summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore15
-rw-r--r--NEWS51
-rw-r--r--callouts/Makefile.am6
-rw-r--r--callouts/nm-avahi-autoipd-action.c2
-rw-r--r--callouts/nm-dispatcher-api.h2
-rw-r--r--callouts/nm-dispatcher-utils.c211
-rw-r--r--callouts/nm-dispatcher.c15
-rw-r--r--callouts/tests/Makefile.am10
-rw-r--r--callouts/tests/dispatcher-down (renamed from callouts/tests/dispatcher-old-down)2
-rw-r--r--callouts/tests/dispatcher-external33
-rw-r--r--callouts/tests/dispatcher-up (renamed from callouts/tests/dispatcher-old-up)3
-rw-r--r--callouts/tests/dispatcher-vpn-down (renamed from callouts/tests/dispatcher-old-vpn-down)3
-rw-r--r--callouts/tests/dispatcher-vpn-up (renamed from callouts/tests/dispatcher-old-vpn-up)3
-rw-r--r--callouts/tests/test-dispatcher-envp.c166
-rw-r--r--clients/cli/Makefile.am22
-rw-r--r--clients/cli/agent.c252
-rw-r--r--clients/cli/agent.h (renamed from src/nm-posix-signals.h)25
-rw-r--r--clients/cli/common.c514
-rw-r--r--clients/cli/common.h29
-rw-r--r--clients/cli/connections.c1161
-rw-r--r--clients/cli/devices.c549
-rw-r--r--clients/cli/general.c99
-rw-r--r--clients/cli/nmcli-completion73
-rw-r--r--clients/cli/nmcli.c52
-rw-r--r--clients/cli/nmcli.h55
-rw-r--r--clients/cli/polkit-agent.c166
-rw-r--r--clients/cli/polkit-agent.h (renamed from src/nm-session-utils.h)22
-rw-r--r--clients/cli/settings.c982
-rw-r--r--clients/cli/settings.h4
-rw-r--r--clients/cli/utils.c266
-rw-r--r--clients/cli/utils.h12
-rw-r--r--clients/common/nm-polkit-listener.c415
-rw-r--r--clients/common/nm-polkit-listener.h104
-rw-r--r--clients/common/nm-secret-agent-simple.c (renamed from clients/tui/nmt-secret-agent.c)413
-rw-r--r--clients/common/nm-secret-agent-simple.h62
-rw-r--r--clients/nm-online.c2
-rw-r--r--clients/tui/Makefile.am17
-rw-r--r--clients/tui/newt/nmt-newt-popup.c19
-rw-r--r--clients/tui/newt/nmt-newt-section.c8
-rw-r--r--clients/tui/nm-editor-bindings.c899
-rw-r--r--clients/tui/nm-editor-bindings.h39
-rw-r--r--clients/tui/nm-editor-utils.c2
-rw-r--r--clients/tui/nmt-connect-connection-list.c35
-rw-r--r--clients/tui/nmt-device-entry.c6
-rw-r--r--clients/tui/nmt-device-entry.h6
-rw-r--r--clients/tui/nmt-editor-grid.c (renamed from clients/tui/nmt-page-grid.c)219
-rw-r--r--clients/tui/nmt-editor-grid.h (renamed from clients/tui/nmt-page-grid.h)38
-rw-r--r--clients/tui/nmt-editor-page-device.c (renamed from clients/tui/nmt-page-device.c)67
-rw-r--r--clients/tui/nmt-editor-page-device.h50
-rw-r--r--clients/tui/nmt-editor-page.c110
-rw-r--r--clients/tui/nmt-editor-page.h20
-rw-r--r--clients/tui/nmt-editor-section.c282
-rw-r--r--clients/tui/nmt-editor-section.h56
-rw-r--r--clients/tui/nmt-editor.c185
-rw-r--r--clients/tui/nmt-page-bond.c35
-rw-r--r--clients/tui/nmt-page-bond.h8
-rw-r--r--clients/tui/nmt-page-bridge-port.c17
-rw-r--r--clients/tui/nmt-page-bridge-port.h2
-rw-r--r--clients/tui/nmt-page-bridge.c37
-rw-r--r--clients/tui/nmt-page-bridge.h8
-rw-r--r--clients/tui/nmt-page-device.h50
-rw-r--r--clients/tui/nmt-page-dsl.c92
-rw-r--r--clients/tui/nmt-page-dsl.h9
-rw-r--r--clients/tui/nmt-page-ethernet.c20
-rw-r--r--clients/tui/nmt-page-ethernet.h8
-rw-r--r--clients/tui/nmt-page-infiniband.c19
-rw-r--r--clients/tui/nmt-page-infiniband.h8
-rw-r--r--clients/tui/nmt-page-ip4.c92
-rw-r--r--clients/tui/nmt-page-ip4.h2
-rw-r--r--clients/tui/nmt-page-ip6.c90
-rw-r--r--clients/tui/nmt-page-ip6.h2
-rw-r--r--clients/tui/nmt-page-main.c328
-rw-r--r--clients/tui/nmt-page-main.h51
-rw-r--r--clients/tui/nmt-page-ppp.c47
-rw-r--r--clients/tui/nmt-page-ppp.h2
-rw-r--r--clients/tui/nmt-page-team-port.c10
-rw-r--r--clients/tui/nmt-page-team-port.h4
-rw-r--r--clients/tui/nmt-page-team.c12
-rw-r--r--clients/tui/nmt-page-team.h8
-rw-r--r--clients/tui/nmt-page-vlan.c23
-rw-r--r--clients/tui/nmt-page-vlan.h8
-rw-r--r--clients/tui/nmt-page-wifi.c63
-rw-r--r--clients/tui/nmt-page-wifi.h8
-rw-r--r--clients/tui/nmt-password-dialog.c14
-rw-r--r--clients/tui/nmt-route-editor.c36
-rw-r--r--clients/tui/nmt-route-entry.c76
-rw-r--r--clients/tui/nmt-route-table.c131
-rw-r--r--clients/tui/nmt-secret-agent.h57
-rw-r--r--clients/tui/nmtui-connect.c40
-rw-r--r--clients/tui/nmtui-edit.c19
-rw-r--r--clients/tui/vpn-helpers.c2
-rw-r--r--configure.ac176
-rw-r--r--contrib/fedora/REQUIRED_PACKAGES45
-rw-r--r--contrib/fedora/rpm/10-ibft-plugin.conf11
-rw-r--r--contrib/fedora/rpm/NetworkManager.spec58
-rwxr-xr-xcontrib/fedora/rpm/build.sh24
-rwxr-xr-xcontrib/fedora/rpm/build_clean.sh8
-rw-r--r--data/77-nm-olpc-mesh.rules (renamed from callouts/77-nm-olpc-mesh.rules)0
-rw-r--r--data/85-nm-unmanaged.rules34
-rw-r--r--data/Makefile.am9
-rw-r--r--data/NetworkManager.service.in1
-rw-r--r--docs/api/Makefile.am10
-rw-r--r--docs/api/settings-spec.xsl2
-rw-r--r--docs/libnm-glib/Makefile.am1
-rw-r--r--docs/libnm-util/Makefile.am7
-rw-r--r--docs/libnm-util/libnm-util-docs.sgml2
-rw-r--r--docs/libnm/Makefile.am21
-rw-r--r--docs/libnm/libnm-docs.xml19
-rw-r--r--examples/C/glib/add-connection-gdbus.c4
-rw-r--r--examples/C/glib/add-connection-libnm.c4
-rw-r--r--examples/C/glib/get-active-connections-gdbus.c2
-rw-r--r--examples/C/glib/get-ap-info-libnm.c2
-rw-r--r--examples/C/glib/list-connections-gdbus.c2
-rw-r--r--examples/C/glib/list-connections-libnm.c2
-rw-r--r--examples/C/glib/monitor-nm-running-gdbus.c2
-rw-r--r--examples/C/glib/monitor-nm-state-gdbus.c2
-rw-r--r--examples/Makefile.am1
-rwxr-xr-xexamples/dispatcher/10-ifcfg-rh-routes.sh34
-rw-r--r--examples/dispatcher/Makefile.am1
-rw-r--r--examples/lua/Makefile.am2
-rw-r--r--examples/lua/lgi/Makefile.am9
-rwxr-xr-xexamples/lua/lgi/add-connection.lua98
-rwxr-xr-xexamples/lua/lgi/change-vpn-username.lua85
-rwxr-xr-xexamples/lua/lgi/deactivate-all.lua82
-rwxr-xr-xexamples/lua/lgi/get-basic-nm-info.lua51
-rwxr-xr-xexamples/lua/lgi/get-ips.lua160
-rwxr-xr-xexamples/lua/lgi/list-connections.lua63
-rwxr-xr-xexamples/lua/lgi/list-devices.lua51
-rwxr-xr-xexamples/lua/lgi/show-wifi-networks.lua79
-rw-r--r--examples/python/dbus/Makefile.am1
-rwxr-xr-xexamples/python/dbus/add-connection-compat.py66
-rwxr-xr-xexamples/python/dbus/add-connection.py24
-rwxr-xr-xexamples/python/dbus/is-wwan-default.py58
-rwxr-xr-xexamples/python/dbus/nm-state.py25
-rwxr-xr-xexamples/python/dbus/update-ip4-method.py31
-rwxr-xr-xexamples/python/dbus/vpn.py4
-rw-r--r--examples/python/gi/Makefile.am3
-rwxr-xr-xexamples/python/gi/add_connection.py22
-rwxr-xr-xexamples/python/gi/deactivate-all.py81
-rwxr-xr-xexamples/python/gi/firewall-zone.py6
-rwxr-xr-xexamples/python/gi/get_ips.py66
-rwxr-xr-xexamples/python/gi/list-connections.py11
-rwxr-xr-xexamples/python/gi/show-wifi-networks.py26
-rwxr-xr-xexamples/python/gi/update-ip4-method.py48
-rwxr-xr-xexamples/ruby/add-connection.rb7
-rwxr-xr-xexamples/shell/active-wifi.sh2
-rwxr-xr-xexamples/shell/disconnect-device.sh4
-rw-r--r--include/gsystem-local-alloc.h57
-rw-r--r--include/nm-dbus-glib-types.h5
-rw-r--r--include/nm-glib-compat.h33
-rw-r--r--include/nm-test-utils.h186
-rw-r--r--include/nm-utils-internal.h78
-rw-r--r--introspection/nm-device-vlan.xml6
-rw-r--r--introspection/nm-device-wifi.xml2
-rw-r--r--introspection/nm-ip4-config.xml40
-rw-r--r--introspection/nm-ip6-config.xml31
-rw-r--r--libnm-core/Makefile.am1
-rw-r--r--libnm-core/Makefile.libnm-core7
-rw-r--r--libnm-core/crypto.c257
-rw-r--r--libnm-core/crypto.h46
-rw-r--r--libnm-core/crypto_gnutls.c83
-rw-r--r--libnm-core/crypto_nss.c80
-rw-r--r--libnm-core/nm-connection.c125
-rw-r--r--libnm-core/nm-connection.h11
-rw-r--r--libnm-core/nm-core-internal.h29
-rw-r--r--libnm-core/nm-core-types.h1
-rw-r--r--libnm-core/nm-dbus-interface.h7
-rw-r--r--libnm-core/nm-errors.c2
-rw-r--r--libnm-core/nm-errors.h12
-rw-r--r--libnm-core/nm-keyfile-internal.h166
-rw-r--r--libnm-core/nm-keyfile-reader.c1656
-rw-r--r--libnm-core/nm-keyfile-utils.c207
-rw-r--r--libnm-core/nm-keyfile-utils.h79
-rw-r--r--libnm-core/nm-keyfile-writer.c751
-rw-r--r--libnm-core/nm-property-compare.c2
-rw-r--r--libnm-core/nm-setting-8021x.c548
-rw-r--r--libnm-core/nm-setting-8021x.h7
-rw-r--r--libnm-core/nm-setting-adsl.c15
-rw-r--r--libnm-core/nm-setting-bluetooth.c7
-rw-r--r--libnm-core/nm-setting-bond.c63
-rw-r--r--libnm-core/nm-setting-bridge-port.c27
-rw-r--r--libnm-core/nm-setting-bridge.c136
-rw-r--r--libnm-core/nm-setting-bridge.h5
-rw-r--r--libnm-core/nm-setting-cdma.c15
-rw-r--r--libnm-core/nm-setting-connection.c146
-rw-r--r--libnm-core/nm-setting-dcb.c129
-rw-r--r--libnm-core/nm-setting-gsm.c15
-rw-r--r--libnm-core/nm-setting-infiniband.c51
-rw-r--r--libnm-core/nm-setting-ip-config.c2363
-rw-r--r--libnm-core/nm-setting-ip-config.h221
-rw-r--r--libnm-core/nm-setting-ip4-config.c2170
-rw-r--r--libnm-core/nm-setting-ip4-config.h111
-rw-r--r--libnm-core/nm-setting-ip6-config.c1891
-rw-r--r--libnm-core/nm-setting-ip6-config.h110
-rw-r--r--libnm-core/nm-setting-olpc-mesh.c13
-rw-r--r--libnm-core/nm-setting-ppp.c4
-rw-r--r--libnm-core/nm-setting-pppoe.c4
-rw-r--r--libnm-core/nm-setting-private.h12
-rw-r--r--libnm-core/nm-setting-serial.c17
-rw-r--r--libnm-core/nm-setting-team-port.c22
-rw-r--r--libnm-core/nm-setting-team.c18
-rw-r--r--libnm-core/nm-setting-vlan.c56
-rw-r--r--libnm-core/nm-setting-vpn.c20
-rw-r--r--libnm-core/nm-setting-wimax.c4
-rw-r--r--libnm-core/nm-setting-wired.c140
-rw-r--r--libnm-core/nm-setting-wireless-security.c177
-rw-r--r--libnm-core/nm-setting-wireless.c180
-rw-r--r--libnm-core/nm-setting-wireless.h3
-rw-r--r--libnm-core/nm-setting.c274
-rw-r--r--libnm-core/nm-setting.h38
-rw-r--r--libnm-core/nm-simple-connection.c4
-rw-r--r--libnm-core/nm-utils-private.h25
-rw-r--r--libnm-core/nm-utils.c1303
-rw-r--r--libnm-core/nm-utils.h62
-rw-r--r--libnm-core/nm-version.h.in31
-rw-r--r--libnm-core/tests/Makefile.am33
-rw-r--r--libnm-core/tests/certs/ca-no-ending-newline.pem (renamed from libnm-util/tests/certs/ca-no-ending-newline.pem)0
-rw-r--r--libnm-core/tests/certs/pkcs8-decrypted.der (renamed from libnm-util/tests/certs/pkcs8-decrypted.der)bin1194 -> 1194 bytes
-rw-r--r--libnm-core/tests/certs/pkcs8-enc-key.pem (renamed from libnm-util/tests/certs/pkcs8-enc-key.pem)0
-rw-r--r--libnm-core/tests/certs/pkcs8-noenc-key.pem (renamed from libnm-util/tests/certs/pkcs8-noenc-key.pem)0
-rw-r--r--libnm-core/tests/certs/test-aes-key.pem (renamed from libnm-util/tests/certs/test-aes-key.pem)0
-rw-r--r--libnm-core/tests/certs/test-ca-cert.pem27
-rw-r--r--libnm-core/tests/certs/test-cert.p12 (renamed from libnm-util/tests/certs/test-cert.p12)bin4092 -> 4092 bytes
-rw-r--r--libnm-core/tests/certs/test-key-and-cert.pem118
-rw-r--r--libnm-core/tests/certs/test-key-only-decrypted.der (renamed from libnm-util/tests/certs/test-key-only-decrypted.der)bin1192 -> 1192 bytes
-rw-r--r--libnm-core/tests/certs/test-key-only-decrypted.pem27
-rw-r--r--libnm-core/tests/certs/test-key-only.pem (renamed from libnm-util/tests/certs/test-key-only.pem)0
-rw-r--r--libnm-core/tests/certs/test2-cert.p12 (renamed from libnm-util/tests/certs/test2-cert.p12)bin4136 -> 4136 bytes
-rw-r--r--libnm-core/tests/certs/test2_ca_cert.pem (renamed from libnm-util/tests/certs/test2_ca_cert.pem)0
-rw-r--r--libnm-core/tests/certs/test2_key_and_cert.pem (renamed from libnm-util/tests/certs/test2_key_and_cert.pem)0
-rw-r--r--libnm-core/tests/certs/test_ca_cert.der (renamed from libnm-util/tests/certs/test_ca_cert.der)bin1162 -> 1162 bytes
-rw-r--r--libnm-core/tests/certs/test_ca_cert.pem (renamed from libnm-util/tests/certs/test_ca_cert.pem)0
-rw-r--r--libnm-core/tests/certs/test_key_and_cert.pem (renamed from libnm-util/tests/certs/test_key_and_cert.pem)0
-rw-r--r--libnm-core/tests/test-compare.c2
-rw-r--r--libnm-core/tests/test-crypto.c332
-rw-r--r--libnm-core/tests/test-general.c1339
-rw-r--r--libnm-core/tests/test-keyfile.c567
-rw-r--r--libnm-core/tests/test-secrets.c13
-rw-r--r--libnm-core/tests/test-setting-8021x.c11
-rw-r--r--libnm-core/tests/test-setting-dcb.c23
-rw-r--r--libnm-core/tests/test-settings-defaults.c9
-rw-r--r--libnm-glib/Makefile.am2
-rw-r--r--libnm-glib/libnm-glib-test.c2
-rw-r--r--libnm-glib/libnm-glib.ver1
-rw-r--r--libnm-glib/libnm_glib.c2
-rw-r--r--libnm-glib/nm-access-point.c3
-rw-r--r--libnm-glib/nm-active-connection.c2
-rw-r--r--libnm-glib/nm-client.c12
-rw-r--r--libnm-glib/nm-dbus-helpers.c3
-rw-r--r--libnm-glib/nm-device-adsl.c2
-rw-r--r--libnm-glib/nm-device-bond.c3
-rw-r--r--libnm-glib/nm-device-bridge.c3
-rw-r--r--libnm-glib/nm-device-bt.c3
-rw-r--r--libnm-glib/nm-device-ethernet.c3
-rw-r--r--libnm-glib/nm-device-generic.c2
-rw-r--r--libnm-glib/nm-device-infiniband.c3
-rw-r--r--libnm-glib/nm-device-modem.c3
-rw-r--r--libnm-glib/nm-device-olpc-mesh.c3
-rw-r--r--libnm-glib/nm-device-team.c3
-rw-r--r--libnm-glib/nm-device-vlan.c41
-rw-r--r--libnm-glib/nm-device-vlan.h5
-rw-r--r--libnm-glib/nm-device-wifi.c3
-rw-r--r--libnm-glib/nm-device-wimax.c3
-rw-r--r--libnm-glib/nm-device.c7
-rw-r--r--libnm-glib/nm-dhcp4-config.c2
-rw-r--r--libnm-glib/nm-dhcp6-config.c2
-rw-r--r--libnm-glib/nm-ip4-config.c2
-rw-r--r--libnm-glib/nm-ip6-config.c2
-rw-r--r--libnm-glib/nm-object-cache.c2
-rw-r--r--libnm-glib/nm-object.c2
-rw-r--r--libnm-glib/nm-remote-connection.c4
-rw-r--r--libnm-glib/nm-remote-settings.c6
-rw-r--r--libnm-glib/nm-secret-agent.c3
-rw-r--r--libnm-glib/nm-secret-agent.h2
-rw-r--r--libnm-glib/nm-types.c2
-rw-r--r--libnm-glib/nm-vpn-connection.c2
-rw-r--r--libnm-glib/nm-vpn-plugin-ui-interface.c2
-rw-r--r--libnm-glib/nm-vpn-plugin-utils.c2
-rw-r--r--libnm-glib/nm-vpn-plugin.c2
-rw-r--r--libnm-glib/nm-wimax-nsp.c3
-rw-r--r--libnm-glib/nm-wimax-nsp.h9
-rw-r--r--libnm-glib/tests/Makefile.am7
-rw-r--r--libnm-glib/tests/common.c2
-rw-r--r--libnm-glib/tests/test-nm-client.c6
-rw-r--r--libnm-glib/tests/test-remote-settings-client.c8
-rw-r--r--libnm-util/Makefile.am25
-rw-r--r--libnm-util/crypto.c2
-rw-r--r--libnm-util/crypto.h2
-rw-r--r--libnm-util/crypto_gnutls.c8
-rw-r--r--libnm-util/crypto_nss.c7
-rw-r--r--libnm-util/libnm-util.ver4
-rw-r--r--libnm-util/nm-connection.c6
-rw-r--r--libnm-util/nm-param-spec-specialized.c2
-rw-r--r--libnm-util/nm-setting-8021x.c354
-rw-r--r--libnm-util/nm-setting-8021x.h2
-rw-r--r--libnm-util/nm-setting-adsl.c15
-rw-r--r--libnm-util/nm-setting-bluetooth.c7
-rw-r--r--libnm-util/nm-setting-bond.c19
-rw-r--r--libnm-util/nm-setting-bridge-port.c30
-rw-r--r--libnm-util/nm-setting-bridge.c81
-rw-r--r--libnm-util/nm-setting-cdma.c15
-rw-r--r--libnm-util/nm-setting-connection.c117
-rw-r--r--libnm-util/nm-setting-dcb.c144
-rw-r--r--libnm-util/nm-setting-gsm.c15
-rw-r--r--libnm-util/nm-setting-infiniband.c56
-rw-r--r--libnm-util/nm-setting-ip4-config.c177
-rw-r--r--libnm-util/nm-setting-ip4-config.h4
-rw-r--r--libnm-util/nm-setting-ip6-config.c155
-rw-r--r--libnm-util/nm-setting-ip6-config.h4
-rw-r--r--libnm-util/nm-setting-olpc-mesh.c4
-rw-r--r--libnm-util/nm-setting-ppp.c4
-rw-r--r--libnm-util/nm-setting-pppoe.c4
-rw-r--r--libnm-util/nm-setting-serial.c12
-rw-r--r--libnm-util/nm-setting-team-port.c23
-rw-r--r--libnm-util/nm-setting-team.c18
-rw-r--r--libnm-util/nm-setting-template.c2
-rw-r--r--libnm-util/nm-setting-vlan.c55
-rw-r--r--libnm-util/nm-setting-vpn.c22
-rw-r--r--libnm-util/nm-setting-wimax.c4
-rw-r--r--libnm-util/nm-setting-wired.c142
-rw-r--r--libnm-util/nm-setting-wireless-security.c191
-rw-r--r--libnm-util/nm-setting-wireless.c177
-rw-r--r--libnm-util/nm-setting-wireless.h3
-rw-r--r--libnm-util/nm-setting.c10
-rw-r--r--libnm-util/nm-utils.c172
-rw-r--r--libnm-util/nm-utils.h10
-rw-r--r--libnm-util/nm-version.h.in31
-rw-r--r--libnm-util/tests/Makefile.am5
-rw-r--r--libnm-util/tests/certs/Makefile.am25
-rw-r--r--libnm-util/tests/test-crypto.c14
-rw-r--r--libnm-util/tests/test-general.c77
-rw-r--r--libnm-util/tests/test-libnm-linking.c2
-rw-r--r--libnm-util/tests/test-secrets.c26
-rw-r--r--libnm-util/tests/test-setting-8021x.c5
-rw-r--r--libnm-util/tests/test-setting-dcb.c13
-rw-r--r--libnm-util/tests/test-settings-defaults.c2
-rw-r--r--libnm/Makefile.am63
-rw-r--r--libnm/NetworkManager.h9
-rwxr-xr-xlibnm/generate-plugin-docs.pl (renamed from libnm-util/generate-plugin-docs.pl)8
-rwxr-xr-xlibnm/generate-setting-docs.py (renamed from libnm-util/generate-setting-docs.py)139
-rw-r--r--libnm/libnm.pc.in2
-rw-r--r--libnm/libnm.ver285
-rw-r--r--libnm/nm-access-point.c6
-rw-r--r--libnm/nm-active-connection.c64
-rw-r--r--libnm/nm-active-connection.h8
-rw-r--r--libnm/nm-client.c27
-rw-r--r--libnm/nm-dbus-helpers.c4
-rw-r--r--libnm/nm-device-adsl.c4
-rw-r--r--libnm/nm-device-bond.c5
-rw-r--r--libnm/nm-device-bridge.c5
-rw-r--r--libnm/nm-device-bt.c5
-rw-r--r--libnm/nm-device-ethernet.c5
-rw-r--r--libnm/nm-device-generic.c4
-rw-r--r--libnm/nm-device-infiniband.c5
-rw-r--r--libnm/nm-device-modem.c5
-rw-r--r--libnm/nm-device-olpc-mesh.c5
-rw-r--r--libnm/nm-device-team.c5
-rw-r--r--libnm/nm-device-vlan.c38
-rw-r--r--libnm/nm-device-vlan.h4
-rw-r--r--libnm/nm-device-wifi.c5
-rw-r--r--libnm/nm-device-wimax.c5
-rw-r--r--libnm/nm-device.c112
-rw-r--r--libnm/nm-device.h8
-rw-r--r--libnm/nm-dhcp-config.c222
-rw-r--r--libnm/nm-dhcp-config.h62
-rw-r--r--libnm/nm-dhcp4-config.c150
-rw-r--r--libnm/nm-dhcp4-config.h23
-rw-r--r--libnm/nm-dhcp6-config.c150
-rw-r--r--libnm/nm-dhcp6-config.h23
-rw-r--r--libnm/nm-ip-config.c502
-rw-r--r--libnm/nm-ip-config.h73
-rw-r--r--libnm/nm-ip4-config.c378
-rw-r--r--libnm/nm-ip4-config.h30
-rw-r--r--libnm/nm-ip6-config.c342
-rw-r--r--libnm/nm-ip6-config.h28
-rw-r--r--libnm/nm-manager.c52
-rw-r--r--libnm/nm-object-cache.c2
-rw-r--r--libnm/nm-object.c65
-rw-r--r--libnm/nm-remote-connection.c4
-rw-r--r--libnm/nm-remote-settings.c4
-rw-r--r--libnm/nm-secret-agent-old.c (renamed from libnm/nm-secret-agent.c)420
-rw-r--r--libnm/nm-secret-agent-old.h (renamed from libnm/nm-secret-agent.h)188
-rw-r--r--libnm/nm-types.h7
-rw-r--r--libnm/nm-vpn-connection.c2
-rw-r--r--libnm/nm-vpn-editor-plugin.c181
-rw-r--r--libnm/nm-vpn-editor-plugin.h189
-rw-r--r--libnm/nm-vpn-plugin-old.c4
-rw-r--r--libnm/nm-vpn-plugin-ui-interface.c244
-rw-r--r--libnm/nm-vpn-plugin-ui-interface.h206
-rw-r--r--libnm/nm-wimax-nsp.c3
-rw-r--r--libnm/nm-wimax-nsp.h9
-rw-r--r--libnm/tests/Makefile.am8
-rw-r--r--libnm/tests/common.c2
-rw-r--r--libnm/tests/test-nm-client.c10
-rw-r--r--libnm/tests/test-remote-settings-client.c8
-rw-r--r--libnm/tests/test-secret-agent.c111
-rw-r--r--m4/ax_lib_readline.m42
-rw-r--r--m4/compiler_warnings.m486
-rw-r--r--man/Makefile.am47
-rw-r--r--man/NetworkManager.conf.xml.in156
-rw-r--r--man/NetworkManager.xml68
-rw-r--r--man/nm-settings-ifcfg-rh.xsl20
-rw-r--r--man/nm-settings.xsl2
-rw-r--r--man/nmcli-examples.xml50
-rw-r--r--man/nmcli.1.in116
-rw-r--r--man/nmtui.1.in66
-rw-r--r--po/POTFILES.in13
-rw-r--r--po/POTFILES.skip1
-rw-r--r--po/de.po51
-rw-r--r--po/gu.po58
-rw-r--r--po/pl.po5783
-rw-r--r--po/ru.po7660
-rw-r--r--po/sv.po4947
-rw-r--r--po/ta.po5087
-rw-r--r--po/te.po1
-rw-r--r--po/tr.po8445
-rw-r--r--po/uk.po6183
-rw-r--r--src/Makefile.am241
-rw-r--r--src/NetworkManagerUtils.c604
-rw-r--r--src/NetworkManagerUtils.h36
-rw-r--r--src/devices/adsl/nm-atm-manager.c3
-rw-r--r--src/devices/adsl/nm-device-adsl.c6
-rw-r--r--src/devices/bluetooth/nm-bluez-device.c29
-rw-r--r--src/devices/bluetooth/nm-bluez-manager.c2
-rw-r--r--src/devices/bluetooth/nm-bluez4-adapter.c2
-rw-r--r--src/devices/bluetooth/nm-bluez4-manager.c2
-rw-r--r--src/devices/bluetooth/nm-bluez5-dun.c3
-rw-r--r--src/devices/bluetooth/nm-bluez5-manager.c2
-rw-r--r--src/devices/bluetooth/nm-bt-error.c2
-rw-r--r--src/devices/bluetooth/nm-device-bt.c19
-rw-r--r--src/devices/nm-device-bond.c24
-rw-r--r--src/devices/nm-device-bridge.c6
-rw-r--r--src/devices/nm-device-ethernet-utils.c2
-rw-r--r--src/devices/nm-device-ethernet.c43
-rw-r--r--src/devices/nm-device-factory.c2
-rw-r--r--src/devices/nm-device-gre.c1
-rw-r--r--src/devices/nm-device-logging.h1
-rw-r--r--src/devices/nm-device-private.h8
-rw-r--r--src/devices/nm-device-veth.c1
-rw-r--r--src/devices/nm-device-vlan.c52
-rw-r--r--src/devices/nm-device-vlan.h4
-rw-r--r--src/devices/nm-device.c1928
-rw-r--r--src/devices/nm-device.h94
-rw-r--r--src/devices/team/nm-device-team.c109
-rw-r--r--src/devices/team/nm-team-factory.c3
-rw-r--r--src/devices/wifi/Makefile.am2
-rw-r--r--src/devices/wifi/nm-device-olpc-mesh.c3
-rw-r--r--src/devices/wifi/nm-device-wifi.c135
-rw-r--r--src/devices/wifi/nm-wifi-ap-utils.c3
-rw-r--r--src/devices/wifi/nm-wifi-ap.c237
-rw-r--r--src/devices/wifi/nm-wifi-ap.h2
-rw-r--r--src/devices/wifi/nm-wifi-factory.c2
-rw-r--r--src/devices/wifi/tests/Makefile.am1
-rw-r--r--src/devices/wifi/tests/test-wifi-ap-utils.c5
-rw-r--r--src/devices/wimax/iwmxsdk.c4
-rw-r--r--src/devices/wimax/nm-device-wimax.c33
-rw-r--r--src/devices/wimax/nm-wimax-factory.c2
-rw-r--r--src/devices/wimax/nm-wimax-nsp.c2
-rw-r--r--src/devices/wimax/nm-wimax-util.c2
-rw-r--r--src/devices/wwan/nm-device-modem.c78
-rw-r--r--src/devices/wwan/nm-modem-broadband.c402
-rw-r--r--src/devices/wwan/nm-modem.c324
-rw-r--r--src/devices/wwan/nm-modem.h24
-rw-r--r--src/devices/wwan/nm-wwan-factory.c3
-rw-r--r--src/devices/wwan/wwan-exports.ver2
-rw-r--r--src/dhcp-manager/nm-dhcp-client.c109
-rw-r--r--src/dhcp-manager/nm-dhcp-client.h46
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient-utils.c171
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient-utils.h8
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient.c113
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient.h6
-rw-r--r--src/dhcp-manager/nm-dhcp-dhcpcd.c52
-rw-r--r--src/dhcp-manager/nm-dhcp-dhcpcd.h2
-rw-r--r--src/dhcp-manager/nm-dhcp-helper.c2
-rw-r--r--src/dhcp-manager/nm-dhcp-listener.c282
-rw-r--r--src/dhcp-manager/nm-dhcp-listener.h39
-rw-r--r--src/dhcp-manager/nm-dhcp-manager.c413
-rw-r--r--src/dhcp-manager/nm-dhcp-manager.h12
-rw-r--r--src/dhcp-manager/nm-dhcp-systemd.c848
-rw-r--r--src/dhcp-manager/nm-dhcp-systemd.h45
-rw-r--r--src/dhcp-manager/nm-dhcp-utils.c63
-rw-r--r--src/dhcp-manager/nm-dhcp-utils.h8
-rw-r--r--src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c209
-rw-r--r--src/dhcp-manager/systemd-dhcp/nm-sd-adapt.h113
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c13
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h1
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-lease-internal.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-option.c2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-protocol.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-internal.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-lease-internal.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-network.c2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-option.c2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-protocol.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.c10
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.h4
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c4
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-lease.c4
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c7
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-lease.c2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/libsystemd/sd-id128/sd-id128.c6
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/async.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/fileio.c6
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/fileio.h3
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.c2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/list.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/log.h4
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/macro.h12
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/path-util.c8
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/path-util.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/refcnt.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/siphash24.c3
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/siphash24.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/socket-util.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/sparse-endian.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/strv.c4
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/strv.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/time-util.c8
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/time-util.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/unaligned.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/utf8.c2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/utf8.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/util.c56
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/shared/util.h10
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/systemd/_sd-common.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-client.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-lease.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-client.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-lease.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/systemd/sd-event.h2
-rw-r--r--src/dhcp-manager/systemd-dhcp/src/systemd/sd-id128.h2
-rw-r--r--src/dhcp-manager/tests/Makefile.am17
-rw-r--r--src/dhcp-manager/tests/test-dhcp-dhclient.c203
-rw-r--r--src/dhcp-manager/tests/test-dhcp-utils.c (renamed from src/dhcp-manager/tests/test-dhcp-options.c)73
-rw-r--r--src/dns-manager/nm-dns-dnsmasq.c3
-rw-r--r--src/dns-manager/nm-dns-manager.c219
-rw-r--r--src/dns-manager/nm-dns-plugin.c22
-rw-r--r--src/dns-manager/nm-dns-unbound.c2
-rw-r--r--src/dns-manager/nm-dns-utils.c2
-rw-r--r--src/dnsmasq-manager/nm-dnsmasq-manager.c24
-rw-r--r--src/dnsmasq-manager/nm-dnsmasq-utils.c3
-rw-r--r--src/dnsmasq-manager/tests/Makefile.am1
-rw-r--r--src/dnsmasq-manager/tests/test-dnsmasq-utils.c2
-rw-r--r--src/main-utils.c259
-rw-r--r--src/main-utils.h49
-rw-r--r--src/main.c509
-rw-r--r--src/nm-activation-request.c13
-rw-r--r--src/nm-active-connection.c3
-rw-r--r--src/nm-auth-manager.c32
-rw-r--r--src/nm-auth-subject.c5
-rw-r--r--src/nm-auth-utils.c24
-rw-r--r--src/nm-auth-utils.h1
-rw-r--r--src/nm-config-data.c427
-rw-r--r--src/nm-config-data.h95
-rw-r--r--src/nm-config.c858
-rw-r--r--src/nm-config.h48
-rw-r--r--src/nm-connection-provider.c2
-rw-r--r--src/nm-connectivity.c321
-rw-r--r--src/nm-connectivity.h6
-rw-r--r--src/nm-dbus-manager.c37
-rw-r--r--src/nm-dbus-manager.h1
-rw-r--r--src/nm-dcb.c6
-rw-r--r--src/nm-default-route-manager.c1412
-rw-r--r--src/nm-default-route-manager.h74
-rw-r--r--src/nm-dhcp4-config.c2
-rw-r--r--src/nm-dhcp6-config.c2
-rw-r--r--src/nm-dispatcher.c17
-rw-r--r--src/nm-firewall-manager.c (renamed from src/firewall-manager/nm-firewall-manager.c)164
-rw-r--r--src/nm-firewall-manager.h (renamed from src/firewall-manager/nm-firewall-manager.h)25
-rw-r--r--src/nm-iface-helper.c556
-rw-r--r--src/nm-ip4-config.c627
-rw-r--r--src/nm-ip4-config.h19
-rw-r--r--src/nm-ip6-config.c556
-rw-r--r--src/nm-ip6-config.h18
-rw-r--r--src/nm-logging.c17
-rw-r--r--src/nm-logging.h10
-rw-r--r--src/nm-manager.c233
-rw-r--r--src/nm-manager.h2
-rw-r--r--src/nm-policy.c464
-rw-r--r--src/nm-posix-signals.c62
-rw-r--r--src/nm-properties-changed-signal.c13
-rw-r--r--src/nm-rfkill-manager.c2
-rw-r--r--src/nm-route-manager.c376
-rw-r--r--src/nm-route-manager.h51
-rw-r--r--src/nm-session-monitor-ck.c502
-rw-r--r--src/nm-session-monitor-null.c168
-rw-r--r--src/nm-session-monitor-systemd.c267
-rw-r--r--src/nm-session-monitor.c443
-rw-r--r--src/nm-session-monitor.h24
-rw-r--r--src/nm-session-utils.c68
-rw-r--r--src/nm-sleep-monitor-systemd.c66
-rw-r--r--src/nm-sleep-monitor-upower.c13
-rw-r--r--src/nm-types.h51
-rw-r--r--src/org.freedesktop.NetworkManager.conf1
-rw-r--r--src/platform/nm-fake-platform.c248
-rw-r--r--src/platform/nm-linux-platform.c572
-rw-r--r--src/platform/nm-platform.c363
-rw-r--r--src/platform/nm-platform.h139
-rw-r--r--src/platform/tests/Makefile.am2
-rw-r--r--src/platform/tests/dump.c6
-rw-r--r--src/platform/tests/monitor.c2
-rw-r--r--src/platform/tests/platform.c9
-rw-r--r--src/platform/tests/test-address.c4
-rw-r--r--src/platform/tests/test-cleanup.c18
-rw-r--r--src/platform/tests/test-common.c111
-rw-r--r--src/platform/tests/test-common.h5
-rw-r--r--src/platform/tests/test-link.c12
-rw-r--r--src/platform/tests/test-route.c111
-rw-r--r--src/platform/wifi/wifi-utils-nl80211.c67
-rw-r--r--src/platform/wifi/wifi-utils-nl80211.h2
-rw-r--r--src/platform/wifi/wifi-utils-private.h3
-rw-r--r--src/platform/wifi/wifi-utils-wext.c28
-rw-r--r--src/platform/wifi/wifi-utils.c23
-rw-r--r--src/platform/wifi/wifi-utils.h4
-rw-r--r--src/ppp-manager/nm-ppp-manager.c141
-rw-r--r--src/ppp-manager/nm-ppp-manager.h8
-rw-r--r--src/ppp-manager/nm-pppd-plugin.c3
-rw-r--r--src/rdisc/nm-fake-rdisc.c2
-rw-r--r--src/rdisc/nm-lndp-rdisc.c3
-rw-r--r--src/rdisc/nm-rdisc.c34
-rw-r--r--src/rdisc/nm-rdisc.h2
-rw-r--r--src/rdisc/tests/rdisc.c2
-rw-r--r--src/settings/nm-agent-manager.c128
-rw-r--r--src/settings/nm-inotify-helper.c45
-rw-r--r--src/settings/nm-secret-agent.c5
-rw-r--r--src/settings/nm-settings-connection.c182
-rw-r--r--src/settings/nm-settings-connection.h22
-rw-r--r--src/settings/nm-settings.c83
-rw-r--r--src/settings/nm-settings.h11
-rw-r--r--src/settings/nm-system-config-interface.c2
-rw-r--r--src/settings/plugins/example/nm-example-connection.c3
-rw-r--r--src/settings/plugins/example/plugin.c5
-rw-r--r--src/settings/plugins/example/reader.c3
-rw-r--r--src/settings/plugins/example/writer.c3
-rw-r--r--src/settings/plugins/ibft/nm-ibft-connection.c3
-rw-r--r--src/settings/plugins/ibft/plugin.c3
-rw-r--r--src/settings/plugins/ibft/reader.c93
-rw-r--r--src/settings/plugins/ibft/tests/Makefile.am1
-rw-r--r--src/settings/plugins/ibft/tests/test-ibft.c53
-rw-r--r--src/settings/plugins/ifcfg-rh/common.h4
-rw-r--r--src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c215
-rw-r--r--src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h8
-rw-r--r--src/settings/plugins/ifcfg-rh/plugin.c570
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c782
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.h17
-rw-r--r--src/settings/plugins/ifcfg-rh/shvar.c30
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/Makefile.am1
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am6
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-mode-numeric5
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main4
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-trailing-spaces11
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open2
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-plus-ip6
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-12
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-23
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-obsolete-gateway-n13
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-shared-plus-ip19
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c4
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c4596
-rw-r--r--src/settings/plugins/ifcfg-rh/utils.c73
-rw-r--r--src/settings/plugins/ifcfg-rh/utils.h8
-rw-r--r--src/settings/plugins/ifcfg-rh/writer.c341
-rw-r--r--src/settings/plugins/ifcfg-suse/plugin.c3
-rw-r--r--src/settings/plugins/ifnet/connection_parser.c393
-rw-r--r--src/settings/plugins/ifnet/net_parser.c8
-rw-r--r--src/settings/plugins/ifnet/net_utils.c126
-rw-r--r--src/settings/plugins/ifnet/net_utils.h22
-rw-r--r--src/settings/plugins/ifnet/nm-ifnet-connection.c3
-rw-r--r--src/settings/plugins/ifnet/plugin.c23
-rw-r--r--src/settings/plugins/ifnet/tests/test_all.c40
-rw-r--r--src/settings/plugins/ifnet/wpa_parser.c2
-rw-r--r--src/settings/plugins/ifupdown/interface_parser.c1
-rw-r--r--src/settings/plugins/ifupdown/nm-ifupdown-connection.c2
-rw-r--r--src/settings/plugins/ifupdown/parser.c124
-rw-r--r--src/settings/plugins/ifupdown/plugin.c10
-rw-r--r--src/settings/plugins/ifupdown/tests/Makefile.am2
-rw-r--r--src/settings/plugins/ifupdown/tests/test-ifupdown.c178
-rw-r--r--src/settings/plugins/keyfile/common.h4
-rw-r--r--src/settings/plugins/keyfile/nm-keyfile-connection.c66
-rw-r--r--src/settings/plugins/keyfile/nm-keyfile-connection.h3
-rw-r--r--src/settings/plugins/keyfile/plugin.c414
-rw-r--r--src/settings/plugins/keyfile/reader.c1363
-rw-r--r--src/settings/plugins/keyfile/tests/Makefile.am1
-rw-r--r--src/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Main3
-rw-r--r--src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Blob4
-rw-r--r--src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Old6
-rw-r--r--src/settings/plugins/keyfile/tests/test-keyfile.c653
-rw-r--r--src/settings/plugins/keyfile/utils.c225
-rw-r--r--src/settings/plugins/keyfile/utils.h58
-rw-r--r--src/settings/plugins/keyfile/writer.c920
-rw-r--r--src/settings/plugins/keyfile/writer.h1
-rw-r--r--src/supplicant-manager/nm-call-store.c117
-rw-r--r--src/supplicant-manager/nm-call-store.h41
-rw-r--r--src/supplicant-manager/nm-supplicant-config.c130
-rw-r--r--src/supplicant-manager/nm-supplicant-config.h2
-rw-r--r--src/supplicant-manager/nm-supplicant-interface.c1499
-rw-r--r--src/supplicant-manager/nm-supplicant-interface.h6
-rw-r--r--src/supplicant-manager/nm-supplicant-manager.c273
-rw-r--r--src/supplicant-manager/nm-supplicant-manager.h9
-rw-r--r--src/supplicant-manager/nm-supplicant-settings-verify.c2
-rw-r--r--src/supplicant-manager/nm-supplicant-types.h4
-rw-r--r--src/supplicant-manager/tests/Makefile.am1
-rw-r--r--src/supplicant-manager/tests/test-supplicant-config.c250
-rw-r--r--src/tests/Makefile.am33
-rw-r--r--src/tests/config/Makefile.am1
-rw-r--r--src/tests/config/nm-test-device.c12
-rw-r--r--src/tests/config/test-config.c152
-rw-r--r--src/tests/test-dcb.c2
-rw-r--r--src/tests/test-general-with-expect.c8
-rw-r--r--src/tests/test-general.c334
-rw-r--r--src/tests/test-ip4-config.c12
-rw-r--r--src/tests/test-ip6-config.c12
-rw-r--r--src/tests/test-resolvconf-capture.c3
-rw-r--r--src/tests/test-route-manager.c681
-rw-r--r--src/tests/test-wired-defname.c11
-rw-r--r--src/vpn-manager/nm-vpn-connection.c1043
-rw-r--r--src/vpn-manager/nm-vpn-connection.h11
-rw-r--r--src/vpn-manager/nm-vpn-manager.c16
-rw-r--r--src/vpn-manager/nm-vpn-service.c30
-rwxr-xr-xtools/check-exports.sh57
-rwxr-xr-xtools/run-test-valgrind.sh20
-rwxr-xr-xtools/test-networkmanager-service.py26
-rw-r--r--valgrind.suppressions250
-rw-r--r--vapi/NMClient-1.0.metadata12
-rw-r--r--vapi/NetworkManager-1.0.metadata12
729 files changed, 68248 insertions, 41321 deletions
diff --git a/.gitignore b/.gitignore
index 86209c29bc..397524e3f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -143,6 +143,7 @@ valgrind-*.log
/libnm-core/tests/test-crypto
/libnm-core/tests/test-settings-defaults
/libnm-core/tests/test-general
+/libnm-core/tests/test-keyfile
/libnm-core/tests/test-need-secrets
/libnm-core/tests/test-secrets
/libnm-core/tests/test-setting-8021x
@@ -152,9 +153,6 @@ valgrind-*.log
/libnm-glib/tests/test-nm-client
/libnm-glib/tests/test-remote-settings-client
-/libnm-util/nm-ifcfg-rh-docs.xml
-/libnm-util/nm-keyfile-docs.xml
-/libnm-util/nm-setting-docs.xml
/libnm-util/nm-version.h
/libnm-util/test-crypto
/libnm-util/tests/test-crypto
@@ -166,6 +164,11 @@ valgrind-*.log
/libnm-util/tests/test-setting-8021x
/libnm-util/tests/test-setting-dcb
+/libnm/nm-ifcfg-rh-docs.xml
+/libnm/nm-keyfile-docs.xml
+/libnm/nm-property-docs.xml
+/libnm/nm-setting-docs.xml
+/libnm/nm-setting-docs-overrides.xml
/libnm/tests/test-nm-client
/libnm/tests/test-remote-settings-client
/libnm/tests/test-secret-agent
@@ -230,10 +233,10 @@ valgrind-*.log
/src/dhcp-manager/nm-dhcp-helper
/src/dhcp-manager/tests/test-dhcp-dhclient
/src/dhcp-manager/tests/test-dhcp-options
+/src/dhcp-manager/tests/test-dhcp-utils
/src/dnsmasq-manager/tests/test-dnsmasq-utils
+/src/nm-iface-helper
/src/settings/plugins/ibft/tests/test-ibft
-/src/settings/plugins/ifcfg-rh/tests/network-scripts/*-Test_Write_*
-/src/settings/plugins/ifcfg-rh/tests/network-scripts/Test_Write_*
/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh
/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils
/src/settings/plugins/ifnet/tests/check_ifnet
@@ -247,6 +250,8 @@ valgrind-*.log
/src/tests/test-ip4-config
/src/tests/test-ip6-config
/src/tests/test-resolvconf-capture
+/src/tests/test-route-manager-fake
+/src/tests/test-route-manager-linux
/src/tests/test-wired-defname
/vapi/*.vapi
diff --git a/NEWS b/NEWS
index d2121a7004..784adcd216 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,52 @@
+===============================================
+NetworkManager-1.0
+Overview of changes since NetworkManager-0.9.10
+===============================================
+
+This is a new stable release of NetworkManager. Notable changes include:
+
+* A new 'libnm' GObject-based client library to replace libnm-util/libnm-glib
+ - IP address, IP route, hardware address, and other properties are now
+ represented as strings
+ - Based on GIO's GDBus bindings instead of dbus-glib
+ - Uses modern GObject APIs including GAsyncResult and GVariant
+ - For more information see https://wiki.gnome.org/Projects/NetworkManager/libnm
+* Devices and VPN connections now have individual default routes. Priorities
+ are handled through configurable route metrics.
+* nmcli now supports password requests and PolicyKit authorizations
+* A faster, lighter-weight (though less capable) internal DHCP client has been
+ added and may be selected with the "dhcp=internal" option. It supports
+ fewer DHCP options and does not yet support DHCPv6.
+* A new 'configure-and-quit=yes' option has been added for environments with
+ less dynamic network configuration
+* When running on 3.17 and later kernels, NetworkManager handles IPv6LL address
+ assignment to ensure that IPv6 connectivity is not enabled until
+ intentionally configured by the user
+* NetworkManager no longer causes the nl80211 kernel module to be loaded on
+ systems with no Wi-Fi devices
+* Bluetooth DUN support now works with Bluez 5.x
+* VPN connections can now persist across link changes and suspend/resume if
+ their VPN plugin supports this feature
+* A new 'ibft' settings plugin has been added to support firmware-based
+ iBFT/iSCSI configurations. This functionality has been moved to 'ibft'
+ from the 'ifcfg-rh' plugin.
+* IPv6 router advertisement MTUs are now respected
+* NetworkManager no longer requires polkit libraries at runtime when Polkit
+ support is enabled, and Polkit can be disabled at build time too
+* Automatically created connections are now deleted when their device goes away
+* 'nmcli dev connect' now attemts to create a connection if none exists
+* Manually configured static IPv6 configuration is kept even if SLAAC fails
+* Manpages for the 'keyfile' and 'ifcfg-rh' plugins now describe their
+ configuration syntax and available options
+* WWAN connections now support IPv6 if the modem and provider support IPv6
+* Software devices (bridge, bond, team, etc) can now be deleted from the D-Bus
+ API or with nmcli
+* The manpages, documentation, and API annotations have received many cleanups
+* Externally created virtual interfaces are no longer managed by NetworkManager
+ until they are set "up" or activated via nmcli
+* Team device support is now an optional plugin
+
+
==============================================
NetworkManager-0.9.10
Overview of changes since NetworkManager-0.9.8
@@ -41,7 +90,7 @@ This is a new stable release of NetworkManager. Notable changes include:
* The dispatcher timeout has increased to 10 minutes, and new "pre-up" and
"pre-down" events have been added which block activation until complete
* NetworkManager no longer prevents Wake-on-LAN functionality from working
-* PPPoE now requires userland "rp-pppoe" to work around kernel bugs with
+* PPPoE now requires userland "rp-pppoe" to work around kernel bugs
that prevent detecting server-side termination of the PPP link
* An ARP announcement is now sent after IPv4 addresses are configured
* Added a DNS plugin for dnssec-trigger for better DNSSEC operation
diff --git a/callouts/Makefile.am b/callouts/Makefile.am
index f682579e91..cc38e01a82 100644
--- a/callouts/Makefile.am
+++ b/callouts/Makefile.am
@@ -87,11 +87,6 @@ libtest_dispatcher_envp_la_LIBADD = \
$(GLIB_LIBS)
-if WITH_UDEV_DIR
-udevrulesdir = $(UDEV_DIR)/rules.d
-udevrules_DATA = 77-nm-olpc-mesh.rules
-endif
-
dbusactivationdir = $(datadir)/dbus-1/system-services
dbusactivation_in_files = org.freedesktop.nm_dispatcher.service.in
dbusactivation_DATA = $(dbusactivation_in_files:.service.in=.service)
@@ -115,7 +110,6 @@ CLEANFILES = $(nodist_libnmdbus_dispatcher_la_SOURCES) $(dbusactivation_DATA)
EXTRA_DIST = \
$(dbusservice_DATA) \
- $(udevrules_DATA) \
$(dbusactivation_in_files) \
nm-dispatcher.xml
diff --git a/callouts/nm-avahi-autoipd-action.c b/callouts/nm-avahi-autoipd-action.c
index 48969df1b9..b28dae5d21 100644
--- a/callouts/nm-avahi-autoipd-action.c
+++ b/callouts/nm-avahi-autoipd-action.c
@@ -18,6 +18,8 @@
* Copyright 2008, 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
diff --git a/callouts/nm-dispatcher-api.h b/callouts/nm-dispatcher-api.h
index df1bced456..71410939cb 100644
--- a/callouts/nm-dispatcher-api.h
+++ b/callouts/nm-dispatcher-api.h
@@ -31,6 +31,8 @@
#define NM_DISPATCHER_DBUS_PATH "/org/freedesktop/nm_dispatcher"
#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 66b6a07fd8..365e7e2969 100644
--- a/callouts/nm-dispatcher-utils.c
+++ b/callouts/nm-dispatcher-utils.c
@@ -18,7 +18,8 @@
* Copyright (C) 2008 - 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <glib-object.h>
@@ -52,6 +53,37 @@ construct_basic_items (GSList *list,
return list;
}
+static GSList *_list_append_val_strv (GSList *items, char **values, const char *format, ...) G_GNUC_PRINTF(3, 4);
+
+static GSList *
+_list_append_val_strv (GSList *items, char **values, const char *format, ...)
+{
+ if (!values)
+ g_return_val_if_reached (items);
+
+ /* Only add an item if the list of @values is not empty */
+ if (values[0]) {
+ va_list args;
+ guint i;
+ GString *str = g_string_new (NULL);
+
+ va_start (args, format);
+ g_string_append_vprintf (str, format, args);
+ va_end (args);
+
+ g_string_append (str, values[0]);
+ for (i = 1; values[i]; i++) {
+ g_string_append_c (str, ' ');
+ g_string_append (str, values[i]);
+ }
+ items = g_slist_prepend (items, g_string_free (str, FALSE));
+ }
+
+ /* we take ownership of the values array and free it. */
+ g_strfreev (values);
+ return items;
+}
+
static GSList *
add_domains (GSList *items,
GVariant *dict,
@@ -59,32 +91,14 @@ add_domains (GSList *items,
const char four_or_six)
{
GVariant *val;
- char **domains = NULL;
- GString *tmp;
- guint i;
/* Search domains */
val = g_variant_lookup_value (dict, "domains", G_VARIANT_TYPE_STRING_ARRAY);
- if (!val)
- return items;
-
- domains = g_variant_dup_strv (val, NULL);
- g_variant_unref (val);
- if (!domains[0]) {
- g_strfreev (domains);
- return items;
- }
-
- tmp = g_string_new (NULL);
- g_string_append_printf (tmp, "%sIP%c_DOMAINS=", prefix, four_or_six);
- for (i = 0; domains[i]; i++) {
- if (i > 0)
- g_string_append_c (tmp, ' ');
- g_string_append (tmp, domains[i]);
+ if (val) {
+ items = _list_append_val_strv (items, g_variant_dup_strv (val, NULL),
+ "%sIP%c_DOMAINS=", prefix, four_or_six);
+ g_variant_unref (val);
}
- items = g_slist_prepend (items, g_string_free (tmp, FALSE));
-
- g_strfreev (domains);
return items;
}
@@ -92,11 +106,8 @@ static GSList *
construct_ip4_items (GSList *items, GVariant *ip4_config, const char *prefix)
{
GPtrArray *addresses, *routes;
- char **dns, **wins;
- GString *tmp;
+ char *gateway;
GVariant *val;
- char str_addr[INET_ADDRSTRLEN];
- char str_gw[INET_ADDRSTRLEN];
int i;
if (ip4_config == NULL)
@@ -108,42 +119,36 @@ construct_ip4_items (GSList *items, GVariant *ip4_config, const char *prefix)
/* IP addresses */
val = g_variant_lookup_value (ip4_config, "addresses", G_VARIANT_TYPE ("aau"));
if (val) {
- addresses = nm_utils_ip4_addresses_from_variant (val);
+ addresses = nm_utils_ip4_addresses_from_variant (val, &gateway);
+ if (!gateway)
+ gateway = g_strdup ("0.0.0.0");
for (i = 0; i < addresses->len; i++) {
- NMIP4Address *addr = addresses->pdata[i];
- guint32 ip_prefix = nm_ip4_address_get_prefix (addr);
+ NMIPAddress *addr = addresses->pdata[i];
char *addrtmp;
- nm_utils_inet4_ntop (nm_ip4_address_get_address (addr), str_addr);
- nm_utils_inet4_ntop (nm_ip4_address_get_gateway (addr), str_gw);
-
- addrtmp = g_strdup_printf ("%sIP4_ADDRESS_%d=%s/%d %s", prefix, i, str_addr, ip_prefix, str_gw);
+ addrtmp = g_strdup_printf ("%sIP4_ADDRESS_%d=%s/%d %s", prefix, i,
+ nm_ip_address_get_address (addr),
+ nm_ip_address_get_prefix (addr),
+ gateway);
items = g_slist_prepend (items, addrtmp);
}
if (addresses->len)
items = g_slist_prepend (items, g_strdup_printf ("%sIP4_NUM_ADDRESSES=%d", prefix, addresses->len));
+
+ /* Write gateway to a separate variable, too. */
+ items = g_slist_prepend (items, g_strdup_printf ("%sIP4_GATEWAY=%s", prefix, gateway));
+
g_ptr_array_unref (addresses);
+ g_free (gateway);
g_variant_unref (val);
}
/* DNS servers */
val = g_variant_lookup_value (ip4_config, "nameservers", G_VARIANT_TYPE ("au"));
if (val) {
- dns = nm_utils_ip4_dns_from_variant (val);
-
- if (dns[0]) {
- tmp = g_string_new (NULL);
- g_string_append_printf (tmp, "%sIP4_NAMESERVERS=", prefix);
- for (i = 0; dns[i]; i++) {
- if (i != 0)
- g_string_append_c (tmp, ' ');
- g_string_append (tmp, dns[i]);
- }
-
- items = g_slist_prepend (items, g_string_free (tmp, FALSE));
- }
- g_strfreev (dns);
+ items = _list_append_val_strv (items, nm_utils_ip4_dns_from_variant (val),
+ "%sIP4_NAMESERVERS=", prefix);
g_variant_unref (val);
}
@@ -153,21 +158,8 @@ construct_ip4_items (GSList *items, GVariant *ip4_config, const char *prefix)
/* WINS servers */
val = g_variant_lookup_value (ip4_config, "wins-servers", G_VARIANT_TYPE ("au"));
if (val) {
- wins = nm_utils_ip4_dns_from_variant (val);
-
- if (wins[0]) {
- tmp = g_string_new (NULL);
- g_string_append_printf (tmp, "%sIP4_WINS_SERVERS=", prefix);
-
- for (i = 0; wins[i]; i++) {
- if (i != 0)
- g_string_append_c (tmp, ' ');
- g_string_append (tmp, wins[i]);
- }
-
- items = g_slist_prepend (items, g_string_free (tmp, FALSE));
- }
- g_strfreev (wins);
+ items = _list_append_val_strv (items, nm_utils_ip4_dns_from_variant (val),
+ "%sIP4_WINS_SERVERS=", prefix);
g_variant_unref (val);
}
@@ -177,15 +169,19 @@ construct_ip4_items (GSList *items, GVariant *ip4_config, const char *prefix)
routes = nm_utils_ip4_routes_from_variant (val);
for (i = 0; i < routes->len; i++) {
- NMIP4Route *route = routes->pdata[i];
- guint32 ip_prefix = nm_ip4_route_get_prefix (route);
- guint32 metric = nm_ip4_route_get_metric (route);
+ NMIPRoute *route = routes->pdata[i];
+ const char *next_hop;
char *routetmp;
- nm_utils_inet4_ntop (nm_ip4_route_get_dest (route), str_addr);
- nm_utils_inet4_ntop (nm_ip4_route_get_next_hop (route), str_gw);
+ next_hop = nm_ip_route_get_next_hop (route);
+ if (!next_hop)
+ next_hop = "0.0.0.0";
- routetmp = g_strdup_printf ("%sIP4_ROUTE_%d=%s/%d %s %d", prefix, i, str_addr, ip_prefix, str_gw, metric);
+ routetmp = g_strdup_printf ("%sIP4_ROUTE_%d=%s/%d %s %u", prefix, i,
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route),
+ next_hop,
+ (guint32) MAX (0, nm_ip_route_get_metric (route)));
items = g_slist_prepend (items, routetmp);
}
items = g_slist_prepend (items, g_strdup_printf ("%sIP4_NUM_ROUTES=%d", prefix, routes->len));
@@ -214,6 +210,7 @@ construct_device_dhcp4_items (GSList *items, GVariant *dhcp4_config)
tmp = g_variant_get_string (val, NULL);
items = g_slist_prepend (items, g_strdup_printf ("DHCP4_%s=%s", ucased, tmp));
g_free (ucased);
+ g_variant_unref (val);
}
return items;
}
@@ -222,11 +219,8 @@ static GSList *
construct_ip6_items (GSList *items, GVariant *ip6_config, const char *prefix)
{
GPtrArray *addresses, *routes;
- char **dns;
- GString *tmp;
+ char *gateway = NULL;
GVariant *val;
- char str_addr[INET6_ADDRSTRLEN];
- char str_gw[INET6_ADDRSTRLEN];
int i;
if (ip6_config == NULL)
@@ -238,43 +232,36 @@ construct_ip6_items (GSList *items, GVariant *ip6_config, const char *prefix)
/* IP addresses */
val = g_variant_lookup_value (ip6_config, "addresses", G_VARIANT_TYPE ("a(ayuay)"));
if (val) {
- addresses = nm_utils_ip6_addresses_from_variant (val);
+ addresses = nm_utils_ip6_addresses_from_variant (val, &gateway);
+ if (!gateway)
+ gateway = g_strdup ("::");
for (i = 0; i < addresses->len; i++) {
- NMIP6Address *addr = addresses->pdata[i];
- guint32 ip_prefix = nm_ip6_address_get_prefix (addr);
+ NMIPAddress *addr = addresses->pdata[i];
char *addrtmp;
- nm_utils_inet6_ntop (nm_ip6_address_get_address (addr), str_addr);
- nm_utils_inet6_ntop (nm_ip6_address_get_gateway (addr), str_gw);
-
- addrtmp = g_strdup_printf ("%sIP6_ADDRESS_%d=%s/%d %s", prefix, i, str_addr, ip_prefix, str_gw);
+ addrtmp = g_strdup_printf ("%sIP6_ADDRESS_%d=%s/%d %s", prefix, i,
+ nm_ip_address_get_address (addr),
+ nm_ip_address_get_prefix (addr),
+ gateway);
items = g_slist_prepend (items, addrtmp);
}
if (addresses->len)
items = g_slist_prepend (items, g_strdup_printf ("%sIP6_NUM_ADDRESSES=%d", prefix, addresses->len));
+
+ /* Write gateway to a separate variable, too. */
+ items = g_slist_prepend (items, g_strdup_printf ("%sIP6_GATEWAY=%s", prefix, gateway));
+
g_ptr_array_unref (addresses);
+ g_free (gateway);
g_variant_unref (val);
}
/* DNS servers */
val = g_variant_lookup_value (ip6_config, "nameservers", G_VARIANT_TYPE ("aay"));
if (val) {
- dns = nm_utils_ip6_dns_from_variant (val);
-
- if (dns[0]) {
- tmp = g_string_new (NULL);
- g_string_append_printf (tmp, "%sIP6_NAMESERVERS=", prefix);
-
- for (i = 0; dns[i]; i++) {
- if (i != 0)
- g_string_append_c (tmp, ' ');
- g_string_append (tmp, dns[i]);
- }
-
- items = g_slist_prepend (items, g_string_free (tmp, FALSE));
- }
- g_strfreev (dns);
+ items = _list_append_val_strv (items, nm_utils_ip6_dns_from_variant (val),
+ "%sIP6_NAMESERVERS=", prefix);
g_variant_unref (val);
}
@@ -287,15 +274,19 @@ construct_ip6_items (GSList *items, GVariant *ip6_config, const char *prefix)
routes = nm_utils_ip6_routes_from_variant (val);
for (i = 0; i < routes->len; i++) {
- NMIP6Route *route = routes->pdata[i];
- guint32 ip_prefix = nm_ip6_route_get_prefix (route);
- guint32 metric = nm_ip6_route_get_metric (route);
+ NMIPRoute *route = routes->pdata[i];
+ const char *next_hop;
char *routetmp;
- nm_utils_inet6_ntop (nm_ip6_route_get_dest (route), str_addr);
- nm_utils_inet6_ntop (nm_ip6_route_get_next_hop (route), str_gw);
+ next_hop = nm_ip_route_get_next_hop (route);
+ if (!next_hop)
+ next_hop = "::";
- routetmp = g_strdup_printf ("%sIP6_ROUTE_%d=%s/%d %s %d", prefix, i, str_addr, ip_prefix, str_gw, metric);
+ routetmp = g_strdup_printf ("%sIP6_ROUTE_%d=%s/%d %s %u", prefix, i,
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route),
+ next_hop,
+ (guint32) MAX (0, nm_ip_route_get_metric (route)));
items = g_slist_prepend (items, routetmp);
}
if (routes->len)
@@ -343,7 +334,9 @@ nm_dispatcher_utils_construct_envp (const char *action,
char **out_iface)
{
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;
@@ -359,6 +352,20 @@ nm_dispatcher_utils_construct_envp (const char *action,
if (!strcmp (action, "hostname"))
goto done;
+ /* Connection properties */
+ if (!g_variant_lookup (connection_props, NMD_CONNECTION_PROPS_PATH, "&o", &path)) {
+ g_warning ("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.
*/
diff --git a/callouts/nm-dispatcher.c b/callouts/nm-dispatcher.c
index 19220654f9..6fb40cf9f3 100644
--- a/callouts/nm-dispatcher.c
+++ b/callouts/nm-dispatcher.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <syslog.h>
#include <stdio.h>
#include <unistd.h>
@@ -294,7 +296,7 @@ script_timeout_cb (gpointer user_data)
if (kill (script->pid, 0) == 0)
kill (script->pid, SIGKILL);
- waitpid (script->pid, NULL, 0);
+ (void) waitpid (script->pid, NULL, 0);
script->error = g_strdup_printf ("Script '%s' timed out.", script->script);
script->result = DISPATCH_RESULT_TIMEOUT;
@@ -359,15 +361,6 @@ check_filename (const char *file_name)
return TRUE;
}
-static void
-child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- /* Give child a different process group to ensure signal separation. */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-}
-
#define SCRIPT_TIMEOUT 600 /* 10 minutes */
static void
@@ -385,7 +378,7 @@ dispatch_one_script (Request *request)
if (request->debug)
g_message ("Running script '%s'", script->script);
- if (g_spawn_async ("/", argv, request->envp, G_SPAWN_DO_NOT_REAP_CHILD, child_setup, request, &script->pid, &error)) {
+ 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);
} else {
diff --git a/callouts/tests/Makefile.am b/callouts/tests/Makefile.am
index f8fd82b7ea..a0ed40159f 100644
--- a/callouts/tests/Makefile.am
+++ b/callouts/tests/Makefile.am
@@ -28,12 +28,14 @@ test_dispatcher_envp_LDADD = \
###########################################
+@VALGRIND_RULES@
TESTS = test-dispatcher-envp
endif
EXTRA_DIST= \
- dispatcher-old-down \
- dispatcher-old-up \
- dispatcher-old-vpn-down \
- dispatcher-old-vpn-up
+ dispatcher-down \
+ dispatcher-external \
+ dispatcher-up \
+ dispatcher-vpn-down \
+ dispatcher-vpn-up
diff --git a/callouts/tests/dispatcher-old-down b/callouts/tests/dispatcher-down
index 836f353289..f766595c1e 100644
--- a/callouts/tests/dispatcher-old-down
+++ b/callouts/tests/dispatcher-down
@@ -14,7 +14,9 @@ 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
DEVICE_IP_IFACE=wlan0
diff --git a/callouts/tests/dispatcher-external b/callouts/tests/dispatcher-external
new file mode 100644
index 0000000000..5430bec28b
--- /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-old-up b/callouts/tests/dispatcher-up
index a35812eeb9..463409e27c 100644
--- a/callouts/tests/dispatcher-old-up
+++ b/callouts/tests/dispatcher-up
@@ -33,12 +33,15 @@ 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
DEVICE_IP_IFACE=wlan0
IP4_ADDRESS_0=192.168.1.119/24 192.168.1.1
IP4_NUM_ADDRESSES=1
IP4_NAMESERVERS=68.87.77.134 68.87.72.134 192.168.1.1
+IP4_GATEWAY=192.168.1.1
IP4_DOMAINS=hsd1.mn.comcast.net.
IP4_NUM_ROUTES=0
DHCP4_NETBIOS_NAME_SERVERS=0.0.0.0
diff --git a/callouts/tests/dispatcher-old-vpn-down b/callouts/tests/dispatcher-vpn-down
index 4fab5e9562..18267f841d 100644
--- a/callouts/tests/dispatcher-old-vpn-down
+++ b/callouts/tests/dispatcher-vpn-down
@@ -33,12 +33,15 @@ 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
DEVICE_IP_IFACE=tun0
IP4_ADDRESS_0=192.168.1.119/24 192.168.1.1
IP4_NUM_ADDRESSES=1
IP4_NAMESERVERS=68.87.77.134 68.87.72.134 192.168.1.1
+IP4_GATEWAY=192.168.1.1
IP4_DOMAINS=hsd1.mn.comcast.net.
IP4_NUM_ROUTES=0
DHCP4_NETBIOS_NAME_SERVERS=0.0.0.0
diff --git a/callouts/tests/dispatcher-old-vpn-up b/callouts/tests/dispatcher-vpn-up
index 3c350dbf07..181ecb53a6 100644
--- a/callouts/tests/dispatcher-old-vpn-up
+++ b/callouts/tests/dispatcher-vpn-up
@@ -33,12 +33,15 @@ 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
DEVICE_IP_IFACE=tun0
IP4_ADDRESS_0=192.168.1.119/24 192.168.1.1
IP4_NUM_ADDRESSES=1
IP4_NAMESERVERS=68.87.77.134 68.87.72.134 192.168.1.1
+IP4_GATEWAY=192.168.1.1
IP4_DOMAINS=hsd1.mn.comcast.net.
IP4_NUM_ROUTES=0
DHCP4_NETBIOS_NAME_SERVERS=0.0.0.0
diff --git a/callouts/tests/test-dispatcher-envp.c b/callouts/tests/test-dispatcher-envp.c
index a8c65f8413..ac2a9bd900 100644
--- a/callouts/tests/test-dispatcher-envp.c
+++ b/callouts/tests/test-dispatcher-envp.c
@@ -18,7 +18,8 @@
*
*/
-#include <config.h>
+#include "config.h"
+
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
@@ -33,6 +34,7 @@
static gboolean
parse_main (GKeyFile *kf,
+ const char *filename,
GVariant **out_con_dict,
GVariant **out_con_props,
char **out_expected_iface,
@@ -79,8 +81,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;
@@ -183,6 +198,7 @@ parse_ip4 (GKeyFile *kf, GVariant **out_props, const char *section, GError **err
char *tmp;
char **split, **iter;
GPtrArray *addresses, *routes;
+ const char *gateway = NULL;
g_variant_builder_init (&props, G_VARIANT_TYPE ("a{sv}"));
@@ -196,12 +212,12 @@ parse_ip4 (GKeyFile *kf, GVariant **out_props, const char *section, GError **err
split = g_strsplit_set (tmp, " ", -1);
g_free (tmp);
- if (g_strv_length (split) > 0) {
+ if (split && g_strv_length (split) > 0) {
for (iter = split; iter && *iter; iter++)
g_strstrip (*iter);
g_variant_builder_add (&props, "{sv}", "domains", g_variant_new_strv ((gpointer) split, -1));
- g_strfreev (split);
}
+ g_strfreev (split);
/* nameservers */
if (!add_uint_array (kf, &props, "ip4", "nameservers", error))
@@ -217,38 +233,37 @@ parse_ip4 (GKeyFile *kf, GVariant **out_props, const char *section, GError **err
split = g_strsplit_set (tmp, ",", -1);
g_free (tmp);
- if (g_strv_length (split) > 0) {
- addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip4_address_unref);
+ if (split && g_strv_length (split) > 0) {
+ addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_address_unref);
for (iter = split; iter && *iter; iter++) {
- NMIP4Address *addr;
- guint32 a;
- char *p;
+ NMIPAddress *addr;
+ char *ip, *prefix;
if (strlen (g_strstrip (*iter)) == 0)
continue;
- addr = nm_ip4_address_new ();
-
- p = strchr (*iter, '/');
- g_assert (p);
- *p++ = '\0';
-
- g_assert_cmpint (inet_pton (AF_INET, *iter, &a), ==, 1);
- nm_ip4_address_set_address (addr, a);
- nm_ip4_address_set_prefix (addr, (guint) atoi (p));
+ ip = *iter;
- p = strchr (p, ' ');
- g_assert (p);
- p++;
+ prefix = strchr (ip, '/');
+ g_assert (prefix);
+ *prefix++ = '\0';
- g_assert_cmpint (inet_pton (AF_INET, p, &a), ==, 1);
- nm_ip4_address_set_gateway (addr, a);
+ if (addresses->len == 0) {
+ gateway = strchr (prefix, ' ');
+ g_assert (gateway);
+ gateway++;
+ }
+ addr = nm_ip_address_new (AF_INET, ip, (guint) atoi (prefix), error);
+ if (!addr) {
+ g_ptr_array_unref (addresses);
+ return FALSE;
+ }
g_ptr_array_add (addresses, addr);
}
g_variant_builder_add (&props, "{sv}", "addresses",
- nm_utils_ip4_addresses_to_variant (addresses));
+ nm_utils_ip4_addresses_to_variant (addresses, gateway));
g_ptr_array_unref (addresses);
}
g_strfreev (split);
@@ -260,38 +275,37 @@ parse_ip4 (GKeyFile *kf, GVariant **out_props, const char *section, GError **err
split = g_strsplit_set (tmp, ",", -1);
g_free (tmp);
- if (g_strv_length (split) > 0) {
- routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip4_route_unref);
+ if (split && g_strv_length (split) > 0) {
+ routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref);
for (iter = split; iter && *iter; iter++) {
- NMIP4Route *route;
- guint32 a;
- char *p;
+ NMIPRoute *route;
+ char *dest, *prefix, *next_hop, *metric;
if (strlen (g_strstrip (*iter)) == 0)
continue;
- route = nm_ip4_route_new ();
-
- p = strchr (*iter, '/');
- g_assert (p);
- *p++ = '\0';
+ dest = *iter;
- g_assert_cmpint (inet_pton (AF_INET, *iter, &a), ==, 1);
- nm_ip4_route_set_dest (route, a);
- nm_ip4_route_set_prefix (route, (guint) atoi (p));
+ prefix = strchr (dest, '/');
+ g_assert (prefix);
+ *prefix++ = '\0';
- p = strchr (p, ' ');
- g_assert (p);
- p++;
+ next_hop = strchr (prefix, ' ');
+ g_assert (next_hop);
+ next_hop++;
- g_assert_cmpint (inet_pton (AF_INET, p, &a), ==, 1);
- nm_ip4_route_set_next_hop (route, a);
-
- p = strchr (p, ' ');
- g_assert (p);
- p++;
- nm_ip4_route_set_metric (route, (guint) atoi (p));
+ metric = strchr (next_hop, ' ');
+ g_assert (metric);
+ metric++;
+ route = nm_ip_route_new (AF_INET,
+ dest, (guint) atoi (prefix),
+ next_hop, (guint) atoi (metric),
+ error);
+ if (!route) {
+ g_ptr_array_unref (routes);
+ return FALSE;
+ }
g_ptr_array_add (routes, route);
}
@@ -322,11 +336,15 @@ parse_dhcp (GKeyFile *kf,
g_variant_builder_init (&props, G_VARIANT_TYPE ("a{sv}"));
for (iter = keys; iter && *iter; iter++) {
val = g_key_file_get_string (kf, group_name, *iter, error);
- if (!val)
+ if (!val) {
+ g_strfreev (keys);
+ g_variant_builder_clear (&props);
return FALSE;
+ }
g_variant_builder_add (&props, "{sv}", *iter, g_variant_new_string (val));
g_free (val);
}
+ g_strfreev (keys);
*out_props = g_variant_builder_end (&props);
return TRUE;
@@ -353,11 +371,27 @@ get_dispatcher_file (const char *file,
gboolean success = FALSE;
char **keys, **iter, *val;
+ g_assert (!error || !*error);
+ g_assert (out_con_dict && !*out_con_dict);
+ g_assert (out_con_props && !*out_con_props);
+ g_assert (out_device_props && !*out_device_props);
+ g_assert (out_device_ip4_props && !*out_device_ip4_props);
+ g_assert (out_device_ip6_props && !*out_device_ip6_props);
+ g_assert (out_device_dhcp4_props && !*out_device_dhcp4_props);
+ g_assert (out_device_dhcp6_props && !*out_device_dhcp6_props);
+ g_assert (out_vpn_ip_iface && !*out_vpn_ip_iface);
+ g_assert (out_vpn_ip4_props && !*out_vpn_ip4_props);
+ g_assert (out_vpn_ip6_props && !*out_vpn_ip6_props);
+ g_assert (out_expected_iface && !*out_expected_iface);
+ g_assert (out_action && !*out_action);
+ g_assert (out_env && !*out_env);
+
kf = g_key_file_new ();
if (!g_key_file_load_from_file (kf, file, G_KEY_FILE_NONE, error))
return FALSE;
if (!parse_main (kf,
+ file,
out_con_dict,
out_con_props,
out_expected_iface,
@@ -380,7 +414,7 @@ get_dispatcher_file (const char *file,
}
if (g_key_file_has_group (kf, "dhcp6")) {
- if (!parse_dhcp (kf, "dhcp6", out_device_dhcp4_props, error))
+ if (!parse_dhcp (kf, "dhcp6", out_device_dhcp6_props, error))
goto out;
}
@@ -505,6 +539,7 @@ test_generic (const char *file, const char *override_vpn_ip_iface)
g_assert_cmpstr (expected_iface, ==, out_iface);
+ g_strfreev (denv);
g_free (out_iface);
g_free (vpn_ip_iface);
g_free (expected_iface);
@@ -530,27 +565,33 @@ test_generic (const char *file, const char *override_vpn_ip_iface)
/*******************************************/
static void
-test_old_up (void)
+test_up (void)
+{
+ test_generic ("dispatcher-up", NULL);
+}
+
+static void
+test_down (void)
{
- test_generic ("dispatcher-old-up", NULL);
+ test_generic ("dispatcher-down", NULL);
}
static void
-test_old_down (void)
+test_vpn_up (void)
{
- test_generic ("dispatcher-old-down", NULL);
+ test_generic ("dispatcher-vpn-up", NULL);
}
static void
-test_old_vpn_up (void)
+test_vpn_down (void)
{
- test_generic ("dispatcher-old-vpn-up", NULL);
+ test_generic ("dispatcher-vpn-down", NULL);
}
static void
-test_old_vpn_down (void)
+test_external (void)
{
- test_generic ("dispatcher-old-vpn-down", NULL);
+ test_generic ("dispatcher-external", NULL);
}
static void
@@ -559,7 +600,7 @@ test_up_empty_vpn_iface (void)
/* Test that an empty VPN iface variable, like is passed through D-Bus
* from NM, is ignored by the dispatcher environment construction code.
*/
- test_generic ("dispatcher-old-up", "");
+ test_generic ("dispatcher-up", "");
}
/*******************************************/
@@ -573,10 +614,11 @@ main (int argc, char **argv)
g_type_init ();
#endif
- g_test_add_func ("/dispatcher/old_up", test_old_up);
- g_test_add_func ("/dispatcher/old_down", test_old_down);
- g_test_add_func ("/dispatcher/old_vpn_up", test_old_vpn_up);
- g_test_add_func ("/dispatcher/old_vpn_down", test_old_vpn_down);
+ 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/cli/Makefile.am b/clients/cli/Makefile.am
index 94a249749e..75c00a998d 100644
--- a/clients/cli/Makefile.am
+++ b/clients/cli/Makefile.am
@@ -9,12 +9,15 @@ AM_CPPFLAGS = \
-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\"
nmcli_SOURCES = \
+ agent.c \
+ agent.h \
common.c \
common.h \
connections.c \
@@ -28,22 +31,33 @@ nmcli_SOURCES = \
nmcli.c \
nmcli.h \
utils.c \
- utils.h
+ utils.h \
+ polkit-agent.c \
+ polkit-agent.h \
+ \
+ $(srcdir)/../common/nm-secret-agent-simple.c \
+ $(srcdir)/../common/nm-secret-agent-simple.h \
+ $(NULL)
nmcli_LDADD = \
$(GLIB_LIBS) \
$(READLINE_LIBS) \
$(top_builddir)/libnm/libnm.la
+if WITH_POLKIT_AGENT
+AM_CPPFLAGS += $(POLKIT_CFLAGS)
+nmcli_SOURCES += $(srcdir)/../common/nm-polkit-listener.c $(srcdir)/../common/nm-polkit-listener.h
+nmcli_LDADD += $(POLKIT_LIBS)
+endif
+
if BUILD_SETTING_DOCS
-settings-docs.c: settings-docs.xsl $(top_builddir)/libnm-util/nm-setting-docs.xml
+settings-docs.c: settings-docs.xsl $(top_builddir)/libnm/nm-property-docs.xml
$(AM_V_GEN) xsltproc --output $@ $^
BUILT_SOURCES = settings-docs.c
+CLEANFILES = settings-docs.c
endif
-DISTCLEANFILES = settings-docs.c
-
EXTRA_DIST = settings-docs.c settings-docs.xsl
completiondir = $(datadir)/bash-completion/completions
diff --git a/clients/cli/agent.c b/clients/cli/agent.c
new file mode 100644
index 0000000000..1695ed5961
--- /dev/null
+++ b/clients/cli/agent.c
@@ -0,0 +1,252 @@
+/*
+ * nmcli - command-line tool for controlling NetworkManager
+ * Functions for running NM secret agent.
+ *
+ * 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 2014 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <readline/readline.h>
+#include <readline/history.h>
+
+#include "common.h"
+#include "utils.h"
+#include "nm-secret-agent-simple.h"
+#include "polkit-agent.h"
+#include "agent.h"
+
+static void
+usage (void)
+{
+ g_printerr (_("Usage: nmcli agent { COMMAND | help }\n\n"
+ "COMMAND := { secret | polkit | all }\n\n"
+ ));
+}
+
+static void
+usage_agent_secret (void)
+{
+ g_printerr (_("Usage: nmcli agent secret { help }\n"
+ "\n"
+ "Runs nmcli as NetworkManager secret agent. When NetworkManager requires\n"
+ "a password it asks registered agents for it. This command keeps nmcli running\n"
+ "and if a password is required asks the user for it.\n\n"));
+}
+
+static void
+usage_agent_polkit (void)
+{
+ g_printerr (_("Usage: nmcli agent polkit { help }\n"
+ "\n"
+ "Registers nmcli as a polkit action for the user session.\n"
+ "When a polkit daemon requires an authorization, nmcli asks the user and gives\n"
+ "the response back to polkit.\n\n"));
+}
+
+static void
+usage_agent_all (void)
+{
+ g_printerr (_("Usage: nmcli agent all { help }\n"
+ "\n"
+ "Runs nmcli as both NetworkManager secret and a polkit agent.\n\n"));
+}
+
+/* for pre-filling a string to readline prompt */
+static char *pre_input_deftext;
+static int
+set_deftext (void)
+{
+ if (pre_input_deftext && rl_startup_hook) {
+ rl_insert_text (pre_input_deftext);
+ g_free (pre_input_deftext);
+ pre_input_deftext = NULL;
+ rl_startup_hook = NULL;
+ }
+ return 0;
+}
+
+static gboolean
+get_secrets_from_user (const char *request_id,
+ const char *title,
+ const char *msg,
+ GPtrArray *secrets)
+{
+ int i;
+
+ for (i = 0; i < secrets->len; i++) {
+ NMSecretAgentSimpleSecret *secret = secrets->pdata[i];
+ char *pwd = NULL;
+
+ /* Ask user for the password */
+ g_print ("%s\n", msg);
+ if (secret->value) {
+ /* Prefill the password if we have it. */
+ rl_startup_hook = set_deftext;
+ pre_input_deftext = g_strdup (secret->value);
+ }
+ pwd = nmc_readline ("%s (%s): ", secret->name, secret->prop_name);
+
+ /* No password provided, cancel the secrets. */
+ if (!pwd)
+ return FALSE;
+ g_free (secret->value);
+ secret->value = pwd;
+ }
+ return TRUE;
+}
+
+static void
+secrets_requested (NMSecretAgentSimple *agent,
+ const char *request_id,
+ const char *title,
+ const char *msg,
+ GPtrArray *secrets,
+ gpointer user_data)
+{
+ NmCli *nmc = (NmCli *) user_data;
+ gboolean success = FALSE;
+
+ if (nmc->print_output == NMC_PRINT_PRETTY)
+ nmc_terminal_erase_line ();
+
+ success = get_secrets_from_user (request_id, title, msg, secrets);
+ if (success)
+ nm_secret_agent_simple_response (agent, request_id, secrets);
+ else
+ nm_secret_agent_simple_response (agent, request_id, NULL);
+}
+
+
+static NMCResultCode
+do_agent_secret (NmCli *nmc, int argc, char **argv)
+{
+ /* Create secret agent */
+ nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-agent");
+ if (nmc->secret_agent) {
+ /* We keep running */
+ nmc->should_wait = TRUE;
+
+ 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);
+ g_print (_("nmcli successfully registered as a NetworkManager's secret agent.\n"));
+ } else {
+ g_string_printf (nmc->return_text, _("Error: secret agent initialization failed"));
+ nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
+ }
+
+ return nmc->return_value;
+}
+
+static NMCResultCode
+do_agent_polkit (NmCli *nmc, int argc, char **argv)
+{
+ GError *error = NULL;
+
+ /* Initialize polkit agent */
+ if (!nmc_polkit_agent_init (nmc, TRUE, &error)) {
+ g_dbus_error_strip_remote_error (error);
+ g_string_printf (nmc->return_text, _("Error: polkit agent initialization failed: %s"),
+ error->message);
+ nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
+ g_error_free (error);
+ } else {
+ /* We keep running */
+ nmc->should_wait = TRUE;
+
+ g_print (_("nmcli successfully registered as a polkit agent.\n"));
+ }
+
+ return nmc->return_value;
+}
+
+static NMCResultCode
+do_agent_all (NmCli *nmc, int argc, char **argv)
+{
+ NMCResultCode secret_res;
+
+ /* Run both secret and polkit agent */
+ secret_res = do_agent_secret (nmc, argc, argv);
+ if (secret_res != NMC_RESULT_SUCCESS)
+ g_printerr ("%s\n", nmc->return_text->str);
+
+ nmc->return_value = do_agent_polkit (nmc, argc, argv);
+
+ if (nmc->return_value == NMC_RESULT_SUCCESS && secret_res != NMC_RESULT_SUCCESS)
+ nmc->return_value = secret_res;
+
+ return nmc->return_value;
+}
+
+NMCResultCode
+do_agent (NmCli *nmc, int argc, char **argv)
+{
+ /* Get NMClient object */
+ nmc->get_client (nmc);
+
+ /* Check whether NetworkManager is running */
+ if (!nm_client_get_nm_running (nmc->client)) {
+ g_string_printf (nmc->return_text, _("Error: NetworkManager is not running."));
+ nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
+ return nmc->return_value;
+ }
+ /* Compare NM and nmcli versions */
+ if (!nmc_versions_match (nmc))
+ return nmc->return_value;
+
+ if (argc == 0) {
+ nmc->return_value = do_agent_all (nmc, 0, NULL);
+ }
+
+ if (argc > 0) {
+ if (nmc_arg_is_help (*argv)) {
+ usage ();
+ goto usage_exit;
+ } else if (matches (*argv, "secret") == 0) {
+ if (nmc_arg_is_help (*(argv+1))) {
+ usage_agent_secret ();
+ goto usage_exit;
+ }
+ nmc->return_value = do_agent_secret (nmc, argc-1, argv+1);
+ } else if (matches (*argv, "polkit") == 0) {
+ if (nmc_arg_is_help (*(argv+1))) {
+ usage_agent_polkit ();
+ goto usage_exit;
+ }
+ nmc->return_value = do_agent_polkit (nmc, argc-1, argv+1);
+ } else if (matches (*argv, "all") == 0) {
+ if (nmc_arg_is_help (*(argv+1))) {
+ usage_agent_all ();
+ goto usage_exit;
+ }
+ nmc->return_value = do_agent_all (nmc, argc-1, argv+1);
+ } else {
+ usage ();
+ g_string_printf (nmc->return_text, _("Error: 'agent' command '%s' is not valid."), *argv);
+ nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
+ }
+ }
+
+usage_exit:
+ return nmc->return_value;
+}
diff --git a/src/nm-posix-signals.h b/clients/cli/agent.h
index e2af559bab..70ea0d9b23 100644
--- a/src/nm-posix-signals.h
+++ b/clients/cli/agent.h
@@ -1,5 +1,6 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* NetworkManager -- Network link manager
+/*
+ * nmcli - command-line tool for controlling NetworkManager
+ * Functions for running NM secret agent.
*
* 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
@@ -15,22 +16,14 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright 2014 Red Hat, Inc.
*/
-#ifndef __NETWORKMANAGER_POSIX_SIGNALS_H__
-#define __NETWORKMANAGER_POSIX_SIGNALS_H__
-
-#include <glib.h>
-#include <signal.h>
+#ifndef __NMC_AGENT_H__
+#define __NMC_AGENT_H__
-/*
- * This function can be used in g_spawn_* as GSpawnChildSetupFunc()
- * callback.
- */
-void nm_unblock_posix_signals (gpointer user_data);
+#include "nmcli.h"
-void nm_save_original_signal_mask (sigset_t sig_mask);
-const sigset_t *nm_get_original_signal_mask (void);
+NMCResultCode do_agent (NmCli *nmc, int argc, char **argv);
-#endif /* __NETWORKMANAGER_POSIX_SIGNALS_H__ */
+#endif /* __NMC_AGENT_H__ */
diff --git a/clients/cli/common.c b/clients/cli/common.c
index 0a7541c976..1276e73cbd 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -30,6 +30,8 @@
#include <readline/readline.h>
#include <readline/history.h>
+#include "nm-glib-compat.h"
+
#include "common.h"
#include "utils.h"
@@ -37,13 +39,14 @@
NmcOutputField nmc_fields_ip4_config[] = {
{"GROUP", N_("GROUP"), 15}, /* 0 */
{"ADDRESS", N_("ADDRESS"), 68}, /* 1 */
- {"ROUTE", N_("ROUTE"), 68}, /* 2 */
- {"DNS", N_("DNS"), 35}, /* 3 */
- {"DOMAIN", N_("DOMAIN"), 35}, /* 4 */
- {"WINS", N_("WINS"), 20}, /* 5 */
+ {"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}
};
-#define NMC_FIELDS_IP4_CONFIG_ALL "GROUP,ADDRESS,ROUTE,DNS,DOMAIN,WINS"
+#define NMC_FIELDS_IP4_CONFIG_ALL "GROUP,ADDRESS,GATEWAY,ROUTE,DNS,DOMAIN,WINS"
/* Available fields for DHCPv4 group */
NmcOutputField nmc_fields_dhcp4_config[] = {
@@ -57,12 +60,13 @@ NmcOutputField nmc_fields_dhcp4_config[] = {
NmcOutputField nmc_fields_ip6_config[] = {
{"GROUP", N_("GROUP"), 15}, /* 0 */
{"ADDRESS", N_("ADDRESS"), 95}, /* 1 */
- {"ROUTE", N_("ROUTE"), 95}, /* 2 */
- {"DNS", N_("DNS"), 60}, /* 3 */
- {"DOMAIN", N_("DOMAIN"), 35}, /* 4 */
+ {"GATEWAY", N_("GATEWAY"), 0}, /* 2 */
+ {"ROUTE", N_("ROUTE"), 95}, /* 3 */
+ {"DNS", N_("DNS"), 60}, /* 4 */
+ {"DOMAIN", N_("DOMAIN"), 35}, /* 5 */
{NULL, NULL, 0}
};
-#define NMC_FIELDS_IP6_CONFIG_ALL "GROUP,ADDRESS,ROUTE,DNS,DOMAIN"
+#define NMC_FIELDS_IP6_CONFIG_ALL "GROUP,ADDRESS,GATEWAY,ROUTE,DNS,DOMAIN"
/* Available fields for DHCPv6 group */
NmcOutputField nmc_fields_dhcp6_config[] = {
@@ -74,7 +78,7 @@ NmcOutputField nmc_fields_dhcp6_config[] = {
gboolean
-print_ip4_config (NMIP4Config *cfg4,
+print_ip4_config (NMIPConfig *cfg4,
NmCli *nmc,
const char *group_prefix,
const char *one_field)
@@ -100,62 +104,58 @@ print_ip4_config (NMIP4Config *cfg4,
g_ptr_array_add (nmc->output_data, arr);
/* addresses */
- ptr_array = nm_ip4_config_get_addresses (cfg4);
+ ptr_array = nm_ip_config_get_addresses (cfg4);
if (ptr_array) {
addr_arr = g_new (char *, ptr_array->len + 1);
for (i = 0; i < ptr_array->len; i++) {
- NMIP4Address *addr = (NMIP4Address *) g_ptr_array_index (ptr_array, i);
- guint32 prefix;
- char *ip_str, *gw_str;
-
- ip_str = nmc_ip4_address_as_string (nm_ip4_address_get_address (addr), NULL);
- prefix = nm_ip4_address_get_prefix (addr);
- gw_str = nmc_ip4_address_as_string (nm_ip4_address_get_gateway (addr), NULL);
+ NMIPAddress *addr = (NMIPAddress *) g_ptr_array_index (ptr_array, i);
- addr_arr[i] = g_strdup_printf ("ip = %s/%u, gw = %s", ip_str, prefix, gw_str);
- g_free (ip_str);
- g_free (gw_str);
+ addr_arr[i] = g_strdup_printf ("%s/%u",
+ nm_ip_address_get_address (addr),
+ nm_ip_address_get_prefix (addr));
}
addr_arr[i] = NULL;
}
/* routes */
- ptr_array = nm_ip4_config_get_routes (cfg4);
+ ptr_array = nm_ip_config_get_routes (cfg4);
if (ptr_array) {
route_arr = g_new (char *, ptr_array->len + 1);
for (i = 0; i < ptr_array->len; i++) {
- NMIP4Route *route = (NMIP4Route *) g_ptr_array_index (ptr_array, i);
- guint32 prefix, metric;
- char *dest_str, *nexthop_str;
-
- dest_str = nmc_ip4_address_as_string (nm_ip4_route_get_dest (route), NULL);
- nexthop_str = nmc_ip4_address_as_string (nm_ip4_route_get_next_hop (route), NULL);
- prefix = nm_ip4_route_get_prefix (route);
- metric = nm_ip4_route_get_metric (route);
-
- route_arr[i] = g_strdup_printf ("dst = %s/%u, nh = %s, mt = %u", dest_str, prefix, nexthop_str, metric);
- g_free (dest_str);
- g_free (nexthop_str);
+ NMIPRoute *route = (NMIPRoute *) g_ptr_array_index (ptr_array, i);
+ const char *next_hop;
+
+ next_hop = nm_ip_route_get_next_hop (route);
+ if (!next_hop)
+ next_hop = "0.0.0.0";
+
+ route_arr[i] = g_strdup_printf ("dst = %s/%u, nh = %s%c mt = %u",
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route),
+ next_hop,
+ nm_ip_route_get_metric (route) == -1 ? '\0' : ',',
+ (guint32) nm_ip_route_get_metric (route));
}
route_arr[i] = NULL;
}
/* DNS */
- dns_arr = g_strdupv ((char **) nm_ip4_config_get_nameservers (cfg4));
+ dns_arr = g_strdupv ((char **) nm_ip_config_get_nameservers (cfg4));
/* domains */
- domain_arr = g_strdupv ((char **) nm_ip4_config_get_domains (cfg4));
+ domain_arr = g_strdupv ((char **) nm_ip_config_get_domains (cfg4));
/* WINS */
- wins_arr = g_strdupv ((char **) nm_ip4_config_get_wins_servers (cfg4));
+ wins_arr = g_strdupv ((char **) nm_ip_config_get_wins_servers (cfg4));
arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
set_val_strc (arr, 0, group_prefix);
set_val_arr (arr, 1, addr_arr);
- set_val_arr (arr, 2, route_arr);
- set_val_arr (arr, 3, dns_arr);
- set_val_arr (arr, 4, domain_arr);
- set_val_arr (arr, 5, wins_arr);
+ set_val_strc (arr, 2, nm_ip_config_get_gateway (cfg4));
+ set_val_arr (arr, 3, route_arr);
+ set_val_arr (arr, 4, dns_arr);
+ set_val_arr (arr, 5, domain_arr);
+ set_val_arr (arr, 6, wins_arr);
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
@@ -167,7 +167,7 @@ print_ip4_config (NMIP4Config *cfg4,
}
gboolean
-print_ip6_config (NMIP6Config *cfg6,
+print_ip6_config (NMIPConfig *cfg6,
NmCli *nmc,
const char *group_prefix,
const char *one_field)
@@ -192,58 +192,54 @@ print_ip6_config (NMIP6Config *cfg6,
g_ptr_array_add (nmc->output_data, arr);
/* addresses */
- ptr_array = nm_ip6_config_get_addresses (cfg6);
+ ptr_array = nm_ip_config_get_addresses (cfg6);
if (ptr_array) {
addr_arr = g_new (char *, ptr_array->len + 1);
for (i = 0; i < ptr_array->len; i++) {
- NMIP6Address *addr = (NMIP6Address *) g_ptr_array_index (ptr_array, i);
- guint32 prefix;
- char *ip_str, *gw_str;
+ NMIPAddress *addr = (NMIPAddress *) g_ptr_array_index (ptr_array, i);
- ip_str = nmc_ip6_address_as_string (nm_ip6_address_get_address (addr), NULL);
- prefix = nm_ip6_address_get_prefix (addr);
- gw_str = nmc_ip6_address_as_string (nm_ip6_address_get_gateway (addr), NULL);
-
- addr_arr[i] = g_strdup_printf ("ip = %s/%u, gw = %s", ip_str, prefix, gw_str);
- g_free (ip_str);
- g_free (gw_str);
+ addr_arr[i] = g_strdup_printf ("%s/%u",
+ nm_ip_address_get_address (addr),
+ nm_ip_address_get_prefix (addr));
}
addr_arr[i] = NULL;
}
/* routes */
- ptr_array = nm_ip6_config_get_routes (cfg6);
+ ptr_array = nm_ip_config_get_routes (cfg6);
if (ptr_array) {
route_arr = g_new (char *, ptr_array->len + 1);
for (i = 0; i < ptr_array->len; i++) {
- NMIP6Route *route = (NMIP6Route *) g_ptr_array_index (ptr_array, i);
- guint32 prefix, metric;
- char *dest_str, *nexthop_str;
-
- dest_str = nmc_ip6_address_as_string (nm_ip6_route_get_dest (route), NULL);
- nexthop_str = nmc_ip6_address_as_string (nm_ip6_route_get_next_hop (route), NULL);
- prefix = nm_ip6_route_get_prefix (route);
- metric = nm_ip6_route_get_metric (route);
-
- route_arr[i] = g_strdup_printf ("dst = %s/%u, nh = %s, mt = %u", dest_str, prefix, nexthop_str, metric);
- g_free (dest_str);
- g_free (nexthop_str);
+ NMIPRoute *route = (NMIPRoute *) g_ptr_array_index (ptr_array, i);
+ const char *next_hop;
+
+ next_hop = nm_ip_route_get_next_hop (route);
+ if (!next_hop)
+ next_hop = "::";
+
+ route_arr[i] = g_strdup_printf ("dst = %s/%u, nh = %s%c mt = %u",
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route),
+ next_hop,
+ nm_ip_route_get_metric (route) == -1 ? '\0' : ',',
+ (guint32) nm_ip_route_get_metric (route));
}
route_arr[i] = NULL;
}
/* DNS */
- dns_arr = g_strdupv ((char **) nm_ip6_config_get_nameservers (cfg6));
+ dns_arr = g_strdupv ((char **) nm_ip_config_get_nameservers (cfg6));
/* domains */
- domain_arr = g_strdupv ((char **) nm_ip6_config_get_domains (cfg6));
+ domain_arr = g_strdupv ((char **) nm_ip_config_get_domains (cfg6));
arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
set_val_strc (arr, 0, group_prefix);
set_val_arr (arr, 1, addr_arr);
- set_val_arr (arr, 2, route_arr);
- set_val_arr (arr, 3, dns_arr);
- set_val_arr (arr, 4, domain_arr);
+ set_val_strc (arr, 2, nm_ip_config_get_gateway (cfg6));
+ set_val_arr (arr, 3, route_arr);
+ set_val_arr (arr, 4, dns_arr);
+ set_val_arr (arr, 5, domain_arr);
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
@@ -255,7 +251,7 @@ print_ip6_config (NMIP6Config *cfg6,
}
gboolean
-print_dhcp4_config (NMDhcp4Config *dhcp4,
+print_dhcp4_config (NMDhcpConfig *dhcp4,
NmCli *nmc,
const char *group_prefix,
const char *one_field)
@@ -267,7 +263,7 @@ print_dhcp4_config (NMDhcp4Config *dhcp4,
if (dhcp4 == NULL)
return FALSE;
- table = nm_dhcp4_config_get_options (dhcp4);
+ table = nm_dhcp_config_get_options (dhcp4);
if (table) {
GHashTableIter table_iter;
gpointer key, value;
@@ -303,7 +299,7 @@ print_dhcp4_config (NMDhcp4Config *dhcp4,
}
gboolean
-print_dhcp6_config (NMDhcp6Config *dhcp6,
+print_dhcp6_config (NMDhcpConfig *dhcp6,
NmCli *nmc,
const char *group_prefix,
const char *one_field)
@@ -315,7 +311,7 @@ print_dhcp6_config (NMDhcp6Config *dhcp6,
if (dhcp6 == NULL)
return FALSE;
- table = nm_dhcp6_config_get_options (dhcp6);
+ table = nm_dhcp_config_get_options (dhcp6);
if (table) {
GHashTableIter table_iter;
gpointer key, value;
@@ -351,71 +347,19 @@ print_dhcp6_config (NMDhcp6Config *dhcp6,
}
/*
- * Parse IPv4 address from string to NMIP4Address stucture.
- * ip_str is the IPv4 address in the form address/prefix
- * gw_str is the gateway address (it is optional)
- */
-NMIP4Address *
-nmc_parse_and_build_ip4_address (const char *ip_str, const char *gw_str, GError **error)
-{
- NMIP4Address *addr = NULL;
- guint32 ip4_addr, gw_addr;
- char *tmp;
- char *plen;
- long int prefix;
-
- g_return_val_if_fail (ip_str != NULL, NULL);
- g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
- tmp = g_strdup (ip_str);
- plen = strchr (tmp, '/'); /* prefix delimiter */
- if (plen)
- *plen++ = '\0';
-
- if (inet_pton (AF_INET, tmp, &ip4_addr) < 1) {
- g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
- _("invalid IPv4 address '%s'"), tmp);
- goto finish;
- }
-
- prefix = 32;
- if (plen) {
- if (!nmc_string_to_int (plen, TRUE, 1, 32, &prefix)) {
- g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
- _("invalid prefix '%s'; <1-32> allowed"), plen);
- goto finish;
- }
- }
-
- if (inet_pton (AF_INET, gw_str ? gw_str : "0.0.0.0", &gw_addr) < 1) {
- g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
- _("invalid gateway '%s'"), gw_str);
- goto finish;
- }
-
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip4_addr);
- nm_ip4_address_set_prefix (addr, (guint32) prefix);
- nm_ip4_address_set_gateway (addr, gw_addr);
-
-finish:
- g_free (tmp);
- return addr;
-}
-
-/*
- * Parse IPv6 address from string to NMIP6Address stucture.
- * ip_str is the IPv6 address in the form address/prefix
- * gw_str is the gateway address (it is optional)
+ * Parse IP address from string to NMIPAddress stucture.
+ * ip_str is the IP address in the form address/prefix
*/
-NMIP6Address *
-nmc_parse_and_build_ip6_address (const char *ip_str, const char *gw_str, GError **error)
+NMIPAddress *
+nmc_parse_and_build_address (int family, const char *ip_str, GError **error)
{
- NMIP6Address *addr = NULL;
- struct in6_addr ip_addr, gw_addr;
+ int max_prefix = (family == AF_INET) ? 32 : 128;
+ NMIPAddress *addr = NULL;
+ const char *ip;
char *tmp;
char *plen;
long int prefix;
+ GError *local = NULL;
g_return_val_if_fail (ip_str != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
@@ -425,105 +369,71 @@ nmc_parse_and_build_ip6_address (const char *ip_str, const char *gw_str, GError
if (plen)
*plen++ = '\0';
- if (inet_pton (AF_INET6, tmp, &ip_addr) < 1) {
- g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
- _("invalid IPv6 address '%s'"), tmp);
- goto finish;
- }
+ ip = tmp;
- prefix = 128;
+ prefix = max_prefix;
if (plen) {
- if (!nmc_string_to_int (plen, TRUE, 1, 128, &prefix)) {
+ if (!nmc_string_to_int (plen, TRUE, 1, max_prefix, &prefix)) {
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
- _("invalid prefix '%s'; <1-128> allowed"), plen);
+ _("invalid prefix '%s'; <1-%d> allowed"), plen, max_prefix);
goto finish;
}
}
- if (inet_pton (AF_INET6, gw_str ? gw_str : "::", &gw_addr) < 1) {
+ addr = nm_ip_address_new (family, ip, (guint32) prefix, &local);
+ if (!addr) {
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
- _("invalid gateway '%s'"), gw_str);
- goto finish;
+ _("invalid IP address: %s"), local->message);
+ g_clear_error (&local);
}
- addr = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr, &ip_addr);
- nm_ip6_address_set_prefix (addr, (guint32) prefix);
- nm_ip6_address_set_gateway (addr, &gw_addr);
-
finish:
g_free (tmp);
return addr;
}
-typedef struct {
- long int prefix;
- long int metric;
- union _IpDest {
- guint32 ip4_dst;
- struct in6_addr ip6_dst;
- } dst;
- union _IpNextHop {
- guint32 ip4_nh;
- struct in6_addr ip6_nh;
- } nh;
-} ParsedRoute;
-
/*
- * _parse_and_build_route:
+ * nmc_parse_and_build_route:
* @family: AF_INET or AF_INET6
* @first: the route destination in the form of "address/prefix"
(/prefix is optional)
* @second: (allow-none): next hop address, if third is not NULL. Otherwise it could be
either next hop address or metric. (It can be NULL when @third is NULL).
* @third: (allow-none): route metric
- * @out: (out): route struct to fill
* @error: location to store GError
*
- * Parse route from strings and fill @out parameter.
+ * Parse route from strings and return an #NMIPRoute
*
* Returns: %TRUE on success, %FALSE on failure
*/
-static gboolean
-_parse_and_build_route (int family,
- const char *first,
- const char *second,
- const char *third,
- ParsedRoute *out,
- GError **error)
+NMIPRoute *
+nmc_parse_and_build_route (int family,
+ const char *first,
+ const char *second,
+ const char *third,
+ GError **error)
{
- int max_prefix;
- char *tmp, *plen;
+ int max_prefix = (family == AF_INET) ? 32 : 128;
+ char *dest = NULL, *plen = NULL;
+ const char *next_hop = NULL;
+ const char *canon_dest;
+ long int prefix = max_prefix, metric = -1;
+ NMIPRoute *route = NULL;
gboolean success = FALSE;
+ GError *local = NULL;
g_return_val_if_fail (family == AF_INET || family == AF_INET6, FALSE);
g_return_val_if_fail (first != NULL, FALSE);
g_return_val_if_fail (second || !third, FALSE);
- g_return_val_if_fail (out, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- max_prefix = (family == AF_INET) ? 32 : 128;
- /* initialize default values */
- out->prefix = max_prefix;
- out->metric = 0;
- if (family == AF_INET)
- out->nh.ip4_nh = 0;
- else
- out->nh.ip6_nh = in6addr_any;
-
- tmp = g_strdup (first);
- plen = strchr (tmp, '/'); /* prefix delimiter */
+ dest = g_strdup (first);
+ plen = strchr (dest, '/'); /* prefix delimiter */
if (plen)
*plen++ = '\0';
- if (inet_pton (family, tmp, family == AF_INET ? (void *) &out->dst.ip4_dst : (void *) &out->dst.ip6_dst) < 1) {
- g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
- _("invalid route destination address '%s'"), tmp);
- goto finish;
- }
-
if (plen) {
- if (!nmc_string_to_int (plen, TRUE, 1, max_prefix, &out->prefix)) {
+ if (!nmc_string_to_int (plen, TRUE, 1, max_prefix, &prefix)) {
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
_("invalid prefix '%s'; <1-%d> allowed"),
plen, max_prefix);
@@ -532,113 +442,49 @@ _parse_and_build_route (int family,
}
if (second) {
- if (inet_pton (family, second, family == AF_INET ? (void *) &out->nh.ip4_nh : (void *) &out->nh.ip6_nh) < 1) {
- if (third) {
- g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
- _("invalid next hop address '%s'"), second);
+ if (third || nm_utils_ipaddr_valid (family, second))
+ next_hop = second;
+ else {
+ /* 'second' can be a metric */
+ if (!nmc_string_to_int (second, TRUE, 0, G_MAXUINT32, &metric)) {
+ g_set_error (error, 1, 0, _("the second component of route ('%s') is neither "
+ "a next hop address nor a metric"), second);
goto finish;
- } else {
- /* 'second' can be a metric */
- if (!nmc_string_to_int (second, TRUE, 0, G_MAXUINT32, &out->metric)) {
- g_set_error (error, 1, 0, _("the second component of route ('%s') is neither "
- "a next hop address nor a metric"), second);
- goto finish;
- }
}
}
}
if (third) {
- if (!nmc_string_to_int (third, TRUE, 0, G_MAXUINT32, &out->metric)) {
+ if (!nmc_string_to_int (third, TRUE, 0, G_MAXUINT32, &metric)) {
g_set_error (error, 1, 0, _("invalid metric '%s'"), third);
goto finish;
}
}
- /* We don't accept default routes as NetworkManager handles it itself */
- if ( (family == AF_INET && out->dst.ip4_dst == 0)
- || (family == AF_INET6 && IN6_IS_ADDR_UNSPECIFIED (&out->dst.ip6_dst))) {
+ route = nm_ip_route_new (family, dest, prefix, next_hop, metric, &local);
+ if (!route) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("invalid route: %s"), local->message);
+ g_clear_error (&local);
+ goto finish;
+ }
+
+ /* We don't accept default routes as NetworkManager handles it
+ * itself. But we have to check this after @route has normalized the
+ * dest string.
+ */
+ canon_dest = nm_ip_route_get_dest (route);
+ if (!strcmp (canon_dest, "0.0.0.0") || !strcmp (canon_dest, "::")) {
g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
_("default route cannot be added (NetworkManager handles it by itself)"));
+ g_clear_pointer (&route, nm_ip_route_unref);
goto finish;
}
success = TRUE;
finish:
- g_free (tmp);
- return success;
-}
-
-/*
- * nmc_parse_and_build_ip4_route:
- * @first: the IPv4 route destination in the form of "address/prefix"
- (/prefix is optional)
- * @second: (allow-none): next hop address, if third is not NULL. Otherwise it could be
- either next hop address or metric. (It can be NULL when @third is NULL).
- * @third: (allow-none): route metric
- * @error: location to store GError
- *
- * Parse IPv4 route from strings to NMIP4Route stucture.
- *
- * Returns: route as a NMIP4Route object, or %NULL on failure
- */
-NMIP4Route *
-nmc_parse_and_build_ip4_route (const char *first,
- const char *second,
- const char *third,
- GError **error)
-{
- ParsedRoute tmp_route;
- NMIP4Route *route = NULL;
-
- g_return_val_if_fail (first != NULL, NULL);
- g_return_val_if_fail (second || !third, NULL);
- g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
- if (_parse_and_build_route (AF_INET, first, second, third, &tmp_route, error)) {
- route = nm_ip4_route_new ();
- nm_ip4_route_set_dest (route, tmp_route.dst.ip4_dst);
- nm_ip4_route_set_prefix (route, (guint32) tmp_route.prefix);
- nm_ip4_route_set_next_hop (route, tmp_route.nh.ip4_nh);
- nm_ip4_route_set_metric (route, (guint32) tmp_route.metric);
- }
- return route;
-}
-
-/*
- * nmc_parse_and_build_ip6_route:
- * @first: the IPv6 route destination in the form of "address/prefix"
- (/prefix is optional)
- * @second: (allow-none): next hop address, if third is not NULL. Otherwise it could be
- either next hop address or metric. (It can be NULL when @third is NULL).
- * @third: (allow-none): route metric
- * @error: location to store GError
- *
- * Parse IPv6 route from strings to NMIP6Route stucture.
- *
- * Returns: route as a NMIP6Route object, or %NULL on failure
- */
-NMIP6Route *
-nmc_parse_and_build_ip6_route (const char *first,
- const char *second,
- const char *third,
- GError **error)
-{
- ParsedRoute tmp_route;
- NMIP6Route *route = NULL;
-
- g_return_val_if_fail (first != NULL, NULL);
- g_return_val_if_fail (second || !third, NULL);
- g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
- if (_parse_and_build_route (AF_INET6, first, second, third, &tmp_route, error)) {
- route = nm_ip6_route_new ();
- nm_ip6_route_set_dest (route, &tmp_route.dst.ip6_dst);
- nm_ip6_route_set_prefix (route, (guint32) tmp_route.prefix);
- nm_ip6_route_set_next_hop (route, &tmp_route.nh.ip6_nh);
- nm_ip6_route_set_metric (route, (guint32) tmp_route.metric);
- }
+ g_free (dest);
return route;
}
@@ -1054,6 +900,93 @@ nmc_find_connection (const GPtrArray *connections,
return found;
}
+static gboolean
+get_secrets_from_user (const char *request_id,
+ const char *title,
+ const char *msg,
+ gboolean ask,
+ GHashTable *pwds_hash,
+ GPtrArray *secrets)
+{
+ int i;
+
+ for (i = 0; i < secrets->len; i++) {
+ NMSecretAgentSimpleSecret *secret = secrets->pdata[i];
+ char *pwd = NULL;
+
+ /* First try to find the password in provided passwords file,
+ * then ask user. */
+ if (pwds_hash && (pwd = g_hash_table_lookup (pwds_hash, secret->prop_name))) {
+ pwd = g_strdup (pwd);
+ } else {
+ g_print ("%s\n", msg);
+ if (ask) {
+ if (secret->value) {
+ /* Prefill the password if we have it. */
+ rl_startup_hook = nmc_rl_set_deftext;
+ nmc_rl_pre_input_deftext = g_strdup (secret->value);
+ }
+ pwd = nmc_readline ("%s (%s): ", secret->name, secret->prop_name);
+ if (!pwd)
+ pwd = g_strdup ("");
+ } else {
+ g_printerr (_("Warning: password for '%s' not given in 'passwd-file' "
+ "and nmcli cannot ask without '--ask' option.\n"),
+ secret->prop_name);
+ }
+ }
+ /* No password provided, cancel the secrets. */
+ if (!pwd)
+ return FALSE;
+ g_free (secret->value);
+ secret->value = pwd;
+ }
+ return TRUE;
+}
+
+/**
+ * nmc_secrets_requested:
+ * @agent: the #NMSecretAgentSimple
+ * @request_id: request ID, to eventually pass to
+ * nm_secret_agent_simple_response()
+ * @title: a title for the password request
+ * @msg: a prompt message for the password request
+ * @secrets: (element-type #NMSecretAgentSimpleSecret): array of secrets
+ * being requested.
+ * @user_data: user data passed to the function
+ *
+ * This function is used as a callback for "request-secrets" signal of
+ * NMSecretAgentSimpleSecret.
+*/
+void
+nmc_secrets_requested (NMSecretAgentSimple *agent,
+ const char *request_id,
+ const char *title,
+ const char *msg,
+ GPtrArray *secrets,
+ gpointer user_data)
+{
+ NmCli *nmc = (NmCli *) user_data;
+ gboolean success = FALSE;
+
+ if (nmc->print_output == NMC_PRINT_PRETTY)
+ nmc_terminal_erase_line ();
+
+ success = get_secrets_from_user (request_id, title, msg, nmc->in_editor || nmc->ask,
+ nmc->pwds_hash, secrets);
+ if (success)
+ nm_secret_agent_simple_response (agent, request_id, secrets);
+ else {
+ /* Unregister our secret agent on failure, so that another agent
+ * may be tried */
+ if (nmc->secret_agent) {
+ nm_secret_agent_old_unregister (nmc->secret_agent, NULL, NULL);
+ g_clear_object (&nmc->secret_agent);
+ }
+ }
+}
+
+
/**
* nmc_cleanup_readline:
*
@@ -1196,3 +1129,18 @@ nmc_rl_gen_func_basic (const char *text, int state, const char **words)
return NULL;
}
+/* for pre-filling a string to readline prompt */
+char *nmc_rl_pre_input_deftext;
+
+int
+nmc_rl_set_deftext (void)
+{
+ if (nmc_rl_pre_input_deftext && rl_startup_hook) {
+ rl_insert_text (nmc_rl_pre_input_deftext);
+ g_free (nmc_rl_pre_input_deftext);
+ nmc_rl_pre_input_deftext = NULL;
+ rl_startup_hook = NULL;
+ }
+ return 0;
+}
+
diff --git a/clients/cli/common.h b/clients/cli/common.h
index 4f43674793..8bb043f4d7 100644
--- a/clients/cli/common.h
+++ b/clients/cli/common.h
@@ -16,24 +16,22 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2012 - 2014 Red Hat, Inc.
+ * Copyright 2012 - 2014 Red Hat, Inc.
*/
#ifndef NMC_COMMON_H
#define NMC_COMMON_H
#include "nmcli.h"
+#include "nm-secret-agent-simple.h"
-gboolean print_ip4_config (NMIP4Config *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field);
-gboolean print_ip6_config (NMIP6Config *cfg6, NmCli *nmc, const char *group_prefix, const char *one_field);
-gboolean print_dhcp4_config (NMDhcp4Config *dhcp4, NmCli *nmc, const char *group_prefix, const char *one_field);
-gboolean print_dhcp6_config (NMDhcp6Config *dhcp6, NmCli *nmc, const char *group_prefix, const char *one_field);
+gboolean print_ip4_config (NMIPConfig *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field);
+gboolean print_ip6_config (NMIPConfig *cfg6, NmCli *nmc, const char *group_prefix, const char *one_field);
+gboolean print_dhcp4_config (NMDhcpConfig *dhcp4, NmCli *nmc, const char *group_prefix, const char *one_field);
+gboolean print_dhcp6_config (NMDhcpConfig *dhcp6, NmCli *nmc, const char *group_prefix, const char *one_field);
-NMIP4Address *nmc_parse_and_build_ip4_address (const char *ip_str, const char *gw_str, GError **error);
-NMIP6Address *nmc_parse_and_build_ip6_address (const char *ip_str, const char *gw_str, GError **error);
-
-NMIP4Route *nmc_parse_and_build_ip4_route (const char *first, const char *second, const char *third, GError **error);
-NMIP6Route *nmc_parse_and_build_ip6_route (const char *first, const char *second, const char *third, GError **error);
+NMIPAddress *nmc_parse_and_build_address (int family, const char *ip_str, GError **error);
+NMIPRoute *nmc_parse_and_build_route (int family, const char *first, const char *second, const char *third, GError **error);
const char * nmc_device_state_to_string (NMDeviceState state);
const char * nmc_device_reason_to_string (NMDeviceStateReason reason);
@@ -51,10 +49,21 @@ NMConnection *nmc_find_connection (const GPtrArray *connections,
const char *filter_val,
int *start);
+void nmc_secrets_requested (NMSecretAgentSimple *agent,
+ const char *request_id,
+ const char *title,
+ const char *msg,
+ GPtrArray *secrets,
+ gpointer user_data);
+
void nmc_cleanup_readline (void);
char *nmc_readline (const char *prompt_fmt, ...) G_GNUC_PRINTF (1, 2);
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);
+/* for pre-filling a string to readline prompt */
+extern char *nmc_rl_pre_input_deftext;
+int nmc_rl_set_deftext (void);
+
#endif /* NMC_COMMON_H */
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 4d48e2fb60..6de3440652 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -14,7 +14,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright 2010 - 2014 Red Hat, Inc.
+ * Copyright 2010 - 2015 Red Hat, Inc.
*/
#include "config.h"
@@ -35,6 +35,8 @@
#include "common.h"
#include "settings.h"
#include "connections.h"
+#include "nm-secret-agent-simple.h"
+#include "polkit-agent.h"
/* define some prompts for connection editor */
#define EDITOR_PROMPT_SETTING _("Setting name? ")
@@ -47,7 +49,9 @@
#define PROMPT_BOND_MASTER _("Bond master: ")
#define PROMPT_TEAM_MASTER _("Team master: ")
#define PROMPT_BRIDGE_MASTER _("Bridge master: ")
-#define PROMPT_CONNECTION _("Connection (name, UUID, or path): ")
+#define PROMPT_CONNECTION _("Connection (name, UUID, or path): ")
+#define PROMPT_CONNECTIONS _("Connection(s) (name, UUID, or path): ")
+#define PROMPT_ACTIVE_CONNECTIONS _("Connection(s) (name, UUID, path or apath): ")
static const char *nmc_known_vpns[] =
{ "openvpn", "vpnc", "pptp", "openconnect", "openswan", "libreswan",
@@ -248,13 +252,14 @@ 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] <ID>] ...\n\n"
+ " show [--active] [--order <order spec>]\n"
+ " show [--active] [--show-secrets] [id | uuid | path | apath] <ID> ...\n\n"
#if WITH_WIMAX
- " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>]\n\n"
+ " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] [passwd-file <file with passwords>]\n\n"
#else
- " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n\n"
+ " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file <file with passwords>]\n\n"
#endif
- " down [id | uuid | path | apath] <ID>\n\n"
+ " down [id | uuid | path | apath] <ID> ...\n\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n"
" modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> <value>)+\n\n"
" edit [id | uuid | path] <ID>\n"
@@ -269,12 +274,12 @@ usage_connection_show (void)
{
g_printerr (_("Usage: nmcli connection show { ARGUMENTS | help }\n"
"\n"
- "ARGUMENTS := [--active]\n"
+ "ARGUMENTS := [--active] [--order <order spec>]\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] <ID> ...\n"
"\n"
@@ -290,19 +295,20 @@ usage_connection_up (void)
{
g_printerr (_("Usage: nmcli connection up { ARGUMENTS | help }\n"
"\n"
- "ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp <name>]\n"
+ "ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp <name>] [passwd-file <file with passwords>]\n"
"\n"
"Activate a connection on a device. The profile to activate is identified by its\n"
"name, UUID or D-Bus path.\n"
"\n"
- "ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+ "ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd-file <file with passwords>]\n"
"\n"
"Activate a device with a connection. The connection profile is selected\n"
"automatically by NetworkManager.\n"
"\n"
- "ifname - specifies the device to active the connection on\n"
- "ap - specifies AP to connect to (only valid for Wi-Fi)\n"
- "nsp - specifies NSP to connect to (only valid for WiMAX)\n\n"));
+ "ifname - specifies the device to active the connection on\n"
+ "ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+ "nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+ "passwd-file - file with password(s) required to activate the connection\n\n"));
}
static void
@@ -310,7 +316,7 @@ usage_connection_down (void)
{
g_printerr (_("Usage: nmcli connection down { ARGUMENTS | help }\n"
"\n"
- "ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+ "ARGUMENTS := [id | uuid | path | apath] <ID> ...\n"
"\n"
"Deactivate a connection from a device (without preventing the device from\n"
"further auto-activation). The profile to deactivate is identified by its name,\n"
@@ -382,6 +388,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 <MAC address>]\n\n"
" bridge-slave: master <master (ifname, or connection UUID or name)>\n"
" [priority <0-63>]\n"
@@ -616,16 +623,23 @@ get_ac_for_connection (const GPtrArray *active_cons, NMConnection *connection)
return ac;
}
+/* Put secrets into local connection. */
static void
-update_secrets_in_connection (NMRemoteConnection *con)
+update_secrets_in_connection (NMRemoteConnection *remote, NMConnection *local)
{
GVariant *secrets;
int i;
+ GError *error = NULL;
for (i = 0; nmc_fields_settings_names[i].name; i++) {
- secrets = nm_remote_connection_get_secrets (con, nmc_fields_settings_names[i].name, NULL, NULL);
+ secrets = nm_remote_connection_get_secrets (remote, nmc_fields_settings_names[i].name, NULL, NULL);
if (secrets) {
- (void) nm_connection_update_secrets (NM_CONNECTION (con), NULL, secrets, NULL);
+ if (!nm_connection_update_secrets (local, NULL, secrets, &error) && error) {
+ g_printerr (_("Error updating secrets for %s: %s\n"),
+ nmc_fields_settings_names[i].name,
+ error->message);
+ g_clear_error (&error);
+ }
g_variant_unref (secrets);
}
}
@@ -753,10 +767,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;
@@ -767,6 +779,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);
@@ -778,7 +791,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);
}
@@ -795,6 +809,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));
@@ -818,8 +842,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 ("<invisible> %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);
@@ -827,7 +852,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);
@@ -841,6 +867,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);
}
@@ -917,36 +945,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;
@@ -1111,7 +1109,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
/* IP4 */
if (strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[1].name) == 0) {
gboolean b1 = FALSE;
- NMIP4Config *cfg4 = nm_active_connection_get_ip4_config (acon);
+ NMIPConfig *cfg4 = nm_active_connection_get_ip4_config (acon);
b1 = print_ip4_config (cfg4, nmc, "IP4", group_fld);
was_output = was_output || b1;
@@ -1120,7 +1118,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
/* DHCP4 */
if (strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[2].name) == 0) {
gboolean b1 = FALSE;
- NMDhcp4Config *dhcp4 = nm_active_connection_get_dhcp4_config (acon);
+ NMDhcpConfig *dhcp4 = nm_active_connection_get_dhcp4_config (acon);
b1 = print_dhcp4_config (dhcp4, nmc, "DHCP4", group_fld);
was_output = was_output || b1;
@@ -1129,7 +1127,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
/* IP6 */
if (strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[3].name) == 0) {
gboolean b1 = FALSE;
- NMIP6Config *cfg6 = nm_active_connection_get_ip6_config (acon);
+ NMIPConfig *cfg6 = nm_active_connection_get_ip6_config (acon);
b1 = print_ip6_config (cfg6, nmc, "IP6", group_fld);
was_output = was_output || b1;
@@ -1138,7 +1136,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
/* DHCP6 */
if (strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[4].name) == 0) {
gboolean b1 = FALSE;
- NMDhcp6Config *dhcp6 = nm_active_connection_get_dhcp6_config (acon);
+ NMDhcpConfig *dhcp6 = nm_active_connection_get_dhcp6_config (acon);
b1 = print_dhcp6_config (dhcp6, nmc, "DHCP6", group_fld);
was_output = was_output || b1;
@@ -1151,7 +1149,8 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
NMSettingConnection *s_con;
NMSettingVpn *s_vpn;
NMVpnConnectionState vpn_state;
- char *type_str, *banner_str, *vpn_state_str;
+ char *type_str, *banner_str = NULL, *vpn_state_str;
+ const char *banner;
const char *username = NULL;
char **vpn_data_array = NULL;
guint32 items_num;
@@ -1184,7 +1183,9 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
}
type_str = get_vpn_connection_type (con);
- banner_str = g_strescape (nm_vpn_connection_get_banner (NM_VPN_CONNECTION (acon)), "");
+ banner = nm_vpn_connection_get_banner (NM_VPN_CONNECTION (acon));
+ if (banner)
+ banner_str = g_strescape (banner, "");
vpn_state = nm_vpn_connection_get_vpn_state (NM_VPN_CONNECTION (acon));
vpn_state_str = g_strdup_printf ("%d - %s", vpn_state, vpn_connection_state_to_string (vpn_state));
@@ -1327,12 +1328,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;
+ GPtrArray *invisibles, *sorted_cons;
nmc->should_wait = FALSE;
@@ -1366,13 +1529,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;
@@ -1445,7 +1614,7 @@ do_connections_show (NmCli *nmc, gboolean active_only, gboolean show_secrets,
if (con) {
nmc->required_fields = profile_flds;
if (show_secrets)
- update_secrets_in_connection (NM_REMOTE_CONNECTION (con));
+ update_secrets_in_connection (NM_REMOTE_CONNECTION (con), con);
res = nmc_connection_profile_details (con, nmc, show_secrets);
nmc->required_fields = NULL;
if (!res)
@@ -1719,7 +1888,7 @@ device_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
g_print (_("Connection successfully activated (master waiting for slaves) (D-Bus active path: %s)\n"),
nm_object_get_path (NM_OBJECT (active)));
quit ();
- } else if (ac_state != NM_ACTIVE_CONNECTION_STATE_ACTIVATING) {
+ } else if (active && ac_state != NM_ACTIVE_CONNECTION_STATE_ACTIVATING) {
g_string_printf (nmc->return_text, _("Error: Connection activation failed."));
nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
quit ();
@@ -1753,6 +1922,13 @@ active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpoin
const GPtrArray *devices;
NMDevice *device;
+ if (nmc->secret_agent) {
+ NMRemoteConnection *connection = nm_active_connection_get_connection (active);
+
+ nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent),
+ nm_connection_get_path (NM_CONNECTION (connection)));
+ }
+
devices = nm_active_connection_get_devices (active);
device = devices->len ? g_ptr_array_index (devices, 0) : NULL;
if ( device
@@ -1926,16 +2102,104 @@ activate_connection_cb (GObject *client, GAsyncResult *result, gpointer user_dat
g_free (info);
}
+/**
+ * parse_passwords:
+ * @passwd_file: file with passwords to parse
+ * @error: location to store error, or %NULL
+ *
+ * Parse passwords given in @passwd_file and insert them into a hash table.
+ * Example of @passwd_file contents:
+ * wifi.psk:tajne heslo
+ * 802-1x.password:krakonos
+ * 802-11-wireless-security:leap-password:my leap password
+ *
+ * Returns: hash table with parsed passwords, or %NULL on an error
+ */
+static GHashTable *
+parse_passwords (const char *passwd_file, GError **error)
+{
+ GHashTable *pwds_hash;
+ char *contents = NULL;
+ gsize len = 0;
+ GError *local_err = NULL;
+ char **lines, **iter;
+ char *pwd_spec, *pwd, *prop;
+ const char *setting;
+
+ pwds_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
+ if (!passwd_file)
+ return pwds_hash;
+
+ /* Read the passwords file */
+ if (!g_file_get_contents (passwd_file, &contents, &len, &local_err)) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("failed to read passwd-file '%s': %s"),
+ passwd_file, local_err->message);
+ g_error_free (local_err);
+ g_hash_table_destroy (pwds_hash);
+ return NULL;
+ }
+
+ lines = nmc_strsplit_set (contents, "\r\n", -1);
+ for (iter = lines; *iter; iter++) {
+ pwd = strchr (*iter, ':');
+ if (!pwd) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("missing colon in 'password' entry '%s'"), *iter);
+ goto failure;
+ }
+ *(pwd++) = '\0';
+
+ prop = strchr (*iter, '.');
+ if (!prop) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("missing dot in 'password' entry '%s'"), *iter);
+ goto failure;
+ }
+ *(prop++) = '\0';
+
+ setting = *iter;
+ while (g_ascii_isspace (*setting))
+ setting++;
+ /* Accept wifi-sec or wifi instead of cumbersome '802-11-wireless-security' */
+ if (!strcmp (setting, "wifi-sec") || !strcmp (setting, "wifi"))
+ setting = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;
+ if (nm_setting_lookup_type (setting) == G_TYPE_INVALID) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("invalid setting name in 'password' entry '%s'"), setting);
+ goto failure;
+ }
+
+ pwd_spec = g_strdup_printf ("%s.%s", setting, prop);
+ g_hash_table_insert (pwds_hash, pwd_spec, g_strdup (pwd));
+ }
+ g_strfreev (lines);
+ g_free (contents);
+ return pwds_hash;
+
+failure:
+ g_strfreev (lines);
+ g_free (contents);
+ g_hash_table_destroy (pwds_hash);
+ return NULL;
+}
+
+
+
static gboolean
nmc_activate_connection (NmCli *nmc,
NMConnection *connection,
const char *ifname,
const char *ap,
const char *nsp,
+ const char *pwds,
GAsyncReadyCallback callback,
GError **error)
{
ActivateConnectionInfo *info;
+
+ GHashTable *pwds_hash;
NMDevice *device = NULL;
const char *spec_object = NULL;
gboolean device_found;
@@ -1954,6 +2218,7 @@ nmc_activate_connection (NmCli *nmc,
g_clear_error (&local);
return FALSE;
}
+ g_clear_error (&local);
} else if (ifname) {
device = nm_client_get_device_by_iface (nmc->client, ifname);
if (!device) {
@@ -1967,6 +2232,26 @@ nmc_activate_connection (NmCli *nmc,
return FALSE;
}
+ /* Parse passwords given in passwords file */
+ pwds_hash = parse_passwords (pwds, &local);
+ if (local) {
+ g_propagate_error (error, local);
+ return FALSE;
+ }
+ if (nmc->pwds_hash)
+ g_hash_table_destroy (nmc->pwds_hash);
+ nmc->pwds_hash = pwds_hash;
+
+ /* Create secret agent */
+ nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-connect");
+ if (nmc->secret_agent) {
+ g_signal_connect (nmc->secret_agent, "request-secrets", G_CALLBACK (nmc_secrets_requested), nmc);
+ if (connection) {
+ nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent),
+ nm_object_get_path (NM_OBJECT (connection)));
+ }
+ }
+
info = g_malloc0 (sizeof (ActivateConnectionInfo));
info->nmc = nmc;
info->device = device;
@@ -1988,6 +2273,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
const char *ifname = NULL;
const char *ap = NULL;
const char *nsp = NULL;
+ const char *pwds = NULL;
GError *error = NULL;
const char *selector = NULL;
const char *name = NULL;
@@ -2022,8 +2308,14 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
next_arg (&argc, &argv);
}
- if (name)
+ if (name) {
connection = nmc_find_connection (nmc->connections, selector, name, NULL);
+ if (!connection) {
+ g_string_printf (nmc->return_text, _("Error: Connection '%s' does not exist."), name);
+ nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
+ goto error;
+ }
+ }
while (argc > 0) {
if (strcmp (*argv, "ifname") == 0) {
@@ -2055,6 +2347,15 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
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));
+ nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
+ goto error;
+ }
+
+ pwds = *argv;
+ }
else {
g_printerr (_("Unknown parameter: %s\n"), *argv);
}
@@ -2070,7 +2371,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
nmc->nowait_flag = (nmc->timeout == 0);
nmc->should_wait = TRUE;
- if (!nmc_activate_connection (nmc, connection, ifname, ap, nsp, activate_connection_cb, &error)) {
+ 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;
@@ -2090,21 +2391,104 @@ error:
return nmc->return_value;
}
+typedef struct {
+ NmCli *nmc;
+ GSList *queue;
+ guint timeout_id;
+} ConnectionCbInfo;
+
+static void connection_cb_info_finish (ConnectionCbInfo *info,
+ gpointer connection);
+
+static void
+connection_removed_cb (NMClient *client, NMConnection *connection, ConnectionCbInfo *info)
+{
+ if (!g_slist_find (info->queue, connection))
+ return;
+ g_print (_("Connection '%s' (%s) successfully deleted.\n"),
+ nm_connection_get_id (connection),
+ nm_connection_get_uuid (connection));
+ connection_cb_info_finish (info, connection);
+}
+
+static void
+down_active_connection_state_cb (NMActiveConnection *active,
+ GParamSpec *pspec,
+ ConnectionCbInfo *info)
+{
+ if (nm_active_connection_get_state (active) < NM_ACTIVE_CONNECTION_STATE_DEACTIVATED)
+ return;
+
+ if (info->nmc->print_output == NMC_PRINT_PRETTY)
+ nmc_terminal_erase_line ();
+ g_print (_("Connection '%s' successfully deactivated (D-Bus active path: %s)\n"),
+ nm_active_connection_get_id (active), nm_object_get_path (NM_OBJECT (active)));
+
+ g_signal_handlers_disconnect_by_func (G_OBJECT (active),
+ down_active_connection_state_cb,
+ info);
+ connection_cb_info_finish (info, active);
+}
+
+static gboolean
+connection_op_timeout_cb (gpointer user_data)
+{
+ ConnectionCbInfo *info = user_data;
+
+ timeout_cb (info->nmc);
+ connection_cb_info_finish (info, NULL);
+ return G_SOURCE_REMOVE;
+}
+
+static void
+destroy_queue_element (gpointer data)
+{
+ g_signal_handlers_disconnect_matched (data, G_SIGNAL_MATCH_FUNC, 0, 0, 0,
+ down_active_connection_state_cb, NULL);
+ g_object_unref (data);
+}
+
+static void
+connection_cb_info_finish (ConnectionCbInfo *info, gpointer connection)
+{
+ if (connection) {
+ info->queue = g_slist_remove (info->queue, connection);
+ g_object_unref (G_OBJECT (connection));
+ } else {
+ g_slist_free_full (info->queue, destroy_queue_element);
+ info->queue = NULL;
+ }
+
+ if (info->queue)
+ return;
+
+ if (info->timeout_id)
+ g_source_remove (info->timeout_id);
+ g_signal_handlers_disconnect_by_func (info->nmc->client, connection_removed_cb, info);
+ g_slice_free (ConnectionCbInfo, info);
+ quit ();
+}
+
static NMCResultCode
do_connection_down (NmCli *nmc, int argc, char **argv)
{
NMActiveConnection *active;
+ ConnectionCbInfo *info = NULL;
const GPtrArray *active_cons;
- char *line = NULL;
+ GSList *queue = NULL, *iter;
char **arg_arr = NULL;
char **arg_ptr = argv;
int arg_num = argc;
int idx = 0;
+ if (nmc->timeout == -1)
+ nmc->timeout = 10;
+
if (argc == 0) {
if (nmc->ask) {
- line = nmc_readline (PROMPT_CONNECTION);
- nmc_string_to_arg_array (line, "", &arg_arr, &arg_num);
+ 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;
}
if (arg_num == 0) {
@@ -2134,23 +2518,51 @@ do_connection_down (NmCli *nmc, int argc, char **argv)
active = find_active_connection (active_cons, nmc->connections, selector, *arg_ptr, &idx);
if (active) {
- nm_client_deactivate_connection (nmc->client, active, NULL, NULL);
+ /* Check if the connection is unique. */
+ /* Calling down for the same connection repeatedly would result in
+ * NM responding for the last D-Bus call only and we would stall. */
+ if (!g_slist_find (queue, active))
+ queue = g_slist_prepend (queue, g_object_ref (active));
} else {
- g_string_printf (nmc->return_text, _("Error: '%s' is not an active connection."), *arg_ptr);
+ g_printerr (_("Error: '%s' is not an active connection.\n"), *arg_ptr);
+ g_string_printf (nmc->return_text, _("Error: not all active connections found."));
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
- goto error;
}
if (idx == 0)
next_arg (&arg_num, &arg_ptr);
}
- // FIXME: do something better then sleep()
- /* Don't quit immediatelly and give NM time to check our permissions */
- sleep (1);
+ if (!queue) {
+ g_string_printf (nmc->return_text, _("Error: no active connection provided."));
+ nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
+ goto error;
+ }
+ queue = g_slist_reverse (queue);
+
+ if (nmc->timeout > 0) {
+ nmc->should_wait = TRUE;
+
+ info = g_slice_new0 (ConnectionCbInfo);
+ info->nmc = nmc;
+ info->queue = queue;
+ info->timeout_id = g_timeout_add_seconds (nmc->timeout, connection_op_timeout_cb, info);
+ }
+
+ for (iter = queue; iter; iter = g_slist_next (iter)) {
+ active = iter->data;
+
+ if (info)
+ g_signal_connect (active,
+ "notify::" NM_ACTIVE_CONNECTION_STATE,
+ G_CALLBACK (down_active_connection_state_cb),
+ info);
+
+ /* Now deactivate the connection */
+ nm_client_deactivate_connection (nmc->client, active, NULL, NULL);
+ }
error:
- nmc->should_wait = FALSE;
g_strfreev (arg_arr);
return nmc->return_value;
}
@@ -2688,9 +3100,9 @@ check_and_convert_vlan_prio_maps (const char *prio_map,
}
static gboolean
-add_ip4_address_to_connection (NMIP4Address *ip4addr, NMConnection *connection)
+add_ip4_address_to_connection (NMIPAddress *ip4addr, NMConnection *connection)
{
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
gboolean ret;
if (!ip4addr)
@@ -2698,22 +3110,22 @@ add_ip4_address_to_connection (NMIP4Address *ip4addr, NMConnection *connection)
s_ip4 = nm_connection_get_setting_ip4_config (connection);
if (!s_ip4) {
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
NULL);
}
- ret = nm_setting_ip4_config_add_address (s_ip4, ip4addr);
- nm_ip4_address_unref (ip4addr);
+ ret = nm_setting_ip_config_add_address (s_ip4, ip4addr);
+ nm_ip_address_unref (ip4addr);
return ret;
}
static gboolean
-add_ip6_address_to_connection (NMIP6Address *ip6addr, NMConnection *connection)
+add_ip6_address_to_connection (NMIPAddress *ip6addr, NMConnection *connection)
{
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
gboolean ret;
if (!ip6addr)
@@ -2721,14 +3133,14 @@ add_ip6_address_to_connection (NMIP6Address *ip6addr, NMConnection *connection)
s_ip6 = nm_connection_get_setting_ip6_config (connection);
if (!s_ip6) {
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
NULL);
}
- ret = nm_setting_ip6_config_add_address (s_ip6, ip6addr);
- nm_ip6_address_unref (ip6addr);
+ ret = nm_setting_ip_config_add_address (s_ip6, ip6addr);
+ nm_ip_address_unref (ip6addr);
return ret;
}
@@ -3257,7 +3669,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) {
@@ -3414,14 +3826,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) {
@@ -3499,6 +3911,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]: "));
@@ -3612,24 +4038,21 @@ do_questionnaire_olpc (char **channel, char **dhcp_anycast)
}
static gboolean
-split_address (char* str, char **ip, char **gw, char **rest)
+split_address (char* str, char **ip, char **rest)
{
- size_t n1, n2, n3, n4, n5;
+ size_t n1, n2, n3;
- *ip = *gw = *rest = NULL;
+ *ip = *rest = NULL;
if (!str)
return FALSE;
n1 = strspn (str, " \t");
n2 = strcspn (str+n1, " \t\0") + n1;
n3 = strspn (str+n2, " \t") + n2;
- n4 = strcspn (str+n3, " \t\0") + n3;
- n5 = strspn (str+n4, " \t") + n4;
- str[n2] = str[n4] = '\0';
+ str[n2] = '\0';
*ip = str[n1] ? str + n1 : NULL;
- *gw = str[n3] ? str + n3 : NULL;
- *rest = str[n5] ? str + n5 : NULL;
+ *rest = str[n3] ? str + n3 : NULL;
return TRUE;
}
@@ -3639,35 +4062,31 @@ ask_for_ip_addresses (NMConnection *connection, int family)
{
gboolean ip_loop;
GError *error = NULL;
- char *str, *ip, *gw, *rest;
+ char *str, *ip, *rest;
const char *prompt;
gboolean added;
- gpointer ipaddr;
+ NMIPAddress *ipaddr;
- if (family == 4)
- prompt =_("IPv4 address (IP[/plen] [gateway]) [none]: ");
+ if (family == AF_INET)
+ prompt =_("IPv4 address (IP[/plen]) [none]: ");
else
- prompt =_("IPv6 address (IP[/plen] [gateway]) [none]: ");
+ prompt =_("IPv6 address (IP[/plen]) [none]: ");
ip_loop = TRUE;
do {
str = nmc_readline ("%s", prompt);
- split_address (str, &ip, &gw, &rest);
+ split_address (str, &ip, &rest);
if (ip) {
- if (family == 4)
- ipaddr = nmc_parse_and_build_ip4_address (ip, gw, &error);
- else
- ipaddr = nmc_parse_and_build_ip6_address (ip, gw, &error);
+ ipaddr = nmc_parse_and_build_address (family, ip, &error);
if (ipaddr) {
- if (family == 4)
- added = add_ip4_address_to_connection ((NMIP4Address *) ipaddr, connection);
+ if (family == AF_INET)
+ added = add_ip4_address_to_connection (ipaddr, connection);
else
- added = add_ip6_address_to_connection ((NMIP6Address *) ipaddr, connection);
- gw = gw ? gw : (family == 4) ? "0.0.0.0" : "::";
+ added = add_ip6_address_to_connection (ipaddr, connection);
if (added)
- g_print (_(" Address successfully added: %s %s\n"), ip, gw);
+ g_print (_(" Address successfully added: %s\n"), ip);
else
- g_print (_(" Warning: address already present: %s %s\n"), ip, gw);
+ g_print (_(" Warning: address already present: %s\n"), ip);
if (rest)
g_print (_(" Warning: ignoring garbage at the end: '%s'\n"), rest);
} else {
@@ -3683,6 +4102,45 @@ ask_for_ip_addresses (NMConnection *connection, int family)
}
static void
+maybe_ask_for_gateway (NMConnection *connection, int family)
+{
+ gboolean gw_loop;
+ char *str, *gw, *rest;
+ const char *prompt;
+ NMSettingIPConfig *s_ip;
+
+ if (family == AF_INET) {
+ prompt =_("IPv4 gateway [none]: ");
+ s_ip = nm_connection_get_setting_ip4_config (connection);
+ } else {
+ prompt =_("IPv6 gateway [none]: ");
+ s_ip = nm_connection_get_setting_ip6_config (connection);
+ }
+ if (s_ip == NULL)
+ return;
+ if ( nm_setting_ip_config_get_num_addresses (s_ip) == 0
+ || nm_setting_ip_config_get_gateway (s_ip) != NULL)
+ return;
+
+ gw_loop = TRUE;
+ do {
+ str = nmc_readline ("%s", prompt);
+ split_address (str, &gw, &rest);
+ if (gw) {
+ if (nm_utils_ipaddr_valid (family, gw)) {
+ g_object_set (s_ip,
+ NM_SETTING_IP_CONFIG_GATEWAY, gw,
+ NULL);
+ gw_loop = FALSE;
+ } else
+ g_print (_("Error: invalid gateway address '%s'\n"), gw);
+ } else
+ gw_loop = FALSE;
+ g_free (str);
+ } while (gw_loop);
+}
+
+static void
do_questionnaire_ip (NMConnection *connection)
{
char *answer;
@@ -3694,14 +4152,14 @@ do_questionnaire_ip (NMConnection *connection)
g_free (answer);
return;
}
+ g_free (answer);
g_print (_("Press <Enter> to finish adding addresses.\n"));
- ask_for_ip_addresses (connection, 4);
- ask_for_ip_addresses (connection, 6);
-
- g_free (answer);
- return;
+ ask_for_ip_addresses (connection, AF_INET);
+ maybe_ask_for_gateway (connection, AF_INET);
+ ask_for_ip_addresses (connection, AF_INET6);
+ maybe_ask_for_gateway (connection, AF_INET6);
}
static gboolean
@@ -3714,6 +4172,7 @@ complete_connection_by_type (NMConnection *connection,
GError **error)
{
NMSettingConnection *s_con;
+ NMSettingGeneric *s_generic;
NMSettingWired *s_wired;
NMSettingInfiniband *s_infiniband;
NMSettingWireless *s_wifi;
@@ -3755,9 +4214,9 @@ complete_connection_by_type (NMConnection *connection,
return FALSE;
/* Also ask for all optional arguments if '--ask' is specified. */
- mtu = mtu_c ? g_strdup (mtu_c) : NULL;
- mac = mac_c ? g_strdup (mac_c) : NULL;
- cloned_mac = cloned_mac_c ? g_strdup (cloned_mac_c) : NULL;
+ mtu = g_strdup (mtu_c);
+ mac = g_strdup (mac_c);
+ cloned_mac = g_strdup (cloned_mac_c);
if (ask)
do_questionnaire_ethernet (TRUE, &mtu, &mac, &cloned_mac);
@@ -3813,11 +4272,11 @@ cleanup_wired:
return FALSE;
/* Also ask for all optional arguments if '--ask' is specified. */
- mtu = mtu_c ? g_strdup (mtu_c) : NULL;
- mac = mac_c ? g_strdup (mac_c) : NULL;
- mode = mode_c ? g_strdup (mode_c) : NULL;
- parent = parent_c ? g_strdup (parent_c) : NULL;
- p_key = p_key_c ? g_strdup (p_key_c) : NULL;
+ mtu = g_strdup (mtu_c);
+ mac = g_strdup (mac_c);
+ mode = g_strdup (mode_c);
+ parent = g_strdup (parent_c);
+ p_key = g_strdup (p_key_c);
if (ask)
do_questionnaire_infiniband (&mtu, &mac, &mode, &parent, &p_key);
@@ -3897,10 +4356,10 @@ cleanup_ib:
}
/* Also ask for all optional arguments if '--ask' is specified. */
- mtu = mtu_c ? g_strdup (mtu_c) : NULL;
- mac = mac_c ? g_strdup (mac_c) : NULL;
- cloned_mac = cloned_mac_c ? g_strdup (cloned_mac_c) : NULL;
- mode = mode_c ? g_strdup (mode_c) : NULL;
+ mtu = g_strdup (mtu_c);
+ mac = g_strdup (mac_c);
+ cloned_mac = g_strdup (cloned_mac_c);
+ mode = g_strdup (mode_c);
if (ask)
do_questionnaire_wifi (&mtu, &mac, &cloned_mac, &mode);
@@ -3964,7 +4423,7 @@ cleanup_wifi:
}
/* Also ask for all optional arguments if '--ask' is specified. */
- mac = mac_c ? g_strdup (mac_c) : NULL;
+ mac = g_strdup (mac_c);
if (ask)
do_questionnaire_wimax (&mac);
@@ -4091,8 +4550,8 @@ cleanup_pppoe:
}
/* Also ask for all optional arguments if '--ask' is specified. */
- user = user_c ? g_strdup (user_c) : NULL;
- password = password_c ? g_strdup (password_c) : NULL;
+ user = g_strdup (user_c);
+ password = g_strdup (password_c);
if (ask)
do_questionnaire_mobile (&user, &password);
@@ -4154,7 +4613,7 @@ cleanup_mobile:
goto cleanup_bt;
/* Also ask for all optional arguments if '--ask' is specified. */
- bt_type = bt_type_c ? g_strdup (bt_type_c) : NULL;
+ bt_type = g_strdup (bt_type_c);
if (ask)
do_questionnaire_bluetooth (&bt_type);
@@ -4264,10 +4723,10 @@ cleanup_bt:
}
/* Also ask for all optional arguments if '--ask' is specified. */
- mtu = mtu_c ? g_strdup (mtu_c) : NULL;
- flags = flags_c ? g_strdup (flags_c) : NULL;
- ingress = ingress_c ? g_strdup (ingress_c) : NULL;
- egress = egress_c ? g_strdup (egress_c) : NULL;
+ mtu = g_strdup (mtu_c);
+ flags = g_strdup (flags_c);
+ ingress = g_strdup (ingress_c);
+ egress = g_strdup (egress_c);
if (ask)
do_questionnaire_vlan (&mtu, &flags, &ingress, &egress);
@@ -4357,13 +4816,13 @@ cleanup_vlan:
return FALSE;
/* Also ask for all optional arguments if '--ask' is specified. */
- bond_mode = bond_mode_c ? g_strdup (bond_mode_c) : NULL;
- bond_primary = bond_primary_c ? g_strdup (bond_primary_c) : NULL;
- bond_miimon = bond_miimon_c ? g_strdup (bond_miimon_c) : NULL;
- bond_downdelay = bond_downdelay_c ? g_strdup (bond_downdelay_c) : NULL;
- bond_updelay = bond_updelay_c ? g_strdup (bond_updelay_c) : NULL;
- bond_arpinterval = bond_arpinterval_c ? g_strdup (bond_arpinterval_c) : NULL;
- bond_arpiptarget = bond_arpiptarget_c ? g_strdup (bond_arpiptarget_c) : NULL;
+ bond_mode = g_strdup (bond_mode_c);
+ bond_primary = g_strdup (bond_primary_c);
+ bond_miimon = g_strdup (bond_miimon_c);
+ bond_downdelay = g_strdup (bond_downdelay_c);
+ bond_updelay = g_strdup (bond_updelay_c);
+ bond_arpinterval = g_strdup (bond_arpinterval_c);
+ bond_arpiptarget = g_strdup (bond_arpiptarget_c);
bond_lacp_rate = g_strdup (bond_lacp_rate_c);
if (ask)
do_questionnaire_bond (&bond_mode, &bond_primary, &bond_miimon,
@@ -4615,7 +5074,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;
@@ -4626,6 +5087,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} };
@@ -4633,16 +5095,17 @@ cleanup_team_slave:
return FALSE;
/* Also ask for all optional arguments if '--ask' is specified. */
- stp = stp_c ? g_strdup (stp_c) : NULL;
- priority = priority_c ? g_strdup (priority_c) : NULL;
- fwd_delay = fwd_delay_c ? g_strdup (fwd_delay_c) : NULL;
- hello_time = hello_time_c ? g_strdup (hello_time_c) : NULL;
- max_age = max_age_c ? g_strdup (max_age_c) : NULL;
- ageing_time = ageing_time_c ? g_strdup (ageing_time_c) : NULL;
+ stp = g_strdup (stp_c);
+ priority = g_strdup (priority_c);
+ fwd_delay = g_strdup (fwd_delay_c);
+ 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);
@@ -4664,6 +5127,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 */
@@ -4706,6 +5178,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);
@@ -4717,6 +5191,7 @@ 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;
@@ -4771,9 +5246,9 @@ cleanup_bridge:
nm_connection_add_setting (connection, NM_SETTING (s_bridge_port));
/* Also ask for all optional arguments if '--ask' is specified. */
- priority = priority_c ? g_strdup (priority_c) : NULL;
- path_cost = path_cost_c ? g_strdup (path_cost_c) : NULL;
- hairpin = hairpin_c ? g_strdup (hairpin_c) : NULL;
+ 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);
@@ -4855,7 +5330,7 @@ cleanup_bridge_slave:
service_type = g_strdup_printf ("%s.%s", NM_DBUS_INTERFACE, st);
/* Also ask for all optional arguments if '--ask' is specified. */
- user = user_c ? g_strdup (user_c) : NULL;
+ user = g_strdup (user_c);
if (ask)
do_questionnaire_vpn (&user);
@@ -4902,8 +5377,8 @@ cleanup_vpn:
}
/* Also ask for all optional arguments if '--ask' is specified. */
- channel = channel_c ? g_strdup (channel_c) : NULL;
- dhcp_anycast = dhcp_anycast_c ? g_strdup (dhcp_anycast_c) : NULL;
+ channel = g_strdup (channel_c);
+ dhcp_anycast = g_strdup (dhcp_anycast_c);
if (ask)
do_questionnaire_olpc (&channel, &dhcp_anycast);
@@ -4940,6 +5415,10 @@ cleanup_olpc:
if (!success)
return FALSE;
+ } else if (!strcmp (con_type, NM_SETTING_GENERIC_SETTING_NAME)) {
+ /* Add 'generic' setting */
+ s_generic = (NMSettingGeneric *) nm_setting_generic_new ();
+ nm_connection_add_setting (connection, NM_SETTING (s_generic));
} else {
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
_("Error: '%s' is not a valid connection type."),
@@ -4952,8 +5431,7 @@ cleanup_olpc:
&& strcmp (con_type, "team-slave") != 0
&& strcmp (con_type, "bridge-slave") != 0) {
- NMIP4Address *ip4addr = NULL;
- NMIP6Address *ip6addr = NULL;
+ 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},
{"ip6", TRUE, &ip6, FALSE}, {"gw6", TRUE, &gw6, FALSE},
@@ -4973,7 +5451,7 @@ cleanup_olpc:
/* coverity[dead_error_begin] */
if (ip4) {
- ip4addr = nmc_parse_and_build_ip4_address (ip4, gw4, error);
+ ip4addr = nmc_parse_and_build_address (AF_INET, ip4, error);
if (!ip4addr) {
g_prefix_error (error, _("Error: "));
return FALSE;
@@ -4982,14 +5460,60 @@ cleanup_olpc:
}
/* coverity[dead_error_begin] */
+ if (gw4) {
+ NMSettingIPConfig *s_ip = nm_connection_get_setting_ip4_config (connection);
+
+ if (!s_ip) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("Error: IPv4 gateway specified without IPv4 addresses"));
+ return FALSE;
+ } else if (nm_setting_ip_config_get_gateway (s_ip)) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("Error: multiple IPv4 gateways specified"));
+ return FALSE;
+ } else if (!nm_utils_ipaddr_valid (AF_INET, gw4)) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("Error: Invalid IPv4 gateway '%s'"),
+ gw4);
+ }
+
+ g_object_set (s_ip,
+ NM_SETTING_IP_CONFIG_GATEWAY, gw4,
+ NULL);
+ }
+
+ /* coverity[dead_error_begin] */
if (ip6) {
- ip6addr = nmc_parse_and_build_ip6_address (ip6, gw6, error);
+ ip6addr = nmc_parse_and_build_address (AF_INET6, ip6, error);
if (!ip6addr) {
g_prefix_error (error, _("Error: "));
return FALSE;
}
add_ip6_address_to_connection (ip6addr, connection);
}
+
+ /* coverity[dead_error_begin] */
+ if (gw6) {
+ NMSettingIPConfig *s_ip = nm_connection_get_setting_ip6_config (connection);
+
+ if (!s_ip) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("Error: IPv6 gateway specified without IPv6 addresses"));
+ return FALSE;
+ } else if (nm_setting_ip_config_get_gateway (s_ip)) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("Error: multiple IPv6 gateways specified"));
+ return FALSE;
+ } else if (!nm_utils_ipaddr_valid (AF_INET, gw6)) {
+ g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
+ _("Error: Invalid IPv6 gateway '%s'"),
+ gw6);
+ }
+
+ g_object_set (s_ip,
+ NM_SETTING_IP_CONFIG_GATEWAY, gw6,
+ NULL);
+ }
}
/* Ask for addresses if '--ask' is specified. */
@@ -5426,19 +5950,6 @@ uuid_display_hook (char **array, int len, int max_len)
rl_forced_update_display ();
}
-static char *pre_input_deftext;
-static int
-set_deftext (void)
-{
- if (pre_input_deftext && rl_startup_hook) {
- rl_insert_text (pre_input_deftext);
- g_free (pre_input_deftext);
- pre_input_deftext = NULL;
- rl_startup_hook = NULL;
- }
- return 0;
-}
-
static char *
gen_nmcli_cmds_menu (const char *text, int state)
{
@@ -5877,11 +6388,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;
@@ -5899,19 +6407,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");
@@ -6662,7 +7158,8 @@ is_connection_dirty (NMConnection *connection, NMRemoteConnection *remote)
{
return !nm_connection_compare (connection,
remote ? NM_CONNECTION (remote) : NULL,
- NM_SETTING_COMPARE_FLAG_EXACT);
+ NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS |
+ NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP);
}
static gboolean
@@ -6706,7 +7203,8 @@ property_edit_submenu (NmCli *nmc,
gboolean temp_changes;
gboolean removed;
- prompt = nmc_colorize (nmc->editor_prompt_color, "nmcli %s.%s> ",
+ prompt = nmc_colorize (nmc->editor_prompt_color, NMC_TERM_FORMAT_NORMAL,
+ "nmcli %s.%s> ",
nm_setting_get_name (curr_setting), prop_name);
while (cmd_property_loop) {
@@ -6767,8 +7265,8 @@ property_edit_submenu (NmCli *nmc,
break;
case NMC_EDITOR_SUB_CMD_CHANGE:
- rl_startup_hook = set_deftext;
- pre_input_deftext = nmc_setting_get_property_out2in (curr_setting, prop_name, NULL);
+ rl_startup_hook = nmc_rl_set_deftext;
+ nmc_rl_pre_input_deftext = nmc_setting_get_property_out2in (curr_setting, prop_name, NULL);
prop_val_user = nmc_readline (_("Edit '%s' value: "), prop_name);
nmc_property_get_gvalue (curr_setting, prop_name, &prop_g_value);
@@ -6918,7 +7416,7 @@ is_property_valid (NMSetting *setting, const char *property, GError **error)
valid_props = nmc_setting_get_valid_properties (setting);
prop_name = nmc_string_is_valid (property, (const char **) valid_props, error);
- ret = prop_name ? g_strdup (prop_name) : NULL;
+ ret = g_strdup (prop_name);
g_strfreev (valid_props);
return ret;
}
@@ -7054,7 +7552,7 @@ menu_switch_to_level0 (NmcEditorMenuContext *menu_ctx,
{
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 (prompt_color, NMC_TERM_FORMAT_NORMAL, "%s", prompt);
menu_ctx->curr_setting = NULL;
g_strfreev (menu_ctx->valid_props);
menu_ctx->valid_props = NULL;
@@ -7070,7 +7568,8 @@ menu_switch_to_level1 (NmcEditorMenuContext *menu_ctx,
{
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 (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);
@@ -7104,7 +7603,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->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;
@@ -7654,7 +8154,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
nmc->nowait_flag = FALSE;
nmc->should_wait = TRUE;
nmc->print_output = NMC_PRINT_PRETTY;
- if (!nmc_activate_connection (nmc, NM_CONNECTION (rem_con), ifname, ap_nsp, ap_nsp,
+ if (!nmc_activate_connection (nmc, NM_CONNECTION (rem_con), ifname, ap_nsp, ap_nsp, NULL,
activate_connection_editor_cb, &tmp_err)) {
g_print (_("Error: Cannot activate connection: %s.\n"), tmp_err->message);
g_clear_error (&tmp_err);
@@ -7740,9 +8240,11 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
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->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->editor_prompt_color, NMC_TERM_FORMAT_NORMAL,
+ "nmcli %s> ",
nm_setting_get_name (menu_ctx.curr_setting));
}
} else if (!cmd_arg_p) {
@@ -7925,8 +8427,7 @@ editor_init_new_connection (NmCli *nmc, NMConnection *connection)
static void
editor_init_existing_connection (NMConnection *connection)
{
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4, *s_ip6;
NMSettingWireless *s_wireless;
NMSettingConnection *s_con;
@@ -8021,14 +8522,14 @@ do_connection_edit (NmCli *nmc, int argc, char **argv)
goto error;
}
- /* Merge secrets into the connection */
- update_secrets_in_connection (NM_REMOTE_CONNECTION (found_con));
-
/* Duplicate the connection and use that so that we need not
* differentiate existing vs. new later
*/
connection = nm_simple_connection_new_clone (found_con);
+ /* Merge secrets into the connection */
+ update_secrets_in_connection (NM_REMOTE_CONNECTION (found_con), connection);
+
s_con = nm_connection_get_setting_connection (connection);
g_assert (s_con);
connection_type = nm_setting_connection_get_connection_type (s_con);
@@ -8337,52 +8838,45 @@ finish:
return nmc->return_value;
}
-
-typedef struct {
- NmCli *nmc;
- int counter;
-} DeleteStateInfo;
-
static void
delete_cb (GObject *con, GAsyncResult *result, gpointer user_data)
{
- DeleteStateInfo *info = (DeleteStateInfo *) user_data;
+ ConnectionCbInfo *info = (ConnectionCbInfo *) user_data;
GError *error = NULL;
if (!nm_remote_connection_delete_finish (NM_REMOTE_CONNECTION (con), result, &error)) {
- g_string_printf (info->nmc->return_text, _("Error: Connection deletion failed: %s"),
- error->message);
+ g_string_printf (info->nmc->return_text, _("Error: not all connections deleted."));
+ g_printerr (_("Error: Connection deletion failed: %s"),
+ error->message);
g_error_free (error);
info->nmc->return_value = NMC_RESULT_ERROR_CON_DEL;
- }
-
- info->counter--;
- if (info->counter == 0) {
- g_free (info);
- quit ();
+ connection_cb_info_finish (info, con);
+ } else {
+ if (info->nmc->nowait_flag)
+ connection_cb_info_finish (info, con);
}
}
static NMCResultCode
do_connection_delete (NmCli *nmc, int argc, char **argv)
{
- NMConnection *connection = NULL;
- DeleteStateInfo *del_info = NULL;
- char *line = NULL;
+ NMConnection *connection;
+ ConnectionCbInfo *info = NULL;
+ GSList *queue = NULL, *iter;
char **arg_arr = NULL;
char **arg_ptr = argv;
int arg_num = argc;
GString *invalid_cons = NULL;
- gboolean del_info_free = FALSE;
int pos = 0;
- nmc->return_value = NMC_RESULT_SUCCESS;
- nmc->should_wait = FALSE;
+ if (nmc->timeout == -1)
+ nmc->timeout = 10;
if (argc == 0) {
if (nmc->ask) {
- line = nmc_readline (PROMPT_CONNECTION);
- nmc_string_to_arg_array (line, "", &arg_arr, &arg_num);
+ char *line = nmc_readline (PROMPT_CONNECTIONS);
+ nmc_string_to_arg_array (line, NULL, TRUE, &arg_arr, &arg_num);
+ g_free (line);
arg_ptr = arg_arr;
}
if (arg_num == 0) {
@@ -8392,11 +8886,6 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
}
}
- del_info = g_malloc0 (sizeof (DeleteStateInfo));
- del_info->nmc = nmc;
- del_info->counter = 0;
- del_info_free = TRUE;
-
while (arg_num > 0) {
const char *selector = NULL;
@@ -8412,43 +8901,50 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
}
connection = nmc_find_connection (nmc->connections, selector, *arg_ptr, &pos);
- if (!connection) {
- if (nmc->print_output != NMC_PRINT_TERSE)
- g_print (_("Error: unknown connection: %s\n"), *arg_ptr);
-
+ if (connection) {
+ /* Check if the connection is unique. */
+ /* Calling delete for the same connection repeatedly would result in
+ * NM responding for the last D-Bus call only and we would stall. */
+ if (!g_slist_find (queue, connection))
+ queue = g_slist_prepend (queue, g_object_ref (connection));
+ } else {
+ g_printerr (_("Error: unknown connection '%s'\n"), *arg_ptr);
+ g_string_printf (nmc->return_text, _("Error: not all active connections found."));
+ nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
if (!invalid_cons)
invalid_cons = g_string_new (NULL);
g_string_append_printf (invalid_cons, "'%s', ", *arg_ptr);
+ }
- /* take the next argument and continue */
+ /* Take next argument (if there's no other connection of the same name) */
+ if (!pos)
next_arg (&arg_num, &arg_ptr);
- continue;
- }
+ }
- /* We need to wait a bit so that nmcli's permissions can be checked.
- * We will exit when D-Bus return (error) messages are received.
- */
- nmc->should_wait = TRUE;
+ if (!queue) {
+ g_string_printf (nmc->return_text, _("Error: no connection provided."));
+ nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
+ goto finish;
+ }
+ queue = g_slist_reverse (queue);
- /* del_info deallocation is handled in delete_cb() */
- del_info_free = FALSE;
+ info = g_slice_new0 (ConnectionCbInfo);
+ info->nmc = nmc;
+ info->queue = queue;
+ info->timeout_id = g_timeout_add_seconds (nmc->timeout, connection_op_timeout_cb, info);
- del_info->counter++;
+ nmc->nowait_flag = (nmc->timeout == 0);
+ nmc->should_wait = TRUE;
- /* Delete the connection */
- nm_remote_connection_delete_async (NM_REMOTE_CONNECTION (connection),
- NULL, delete_cb, del_info);
+ g_signal_connect (nmc->client, NM_CLIENT_CONNECTION_REMOVED,
+ G_CALLBACK (connection_removed_cb), info);
- /* Take next argument (if there's no other connection of the same name) */
- if (!pos)
- next_arg (&arg_num, &arg_ptr);
- }
+ /* Now delete the connections */
+ for (iter = queue; iter; iter = g_slist_next (iter))
+ nm_remote_connection_delete_async (NM_REMOTE_CONNECTION (iter->data),
+ NULL, delete_cb, info);
finish:
- if (del_info_free)
- g_free (del_info);
- g_strfreev (arg_arr);
-
if (invalid_cons) {
g_string_truncate (invalid_cons, invalid_cons->len-2); /* truncate trailing ", " */
g_string_printf (nmc->return_text, _("Error: cannot delete unknown connection(s): %s."),
@@ -8456,6 +8952,7 @@ finish:
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
g_string_free (invalid_cons, TRUE);
}
+ g_strfreev (arg_arr);
return nmc->return_value;
}
@@ -8571,7 +9068,7 @@ gen_func_connection_names (const char *text, int state)
for (i = 0; i < nm_cli.connections->len; i++) {
NMConnection *con = NM_CONNECTION (nm_cli.connections->pdata[i]);
const char *id = nm_connection_get_id (con);
- connections[i++] = id;
+ connections[i] = id;
}
connections[i] = NULL;
@@ -8581,6 +9078,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)
{
@@ -8590,14 +9113,19 @@ nmcli_con_tab_completion (const char *text, int start, int end)
/* Disable readline's default filename completion */
rl_attempted_completion_over = 1;
- /* Disable appending space after completion */
- rl_completion_append_character = '\0';
+ if (g_strcmp0 (rl_prompt, PROMPT_CONNECTION) == 0) {
+ /* Disable appending space after completion */
+ rl_completion_append_character = '\0';
- if (!is_single_word (rl_line_buffer))
- return NULL;
+ if (!is_single_word (rl_line_buffer))
+ return NULL;
- if (g_strcmp0 (rl_prompt, PROMPT_CONNECTION) == 0)
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;
+ }
if (generator_func)
match_array = rl_completion_matches (text, generator_func);
@@ -8605,12 +9133,75 @@ 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)
{
GError *error = NULL;
+ /* Register polkit agent */
+ nmc_start_polkit_agent_start_try (nmc);
+
/* Set completion function for 'nmcli con' */
rl_attempted_completion_function = (rl_completion_func_t *) nmcli_con_tab_completion;
@@ -8644,16 +9235,17 @@ 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);
@@ -8662,8 +9254,21 @@ do_connections (NmCli *nmc, int argc, char **argv)
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);
+ 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) {
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index 3d9598fb41..987d8de9e9 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -28,12 +28,15 @@
#include <glib.h>
#include <glib/gi18n.h>
+#include "nm-secret-agent-simple.h"
+#include "polkit-agent.h"
#include "utils.h"
#include "common.h"
#include "devices.h"
/* define some prompts */
-#define PROMPT_INTERFACE _("Interface: ")
+#define PROMPT_INTERFACE _("Interface: ")
+#define PROMPT_INTERFACES _("Interface(s): ")
/* Available fields for 'device status' */
static NmcOutputField nmc_fields_dev_status[] = {
@@ -190,11 +193,12 @@ static NmcOutputField nmc_fields_dev_show_master_prop[] = {
/* Available fields for 'device show' - VLAN part */
static NmcOutputField nmc_fields_dev_show_vlan_prop[] = {
{"NAME", N_("NAME"), 18}, /* 0 */
- {"ID", N_("ID"), 5}, /* 1 */
+ {"PARENT", N_("PARENT"), 10}, /* 1 */
+ {"ID", N_("ID"), 5}, /* 2 */
{NULL, NULL, 0}
};
-#define NMC_FIELDS_DEV_SHOW_VLAN_PROP_ALL "NAME,ID"
-#define NMC_FIELDS_DEV_SHOW_VLAN_PROP_COMMON "NAME,ID"
+#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[] = {
@@ -262,8 +266,8 @@ usage (void)
" status\n\n"
" show [<ifname>]\n\n"
" connect <ifname>\n\n"
- " disconnect <ifname>\n\n"
- " delete <ifname>\n\n"
+ " disconnect <ifname> ...\n\n"
+ " delete <ifname> ...\n\n"
" wifi [list [ifname <ifname>] [bssid <BSSID>]]\n\n"
" wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] [ifname <ifname>]\n"
" [bssid <BSSID>] [name <name>] [private yes|no]\n\n"
@@ -317,9 +321,9 @@ usage_device_disconnect (void)
{
g_printerr (_("Usage: nmcli device disconnect { ARGUMENTS | help }\n"
"\n"
- "ARGUMENTS := <ifname>\n"
+ "ARGUMENTS := <ifname> ...\n"
"\n"
- "Disconnect the device.\n"
+ "Disconnect devices.\n"
"The command disconnects the device and prevents it from auto-activating\n"
"further connections without user/manual intervention.\n\n"));
}
@@ -329,10 +333,10 @@ usage_device_delete (void)
{
g_printerr (_("Usage: nmcli device delete { ARGUMENTS | help }\n"
"\n"
- "ARGUMENTS := <ifname>\n"
+ "ARGUMENTS := <ifname> ...\n"
"\n"
- "Deletes the software device.\n"
- "The command removes the interface. It only works for software devices\n"
+ "Delete the software devices.\n"
+ "The command removes the interfaces. It only works for software devices\n"
"(like bonds, bridges, etc.). Hardware devices cannot be deleted by the\n"
"command.\n\n"));
}
@@ -433,6 +437,60 @@ get_devices_sorted (NMClient *client)
return sorted;
}
+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)
{
@@ -502,6 +560,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);
@@ -587,6 +646,13 @@ 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);
@@ -766,10 +832,8 @@ show_device_info (NMDevice *device, NmCli *nmc)
NmcOutputField *tmpl, *arr;
size_t tmpl_len;
gboolean was_output = FALSE;
- NMIP4Config *cfg4;
- NMIP6Config *cfg6;
- NMDhcp4Config *dhcp4;
- NMDhcp6Config *dhcp6;
+ NMIPConfig *cfg4, *cfg6;
+ NMDhcpConfig *dhcp4, *dhcp6;
const char *base_hdr = _("Device details");
GPtrArray *fields_in_section = NULL;
@@ -892,7 +956,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)) {
@@ -941,8 +1005,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;
@@ -1084,6 +1149,7 @@ show_device_info (NMDevice *device, NmCli *nmc)
if ((NM_IS_DEVICE_VLAN (device))) {
if (!strcasecmp (nmc_fields_dev_show_sections[section_idx].name, nmc_fields_dev_show_sections[14].name)) {
char * vlan_id_str = g_strdup_printf ("%u", nm_device_vlan_get_vlan_id (NM_DEVICE_VLAN (device)));
+ NMDevice *parent = nm_device_vlan_get_parent (NM_DEVICE_VLAN (device));
tmpl = nmc_fields_dev_show_vlan_prop;
tmpl_len = sizeof (nmc_fields_dev_show_vlan_prop);
@@ -1094,7 +1160,8 @@ show_device_info (NMDevice *device, NmCli *nmc)
arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
set_val_strc (arr, 0, nmc_fields_dev_show_sections[14].name); /* "VLAN" */
- set_val_str (arr, 1, vlan_id_str);
+ set_val_strc (arr, 1, parent ? nm_device_get_iface (parent) : NULL);
+ set_val_str (arr, 2, vlan_id_str);
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
@@ -1185,15 +1252,27 @@ static void
fill_output_device_status (NMDevice *device, NmCli *nmc)
{
NMActiveConnection *ac;
+ NMDeviceState state;
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 */
+ if (state <= NM_DEVICE_STATE_UNAVAILABLE)
+ set_val_color_fmt_all (arr, NMC_TERM_FORMAT_DIM);
+ else if (state == NM_DEVICE_STATE_DISCONNECTED)
+ set_val_color_all (arr, NMC_TERM_COLOR_RED);
+ else if (state >= NM_DEVICE_STATE_PREPARE && state <= NM_DEVICE_STATE_SECONDARIES)
+ set_val_color_all (arr, NMC_TERM_COLOR_YELLOW);
+ else if (state == NM_DEVICE_STATE_ACTIVATED)
+ set_val_color_all (arr, NMC_TERM_COLOR_GREEN);
+
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);
@@ -1332,48 +1411,57 @@ progress_cb (gpointer user_data)
return TRUE;
}
+static void connected_state_cb (NMDevice *device, NMActiveConnection *active);
+
static void
-connected_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
+device_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
{
NMActiveConnection *active = (NMActiveConnection *) user_data;
- NMDeviceState state;
- state = nm_device_get_state (device);
+ connected_state_cb (device, active);
+}
- if (state == NM_DEVICE_STATE_ACTIVATED) {
- nmc_terminal_erase_line ();
- g_print (_("Device '%s' successfully activated with '%s'.\n"),
- nm_device_get_iface (device),
- nm_active_connection_get_uuid (active));
- g_object_unref (active);
- quit ();
- }
+static void
+active_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpointer user_data)
+{
+ NMDevice *device = (NMDevice *) user_data;
+
+ connected_state_cb (device, active);
}
static void
-monitor_device_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
+connected_state_cb (NMDevice *device, NMActiveConnection *active)
{
- NmCli *nmc = (NmCli *) user_data;
NMDeviceState state;
NMDeviceStateReason reason;
+ NMActiveConnectionState ac_state;
state = nm_device_get_state (device);
+ ac_state = nm_active_connection_get_state (active);
- if (state == NM_DEVICE_STATE_ACTIVATED) {
- NMActiveConnection *active = nm_device_get_active_connection (device);
+ if (ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING)
+ return;
- 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));
- quit ();
- } else if (state == NM_DEVICE_STATE_FAILED) {
+ if (state == NM_DEVICE_STATE_ACTIVATED) {
+ nmc_terminal_erase_line ();
+ g_print (_("Device '%s' successfully activated with '%s'.\n"),
+ nm_device_get_iface (device),
+ nm_active_connection_get_uuid (active));
+ } else if ( state <= NM_DEVICE_STATE_DISCONNECTED
+ || state >= NM_DEVICE_STATE_DEACTIVATING) {
reason = nm_device_get_state_reason (device);
- g_string_printf (nmc->return_text, _("Error: Connection activation failed: (%d) %s."),
- reason, nmc_device_reason_to_string (reason));
- nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
- quit ();
- }
+ g_print (_("Error: Connection activation failed: (%d) %s.\n"),
+ reason, nmc_device_reason_to_string (reason));
+ } else
+ return;
+
+ g_signal_handlers_disconnect_by_func (active, G_CALLBACK (active_state_cb), device);
+ g_signal_handlers_disconnect_by_func (device, G_CALLBACK (device_state_cb), active);
+
+ g_object_unref (active);
+ g_object_unref (device);
+
+ quit ();
}
typedef struct {
@@ -1407,6 +1495,7 @@ add_and_activate_cb (GObject *client,
if (state == NM_ACTIVE_CONNECTION_STATE_UNKNOWN) {
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 ();
}
@@ -1421,12 +1510,14 @@ add_and_activate_cb (GObject *client,
g_object_unref (active);
quit ();
} else {
- g_signal_connect (device, "notify::state", G_CALLBACK (monitor_device_state_cb), nmc);
+ g_object_ref (device);
+ g_signal_connect (device, "notify::state", G_CALLBACK (device_state_cb), active);
+ g_signal_connect (active, "notify::state", G_CALLBACK (active_state_cb), device);
+
g_timeout_add_seconds (nmc->timeout, timeout_cb, nmc); /* Exit if timeout expires */
if (nmc->print_output == NMC_PRINT_PRETTY)
progress_id = g_timeout_add (120, progress_cb, device);
- g_object_unref (active);
}
}
@@ -1488,6 +1579,7 @@ connect_device_cb (GObject *client, GAsyncResult *result, gpointer user_data)
if (devices->len == 0) {
g_string_printf (nmc->return_text, _("Error: Device activation failed: device was disconnected"));
nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
+ g_object_unref (active);
quit ();
g_free (info);
return;
@@ -1502,9 +1594,19 @@ connect_device_cb (GObject *client, GAsyncResult *result, gpointer user_data)
nmc_terminal_erase_line ();
g_print (_("Device '%s' has been connected.\n"), nm_device_get_iface (device));
}
+ g_object_unref (active);
quit ();
} else {
- g_signal_connect (device, "notify::state", G_CALLBACK (connected_state_cb), active);
+ if (nmc->secret_agent) {
+ NMRemoteConnection *connection = nm_active_connection_get_connection (active);
+
+ nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent),
+ nm_connection_get_path (NM_CONNECTION (connection)));
+ }
+
+ g_object_ref (device);
+ g_signal_connect (device, "notify::state", G_CALLBACK (device_state_cb), active);
+ g_signal_connect (active, "notify::state", G_CALLBACK (active_state_cb), device);
/* Start timer not to loop forever if "notify::state" signal is not issued */
g_timeout_add_seconds (nmc->timeout, timeout_cb, nmc);
}
@@ -1574,6 +1676,11 @@ do_device_connect (NmCli *nmc, int argc, char **argv)
nmc->nowait_flag = (nmc->timeout == 0);
nmc->should_wait = TRUE;
+ /* Create secret agent */
+ nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-connect");
+ if (nmc->secret_agent)
+ g_signal_connect (nmc->secret_agent, "request-secrets", G_CALLBACK (nmc_secrets_requested), nmc);
+
info = g_malloc0 (sizeof (AddAndActivateInfo));
info->nmc = nmc;
info->device = device;
@@ -1596,53 +1703,118 @@ error:
return nmc->return_value;
}
+typedef struct {
+ NmCli *nmc;
+ GSList *queue;
+ guint timeout_id;
+ gboolean cmd_disconnect;
+} DeviceCbInfo;
+
+static void device_cb_info_finish (DeviceCbInfo *info, NMDevice *device);
+
+static gboolean
+device_op_timeout_cb (gpointer user_data)
+{
+ DeviceCbInfo *info = user_data;
+
+ timeout_cb (info->nmc);
+ device_cb_info_finish (info, NULL);
+ return G_SOURCE_REMOVE;
+}
+
static void
-disconnect_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
+device_removed_cb (NMClient *client, NMDevice *device, DeviceCbInfo *info)
{
- NmCli *nmc = (NmCli *) user_data;
- NMDeviceState state;
+ /* Success: device has been removed.
+ * It can also happen when disconnecting a software device.
+ */
+ if (!g_slist_find (info->queue, device))
+ return;
- state = nm_device_get_state (device);
+ if (info->cmd_disconnect)
+ g_print (_("Device '%s' successfully disconnected.\n"),
+ nm_device_get_iface (device));
+ else
+ g_print (_("Device '%s' successfully removed.\n"),
+ nm_device_get_iface (device));
+ device_cb_info_finish (info, device);
+}
- if (state == NM_DEVICE_STATE_DISCONNECTED) {
- g_string_printf (nmc->return_text, _("Success: Device '%s' successfully disconnected."), nm_device_get_iface (device));
- quit ();
+static void
+disconnect_state_cb (NMDevice *device, GParamSpec *pspec, DeviceCbInfo *info)
+{
+ if (!g_slist_find (info->queue, device))
+ return;
+
+ if (nm_device_get_state (device) == NM_DEVICE_STATE_DISCONNECTED) {
+ g_print (_("Device '%s' successfully disconnected.\n"),
+ nm_device_get_iface (device));
+ device_cb_info_finish (info, device);
+ }
+}
+
+static void
+destroy_queue_element (gpointer data)
+{
+ g_signal_handlers_disconnect_matched (data, G_SIGNAL_MATCH_FUNC, 0, 0, 0,
+ disconnect_state_cb, NULL);
+ g_object_unref (data);
+}
+
+static void
+device_cb_info_finish (DeviceCbInfo *info, NMDevice *device)
+{
+ if (device) {
+ GSList *elem = g_slist_find (info->queue, device);
+ if (!elem)
+ return;
+ info->queue = g_slist_delete_link (info->queue, elem);
+ destroy_queue_element (device);
+ } else {
+ g_slist_free_full (info->queue, destroy_queue_element);
+ info->queue = NULL;
}
+
+ if (info->queue)
+ return;
+
+ if (info->timeout_id)
+ g_source_remove (info->timeout_id);
+ g_signal_handlers_disconnect_by_func (info->nmc->client, device_removed_cb, info);
+ g_slice_free (DeviceCbInfo, info);
+ quit ();
}
static void
disconnect_device_cb (GObject *object, GAsyncResult *result, gpointer user_data)
{
NMDevice *device = NM_DEVICE (object);
- NmCli *nmc = (NmCli *) user_data;
+ 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: Device '%s' (%s) disconnecting failed: %s"),
- nm_device_get_iface (device),
- nm_object_get_path (NM_OBJECT (device)),
- error->message);
+ 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;
- quit ();
+ 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' has been disconnected.\n"), nm_device_get_iface (device));
+ g_print (_("Device '%s' successfully disconnected.\n"),
+ nm_device_get_iface (device));
}
- quit ();
- } else {
- g_signal_connect (device, "notify::state", G_CALLBACK (disconnect_state_cb), nmc);
- /* Start timer not to loop forever if "notify::state" signal is not issued */
- g_timeout_add_seconds (nmc->timeout, timeout_cb, nmc);
+ device_cb_info_finish (info, device);
}
-
}
}
@@ -1650,9 +1822,12 @@ static NMCResultCode
do_device_disconnect (NmCli *nmc, int argc, char **argv)
{
NMDevice **devices;
- NMDevice *device = NULL;
- const char *ifname = NULL;
- char *ifname_ask = NULL;
+ NMDevice *device;
+ DeviceCbInfo *info = NULL;
+ GSList *queue = NULL, *iter;
+ char **arg_arr = NULL;
+ char **arg_ptr = argv;
+ int arg_num = argc;
int i;
/* Set default timeout for disconnect operation. */
@@ -1660,59 +1835,78 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv)
nmc->timeout = 10;
if (argc == 0) {
- if (nmc->ask)
- ifname = ifname_ask = nmc_readline (PROMPT_INTERFACE);
-
- if (!ifname_ask) {
+ 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;
}
- } 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;
- }
-
- if (next_arg (&argc, &argv) == 0) {
- g_string_printf (nmc->return_text, _("Error: extra argument not allowed: '%s'."), *argv);
- 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);
+ 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 (!g_strcmp0 (dev_iface, ifname))
- device = candidate;
+ 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);
- if (!device) {
- g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), ifname);
+ if (!queue) {
+ g_string_printf (nmc->return_text, _("Error: no valid device provided."));
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
goto error;
}
+ queue = g_slist_reverse (queue);
+
+ info = g_slice_new0 (DeviceCbInfo);
+ info->nmc = nmc;
+ info->cmd_disconnect = TRUE;
+ if (nmc->timeout > 0)
+ info->timeout_id = g_timeout_add_seconds (nmc->timeout, device_op_timeout_cb, info);
+
+ g_signal_connect (nmc->client, NM_CLIENT_DEVICE_REMOVED,
+ G_CALLBACK (device_removed_cb), info);
- /*
- * Use nowait_flag instead of should_wait, because exiting has to be postponed
- * till disconnect_device_cb() is called, giving NM time to check our permissions.
- */
nmc->nowait_flag = (nmc->timeout == 0);
nmc->should_wait = TRUE;
- nm_device_disconnect_async (device, NULL, disconnect_device_cb, nmc);
- /* Start progress indication */
- if (nmc->print_output == NMC_PRINT_PRETTY)
- progress_id = g_timeout_add (120, progress_cb, device);
+ for (iter = queue; iter; iter = g_slist_next (iter)) {
+ device = iter->data;
+
+ info->queue = g_slist_prepend (info->queue, g_object_ref (device));
+ g_signal_connect (device, "notify::" NM_DEVICE_STATE,
+ G_CALLBACK (disconnect_state_cb), info);
+
+ /* Now disconnect the device */
+ nm_device_disconnect_async (device, NULL, disconnect_device_cb, info);
+ }
error:
+ g_strfreev (arg_arr);
+ g_slist_free (queue);
return nmc->return_value;
}
@@ -1720,27 +1914,35 @@ static void
delete_device_cb (GObject *object, GAsyncResult *result, gpointer user_data)
{
NMDevice *device = NM_DEVICE (object);
- NmCli *nmc = (NmCli *) user_data;
+ DeviceCbInfo *info = (DeviceCbInfo *) user_data;
+ NmCli *nmc = info->nmc;
GError *error = NULL;
if (!nm_device_delete_finish (device, result, &error)) {
- g_string_printf (nmc->return_text, _("Error: Device '%s' (%s) deletion failed: %s"),
- nm_device_get_iface (device),
- nm_object_get_path (NM_OBJECT (device)),
- error->message);
+ g_string_printf (nmc->return_text, _("Error: not all devices deleted."));
+ g_printerr (_("Error: Device '%s' (%s) deletion 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_UNKNOWN;
+ device_cb_info_finish (info, device);
+ } else {
+ if (nmc->nowait_flag)
+ device_cb_info_finish (info, device);
}
- quit ();
}
static NMCResultCode
do_device_delete (NmCli *nmc, int argc, char **argv)
{
NMDevice **devices;
- NMDevice *device = NULL;
- const char *ifname = NULL;
- char *ifname_ask = NULL;
+ NMDevice *device;
+ DeviceCbInfo *info = NULL;
+ GSList *queue = NULL, *iter;
+ char **arg_arr = NULL;
+ char **arg_ptr = argv;
+ int arg_num = argc;
int i;
/* Set default timeout for delete operation. */
@@ -1748,64 +1950,82 @@ do_device_delete (NmCli *nmc, int argc, char **argv)
nmc->timeout = 10;
if (argc == 0) {
- if (nmc->ask)
- ifname = ifname_ask = nmc_readline (PROMPT_INTERFACE);
-
- if (!ifname_ask) {
+ 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;
}
- } 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;
- }
-
- if (next_arg (&argc, &argv) == 0) {
- g_string_printf (nmc->return_text, _("Error: extra argument not allowed: '%s'."), *argv);
- 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);
+ 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 (!g_strcmp0 (dev_iface, ifname))
- device = candidate;
+ 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 (!device) {
- g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), ifname);
+ if (!queue) {
+ g_string_printf (nmc->return_text, _("Error: no valid device provided."));
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
goto error;
}
+ queue = g_slist_reverse (queue);
- if (!nm_device_is_software (device)) {
- g_string_printf (nmc->return_text, _("Error: Device '%s' is a hardware device. It can't be deleted."), ifname);
- nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
- goto error;
- }
+ info = g_slice_new0 (DeviceCbInfo);
+ info->nmc = nmc;
+ if (nmc->timeout > 0)
+ info->timeout_id = g_timeout_add_seconds (nmc->timeout, device_op_timeout_cb, info);
+
+ g_signal_connect (nmc->client, NM_CLIENT_DEVICE_REMOVED,
+ G_CALLBACK (device_removed_cb), info);
- /*
- * Use nowait_flag instead of should_wait, because exiting has to be postponed
- * till delete_device_cb() is called, giving NM time to check our permissions.
- */
nmc->nowait_flag = (nmc->timeout == 0);
nmc->should_wait = TRUE;
- nm_device_delete_async (device, NULL, delete_device_cb, nmc);
- /* Start progress indication */
- if (nmc->print_output == NMC_PRINT_PRETTY)
- progress_id = g_timeout_add (120, progress_cb, device);
+ for (iter = queue; iter; iter = g_slist_next (iter)) {
+ device = iter->data;
+
+ info->queue = g_slist_prepend (info->queue, g_object_ref (device));
+
+ /* Now delete the device */
+ nm_device_delete_async (device, NULL, delete_device_cb, info);
+ }
error:
+ g_strfreev (arg_arr);
+ g_slist_free (queue);
return nmc->return_value;
}
@@ -1814,7 +2034,7 @@ 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;
@@ -1833,8 +2053,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);
@@ -2723,7 +2944,7 @@ extern NmCli nm_cli;
static char *
gen_func_ifnames (const char *text, int state)
{
- int i, j = 0;
+ int i;
const GPtrArray *devices;
const char **ifnames;
char *ret;
@@ -2737,9 +2958,9 @@ gen_func_ifnames (const char *text, int state)
for (i = 0; i < devices->len; i++) {
NMDevice *dev = g_ptr_array_index (devices, i);
const char *ifname = nm_device_get_iface (dev);
- ifnames[j++] = ifname;
+ ifnames[i] = ifname;
}
- ifnames[j] = NULL;
+ ifnames[i] = NULL;
ret = nmc_rl_gen_func_basic (text, state, ifnames);
@@ -2756,14 +2977,17 @@ nmcli_device_tab_completion (const char *text, int start, int end)
/* Disable readline's default filename completion */
rl_attempted_completion_over = 1;
- /* Disable appending space after completion */
- rl_completion_append_character = '\0';
+ if (g_strcmp0 (rl_prompt, PROMPT_INTERFACE) == 0) {
+ /* Disable appending space after completion */
+ rl_completion_append_character = '\0';
- if (!is_single_word (rl_line_buffer))
- return NULL;
+ if (!is_single_word (rl_line_buffer))
+ return NULL;
- if (g_strcmp0 (rl_prompt, PROMPT_INTERFACE) == 0)
generator_func = gen_func_ifnames;
+ } else if (g_strcmp0 (rl_prompt, PROMPT_INTERFACES) == 0) {
+ generator_func = gen_func_ifnames;
+ }
if (generator_func)
match_array = rl_completion_matches (text, generator_func);
@@ -2776,6 +3000,9 @@ do_devices (NmCli *nmc, int argc, char **argv)
{
GError *error = NULL;
+ /* Register polkit agent */
+ nmc_start_polkit_agent_start_try (nmc);
+
rl_attempted_completion_function = (rl_completion_func_t *) nmcli_device_tab_completion;
/* Get NMClient object early */
diff --git a/clients/cli/general.c b/clients/cli/general.c
index 531d4f7acd..c252427c44 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"
@@ -25,6 +25,7 @@
#include <glib.h>
#include <glib/gi18n.h>
+#include "polkit-agent.h"
#include "utils.h"
#include "general.h"
@@ -263,6 +264,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)
{
@@ -281,17 +302,33 @@ 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;
+ gboolean net_enabled;
+ gboolean wireless_hw_enabled, wireless_enabled;
+ gboolean wwan_hw_enabled, wwan_enabled;
#if WITH_WIMAX
- const char *wimax_hw_enabled_str, *wimax_enabled_str;
+ gboolean wimax_hw_enabled, wimax_enabled;
#endif
GError *error = NULL;
const char *fields_str;
@@ -332,14 +369,14 @@ 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");
+ 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);
#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");
+ wimax_hw_enabled = nm_client_wimax_hardware_get_enabled (nmc->client);
+ wimax_enabled = nm_client_wimax_get_enabled (nmc->client);
#endif
nmc->print_fields.header_name = pretty_header_name ? (char *) pretty_header_name : _("NetworkManager status");
@@ -352,15 +389,30 @@ 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);
+ 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"));
#if WITH_WIMAX
- set_val_strc (arr, 10, wimax_hw_enabled_str);
- set_val_strc (arr, 11, wimax_enabled_str);
+ set_val_strc (arr, 10, wimax_hw_enabled ? _("enabled") : _("disabled"));
+ set_val_strc (arr, 11, wimax_enabled ? _("enabled") : _("disabled"));
#endif
+
+ /* 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;
+#if WITH_WIMAX
+ arr[10].color = wimax_hw_enabled ? NMC_TERM_COLOR_GREEN : NMC_TERM_COLOR_RED;
+ arr[11].color = wimax_enabled ? NMC_TERM_COLOR_GREEN : NMC_TERM_COLOR_RED;
+#endif
+
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
@@ -558,6 +610,9 @@ do_general (NmCli *nmc, int argc, char **argv)
{
GError *error = NULL;
+ /* Register polkit agent */
+ nmc_start_polkit_agent_start_try (nmc);
+
if (argc == 0) {
if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
g_string_printf (nmc->return_text, _("Error: %s."), error->message);
@@ -726,6 +781,9 @@ do_networking (NmCli *nmc, int argc, char **argv)
{
gboolean enable_flag;
+ /* Register polkit agent */
+ nmc_start_polkit_agent_start_try (nmc);
+
if (argc == 0)
nmc_switch_show (nmc, NMC_FIELDS_NM_NETWORKING, _("Networking"));
else if (argc > 0) {
@@ -787,6 +845,9 @@ do_radio (NmCli *nmc, int argc, char **argv)
GError *error = NULL;
gboolean enable_flag;
+ /* Register polkit agent */
+ nmc_start_polkit_agent_start_try (nmc);
+
if (argc == 0) {
if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
g_string_printf (nmc->return_text, _("Error: %s."), error->message);
diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion
index a9dfc41774..51c817affe 100644
--- a/clients/cli/nmcli-completion
+++ b/clients/cli/nmcli-completion
@@ -170,6 +170,33 @@ _nmcli_compl_OPTIONS()
ask)
_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
+ ;;
show-secrets)
_nmcli_array_delete_at words 0
;;
@@ -197,6 +224,13 @@ _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
@@ -502,7 +536,8 @@ _nmcli_compl_ARGS()
user| \
username| \
service| \
- password)
+ password| \
+ passwd-file)
if [[ "${#words[@]}" -eq 2 ]]; then
return 0
fi
@@ -682,7 +717,7 @@ _nmcli()
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 wait version help)
_nmcli_compl_OPTIONS
i=$?
@@ -700,7 +735,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)
+ OPTIONS=(help general networking radio connection device agent)
elif [[ "${words[0]:1:1}" == '-' || "${words[0]}" == "-" ]]; then
OPTIONS=("${LONG_OPTIONS[@]/#/--}")
else
@@ -777,11 +812,11 @@ _nmcli()
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 show-secrets order
elif [[ ${#words[@]} -gt 3 ]]; then
_nmcli_array_delete_at words 0 1
- LONG_OPTIONS=(help active show-secrets)
+ LONG_OPTIONS=(help active show-secrets order)
HELP_ONLY_AS_FIRST=1
_nmcli_compl_OPTIONS
i=$?
@@ -845,9 +880,9 @@ _nmcli()
_nmcli_compl_ARGS_CONNECTION && return 0
if [[ "$COMMAND_CONNECTION_TYPE" = "ifname" ]]; then
- OPTIONS=(ap nsp)
+ OPTIONS=(ap nsp passwd-file)
else
- OPTIONS=(ifname ap nsp)
+ OPTIONS=(ifname ap nsp passwd-file)
fi
_nmcli_compl_ARGS
fi
@@ -1149,18 +1184,23 @@ _nmcli()
;;
esac
- OPTIONS=(id uuid path apath)
+ OPTIONS=(id uuid path)
_nmcli_compl_ARGS_CONNECTION && return 0
while [[ "${#words[@]}" -gt 0 ]]; do
if [[ ${#words[@]} -le 1 ]]; then
- _nmcli_list_nl "$(nmcli --fields profile connection show "${COMMAND_CONNECTION_TYPE:-id}" "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/\1/p')"
+ 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')"
return 0
elif [[ ${#words[@]} -le 2 ]]; then
return 0
fi
_nmcli_array_delete_at words 0 1
done
- _nmcli_list_nl "$(nmcli --fields profile connection show "${COMMAND_CONNECTION_TYPE:-id}" "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/\1/p')"
+ _nmcli_list_nl "$(nmcli --fields profile connection show ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/\1/p')"
return 0
fi
;;
@@ -1212,10 +1252,14 @@ _nmcli()
fi
;;
sh|sho|show| \
- c|co|con|conn|conne|connec|connect| \
+ c|co|con|conn|conne|connec|connect)
+ if [[ ${#words[@]} -eq 3 ]]; then
+ _nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)"
+ fi
+ ;;
d|di|dis|disc|disco|discon|disconn|disconne|disconnec|disconnect| \
de|del|dele|delet|delete)
- if [[ ${#words[@]} -eq 3 ]]; then
+ if [[ ${#words[@]} -ge 3 ]]; then
_nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)"
fi
;;
@@ -1267,6 +1311,11 @@ _nmcli()
esac
fi
;;
+ a|ag|age|agen|agent)
+ if [[ ${#words[@]} -eq 2 ]]; then
+ _nmcli_compl_COMMAND "$command" secret polkit all
+ fi
+ ;;
esac
return 0
diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c
index b1a810ce7a..63c4b777a7 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 */
@@ -27,6 +27,8 @@
#include <stdlib.h>
#include <signal.h>
#include <pthread.h>
+#include <termios.h>
+#include <unistd.h>
#include <locale.h>
#include <readline/readline.h>
#include <readline/history.h>
@@ -34,12 +36,14 @@
#include <glib.h>
#include <glib/gi18n.h>
+#include "polkit-agent.h"
#include "nmcli.h"
#include "utils.h"
#include "common.h"
#include "connections.h"
#include "devices.h"
#include "general.h"
+#include "agent.h"
#if defined(NM_DIST_VERSION)
# define NMCLI_VERSION NM_DIST_VERSION
@@ -61,6 +65,7 @@ typedef struct {
/* --- Global variables --- */
GMainLoop *loop = NULL;
static sigset_t signal_set;
+struct termios termios_orig;
/* Get an error quark for use with GError */
@@ -84,6 +89,7 @@ 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] <field1,field2,...>|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"
@@ -98,6 +104,7 @@ usage (const char *prog_name)
" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+ " a[gent] NetworkManager secret agent or polkit agent\n"
"\n"),
prog_name);
}
@@ -118,6 +125,7 @@ static const struct cmd {
{ "radio", do_radio },
{ "connection", do_connections },
{ "device", do_devices },
+ { "agent", do_agent },
{ "help", do_help },
{ 0 }
};
@@ -203,6 +211,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) {
@@ -261,8 +287,10 @@ parse_command_line (NmCli *nmc, int argc, char **argv)
argv++;
}
- if (argc > 1)
+ if (argc > 1) {
+ /* Now run the requested command */
return do_cmd (nmc, argv[1], argc-1, argv+1);
+ }
usage (base);
return nmc->return_value;
@@ -332,6 +360,7 @@ signal_handling_thread (void *arg) {
pthread_mutex_unlock (&sigint_mutex);
} else {
/* We can quit nmcli */
+ tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_orig);
nmc_cleanup_readline ();
g_print (_("\nError: nmcli terminated by signal %s (%d)\n"),
strsignal (signo), signo);
@@ -340,6 +369,7 @@ signal_handling_thread (void *arg) {
break;
case SIGQUIT:
case SIGTERM:
+ tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_orig);
nmc_cleanup_readline ();
if (!nmcli_sigquit_internal)
g_print (_("\nError: nmcli terminated by signal %s (%d)\n"),
@@ -500,6 +530,10 @@ nmc_init (NmCli *nmc)
nmc->connections = NULL;
+ nmc->secret_agent = NULL;
+ nmc->pwds_hash = NULL;
+ nmc->pk_listener = NULL;
+
nmc->should_wait = FALSE;
nmc->nowait_flag = TRUE;
nmc->print_output = NMC_PRINT_NORMAL;
@@ -511,6 +545,7 @@ nmc_init (NmCli *nmc)
memset (&nmc->print_fields, '\0', sizeof (NmcPrintFields));
nmc->nocheck_ver = FALSE;
nmc->ask = FALSE;
+ nmc->use_colors = NMC_USE_COLOR_AUTO;
nmc->in_editor = FALSE;
nmc->editor_status_line = FALSE;
nmc->editor_save_confirmation = TRUE;
@@ -525,9 +560,19 @@ nmc_cleanup (NmCli *nmc)
g_string_free (nmc->return_text, TRUE);
+ if (nmc->secret_agent) {
+ /* Destroy secret agent if we have one. */
+ nm_secret_agent_old_unregister (nmc->secret_agent, NULL, NULL);
+ g_object_unref (nmc->secret_agent);
+ }
+ if (nmc->pwds_hash)
+ g_hash_table_destroy (nmc->pwds_hash);
+
g_free (nmc->required_fields);
nmc_empty_output_fields (nmc);
g_ptr_array_unref (nmc->output_data);
+
+ nmc_polkit_agent_fini (nmc);
}
static gboolean
@@ -565,6 +610,9 @@ main (int argc, char *argv[])
#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
#endif
+
+ /* Save terminal settings */
+ tcgetattr (STDIN_FILENO, &termios_orig);
/* readline init */
rl_event_hook = event_hook_for_readline;
diff --git a/clients/cli/nmcli.h b/clients/cli/nmcli.h
index 0a87bd9147..06662fefee 100644
--- a/clients/cli/nmcli.h
+++ b/clients/cli/nmcli.h
@@ -14,13 +14,23 @@
* 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
#define NMC_NMCLI_H
+#include "config.h"
+
#include <NetworkManager.h>
+#include <nm-secret-agent-old.h>
+
+#if WITH_POLKIT_AGENT
+#include "nm-polkit-listener.h"
+#else
+/* polkit agent is not available; define fake NMPolkitListener */
+typedef gpointer NMPolkitListener;
+#endif
/* nmcli exit codes */
typedef enum {
@@ -59,6 +69,28 @@ typedef enum {
} 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,
NMC_PRINT_PRETTY = 2
@@ -80,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 {
@@ -89,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 {
@@ -112,11 +140,16 @@ typedef struct _NmCli {
const GPtrArray *connections; /* List of connections */
+ NMSecretAgentOld *secret_agent; /* Secret agent */
+ 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 */
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 */
diff --git a/clients/cli/polkit-agent.c b/clients/cli/polkit-agent.c
new file mode 100644
index 0000000000..a163b824fa
--- /dev/null
+++ b/clients/cli/polkit-agent.c
@@ -0,0 +1,166 @@
+/* nmcli - command-line tool to control NetworkManager
+ *
+ * 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 2014 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#if WITH_POLKIT_AGENT
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <termios.h>
+
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+
+#include "polkit-agent.h"
+#include "nm-polkit-listener.h"
+#include "common.h"
+
+static char *
+polkit_request (const char *request,
+ const char *action_id,
+ const char *message,
+ const char *icon_name,
+ const char *user,
+ gboolean echo_on,
+ 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 */
+ tmp = g_strdup (request);
+ p = strrchr (tmp, ':');
+ if (p && !strcmp (p, ": "))
+ *p = '\0';
+ response = nmc_readline ("%s (%s): ", tmp, user);
+ g_free (tmp);
+ } else
+ response = nmc_readline ("%s", request);
+ g_print ("\n");
+
+ /* Restore original terminal settings */
+ if (!echo_on)
+ tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_orig);
+
+ return response;
+}
+
+static void
+polkit_show_info (const char *text)
+{
+ g_print (_("Authentication message: %s\n"), text);
+}
+
+static void
+polkit_show_error (const char *text)
+{
+ g_print (_("Authentication error: %s\n"), text);
+}
+
+static void
+polkit_completed (gboolean gained_authorization)
+{
+ /* We don't print anything here. The outcome will be evident from
+ * the operation result anyway. */
+}
+
+gboolean
+nmc_polkit_agent_init (NmCli* nmc, gboolean for_session, GError **error)
+{
+ PolkitAgentListener *listener;
+
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ listener = nm_polkit_listener_new (for_session, error);
+ if (!listener)
+ return FALSE;
+
+ nm_polkit_listener_set_request_callback (NM_POLKIT_LISTENER (listener), polkit_request, nmc);
+ nm_polkit_listener_set_show_info_callback (NM_POLKIT_LISTENER (listener), polkit_show_info);
+ nm_polkit_listener_set_show_error_callback (NM_POLKIT_LISTENER (listener), polkit_show_error);
+ nm_polkit_listener_set_completed_callback (NM_POLKIT_LISTENER (listener), polkit_completed);
+
+ nmc->pk_listener = NM_POLKIT_LISTENER (listener);
+ return TRUE;
+}
+
+void
+nmc_polkit_agent_fini (NmCli* nmc)
+{
+ g_clear_object (&nmc->pk_listener);
+}
+
+gboolean
+nmc_start_polkit_agent_start_try (NmCli *nmc)
+{
+ GError *error = NULL;
+
+ /* We don't register polkit agent at all when running non-interactively */
+ if (!nmc->ask)
+ return TRUE;
+
+ if (!nmc_polkit_agent_init (nmc, FALSE, &error)) {
+ g_printerr (_("Warning: polkit agent initialization failed: %s\n"),
+ error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+#else
+/* polkit agent is not avalable; implement stub functions. */
+
+#include <glib.h>
+#include "nmcli.h"
+#include "polkit-agent.h"
+
+gboolean
+nmc_polkit_agent_init (NmCli* nmc, gboolean for_session, GError **error)
+{
+ return TRUE;
+}
+
+void
+nmc_polkit_agent_fini (NmCli* nmc)
+{
+}
+
+gboolean
+nmc_start_polkit_agent_start_try (NmCli *nmc)
+{
+ return TRUE;
+}
+
+#endif /* #if WITH_POLKIT_AGENT */
diff --git a/src/nm-session-utils.h b/clients/cli/polkit-agent.h
index e626f52ae0..e2902dc0b1 100644
--- a/src/nm-session-utils.h
+++ b/clients/cli/polkit-agent.h
@@ -1,5 +1,6 @@
-/* -*- 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
+/* nmcli - command-line tool to control NetworkManager
+ *
+ * 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.
@@ -13,18 +14,17 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2012 Red Hat, Inc.
- * Author: Dan Williams <dcbw@redhat.com>
+ * Copyright 2014 Red Hat, Inc.
*/
-#ifndef __NETWORKMANAGER_SESSION_UTILS_H__
-#define __NETWORKMANAGER_SESSION_UTILS_H__
+#ifndef __NMC_POLKIT_AGENT_H__
+#define __NMC_POLKIT_AGENT_H__
-#include <glib.h>
-#include <glib-object.h>
+#include "nmcli.h"
-gboolean nm_session_uid_to_user (uid_t uid, const char **out_user, GError **error);
+gboolean nmc_polkit_agent_init (NmCli *nmc, gboolean for_session, GError **error);
+void nmc_polkit_agent_fini (NmCli* nmc);
-gboolean nm_session_user_to_uid (const char *user, uid_t *out_uid, GError **error);
+gboolean nmc_start_polkit_agent_start_try (NmCli *nmc);
-#endif /* NM_SESSION_UTILS_H */
+#endif /* __NMC_POLKIT_AGENT_H__ */
diff --git a/clients/cli/settings.c b/clients/cli/settings.c
index 136c818641..7da47d43a8 100644
--- a/clients/cli/settings.c
+++ b/clients/cli/settings.c
@@ -14,12 +14,13 @@
* 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 <stdlib.h>
+#include <arpa/inet.h>
#include <glib.h>
#include <glib/gi18n.h>
@@ -28,6 +29,7 @@
#include "common.h"
#include "settings.h"
#include "nm-glib-compat.h"
+#include "nm-utils-internal.h"
/* Forward declarations */
static char *wep_key_type_to_string (NMWepKeyType type);
@@ -189,6 +191,7 @@ NmcOutputField nmc_fields_setting_wireless[] = {
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 (NM_SETTING_WIRELESS_POWERSAVE, 10), /* 14 */
{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
};
#define NMC_FIELDS_SETTING_WIRELESS_ALL "name"","\
@@ -204,7 +207,8 @@ NmcOutputField nmc_fields_setting_wireless[] = {
NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST","\
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 */
@@ -251,64 +255,74 @@ 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_IP4_CONFIG_METHOD, 10), /* 1 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_DNS, 20), /* 2 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_DNS_SEARCH, 15), /* 3 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_ADDRESSES, 20), /* 4 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_ROUTES, 20), /* 5 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, 19), /* 6 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, 16), /* 7 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, 15), /* 8 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, 19), /* 9 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, 14), /* 10 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, 15), /* 11 */
- SETTING_FIELD (NM_SETTING_IP4_CONFIG_MAY_FAIL, 12), /* 12 */
+ 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 */
{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
};
#define NMC_FIELDS_SETTING_IP4_CONFIG_ALL "name"","\
- NM_SETTING_IP4_CONFIG_METHOD","\
- NM_SETTING_IP4_CONFIG_DNS","\
- NM_SETTING_IP4_CONFIG_DNS_SEARCH","\
- NM_SETTING_IP4_CONFIG_ADDRESSES","\
- NM_SETTING_IP4_CONFIG_ROUTES","\
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES","\
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS","\
+ NM_SETTING_IP_CONFIG_METHOD","\
+ NM_SETTING_IP_CONFIG_DNS","\
+ NM_SETTING_IP_CONFIG_DNS_SEARCH","\
+ NM_SETTING_IP_CONFIG_ADDRESSES","\
+ NM_SETTING_IP_CONFIG_GATEWAY","\
+ NM_SETTING_IP_CONFIG_ROUTES","\
+ NM_SETTING_IP_CONFIG_ROUTE_METRIC","\
+ 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_SEND_HOSTNAME","\
- NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME","\
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT","\
- NM_SETTING_IP4_CONFIG_MAY_FAIL
+ NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME","\
+ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME","\
+ 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_IP6_CONFIG_METHOD, 10), /* 1 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_DNS, 20), /* 2 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_DNS_SEARCH, 15), /* 3 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_ADDRESSES, 20), /* 4 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_ROUTES, 20), /* 5 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, 19), /* 6 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, 16), /* 7 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, 15), /* 8 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_MAY_FAIL, 12), /* 9 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_IP6_PRIVACY, 15), /* 10 */
- SETTING_FIELD (NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME, 14), /* 11 */
+ 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 */
{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
};
#define NMC_FIELDS_SETTING_IP6_CONFIG_ALL "name"","\
- NM_SETTING_IP6_CONFIG_METHOD","\
- NM_SETTING_IP6_CONFIG_DNS","\
- NM_SETTING_IP6_CONFIG_DNS_SEARCH","\
- NM_SETTING_IP6_CONFIG_ADDRESSES","\
- NM_SETTING_IP6_CONFIG_ROUTES","\
- NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES","\
- NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS","\
- NM_SETTING_IP6_CONFIG_NEVER_DEFAULT","\
- NM_SETTING_IP6_CONFIG_MAY_FAIL","\
+ NM_SETTING_IP_CONFIG_METHOD","\
+ NM_SETTING_IP_CONFIG_DNS","\
+ NM_SETTING_IP_CONFIG_DNS_SEARCH","\
+ NM_SETTING_IP_CONFIG_ADDRESSES","\
+ NM_SETTING_IP_CONFIG_GATEWAY","\
+ NM_SETTING_IP_CONFIG_ROUTES","\
+ NM_SETTING_IP_CONFIG_ROUTE_METRIC","\
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES","\
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS","\
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT","\
+ NM_SETTING_IP_CONFIG_MAY_FAIL","\
NM_SETTING_IP6_CONFIG_IP6_PRIVACY","\
- NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME
+ 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 */
@@ -486,13 +500,15 @@ NmcOutputField nmc_fields_setting_vpn[] = {
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 */
{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
};
#define NMC_FIELDS_SETTING_VPN_ALL "name"","\
NM_SETTING_VPN_SERVICE_TYPE","\
NM_SETTING_VPN_USER_NAME","\
NM_SETTING_VPN_DATA","\
- NM_SETTING_VPN_SECRETS
+ NM_SETTING_VPN_SECRETS","\
+ NM_SETTING_VPN_PERSISTENT
#define NMC_FIELDS_SETTING_VPN_COMMON NMC_FIELDS_SETTING_VPN_ALL
/* Available fields for NM_SETTING_WIMAX_SETTING_NAME */
@@ -563,6 +579,7 @@ NmcOutputField nmc_fields_setting_bridge[] = {
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 (NM_SETTING_BRIDGE_MULTICAST_SNOOPING, 6), /* 8 */
{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
};
#define NMC_FIELDS_SETTING_BRIDGE_ALL "name"","\
@@ -572,7 +589,8 @@ 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 */
@@ -981,6 +999,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)
@@ -1199,41 +1218,30 @@ nmc_property_ib_get_p_key (NMSetting *setting)
DEFINE_GETTER (nmc_property_ib_get_parent, NM_SETTING_INFINIBAND_PARENT)
/* --- NM_SETTING_IP4_CONFIG_SETTING_NAME property get functions --- */
-DEFINE_GETTER (nmc_property_ipv4_get_method, NM_SETTING_IP4_CONFIG_METHOD)
-DEFINE_GETTER (nmc_property_ipv4_get_dns, NM_SETTING_IP4_CONFIG_DNS)
-DEFINE_GETTER (nmc_property_ipv4_get_dns_search, NM_SETTING_IP4_CONFIG_DNS_SEARCH)
+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)
static char *
-nmc_property_ipv4_get_addresses (NMSetting *setting)
+nmc_property_ip_get_addresses (NMSetting *setting)
{
- NMSettingIP4Config *s_ip4 = NM_SETTING_IP4_CONFIG (setting);
+ NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting);
GString *printable;
guint32 num_addresses, i;
- NMIP4Address *addr;
- char buf[INET_ADDRSTRLEN];
+ NMIPAddress *addr;
printable = g_string_new (NULL);
- num_addresses = nm_setting_ip4_config_get_num_addresses (s_ip4);
+ num_addresses = nm_setting_ip_config_get_num_addresses (s_ip);
for (i = 0; i < num_addresses; i++) {
- addr = nm_setting_ip4_config_get_address (s_ip4, i);
+ addr = nm_setting_ip_config_get_address (s_ip, i);
if (printable->len > 0)
- g_string_append (printable, "; ");
-
- g_string_append (printable, "{ ");
-
- nm_utils_inet4_ntop (nm_ip4_address_get_address (addr), buf);
- g_string_append_printf (printable, "ip = %s", buf);
+ g_string_append (printable, ", ");
- g_string_append_printf (printable, "/%u", nm_ip4_address_get_prefix (addr));
-
- if (nm_ip4_address_get_gateway (addr)) {
- nm_utils_inet4_ntop (nm_ip4_address_get_gateway (addr), buf);
- g_string_append_printf (printable, ", gw = %s", buf);
- }
-
- g_string_append (printable, " }");
+ g_string_append_printf (printable, "%s/%u",
+ nm_ip_address_get_address (addr),
+ nm_ip_address_get_prefix (addr));
}
return g_string_free (printable, FALSE);
@@ -1242,35 +1250,33 @@ nmc_property_ipv4_get_addresses (NMSetting *setting)
static char *
nmc_property_ipv4_get_routes (NMSetting *setting)
{
- NMSettingIP4Config *s_ip4 = NM_SETTING_IP4_CONFIG (setting);
+ NMSettingIPConfig *s_ip4 = NM_SETTING_IP_CONFIG (setting);
GString *printable;
guint32 num_routes, i;
- NMIP4Route *route;
- char buf[INET_ADDRSTRLEN];
+ NMIPRoute *route;
printable = g_string_new (NULL);
- num_routes = nm_setting_ip4_config_get_num_routes (s_ip4);
+ num_routes = nm_setting_ip_config_get_num_routes (s_ip4);
for (i = 0; i < num_routes; i++) {
- route = nm_setting_ip4_config_get_route (s_ip4, i);
+ route = nm_setting_ip_config_get_route (s_ip4, i);
if (printable->len > 0)
g_string_append (printable, "; ");
g_string_append (printable, "{ ");
- nm_utils_inet4_ntop (nm_ip4_route_get_dest (route), buf);
- g_string_append_printf (printable, "ip = %s", buf);
+ g_string_append_printf (printable, "ip = %s/%u",
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route));
- g_string_append_printf (printable, "/%u", nm_ip4_route_get_prefix (route));
-
- if (nm_ip4_route_get_next_hop (route)) {
- nm_utils_inet4_ntop (nm_ip4_route_get_next_hop (route), buf);
- g_string_append_printf (printable, ", nh = %s", buf);
+ if (nm_ip_route_get_next_hop (route)) {
+ g_string_append_printf (printable, ", nh = %s",
+ nm_ip_route_get_next_hop (route));
}
- if (nm_ip4_route_get_metric (route))
- g_string_append_printf (printable, ", mt = %u", nm_ip4_route_get_metric (route));
+ if (nm_ip_route_get_metric (route) != -1)
+ g_string_append_printf (printable, ", mt = %u", (guint32) nm_ip_route_get_metric (route));
g_string_append (printable, " }");
}
@@ -1278,87 +1284,51 @@ nmc_property_ipv4_get_routes (NMSetting *setting)
return g_string_free (printable, FALSE);
}
-DEFINE_GETTER (nmc_property_ipv4_get_ignore_auto_routes, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES)
-DEFINE_GETTER (nmc_property_ipv4_get_ignore_auto_dns, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS)
+DEFINE_GETTER (nmc_property_ipv4_get_gateway, NM_SETTING_IP_CONFIG_GATEWAY)
+DEFINE_GETTER (nmc_property_ipv4_get_route_metric, NM_SETTING_IP_CONFIG_ROUTE_METRIC)
+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_send_hostname, NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME)
-DEFINE_GETTER (nmc_property_ipv4_get_dhcp_hostname, NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME)
-DEFINE_GETTER (nmc_property_ipv4_get_never_default, NM_SETTING_IP4_CONFIG_NEVER_DEFAULT)
-DEFINE_GETTER (nmc_property_ipv4_get_may_fail, NM_SETTING_IP4_CONFIG_MAY_FAIL)
+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_never_default, NM_SETTING_IP_CONFIG_NEVER_DEFAULT)
+DEFINE_GETTER (nmc_property_ipv4_get_may_fail, NM_SETTING_IP_CONFIG_MAY_FAIL)
/* --- NM_SETTING_IP6_CONFIG_SETTING_NAME property get functions --- */
-DEFINE_GETTER (nmc_property_ipv6_get_method, NM_SETTING_IP6_CONFIG_METHOD)
-DEFINE_GETTER (nmc_property_ipv6_get_dns, NM_SETTING_IP6_CONFIG_DNS)
-DEFINE_GETTER (nmc_property_ipv6_get_dns_search, NM_SETTING_IP6_CONFIG_DNS_SEARCH)
-
-static char *
-nmc_property_ipv6_get_addresses (NMSetting *setting)
-{
- NMSettingIP6Config *s_ip6 = NM_SETTING_IP6_CONFIG (setting);
- GString *printable;
- guint32 num_addresses, i;
- NMIP6Address *addr;
- char buf[INET6_ADDRSTRLEN];
-
- printable = g_string_new (NULL);
-
- num_addresses = nm_setting_ip6_config_get_num_addresses (s_ip6);
- for (i = 0; i < num_addresses; i++) {
- addr = nm_setting_ip6_config_get_address (s_ip6, i);
-
- if (printable->len > 0)
- g_string_append (printable, "; ");
-
- g_string_append (printable, "{ ");
-
- nm_utils_inet6_ntop (nm_ip6_address_get_address (addr), buf);
- g_string_append_printf (printable, "ip = %s", buf);
-
- g_string_append_printf (printable, "/%u", nm_ip6_address_get_prefix (addr));
-
- if (nm_ip6_address_get_gateway (addr)) {
- nm_utils_inet6_ntop (nm_ip6_address_get_gateway (addr), buf);
- g_string_append_printf (printable, ", gw = %s", buf);
- }
-
- g_string_append (printable, " }");
- }
-
- return g_string_free (printable, FALSE);
-}
+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)
static char *
nmc_property_ipv6_get_routes (NMSetting *setting)
{
- NMSettingIP6Config *s_ip6 = NM_SETTING_IP6_CONFIG (setting);
+ NMSettingIPConfig *s_ip6 = NM_SETTING_IP_CONFIG (setting);
GString *printable;
guint32 num_routes, i;
- NMIP6Route *route;
- char buf[INET6_ADDRSTRLEN];
+ NMIPRoute *route;
printable = g_string_new (NULL);
- num_routes = nm_setting_ip6_config_get_num_routes (s_ip6);
+ num_routes = nm_setting_ip_config_get_num_routes (s_ip6);
for (i = 0; i < num_routes; i++) {
- route = nm_setting_ip6_config_get_route (s_ip6, i);
+ route = nm_setting_ip_config_get_route (s_ip6, i);
if (printable->len > 0)
g_string_append (printable, "; ");
g_string_append (printable, "{ ");
- nm_utils_inet6_ntop (nm_ip6_route_get_dest (route), buf);
- g_string_append_printf (printable, "ip = %s", buf);
-
- g_string_append_printf (printable, "/%u", nm_ip6_route_get_prefix (route));
+ g_string_append_printf (printable, "ip = %s/%u",
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route));
- if (nm_ip6_route_get_next_hop (route)) {
- nm_utils_inet6_ntop (nm_ip6_route_get_next_hop (route), buf);
- g_string_append_printf (printable, ", nh = %s", buf);
+ if (nm_ip_route_get_next_hop (route)) {
+ g_string_append_printf (printable, ", nh = %s",
+ nm_ip_route_get_next_hop (route));
}
- if (nm_ip6_route_get_metric (route))
- g_string_append_printf (printable, ", mt = %u", nm_ip6_route_get_metric (route));
+ if (nm_ip_route_get_metric (route) != -1)
+ g_string_append_printf (printable, ", mt = %u", (guint32) nm_ip_route_get_metric (route));
g_string_append (printable, " }");
}
@@ -1366,11 +1336,14 @@ nmc_property_ipv6_get_routes (NMSetting *setting)
return g_string_free (printable, FALSE);
}
-DEFINE_GETTER (nmc_property_ipv6_get_ignore_auto_routes, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES)
-DEFINE_GETTER (nmc_property_ipv6_get_ignore_auto_dns, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS)
-DEFINE_GETTER (nmc_property_ipv6_get_never_default, NM_SETTING_IP6_CONFIG_NEVER_DEFAULT)
-DEFINE_GETTER (nmc_property_ipv6_get_may_fail, NM_SETTING_IP6_CONFIG_MAY_FAIL)
-DEFINE_GETTER (nmc_property_ipv6_get_dhcp_hostname, NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME)
+DEFINE_GETTER (nmc_property_ipv6_get_gateway, NM_SETTING_IP_CONFIG_GATEWAY)
+DEFINE_GETTER (nmc_property_ipv6_get_route_metric, NM_SETTING_IP_CONFIG_ROUTE_METRIC)
+DEFINE_GETTER (nmc_property_ipv6_get_ignore_auto_routes, NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES)
+DEFINE_GETTER (nmc_property_ipv6_get_ignore_auto_dns, NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS)
+DEFINE_GETTER (nmc_property_ipv6_get_never_default, NM_SETTING_IP_CONFIG_NEVER_DEFAULT)
+DEFINE_GETTER (nmc_property_ipv6_get_may_fail, NM_SETTING_IP_CONFIG_MAY_FAIL)
+DEFINE_GETTER (nmc_property_ipv6_get_dhcp_send_hostname, NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME)
+DEFINE_GETTER (nmc_property_ipv6_get_dhcp_hostname, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME)
static char *
nmc_property_ipv6_get_ip6_privacy (NMSetting *setting)
@@ -1485,6 +1458,8 @@ nmc_property_vpn_get_secrets (NMSetting *setting)
return g_string_free (secret_str, FALSE);
}
+DEFINE_GETTER (nmc_property_vpn_get_persistent, NM_SETTING_VPN_PERSISTENT)
+
/* --- NM_SETTING_WIMAX_SETTING_NAME property get functions --- */
DEFINE_GETTER (nmc_property_wimax_get_network_name, NM_SETTING_WIMAX_NETWORK_NAME)
DEFINE_GETTER (nmc_property_wimax_get_mac_address, NM_SETTING_WIMAX_MAC_ADDRESS)
@@ -1556,6 +1531,20 @@ nmc_property_wireless_get_mtu (NMSetting *setting)
return g_strdup_printf ("%d", mtu);
}
+static char *
+nmc_property_wireless_get_powersave (NMSetting *setting)
+{
+ 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);
+}
+
/* --- 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)
@@ -1704,19 +1693,19 @@ ipv4_addresses_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_dat
/* If we have some IP addresses set method to 'manual'.
* Else if the method was 'manual', change it back to 'auto'.
*/
- if (nm_setting_ip4_config_get_num_addresses (NM_SETTING_IP4_CONFIG (object))) {
- if (g_strcmp0 (nm_setting_ip4_config_get_method (NM_SETTING_IP4_CONFIG (object)), NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
+ if (nm_setting_ip_config_get_num_addresses (NM_SETTING_IP_CONFIG (object))) {
+ if (g_strcmp0 (nm_setting_ip_config_get_method (NM_SETTING_IP_CONFIG (object)), NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
if (!answered) {
answered = TRUE;
answer = get_answer ("ipv4.method", "manual");
}
if (answer)
- g_object_set (object, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
+ g_object_set (object, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
}
} else {
answered = FALSE;
- if (!g_strcmp0 (nm_setting_ip4_config_get_method (NM_SETTING_IP4_CONFIG (object)), NM_SETTING_IP4_CONFIG_METHOD_MANUAL))
- g_object_set (object, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ if (!g_strcmp0 (nm_setting_ip_config_get_method (NM_SETTING_IP_CONFIG (object)), NM_SETTING_IP4_CONFIG_METHOD_MANUAL))
+ g_object_set (object, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
}
g_signal_handlers_unblock_by_func (object, G_CALLBACK (ipv4_method_changed_cb), NULL);
@@ -1732,8 +1721,8 @@ ipv4_method_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
g_signal_handlers_block_by_func (object, G_CALLBACK (ipv4_addresses_changed_cb), NULL);
/* If method != manual, remove addresses (save them for restoring them later when method becomes 'manual' */
- if (g_strcmp0 (nm_setting_ip4_config_get_method (NM_SETTING_IP4_CONFIG (object)), NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
- if (nm_setting_ip4_config_get_num_addresses (NM_SETTING_IP4_CONFIG (object))) {
+ if (g_strcmp0 (nm_setting_ip_config_get_method (NM_SETTING_IP_CONFIG (object)), NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
+ if (nm_setting_ip_config_get_num_addresses (NM_SETTING_IP_CONFIG (object))) {
if (!answered) {
answered = TRUE;
answer = get_answer ("ipv4.addresses", NULL);
@@ -1741,14 +1730,14 @@ ipv4_method_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
if (answer) {
if (G_IS_VALUE (&value))
g_value_unset (&value);
- nmc_property_get_gvalue (NM_SETTING (object), NM_SETTING_IP4_CONFIG_ADDRESSES, &value);
- g_object_set (object, NM_SETTING_IP4_CONFIG_ADDRESSES, NULL, NULL);
+ nmc_property_get_gvalue (NM_SETTING (object), NM_SETTING_IP_CONFIG_ADDRESSES, &value);
+ g_object_set (object, NM_SETTING_IP_CONFIG_ADDRESSES, NULL, NULL);
}
}
} else {
answered = FALSE;
if (G_IS_VALUE (&value)) {
- nmc_property_set_gvalue (NM_SETTING (object), NM_SETTING_IP4_CONFIG_ADDRESSES, &value);
+ nmc_property_set_gvalue (NM_SETTING (object), NM_SETTING_IP_CONFIG_ADDRESSES, &value);
g_value_unset (&value);
}
}
@@ -1767,19 +1756,19 @@ ipv6_addresses_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_dat
/* If we have some IP addresses set method to 'manual'.
* Else if the method was 'manual', change it back to 'auto'.
*/
- if (nm_setting_ip6_config_get_num_addresses (NM_SETTING_IP6_CONFIG (object))) {
- if (g_strcmp0 (nm_setting_ip6_config_get_method (NM_SETTING_IP6_CONFIG (object)), NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
+ if (nm_setting_ip_config_get_num_addresses (NM_SETTING_IP_CONFIG (object))) {
+ if (g_strcmp0 (nm_setting_ip_config_get_method (NM_SETTING_IP_CONFIG (object)), NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
if (!answered) {
answered = TRUE;
answer = get_answer ("ipv6.method", "manual");
}
if (answer)
- g_object_set (object, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, NULL);
+ g_object_set (object, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, NULL);
}
} else {
answered = FALSE;
- if (!g_strcmp0 (nm_setting_ip6_config_get_method (NM_SETTING_IP6_CONFIG (object)), NM_SETTING_IP6_CONFIG_METHOD_MANUAL))
- g_object_set (object, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
+ if (!g_strcmp0 (nm_setting_ip_config_get_method (NM_SETTING_IP_CONFIG (object)), NM_SETTING_IP6_CONFIG_METHOD_MANUAL))
+ g_object_set (object, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
}
g_signal_handlers_unblock_by_func (object, G_CALLBACK (ipv6_method_changed_cb), NULL);
@@ -1795,8 +1784,8 @@ ipv6_method_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
g_signal_handlers_block_by_func (object, G_CALLBACK (ipv6_addresses_changed_cb), NULL);
/* If method != manual, remove addresses (save them for restoring them later when method becomes 'manual' */
- if (g_strcmp0 (nm_setting_ip6_config_get_method (NM_SETTING_IP6_CONFIG (object)), NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
- if (nm_setting_ip6_config_get_num_addresses (NM_SETTING_IP6_CONFIG (object))) {
+ if (g_strcmp0 (nm_setting_ip_config_get_method (NM_SETTING_IP_CONFIG (object)), NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
+ if (nm_setting_ip_config_get_num_addresses (NM_SETTING_IP_CONFIG (object))) {
if (!answered) {
answered = TRUE;
answer = get_answer ("ipv6.addresses", NULL);
@@ -1804,14 +1793,14 @@ ipv6_method_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
if (answer) {
if (G_IS_VALUE (&value))
g_value_unset (&value);
- nmc_property_get_gvalue (NM_SETTING (object), NM_SETTING_IP6_CONFIG_ADDRESSES, &value);
- g_object_set (object, NM_SETTING_IP6_CONFIG_ADDRESSES, NULL, NULL);
+ nmc_property_get_gvalue (NM_SETTING (object), NM_SETTING_IP_CONFIG_ADDRESSES, &value);
+ g_object_set (object, NM_SETTING_IP_CONFIG_ADDRESSES, NULL, NULL);
}
}
} else {
answered = FALSE;
if (G_IS_VALUE (&value)) {
- nmc_property_set_gvalue (NM_SETTING (object), NM_SETTING_IP6_CONFIG_ADDRESSES, &value);
+ nmc_property_set_gvalue (NM_SETTING (object), NM_SETTING_IP_CONFIG_ADDRESSES, &value);
g_value_unset (&value);
}
}
@@ -1875,24 +1864,24 @@ connection_master_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_
}
void
-nmc_setting_ip4_connect_handlers (NMSettingIP4Config *setting)
+nmc_setting_ip4_connect_handlers (NMSettingIPConfig *setting)
{
g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
- g_signal_connect (setting, "notify::" NM_SETTING_IP4_CONFIG_ADDRESSES,
+ g_signal_connect (setting, "notify::" NM_SETTING_IP_CONFIG_ADDRESSES,
G_CALLBACK (ipv4_addresses_changed_cb), NULL);
- g_signal_connect (setting, "notify::" NM_SETTING_IP4_CONFIG_METHOD,
+ g_signal_connect (setting, "notify::" NM_SETTING_IP_CONFIG_METHOD,
G_CALLBACK (ipv4_method_changed_cb), NULL);
}
void
-nmc_setting_ip6_connect_handlers (NMSettingIP6Config *setting)
+nmc_setting_ip6_connect_handlers (NMSettingIPConfig *setting)
{
g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
- g_signal_connect (setting, "notify::" NM_SETTING_IP6_CONFIG_ADDRESSES,
+ g_signal_connect (setting, "notify::" NM_SETTING_IP_CONFIG_ADDRESSES,
G_CALLBACK (ipv6_addresses_changed_cb), NULL);
- g_signal_connect (setting, "notify::" NM_SETTING_IP6_CONFIG_METHOD,
+ g_signal_connect (setting, "notify::" NM_SETTING_IP_CONFIG_METHOD,
G_CALLBACK (ipv6_method_changed_cb), NULL);
}
@@ -1926,15 +1915,15 @@ nmc_setting_custom_init (NMSetting *setting)
g_return_if_fail (NM_IS_SETTING (setting));
if (NM_IS_SETTING_IP4_CONFIG (setting)) {
- g_object_set (NM_SETTING_IP4_CONFIG (setting),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ g_object_set (NM_SETTING_IP_CONFIG (setting),
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
- nmc_setting_ip4_connect_handlers (NM_SETTING_IP4_CONFIG (setting));
+ nmc_setting_ip4_connect_handlers (NM_SETTING_IP_CONFIG (setting));
} else if (NM_IS_SETTING_IP6_CONFIG (setting)) {
- g_object_set (NM_SETTING_IP6_CONFIG (setting),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ g_object_set (NM_SETTING_IP_CONFIG (setting),
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
NULL);
- nmc_setting_ip6_connect_handlers (NM_SETTING_IP6_CONFIG (setting));
+ nmc_setting_ip6_connect_handlers (NM_SETTING_IP_CONFIG (setting));
} else if (NM_IS_SETTING_WIRELESS (setting)) {
g_object_set (NM_SETTING_WIRELESS (setting),
NM_SETTING_WIRELESS_MODE, NM_SETTING_WIRELESS_MODE_INFRA,
@@ -1990,6 +1979,28 @@ validate_int (NMSetting *setting, const char* prop, gint val, GError **error)
return success;
}
+static gboolean
+validate_int64 (NMSetting *setting, const char* prop, gint64 val, GError **error)
+{
+ GParamSpec *pspec;
+ GValue value = G_VALUE_INIT;
+ gboolean success = TRUE;
+
+ g_value_init (&value, G_TYPE_INT64);
+ g_value_set_int64 (&value, val);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (setting)), prop);
+ g_assert (G_IS_PARAM_SPEC (pspec));
+ if (g_param_value_validate (pspec, &value)) {
+ GParamSpecInt64 *pspec_int = (GParamSpecInt64 *) pspec;
+ G_STATIC_ASSERT (sizeof (long long) >= sizeof (gint64));
+ g_set_error (error, 1, 0, _("'%lld' is not valid; use <%lld-%lld>"),
+ (long long) val, (long long) pspec_int->minimum, (long long) pspec_int->maximum);
+ success = FALSE;
+ }
+ g_value_unset (&value);
+ return success;
+}
+
/* Validate 'val' number against to uint property spec */
static gboolean
validate_uint (NMSetting *setting, const char* prop, guint val, GError **error)
@@ -2004,7 +2015,7 @@ validate_uint (NMSetting *setting, const char* prop, guint val, GError **error)
g_assert (G_IS_PARAM_SPEC (pspec));
if (g_param_value_validate (pspec, &value)) {
GParamSpecUInt *pspec_uint = (GParamSpecUInt *) pspec;
- g_set_error (error, 1, 0, _("'%u' is not valid; use <%d-%d>"),
+ g_set_error (error, 1, 0, _("'%u' is not valid; use <%u-%u>"),
val, pspec_uint->minimum, pspec_uint->maximum);
success = FALSE;
}
@@ -2218,6 +2229,26 @@ nmc_property_set_int (NMSetting *setting, const char *prop, const char *val, GEr
}
static gboolean
+nmc_property_set_int64 (NMSetting *setting, const char *prop, const char *val, GError **error)
+{
+ long val_int;
+
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ if (!nmc_string_to_int (val, FALSE, 0, 0, &val_int)) {
+ g_set_error (error, 1, 0, _("'%s' is not a valid number (or out of range)"), val);
+ return FALSE;
+ }
+
+ /* Validate the number according to the property spec */
+ if (!validate_int64 (setting, prop, (gint64) val_int, error))
+ return FALSE;
+
+ g_object_set (setting, prop, (gint64) val_int, NULL);
+ return TRUE;
+}
+
+static gboolean
nmc_property_set_bool (NMSetting *setting, const char *prop, const char *val, GError **error)
{
gboolean val_bool;
@@ -2337,7 +2368,7 @@ nmc_property_set_byte_array (NMSetting *setting, const char *prop, const char *v
char *val_strip;
const char *delimiters = " \t,";
long int val_int;
- char *bin;
+ GBytes *bytes;
GByteArray *array = NULL;
gboolean success = TRUE;
@@ -2346,11 +2377,9 @@ nmc_property_set_byte_array (NMSetting *setting, const char *prop, const char *v
val_strip = g_strstrip (g_strdup (val));
/* First try hex string in the format of AAbbCCDd */
- bin = nm_utils_hexstr2bin (val_strip, strlen (val_strip));
- if (bin) {
- array = g_byte_array_sized_new (strlen (val_strip)/2);
- g_byte_array_append (array, (const guint8 *) bin, strlen (val_strip)/2);
- g_free (bin);
+ bytes = nm_utils_hexstr2bin (val_strip);
+ if (bytes) {
+ array = g_bytes_unref_to_array (bytes);
goto done;
}
@@ -2663,13 +2692,12 @@ nmc_property_connection_describe_secondaries (NMSetting *setting, const char *pr
static gboolean \
def_func (NMSetting *setting, const char *prop, const char *val, GError **error) \
{ \
- const char *SCHEME_PATH = "file://"; \
char *val_strip = g_strstrip (g_strdup (val)); \
char *p = val_strip; \
gboolean success; \
\
- if (strncmp (val_strip, SCHEME_PATH, strlen (SCHEME_PATH)) == 0) \
- p += strlen (SCHEME_PATH); \
+ if (strncmp (val_strip, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH, STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH)) == 0) \
+ p += STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH); \
\
success = set_func (NM_SETTING_802_1X (setting), \
p, \
@@ -2685,14 +2713,13 @@ nmc_property_connection_describe_secondaries (NMSetting *setting, const char *pr
def_func (NMSetting *setting, const char *prop, const char *val, GError **error) \
{ \
char **strv = NULL; \
- const char *SCHEME_PATH = "file://"; \
char *val_strip = g_strstrip (g_strdup (val)); \
char *p = val_strip; \
const char *path, *password; \
gboolean success; \
\
- if (strncmp (val_strip, SCHEME_PATH, strlen (SCHEME_PATH)) == 0) \
- p += strlen (SCHEME_PATH); \
+ if (strncmp (val_strip, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH, STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH)) == 0) \
+ p += STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH); \
\
strv = nmc_strsplit_set (p, " \t,", 2); \
path = strv[0]; \
@@ -2750,6 +2777,15 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_802_1X_remove_eap,
/* 'ca-cert' */
DEFINE_SETTER_CERT (nmc_property_802_1X_set_ca_cert, nm_setting_802_1x_set_ca_cert)
+static const char *
+nmc_property_802_1X_describe_ca_cert (NMSetting *setting, const char *prop)
+{
+ return _("Enter file path to CA certificate (optionally prefixed with file://).\n"
+ " [file://]<file path>\n"
+ "Note that nmcli does not support specifying certificates as raw blob data.\n"
+ "Example: /home/cimrman/cacert.crt\n");
+}
+
/* 'altsubject-matches' */
DEFINE_SETTER_STR_LIST (nmc_property_802_1X_set_altsubject_matches, nm_setting_802_1x_add_altsubject_match)
@@ -2776,9 +2812,28 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_802_1X_remove_altsubject_matches,
/* 'client-cert' */
DEFINE_SETTER_CERT (nmc_property_802_1X_set_client_cert, nm_setting_802_1x_set_client_cert)
+static const char *
+nmc_property_802_1X_describe_client_cert (NMSetting *setting, const char *prop)
+{
+ return _("Enter file path to client certificate (optionally prefixed with file://).\n"
+ " [file://]<file path>\n"
+ "Note that nmcli does not support specifying certificates as raw blob data.\n"
+ "Example: /home/cimrman/jara.crt\n");
+}
+
/* 'phase2-ca-cert' */
DEFINE_SETTER_CERT (nmc_property_802_1X_set_phase2_ca_cert, nm_setting_802_1x_set_phase2_ca_cert)
+static const char *
+nmc_property_802_1X_describe_phase2_ca_cert (NMSetting *setting, const char *prop)
+{
+ return _("Enter file path to CA certificate for inner authentication (optionally prefixed\n"
+ "with file://).\n"
+ " [file://]<file path>\n"
+ "Note that nmcli does not support specifying certificates as raw blob data.\n"
+ "Example: /home/cimrman/ca-zweite-phase.crt\n");
+}
+
/* 'phase2-altsubject-matches' */
DEFINE_SETTER_STR_LIST (nmc_property_802_1X_set_phase2_altsubject_matches, nm_setting_802_1x_add_phase2_altsubject_match)
@@ -2805,6 +2860,16 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_802_1X_remove_phase2_altsubject_matc
/* 'phase2-client-cert' */
DEFINE_SETTER_CERT (nmc_property_802_1X_set_phase2_client_cert, nm_setting_802_1x_set_phase2_client_cert)
+static const char *
+nmc_property_802_1X_describe_phase2_client_cert (NMSetting *setting, const char *prop)
+{
+ return _("Enter file path to client certificate for inner authentication (optionally prefixed\n"
+ "with file://).\n"
+ " [file://]<file path>\n"
+ "Note that nmcli does not support specifying certificates as raw blob data.\n"
+ "Example: /home/cimrman/jara-zweite-phase.crt\n");
+}
+
/* 'private-key' */
DEFINE_SETTER_PRIV_KEY (nmc_property_802_1X_set_private_key,
nm_setting_802_1x_get_private_key_password,
@@ -2819,7 +2884,8 @@ static const char *
nmc_property_802_1X_describe_private_key (NMSetting *setting, const char *prop)
{
return _("Enter path to a private key and the key password (if not set yet):\n"
- " <file path> [<password>]\n"
+ " [file://]<file path> [<password>]\n"
+ "Note that nmcli does not support specifying private key as raw blob data.\n"
"Example: /home/cimrman/jara-priv-key Dardanely\n");
}
@@ -3074,6 +3140,41 @@ nmc_property_ib_set_p_key (NMSetting *setting, const char *prop, const char *val
return TRUE;
}
+/* --- IP4 / IP6 shared functions --- */
+static NMIPAddress *
+_parse_ip_address (int family, const char *address, GError **error)
+{
+ char *value = g_strdup (address);
+ NMIPAddress *ipaddr;
+
+ ipaddr = nmc_parse_and_build_address (family, g_strstrip (value), error);
+ g_free (value);
+ return ipaddr;
+}
+
+static NMIPRoute *
+_parse_ip_route (int family, const char *route, GError **error)
+{
+ char *value = g_strdup (route);
+ char **routev;
+ guint len;
+ NMIPRoute *iproute = NULL;
+
+ routev = nmc_strsplit_set (g_strstrip (value), " \t", 0);
+ len = g_strv_length (routev);
+ if (len < 1 || len > 3) {
+ g_set_error (error, 1, 0, _("'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"),
+ route);
+ goto finish;
+ }
+ iproute = nmc_parse_and_build_route (family, routev[0], routev[1], len >= 2 ? routev[2] : NULL, error);
+
+finish:
+ g_free (value);
+ g_strfreev (routev);
+ return iproute;
+}
+
/* --- NM_SETTING_IP4_CONFIG_SETTING_NAME property setter functions --- */
/* 'method' */
static const char *ipv4_valid_methods[] = {
@@ -3114,14 +3215,14 @@ nmc_property_ipv4_set_dns (NMSetting *setting, const char *prop, const char *val
g_strfreev (strv);
return FALSE;
}
- nm_setting_ip4_config_add_dns (NM_SETTING_IP4_CONFIG (setting), addr);
+ nm_setting_ip_config_add_dns (NM_SETTING_IP_CONFIG (setting), addr);
}
g_strfreev (strv);
return TRUE;
}
static gboolean
-_validate_and_remove_ipv4_dns (NMSettingIP4Config *setting,
+_validate_and_remove_ipv4_dns (NMSettingIPConfig *setting,
const char *dns,
GError **error)
{
@@ -3133,15 +3234,15 @@ _validate_and_remove_ipv4_dns (NMSettingIP4Config *setting,
return FALSE;
}
- ret = nm_setting_ip4_config_remove_dns_by_value (setting, dns);
+ ret = nm_setting_ip_config_remove_dns_by_value (setting, dns);
if (!ret)
g_set_error (error, 1, 0, _("the property doesn't contain DNS server '%s'"), dns);
return ret;
}
DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv4_remove_dns,
- NM_SETTING_IP4_CONFIG,
- nm_setting_ip4_config_get_num_dns,
- nm_setting_ip4_config_remove_dns,
+ NM_SETTING_IP_CONFIG,
+ nm_setting_ip_config_get_num_dns,
+ nm_setting_ip_config_remove_dns,
_validate_and_remove_ipv4_dns)
static const char *
@@ -3167,20 +3268,20 @@ nmc_property_ipv4_set_dns_search (NMSetting *setting, const char *prop, const ch
}
while (strv && strv[i])
- nm_setting_ip4_config_add_dns_search (NM_SETTING_IP4_CONFIG (setting), strv[i++]);
+ nm_setting_ip_config_add_dns_search (NM_SETTING_IP_CONFIG (setting), strv[i++]);
g_strfreev (strv);
return TRUE;
}
static gboolean
-_validate_and_remove_ipv4_dns_search (NMSettingIP4Config *setting,
+_validate_and_remove_ipv4_dns_search (NMSettingIPConfig *setting,
const char *dns_search,
GError **error)
{
gboolean ret;
- ret = nm_setting_ip4_config_remove_dns_search_by_value (setting, dns_search);
+ ret = nm_setting_ip_config_remove_dns_search_by_value (setting, dns_search);
if (!ret)
g_set_error (error, 1, 0,
_("the property doesn't contain DNS search domain '%s'"),
@@ -3188,38 +3289,23 @@ _validate_and_remove_ipv4_dns_search (NMSettingIP4Config *setting,
return ret;
}
DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv4_remove_dns_search,
- NM_SETTING_IP4_CONFIG,
- nm_setting_ip4_config_get_num_dns_searches,
- nm_setting_ip4_config_remove_dns_search,
+ NM_SETTING_IP_CONFIG,
+ nm_setting_ip_config_get_num_dns_searches,
+ nm_setting_ip_config_remove_dns_search,
_validate_and_remove_ipv4_dns_search)
/* 'addresses' */
-static NMIP4Address *
+static NMIPAddress *
_parse_ipv4_address (const char *address, GError **error)
{
- char *value = g_strdup (address);
- char **addrv;
- NMIP4Address *ip4addr;
-
- addrv = nmc_strsplit_set (g_strstrip (value), " \t", 0);
- if (addrv[0] == NULL || g_strv_length (addrv) > 2) {
- g_set_error (error, 1, 0, _("'%s' is not valid (use ip[/prefix] [gateway])"),
- address);
- g_free (value);
- g_strfreev (addrv);
- return NULL;
- }
- ip4addr = nmc_parse_and_build_ip4_address (addrv[0], addrv[1], error);
- g_free (value);
- g_strfreev (addrv);
- return ip4addr;
+ return _parse_ip_address (AF_INET, address, error);
}
static gboolean
nmc_property_ipv4_set_addresses (NMSetting *setting, const char *prop, const char *val, GError **error)
{
char **strv = NULL, **iter;
- NMIP4Address *ip4addr;
+ NMIPAddress *ip4addr;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -3230,111 +3316,81 @@ nmc_property_ipv4_set_addresses (NMSetting *setting, const char *prop, const cha
g_strfreev (strv);
return FALSE;
}
- nm_setting_ip4_config_add_address (NM_SETTING_IP4_CONFIG (setting), ip4addr);
- nm_ip4_address_unref (ip4addr);
+ nm_setting_ip_config_add_address (NM_SETTING_IP_CONFIG (setting), ip4addr);
+ nm_ip_address_unref (ip4addr);
}
g_strfreev (strv);
return TRUE;
}
static gboolean
-_validate_and_remove_ipv4_address (NMSettingIP4Config *setting,
+_validate_and_remove_ipv4_address (NMSettingIPConfig *setting,
const char *address,
GError **error)
{
- NMIP4Address *ip4addr;
+ NMIPAddress *ip4addr;
gboolean ret;
ip4addr = _parse_ipv4_address (address, error);
if (!ip4addr)
return FALSE;
- ret = nm_setting_ip4_config_remove_address_by_value (setting, ip4addr);
+ ret = nm_setting_ip_config_remove_address_by_value (setting, ip4addr);
if (!ret)
g_set_error (error, 1, 0,
_("the property doesn't contain IP address '%s'"), address);
- nm_ip4_address_unref (ip4addr);
+ nm_ip_address_unref (ip4addr);
return ret;
}
DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv4_remove_addresses,
- NM_SETTING_IP4_CONFIG,
- nm_setting_ip4_config_get_num_addresses,
- nm_setting_ip4_config_remove_address,
+ NM_SETTING_IP_CONFIG,
+ nm_setting_ip_config_get_num_addresses,
+ nm_setting_ip_config_remove_address,
_validate_and_remove_ipv4_address)
static const char *
nmc_property_ipv4_describe_addresses (NMSetting *setting, const char *prop)
{
return _("Enter a list of IPv4 addresses formatted as:\n"
- " ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+ " ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 32.\n\n"
- "Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n");
+ "Example: 192.168.1.5/24, 10.0.0.11/24\n");
}
-/*
- * from: { ip = 1.2.3.4/24, gw = 1.2.3.254 }; { ip = 2.2.2.2/16, gw = 5.5.5.5 }
- * to: 1.2.3.4/24 1.2.3.254, 2.2.2.2/16 5.5.5.5
- * from: { ip = 11::22/64, gw = 22::33 }; { ip = ab::cd/64, gw = ab::1 }
- * to: 11::22/64 22:33, ab::cd/64 ab::1
-*/
-static char *
-nmc_property_out2in_addresses (const char *out_format)
+/* 'gateway' */
+static gboolean
+nmc_property_ipv4_set_gateway (NMSetting *setting, const char *prop, const char *val, GError **error)
{
- GRegex *regex;
- GString *str;
- char **strv;
- int i;
+ NMIPAddress *ip4addr;
- str = g_string_sized_new (128);
- regex = g_regex_new ("\\{ ip = ([^/]+)/([^,]+), gw = ([^ ]+) \\}", 0, 0, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- strv = g_regex_split (regex, out_format, 0);
- for (i = 1; strv && strv[i] && strv[i+1] && strv[i+2]; i=i+4) {
- g_string_append (str, strv[i]); /* IP */
- g_string_append_c (str, '/');
- g_string_append (str, strv[i+1]); /* prefix */
- g_string_append_c (str, ' ');
- g_string_append (str, strv[i+2]); /* gateway */
- g_string_append (str, ", ");
+ if (strchr (val, '/')) {
+ g_set_error (error, 1, 0,
+ _("invalid gateway address '%s'"), val);
+ return FALSE;
}
- if (str->len > 0)
- g_string_truncate (str, str->len - 2);
-
- g_strfreev (strv);
- g_regex_unref (regex);
+ ip4addr = _parse_ipv4_address (val, error);
+ if (!ip4addr)
+ return FALSE;
- return g_string_free (str, FALSE);
+ g_object_set (setting, prop, val, NULL);
+ nm_ip_address_unref (ip4addr);
+ return TRUE;
}
/* 'routes' */
-static NMIP4Route *
+static NMIPRoute *
_parse_ipv4_route (const char *route, GError **error)
{
- char *value = g_strdup (route);
- char **routev;
- guint len;
- NMIP4Route *ip4route = NULL;
-
- routev = nmc_strsplit_set (g_strstrip (value), " \t", 0);
- len = g_strv_length (routev);
- if (len < 1 || len > 3) {
- g_set_error (error, 1, 0, _("'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"),
- route);
- goto finish;
- }
- ip4route = nmc_parse_and_build_ip4_route (routev[0], routev[1], len >= 2 ? routev[2] : NULL, error);
-
-finish:
- g_free (value);
- g_strfreev (routev);
- return ip4route;
+ return _parse_ip_route (AF_INET, route, error);
}
static gboolean
nmc_property_ipv4_set_routes (NMSetting *setting, const char *prop, const char *val, GError **error)
{
char **strv = NULL, **iter;
- NMIP4Route *ip4route;
+ NMIPRoute *ip4route;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -3345,35 +3401,35 @@ nmc_property_ipv4_set_routes (NMSetting *setting, const char *prop, const char *
g_strfreev (strv);
return FALSE;
}
- nm_setting_ip4_config_add_route (NM_SETTING_IP4_CONFIG (setting), ip4route);
- nm_ip4_route_unref (ip4route);
+ nm_setting_ip_config_add_route (NM_SETTING_IP_CONFIG (setting), ip4route);
+ nm_ip_route_unref (ip4route);
}
g_strfreev (strv);
return TRUE;
}
static gboolean
-_validate_and_remove_ipv4_route (NMSettingIP4Config *setting,
+_validate_and_remove_ipv4_route (NMSettingIPConfig *setting,
const char *route,
GError **error)
{
- NMIP4Route *ip4route;
+ NMIPRoute *ip4route;
gboolean ret;
ip4route = _parse_ipv4_route (route, error);
if (!ip4route)
return FALSE;
- ret = nm_setting_ip4_config_remove_route_by_value (setting, ip4route);
+ ret = nm_setting_ip_config_remove_route_by_value (setting, ip4route);
if (!ret)
g_set_error (error, 1, 0, _("the property doesn't contain route '%s'"), route);
- nm_ip4_route_unref (ip4route);
+ nm_ip_route_unref (ip4route);
return ret;
}
DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv4_remove_routes,
- NM_SETTING_IP4_CONFIG,
- nm_setting_ip4_config_get_num_routes,
- nm_setting_ip4_config_remove_route,
+ NM_SETTING_IP_CONFIG,
+ nm_setting_ip_config_get_num_routes,
+ nm_setting_ip_config_remove_route,
_validate_and_remove_ipv4_route)
static const char *
@@ -3383,7 +3439,7 @@ nmc_property_ipv4_describe_routes (NMSetting *setting, const char *prop)
" ip[/prefix] [next-hop] [metric],...\n\n"
"Missing prefix is regarded as a prefix of 32.\n"
"Missing next-hop is regarded as 0.0.0.0.\n"
- "Missing metric or 0 means a default metric (NM/kernel will set a default value).\n\n"
+ "Missing metric means default (NM/kernel will set a default value).\n\n"
"Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
" 10.1.2.0/24\n");
}
@@ -3460,14 +3516,14 @@ nmc_property_ipv6_set_dns (NMSetting *setting, const char *prop, const char *val
g_strfreev (strv);
return FALSE;
}
- nm_setting_ip6_config_add_dns (NM_SETTING_IP6_CONFIG (setting), addr);
+ nm_setting_ip_config_add_dns (NM_SETTING_IP_CONFIG (setting), addr);
}
g_strfreev (strv);
return TRUE;
}
static gboolean
-_validate_and_remove_ipv6_dns (NMSettingIP6Config *setting,
+_validate_and_remove_ipv6_dns (NMSettingIPConfig *setting,
const char *dns,
GError **error)
{
@@ -3479,15 +3535,15 @@ _validate_and_remove_ipv6_dns (NMSettingIP6Config *setting,
return FALSE;
}
- ret = nm_setting_ip6_config_remove_dns_by_value (setting, dns);
+ ret = nm_setting_ip_config_remove_dns_by_value (setting, dns);
if (!ret)
g_set_error (error, 1, 0, _("the property doesn't contain DNS server '%s'"), dns);
return ret;
}
DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv6_remove_dns,
- NM_SETTING_IP6_CONFIG,
- nm_setting_ip6_config_get_num_dns,
- nm_setting_ip6_config_remove_dns,
+ NM_SETTING_IP_CONFIG,
+ nm_setting_ip_config_get_num_dns,
+ nm_setting_ip_config_remove_dns,
_validate_and_remove_ipv6_dns)
static const char *
@@ -3519,20 +3575,20 @@ nmc_property_ipv6_set_dns_search (NMSetting *setting, const char *prop, const ch
}
while (strv && strv[i])
- nm_setting_ip6_config_add_dns_search (NM_SETTING_IP6_CONFIG (setting), strv[i++]);
+ nm_setting_ip_config_add_dns_search (NM_SETTING_IP_CONFIG (setting), strv[i++]);
g_strfreev (strv);
return TRUE;
}
static gboolean
-_validate_and_remove_ipv6_dns_search (NMSettingIP6Config *setting,
+_validate_and_remove_ipv6_dns_search (NMSettingIPConfig *setting,
const char *dns_search,
GError **error)
{
gboolean ret;
- ret = nm_setting_ip6_config_remove_dns_search_by_value (setting, dns_search);
+ ret = nm_setting_ip_config_remove_dns_search_by_value (setting, dns_search);
if (!ret)
g_set_error (error, 1, 0,
_("the property doesn't contain DNS search domain '%s'"),
@@ -3540,38 +3596,23 @@ _validate_and_remove_ipv6_dns_search (NMSettingIP6Config *setting,
return ret;
}
DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv6_remove_dns_search,
- NM_SETTING_IP6_CONFIG,
- nm_setting_ip6_config_get_num_dns_searches,
- nm_setting_ip6_config_remove_dns_search,
+ NM_SETTING_IP_CONFIG,
+ nm_setting_ip_config_get_num_dns_searches,
+ nm_setting_ip_config_remove_dns_search,
_validate_and_remove_ipv6_dns_search)
/* 'addresses' */
-static NMIP6Address *
+static NMIPAddress *
_parse_ipv6_address (const char *address, GError **error)
{
- char *value = g_strstrip (g_strdup (address));
- char **addrv;
- NMIP6Address *ip6addr;
-
- addrv = nmc_strsplit_set (g_strstrip (value), " \t", 0);
- if (addrv[0] == NULL || g_strv_length (addrv) > 2) {
- g_set_error (error, 1, 0, _("'%s' is not valid (use ip[/prefix] [gateway])"),
- address);
- g_free (value);
- g_strfreev (addrv);
- return NULL;
- }
- ip6addr = nmc_parse_and_build_ip6_address (addrv[0], addrv[1], error);
- g_free (value);
- g_strfreev (addrv);
- return ip6addr;
+ return _parse_ip_address (AF_INET6, address, error);
}
static gboolean
nmc_property_ipv6_set_addresses (NMSetting *setting, const char *prop, const char *val, GError **error)
{
char **strv = NULL, **iter;
- NMIP6Address *ip6addr;
+ NMIPAddress *ip6addr;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -3582,75 +3623,80 @@ nmc_property_ipv6_set_addresses (NMSetting *setting, const char *prop, const cha
g_strfreev (strv);
return FALSE;
}
- nm_setting_ip6_config_add_address (NM_SETTING_IP6_CONFIG (setting), ip6addr);
- nm_ip6_address_unref (ip6addr);
+ nm_setting_ip_config_add_address (NM_SETTING_IP_CONFIG (setting), ip6addr);
+ nm_ip_address_unref (ip6addr);
}
g_strfreev (strv);
return TRUE;
}
static gboolean
-_validate_and_remove_ipv6_address (NMSettingIP6Config *setting,
+_validate_and_remove_ipv6_address (NMSettingIPConfig *setting,
const char *address,
GError **error)
{
- NMIP6Address *ip6addr;
+ NMIPAddress *ip6addr;
gboolean ret;
ip6addr = _parse_ipv6_address (address, error);
if (!ip6addr)
return FALSE;
- ret = nm_setting_ip6_config_remove_address_by_value (setting, ip6addr);
+ ret = nm_setting_ip_config_remove_address_by_value (setting, ip6addr);
if (!ret)
g_set_error (error, 1, 0, _("the property doesn't contain IP address '%s'"), address);
- nm_ip6_address_unref (ip6addr);
+ nm_ip_address_unref (ip6addr);
return ret;
}
DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv6_remove_addresses,
- NM_SETTING_IP6_CONFIG,
- nm_setting_ip6_config_get_num_addresses,
- nm_setting_ip6_config_remove_address,
+ NM_SETTING_IP_CONFIG,
+ nm_setting_ip_config_get_num_addresses,
+ nm_setting_ip_config_remove_address,
_validate_and_remove_ipv6_address)
static const char *
nmc_property_ipv6_describe_addresses (NMSetting *setting, const char *prop)
{
return _("Enter a list of IPv6 addresses formatted as:\n"
- " ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+ " ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 128.\n\n"
- "Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, 1050:0:0:0:5:600:300c:326b\n");
+ "Example: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n");
}
-/* 'routes' */
-static NMIP6Route *
-_parse_ipv6_route (const char *route, GError **error)
+/* 'gateway' */
+static gboolean
+nmc_property_ipv6_set_gateway (NMSetting *setting, const char *prop, const char *val, GError **error)
{
- char *value = g_strdup (route);
- char **routev;
- guint len;
- NMIP6Route *ip6route = NULL;
+ NMIPAddress *ip6addr;
- routev = nmc_strsplit_set (g_strstrip (value), " \t", 0);
- len = g_strv_length (routev);
- if (len < 1 || len > 3) {
- g_set_error (error, 1, 0, _("'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"),
- route);
- goto finish;
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ if (strchr (val, '/')) {
+ g_set_error (error, 1, 0,
+ _("invalid gateway address '%s'"), val);
+ return FALSE;
}
- ip6route = nmc_parse_and_build_ip6_route (routev[0], routev[1], len >= 2 ? routev[2] : NULL, error);
+ ip6addr = _parse_ipv6_address (val, error);
+ if (!ip6addr)
+ return FALSE;
-finish:
- g_free (value);
- g_strfreev (routev);
- return ip6route;
+ g_object_set (setting, prop, val, NULL);
+ nm_ip_address_unref (ip6addr);
+ return TRUE;
+}
+
+/* 'routes' */
+static NMIPRoute *
+_parse_ipv6_route (const char *route, GError **error)
+{
+ return _parse_ip_route (AF_INET6, route, error);
}
static gboolean
nmc_property_ipv6_set_routes (NMSetting *setting, const char *prop, const char *val, GError **error)
{
char **strv = NULL, **iter;
- NMIP6Route *ip6route;
+ NMIPRoute *ip6route;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -3661,35 +3707,35 @@ nmc_property_ipv6_set_routes (NMSetting *setting, const char *prop, const char *
g_strfreev (strv);
return FALSE;
}
- nm_setting_ip6_config_add_route (NM_SETTING_IP6_CONFIG (setting), ip6route);
- nm_ip6_route_unref (ip6route);
+ nm_setting_ip_config_add_route (NM_SETTING_IP_CONFIG (setting), ip6route);
+ nm_ip_route_unref (ip6route);
}
g_strfreev (strv);
return TRUE;
}
static gboolean
-_validate_and_remove_ipv6_route (NMSettingIP6Config *setting,
+_validate_and_remove_ipv6_route (NMSettingIPConfig *setting,
const char *route,
GError **error)
{
- NMIP6Route *ip6route;
+ NMIPRoute *ip6route;
gboolean ret;
ip6route = _parse_ipv6_route (route, error);
if (!ip6route)
return FALSE;
- ret = nm_setting_ip6_config_remove_route_by_value (setting, ip6route);
+ ret = nm_setting_ip_config_remove_route_by_value (setting, ip6route);
if (!ret)
g_set_error (error, 1, 0, _("the property doesn't contain route '%s'"), route);
- nm_ip6_route_unref (ip6route);
+ nm_ip_route_unref (ip6route);
return ret;
}
DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv6_remove_routes,
- NM_SETTING_IP6_CONFIG,
- nm_setting_ip6_config_get_num_routes,
- nm_setting_ip6_config_remove_route,
+ NM_SETTING_IP_CONFIG,
+ nm_setting_ip_config_get_num_routes,
+ nm_setting_ip_config_remove_route,
_validate_and_remove_ipv6_route)
static const char *
@@ -3699,7 +3745,7 @@ nmc_property_ipv6_describe_routes (NMSetting *setting, const char *prop)
" ip[/prefix] [next-hop] [metric],...\n\n"
"Missing prefix is regarded as a prefix of 128.\n"
"Missing next-hop is regarded as \"::\".\n"
- "Missing metric or 0 means a default metric (NM/kernel will set a default value).\n\n"
+ "Missing metric means default (NM/kernel will set a default value).\n\n"
"Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:db8:beef::3 2\n"
" abbe::/64 55\n");
}
@@ -4019,32 +4065,27 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_wired_remove_mac_address_blacklist,
static gboolean
nmc_property_wired_set_s390_subchannels (NMSetting *setting, const char *prop, const char *val, GError **error)
{
- char **strv = NULL, **iter;
- GPtrArray *s390_subchannels;
+ char **strv = NULL;
+ int len;
- //FIXME: both libnm and ifcfg-rh also allow two strings (3rd is optional)
strv = nmc_strsplit_set (val, " ,\t", 0);
- if (g_strv_length (strv) != 3) {
- g_set_error (error, 1, 0, _("'%s' is not valid; 3 strings should be provided"),
+ len = g_strv_length (strv);
+ if (len != 2 && len != 3) {
+ g_set_error (error, 1, 0, _("'%s' is not valid; 2 or 3 strings should be provided"),
val);
g_strfreev (strv);
return FALSE;
}
- s390_subchannels = g_ptr_array_sized_new (3);
- for (iter = strv; iter && *iter; iter++)
- g_ptr_array_add (s390_subchannels, *iter);
-
- g_object_set (setting, prop, s390_subchannels, NULL);
+ g_object_set (setting, prop, strv, NULL);
g_strfreev (strv);
- g_ptr_array_free (s390_subchannels, TRUE);
return TRUE;
}
static const char *
nmc_property_wired_describe_s390_subchannels (NMSetting *setting, const char *prop)
{
- return _("Enter a list of three channels (comma or space separated).\n\n"
+ return _("Enter a list of subchannels (comma or space separated).\n\n"
"Example: 0.0.0e20 0.0.0e21 0.0.0e22\n");
}
@@ -4183,6 +4224,27 @@ 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;
+}
+
/* --- 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 };
@@ -4722,6 +4784,8 @@ nmc_add_prop_funcs (char *key,
/* concatenate setting name and property name */
#define GLUE(A,B) (g_strconcat ((NM_SETTING_##A##_SETTING_NAME),(NM_SETTING_##A##_##B), NULL))
+#define GLUE_IP(A,B) (g_strconcat ((NM_SETTING_IP##A##_CONFIG_SETTING_NAME),(NM_SETTING_IP_CONFIG_##B), NULL))
+
void
nmc_properties_init (void)
{
@@ -4764,7 +4828,7 @@ nmc_properties_init (void)
nmc_property_802_1X_get_ca_cert,
nmc_property_802_1X_set_ca_cert,
NULL,
- NULL,
+ nmc_property_802_1X_describe_ca_cert,
NULL,
NULL);
nmc_add_prop_funcs (GLUE (802_1X, CA_PATH),
@@ -4792,7 +4856,7 @@ nmc_properties_init (void)
nmc_property_802_1X_get_client_cert,
nmc_property_802_1X_set_client_cert,
NULL,
- NULL,
+ nmc_property_802_1X_describe_client_cert,
NULL,
NULL);
nmc_add_prop_funcs (GLUE (802_1X, PHASE1_PEAPVER),
@@ -4834,7 +4898,7 @@ nmc_properties_init (void)
nmc_property_802_1X_get_phase2_ca_cert,
nmc_property_802_1X_set_phase2_ca_cert,
NULL,
- NULL,
+ nmc_property_802_1X_describe_phase2_ca_cert,
NULL,
NULL);
nmc_add_prop_funcs (GLUE (802_1X, PHASE2_CA_PATH),
@@ -4862,7 +4926,7 @@ nmc_properties_init (void)
nmc_property_802_1X_get_phase2_client_cert,
nmc_property_802_1X_set_phase2_client_cert,
NULL,
- NULL,
+ nmc_property_802_1X_describe_phase2_client_cert,
NULL,
NULL);
nmc_add_prop_funcs (GLUE (802_1X, PASSWORD),
@@ -5084,6 +5148,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,
@@ -5447,49 +5519,63 @@ nmc_properties_init (void)
NULL);
/* Add editable properties for NM_SETTING_IP4_CONFIG_SETTING_NAME */
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, METHOD),
+ nmc_add_prop_funcs (GLUE_IP (4, METHOD),
nmc_property_ipv4_get_method,
nmc_property_ipv4_set_method,
NULL,
NULL,
nmc_property_ipv4_allowed_method,
NULL);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, DNS),
+ nmc_add_prop_funcs (GLUE_IP (4, DNS),
nmc_property_ipv4_get_dns,
nmc_property_ipv4_set_dns,
nmc_property_ipv4_remove_dns,
nmc_property_ipv4_describe_dns,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, DNS_SEARCH),
+ nmc_add_prop_funcs (GLUE_IP (4, DNS_SEARCH),
nmc_property_ipv4_get_dns_search,
nmc_property_ipv4_set_dns_search,
nmc_property_ipv4_remove_dns_search,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, ADDRESSES),
- nmc_property_ipv4_get_addresses,
+ nmc_add_prop_funcs (GLUE_IP (4, ADDRESSES),
+ nmc_property_ip_get_addresses,
nmc_property_ipv4_set_addresses,
nmc_property_ipv4_remove_addresses,
nmc_property_ipv4_describe_addresses,
NULL,
- nmc_property_out2in_addresses);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, ROUTES),
+ NULL);
+ nmc_add_prop_funcs (GLUE_IP (4, GATEWAY),
+ nmc_property_ipv4_get_gateway,
+ nmc_property_ipv4_set_gateway,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ nmc_add_prop_funcs (GLUE_IP (4, ROUTES),
nmc_property_ipv4_get_routes,
nmc_property_ipv4_set_routes,
nmc_property_ipv4_remove_routes,
nmc_property_ipv4_describe_routes,
NULL,
nmc_property_out2in_routes);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, IGNORE_AUTO_ROUTES),
+ nmc_add_prop_funcs (GLUE_IP (4, ROUTE_METRIC),
+ nmc_property_ipv4_get_route_metric,
+ nmc_property_set_int64,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ nmc_add_prop_funcs (GLUE_IP (4, IGNORE_AUTO_ROUTES),
nmc_property_ipv4_get_ignore_auto_routes,
nmc_property_set_bool,
NULL,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, IGNORE_AUTO_DNS),
+ nmc_add_prop_funcs (GLUE_IP (4, IGNORE_AUTO_DNS),
nmc_property_ipv4_get_ignore_auto_dns,
nmc_property_set_bool,
NULL,
@@ -5503,28 +5589,28 @@ nmc_properties_init (void)
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, DHCP_SEND_HOSTNAME),
+ nmc_add_prop_funcs (GLUE_IP (4, DHCP_SEND_HOSTNAME),
nmc_property_ipv4_get_dhcp_send_hostname,
nmc_property_set_bool,
NULL,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, DHCP_HOSTNAME),
+ nmc_add_prop_funcs (GLUE_IP (4, DHCP_HOSTNAME),
nmc_property_ipv4_get_dhcp_hostname,
nmc_property_set_string,
NULL,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, NEVER_DEFAULT),
+ nmc_add_prop_funcs (GLUE_IP (4, NEVER_DEFAULT),
nmc_property_ipv4_get_never_default,
nmc_property_set_bool,
NULL,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP4_CONFIG, MAY_FAIL),
+ nmc_add_prop_funcs (GLUE_IP (4, MAY_FAIL),
nmc_property_ipv4_get_may_fail,
nmc_property_set_bool,
NULL,
@@ -5533,63 +5619,77 @@ nmc_properties_init (void)
NULL);
/* Add editable properties for NM_SETTING_IP6_CONFIG_SETTING_NAME */
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, METHOD),
+ nmc_add_prop_funcs (GLUE_IP (6, METHOD),
nmc_property_ipv6_get_method,
nmc_property_ipv6_set_method,
NULL,
NULL,
nmc_property_ipv6_allowed_method,
NULL);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, DNS),
+ nmc_add_prop_funcs (GLUE_IP (6, DNS),
nmc_property_ipv6_get_dns,
nmc_property_ipv6_set_dns,
nmc_property_ipv6_remove_dns,
nmc_property_ipv6_describe_dns,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, DNS_SEARCH),
+ nmc_add_prop_funcs (GLUE_IP (6, DNS_SEARCH),
nmc_property_ipv6_get_dns_search,
nmc_property_ipv6_set_dns_search,
nmc_property_ipv6_remove_dns_search,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, ADDRESSES),
- nmc_property_ipv6_get_addresses,
+ nmc_add_prop_funcs (GLUE_IP (6, ADDRESSES),
+ nmc_property_ip_get_addresses,
nmc_property_ipv6_set_addresses,
nmc_property_ipv6_remove_addresses,
nmc_property_ipv6_describe_addresses,
NULL,
- nmc_property_out2in_addresses);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, ROUTES),
+ NULL);
+ nmc_add_prop_funcs (GLUE_IP (6, GATEWAY),
+ nmc_property_ipv6_get_gateway,
+ nmc_property_ipv6_set_gateway,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ nmc_add_prop_funcs (GLUE_IP (6, ROUTES),
nmc_property_ipv6_get_routes,
nmc_property_ipv6_set_routes,
nmc_property_ipv6_remove_routes,
nmc_property_ipv6_describe_routes,
NULL,
nmc_property_out2in_routes);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, IGNORE_AUTO_ROUTES),
+ nmc_add_prop_funcs (GLUE_IP (6, ROUTE_METRIC),
+ nmc_property_ipv6_get_route_metric,
+ nmc_property_set_int64,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ nmc_add_prop_funcs (GLUE_IP (6, IGNORE_AUTO_ROUTES),
nmc_property_ipv6_get_ignore_auto_routes,
nmc_property_set_bool,
NULL,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, IGNORE_AUTO_DNS),
+ nmc_add_prop_funcs (GLUE_IP (6, IGNORE_AUTO_DNS),
nmc_property_ipv6_get_ignore_auto_dns,
nmc_property_set_bool,
NULL,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, NEVER_DEFAULT),
+ nmc_add_prop_funcs (GLUE_IP (6, NEVER_DEFAULT),
nmc_property_ipv6_get_never_default,
nmc_property_set_bool,
NULL,
NULL,
NULL,
NULL);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, MAY_FAIL),
+ nmc_add_prop_funcs (GLUE_IP (6, MAY_FAIL),
nmc_property_ipv6_get_may_fail,
nmc_property_set_bool,
NULL,
@@ -5603,7 +5703,14 @@ nmc_properties_init (void)
NULL,
NULL,
nmc_property_out2in_cut_paren);
- nmc_add_prop_funcs (GLUE (IP6_CONFIG, DHCP_HOSTNAME),
+ nmc_add_prop_funcs (GLUE_IP (6, DHCP_SEND_HOSTNAME),
+ nmc_property_ipv6_get_dhcp_send_hostname,
+ nmc_property_set_bool,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ nmc_add_prop_funcs (GLUE_IP (6, DHCP_HOSTNAME),
nmc_property_ipv6_get_dhcp_hostname,
nmc_property_set_string,
NULL,
@@ -5913,6 +6020,13 @@ nmc_properties_init (void)
NULL,
NULL,
NULL);
+ nmc_add_prop_funcs (GLUE (VPN, PERSISTENT),
+ nmc_property_vpn_get_persistent,
+ nmc_property_set_bool,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
/* Add editable properties for NM_SETTING_WIMAX_SETTING_NAME */
nmc_add_prop_funcs (GLUE (WIMAX, NETWORK_NAME),
@@ -6105,6 +6219,13 @@ 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);
/* Add editable properties for NM_SETTING_WIRELESS_SECURITY_SETTING_NAME */
nmc_add_prop_funcs (GLUE (WIRELESS_SECURITY, KEY_MGMT),
@@ -6421,6 +6542,7 @@ nmc_setting_get_valid_properties (NMSetting *setting)
valid_props[i++] = g_strdup (key_name);
}
valid_props[i] = NULL;
+ g_free (props);
return valid_props;
}
@@ -6690,6 +6812,7 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc, const char *one_prop,
set_val_str (arr, 11, nmc_property_wireless_get_mtu (setting));
set_val_str (arr, 12, nmc_property_wireless_get_seen_bssids (setting));
set_val_str (arr, 13, nmc_property_wireless_get_hidden (setting));
+ set_val_str (arr, 14, nmc_property_wireless_get_powersave (setting));
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
@@ -6742,7 +6865,7 @@ setting_wireless_security_details (NMSetting *setting, NmCli *nmc, const char *o
static gboolean
setting_ip4_config_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboolean secrets)
{
- NMSettingIP4Config *s_ip4 = NM_SETTING_IP4_CONFIG (setting);
+ NMSettingIPConfig *s_ip4 = NM_SETTING_IP_CONFIG (setting);
NmcOutputField *tmpl, *arr;
size_t tmpl_len;
@@ -6760,15 +6883,17 @@ setting_ip4_config_details (NMSetting *setting, NmCli *nmc, const char *one_pro
set_val_str (arr, 1, nmc_property_ipv4_get_method (setting));
set_val_str (arr, 2, nmc_property_ipv4_get_dns (setting));
set_val_str (arr, 3, nmc_property_ipv4_get_dns_search (setting));
- set_val_str (arr, 4, nmc_property_ipv4_get_addresses (setting));
- set_val_str (arr, 5, nmc_property_ipv4_get_routes (setting));
- set_val_str (arr, 6, nmc_property_ipv4_get_ignore_auto_routes (setting));
- set_val_str (arr, 7, nmc_property_ipv4_get_ignore_auto_dns (setting));
- set_val_str (arr, 8, nmc_property_ipv4_get_dhcp_client_id (setting));
- set_val_str (arr, 9, nmc_property_ipv4_get_dhcp_send_hostname (setting));
- set_val_str (arr, 10, nmc_property_ipv4_get_dhcp_hostname (setting));
- set_val_str (arr, 11, nmc_property_ipv4_get_never_default (setting));
- set_val_str (arr, 12, nmc_property_ipv4_get_may_fail (setting));
+ set_val_str (arr, 4, nmc_property_ip_get_addresses (setting));
+ set_val_str (arr, 5, nmc_property_ipv4_get_gateway (setting));
+ set_val_str (arr, 6, nmc_property_ipv4_get_routes (setting));
+ set_val_str (arr, 7, nmc_property_ipv4_get_route_metric (setting));
+ set_val_str (arr, 8, nmc_property_ipv4_get_ignore_auto_routes (setting));
+ set_val_str (arr, 9, nmc_property_ipv4_get_ignore_auto_dns (setting));
+ set_val_str (arr, 10, nmc_property_ipv4_get_dhcp_client_id (setting));
+ set_val_str (arr, 11, nmc_property_ipv4_get_dhcp_send_hostname (setting));
+ set_val_str (arr, 12, nmc_property_ipv4_get_dhcp_hostname (setting));
+ set_val_str (arr, 13, nmc_property_ipv4_get_never_default (setting));
+ set_val_str (arr, 14, nmc_property_ipv4_get_may_fail (setting));
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
@@ -6779,7 +6904,7 @@ setting_ip4_config_details (NMSetting *setting, NmCli *nmc, const char *one_pro
static gboolean
setting_ip6_config_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboolean secrets)
{
- NMSettingIP6Config *s_ip6 = NM_SETTING_IP6_CONFIG (setting);
+ NMSettingIPConfig *s_ip6 = NM_SETTING_IP_CONFIG (setting);
NmcOutputField *tmpl, *arr;
size_t tmpl_len;
@@ -6797,14 +6922,17 @@ setting_ip6_config_details (NMSetting *setting, NmCli *nmc, const char *one_pro
set_val_str (arr, 1, nmc_property_ipv6_get_method (setting));
set_val_str (arr, 2, nmc_property_ipv6_get_dns (setting));
set_val_str (arr, 3, nmc_property_ipv6_get_dns_search (setting));
- set_val_str (arr, 4, nmc_property_ipv6_get_addresses (setting));
- set_val_str (arr, 5, nmc_property_ipv6_get_routes (setting));
- set_val_str (arr, 6, nmc_property_ipv6_get_ignore_auto_routes (setting));
- set_val_str (arr, 7, nmc_property_ipv6_get_ignore_auto_dns (setting));
- set_val_str (arr, 8, nmc_property_ipv6_get_never_default (setting));
- set_val_str (arr, 9, nmc_property_ipv6_get_may_fail (setting));
- set_val_str (arr, 10, nmc_property_ipv6_get_ip6_privacy (setting));
- set_val_str (arr, 11, nmc_property_ipv6_get_dhcp_hostname (setting));
+ set_val_str (arr, 4, nmc_property_ip_get_addresses (setting));
+ set_val_str (arr, 5, nmc_property_ipv6_get_gateway (setting));
+ set_val_str (arr, 6, nmc_property_ipv6_get_routes (setting));
+ set_val_str (arr, 7, nmc_property_ipv6_get_route_metric (setting));
+ set_val_str (arr, 8, nmc_property_ipv6_get_ignore_auto_routes (setting));
+ set_val_str (arr, 9, nmc_property_ipv6_get_ignore_auto_dns (setting));
+ set_val_str (arr, 10, nmc_property_ipv6_get_never_default (setting));
+ set_val_str (arr, 11, nmc_property_ipv6_get_may_fail (setting));
+ set_val_str (arr, 12, nmc_property_ipv6_get_ip6_privacy (setting));
+ set_val_str (arr, 13, nmc_property_ipv6_get_dhcp_send_hostname (setting));
+ set_val_str (arr, 14, nmc_property_ipv6_get_dhcp_hostname (setting));
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
@@ -7054,6 +7182,7 @@ setting_vpn_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboo
set_val_str (arr, 2, nmc_property_vpn_get_user_name (setting));
set_val_str (arr, 3, nmc_property_vpn_get_data (setting));
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));
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
@@ -7231,6 +7360,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));
set_val_str (arr, 6, nmc_property_bridge_get_max_age (setting));
set_val_str (arr, 7, nmc_property_bridge_get_ageing_time (setting));
+ set_val_str (arr, 8, nmc_property_bridge_get_multicast_snooping (setting));
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
diff --git a/clients/cli/settings.h b/clients/cli/settings.h
index ad74fc9053..3c4c814fd2 100644
--- a/clients/cli/settings.h
+++ b/clients/cli/settings.h
@@ -30,8 +30,8 @@ void nmc_properties_cleanup (void);
NMSetting *nmc_setting_new_for_name (const char *name);
void nmc_setting_custom_init (NMSetting *setting);
-void nmc_setting_ip4_connect_handlers (NMSettingIP4Config *setting);
-void nmc_setting_ip6_connect_handlers (NMSettingIP6Config *setting);
+void nmc_setting_ip4_connect_handlers (NMSettingIPConfig *setting);
+void nmc_setting_ip6_connect_handlers (NMSettingIPConfig *setting);
void nmc_setting_wireless_connect_handlers (NMSettingWireless *setting);
void nmc_setting_connection_connect_handlers (NMSettingConnection *setting, NMConnection *connection);
diff --git a/clients/cli/utils.c b/clients/cli/utils.c
index cb8fbf018a..1cbf611e25 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 */
@@ -307,29 +307,122 @@ nmc_term_color_sequence (NmcTermColor color)
}
}
+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;
+ }
+}
+
char *
-nmc_colorize (NmcTermColor color, const char *fmt, ...)
+nmc_colorize (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);
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 <min,max> range.
*/
@@ -454,17 +547,34 @@ nmc_get_user_input (const char *ask_str)
* Split string in 'line' according to 'delim' to (argument) array.
*/
int
-nmc_string_to_arg_array (const char *line, const char *delim, char ***argv, int *argc)
+nmc_string_to_arg_array (const char *line, const char *delim, gboolean unquote,
+ char ***argv, int *argc)
{
- int i = 0;
char **arr;
- arr = g_strsplit_set (line ? line : "", delim ? delim : " \t", 0);
- while (arr && arr[i])
- i++;
+ arr = nmc_strsplit_set (line ? line : "", delim ? delim : " \t", 0);
+
+ if (unquote) {
+ int i = 0;
+ char *s;
+ size_t l;
+ const char *quotes = "\"'";
+
+ while (arr && arr[i]) {
+ s = arr[i];
+ l = strlen (s);
+ if (l >= 2) {
+ if (strchr (quotes, s[0]) && s[l-1] == s[0]) {
+ memmove (s, s+1, l-2);
+ s[l-2] = '\0';
+ }
+ }
+ i++;
+ }
+ }
- *argc = i;
*argv = arr;
+ *argc = g_strv_length (arr);
return 0;
}
@@ -510,13 +620,10 @@ nmc_string_is_valid (const char *input, const char **allowed, GError **error)
finish:
if (ret == NULL) {
char *valid_vals = g_strjoinv (", ", (char **) allowed);
- if (!input || !*input) {
- g_set_error (error, 1, 0, _("missing name, try one of [%s]"),
- valid_vals);
- } else {
- g_set_error (error, 1, 0, _("'%s' not among [%s]"),
- input ? input : "", valid_vals);
- }
+ if (!input || !*input)
+ g_set_error (error, 1, 0, _("missing name, try one of [%s]"), valid_vals);
+ else
+ g_set_error (error, 1, 0, _("'%s' not among [%s]"), input, valid_vals);
g_free (valid_vals);
}
@@ -591,21 +698,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
@@ -640,6 +750,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
*/
@@ -858,23 +988,55 @@ nmc_empty_output_fields (NmCli *nmc)
}
static char *
-get_value_to_print (NmcOutputField *fields,
+colorize_string (gboolean colorize,
+ NmcTermColor color,
+ NmcTermFormat color_fmt,
+ const char *str,
+ gboolean *dealloc)
+{
+ char *out;
+
+ if ( colorize
+ && (color != NMC_TERM_COLOR_NORMAL || color_fmt != NMC_TERM_FORMAT_NORMAL)) {
+ out = nmc_colorize (color, color_fmt, str);
+ *dealloc = TRUE;
+ } else {
+ out = (char *) str;
+ *dealloc = FALSE;
+ }
+ return out;
+}
+
+static char *
+get_value_to_print (NmcOutputField *field,
gboolean field_name,
const char *not_set_str,
- gboolean *dealloc)
+ gboolean *dealloc,
+ gboolean colorize)
{
- 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 (colorize, 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;
}
/*
@@ -904,6 +1066,7 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[])
gboolean field_names = field_values[0].flags & NMC_OF_FLAG_FIELD_NAMES;
gboolean section_prefix = field_values[0].flags & NMC_OF_FLAG_SECTION_PREFIX;
gboolean main_header = main_header_add || main_header_only;
+ gboolean colorize;
/* No headers are printed in terse mode:
* - neither main header nor field (column) names
@@ -911,6 +1074,11 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[])
if ((main_header_only || field_names) && terse)
return;
+ /* Only show colors if the output is a terminal */
+ colorize = nmc->use_colors == NMC_USE_COLOR_YES ? TRUE :
+ nmc->use_colors == NMC_USE_COLOR_NO ? FALSE :
+ isatty (fileno (stdout));
+
if (multiline) {
/* --- Multiline mode --- */
enum { ML_HEADER_WIDTH = 79 };
@@ -933,6 +1101,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;
@@ -944,10 +1113,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 (colorize, 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 ? "." : "",
@@ -955,24 +1128,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 (colorize, 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) {
@@ -990,7 +1169,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 ((NmcOutputField *) field_values+idx, field_names,
+ not_set_str, &dealloc, colorize);
if (terse) {
if (escape) {
@@ -1088,7 +1268,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 (row+i, field_names, "--", &dealloc, FALSE);
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 fc43b0ed92..3088846e5d 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
@@ -67,9 +67,13 @@ 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);
+char *nmc_colorize (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, char ***argv, int *argc);
+int nmc_string_to_arg_array (const char *line, const char *delim, gboolean unquote,
+ char ***argv, int *argc);
const char *nmc_string_is_valid (const char *input, const char **allowed, GError **error);
GSList *nmc_util_strv_to_slist (char **strv);
char * nmc_util_strv_for_display (const char **strv);
@@ -79,6 +83,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
new file mode 100644
index 0000000000..82df1b2de2
--- /dev/null
+++ b/clients/common/nm-polkit-listener.c
@@ -0,0 +1,415 @@
+/* -*- 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2014 Red Hat, Inc.
+ */
+
+/**
+ * SECTION:nm-polkit-listener
+ * @short_description: A polkit agent listener
+ *
+ * #NMPolkitListener is the polkit agent listener used by nmcli and nmtui.
+ * http://www.freedesktop.org/software/polkit/docs/latest/index.html
+ *
+ * For an example polkit agent you can look at polkit source tree:
+ * http://cgit.freedesktop.org/polkit/tree/src/polkitagent/polkitagenttextlistener.c
+ * http://cgit.freedesktop.org/polkit/tree/src/programs/pkttyagent.c
+ * or LXDE polkit agent:
+ * http://git.lxde.org/gitweb/?p=debian/lxpolkit.git;a=blob;f=src/lxpolkit-listener.c
+ * https://github.com/lxde/lxqt-policykit/tree/master/src
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+
+#include "nm-glib-compat.h"
+#include "nm-polkit-listener.h"
+
+G_DEFINE_TYPE (NMPolkitListener, nm_polkit_listener, POLKIT_AGENT_TYPE_LISTENER)
+
+#define NM_POLKIT_LISTENER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_POLKIT_LISTENER, NMPolkitListenerPrivate))
+
+typedef struct {
+ gpointer reg_handle; /* handle of polkit agent registration */
+
+ GSimpleAsyncResult *simple;
+ PolkitAgentSession *active_session;
+ gulong cancel_id;
+ GCancellable *cancellable;
+
+ char *action_id;
+ char *message;
+ char *icon_name;
+ char *identity;
+
+ /* callbacks */
+ NMPolkitListenerOnRequestFunc on_request_callback;
+ NMPolkitListenerOnShowInfoFunc on_show_info_callback;
+ NMPolkitListenerOnShowErrorFunc on_show_error_callback;
+ NMPolkitListenerOnCompletedFunc on_completed_callback;
+ gpointer request_callback_data;
+} NMPolkitListenerPrivate;
+
+
+static void
+on_request (PolkitAgentSession *session,
+ const char *request,
+ gboolean echo_on,
+ gpointer user_data)
+{
+ NMPolkitListenerPrivate *priv = NM_POLKIT_LISTENER_GET_PRIVATE (user_data);
+ char *response = NULL;
+
+ if (priv->on_request_callback) {
+ response = priv->on_request_callback (request, priv->action_id,
+ priv->message, priv->icon_name,
+ priv->identity, echo_on,
+ priv->request_callback_data);
+ }
+
+ if (response) {
+ polkit_agent_session_response (session, response);
+ g_free (response);
+ } else {
+ //FIXME: polkit_agent_session_cancel() should emit "completed", but it doesn't work for me ???
+ //polkit_agent_session_cancel (session);
+ polkit_agent_session_response (session, "");
+ }
+}
+
+static void
+on_show_info (PolkitAgentSession *session,
+ const char *text,
+ gpointer user_data)
+{
+ NMPolkitListenerPrivate *priv = NM_POLKIT_LISTENER_GET_PRIVATE (user_data);
+
+ if (priv->on_show_info_callback)
+ priv->on_show_info_callback (text);
+}
+
+static void
+on_show_error (PolkitAgentSession *session,
+ const char *text,
+ gpointer user_data)
+{
+ NMPolkitListenerPrivate *priv = NM_POLKIT_LISTENER_GET_PRIVATE (user_data);
+
+ if (priv->on_show_error_callback)
+ priv->on_show_error_callback (text);
+}
+
+static void
+on_completed (PolkitAgentSession *session,
+ gboolean gained_authorization,
+ gpointer user_data)
+{
+ NMPolkitListenerPrivate *priv = NM_POLKIT_LISTENER_GET_PRIVATE (user_data);
+
+ if (priv->on_completed_callback)
+ priv->on_completed_callback (gained_authorization);
+
+ g_simple_async_result_complete_in_idle (priv->simple);
+
+ g_object_unref (priv->simple);
+ g_object_unref (priv->active_session);
+ if (priv->cancellable) {
+ g_cancellable_disconnect (priv->cancellable, priv->cancel_id);
+ g_object_unref (priv->cancellable);
+ }
+
+ priv->simple = NULL;
+ priv->active_session = NULL;
+ priv->cancel_id = 0;
+
+ g_clear_pointer (&priv->action_id, g_free);
+ g_clear_pointer (&priv->message, g_free);
+ g_clear_pointer (&priv->icon_name, g_free);
+ g_clear_pointer (&priv->identity, g_free);
+}
+
+static void
+on_cancelled (GCancellable *cancellable, gpointer user_data)
+{
+ NMPolkitListenerPrivate *priv = NM_POLKIT_LISTENER_GET_PRIVATE (user_data);
+
+ polkit_agent_session_cancel (priv->active_session);
+}
+
+static gint
+compare_users (gconstpointer a, gconstpointer b)
+{
+ char *user;
+ int ret;
+
+ if (POLKIT_IS_UNIX_USER (a))
+ user = g_strdup (polkit_unix_user_get_name (POLKIT_UNIX_USER (a)));
+ else
+ user = polkit_identity_to_string (POLKIT_IDENTITY (a));
+
+ ret = g_strcmp0 ((const char *) user, (const char *) b);
+ g_free (user);
+ return ret;
+}
+
+static PolkitIdentity *
+choose_identity (GList *identities)
+{
+ const char *user;
+ GList *elem;
+
+ /* Choose identity. First try current user, then root, and else
+ * take the firts one */
+ user = getenv("USER");
+ elem = g_list_find_custom (identities, user, (GCompareFunc) compare_users);
+ if (!elem) {
+ elem = g_list_find_custom (identities, "root", (GCompareFunc) compare_users);
+ if (!elem)
+ elem = identities;
+ }
+
+ return elem->data;
+}
+
+static void
+initiate_authentication (PolkitAgentListener *listener,
+ const char *action_id,
+ const char *message,
+ const char *icon_name,
+ PolkitDetails *details,
+ const char *cookie,
+ GList *identities,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ NMPolkitListenerPrivate *priv = NM_POLKIT_LISTENER_GET_PRIVATE (listener);
+ GSimpleAsyncResult *simple;
+ PolkitIdentity *identity;
+
+ simple = g_simple_async_result_new (G_OBJECT (listener),
+ callback,
+ user_data,
+ initiate_authentication);
+ if (priv->active_session != NULL) {
+ g_simple_async_result_set_error (simple,
+ POLKIT_ERROR,
+ POLKIT_ERROR_FAILED,
+ _("An authentication session is already underway."));
+ g_simple_async_result_complete_in_idle (simple);
+ g_object_unref (simple);
+ return;
+ }
+
+ /* Choose identity */
+ identity = choose_identity (identities);
+
+ priv->active_session = polkit_agent_session_new (identity, cookie);
+ g_signal_connect (priv->active_session,
+ "completed",
+ G_CALLBACK (on_completed),
+ listener);
+ g_signal_connect (priv->active_session,
+ "request",
+ G_CALLBACK (on_request),
+ listener);
+ g_signal_connect (priv->active_session,
+ "show-info",
+ G_CALLBACK (on_show_info),
+ listener);
+ g_signal_connect (priv->active_session,
+ "show-error",
+ G_CALLBACK (on_show_error),
+ listener);
+
+ priv->action_id = g_strdup (action_id);
+ priv->message = g_strdup (message);
+ priv->icon_name = g_strdup (icon_name);
+ if (POLKIT_IS_UNIX_USER (identity))
+ priv->identity = g_strdup (polkit_unix_user_get_name (POLKIT_UNIX_USER (identity)));
+ else
+ priv->identity = polkit_identity_to_string (identity);
+
+ priv->simple = simple;
+ priv->cancellable = g_object_ref (cancellable);
+ priv->cancel_id = g_cancellable_connect (cancellable,
+ G_CALLBACK (on_cancelled),
+ listener,
+ NULL);
+
+ polkit_agent_session_initiate (priv->active_session);
+}
+
+static gboolean
+initiate_authentication_finish (PolkitAgentListener *listener,
+ GAsyncResult *result,
+ GError **error)
+{
+ return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error);
+}
+
+
+static void
+nm_polkit_listener_init (NMPolkitListener *agent)
+{
+}
+
+static void
+nm_polkit_listener_finalize (GObject *object)
+{
+ NMPolkitListenerPrivate *priv = NM_POLKIT_LISTENER_GET_PRIVATE (object);
+
+ if (priv->reg_handle)
+ polkit_agent_listener_unregister (priv->reg_handle);
+
+ g_free (priv->action_id);
+ g_free (priv->message);
+ g_free (priv->icon_name);
+ g_free (priv->identity);
+
+ G_OBJECT_CLASS (nm_polkit_listener_parent_class)->finalize (object);
+}
+
+static void
+nm_polkit_listener_class_init (NMPolkitListenerClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ PolkitAgentListenerClass *pkal_class = POLKIT_AGENT_LISTENER_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (NMPolkitListenerPrivate));
+
+ gobject_class->finalize = nm_polkit_listener_finalize;
+
+ pkal_class->initiate_authentication = initiate_authentication;
+ pkal_class->initiate_authentication_finish = initiate_authentication_finish;
+}
+
+/**
+ * nm_polkit_listener_new:
+ * @for_session: %TRUE for registering the polkit agent for the user session,
+ * %FALSE for registering it for the running process
+ * @error: location to store error, or %NULL
+ *
+ * Creates a new #NMPolkitListener and registers it as a polkit agent.
+ *
+ * Returns: a new #NMPolkitListener
+ */
+PolkitAgentListener *
+nm_polkit_listener_new (gboolean for_session, GError **error)
+{
+ PolkitAgentListener *listener;
+ PolkitSubject* session;
+ NMPolkitListenerPrivate *priv;
+
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ listener = g_object_new (NM_TYPE_POLKIT_LISTENER, NULL);
+ priv = NM_POLKIT_LISTENER_GET_PRIVATE (listener);
+
+ if (for_session)
+ session = polkit_unix_session_new_for_process_sync (getpid (), NULL, NULL);
+ else
+ session = polkit_unix_process_new_for_owner (getpid (), 0, getuid ());
+
+ priv->reg_handle = polkit_agent_listener_register (listener, POLKIT_AGENT_REGISTER_FLAGS_NONE,
+ session, NULL, NULL, error);
+ if (!priv->reg_handle) {
+ g_object_unref (listener);
+ g_object_unref (session);
+ return NULL;
+ }
+
+ return listener;
+}
+
+/**
+ * nm_polkit_listener_set_request_callback:
+ * @self: a #NMPolkitListener object
+ * @request_callback: callback to install for polkit requests
+ * @request_callback_data: usaer data passed to request_callback when it is called
+ *
+ * Set a callback for "request" signal. The callback will be invoked when polkit
+ * requests an authorization.
+ */
+void
+nm_polkit_listener_set_request_callback (NMPolkitListener *self,
+ NMPolkitListenerOnRequestFunc request_callback,
+ gpointer request_callback_data)
+{
+ NMPolkitListenerPrivate *priv;
+
+ g_return_if_fail (NM_IS_POLKIT_LISTENER (self));
+
+ priv = NM_POLKIT_LISTENER_GET_PRIVATE (self);
+
+ priv->on_request_callback = request_callback;
+ priv->request_callback_data = request_callback_data;
+}
+
+/**
+ * nm_polkit_listener_set_show_info_callback:
+ * @self: a #NMPolkitListener object
+ * @show_info_callback: callback to install for polkit show info trigger
+ *
+ * Set a callback for "show-info" signal. The callback will be invoked when polkit
+ * has an info text to display.
+ */
+void
+nm_polkit_listener_set_show_info_callback (NMPolkitListener *self,
+ NMPolkitListenerOnShowInfoFunc show_info_callback)
+{
+ g_return_if_fail (NM_IS_POLKIT_LISTENER (self));
+
+ NM_POLKIT_LISTENER_GET_PRIVATE (self)->on_show_info_callback = show_info_callback;
+}
+
+/**
+ * nm_polkit_listener_set_show_error_callback:
+ * @self: a #NMPolkitListener object
+ * @show_error_callback: callback to install for polkit show error trigger
+ *
+ * Set a callback for "show-error" signal. The callback will be invoked when polkit
+ * has an error text to display.
+ */
+void
+nm_polkit_listener_set_show_error_callback (NMPolkitListener *self,
+ NMPolkitListenerOnShowErrorFunc show_error_callback)
+{
+ g_return_if_fail (NM_IS_POLKIT_LISTENER (self));
+
+ NM_POLKIT_LISTENER_GET_PRIVATE (self)->on_show_error_callback = show_error_callback;
+}
+
+/**
+ * nm_polkit_listener_set_completed_callback:
+ * @self: a #NMPolkitListener object
+ * @completed_callback: callback to install for polkit completing authorization
+ *
+ * Set a callback for "completed" signal. The callback will be invoked when polkit
+ * completed the request.
+ */
+void
+nm_polkit_listener_set_completed_callback (NMPolkitListener *self,
+ NMPolkitListenerOnCompletedFunc completed_callback)
+{
+ g_return_if_fail (NM_IS_POLKIT_LISTENER (self));
+
+ NM_POLKIT_LISTENER_GET_PRIVATE (self)->on_completed_callback = completed_callback;
+}
diff --git a/clients/common/nm-polkit-listener.h b/clients/common/nm-polkit-listener.h
new file mode 100644
index 0000000000..3cd7501924
--- /dev/null
+++ b/clients/common/nm-polkit-listener.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, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2014 Red Hat, Inc.
+ */
+
+#ifndef __NM_POLKIT_LISTENER_H__
+#define __NM_POLKIT_LISTENER_H__
+
+#include <glib.h>
+
+#define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
+#include <polkitagent/polkitagent.h>
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_POLKIT_LISTENER (nm_polkit_listener_get_type ())
+#define NM_POLKIT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_POLKIT_LISTENER, NMPolkitListener))
+#define NM_POLKIT_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_POLKIT_LISTENER, NMPolkitListenerClass))
+#define NM_IS_POLKIT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_POLKIT_LISTENER))
+#define NM_IS_POLKIT_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_POLKIT_LISTENER))
+#define NM_POLKIT_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_POLKIT_LISTENER, NMPolkitListenerClass))
+
+/**
+ * NMPolkitListenerOnRequestFunc:
+ * @request: the request asked by polkit agent
+ * @action_id: the action_id of the polkit request
+ * @message: the message of the polkit request
+ * @icon_name: the icon name of the polkit request
+ * @user: user name
+ * @echo_on: whether the response to the request should be echoed to the screen
+ * @user_data: user data for the callback
+ *
+ * Called as a result of a request by polkit. The function should obtain response
+ * to the request from user, i.e. get the password required.
+ */
+typedef char * (*NMPolkitListenerOnRequestFunc) (const char *request,
+ const char *action_id,
+ const char *message,
+ const char *icon_name,
+ const char *user,
+ gboolean echo_on,
+ gpointer user_data);
+/**
+ * NMPolkitListenerOnShowInfoFunc:
+ * @text: the info text from polkit
+ *
+ * Called as a result of show-info signal by polkit.
+ */
+typedef void (*NMPolkitListenerOnShowInfoFunc) (const char *text);
+/**
+ * NMPolkitListenerOnShowErrorFunc:
+ * @text: the error text from polkit
+ *
+ * Called as a result of show-error signal by polkit.
+ */
+typedef void (*NMPolkitListenerOnShowErrorFunc) (const char *text);
+/**
+ * NMPolkitListenerCompletedFunc:
+ * @gained_authorization: whether the autorization was successful
+ *
+ * Called as a result of completed signal by polkit.
+ */
+typedef void (*NMPolkitListenerOnCompletedFunc) (gboolean gained_authorization);
+
+
+typedef struct {
+ PolkitAgentListener parent;
+
+} NMPolkitListener;
+
+typedef struct {
+ PolkitAgentListenerClass parent;
+
+} NMPolkitListenerClass;
+
+GType nm_polkit_listener_get_type (void);
+
+PolkitAgentListener* nm_polkit_listener_new (gboolean for_session, GError **error);
+void nm_polkit_listener_set_request_callback (NMPolkitListener *self,
+ NMPolkitListenerOnRequestFunc request_callback,
+ gpointer request_callback_data);
+void nm_polkit_listener_set_show_info_callback (NMPolkitListener *self,
+ NMPolkitListenerOnShowInfoFunc show_info_callback);
+void nm_polkit_listener_set_show_error_callback (NMPolkitListener *self,
+ NMPolkitListenerOnShowErrorFunc show_error_callback);
+void nm_polkit_listener_set_completed_callback (NMPolkitListener *self,
+ NMPolkitListenerOnCompletedFunc completed_callback);
+
+G_END_DECLS
+
+#endif /* __NM_POLKIT_LISTENER_H__ */
diff --git a/clients/tui/nmt-secret-agent.c b/clients/common/nm-secret-agent-simple.c
index 40ab9c14cb..80022a4dc3 100644
--- a/clients/tui/nmt-secret-agent.c
+++ b/clients/common/nm-secret-agent-simple.c
@@ -18,10 +18,10 @@
*/
/**
- * SECTION:nmt-secret-agent
- * @short_description: A secret agent
+ * SECTION:nm-secret-agent-simple
+ * @short_description: A simple secret agent for NetworkManager
*
- * #NmtSecretAgent is the secret agent used by nmtui-connect.
+ * #NMSecretAgentSimple is the secret agent used by nmtui-connect and nmcli.
*
* This is a stripped-down version of gnome-shell's ShellNetworkAgent,
* with bits of the corresponding JavaScript code squished down into
@@ -34,12 +34,11 @@
#include <string.h>
#include <glib/gi18n-lib.h>
-#include "nmt-secret-agent.h"
-#include "nmt-newt.h"
+#include "nm-secret-agent-simple.h"
-G_DEFINE_TYPE (NmtSecretAgent, nmt_secret_agent, NM_TYPE_SECRET_AGENT)
+G_DEFINE_TYPE (NMSecretAgentSimple, nm_secret_agent_simple, NM_TYPE_SECRET_AGENT_OLD)
-#define NMT_SECRET_AGENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_SECRET_AGENT, NmtSecretAgentPrivate))
+#define NM_SECRET_AGENT_SIMPLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimplePrivate))
enum {
REQUEST_SECRETS,
@@ -50,45 +49,48 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
typedef struct {
- NmtSecretAgent *self;
+ NMSecretAgentSimple *self;
gchar *request_id;
NMConnection *connection;
gchar **hints;
- NMSecretAgentGetSecretsFunc callback;
+ NMSecretAgentOldGetSecretsFunc callback;
gpointer callback_data;
-} NmtSecretAgentRequest;
+} NMSecretAgentSimpleRequest;
typedef struct {
- /* <char *request_id, NmtSecretAgentRequest *request> */
+ /* <char *request_id, NMSecretAgentSimpleRequest *request> */
GHashTable *requests;
-} NmtSecretAgentPrivate;
+
+ char *path;
+ gboolean enabled;
+} NMSecretAgentSimplePrivate;
static void
-nmt_secret_agent_request_free (gpointer data)
+nm_secret_agent_simple_request_free (gpointer data)
{
- NmtSecretAgentRequest *request = data;
+ NMSecretAgentSimpleRequest *request = data;
g_object_unref (request->self);
g_object_unref (request->connection);
g_strfreev (request->hints);
- g_slice_free (NmtSecretAgentRequest, request);
+ g_slice_free (NMSecretAgentSimpleRequest, request);
}
static void
-nmt_secret_agent_init (NmtSecretAgent *agent)
+nm_secret_agent_simple_init (NMSecretAgentSimple *agent)
{
- NmtSecretAgentPrivate *priv = NMT_SECRET_AGENT_GET_PRIVATE (agent);
+ NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (agent);
priv->requests = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, nmt_secret_agent_request_free);
+ g_free, nm_secret_agent_simple_request_free);
}
static void
-nmt_secret_agent_finalize (GObject *object)
+nm_secret_agent_simple_finalize (GObject *object)
{
- NmtSecretAgentPrivate *priv = NMT_SECRET_AGENT_GET_PRIVATE (object);
+ NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (object);
GError *error;
GHashTableIter iter;
gpointer key;
@@ -100,9 +102,9 @@ nmt_secret_agent_finalize (GObject *object)
g_hash_table_iter_init (&iter, priv->requests);
while (g_hash_table_iter_next (&iter, &key, &value)) {
- NmtSecretAgentRequest *request = value;
+ NMSecretAgentSimpleRequest *request = value;
- request->callback (NM_SECRET_AGENT (object),
+ request->callback (NM_SECRET_AGENT_OLD (object),
request->connection,
NULL, error,
request->callback_data);
@@ -111,7 +113,9 @@ nmt_secret_agent_finalize (GObject *object)
g_hash_table_destroy (priv->requests);
g_error_free (error);
- G_OBJECT_CLASS (nmt_secret_agent_parent_class)->finalize (object);
+ g_free (priv->path);
+
+ G_OBJECT_CLASS (nm_secret_agent_simple_parent_class)->finalize (object);
}
static gboolean
@@ -129,7 +133,7 @@ strv_has (gchar **haystack,
}
/**
- * NmtSecretAgentSecret:
+ * NMSecretAgentSimpleSecret:
* @name: the user-visible name of the secret. Eg, "WEP Passphrase".
* @value: the value of the secret
* @password: %TRUE if this secret represents a password, %FALSE
@@ -139,38 +143,37 @@ strv_has (gchar **haystack,
*/
typedef struct {
- NmtSecretAgentSecret base;
+ NMSecretAgentSimpleSecret base;
NMSetting *setting;
char *property;
-
- NmtNewtEntryValidator validator;
- gpointer validator_data;
-} NmtSecretAgentSecretReal;
+} NMSecretAgentSimpleSecretReal;
static void
-nmt_secret_agent_secret_free (NmtSecretAgentSecret *secret)
+nm_secret_agent_simple_secret_free (NMSecretAgentSimpleSecret *secret)
{
- NmtSecretAgentSecretReal *real = (NmtSecretAgentSecretReal *)secret;
+ NMSecretAgentSimpleSecretReal *real = (NMSecretAgentSimpleSecretReal *)secret;
g_free (secret->name);
+ g_free (secret->prop_name);
g_free (secret->value);
g_free (real->property);
g_clear_object (&real->setting);
- g_slice_free (NmtSecretAgentSecretReal, real);
+ g_slice_free (NMSecretAgentSimpleSecretReal, real);
}
-static NmtSecretAgentSecret *
-nmt_secret_agent_secret_new (const char *name,
- NMSetting *setting,
- const char *property,
- gboolean password)
+static NMSecretAgentSimpleSecret *
+nm_secret_agent_simple_secret_new (const char *name,
+ NMSetting *setting,
+ const char *property,
+ gboolean password)
{
- NmtSecretAgentSecretReal *real;
+ NMSecretAgentSimpleSecretReal *real;
- real = g_slice_new0 (NmtSecretAgentSecretReal);
+ real = g_slice_new0 (NMSecretAgentSimpleSecretReal);
real->base.name = g_strdup (name);
+ real->base.prop_name = g_strdup_printf ("%s.%s", nm_setting_get_name (setting), property);
real->base.password = password;
if (setting) {
@@ -184,12 +187,12 @@ nmt_secret_agent_secret_new (const char *name,
}
static gboolean
-add_8021x_secrets (NmtSecretAgentRequest *request,
- GPtrArray *secrets)
+add_8021x_secrets (NMSecretAgentSimpleRequest *request,
+ GPtrArray *secrets)
{
NMSetting8021x *s_8021x = nm_connection_get_setting_802_1x (request->connection);
const char *eap_method;
- NmtSecretAgentSecret *secret;
+ NMSecretAgentSimpleSecret *secret;
eap_method = nm_setting_802_1x_get_eap_method (s_8021x, 0);
if (!eap_method)
@@ -203,29 +206,29 @@ add_8021x_secrets (NmtSecretAgentRequest *request,
* is not visible here since we only care about phase2 authentication
* (and don't even care of which one)
*/
- secret = nmt_secret_agent_secret_new (_("Username"),
- NM_SETTING (s_8021x),
- NM_SETTING_802_1X_IDENTITY,
- FALSE);
+ secret = nm_secret_agent_simple_secret_new (_("Username"),
+ NM_SETTING (s_8021x),
+ NM_SETTING_802_1X_IDENTITY,
+ FALSE);
g_ptr_array_add (secrets, secret);
- secret = nmt_secret_agent_secret_new (_("Password"),
- NM_SETTING (s_8021x),
- NM_SETTING_802_1X_PASSWORD,
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Password"),
+ NM_SETTING (s_8021x),
+ NM_SETTING_802_1X_PASSWORD,
+ TRUE);
g_ptr_array_add (secrets, secret);
return TRUE;
}
if (!strcmp (eap_method, "tls")) {
- secret = nmt_secret_agent_secret_new (_("Identity"),
- NM_SETTING (s_8021x),
- NM_SETTING_802_1X_IDENTITY,
- FALSE);
+ secret = nm_secret_agent_simple_secret_new (_("Identity"),
+ NM_SETTING (s_8021x),
+ NM_SETTING_802_1X_IDENTITY,
+ FALSE);
g_ptr_array_add (secrets, secret);
- secret = nmt_secret_agent_secret_new (_("Private key password"),
- NM_SETTING (s_8021x),
- NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD,
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Private key password"),
+ NM_SETTING (s_8021x),
+ NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD,
+ TRUE);
g_ptr_array_add (secrets, secret);
return TRUE;
}
@@ -234,21 +237,21 @@ add_8021x_secrets (NmtSecretAgentRequest *request,
}
static gboolean
-add_wireless_secrets (NmtSecretAgentRequest *request,
- GPtrArray *secrets)
+add_wireless_secrets (NMSecretAgentSimpleRequest *request,
+ GPtrArray *secrets)
{
NMSettingWirelessSecurity *s_wsec = nm_connection_get_setting_wireless_security (request->connection);
const char *key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec);
- NmtSecretAgentSecret *secret;
+ NMSecretAgentSimpleSecret *secret;
if (!key_mgmt)
return FALSE;
if (!strcmp (key_mgmt, "wpa-none") || !strcmp (key_mgmt, "wpa-psk")) {
- secret = nmt_secret_agent_secret_new (_("Password"),
- NM_SETTING (s_wsec),
- NM_SETTING_WIRELESS_SECURITY_PSK,
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Password"),
+ NM_SETTING (s_wsec),
+ NM_SETTING_WIRELESS_SECURITY_PSK,
+ TRUE);
g_ptr_array_add (secrets, secret);
return TRUE;
}
@@ -259,26 +262,22 @@ add_wireless_secrets (NmtSecretAgentRequest *request,
index = nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec);
key = g_strdup_printf ("wep-key%d", index);
- secret = nmt_secret_agent_secret_new (_("Key"),
- NM_SETTING (s_wsec),
- key,
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Key"),
+ NM_SETTING (s_wsec),
+ key,
+ TRUE);
g_free (key);
-#if 0
- nmt_secret_agent_secret_set_validator (secret, static_wep_key_validate,
- nm_setting_wireless_security_get_wep_key_type (s_wsec));
-#endif
g_ptr_array_add (secrets, secret);
return TRUE;
}
if (!strcmp (key_mgmt, "iee8021x")) {
if (!g_strcmp0 (nm_setting_wireless_security_get_auth_alg (s_wsec), "leap")) {
- secret = nmt_secret_agent_secret_new (_("Password"),
- NM_SETTING (s_wsec),
- NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD,
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Password"),
+ NM_SETTING (s_wsec),
+ NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD,
+ TRUE);
g_ptr_array_add (secrets, secret);
return TRUE;
} else
@@ -292,40 +291,40 @@ add_wireless_secrets (NmtSecretAgentRequest *request,
}
static gboolean
-add_pppoe_secrets (NmtSecretAgentRequest *request,
- GPtrArray *secrets)
+add_pppoe_secrets (NMSecretAgentSimpleRequest *request,
+ GPtrArray *secrets)
{
NMSettingPppoe *s_pppoe = nm_connection_get_setting_pppoe (request->connection);
- NmtSecretAgentSecret *secret;
+ NMSecretAgentSimpleSecret *secret;
- secret = nmt_secret_agent_secret_new (_("Username"),
- NM_SETTING (s_pppoe),
- NM_SETTING_PPPOE_USERNAME,
- FALSE);
+ secret = nm_secret_agent_simple_secret_new (_("Username"),
+ NM_SETTING (s_pppoe),
+ NM_SETTING_PPPOE_USERNAME,
+ FALSE);
g_ptr_array_add (secrets, secret);
- secret = nmt_secret_agent_secret_new (_("Service"),
- NM_SETTING (s_pppoe),
- NM_SETTING_PPPOE_SERVICE,
- FALSE);
+ secret = nm_secret_agent_simple_secret_new (_("Service"),
+ NM_SETTING (s_pppoe),
+ NM_SETTING_PPPOE_SERVICE,
+ FALSE);
g_ptr_array_add (secrets, secret);
- secret = nmt_secret_agent_secret_new (_("Password"),
- NM_SETTING (s_pppoe),
- NM_SETTING_PPPOE_PASSWORD,
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Password"),
+ NM_SETTING (s_pppoe),
+ NM_SETTING_PPPOE_PASSWORD,
+ TRUE);
g_ptr_array_add (secrets, secret);
return TRUE;
}
static void
-request_secrets_from_ui (NmtSecretAgentRequest *request)
+request_secrets_from_ui (NMSecretAgentSimpleRequest *request)
{
GPtrArray *secrets;
- NmtSecretAgentSecret *secret;
+ NMSecretAgentSimpleSecret *secret;
const char *title;
char *msg;
gboolean ok = TRUE;
- secrets = g_ptr_array_new_with_free_func ((GDestroyNotify) nmt_secret_agent_secret_free);
+ secrets = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_secret_agent_simple_secret_free);
if (nm_connection_is_type (request->connection, NM_SETTING_WIRELESS_SETTING_NAME)) {
NMSettingWireless *s_wireless;
@@ -349,10 +348,10 @@ request_secrets_from_ui (NmtSecretAgentRequest *request)
title = _("Wired 802.1X authentication");
msg = NULL;
- secret = nmt_secret_agent_secret_new (_("Network name"),
- NM_SETTING (s_con),
- NM_SETTING_CONNECTION_ID,
- FALSE);
+ secret = nm_secret_agent_simple_secret_new (_("Network name"),
+ NM_SETTING (s_con),
+ NM_SETTING_CONNECTION_ID,
+ FALSE);
g_ptr_array_add (secrets, secret);
ok = add_8021x_secrets (request, secrets);
} else if (nm_connection_is_type (request->connection, NM_SETTING_PPPOE_SETTING_NAME)) {
@@ -367,20 +366,20 @@ request_secrets_from_ui (NmtSecretAgentRequest *request)
title = _("PIN code required");
msg = g_strdup (_("PIN code is needed for the mobile broadband device"));
- secret = nmt_secret_agent_secret_new (_("PIN"),
- NM_SETTING (s_gsm),
- NM_SETTING_GSM_PIN,
- FALSE);
+ secret = nm_secret_agent_simple_secret_new (_("PIN"),
+ NM_SETTING (s_gsm),
+ NM_SETTING_GSM_PIN,
+ FALSE);
g_ptr_array_add (secrets, secret);
} else {
title = _("Mobile broadband network password");
msg = g_strdup_printf (_("A password is required to connect to '%s'."),
nm_connection_get_id (request->connection));
- secret = nmt_secret_agent_secret_new (_("Password"),
- NM_SETTING (s_gsm),
- NM_SETTING_GSM_PASSWORD,
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Password"),
+ NM_SETTING (s_gsm),
+ NM_SETTING_GSM_PASSWORD,
+ TRUE);
g_ptr_array_add (secrets, secret);
}
} else if (nm_connection_is_type (request->connection, NM_SETTING_CDMA_SETTING_NAME)) {
@@ -390,10 +389,10 @@ request_secrets_from_ui (NmtSecretAgentRequest *request)
msg = g_strdup_printf (_("A password is required to connect to '%s'."),
nm_connection_get_id (request->connection));
- secret = nmt_secret_agent_secret_new (_("Password"),
- NM_SETTING (s_cdma),
- NM_SETTING_CDMA_PASSWORD,
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Password"),
+ NM_SETTING (s_cdma),
+ NM_SETTING_CDMA_PASSWORD,
+ TRUE);
g_ptr_array_add (secrets, secret);
} else if (nm_connection_is_type (request->connection, NM_SETTING_BLUETOOTH_SETTING_NAME)) {
NMSetting *setting;
@@ -406,10 +405,10 @@ request_secrets_from_ui (NmtSecretAgentRequest *request)
msg = g_strdup_printf (_("A password is required to connect to '%s'."),
nm_connection_get_id (request->connection));
- secret = nmt_secret_agent_secret_new (_("Password"),
- setting,
- "password",
- TRUE);
+ secret = nm_secret_agent_simple_secret_new (_("Password"),
+ setting,
+ "password",
+ TRUE);
g_ptr_array_add (secrets, secret);
} else
ok = FALSE;
@@ -424,18 +423,18 @@ request_secrets_from_ui (NmtSecretAgentRequest *request)
}
static void
-nmt_secret_agent_get_secrets (NMSecretAgent *agent,
- NMConnection *connection,
- const gchar *connection_path,
- const gchar *setting_name,
- const gchar **hints,
- NMSecretAgentGetSecretsFlags flags,
- NMSecretAgentGetSecretsFunc callback,
- gpointer callback_data)
+nm_secret_agent_simple_get_secrets (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ const gchar *connection_path,
+ const gchar *setting_name,
+ const gchar **hints,
+ NMSecretAgentGetSecretsFlags flags,
+ NMSecretAgentOldGetSecretsFunc callback,
+ gpointer callback_data)
{
- NmtSecretAgent *self = NMT_SECRET_AGENT (agent);
- NmtSecretAgentPrivate *priv = NMT_SECRET_AGENT_GET_PRIVATE (self);
- NmtSecretAgentRequest *request;
+ NMSecretAgentSimple *self = NM_SECRET_AGENT_SIMPLE (agent);
+ NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (self);
+ NMSecretAgentSimpleRequest *request;
NMSettingConnection *s_con;
const char *connection_type;
char *request_id;
@@ -470,7 +469,7 @@ nmt_secret_agent_get_secrets (NMSecretAgent *agent,
goto nope;
}
- request = g_slice_new (NmtSecretAgentRequest);
+ request = g_slice_new (NMSecretAgentSimpleRequest);
request->self = g_object_ref (self);
request->connection = g_object_ref (connection);
request->hints = g_strdupv ((gchar **)hints);
@@ -479,37 +478,38 @@ nmt_secret_agent_get_secrets (NMSecretAgent *agent,
request->request_id = request_id;
g_hash_table_replace (priv->requests, request->request_id, request);
- request_secrets_from_ui (request);
+ if (priv->enabled)
+ request_secrets_from_ui (request);
}
/**
- * nmt_secret_agent_response:
- * @self: the #NmtSecretAgent
+ * nm_secret_agent_simple_response:
+ * @self: the #NMSecretAgentSimple
* @request_id: the request ID being responded to
* @secrets: (allow-none): the array of secrets, or %NULL
*
- * Response to a #NmtSecretAgent::get-secrets signal.
+ * Response to a #NMSecretAgentSimple::get-secrets signal.
*
* If the user provided secrets, the caller should set the
* corresponding <literal>value</literal> fields in the
- * #NmtSecretAgentSecrets (freeing any initial values they had), and
- * pass the array to nmt_secret_agent_response(). If the user
+ * #NMSecretAgentSimpleSecrets (freeing any initial values they had), and
+ * pass the array to nm_secret_agent_simple_response(). If the user
* cancelled the request, @secrets should be NULL.
*/
void
-nmt_secret_agent_response (NmtSecretAgent *self,
- const char *request_id,
- GPtrArray *secrets)
+nm_secret_agent_simple_response (NMSecretAgentSimple *self,
+ const char *request_id,
+ GPtrArray *secrets)
{
- NmtSecretAgentPrivate *priv;
- NmtSecretAgentRequest *request;
+ NMSecretAgentSimplePrivate *priv;
+ NMSecretAgentSimpleRequest *request;
GVariant *dict = NULL;
GError *error = NULL;
int i;
- g_return_if_fail (NMT_IS_SECRET_AGENT (self));
+ g_return_if_fail (NM_IS_SECRET_AGENT_SIMPLE (self));
- priv = NMT_SECRET_AGENT_GET_PRIVATE (self);
+ priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (self);
request = g_hash_table_lookup (priv->requests, request_id);
g_return_if_fail (request != NULL);
@@ -521,7 +521,7 @@ nmt_secret_agent_response (NmtSecretAgent *self,
settings = g_hash_table_new (g_str_hash, g_str_equal);
for (i = 0; i < secrets->len; i++) {
- NmtSecretAgentSecretReal *secret = secrets->pdata[i];
+ NMSecretAgentSimpleSecretReal *secret = secrets->pdata[i];
setting_builder = g_hash_table_lookup (settings, nm_setting_get_name (secret->setting));
if (!setting_builder) {
@@ -546,76 +546,124 @@ nmt_secret_agent_response (NmtSecretAgent *self,
"User cancelled");
}
- request->callback (NM_SECRET_AGENT (self), request->connection, dict, error, request->callback_data);
+ request->callback (NM_SECRET_AGENT_OLD (self), request->connection, dict, error, request->callback_data);
g_clear_error (&error);
g_hash_table_remove (priv->requests, request_id);
}
static void
-nmt_secret_agent_cancel_get_secrets (NMSecretAgent *agent,
- const gchar *connection_path,
- const gchar *setting_name)
+nm_secret_agent_simple_cancel_get_secrets (NMSecretAgentOld *agent,
+ const gchar *connection_path,
+ const gchar *setting_name)
{
/* We don't support cancellation. Sorry! */
}
static void
-nmt_secret_agent_save_secrets (NMSecretAgent *agent,
- NMConnection *connection,
- const gchar *connection_path,
- NMSecretAgentSaveSecretsFunc callback,
- gpointer callback_data)
+nm_secret_agent_simple_save_secrets (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ const gchar *connection_path,
+ NMSecretAgentOldSaveSecretsFunc callback,
+ gpointer callback_data)
{
/* We don't support secret storage */
- callback (agent, connection, NULL, callback_data);}
+ callback (agent, connection, NULL, callback_data);
+}
static void
-nmt_secret_agent_delete_secrets (NMSecretAgent *agent,
- NMConnection *connection,
- const gchar *connection_path,
- NMSecretAgentDeleteSecretsFunc callback,
- gpointer callback_data)
+nm_secret_agent_simple_delete_secrets (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ const gchar *connection_path,
+ NMSecretAgentOldDeleteSecretsFunc callback,
+ gpointer callback_data)
{
/* We don't support secret storage, so there's nothing to delete. */
callback (agent, connection, NULL, callback_data);
}
+/**
+ * nm_secret_agent_simple_enable:
+ * @self: the #NMSecretAgentSimple
+ * @path: (allow-none): the path of the connection (if any) to handle secrets
+ * for. If %NULL, secrets for any connection will be handled.
+ *
+ * Enables servicing the requests including the already queued ones. If @path
+ * is given, the agent will only handle requests for connections that match
+ * @path.
+ */
+void
+nm_secret_agent_simple_enable (NMSecretAgentSimple *self, const char *path)
+{
+ NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (self);
+ GList *requests, *iter;
+ GError *error;
+
+ if (g_strcmp0 (path, priv->path) != 0) {
+ g_free (priv->path);
+ priv->path = g_strdup (path);
+ }
+
+ if (priv->enabled)
+ return;
+ priv->enabled = TRUE;
+
+ /* Service pending secret requests. */
+ requests = g_hash_table_get_values (priv->requests);
+ for (iter = requests; iter; iter = g_list_next (iter)) {
+ NMSecretAgentSimpleRequest *request = iter->data;
+
+ if (g_str_has_prefix (request->request_id, priv->path)) {
+ request_secrets_from_ui (request);
+ } else {
+ /* We only handle requests for connection with @path if set. */
+ error = g_error_new (NM_SECRET_AGENT_ERROR, NM_SECRET_AGENT_ERROR_FAILED,
+ "Request for %s secrets doesn't match path %s",
+ request->request_id, priv->path);
+ request->callback (NM_SECRET_AGENT_OLD (self), request->connection, NULL, error, request->callback_data);
+ g_hash_table_remove (priv->requests, request->request_id);
+ g_error_free (error);
+ }
+ }
+ g_list_free (requests);
+}
+
void
-nmt_secret_agent_class_init (NmtSecretAgentClass *klass)
+nm_secret_agent_simple_class_init (NMSecretAgentSimpleClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- NMSecretAgentClass *agent_class = NM_SECRET_AGENT_CLASS (klass);
+ NMSecretAgentOldClass *agent_class = NM_SECRET_AGENT_OLD_CLASS (klass);
- g_type_class_add_private (klass, sizeof (NmtSecretAgentPrivate));
+ g_type_class_add_private (klass, sizeof (NMSecretAgentSimplePrivate));
- gobject_class->finalize = nmt_secret_agent_finalize;
+ gobject_class->finalize = nm_secret_agent_simple_finalize;
- agent_class->get_secrets = nmt_secret_agent_get_secrets;
- agent_class->cancel_get_secrets = nmt_secret_agent_cancel_get_secrets;
- agent_class->save_secrets = nmt_secret_agent_save_secrets;
- agent_class->delete_secrets = nmt_secret_agent_delete_secrets;
+ agent_class->get_secrets = nm_secret_agent_simple_get_secrets;
+ agent_class->cancel_get_secrets = nm_secret_agent_simple_cancel_get_secrets;
+ agent_class->save_secrets = nm_secret_agent_simple_save_secrets;
+ agent_class->delete_secrets = nm_secret_agent_simple_delete_secrets;
/**
- * NmtSecretAgent::request-secrets:
- * @agent: the #NmtSecretAgent
+ * NMSecretAgentSimple::request-secrets:
+ * @agent: the #NMSecretAgentSimple
* @request_id: request ID, to eventually pass to
- * nmt_secret_agent_response().
+ * nm_secret_agent_simple_response().
* @title: a title for the password dialog
* @prompt: a prompt message for the password dialog
- * @secrets: (element-type #NmtSecretAgentSecret): array of secrets
+ * @secrets: (element-type #NMSecretAgentSimpleSecret): array of secrets
* being requested.
*
* Emitted when the agent requires secrets from the user.
*
- * The application should create a password dialog (eg,
- * #NmtPasswordDialog) with the given title and prompt, and an
- * entry for each element of @secrets. If any of the secrets
- * already have a <literal>value</literal> filled in, the
- * corresponding entry should be initialized to that value.
+ * The application should ask user for the secrets. For example,
+ * nmtui should create a password dialog (#NmtPasswordDialog)
+ * with the given title and prompt, and an entry for each
+ * element of @secrets. If any of the secrets already have a
+ * <literal>value</literal> filled in, the corresponding entry
+ * should be initialized to that value.
*
* When the dialog is complete, the app must call
- * nmt_secret_agent_response() with the results.
+ * nm_secret_agent_simple_response() with the results.
*/
signals[REQUEST_SECRETS] = g_signal_new ("request-secrets",
G_TYPE_FROM_CLASS (klass),
@@ -629,16 +677,19 @@ nmt_secret_agent_class_init (NmtSecretAgentClass *klass)
}
/**
- * nmt_secret_agent_new:
+ * nm_secret_agent_simple_new:
+ * @name: the identifier of secret agent
*
- * Creates a new #NmtSecretAgent.
+ * Creates a new #NMSecretAgentSimple. It does not serve any requests until
+ * nm_secret_agent_simple_enable() is called.
*
- * Returns: a new #NmtSecretAgent
+ * Returns: a new #NMSecretAgentSimple if the agent creation is successful
+ * or %NULL in case of a failure.
*/
-NMSecretAgent *
-nmt_secret_agent_new (void)
+NMSecretAgentOld *
+nm_secret_agent_simple_new (const char *name)
{
- return g_initable_new (NMT_TYPE_SECRET_AGENT, NULL, NULL,
- NM_SECRET_AGENT_IDENTIFIER, "nmtui",
+ return g_initable_new (NM_TYPE_SECRET_AGENT_SIMPLE, NULL, NULL,
+ NM_SECRET_AGENT_OLD_IDENTIFIER, name,
NULL);
}
diff --git a/clients/common/nm-secret-agent-simple.h b/clients/common/nm-secret-agent-simple.h
new file mode 100644
index 0000000000..81fec65139
--- /dev/null
+++ b/clients/common/nm-secret-agent-simple.h
@@ -0,0 +1,62 @@
+/* -*- 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2013 - 2014 Red Hat, Inc.
+ */
+
+#ifndef __NM_SECRET_AGENT_SIMPLE_H__
+#define __NM_SECRET_AGENT_SIMPLE_H__
+
+#include <NetworkManager.h>
+#include <nm-secret-agent-old.h>
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_SECRET_AGENT_SIMPLE (nm_secret_agent_simple_get_type ())
+#define NM_SECRET_AGENT_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimple))
+#define NM_SECRET_AGENT_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimpleClass))
+#define NM_IS_SECRET_AGENT_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SECRET_AGENT_SIMPLE))
+#define NM_IS_SECRET_AGENT_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SECRET_AGENT_SIMPLE))
+#define NM_SECRET_AGENT_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimpleClass))
+
+typedef struct {
+ NMSecretAgentOld parent;
+
+} NMSecretAgentSimple;
+
+typedef struct {
+ NMSecretAgentOldClass parent;
+
+} NMSecretAgentSimpleClass;
+
+typedef struct {
+ char *name, *prop_name, *value;
+ gboolean password;
+} NMSecretAgentSimpleSecret;
+
+GType nm_secret_agent_simple_get_type (void);
+
+NMSecretAgentOld *nm_secret_agent_simple_new (const char *name);
+
+void nm_secret_agent_simple_response (NMSecretAgentSimple *self,
+ const char *request_id,
+ GPtrArray *secrets);
+
+void nm_secret_agent_simple_enable (NMSecretAgentSimple *self,
+ const char *path);
+
+G_END_DECLS
+
+#endif /* __NM_SECRET_AGENT_SIMPLE_H__ */
diff --git a/clients/nm-online.c b/clients/nm-online.c
index d4397042bb..bb0c970663 100644
--- a/clients/nm-online.c
+++ b/clients/nm-online.c
@@ -31,7 +31,7 @@
* Robert Love <rml@novell.com>
*/
-#include <config.h>
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/clients/tui/Makefile.am b/clients/tui/Makefile.am
index fb5ad8fcf0..ad9335daf8 100644
--- a/clients/tui/Makefile.am
+++ b/clients/tui/Makefile.am
@@ -10,6 +10,7 @@ AM_CPPFLAGS= \
-I$(top_srcdir)/libnm \
-I$(top_builddir)/libnm \
-I$(srcdir)/newt \
+ -I$(top_srcdir)/clients/common \
$(GLIB_CFLAGS) \
$(NEWT_CFLAGS) \
$(GUDEV_CFLAGS) \
@@ -54,8 +55,14 @@ nmtui_SOURCES = \
nmt-device-entry.h \
nmt-edit-connection-list.c \
nmt-edit-connection-list.h \
+ nmt-editor-grid.c \
+ nmt-editor-grid.h \
nmt-editor-page.c \
nmt-editor-page.h \
+ nmt-editor-page-device.c \
+ nmt-editor-page-device.h \
+ nmt-editor-section.c \
+ nmt-editor-section.h \
nmt-editor.c \
nmt-editor.h \
nmt-ip-entry.c \
@@ -70,22 +77,16 @@ nmtui_SOURCES = \
nmt-page-bridge.h \
nmt-page-bridge-port.c \
nmt-page-bridge-port.h \
- nmt-page-device.c \
- nmt-page-device.h \
nmt-page-dsl.c \
nmt-page-dsl.h \
nmt-page-ethernet.c \
nmt-page-ethernet.h \
- nmt-page-grid.c \
- nmt-page-grid.h \
nmt-page-infiniband.c \
nmt-page-infiniband.h \
nmt-page-ip4.c \
nmt-page-ip4.h \
nmt-page-ip6.c \
nmt-page-ip6.h \
- nmt-page-main.c \
- nmt-page-main.h \
nmt-page-ppp.c \
nmt-page-ppp.h \
nmt-page-team.c \
@@ -106,14 +107,14 @@ nmtui_SOURCES = \
nmt-route-entry.h \
nmt-route-table.c \
nmt-route-table.h \
- nmt-secret-agent.c \
- nmt-secret-agent.h \
nmt-slave-list.c \
nmt-slave-list.h \
nmt-utils.c \
nmt-utils.h \
nmt-widget-list.c \
nmt-widget-list.h \
+ $(srcdir)/../common/nm-secret-agent-simple.c \
+ $(srcdir)/../common/nm-secret-agent-simple.h \
$(NULL)
nmtui_LDADD = \
diff --git a/clients/tui/newt/nmt-newt-popup.c b/clients/tui/newt/nmt-newt-popup.c
index 80fa0181c5..b604eaaa39 100644
--- a/clients/tui/newt/nmt-newt-popup.c
+++ b/clients/tui/newt/nmt-newt-popup.c
@@ -147,12 +147,27 @@ nmt_newt_popup_activated (NmtNewtWidget *widget)
for (i = 0; i < priv->entries->len; i++)
nmt_newt_listbox_append (NMT_NEWT_LISTBOX (listbox), entries[i].label, NULL);
nmt_newt_listbox_set_active (NMT_NEWT_LISTBOX (listbox), priv->active);
+ nmt_newt_widget_set_padding (listbox, 1, 0, 1, 0);
nmt_newt_widget_size_request (listbox, &list_w, &list_h);
+
+ g_object_get (nmt_newt_widget_get_form (widget),
+ "x", &window_x,
+ "y", &window_y,
+ NULL);
newtComponentGetPosition (nmt_newt_component_get_component (NMT_NEWT_COMPONENT (widget)),
&button_x, &button_y);
- window_x = button_x + 4;
- window_y = button_y + 2 - priv->active;
+ /* (window_x + button_x) is the screen X coordinate of the newtComponent. A
+ * newtButton labelled "Foo" is rendered as " <Foo>" (with a preceding
+ * space), so the "F" is at (window_x + button_x + 2). We've added 1 column
+ * of padding to the left of the listbox, so we need to position the popup
+ * at (window_x + button_x + 1) in order for its text to be aligned with the
+ * button's text. (The x and y coordinates given to NmtNewtForm are the
+ * coordinates of the top left of the window content, ignoring the border
+ * graphics.)
+ */
+ window_x += button_x + 1;
+ window_y += button_y - priv->active;
form = g_object_new (NMT_TYPE_NEWT_FORM,
"x", window_x,
diff --git a/clients/tui/newt/nmt-newt-section.c b/clients/tui/newt/nmt-newt-section.c
index df5b188945..1a5035fc09 100644
--- a/clients/tui/newt/nmt-newt-section.c
+++ b/clients/tui/newt/nmt-newt-section.c
@@ -260,12 +260,12 @@ nmt_newt_section_size_request (NmtNewtWidget *widget,
int *height)
{
NmtNewtSectionPrivate *priv = NMT_NEWT_SECTION_GET_PRIVATE (widget);
- int border_width, border_height;
+ int w_ignore, h_ignore;
g_return_if_fail (priv->header != NULL && priv->body != NULL);
if (priv->show_border)
- nmt_newt_widget_size_request (priv->border_grid, &border_width, &border_height);
+ nmt_newt_widget_size_request (priv->border_grid, &w_ignore, &h_ignore);
nmt_newt_widget_size_request (priv->header, &priv->hwidth_req, &priv->hheight_req);
nmt_newt_widget_size_request (priv->body, &priv->bwidth_req, &priv->bheight_req);
@@ -322,10 +322,10 @@ nmt_newt_section_size_allocate (NmtNewtWidget *widget,
NmtNewtSectionPrivate *priv = NMT_NEWT_SECTION_GET_PRIVATE (widget);
if (priv->show_border) {
- int border_height, border_width;
+ int w_ignore, h_ignore;
adjust_border_for_allocation (priv, height);
- nmt_newt_widget_size_request (priv->border_grid, &border_height, &border_width);
+ nmt_newt_widget_size_request (priv->border_grid, &w_ignore, &h_ignore);
nmt_newt_widget_size_allocate (priv->border_grid, x, y, 1, height);
nmt_newt_widget_size_allocate (priv->header, x + 2, y, width, priv->hheight_req);
} else
diff --git a/clients/tui/nm-editor-bindings.c b/clients/tui/nm-editor-bindings.c
index e3b210dec6..9218c31f52 100644
--- a/clients/tui/nm-editor-bindings.c
+++ b/clients/tui/nm-editor-bindings.c
@@ -72,10 +72,10 @@ nm_editor_bindings_init (void)
}
static gboolean
-ip_string_parse (const char *text,
- int family,
- gpointer addr,
- guint32 *prefix)
+parse_addr_prefix (const char *text,
+ int family,
+ char **addr,
+ guint32 *prefix)
{
const char *slash;
char *addrstr, *end;
@@ -83,17 +83,11 @@ ip_string_parse (const char *text,
slash = strchr (text, '/');
- if (slash) {
- if (!prefix)
- return FALSE;
+ if (slash)
addrstr = g_strndup (text, slash - text);
- } else
+ else
addrstr = g_strdup (text);
- valid = (inet_pton (family, addrstr, addr) == 1);
- g_free (addrstr);
-
- if (!valid)
- return FALSE;
+ valid = nm_utils_ipaddr_valid (family, addrstr);
if (slash) {
*prefix = strtoul (slash + 1, &end, 10);
@@ -109,19 +103,24 @@ ip_string_parse (const char *text,
*prefix = 128;
}
+ if (addr && valid)
+ *addr = addrstr;
+ else
+ g_free (addrstr);
return valid;
}
static gboolean
-ip4_addresses_with_prefix_to_strv (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_addresses_with_prefix_to_strv (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
GPtrArray *addrs;
- NMIP4Address *addr;
- guint32 addrbytes, prefix;
- char buf[INET_ADDRSTRLEN], **strings;
+ NMIPAddress *addr;
+ const char *addrstr;
+ guint32 prefix;
+ char **strings;
int i;
addrs = g_value_get_boxed (source_value);
@@ -129,14 +128,12 @@ ip4_addresses_with_prefix_to_strv (GBinding *binding,
for (i = 0; i < addrs->len; i++) {
addr = addrs->pdata[i];
- addrbytes = nm_ip4_address_get_address (addr);
- prefix = nm_ip4_address_get_prefix (addr);
+ addrstr = nm_ip_address_get_address (addr);
+ prefix = nm_ip_address_get_prefix (addr);
- if (addrbytes) {
- strings[i] = g_strdup_printf ("%s/%d",
- inet_ntop (AF_INET, &addrbytes, buf, sizeof (buf)),
- (int) prefix);
- } else
+ if (addrstr)
+ strings[i] = g_strdup_printf ("%s/%d", addrstr, (int) prefix);
+ else
strings[i] = g_strdup ("");
}
@@ -145,38 +142,43 @@ ip4_addresses_with_prefix_to_strv (GBinding *binding,
}
static gboolean
-ip4_addresses_with_prefix_from_strv (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_addresses_with_prefix_from_strv (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
+ int family = GPOINTER_TO_INT (user_data);
char **strings;
GPtrArray *addrs;
- NMIP4Address *addr;
- guint32 addrbytes, prefix;
+ NMIPAddress *addr;
+ char *addrstr;
+ guint32 prefix;
int i;
strings = g_value_get_boxed (source_value);
- /* Fetch the original property value, so as to preserve the gateway elements */
+ /* Fetch the original property value, so as to preserve their extra attributes */
g_object_get (g_binding_get_source (binding),
g_binding_get_source_property (binding), &addrs,
NULL);
for (i = 0; strings[i]; i++) {
if (i >= addrs->len) {
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_prefix (addr, 32);
+ if (family == AF_INET)
+ addr = nm_ip_address_new (AF_INET, "0.0.0.0", 32, NULL);
+ else
+ addr = nm_ip_address_new (AF_INET6, "::", 128, NULL);
g_ptr_array_add (addrs, addr);
} else
addr = addrs->pdata[i];
- if (!ip_string_parse (strings[i], AF_INET, &addrbytes, &prefix)) {
+ if (!parse_addr_prefix (strings[i], family, &addrstr, &prefix)) {
g_ptr_array_unref (addrs);
return FALSE;
}
- nm_ip4_address_set_address (addr, addrbytes);
- nm_ip4_address_set_prefix (addr, prefix);
+ nm_ip_address_set_address (addr, addrstr);
+ nm_ip_address_set_prefix (addr, prefix);
+ g_free (addrstr);
}
g_ptr_array_set_size (addrs, i);
@@ -185,7 +187,8 @@ ip4_addresses_with_prefix_from_strv (GBinding *binding,
}
/**
- * nm_editor_bind_ip4_addresses_with_prefix_to_strv:
+ * nm_editor_bind_ip_addresses_with_prefix_to_strv:
+ * @family: the IP address family
* @source: the source object (eg, an #NMSettingIP4Config)
* @source_property: the property on @source to bind (eg,
* %NM_SETTING_IP4_CONFIG_ADDRESSES)
@@ -194,44 +197,43 @@ ip4_addresses_with_prefix_from_strv (GBinding *binding,
* (eg, "strings")
* @flags: %GBindingFlags
*
- * Binds the #GPtrArray-of-#NMIP4Address property @source_property on @source to
+ * Binds the #GPtrArray-of-#NMIPAddress property @source_property on @source to
* the %G_TYPE_STRV property @target_property on @target.
*
- * Each #NMIP4Address in @source_property will be converted to a string of the
- * form "ip.ad.dr.ess/prefix" in @target_property (and vice versa if
- * %G_BINDING_BIDIRECTIONAL) is specified. The "gateway" fields in
- * @source_property are ignored when converting to strings, and unmodified when
- * converting from strings.
+ * Each #NMIPAddress in @source_property will be converted to a string of the
+ * form "ip.ad.dr.ess/prefix" or "ip:ad:dr:ess/prefix" in @target_property (and
+ * vice versa if %G_BINDING_BIDIRECTIONAL) is specified.
*/
void
-nm_editor_bind_ip4_addresses_with_prefix_to_strv (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags)
+nm_editor_bind_ip_addresses_with_prefix_to_strv (int family,
+ gpointer source,
+ const gchar *source_property,
+ gpointer target,
+ const gchar *target_property,
+ GBindingFlags flags)
{
g_object_bind_property_full (source, source_property,
target, target_property,
flags,
- ip4_addresses_with_prefix_to_strv,
- ip4_addresses_with_prefix_from_strv,
- NULL, NULL);
+ ip_addresses_with_prefix_to_strv,
+ ip_addresses_with_prefix_from_strv,
+ GINT_TO_POINTER (family), NULL);
}
static gboolean
-ip4_addresses_check_and_copy (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_addresses_check_and_copy (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
+ int family = GPOINTER_TO_INT (user_data);
char **strings;
- guint32 addr;
int i;
strings = g_value_get_boxed (source_value);
for (i = 0; strings[i]; i++) {
- if (!ip_string_parse (strings[i], AF_INET, &addr, NULL))
+ if (!nm_utils_ipaddr_valid (family, strings[i]))
return FALSE;
}
@@ -240,7 +242,8 @@ ip4_addresses_check_and_copy (GBinding *binding,
}
/**
- * nm_editor_bind_ip4_addresses_to_strv:
+ * nm_editor_bind_ip_addresses_to_strv:
+ * @family: the IP address family
* @source: the source object (eg, an #NMSettingIP4Config)
* @source_property: the property on @source to bind (eg,
* %NM_SETTING_IP4_CONFIG_DNS)
@@ -251,599 +254,149 @@ ip4_addresses_check_and_copy (GBinding *binding,
*
* Binds the %G_TYPE_STRV property @source_property on @source to the
* %G_TYPE_STRV property @target_property on @target, verifying that
- * each string is a valid IPv4 address when copying.
+ * each string is a valid address of type @family when copying.
*/
void
-nm_editor_bind_ip4_addresses_to_strv (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags)
-{
- g_object_bind_property_full (source, source_property,
- target, target_property,
- flags,
- ip4_addresses_check_and_copy,
- ip4_addresses_check_and_copy,
- NULL, NULL);
-}
-
-static gboolean
-ip4_gateway_to_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- GPtrArray *addrs;
- NMIP4Address *addr;
- guint32 gateway = 0;
- const char *str;
- char buf[INET_ADDRSTRLEN];
- int i;
-
- addrs = g_value_get_boxed (source_value);
- for (i = 0; i < addrs->len; i++) {
- addr = addrs->pdata[i];
- gateway = nm_ip4_address_get_gateway (addr);
- if (gateway)
- break;
- }
-
- if (gateway)
- str = inet_ntop (AF_INET, &gateway, buf, sizeof (buf));
- else
- str = "";
- g_value_set_string (target_value, str);
- return TRUE;
-}
-
-static gboolean
-ip4_gateway_from_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- const char *text;
- GPtrArray *addrs;
- NMIP4Address *addr;
- guint32 addrbytes;
- int i;
-
- text = g_value_get_string (source_value);
- if (!ip_string_parse (text, AF_INET, &addrbytes, NULL))
- return FALSE;
-
- /* Fetch the original property value, so as to preserve the IP address elements */
- g_object_get (g_binding_get_source (binding),
- g_binding_get_source_property (binding), &addrs,
- NULL);
- if (!addrs->len) {
- g_ptr_array_unref (addrs);
- return FALSE;
- }
- addr = addrs->pdata[0];
- if (addrbytes == nm_ip4_address_get_gateway (addr)) {
- g_ptr_array_unref (addrs);
- return FALSE;
- }
- nm_ip4_address_set_gateway (addr, addrbytes);
-
- for (i = 1; i < addrs->len; i++) {
- addr = addrs->pdata[i];
- nm_ip4_address_set_gateway (addr, 0);
- }
-
- g_value_take_boxed (target_value, addrs);
- return TRUE;
-}
-
-/**
- * nm_editor_bind_ip4_gateway_to_string:
- * @source: the source object (eg, an #NMSettingIP4Config)
- * @source_property: the property on @source to bind (eg,
- * %NM_SETTING_IP4_CONFIG_ADDRESSES)
- * @target: the target object (eg, an #NmtNewtEntry)
- * @target_property: the property on @target to bind
- * (eg, "text")
- * @flags: %GBindingFlags
- *
- * Binds the #GPtrArray-of-#NMIP4Route property @source_property on @source to
- * the %G_TYPE_STRING property @target_property on @target.
- *
- * Specifically, this binds the "gateway" field of the first address in
- * @source_property; all other addresses in @source_property are ignored, and
- * its "address" and "prefix" fields are unmodified.
- */
-void
-nm_editor_bind_ip4_gateway_to_string (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags)
+nm_editor_bind_ip_addresses_to_strv (int family,
+ gpointer source,
+ const gchar *source_property,
+ gpointer target,
+ const gchar *target_property,
+ GBindingFlags flags)
{
g_object_bind_property_full (source, source_property,
target, target_property,
flags,
- ip4_gateway_to_string,
- ip4_gateway_from_string,
- NULL, NULL);
+ ip_addresses_check_and_copy,
+ ip_addresses_check_and_copy,
+ GINT_TO_POINTER (family), NULL);
}
static gboolean
-ip4_route_transform_to_dest_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_gateway_to_string (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP4Route *route;
- char buf[INET_ADDRSTRLEN], *string;
- guint32 addrbytes;
-
- route = g_value_get_boxed (source_value);
- if (route)
- addrbytes = nm_ip4_route_get_dest (route);
- else
- addrbytes = 0;
-
- if (addrbytes) {
- string = g_strdup_printf ("%s/%d",
- inet_ntop (AF_INET, &addrbytes, buf, sizeof (buf)),
- (int) nm_ip4_route_get_prefix (route));
- g_value_take_string (target_value, string);
- } else
- g_value_set_string (target_value, "");
+ g_value_set_string (target_value, g_value_get_string (source_value));
return TRUE;
}
static gboolean
-ip4_route_transform_to_next_hop_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_gateway_from_string (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP4Route *route;
- char buf[INET_ADDRSTRLEN];
- guint32 addrbytes;
+ int family = GPOINTER_TO_INT (user_data);
+ const char *gateway;
- route = g_value_get_boxed (source_value);
- if (route)
- addrbytes = nm_ip4_route_get_next_hop (route);
- else
- addrbytes = 0;
+ gateway = g_value_get_string (source_value);
+ if (gateway && !nm_utils_ipaddr_valid (family, gateway))
+ gateway = NULL;
- if (addrbytes)
- inet_ntop (AF_INET, &addrbytes, buf, sizeof (buf));
- else
- buf[0] = '\0';
- g_value_set_string (target_value, buf);
+ g_value_set_string (target_value, gateway);
return TRUE;
}
static gboolean
-ip4_route_transform_to_metric_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_addresses_to_gateway (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP4Route *route;
- char *string;
+ GPtrArray *addrs;
- route = g_value_get_boxed (source_value);
- if (route && nm_ip4_route_get_dest (route)) {
- string = g_strdup_printf ("%lu", (gulong) nm_ip4_route_get_metric (route));
- g_value_take_string (target_value, string);
+ addrs = g_value_get_boxed (source_value);
+ if (addrs->len == 0) {
+ g_value_set_string (target_value, NULL);
+ return TRUE;
} else
- g_value_set_string (target_value, "");
- return TRUE;
-}
-
-static gboolean
-ip4_route_transform_from_dest_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- NMIP4Route *route;
- const char *text;
- guint32 addrbytes, prefix;
-
- text = g_value_get_string (source_value);
- if (!ip_string_parse (text, AF_INET, &addrbytes, &prefix))
return FALSE;
-
- /* Fetch the original property value */
- g_object_get (g_binding_get_source (binding),
- g_binding_get_source_property (binding), &route,
- NULL);
-
- nm_ip4_route_set_dest (route, addrbytes);
- nm_ip4_route_set_prefix (route, prefix);
-
- g_value_take_boxed (target_value, route);
- return TRUE;
}
static gboolean
-ip4_route_transform_from_next_hop_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- NMIP4Route *route;
- const char *text;
- guint32 addrbytes;
-
- text = g_value_get_string (source_value);
- if (*text) {
- if (!ip_string_parse (text, AF_INET, &addrbytes, NULL))
- return FALSE;
- } else
- addrbytes = 0;
-
- /* Fetch the original property value */
- g_object_get (g_binding_get_source (binding),
- g_binding_get_source_property (binding), &route,
- NULL);
-
- nm_ip4_route_set_next_hop (route, addrbytes);
-
- g_value_take_boxed (target_value, route);
- return TRUE;
-}
-
-static gboolean
-ip4_route_transform_from_metric_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- NMIP4Route *route;
- const char *text;
- guint32 metric;
-
- text = g_value_get_string (source_value);
- metric = strtoul (text, NULL, 10);
-
- /* Fetch the original property value */
- g_object_get (g_binding_get_source (binding),
- g_binding_get_source_property (binding), &route,
- NULL);
-
- nm_ip4_route_set_metric (route, metric);
-
- g_value_take_boxed (target_value, route);
- return TRUE;
-}
-
-/**
- * nm_editor_bind_ip4_route_to_strings:
- * @source: the source object
- * @source_property: the source property
- * @dest_target: the target object for the route's destionation
- * @dest_target_property: the property on @dest_target
- * @next_hop_target: the target object for the route's next hop
- * @next_hop_target_property: the property on @next_hop_target
- * @metric_target: the target object for the route's metric
- * @metric_target_property: the property on @metric_target
- * @flags: %GBindingFlags
- *
- * Binds the #NMIP4Route-valued property @source_property on @source to the
- * three indicated string-valued target properties (and vice versa if
- * %G_BINDING_BIDIRECTIONAL is specified).
- *
- * @dest_target_property should be an "address/prefix" string, as with
- * nm_editor_bind_ip4_addresses_with_prefix_to_strv(). @next_hop_target_property
- * is a plain IP address, and @metric_target_property is a number.
- */
-void
-nm_editor_bind_ip4_route_to_strings (gpointer source,
- const gchar *source_property,
- gpointer dest_target,
- const gchar *dest_target_property,
- gpointer next_hop_target,
- const gchar *next_hop_target_property,
- gpointer metric_target,
- const gchar *metric_target_property,
- GBindingFlags flags)
-{
- g_object_bind_property_full (source, source_property,
- dest_target, dest_target_property,
- flags,
- ip4_route_transform_to_dest_string,
- ip4_route_transform_from_dest_string,
- NULL, NULL);
- g_object_bind_property_full (source, source_property,
- next_hop_target, next_hop_target_property,
- flags,
- ip4_route_transform_to_next_hop_string,
- ip4_route_transform_from_next_hop_string,
- NULL, NULL);
- g_object_bind_property_full (source, source_property,
- metric_target, metric_target_property,
- flags,
- ip4_route_transform_to_metric_string,
- ip4_route_transform_from_metric_string,
- NULL, NULL);
-}
-
-#define IP6_ADDRESS_SET(addr) ( addr \
- && memcmp (addr, &in6addr_any, sizeof (struct in6_addr)) != 0)
-
-static gboolean
-ip6_addresses_with_prefix_to_strv (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_addresses_to_sensitivity (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
GPtrArray *addrs;
- NMIP6Address *addr;
- const struct in6_addr *addrbytes;
- guint prefix;
- char **strings, buf[INET6_ADDRSTRLEN];
- int i;
addrs = g_value_get_boxed (source_value);
- strings = g_new0 (char *, addrs->len + 1);
-
- for (i = 0; i < addrs->len; i++) {
- addr = addrs->pdata[i];
- addrbytes = nm_ip6_address_get_address (addr);
- prefix = nm_ip6_address_get_prefix (addr);
-
- if (IP6_ADDRESS_SET (addrbytes)) {
- strings[i] = g_strdup_printf ("%s/%d",
- inet_ntop (AF_INET6, addrbytes, buf, sizeof (buf)),
- prefix);
- } else
- strings[i] = g_strdup ("");
- }
-
- g_value_take_boxed (target_value, strings);
- return TRUE;
-}
-
-static gboolean
-ip6_addresses_with_prefix_from_strv (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- char **strings;
- GPtrArray *addrs;
- NMIP6Address *addr;
- struct in6_addr addrbytes;
- guint32 prefix;
- int i;
-
- strings = g_value_get_boxed (source_value);
-
- /* Fetch the original property value, so as to preserve the gateway elements */
- g_object_get (g_binding_get_source (binding),
- g_binding_get_source_property (binding), &addrs,
- NULL);
-
- for (i = 0; strings[i]; i++) {
- if (i >= addrs->len) {
- addr = nm_ip6_address_new ();
- nm_ip6_address_set_prefix (addr, 128);
- g_ptr_array_add (addrs, addr);
- } else
- addr = addrs->pdata[i];
-
- if (!ip_string_parse (strings[i], AF_INET6, &addrbytes, &prefix)) {
- g_ptr_array_unref (addrs);
- return FALSE;
- }
-
- nm_ip6_address_set_address (addr, &addrbytes);
- nm_ip6_address_set_prefix (addr, prefix);
- }
-
- g_ptr_array_set_size (addrs, i);
- g_value_set_boxed (target_value, addrs);
+ g_value_set_boolean (target_value, addrs->len != 0);
return TRUE;
}
/**
- * nm_editor_bind_ip6_addresses_with_prefix_to_strv:
- * @source: the source object (eg, an #NMSettingIP6Config)
- * @source_property: the property on @source to bind (eg,
- * %NM_SETTING_IP6_CONFIG_ADDRESSES)
- * @target: the target object (eg, an #NmtAddressList)
- * @target_property: the property on @target to bind
- * (eg, "strings")
+ * nm_editor_bind_ip_gateway_to_string:
+ * @family: the IP address family
+ * @source: the source #NMSettingIPConfig
+ * @target: the target object (eg, an #NmtIPEntry)
+ * @target_property: the property on @target to bind (eg, "text")
+ * @target_sensitive_property: the "sensitivity" property on @target to bind
* @flags: %GBindingFlags
*
- * Binds the #GPtrArray-of-#NMIP6Address property @source_property on @source to
- * the %G_TYPE_STRV property @target_property on @target.
+ * Binds the #NMSettingIPConfig:gateway property on @source to the
+ * %G_TYPE_STRING property @target_property and %G_TYPE_BOOLEAN property
+ * @target_sensitive_property on @target, also taking the
+ * #NMSettingIPConfig:addresses property on @source into account.
*
- * Each #NMIP6Address in triplet in @source_property will be converted to a
- * string of the form "ip::ad:dr:ess/prefix" in @target_property (and vice versa
- * if %G_BINDING_BIDIRECTIONAL) is specified. The "gateway" fields in
- * @source_property are ignored when converting to strings, and unmodified when
- * converting from strings.
- */
-void
-nm_editor_bind_ip6_addresses_with_prefix_to_strv (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags)
-{
- g_object_bind_property_full (source, source_property,
- target, target_property,
- flags,
- ip6_addresses_with_prefix_to_strv,
- ip6_addresses_with_prefix_from_strv,
- NULL, NULL);
-}
-
-static gboolean
-ip6_addresses_check_and_copy (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- char **strings;
- struct in6_addr addr;
- int i;
-
- strings = g_value_get_boxed (source_value);
-
- for (i = 0; strings[i]; i++) {
- if (!ip_string_parse (strings[i], AF_INET6, &addr, NULL))
- return FALSE;
- }
-
- g_value_set_boxed (target_value, strings);
- return TRUE;
-}
-
-/**
- * nm_editor_bind_ip6_addresses_to_strv:
- * @source: the source object (eg, an #NMSettingIP6Config)
- * @source_property: the property on @source to bind (eg,
- * %NM_SETTING_IP6_CONFIG_DNS)
- * @target: the target object (eg, an #NmtAddressList)
- * @target_property: the property on @target to bind
- * (eg, "strings")
- * @flags: %GBindingFlags
+ * In particular, if @source has no static IP addresses, then @target_property
+ * will be set to "" and @target_sensitive_property will be set to %FALSE.
*
- * Binds the %G_TYPE_STRV property @source_property on @source to the
- * %G_TYPE_STRV property @target_property on @target, verifying that
- * each string is a valid IPv6 address when copying.
+ * If @source has at least one static IP address, then
+ * @target_sensitive_property will be set to %TRUE, @target_property will be
+ * initialized from @source's #NMSettingIPConfig:gateway, and @source will be
+ * updated with the value of @target_property whenever it contains a valid IP
+ * address.
*/
void
-nm_editor_bind_ip6_addresses_to_strv (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags)
+nm_editor_bind_ip_gateway_to_string (int family,
+ NMSettingIPConfig *source,
+ gpointer target,
+ const gchar *target_property,
+ const gchar *target_sensitive_property,
+ GBindingFlags flags)
{
- g_object_bind_property_full (source, source_property,
+ g_object_bind_property_full (source, "gateway",
target, target_property,
flags,
- ip6_addresses_check_and_copy,
- ip6_addresses_check_and_copy,
+ ip_gateway_to_string,
+ ip_gateway_from_string,
+ GINT_TO_POINTER (family), NULL);
+ g_object_bind_property_full (source, "addresses",
+ source, "gateway",
+ (flags & G_BINDING_SYNC_CREATE),
+ ip_addresses_to_gateway,
+ NULL,
NULL, NULL);
-}
-
-static gboolean
-ip6_gateway_to_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- GPtrArray *addrs;
- NMIP6Address *addr;
- const struct in6_addr *gateway;
- char buf[INET6_ADDRSTRLEN];
- const char *str;
-
- addrs = g_value_get_boxed (source_value);
- if (addrs->len == 0)
- return FALSE;
-
- addr = addrs->pdata[0];
- gateway = nm_ip6_address_get_gateway (addr);
-
- if (IP6_ADDRESS_SET (gateway))
- str = inet_ntop (AF_INET6, gateway, buf, sizeof (buf));
- else
- str = "";
- g_value_set_string (target_value, str);
- return TRUE;
-}
-
-static gboolean
-ip6_gateway_from_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- GPtrArray *addrs;
- const char *text;
- NMIP6Address *addr;
- struct in6_addr gateway;
- int i;
-
- text = g_value_get_string (source_value);
- if (!ip_string_parse (text, AF_INET6, &gateway, NULL))
- return FALSE;
-
- /* Fetch the original property value, so as to preserve the IP address elements */
- g_object_get (g_binding_get_source (binding),
- g_binding_get_source_property (binding), &addrs,
- NULL);
- if (!addrs->len) {
- g_ptr_array_unref (addrs);
- return FALSE;
- }
-
- addr = addrs->pdata[0];
- nm_ip6_address_set_gateway (addr, &gateway);
-
- for (i = 1; i < addrs->len; i++) {
- addr = addrs->pdata[i];
- nm_ip6_address_set_gateway (addr, &in6addr_any);
- }
-
- g_value_take_boxed (target_value, addrs);
- return TRUE;
-}
-
-/**
- * nm_editor_bind_ip6_gateway_to_string:
- * @source: the source object (eg, an #NMSettingIP6Config)
- * @source_property: the property on @source to bind (eg,
- * %NM_SETTING_IP6_CONFIG_ADDRESSES)
- * @target: the target object (eg, an #NmtNewtEntry)
- * @target_property: the property on @target to bind
- * (eg, "text")
- * @flags: %GBindingFlags
- *
- * Binds the #GPtrArray-of-#NMIP6Address property @source_property on @source to
- * the %G_TYPE_STRING property @target_property on @target.
- *
- * Specifically, this binds the "gateway" field of the first address in
- * @source_property; all other addresses in @source_property are ignored, and
- * its "address" and "prefix" fields are unmodified.
- */
-void
-nm_editor_bind_ip6_gateway_to_string (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags)
-{
- g_object_bind_property_full (source, source_property,
- target, target_property,
- flags,
- ip6_gateway_to_string,
- ip6_gateway_from_string,
+ g_object_bind_property_full (source, "addresses",
+ target, target_sensitive_property,
+ (flags & G_BINDING_SYNC_CREATE),
+ ip_addresses_to_sensitivity,
+ NULL,
NULL, NULL);
}
static gboolean
-ip6_route_transform_to_dest_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_route_transform_to_dest_string (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP6Route *route;
- char buf[INET6_ADDRSTRLEN], *string;
- const struct in6_addr *addrbytes;
+ NMIPRoute *route;
+ const char *addrstr;
+ char *string;
route = g_value_get_boxed (source_value);
if (route)
- addrbytes = nm_ip6_route_get_dest (route);
+ addrstr = nm_ip_route_get_dest (route);
else
- addrbytes = &in6addr_any;
+ addrstr = NULL;
- if (IP6_ADDRESS_SET (addrbytes)) {
- string = g_strdup_printf ("%s/%d",
- inet_ntop (AF_INET6, addrbytes, buf, sizeof (buf)),
- (int) nm_ip6_route_get_prefix (route));
+ if (addrstr) {
+ string = g_strdup_printf ("%s/%d", addrstr, (int) nm_ip_route_get_prefix (route));
g_value_take_string (target_value, string);
} else
g_value_set_string (target_value, "");
@@ -851,41 +404,38 @@ ip6_route_transform_to_dest_string (GBinding *binding,
}
static gboolean
-ip6_route_transform_to_next_hop_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_route_transform_to_next_hop_string (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP6Route *route;
- char buf[INET6_ADDRSTRLEN];
- const struct in6_addr *addrbytes;
+ NMIPRoute *route;
+ const char *addrstr;
route = g_value_get_boxed (source_value);
- if (route)
- addrbytes = nm_ip6_route_get_next_hop (route);
- else
- addrbytes = &in6addr_any;
+ if (route) {
+ addrstr = nm_ip_route_get_next_hop (route);
+ if (!addrstr)
+ addrstr = "";
+ } else
+ addrstr = "";
- if (IP6_ADDRESS_SET (addrbytes))
- inet_ntop (AF_INET6, addrbytes, buf, sizeof (buf));
- else
- buf[0] = '\0';
- g_value_set_string (target_value, buf);
+ g_value_set_string (target_value, addrstr);
return TRUE;
}
static gboolean
-ip6_route_transform_to_metric_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_route_transform_to_metric_string (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP6Route *route;
+ NMIPRoute *route;
char *string;
route = g_value_get_boxed (source_value);
- if (route && IP6_ADDRESS_SET (nm_ip6_route_get_dest (route))) {
- string = g_strdup_printf ("%lu", (gulong) nm_ip6_route_get_metric (route));
+ if (route && nm_ip_route_get_dest (route) && nm_ip_route_get_metric (route) != -1) {
+ string = g_strdup_printf ("%lu", (gulong) nm_ip_route_get_metric (route));
g_value_take_string (target_value, string);
} else
g_value_set_string (target_value, "");
@@ -893,18 +443,19 @@ ip6_route_transform_to_metric_string (GBinding *binding,
}
static gboolean
-ip6_route_transform_from_dest_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_route_transform_from_dest_string (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP6Route *route;
+ int family = GPOINTER_TO_INT (user_data);
+ NMIPRoute *route;
const char *text;
- struct in6_addr addrbytes;
+ char *addrstr;
guint32 prefix;
text = g_value_get_string (source_value);
- if (!ip_string_parse (text, AF_INET6, &addrbytes, &prefix))
+ if (!parse_addr_prefix (text, family, &addrstr, &prefix))
return FALSE;
/* Fetch the original property value */
@@ -912,67 +463,72 @@ ip6_route_transform_from_dest_string (GBinding *binding,
g_binding_get_source_property (binding), &route,
NULL);
- nm_ip6_route_set_dest (route, &addrbytes);
- nm_ip6_route_set_prefix (route, prefix);
+ nm_ip_route_set_dest (route, addrstr);
+ nm_ip_route_set_prefix (route, prefix);
+ g_free (addrstr);
g_value_take_boxed (target_value, route);
return TRUE;
}
static gboolean
-ip6_route_transform_from_next_hop_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_route_transform_from_next_hop_string (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP6Route *route;
+ int family = GPOINTER_TO_INT (user_data);
+ NMIPRoute *route;
const char *text;
- struct in6_addr addrbytes;
text = g_value_get_string (source_value);
if (*text) {
- if (!ip_string_parse (text, AF_INET6, &addrbytes, NULL))
+ if (!nm_utils_ipaddr_valid (family, text))
return FALSE;
} else
- addrbytes = in6addr_any;
+ text = NULL;
/* Fetch the original property value */
g_object_get (g_binding_get_source (binding),
g_binding_get_source_property (binding), &route,
NULL);
- nm_ip6_route_set_next_hop (route, &addrbytes);
+ nm_ip_route_set_next_hop (route, text);
g_value_take_boxed (target_value, route);
return TRUE;
}
static gboolean
-ip6_route_transform_from_metric_string (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
+ip_route_transform_from_metric_string (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
{
- NMIP6Route *route;
+ NMIPRoute *route;
const char *text;
- guint32 metric;
+ gint64 metric;
text = g_value_get_string (source_value);
- metric = strtoul (text, NULL, 10);
+ if (*text)
+ metric = strtoul (text, NULL, 10);
+ else
+ metric = -1;
/* Fetch the original property value */
g_object_get (g_binding_get_source (binding),
g_binding_get_source_property (binding), &route,
NULL);
- nm_ip6_route_set_metric (route, metric);
+ nm_ip_route_set_metric (route, metric);
g_value_take_boxed (target_value, route);
return TRUE;
}
/**
- * nm_editor_bind_ip6_route_to_strings:
+ * nm_editor_bind_ip_route_to_strings:
+ * @family: the IP address family
* @source: the source object
* @source_property: the source property
* @dest_target: the target object for the route's destionation
@@ -983,43 +539,44 @@ ip6_route_transform_from_metric_string (GBinding *binding,
* @metric_target_property: the property on @metric_target
* @flags: %GBindingFlags
*
- * Binds the #NMIP6Route-valued property @source_property on @source
- * to the three indicated string-valued target properties (and vice
- * versa if %G_BINDING_BIDIRECTIONAL is specified).
+ * Binds the #NMIPRoute-valued property @source_property on @source to the
+ * three indicated string-valued target properties (and vice versa if
+ * %G_BINDING_BIDIRECTIONAL is specified).
*
* @dest_target_property should be an "address/prefix" string, as with
- * nm_editor_bind_ip6_addresses_with_prefix_to_strv(). @next_hop_target
- * is a plain IP address, and @metric_target is a number.
+ * nm_editor_bind_ip4_addresses_with_prefix_to_strv(). @next_hop_target_property
+ * is a plain IP address, and @metric_target_property is a number.
*/
void
-nm_editor_bind_ip6_route_to_strings (gpointer source,
- const gchar *source_property,
- gpointer dest_target,
- const gchar *dest_target_property,
- gpointer next_hop_target,
- const gchar *next_hop_target_property,
- gpointer metric_target,
- const gchar *metric_target_property,
- GBindingFlags flags)
+nm_editor_bind_ip_route_to_strings (int family,
+ gpointer source,
+ const gchar *source_property,
+ gpointer dest_target,
+ const gchar *dest_target_property,
+ gpointer next_hop_target,
+ const gchar *next_hop_target_property,
+ gpointer metric_target,
+ const gchar *metric_target_property,
+ GBindingFlags flags)
{
g_object_bind_property_full (source, source_property,
dest_target, dest_target_property,
flags,
- ip6_route_transform_to_dest_string,
- ip6_route_transform_from_dest_string,
- NULL, NULL);
+ ip_route_transform_to_dest_string,
+ ip_route_transform_from_dest_string,
+ GINT_TO_POINTER (family), NULL);
g_object_bind_property_full (source, source_property,
next_hop_target, next_hop_target_property,
flags,
- ip6_route_transform_to_next_hop_string,
- ip6_route_transform_from_next_hop_string,
- NULL, NULL);
+ ip_route_transform_to_next_hop_string,
+ ip_route_transform_from_next_hop_string,
+ GINT_TO_POINTER (family), NULL);
g_object_bind_property_full (source, source_property,
metric_target, metric_target_property,
flags,
- ip6_route_transform_to_metric_string,
- ip6_route_transform_from_metric_string,
- NULL, NULL);
+ ip_route_transform_to_metric_string,
+ ip_route_transform_from_metric_string,
+ GINT_TO_POINTER (family), NULL);
}
/* Wireless security method binding */
diff --git a/clients/tui/nm-editor-bindings.h b/clients/tui/nm-editor-bindings.h
index b595ef03c1..c4ed95d53e 100644
--- a/clients/tui/nm-editor-bindings.h
+++ b/clients/tui/nm-editor-bindings.h
@@ -25,49 +25,28 @@ G_BEGIN_DECLS
void nm_editor_bindings_init (void);
-void nm_editor_bind_ip4_addresses_with_prefix_to_strv (gpointer source,
+void nm_editor_bind_ip_addresses_with_prefix_to_strv (int family,
+ gpointer source,
const gchar *source_property,
gpointer target,
const gchar *target_property,
GBindingFlags flags);
-void nm_editor_bind_ip4_addresses_to_strv (gpointer source,
+void nm_editor_bind_ip_addresses_to_strv (int family,
+ gpointer source,
const gchar *source_property,
gpointer target,
const gchar *target_property,
GBindingFlags flags);
-void nm_editor_bind_ip4_gateway_to_string (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags);
-
-void nm_editor_bind_ip4_route_to_strings (gpointer source,
- const gchar *source_property,
- gpointer dest_target,
- const gchar *dest_target_property,
- gpointer next_hop_target,
- const gchar *next_hop_target_property,
- gpointer metric_target,
- const gchar *metric_target_property,
- GBindingFlags flags);
-void nm_editor_bind_ip6_addresses_with_prefix_to_strv (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags);
-void nm_editor_bind_ip6_addresses_to_strv (gpointer source,
- const gchar *source_property,
- gpointer target,
- const gchar *target_property,
- GBindingFlags flags);
-void nm_editor_bind_ip6_gateway_to_string (gpointer source,
- const gchar *source_property,
+void nm_editor_bind_ip_gateway_to_string (int family,
+ NMSettingIPConfig *source,
gpointer target,
const gchar *target_property,
+ const gchar *target_sensitive_property,
GBindingFlags flags);
-void nm_editor_bind_ip6_route_to_strings (gpointer source,
+void nm_editor_bind_ip_route_to_strings (int family,
+ gpointer source,
const gchar *source_property,
gpointer dest_target,
const gchar *dest_target_property,
diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c
index a98278bc09..f936c95943 100644
--- a/clients/tui/nm-editor-utils.c
+++ b/clients/tui/nm-editor-utils.c
@@ -272,7 +272,7 @@ get_available_connection_name (const char *format,
}
/* Find the next available unique connection name */
- while (!cname && (i++ < 10000)) {
+ for (i = 1; !cname && i < 10000; i++) {
char *temp;
gboolean found = FALSE;
diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c
index bd54af22cd..88502ba7c8 100644
--- a/clients/tui/nmt-connect-connection-list.c
+++ b/clients/tui/nmt-connect-connection-list.c
@@ -503,9 +503,11 @@ nmt_connect_connection_list_rebuild (NmtConnectConnectionList *list)
for (diter = nmt_devices; diter; diter = diter->next) {
nmtdev = diter->data;
- if (diter != nmt_devices)
- nmt_newt_listbox_append (listbox, "", NULL);
- nmt_newt_listbox_append (listbox, nmtdev->name, NULL);
+ if (nmtdev->conns) {
+ if (diter != nmt_devices)
+ nmt_newt_listbox_append (listbox, "", NULL);
+ nmt_newt_listbox_append (listbox, nmtdev->name, NULL);
+ }
for (citer = nmtdev->conns; citer; citer = citer->next) {
nmtconn = citer->data;
@@ -544,17 +546,9 @@ nmt_connect_connection_list_rebuild (NmtConnectConnectionList *list)
}
static void
-rebuild_on_acs_changed (GObject *object,
- GParamSpec *spec,
- gpointer list)
-{
- nmt_connect_connection_list_rebuild (list);
-}
-
-static void
-rebuild_on_devices_changed (NMClient *client,
- NMDevice *device,
- gpointer list)
+rebuild_on_property_changed (GObject *object,
+ GParamSpec *spec,
+ gpointer list)
{
nmt_connect_connection_list_rebuild (list);
}
@@ -565,11 +559,11 @@ nmt_connect_connection_list_constructed (GObject *object)
NmtConnectConnectionList *list = NMT_CONNECT_CONNECTION_LIST (object);
g_signal_connect (nm_client, "notify::" NM_CLIENT_ACTIVE_CONNECTIONS,
- G_CALLBACK (rebuild_on_acs_changed), list);
- g_signal_connect (nm_client, "device-added",
- G_CALLBACK (rebuild_on_devices_changed), list);
- g_signal_connect (nm_client, "device-removed",
- G_CALLBACK (rebuild_on_devices_changed), list);
+ G_CALLBACK (rebuild_on_property_changed), list);
+ g_signal_connect (nm_client, "notify::" NM_CLIENT_CONNECTIONS,
+ G_CALLBACK (rebuild_on_property_changed), list);
+ g_signal_connect (nm_client, "notify::" NM_CLIENT_DEVICES,
+ G_CALLBACK (rebuild_on_property_changed), list);
nmt_connect_connection_list_rebuild (list);
@@ -583,8 +577,7 @@ nmt_connect_connection_list_finalize (GObject *object)
g_slist_free_full (priv->nmt_devices, (GDestroyNotify) nmt_connect_device_free);
- g_signal_handlers_disconnect_by_func (nm_client, G_CALLBACK (rebuild_on_acs_changed), object);
- g_signal_handlers_disconnect_by_func (nm_client, G_CALLBACK (rebuild_on_devices_changed), object);
+ g_signal_handlers_disconnect_by_func (nm_client, G_CALLBACK (rebuild_on_property_changed), object);
G_OBJECT_CLASS (nmt_connect_connection_list_parent_class)->finalize (object);
}
diff --git a/clients/tui/nmt-device-entry.c b/clients/tui/nmt-device-entry.c
index 184ed96ffc..2af5e584c4 100644
--- a/clients/tui/nmt-device-entry.c
+++ b/clients/tui/nmt-device-entry.c
@@ -28,7 +28,7 @@
* matching a known #NMDevice, then it will also display the other
* property in parentheses.
*
- * FIXME: #NmtDeviceEntry is currently an #NmtPageGrid object, so that
+ * FIXME: #NmtDeviceEntry is currently an #NmtEditorGrid object, so that
* we can possibly eventually add a button to its "extra" field, that
* would pop up a form for selecting a device. But if we're not going
* to implement that then we should make it just an #NmtNewtEntry.
@@ -46,7 +46,7 @@
#include "nmtui.h"
#include "nmt-device-entry.h"
-G_DEFINE_TYPE (NmtDeviceEntry, nmt_device_entry, NMT_TYPE_PAGE_GRID)
+G_DEFINE_TYPE (NmtDeviceEntry, nmt_device_entry, NMT_TYPE_EDITOR_GRID)
#define NMT_DEVICE_ENTRY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntryPrivate))
@@ -379,7 +379,7 @@ nmt_device_entry_constructed (GObject *object)
{
NmtDeviceEntryPrivate *priv = NMT_DEVICE_ENTRY_GET_PRIVATE (object);
- nmt_page_grid_append (NMT_PAGE_GRID (object), priv->label, NMT_NEWT_WIDGET (priv->entry), NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (object), priv->label, NMT_NEWT_WIDGET (priv->entry), NULL);
G_OBJECT_CLASS (nmt_device_entry_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-device-entry.h b/clients/tui/nmt-device-entry.h
index d44126a869..05d5d40f7d 100644
--- a/clients/tui/nmt-device-entry.h
+++ b/clients/tui/nmt-device-entry.h
@@ -19,7 +19,7 @@
#ifndef NMT_DEVICE_ENTRY_H
#define NMT_DEVICE_ENTRY_H
-#include "nmt-page-grid.h"
+#include "nmt-editor-grid.h"
#include <NetworkManager.h>
@@ -33,12 +33,12 @@ G_BEGIN_DECLS
#define NMT_DEVICE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntryClass))
typedef struct {
- NmtPageGrid parent;
+ NmtEditorGrid parent;
} NmtDeviceEntry;
typedef struct {
- NmtPageGridClass parent;
+ NmtEditorGridClass parent;
} NmtDeviceEntryClass;
diff --git a/clients/tui/nmt-page-grid.c b/clients/tui/nmt-editor-grid.c
index 89ba9330f4..118bf01d3a 100644
--- a/clients/tui/nmt-page-grid.c
+++ b/clients/tui/nmt-editor-grid.c
@@ -17,10 +17,10 @@
*/
/**
- * SECTION:nmt-page-grid
+ * SECTION:nmt-editor-grid
* @short_description: Grid widget for #NmtEditorPages
*
- * #NmtPageGrid is the layout grid used by #NmtEditorPages. It
+ * #NmtEditorGrid is the layout grid used by #NmtEditorPages. It
* consists of a number of rows, each containing either a single
* widget that spans the entire width of the row, or else containing a
* label, a widget, and an optional extra widget.
@@ -29,10 +29,10 @@
* its main widget is multiple rows high. The label and extra widgets
* will be top-aligned if the row is taller than they are.
*
- * The #NmtPageGrids in a form behave as though they are all in a
+ * The #NmtEditorGrids in a form behave as though they are all in a
* "size group" together; they will all use the same column widths,
* which will be wide enough for the widest labels/widgets in any of
- * the grids. #NmtPageGrid is also specially aware of #NmtNewtSection,
+ * the grids. #NmtEditorGrid is also specially aware of #NmtNewtSection,
* and grids inside sections will automatically take the size of the
* section border into account as well.
*/
@@ -41,96 +41,100 @@
#include <string.h>
-#include "nmt-page-grid.h"
+#include "nmt-editor-grid.h"
-G_DEFINE_TYPE (NmtPageGrid, nmt_page_grid, NMT_TYPE_NEWT_CONTAINER)
+G_DEFINE_TYPE (NmtEditorGrid, nmt_editor_grid, NMT_TYPE_NEWT_CONTAINER)
-#define NMT_PAGE_GRID_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_GRID, NmtPageGridPrivate))
+#define NMT_EDITOR_GRID_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_EDITOR_GRID, NmtEditorGridPrivate))
typedef struct {
GArray *rows;
int *row_heights;
int indent;
-} NmtPageGridPrivate;
+} NmtEditorGridPrivate;
typedef struct {
NmtNewtWidget *label;
NmtNewtWidget *widget;
NmtNewtWidget *extra;
- NmtPageGridRowFlags flags;
-} NmtPageGridRow;
+ NmtEditorGridRowFlags flags;
+} NmtEditorGridRow;
typedef struct {
int col_widths[3];
-} NmtPageGridFormState;
+} NmtEditorGridFormState;
/**
- * nmt_page_grid_new:
+ * nmt_editor_grid_new:
*
- * Creates a new #NmtPageGrid
+ * Creates a new #NmtEditorGrid
*
- * Returns: a new #NmtPageGrid
+ * Returns: a new #NmtEditorGrid
*/
NmtNewtWidget *
-nmt_page_grid_new (void)
+nmt_editor_grid_new (void)
{
- return g_object_new (NMT_TYPE_PAGE_GRID,
+ return g_object_new (NMT_TYPE_EDITOR_GRID,
NULL);
}
static void
-nmt_page_grid_init (NmtPageGrid *grid)
+nmt_editor_grid_init (NmtEditorGrid *grid)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
- priv->rows = g_array_new (FALSE, TRUE, sizeof (NmtPageGridRow));
+ priv->rows = g_array_new (FALSE, TRUE, sizeof (NmtEditorGridRow));
}
static void
-nmt_page_grid_finalize (GObject *object)
+nmt_editor_grid_finalize (GObject *object)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (object);
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (object);
g_array_unref (priv->rows);
g_clear_pointer (&priv->row_heights, g_free);
- G_OBJECT_CLASS (nmt_page_grid_parent_class)->finalize (object);
+ G_OBJECT_CLASS (nmt_editor_grid_parent_class)->finalize (object);
}
/**
- * nmt_page_grid_append:
- * @grid: the #NmtPageGrid
+ * nmt_editor_grid_append:
+ * @grid: the #NmtEditorGrid
* @label: (allow-none): the label text for @widget, or %NULL
- * @widget: the (main) widget
+ * @widget: (allow-none): the (main) widget
* @extra: (allow-none): optional extra widget
*
* Adds a row to @grid.
*
- * If @label is non-%NULL, this will add a three-column row,
- * containing a right-aligned #NmtNewtLabel in the first column,
- * @widget in the second column, and @extra (if non-%NULL) in
- * the third column.
+ * If @label and @widget are both non-%NULL, this will add a three-column row,
+ * containing a right-aligned #NmtNewtLabel in the first column, @widget in the
+ * second column, and @extra (if non-%NULL) in the third column.
*
- * If @label is %NULL, then this will add a row with a single
- * grid-spanning column, containing @widget.
+ * If either @label or @widget is %NULL, then the other column will expand into
+ * it.
*
- * FIXME: That's sort of weird.
- *
- * See also nmt_page_grid_set_row_flags().
+ * See also nmt_editor_grid_set_row_flags().
*/
void
-nmt_page_grid_append (NmtPageGrid *grid,
+nmt_editor_grid_append (NmtEditorGrid *grid,
const char *label,
NmtNewtWidget *widget,
NmtNewtWidget *extra)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
- NmtNewtContainerClass *parent_class = NMT_NEWT_CONTAINER_CLASS (nmt_page_grid_parent_class);
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
+ NmtNewtContainerClass *parent_class = NMT_NEWT_CONTAINER_CLASS (nmt_editor_grid_parent_class);
NmtNewtContainer *container = NMT_NEWT_CONTAINER (grid);
- NmtPageGridRow row;
+ NmtEditorGridRow row;
+
+ g_return_if_fail (label != NULL || widget != NULL);
memset (&row, 0, sizeof (row));
+ if (label && !widget) {
+ widget = nmt_newt_label_new (label);
+ label = NULL;
+ }
+
if (label) {
row.label = nmt_newt_label_new (label);
parent_class->add (container, row.label);
@@ -153,11 +157,11 @@ nmt_page_grid_append (NmtPageGrid *grid,
}
static int
-nmt_page_grid_find_widget (NmtPageGrid *grid,
+nmt_editor_grid_find_widget (NmtEditorGrid *grid,
NmtNewtWidget *widget)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
- NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
+ NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
int i;
for (i = 0; i < priv->rows->len; i++) {
@@ -169,48 +173,48 @@ nmt_page_grid_find_widget (NmtPageGrid *grid,
}
/**
- * NmtPageGridRowFlags:
- * @NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT: the row's label should be
+ * NmtEditorGridRowFlags:
+ * @NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT: the row's label should be
* aligned left instead of right.
- * @NMT_PAGE_GRID_ROW_EXTRA_ALIGN_RIGHT: the row's extra widget
+ * @NMT_EDITOR_GRID_ROW_EXTRA_ALIGN_RIGHT: the row's extra widget
* should be aligned right instead of left.
*
- * Flags to alter an #NmtPageGrid row's layout.
+ * Flags to alter an #NmtEditorGrid row's layout.
*/
/**
- * nmt_page_grid_set_row_flags:
- * @grid: an #NmtPageGrid
+ * nmt_editor_grid_set_row_flags:
+ * @grid: an #NmtEditorGrid
* @widget: the widget whose row you want to adjust
* @flags: the flags to set
*
* Sets flags to adjust the layout of @widget's row in @grid.
*/
void
-nmt_page_grid_set_row_flags (NmtPageGrid *grid,
+nmt_editor_grid_set_row_flags (NmtEditorGrid *grid,
NmtNewtWidget *widget,
- NmtPageGridRowFlags flags)
+ NmtEditorGridRowFlags flags)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
- NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
+ NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
int i;
- i = nmt_page_grid_find_widget (grid, widget);
+ i = nmt_editor_grid_find_widget (grid, widget);
if (i != -1)
rows[i].flags = flags;
}
static void
-nmt_page_grid_remove (NmtNewtContainer *container,
+nmt_editor_grid_remove (NmtNewtContainer *container,
NmtNewtWidget *widget)
{
- NmtPageGrid *grid = NMT_PAGE_GRID (container);
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
- NmtNewtContainerClass *parent_class = NMT_NEWT_CONTAINER_CLASS (nmt_page_grid_parent_class);
- NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
+ NmtEditorGrid *grid = NMT_EDITOR_GRID (container);
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
+ NmtNewtContainerClass *parent_class = NMT_NEWT_CONTAINER_CLASS (nmt_editor_grid_parent_class);
+ NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
int i;
- i = nmt_page_grid_find_widget (grid, widget);
+ i = nmt_editor_grid_find_widget (grid, widget);
if (i != -1) {
if (rows[i].label)
parent_class->remove (container, rows[i].label);
@@ -227,10 +231,10 @@ nmt_page_grid_remove (NmtNewtContainer *container,
}
static newtComponent *
-nmt_page_grid_get_components (NmtNewtWidget *widget)
+nmt_editor_grid_get_components (NmtNewtWidget *widget)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (widget);
- NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (widget);
+ NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
newtComponent *child_cos;
GPtrArray *cos;
int i, c;
@@ -265,31 +269,31 @@ nmt_page_grid_get_components (NmtNewtWidget *widget)
return (newtComponent *) g_ptr_array_free (cos, FALSE);
}
-static NmtPageGridFormState *
+static NmtEditorGridFormState *
get_form_state (NmtNewtWidget *widget)
{
NmtNewtForm *form = nmt_newt_widget_get_form (widget);
- NmtPageGridFormState *state;
+ NmtEditorGridFormState *state;
if (!form)
return NULL;
- state = g_object_get_data (G_OBJECT (form), "NmtPageGridFormState");
+ state = g_object_get_data (G_OBJECT (form), "NmtEditorGridFormState");
if (state)
return state;
- state = g_new0 (NmtPageGridFormState, 1);
- g_object_set_data_full (G_OBJECT (form), "NmtPageGridFormState", state, g_free);
+ state = g_new0 (NmtEditorGridFormState, 1);
+ g_object_set_data_full (G_OBJECT (form), "NmtEditorGridFormState", state, g_free);
return state;
}
static void
-nmt_page_grid_realize (NmtNewtWidget *widget)
+nmt_editor_grid_realize (NmtNewtWidget *widget)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (widget);
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (widget);
NmtNewtWidget *parent;
- NMT_NEWT_WIDGET_CLASS (nmt_page_grid_parent_class)->realize (widget);
+ NMT_NEWT_WIDGET_CLASS (nmt_editor_grid_parent_class)->realize (widget);
/* This is a hack, but it's the simplest way to make it work... */
priv->indent = 0;
@@ -305,24 +309,24 @@ nmt_page_grid_realize (NmtNewtWidget *widget)
}
static void
-nmt_page_grid_unrealize (NmtNewtWidget *widget)
+nmt_editor_grid_unrealize (NmtNewtWidget *widget)
{
- NmtPageGridFormState *state = get_form_state (widget);
+ NmtEditorGridFormState *state = get_form_state (widget);
if (state)
memset (state->col_widths, 0, sizeof (state->col_widths));
- NMT_NEWT_WIDGET_CLASS (nmt_page_grid_parent_class)->unrealize (widget);
+ NMT_NEWT_WIDGET_CLASS (nmt_editor_grid_parent_class)->unrealize (widget);
}
static void
-nmt_page_grid_size_request (NmtNewtWidget *widget,
+nmt_editor_grid_size_request (NmtNewtWidget *widget,
int *width,
int *height)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (widget);
- NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
- NmtPageGridFormState *state = get_form_state (widget);
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (widget);
+ NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
+ NmtEditorGridFormState *state = get_form_state (widget);
gboolean add_padding = FALSE;
int i;
@@ -367,15 +371,15 @@ nmt_page_grid_size_request (NmtNewtWidget *widget,
static void
-nmt_page_grid_size_allocate (NmtNewtWidget *widget,
+nmt_editor_grid_size_allocate (NmtNewtWidget *widget,
int x,
int y,
int width,
int height)
{
- NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (widget);
- NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
- NmtPageGridFormState *state = get_form_state (widget);
+ NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (widget);
+ NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
+ NmtEditorGridFormState *state = get_form_state (widget);
int col0_width, col1_width, col2_width;
int i, row;
@@ -390,7 +394,7 @@ nmt_page_grid_size_allocate (NmtNewtWidget *widget,
if (rows[i].label) {
int lwidth, lheight, lx;
- if (rows[i].flags & NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT)
+ if (rows[i].flags & NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT)
lx = x;
else {
nmt_newt_widget_size_request (rows[i].label, &lwidth, &lheight);
@@ -408,27 +412,28 @@ nmt_page_grid_size_allocate (NmtNewtWidget *widget,
y + row,
col1_width,
priv->row_heights[i]);
- if (rows[i].extra) {
- int wwidth, wheight, ex;
-
- if (rows[i].flags & NMT_PAGE_GRID_ROW_EXTRA_ALIGN_RIGHT)
- ex = x + col0_width + col1_width + 2;
- else {
- nmt_newt_widget_size_request (rows[i].widget, &wwidth, &wheight);
- ex = x + col0_width + wwidth + 2;
- }
-
- nmt_newt_widget_size_allocate (rows[i].extra,
- ex,
- y + row,
- col2_width,
- priv->row_heights[i]);
- }
} else {
nmt_newt_widget_size_allocate (rows[i].widget,
x,
y + row,
- col0_width + col1_width + col2_width + 2,
+ col0_width + col1_width + 1,
+ priv->row_heights[i]);
+ }
+
+ if (rows[i].extra) {
+ int wwidth, wheight, ex;
+
+ if (rows[i].flags & NMT_EDITOR_GRID_ROW_EXTRA_ALIGN_RIGHT)
+ ex = x + col0_width + col1_width + 2;
+ else {
+ nmt_newt_widget_size_request (rows[i].widget, &wwidth, &wheight);
+ ex = x + col0_width + wwidth + 2;
+ }
+
+ nmt_newt_widget_size_allocate (rows[i].extra,
+ ex,
+ y + row,
+ col2_width,
priv->row_heights[i]);
}
@@ -437,22 +442,22 @@ nmt_page_grid_size_allocate (NmtNewtWidget *widget,
}
static void
-nmt_page_grid_class_init (NmtPageGridClass *grid_class)
+nmt_editor_grid_class_init (NmtEditorGridClass *grid_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (grid_class);
NmtNewtWidgetClass *widget_class = NMT_NEWT_WIDGET_CLASS (grid_class);
NmtNewtContainerClass *container_class = NMT_NEWT_CONTAINER_CLASS (grid_class);
- g_type_class_add_private (grid_class, sizeof (NmtPageGridPrivate));
+ g_type_class_add_private (grid_class, sizeof (NmtEditorGridPrivate));
/* virtual methods */
- object_class->finalize = nmt_page_grid_finalize;
+ object_class->finalize = nmt_editor_grid_finalize;
- widget_class->realize = nmt_page_grid_realize;
- widget_class->unrealize = nmt_page_grid_unrealize;
- widget_class->get_components = nmt_page_grid_get_components;
- widget_class->size_request = nmt_page_grid_size_request;
- widget_class->size_allocate = nmt_page_grid_size_allocate;
+ widget_class->realize = nmt_editor_grid_realize;
+ widget_class->unrealize = nmt_editor_grid_unrealize;
+ widget_class->get_components = nmt_editor_grid_get_components;
+ widget_class->size_request = nmt_editor_grid_size_request;
+ widget_class->size_allocate = nmt_editor_grid_size_allocate;
- container_class->remove = nmt_page_grid_remove;
+ container_class->remove = nmt_editor_grid_remove;
}
diff --git a/clients/tui/nmt-page-grid.h b/clients/tui/nmt-editor-grid.h
index 40ff96c410..2ae01d71d5 100644
--- a/clients/tui/nmt-page-grid.h
+++ b/clients/tui/nmt-editor-grid.h
@@ -16,47 +16,47 @@
* Copyright 2013 Red Hat, Inc.
*/
-#ifndef NMT_PAGE_GRID_H
-#define NMT_PAGE_GRID_H
+#ifndef NMT_EDITOR_GRID_H
+#define NMT_EDITOR_GRID_H
#include "nmt-newt.h"
G_BEGIN_DECLS
-#define NMT_TYPE_PAGE_GRID (nmt_page_grid_get_type ())
-#define NMT_PAGE_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_GRID, NmtPageGrid))
-#define NMT_PAGE_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_GRID, NmtPageGridClass))
-#define NMT_IS_PAGE_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_PAGE_GRID))
-#define NMT_IS_PAGE_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_PAGE_GRID))
-#define NMT_PAGE_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_GRID, NmtPageGridClass))
+#define NMT_TYPE_EDITOR_GRID (nmt_editor_grid_get_type ())
+#define NMT_EDITOR_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_GRID, NmtEditorGrid))
+#define NMT_EDITOR_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_GRID, NmtEditorGridClass))
+#define NMT_IS_EDITOR_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_EDITOR_GRID))
+#define NMT_IS_EDITOR_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_EDITOR_GRID))
+#define NMT_EDITOR_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_EDITOR_GRID, NmtEditorGridClass))
typedef struct {
NmtNewtContainer parent;
-} NmtPageGrid;
+} NmtEditorGrid;
typedef struct {
NmtNewtContainerClass parent;
-} NmtPageGridClass;
+} NmtEditorGridClass;
-GType nmt_page_grid_get_type (void);
+GType nmt_editor_grid_get_type (void);
typedef enum {
- NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT = (1 << 0),
- NMT_PAGE_GRID_ROW_EXTRA_ALIGN_RIGHT = (1 << 1)
-} NmtPageGridRowFlags;
+ NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT = (1 << 0),
+ NMT_EDITOR_GRID_ROW_EXTRA_ALIGN_RIGHT = (1 << 1)
+} NmtEditorGridRowFlags;
-NmtNewtWidget *nmt_page_grid_new (void);
+NmtNewtWidget *nmt_editor_grid_new (void);
-void nmt_page_grid_append (NmtPageGrid *grid,
+void nmt_editor_grid_append (NmtEditorGrid *grid,
const char *label,
NmtNewtWidget *widget,
NmtNewtWidget *extra);
-void nmt_page_grid_set_row_flags (NmtPageGrid *grid,
+void nmt_editor_grid_set_row_flags (NmtEditorGrid *grid,
NmtNewtWidget *widget,
- NmtPageGridRowFlags flags);
+ NmtEditorGridRowFlags flags);
G_END_DECLS
-#endif /* NMT_PAGE_GRID_H */
+#endif /* NMT_EDITOR_GRID_H */
diff --git a/clients/tui/nmt-page-device.c b/clients/tui/nmt-editor-page-device.c
index d67a5fe019..0a9b18e0bf 100644
--- a/clients/tui/nmt-page-device.c
+++ b/clients/tui/nmt-editor-page-device.c
@@ -17,10 +17,10 @@
*/
/**
- * SECTION:nmt-page-device
+ * SECTION:nmt-editor-page-device
* @short_description: Abstract base class for "device" editor pages
*
- * #NmtPageDevice is the base class for #NmtEditorPage subclasses
+ * #NmtEditorPageDevice is the base class for #NmtEditorPage subclasses
* representing device-type-specific data. (Eg, #NmtPageEthernet,
* #NmtPageVlan, etc).
*
@@ -30,72 +30,60 @@
#include "config.h"
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
-G_DEFINE_TYPE (NmtPageDevice, nmt_page_device, NMT_TYPE_EDITOR_PAGE)
+G_DEFINE_TYPE (NmtEditorPageDevice, nmt_editor_page_device, NMT_TYPE_EDITOR_PAGE)
-#define NMT_PAGE_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_DEVICE, NmtPageDevicePrivate))
+#define NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDevicePrivate))
typedef struct {
NmtDeviceEntry *device_entry;
gboolean show_by_default;
-} NmtPageDevicePrivate;
+} NmtEditorPageDevicePrivate;
enum {
PROP_0,
PROP_DEVICE_ENTRY,
- PROP_SHOW_BY_DEFAULT,
LAST_PROP
};
static void
-nmt_page_device_init (NmtPageDevice *device)
+nmt_editor_page_device_init (NmtEditorPageDevice *device)
{
}
static void
-nmt_page_device_finalize (GObject *object)
+nmt_editor_page_device_finalize (GObject *object)
{
- NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (object);
+ NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (object);
g_clear_object (&priv->device_entry);
- G_OBJECT_CLASS (nmt_page_device_parent_class)->finalize (object);
+ G_OBJECT_CLASS (nmt_editor_page_device_parent_class)->finalize (object);
}
NmtDeviceEntry *
-nmt_page_device_get_device_entry (NmtPageDevice *page)
+nmt_editor_page_device_get_device_entry (NmtEditorPageDevice *page)
{
- NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (page);
+ NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (page);
return priv->device_entry;
}
-static gboolean
-nmt_page_device_show_by_default (NmtEditorPage *page)
-{
- NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (page);
-
- return priv->show_by_default;
-}
-
static void
-nmt_page_device_set_property (GObject *object,
+nmt_editor_page_device_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (object);
+ NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (object);
switch (prop_id) {
case PROP_DEVICE_ENTRY:
priv->device_entry = g_value_dup_object (value);
break;
- case PROP_SHOW_BY_DEFAULT:
- priv->show_by_default = g_value_get_boolean (value);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -103,20 +91,17 @@ nmt_page_device_set_property (GObject *object,
}
static void
-nmt_page_device_get_property (GObject *object,
+nmt_editor_page_device_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (object);
+ NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (object);
switch (prop_id) {
case PROP_DEVICE_ENTRY:
g_value_set_object (value, priv->device_entry);
break;
- case PROP_SHOW_BY_DEFAULT:
- g_value_set_boolean (value, priv->show_by_default);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -124,19 +109,16 @@ nmt_page_device_get_property (GObject *object,
}
static void
-nmt_page_device_class_init (NmtPageDeviceClass *page_device_class)
+nmt_editor_page_device_class_init (NmtEditorPageDeviceClass *page_device_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (page_device_class);
- NmtEditorPageClass *page_class = NMT_EDITOR_PAGE_CLASS (page_device_class);
- g_type_class_add_private (page_device_class, sizeof (NmtPageDevicePrivate));
+ g_type_class_add_private (page_device_class, sizeof (NmtEditorPageDevicePrivate));
/* virtual methods */
- object_class->set_property = nmt_page_device_set_property;
- object_class->get_property = nmt_page_device_get_property;
- object_class->finalize = nmt_page_device_finalize;
-
- page_class->show_by_default = nmt_page_device_show_by_default;
+ object_class->set_property = nmt_editor_page_device_set_property;
+ object_class->get_property = nmt_editor_page_device_get_property;
+ object_class->finalize = nmt_editor_page_device_finalize;
/* properties */
g_object_class_install_property
@@ -146,11 +128,4 @@ nmt_page_device_class_init (NmtPageDeviceClass *page_device_class)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
- g_object_class_install_property
- (object_class, PROP_SHOW_BY_DEFAULT,
- g_param_spec_boolean ("show-by-default", "", "",
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
}
diff --git a/clients/tui/nmt-editor-page-device.h b/clients/tui/nmt-editor-page-device.h
new file mode 100644
index 0000000000..f911602cc8
--- /dev/null
+++ b/clients/tui/nmt-editor-page-device.h
@@ -0,0 +1,50 @@
+/* -*- 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2013 Red Hat, Inc.
+ */
+
+#ifndef NMT_EDITOR_PAGE_DEVICE_H
+#define NMT_EDITOR_PAGE_DEVICE_H
+
+#include "nmt-editor-page.h"
+#include "nmt-device-entry.h"
+
+G_BEGIN_DECLS
+
+#define NMT_TYPE_EDITOR_PAGE_DEVICE (nmt_editor_page_device_get_type ())
+#define NMT_EDITOR_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDevice))
+#define NMT_EDITOR_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDeviceClass))
+#define NMT_IS_EDITOR_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_EDITOR_PAGE_DEVICE))
+#define NMT_IS_EDITOR_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_EDITOR_PAGE_DEVICE))
+#define NMT_EDITOR_PAGE_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDeviceClass))
+
+typedef struct {
+ NmtEditorPage parent;
+
+} NmtEditorPageDevice;
+
+typedef struct {
+ NmtEditorPageClass parent;
+
+} NmtEditorPageDeviceClass;
+
+GType nmt_editor_page_device_get_type (void);
+
+NmtDeviceEntry *nmt_editor_page_device_get_device_entry (NmtEditorPageDevice *page);
+
+G_END_DECLS
+
+#endif /* NMT_EDITOR_PAGE_DEVICE_H */
diff --git a/clients/tui/nmt-editor-page.c b/clients/tui/nmt-editor-page.c
index 49419e9254..a46d0ed43d 100644
--- a/clients/tui/nmt-editor-page.c
+++ b/clients/tui/nmt-editor-page.c
@@ -21,9 +21,7 @@
* @short_description: An #NmtEditor "page"
*
* #NmtEditorPage is the abstract base class for #NmtEditor "pages".
- * Note that despite the name, currently all "page" types except
- * #NmtPageMain are actually displayed as collapsible sections, not
- * separate tabs/forms.
+ * A "page" is a set of related #NmtEditorSections.
*/
#include "config.h"
@@ -32,14 +30,13 @@
#include "nmt-editor-page.h"
-G_DEFINE_ABSTRACT_TYPE (NmtEditorPage, nmt_editor_page, NMT_TYPE_PAGE_GRID)
+G_DEFINE_ABSTRACT_TYPE (NmtEditorPage, nmt_editor_page, G_TYPE_OBJECT)
#define NMT_EDITOR_PAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_EDITOR_PAGE, NmtEditorPagePrivate))
typedef struct {
- char *title;
- NmtNewtWidget *header_widget;
NMConnection *connection;
+ GSList *sections;
} NmtEditorPagePrivate;
@@ -47,7 +44,6 @@ enum {
PROP_0,
PROP_CONNECTION,
- PROP_TITLE,
LAST_PROP
};
@@ -55,9 +51,6 @@ enum {
static void
nmt_editor_page_init (NmtEditorPage *page)
{
- NmtEditorPagePrivate *priv = NMT_EDITOR_PAGE_GET_PRIVATE (page);
-
- priv->header_widget = g_object_ref_sink (nmt_newt_separator_new ());
}
static void
@@ -65,9 +58,8 @@ nmt_editor_page_finalize (GObject *object)
{
NmtEditorPagePrivate *priv = NMT_EDITOR_PAGE_GET_PRIVATE (object);
- g_free (priv->title);
- g_clear_object (&priv->header_widget);
g_clear_object (&priv->connection);
+ g_slist_free_full (priv->sections, g_object_unref);
G_OBJECT_CLASS (nmt_editor_page_parent_class)->finalize (object);
}
@@ -89,81 +81,37 @@ nmt_editor_page_get_connection (NmtEditorPage *page)
}
/**
- * nmt_editor_page_set_header_widget:
+ * nmt_editor_page_get_sections:
* @page: the #NmtEditorPage
- * @widget: an #NmtNewtWidget
*
- * Sets the page's header widget. When displayed as a subpage of
- * #NmtPageMain, this widget will be put into the corresponding
- * #NmtNewtSection's header.
+ * Gets the page's list of sections to display.
*
- * FIXME: for consistency, this should be a property as well.
+ * Returns: (transfer none): the list of sections; this is the internal list
+ * used by the page and must not be modified or freed.
*/
-void
-nmt_editor_page_set_header_widget (NmtEditorPage *page,
- NmtNewtWidget *widget)
+GSList *
+nmt_editor_page_get_sections (NmtEditorPage *page)
{
NmtEditorPagePrivate *priv = NMT_EDITOR_PAGE_GET_PRIVATE (page);
- g_clear_object (&priv->header_widget);
-
- if (!widget)
- widget = nmt_newt_separator_new ();
- priv->header_widget = g_object_ref_sink (widget);
+ return priv->sections;
}
/**
- * nmt_editor_page_get_header_widget:
+ * nmt_editor_page_add_section:
* @page: the #NmtEditorPage
+ * @section: the #NmtEditorSection
*
- * Gets the page's header widget. When displayed as a subpage of
- * #NmtPageMain, this widget will be put into the corresponding
- * #NmtNewtSection's header.
- *
- * Returns: (transfer none): the page's header widget.
+ * Adds a section to the page. This should only be called by #NmtEditorPage
+ * subclasses.
*/
-NmtNewtWidget *
-nmt_editor_page_get_header_widget (NmtEditorPage *page)
-{
- NmtEditorPagePrivate *priv = NMT_EDITOR_PAGE_GET_PRIVATE (page);
-
- return priv->header_widget;
-}
-
-/**
- * nmt_editor_page_get_title:
- * @page: the #NmtEditorPage
- *
- * Gets the page's title.
- *
- * Returns: the page's title
- */
-const char *
-nmt_editor_page_get_title (NmtEditorPage *page)
+void
+nmt_editor_page_add_section (NmtEditorPage *page,
+ NmtEditorSection *section)
{
NmtEditorPagePrivate *priv = NMT_EDITOR_PAGE_GET_PRIVATE (page);
- return priv->title;
-}
-
-static gboolean
-nmt_editor_page_real_show_by_default (NmtEditorPage *page)
-{
- return TRUE;
-}
-
-/**
- * nmt_editor_page_show_by_default:
- * @page: the #NmtEditorPage
- *
- * Checks if @page should be shown expanded by default
- *
- * Returns: %TRUE or %FALSE
- */
-gboolean
-nmt_editor_page_show_by_default (NmtEditorPage *page)
-{
- return NMT_EDITOR_PAGE_GET_CLASS (page)->show_by_default (page);
+ priv->sections = g_slist_append (priv->sections, g_object_ref_sink (section));
}
static void
@@ -178,9 +126,6 @@ nmt_editor_page_set_property (GObject *object,
case PROP_CONNECTION:
priv->connection = g_value_dup_object (value);
break;
- case PROP_TITLE:
- priv->title = g_value_dup_string (value);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -199,9 +144,6 @@ nmt_editor_page_get_property (GObject *object,
case PROP_CONNECTION:
g_value_set_object (value, priv->connection);
break;
- case PROP_TITLE:
- g_value_set_string (value, priv->title);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -220,8 +162,6 @@ nmt_editor_page_class_init (NmtEditorPageClass *page_class)
object_class->get_property = nmt_editor_page_get_property;
object_class->finalize = nmt_editor_page_finalize;
- page_class->show_by_default = nmt_editor_page_real_show_by_default;
-
/* properties */
/**
@@ -236,16 +176,4 @@ nmt_editor_page_class_init (NmtEditorPageClass *page_class)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
- /**
- * NmtEditorPage:title:
- *
- * The page's title.
- */
- g_object_class_install_property
- (object_class, PROP_TITLE,
- g_param_spec_string ("title", "", "",
- NULL,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
}
diff --git a/clients/tui/nmt-editor-page.h b/clients/tui/nmt-editor-page.h
index f5733ff256..bbc0d9e351 100644
--- a/clients/tui/nmt-editor-page.h
+++ b/clients/tui/nmt-editor-page.h
@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * Copyright 2013 Red Hat, Inc.
+ * Copyright 2013-2014 Red Hat, Inc.
*/
#ifndef NMT_EDITOR_PAGE_H
@@ -21,7 +21,8 @@
#include <NetworkManager.h>
-#include "nmt-page-grid.h"
+#include "nmt-editor-grid.h"
+#include "nmt-editor-section.h"
G_BEGIN_DECLS
@@ -33,27 +34,24 @@ G_BEGIN_DECLS
#define NMT_EDITOR_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_EDITOR_PAGE, NmtEditorPageClass))
typedef struct {
- NmtPageGrid parent;
+ GObject parent;
} NmtEditorPage;
typedef struct {
- NmtPageGridClass parent;
+ GObjectClass parent;
- gboolean (*show_by_default) (NmtEditorPage *);
} NmtEditorPageClass;
GType nmt_editor_page_get_type (void);
NMConnection *nmt_editor_page_get_connection (NmtEditorPage *page);
-void nmt_editor_page_set_header_widget (NmtEditorPage *page,
- NmtNewtWidget *widget);
-NmtNewtWidget *nmt_editor_page_get_header_widget (NmtEditorPage *page);
+GSList *nmt_editor_page_get_sections (NmtEditorPage *page);
-const char *nmt_editor_page_get_title (NmtEditorPage *page);
-
-gboolean nmt_editor_page_show_by_default (NmtEditorPage *page);
+/*< protected >*/
+void nmt_editor_page_add_section (NmtEditorPage *page,
+ NmtEditorSection *section);
G_END_DECLS
diff --git a/clients/tui/nmt-editor-section.c b/clients/tui/nmt-editor-section.c
new file mode 100644
index 0000000000..ff463f7fe3
--- /dev/null
+++ b/clients/tui/nmt-editor-section.c
@@ -0,0 +1,282 @@
+/* -*- 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2013 Red Hat, Inc.
+ */
+
+/**
+ * SECTION:nmt-editor-section:
+ * @short_description: A section of the #NmtEditor
+ *
+ * #NmtEditorSection is the abstract base class for #NmtEditor sections.
+ */
+
+#include "config.h"
+
+#include <glib/gi18n-lib.h>
+
+#include "nmt-editor-section.h"
+#include "nmt-newt-toggle-button.h"
+
+G_DEFINE_TYPE (NmtEditorSection, nmt_editor_section, NMT_TYPE_NEWT_SECTION)
+
+#define NMT_EDITOR_SECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_EDITOR_SECTION, NmtEditorSectionPrivate))
+
+typedef struct {
+ NmtEditorGrid *header, *body;
+ char *title;
+ NmtNewtWidget *header_widget;
+ NmtNewtWidget *toggle;
+
+ gboolean show_by_default;
+} NmtEditorSectionPrivate;
+
+enum {
+ PROP_0,
+
+ PROP_TITLE,
+ PROP_SHOW_BY_DEFAULT,
+ PROP_HEADER_WIDGET,
+
+ LAST_PROP
+};
+
+/**
+ * nmt_editor_section_new:
+ * @title: the section title
+ * @header_widget: (allow-none): the widget to show next to the title
+ * @show_by_default: whether the section should be open by default
+ *
+ * Creates a new #NmtEditorSection.
+ *
+ * Returns: a new #NmtEditorSection
+ */
+NmtEditorSection *
+nmt_editor_section_new (const char *title,
+ NmtNewtWidget *header_widget,
+ gboolean show_by_default)
+{
+ return g_object_new (NMT_TYPE_EDITOR_SECTION,
+ "title", title,
+ "header-widget", header_widget,
+ "show-by-default", show_by_default,
+ NULL);
+}
+
+static void
+rebuild_header (NmtEditorSection *section)
+{
+ NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (section);
+
+ /* Removing any widget in an NmtEditorGrid removes its whole row, so we can
+ * remove the existing title/widget/toggle by asking to remove toggle.
+ */
+ nmt_newt_container_remove (NMT_NEWT_CONTAINER (priv->header), priv->toggle);
+
+ nmt_editor_grid_append (priv->header,
+ priv->title,
+ priv->header_widget,
+ priv->toggle);
+ nmt_editor_grid_set_row_flags (priv->header,
+ priv->toggle,
+ NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT |
+ NMT_EDITOR_GRID_ROW_EXTRA_ALIGN_RIGHT);
+}
+
+static void
+nmt_editor_section_init (NmtEditorSection *section)
+{
+ NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (section);
+
+ priv->header = NMT_EDITOR_GRID (nmt_editor_grid_new ());
+ priv->body = NMT_EDITOR_GRID (nmt_editor_grid_new ());
+ priv->toggle = nmt_newt_toggle_button_new (_("Hide"), _("Show"));
+ g_object_ref_sink (priv->toggle);
+
+ nmt_newt_section_set_header (NMT_NEWT_SECTION (section), NMT_NEWT_WIDGET (priv->header));
+ nmt_newt_section_set_body (NMT_NEWT_SECTION (section), NMT_NEWT_WIDGET (priv->body));
+
+ g_object_bind_property (priv->toggle, "active",
+ section, "open",
+ G_BINDING_SYNC_CREATE);
+}
+
+static void
+nmt_editor_section_finalize (GObject *object)
+{
+ NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (object);
+
+ g_free (priv->title);
+ g_clear_object (&priv->header_widget);
+ g_clear_object (&priv->toggle);
+
+ G_OBJECT_CLASS (nmt_editor_section_parent_class)->finalize (object);
+}
+
+/**
+ * nmt_editor_section_get_header_widget:
+ * @section: the #NmtEditorSection
+ *
+ * Gets the section's header widget.
+ *
+ * Returns: the section's header widget.
+ */
+NmtNewtWidget *
+nmt_editor_section_get_header_widget (NmtEditorSection *section)
+{
+ NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (section);
+
+ return priv->header_widget;
+}
+
+/**
+ * nmt_editor_section_get_body:
+ * @section: the #NmtEditorSection
+ *
+ * Gets the section's body grid, so that you can add things to it.
+ *
+ * Returns: the #NmtEditorGrid used for the section body
+ */
+NmtEditorGrid *
+nmt_editor_section_get_body (NmtEditorSection *section)
+{
+ NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (section);
+
+ return priv->body;
+}
+
+/**
+ * nmt_editor_section_get_title:
+ * @section: the #NmtEditorSection
+ *
+ * Gets the section's title.
+ *
+ * Returns: the section's title
+ */
+const char *
+nmt_editor_section_get_title (NmtEditorSection *section)
+{
+ NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (section);
+
+ return priv->title;
+}
+
+static void
+nmt_editor_section_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ NmtEditorSection *section = NMT_EDITOR_SECTION (object);
+ NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (section);
+
+ switch (prop_id) {
+ case PROP_TITLE:
+ priv->title = g_value_dup_string (value);
+ rebuild_header (section);
+ break;
+ case PROP_SHOW_BY_DEFAULT:
+ priv->show_by_default = g_value_get_boolean (value);
+ nmt_newt_toggle_button_set_active (NMT_NEWT_TOGGLE_BUTTON (priv->toggle),
+ priv->show_by_default);
+ break;
+ case PROP_HEADER_WIDGET:
+ priv->header_widget = g_value_get_object (value);
+ if (priv->header_widget)
+ g_object_ref_sink (priv->header_widget);
+ rebuild_header (section);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+nmt_editor_section_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_TITLE:
+ g_value_set_string (value, priv->title);
+ break;
+ case PROP_SHOW_BY_DEFAULT:
+ g_value_set_boolean (value, priv->show_by_default);
+ break;
+ case PROP_HEADER_WIDGET:
+ g_value_set_object (value, priv->header_widget);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+nmt_editor_section_class_init (NmtEditorSectionClass *section_class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (section_class);
+
+ g_type_class_add_private (section_class, sizeof (NmtEditorSectionPrivate));
+
+ /* virtual methods */
+ object_class->set_property = nmt_editor_section_set_property;
+ object_class->get_property = nmt_editor_section_get_property;
+ object_class->finalize = nmt_editor_section_finalize;
+
+ /* properties */
+
+ /**
+ * NmtEditorSection:title:
+ *
+ * The section's title.
+ */
+ g_object_class_install_property
+ (object_class, PROP_TITLE,
+ g_param_spec_string ("title", "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NmtEditorSection:show-by-default:
+ *
+ * Whether the section should be expanded by default.
+ */
+ g_object_class_install_property
+ (object_class, PROP_SHOW_BY_DEFAULT,
+ g_param_spec_boolean ("show-by-default", "", "",
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NmtEditorSection:header-widget:
+ *
+ * The widget (if any) that appears between the section title and its toggle
+ * button.
+ */
+ g_object_class_install_property
+ (object_class, PROP_HEADER_WIDGET,
+ g_param_spec_object ("header-widget", "", "",
+ NMT_TYPE_NEWT_WIDGET,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+}
diff --git a/clients/tui/nmt-editor-section.h b/clients/tui/nmt-editor-section.h
new file mode 100644
index 0000000000..67410c7174
--- /dev/null
+++ b/clients/tui/nmt-editor-section.h
@@ -0,0 +1,56 @@
+/* -*- 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2013 Red Hat, Inc.
+ */
+
+#ifndef NMT_EDITOR_SECTION_H
+#define NMT_EDITOR_SECTION_H
+
+#include "nmt-newt-section.h"
+#include "nmt-editor-grid.h"
+
+G_BEGIN_DECLS
+
+#define NMT_TYPE_EDITOR_SECTION (nmt_editor_section_get_type ())
+#define NMT_EDITOR_SECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_SECTION, NmtEditorSection))
+#define NMT_EDITOR_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_SECTION, NmtEditorSectionClass))
+#define NMT_IS_EDITOR_SECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_EDITOR_SECTION))
+#define NMT_IS_EDITOR_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_EDITOR_SECTION))
+#define NMT_EDITOR_SECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_EDITOR_SECTION, NmtEditorSectionClass))
+
+typedef struct {
+ NmtNewtSection parent;
+
+} NmtEditorSection;
+
+typedef struct {
+ NmtNewtSectionClass parent;
+
+} NmtEditorSectionClass;
+
+GType nmt_editor_section_get_type (void);
+
+NmtEditorSection *nmt_editor_section_new (const char *title,
+ NmtNewtWidget *header_widget,
+ gboolean show_by_default);
+
+const char *nmt_editor_section_get_title (NmtEditorSection *section);
+NmtNewtWidget *nmt_editor_section_get_header_widget (NmtEditorSection *section);
+NmtEditorGrid *nmt_editor_section_get_body (NmtEditorSection *section);
+
+G_END_DECLS
+
+#endif /* NMT_EDITOR_SECTION_H */
diff --git a/clients/tui/nmt-editor.c b/clients/tui/nmt-editor.c
index bd1c77e339..abc9286637 100644
--- a/clients/tui/nmt-editor.c
+++ b/clients/tui/nmt-editor.c
@@ -34,9 +34,26 @@
#include "nmtui.h"
#include "nm-editor-utils.h"
-#include "nmt-page-main.h"
#include "nmt-utils.h"
+#include "nmt-device-entry.h"
+#include "nmt-mac-entry.h"
+#include "nmt-mtu-entry.h"
+
+#include "nmt-page-bond.h"
+#include "nmt-page-bridge.h"
+#include "nmt-page-bridge-port.h"
+#include "nmt-page-dsl.h"
+#include "nmt-page-ethernet.h"
+#include "nmt-page-infiniband.h"
+#include "nmt-page-ip4.h"
+#include "nmt-page-ip6.h"
+#include "nmt-page-ppp.h"
+#include "nmt-page-team.h"
+#include "nmt-page-team-port.h"
+#include "nmt-page-vlan.h"
+#include "nmt-page-wifi.h"
+
G_DEFINE_TYPE (NmtEditor, nmt_editor, NMT_TYPE_NEWT_FORM)
#define NMT_EDITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_EDITOR, NmtEditorPrivate))
@@ -47,6 +64,7 @@ typedef struct {
NMEditorConnectionTypeData *type_data;
+ GSList *pages;
NmtNewtWidget *ok, *cancel;
gboolean running;
} NmtEditorPrivate;
@@ -217,12 +235,71 @@ build_edit_connection (NMConnection *orig_connection)
return edit_connection;
}
+static gboolean
+permissions_transform_to_allusers (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
+{
+ char **perms = g_value_get_boxed (source_value);
+
+ g_value_set_boolean (target_value, g_strv_length (perms) == 0);
+ return TRUE;
+}
+
+static gboolean
+permissions_transform_from_allusers (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
+{
+ gboolean allusers = g_value_get_boolean (source_value);
+ char **perms = NULL;
+
+ if (!allusers) {
+ perms = g_new (char *, 2);
+
+ perms[0] = g_strdup_printf ("user:%s:", g_get_user_name ());
+ perms[1] = NULL;
+ }
+ g_value_take_boxed (target_value, perms);
+ return TRUE;
+}
+
+static NmtNewtWidget *
+add_sections_for_page (NmtEditor *editor, NmtEditorGrid *grid, NmtEditorPage *page)
+{
+ NmtEditorPrivate *priv = NMT_EDITOR_GET_PRIVATE (editor);
+ NmtNewtWidget *first_section = NULL;
+ const GSList *sections, *iter;
+
+ g_return_val_if_fail (NMT_IS_EDITOR_PAGE (page), NULL);
+
+ priv->pages = g_slist_prepend (priv->pages, page);
+
+ sections = nmt_editor_page_get_sections (page);
+ for (iter = sections; iter; iter = iter->next) {
+ if (!first_section)
+ first_section = iter->data;
+ nmt_editor_grid_append (grid, NULL, iter->data, NULL);
+ }
+
+ return first_section;
+}
+
static void
nmt_editor_constructed (GObject *object)
{
NmtEditor *editor = NMT_EDITOR (object);
NmtEditorPrivate *priv = NMT_EDITOR_GET_PRIVATE (editor);
- NmtNewtWidget *vbox, *buttons, *page;
+ NMSettingConnection *s_con;
+ NmtNewtWidget *vbox, *widget, *buttons;
+ NmtEditorGrid *grid;
+ const char *deventry_label;
+ NmtDeviceEntry *deventry;
+ GType hardware_type;
+ const char *slave_type;
+ NmtEditorPage *page;
if (G_OBJECT_CLASS (nmt_editor_parent_class)->constructed)
G_OBJECT_CLASS (nmt_editor_parent_class)->constructed (object);
@@ -231,8 +308,104 @@ nmt_editor_constructed (GObject *object)
vbox = nmt_newt_grid_new ();
- page = nmt_page_main_new (priv->edit_connection, priv->type_data);
- nmt_newt_grid_add (NMT_NEWT_GRID (vbox), page, 0, 0);
+ s_con = nm_connection_get_setting_connection (priv->edit_connection);
+
+ grid = NMT_EDITOR_GRID (nmt_editor_grid_new ());
+ nmt_newt_grid_add (NMT_NEWT_GRID (vbox), NMT_NEWT_WIDGET (grid), 0, 0);
+
+ /* Add the top widgets */
+
+ widget = nmt_newt_entry_new (40, NMT_NEWT_ENTRY_NONEMPTY);
+ g_object_bind_property (s_con, NM_SETTING_CONNECTION_ID,
+ widget, "text",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, _("Profile name"), widget, NULL);
+
+ if (priv->type_data->virtual)
+ hardware_type = G_TYPE_NONE;
+ else
+ hardware_type = priv->type_data->device_type;
+
+ /* For connections involving multiple network devices, clarify which one
+ * NMSettingConnection:interface-name refers to.
+ */
+ if (nm_connection_is_type (priv->edit_connection, NM_SETTING_PPPOE_SETTING_NAME))
+ deventry_label = _("Ethernet device");
+ else
+ deventry_label = _("Device");
+
+ widget = nmt_device_entry_new (deventry_label, 40, hardware_type);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
+ deventry = NMT_DEVICE_ENTRY (widget);
+ g_object_bind_property (s_con, NM_SETTING_CONNECTION_INTERFACE_NAME,
+ deventry, "interface-name",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+
+ /* Now add the various pages... */
+
+ if (nm_connection_is_type (priv->edit_connection, NM_SETTING_BOND_SETTING_NAME))
+ page = nmt_page_bond_new (priv->edit_connection, deventry);
+ else if (nm_connection_is_type (priv->edit_connection, NM_SETTING_BRIDGE_SETTING_NAME))
+ page = nmt_page_bridge_new (priv->edit_connection, deventry);
+ else if (nm_connection_is_type (priv->edit_connection, NM_SETTING_INFINIBAND_SETTING_NAME))
+ page = nmt_page_infiniband_new (priv->edit_connection, deventry);
+ else if (nm_connection_is_type (priv->edit_connection, NM_SETTING_PPPOE_SETTING_NAME))
+ page = nmt_page_dsl_new (priv->edit_connection, deventry);
+ else if (nm_connection_is_type (priv->edit_connection, NM_SETTING_TEAM_SETTING_NAME))
+ page = nmt_page_team_new (priv->edit_connection, deventry);
+ else if (nm_connection_is_type (priv->edit_connection, NM_SETTING_VLAN_SETTING_NAME))
+ page = nmt_page_vlan_new (priv->edit_connection, deventry);
+ else if (nm_connection_is_type (priv->edit_connection, NM_SETTING_WIRED_SETTING_NAME))
+ page = nmt_page_ethernet_new (priv->edit_connection, deventry);
+ else if (nm_connection_is_type (priv->edit_connection, NM_SETTING_WIRELESS_SETTING_NAME))
+ page = nmt_page_wifi_new (priv->edit_connection, deventry);
+ else
+ g_assert_not_reached ();
+
+ add_sections_for_page (editor, grid, page);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+
+ slave_type = nm_setting_connection_get_slave_type (s_con);
+ if (slave_type) {
+ if (!strcmp (slave_type, NM_SETTING_BRIDGE_SETTING_NAME))
+ add_sections_for_page (editor, grid, nmt_page_bridge_port_new (priv->edit_connection));
+ else if (!strcmp (slave_type, NM_SETTING_TEAM_SETTING_NAME))
+ add_sections_for_page (editor, grid, nmt_page_team_port_new (priv->edit_connection));
+ } else {
+ NmtNewtWidget *section;
+
+ section = add_sections_for_page (editor, grid, nmt_page_ip4_new (priv->edit_connection));
+
+ /* Add a separator between ip4 and ip6 that's only visible if ip4 is open */
+ widget = nmt_newt_separator_new ();
+ g_object_bind_property (section, "open", widget, "visible", G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
+
+ add_sections_for_page (editor, grid, nmt_page_ip6_new (priv->edit_connection));
+
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ }
+
+ /* And finally the bottom widgets */
+
+ widget = nmt_newt_checkbox_new (_("Automatically connect"));
+ g_object_bind_property (s_con, NM_SETTING_CONNECTION_AUTOCONNECT,
+ widget, "active",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
+
+ widget = nmt_newt_checkbox_new (_("Available to all users"));
+ g_object_bind_property_full (s_con, NM_SETTING_CONNECTION_PERMISSIONS,
+ widget, "active",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
+ permissions_transform_to_allusers,
+ permissions_transform_from_allusers,
+ NULL, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
+
+ /* And the button box */
buttons = nmt_newt_button_box_new (NMT_NEWT_BUTTON_BOX_HORIZONTAL);
nmt_newt_grid_add (NMT_NEWT_GRID (vbox), buttons, 0, 1);
@@ -243,7 +416,7 @@ nmt_editor_constructed (GObject *object)
priv->ok = nmt_newt_button_box_add_end (NMT_NEWT_BUTTON_BOX (buttons), _("OK"));
g_signal_connect (priv->ok, "clicked", G_CALLBACK (save_connection_and_exit), editor);
- g_object_bind_property (page, "valid",
+ g_object_bind_property (NMT_NEWT_WIDGET (grid), "valid",
priv->ok, "sensitive",
G_BINDING_SYNC_CREATE);
@@ -258,6 +431,8 @@ nmt_editor_finalize (GObject *object)
g_clear_object (&priv->orig_connection);
g_clear_object (&priv->edit_connection);
+ g_slist_free_full (priv->pages, g_object_unref);
+
g_clear_object (&priv->ok);
g_clear_object (&priv->cancel);
diff --git a/clients/tui/nmt-page-bond.c b/clients/tui/nmt-page-bond.c
index d39ccd1d89..b043b513de 100644
--- a/clients/tui/nmt-page-bond.c
+++ b/clients/tui/nmt-page-bond.c
@@ -35,7 +35,7 @@
#include "nmt-address-list.h"
#include "nmt-slave-list.h"
-G_DEFINE_TYPE (NmtPageBond, nmt_page_bond, NMT_TYPE_PAGE_DEVICE)
+G_DEFINE_TYPE (NmtPageBond, nmt_page_bond, NMT_TYPE_EDITOR_PAGE_DEVICE)
#define NMT_PAGE_BOND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_BOND, NmtPageBondPrivate))
@@ -64,13 +64,12 @@ typedef struct {
gboolean updating;
} NmtPageBondPrivate;
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_bond_new (NMConnection *conn,
NmtDeviceEntry *deventry)
{
return g_object_new (NMT_TYPE_PAGE_BOND,
"connection", conn,
- "title", _("BOND"),
"device-entry", deventry,
NULL);
}
@@ -338,7 +337,8 @@ nmt_page_bond_constructed (GObject *object)
{
NmtPageBond *bond = NMT_PAGE_BOND (object);
NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE (bond);
- NmtPageGrid *grid;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NMSettingBond *s_bond;
NmtNewtWidget *widget, *label;
NMConnection *conn;
@@ -351,68 +351,69 @@ nmt_page_bond_constructed (GObject *object)
}
priv->s_bond = s_bond;
- grid = NMT_PAGE_GRID (bond);
+ section = nmt_editor_section_new (_("BOND"), NULL, TRUE);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_newt_separator_new ();
- nmt_page_grid_append (grid, _("Slaves"), widget, NULL);
- nmt_page_grid_set_row_flags (grid, widget, NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT);
+ nmt_editor_grid_append (grid, _("Slaves"), widget, NULL);
+ nmt_editor_grid_set_row_flags (grid, widget, NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT);
widget = nmt_slave_list_new (conn, bond_connection_type_filter, bond);
g_signal_connect (widget, "notify::connections",
G_CALLBACK (slaves_changed), bond);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
priv->slaves = NMT_SLAVE_LIST (widget);
widget = nmt_newt_popup_new (bond_mode);
g_signal_connect (widget, "notify::active-id",
G_CALLBACK (mode_widget_changed), bond);
- nmt_page_grid_append (grid, _("Mode"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Mode"), widget, NULL);
priv->mode = NMT_NEWT_POPUP (widget);
widget = nmt_newt_entry_new (40, 0);
g_signal_connect (widget, "notify::text",
G_CALLBACK (primary_widget_changed), bond);
- nmt_page_grid_append (grid, _("Primary"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Primary"), widget, NULL);
priv->primary = NMT_NEWT_ENTRY (widget);
widget = nmt_newt_popup_new (bond_monitoring);
g_signal_connect (widget, "notify::active",
G_CALLBACK (monitoring_widget_changed), bond);
- nmt_page_grid_append (grid, _("Link monitoring"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Link monitoring"), widget, NULL);
priv->monitoring = NMT_NEWT_POPUP (widget);
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
g_signal_connect (widget, "notify::text",
G_CALLBACK (miimon_widget_changed), bond);
label = nmt_newt_label_new (C_("milliseconds", "ms"));
- nmt_page_grid_append (grid, _("Monitoring frequency"), widget, label);
+ nmt_editor_grid_append (grid, _("Monitoring frequency"), widget, label);
priv->miimon = NMT_NEWT_ENTRY (widget);
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
g_signal_connect (widget, "notify::text",
G_CALLBACK (updelay_widget_changed), bond);
label = nmt_newt_label_new (C_("milliseconds", "ms"));
- nmt_page_grid_append (grid, _("Link up delay"), widget, label);
+ nmt_editor_grid_append (grid, _("Link up delay"), widget, label);
priv->updelay = NMT_NEWT_ENTRY (widget);
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
g_signal_connect (widget, "notify::text",
G_CALLBACK (downdelay_widget_changed), bond);
label = nmt_newt_label_new (C_("milliseconds", "ms"));
- nmt_page_grid_append (grid, _("Link down delay"), widget, label);
+ nmt_editor_grid_append (grid, _("Link down delay"), widget, label);
priv->downdelay = NMT_NEWT_ENTRY (widget);
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
g_signal_connect (widget, "notify::text",
G_CALLBACK (arp_interval_widget_changed), bond);
label = nmt_newt_label_new (C_("milliseconds", "ms"));
- nmt_page_grid_append (grid, _("Monitoring frequency"), widget, label);
+ nmt_editor_grid_append (grid, _("Monitoring frequency"), widget, label);
priv->arp_interval = NMT_NEWT_ENTRY (widget);
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP4);
g_signal_connect (widget, "notify::strings",
G_CALLBACK (arp_ip_target_widget_changed), bond);
- nmt_page_grid_append (grid, _("ARP targets"), widget, NULL);
+ nmt_editor_grid_append (grid, _("ARP targets"), widget, NULL);
priv->arp_ip_target = NMT_ADDRESS_LIST (widget);
g_signal_connect (s_bond, "notify::" NM_SETTING_BOND_OPTIONS,
@@ -420,6 +421,8 @@ nmt_page_bond_constructed (GObject *object)
bond_options_changed (G_OBJECT (s_bond), NULL, bond);
slaves_changed (G_OBJECT (priv->slaves), NULL, bond);
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (bond), section);
+
G_OBJECT_CLASS (nmt_page_bond_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-bond.h b/clients/tui/nmt-page-bond.h
index c8e69dd5ee..b77477db28 100644
--- a/clients/tui/nmt-page-bond.h
+++ b/clients/tui/nmt-page-bond.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_BOND_H
#define NMT_PAGE_BOND_H
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -31,18 +31,18 @@ G_BEGIN_DECLS
#define NMT_PAGE_BOND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_BOND, NmtPageBondClass))
typedef struct {
- NmtPageDevice parent;
+ NmtEditorPageDevice parent;
} NmtPageBond;
typedef struct {
- NmtPageDeviceClass parent;
+ NmtEditorPageDeviceClass parent;
} NmtPageBondClass;
GType nmt_page_bond_get_type (void);
-NmtNewtWidget *nmt_page_bond_new (NMConnection *conn,
+NmtEditorPage *nmt_page_bond_new (NMConnection *conn,
NmtDeviceEntry *deventry);
G_END_DECLS
diff --git a/clients/tui/nmt-page-bridge-port.c b/clients/tui/nmt-page-bridge-port.c
index ab7a78887f..c9ef14ed86 100644
--- a/clients/tui/nmt-page-bridge-port.c
+++ b/clients/tui/nmt-page-bridge-port.c
@@ -30,12 +30,11 @@
G_DEFINE_TYPE (NmtPageBridgePort, nmt_page_bridge_port, NMT_TYPE_EDITOR_PAGE)
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_bridge_port_new (NMConnection *conn)
{
return g_object_new (NMT_TYPE_PAGE_BRIDGE_PORT,
"connection", conn,
- "title", _("BRIDGE PORT"),
NULL);
}
@@ -48,7 +47,8 @@ static void
nmt_page_bridge_port_constructed (GObject *object)
{
NmtPageBridgePort *bridge = NMT_PAGE_BRIDGE_PORT (object);
- NmtPageGrid *grid;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NMSettingBridgePort *s_port;
NmtNewtWidget *widget;
NMConnection *conn;
@@ -60,25 +60,28 @@ nmt_page_bridge_port_constructed (GObject *object)
s_port = nm_connection_get_setting_bridge_port (conn);
}
- grid = NMT_PAGE_GRID (bridge);
+ section = nmt_editor_section_new (_("BRIDGE PORT"), NULL, TRUE);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_newt_entry_numeric_new (10, 0, 63);
g_object_bind_property (s_port, NM_SETTING_BRIDGE_PORT_PRIORITY,
widget, "text",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Priority"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Priority"), widget, NULL);
widget = nmt_newt_entry_numeric_new (10, 1, 65535);
g_object_bind_property (s_port, NM_SETTING_BRIDGE_PORT_PATH_COST,
widget, "text",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Path cost"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Path cost"), widget, NULL);
widget = nmt_newt_checkbox_new (_("Hairpin mode"));
g_object_bind_property (s_port, NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE,
widget, "active",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (bridge), section);
G_OBJECT_CLASS (nmt_page_bridge_port_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-bridge-port.h b/clients/tui/nmt-page-bridge-port.h
index 7fe3a92c43..c566dbc095 100644
--- a/clients/tui/nmt-page-bridge-port.h
+++ b/clients/tui/nmt-page-bridge-port.h
@@ -42,7 +42,7 @@ typedef struct {
GType nmt_page_bridge_port_get_type (void);
-NmtNewtWidget *nmt_page_bridge_port_new (NMConnection *conn);
+NmtEditorPage *nmt_page_bridge_port_new (NMConnection *conn);
G_END_DECLS
diff --git a/clients/tui/nmt-page-bridge.c b/clients/tui/nmt-page-bridge.c
index 3769383ae0..ee42d78339 100644
--- a/clients/tui/nmt-page-bridge.c
+++ b/clients/tui/nmt-page-bridge.c
@@ -31,15 +31,14 @@
#include "nmt-address-list.h"
#include "nmt-slave-list.h"
-G_DEFINE_TYPE (NmtPageBridge, nmt_page_bridge, NMT_TYPE_PAGE_DEVICE)
+G_DEFINE_TYPE (NmtPageBridge, nmt_page_bridge, NMT_TYPE_EDITOR_PAGE_DEVICE)
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_bridge_new (NMConnection *conn,
NmtDeviceEntry *deventry)
{
return g_object_new (NMT_TYPE_PAGE_BRIDGE,
"connection", conn,
- "title", _("BRIDGE"),
"device-entry", deventry,
NULL);
}
@@ -62,7 +61,8 @@ static void
nmt_page_bridge_constructed (GObject *object)
{
NmtPageBridge *bridge = NMT_PAGE_BRIDGE (object);
- NmtPageGrid *grid;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NMSettingBridge *s_bridge;
NmtNewtWidget *widget, *label, *stp;
NMConnection *conn;
@@ -74,27 +74,34 @@ nmt_page_bridge_constructed (GObject *object)
s_bridge = nm_connection_get_setting_bridge (conn);
}
- grid = NMT_PAGE_GRID (bridge);
+ section = nmt_editor_section_new (_("BRIDGE"), NULL, TRUE);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_newt_separator_new ();
- nmt_page_grid_append (grid, _("Slaves"), widget, NULL);
- nmt_page_grid_set_row_flags (grid, widget, NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT);
+ nmt_editor_grid_append (grid, _("Slaves"), widget, NULL);
+ nmt_editor_grid_set_row_flags (grid, widget, NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT);
widget = nmt_slave_list_new (conn, bridge_connection_type_filter, bridge);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
widget = nmt_newt_entry_numeric_new (10, 0, 1000000);
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_AGEING_TIME,
widget, "text",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
label = nmt_newt_label_new (_("seconds"));
- nmt_page_grid_append (grid, _("Aging time"), widget, label);
+ 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",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_PRIORITY,
@@ -103,7 +110,7 @@ nmt_page_bridge_constructed (GObject *object)
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP,
widget, "sensitive",
G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Priority"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Priority"), widget, NULL);
widget = nmt_newt_entry_numeric_new (10, 2, 30);
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_FORWARD_DELAY,
@@ -113,7 +120,7 @@ nmt_page_bridge_constructed (GObject *object)
widget, "sensitive",
G_BINDING_SYNC_CREATE);
label = nmt_newt_label_new (_("seconds"));
- nmt_page_grid_append (grid, _("Forward delay"), widget, label);
+ nmt_editor_grid_append (grid, _("Forward delay"), widget, label);
widget = nmt_newt_entry_numeric_new (10, 1, 10);
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_HELLO_TIME,
@@ -123,7 +130,7 @@ nmt_page_bridge_constructed (GObject *object)
widget, "sensitive",
G_BINDING_SYNC_CREATE);
label = nmt_newt_label_new (_("seconds"));
- nmt_page_grid_append (grid, _("Hello time"), widget, label);
+ nmt_editor_grid_append (grid, _("Hello time"), widget, label);
widget = nmt_newt_entry_numeric_new (10, 6, 40);
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_MAX_AGE,
@@ -133,7 +140,9 @@ nmt_page_bridge_constructed (GObject *object)
widget, "sensitive",
G_BINDING_SYNC_CREATE);
label = nmt_newt_label_new (_("seconds"));
- nmt_page_grid_append (grid, _("Max age"), widget, label);
+ nmt_editor_grid_append (grid, _("Max age"), widget, label);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (bridge), section);
G_OBJECT_CLASS (nmt_page_bridge_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-bridge.h b/clients/tui/nmt-page-bridge.h
index b11d350291..60cbdea23f 100644
--- a/clients/tui/nmt-page-bridge.h
+++ b/clients/tui/nmt-page-bridge.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_BRIDGE_H
#define NMT_PAGE_BRIDGE_H
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -31,18 +31,18 @@ G_BEGIN_DECLS
#define NMT_PAGE_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_BRIDGE, NmtPageBridgeClass))
typedef struct {
- NmtPageDevice parent;
+ NmtEditorPageDevice parent;
} NmtPageBridge;
typedef struct {
- NmtPageDeviceClass parent;
+ NmtEditorPageDeviceClass parent;
} NmtPageBridgeClass;
GType nmt_page_bridge_get_type (void);
-NmtNewtWidget *nmt_page_bridge_new (NMConnection *conn,
+NmtEditorPage *nmt_page_bridge_new (NMConnection *conn,
NmtDeviceEntry *deventry);
G_END_DECLS
diff --git a/clients/tui/nmt-page-device.h b/clients/tui/nmt-page-device.h
deleted file mode 100644
index a15595a553..0000000000
--- a/clients/tui/nmt-page-device.h
+++ /dev/null
@@ -1,50 +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, see <http://www.gnu.org/licenses/>.
- *
- * Copyright 2013 Red Hat, Inc.
- */
-
-#ifndef NMT_PAGE_DEVICE_H
-#define NMT_PAGE_DEVICE_H
-
-#include "nmt-editor-page.h"
-#include "nmt-device-entry.h"
-
-G_BEGIN_DECLS
-
-#define NMT_TYPE_PAGE_DEVICE (nmt_page_device_get_type ())
-#define NMT_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_DEVICE, NmtPageDevice))
-#define NMT_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_DEVICE, NmtPageDeviceClass))
-#define NMT_IS_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_PAGE_DEVICE))
-#define NMT_IS_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_PAGE_DEVICE))
-#define NMT_PAGE_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_DEVICE, NmtPageDeviceClass))
-
-typedef struct {
- NmtEditorPage parent;
-
-} NmtPageDevice;
-
-typedef struct {
- NmtEditorPageClass parent;
-
-} NmtPageDeviceClass;
-
-GType nmt_page_device_get_type (void);
-
-NmtDeviceEntry *nmt_page_device_get_device_entry (NmtPageDevice *page);
-
-G_END_DECLS
-
-#endif /* NMT_PAGE_DEVICE_H */
diff --git a/clients/tui/nmt-page-dsl.c b/clients/tui/nmt-page-dsl.c
index 5286d9f08a..1d476aa01b 100644
--- a/clients/tui/nmt-page-dsl.c
+++ b/clients/tui/nmt-page-dsl.c
@@ -27,16 +27,26 @@
#include <glib/gi18n-lib.h>
#include "nmt-page-dsl.h"
+#include "nmt-page-ethernet.h"
+#include "nmt-page-ppp.h"
#include "nmt-password-fields.h"
-G_DEFINE_TYPE (NmtPageDsl, nmt_page_dsl, NMT_TYPE_EDITOR_PAGE)
+G_DEFINE_TYPE (NmtPageDsl, nmt_page_dsl, NMT_TYPE_EDITOR_PAGE_DEVICE)
-NmtNewtWidget *
-nmt_page_dsl_new (NMConnection *conn)
+#define NMT_PAGE_DSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_DSL, NmtPageDslPrivate))
+
+typedef struct {
+ NmtEditorPage *ethernet_page, *ppp_page;
+
+} NmtPageDslPrivate;
+
+NmtEditorPage *
+nmt_page_dsl_new (NMConnection *conn,
+ NmtDeviceEntry *deventry)
{
return g_object_new (NMT_TYPE_PAGE_DSL,
"connection", conn,
- "title", _("DSL"),
+ "device-entry", deventry,
NULL);
}
@@ -45,26 +55,18 @@ nmt_page_dsl_init (NmtPageDsl *dsl)
{
}
-static void
-nmt_page_dsl_constructed (GObject *object)
+static NmtEditorSection *
+build_dsl_section (NmtPageDsl *dsl, NMSettingPppoe *s_pppoe)
{
- NmtPageDsl *dsl = NMT_PAGE_DSL (object);
- NmtPageGrid *grid;
- NMSettingPppoe *s_pppoe;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NmtNewtWidget *widget;
- NMConnection *conn;
- conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (dsl));
- s_pppoe = nm_connection_get_setting_pppoe (conn);
- if (!s_pppoe) {
- nm_connection_add_setting (conn, nm_setting_pppoe_new ());
- s_pppoe = nm_connection_get_setting_pppoe (conn);
- }
-
- grid = NMT_PAGE_GRID (dsl);
+ section = nmt_editor_section_new (_("DSL"), NULL, TRUE);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_newt_entry_new (40, 0);
- nmt_page_grid_append (grid, _("Username"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Username"), widget, NULL);
g_object_bind_property (s_pppoe, NM_SETTING_PPPOE_USERNAME,
widget, "text",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
@@ -73,21 +75,69 @@ nmt_page_dsl_constructed (GObject *object)
g_object_bind_property (s_pppoe, NM_SETTING_PPPOE_PASSWORD,
widget, "password",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
- nmt_page_grid_append (grid, _("Password"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Password"), widget, NULL);
widget = nmt_newt_entry_new (40, 0);
- nmt_page_grid_append (grid, _("Service"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Service"), widget, NULL);
g_object_bind_property (s_pppoe, NM_SETTING_PPPOE_SERVICE,
widget, "text",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
+ return section;
+}
+
+static void
+nmt_page_dsl_constructed (GObject *object)
+{
+ NmtPageDsl *dsl = NMT_PAGE_DSL (object);
+ NmtPageDslPrivate *priv = NMT_PAGE_DSL_GET_PRIVATE (dsl);
+ NMConnection *conn;
+ NMSettingPppoe *s_pppoe;
+ NmtEditorSection *section;
+ const GSList *sections, *iter;
+
+ conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (dsl));
+ s_pppoe = nm_connection_get_setting_pppoe (conn);
+ if (!s_pppoe) {
+ nm_connection_add_setting (conn, nm_setting_pppoe_new ());
+ s_pppoe = nm_connection_get_setting_pppoe (conn);
+ }
+
+ section = build_dsl_section (dsl, s_pppoe);
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (dsl), section);
+
+ priv->ethernet_page = nmt_page_ethernet_new (conn, nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (dsl)));
+ sections = nmt_editor_page_get_sections (priv->ethernet_page);
+ for (iter = sections; iter; iter = iter->next)
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (dsl), iter->data);
+
+ priv->ppp_page = nmt_page_ppp_new (conn);
+ sections = nmt_editor_page_get_sections (priv->ppp_page);
+ for (iter = sections; iter; iter = iter->next)
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (dsl), iter->data);
+
G_OBJECT_CLASS (nmt_page_dsl_parent_class)->constructed (object);
}
static void
+nmt_page_dsl_finalize (GObject *object)
+{
+ NmtPageDsl *dsl = NMT_PAGE_DSL (object);
+ NmtPageDslPrivate *priv = NMT_PAGE_DSL_GET_PRIVATE (dsl);
+
+ g_clear_object (&priv->ethernet_page);
+ g_clear_object (&priv->ppp_page);
+
+ G_OBJECT_CLASS (nmt_page_dsl_parent_class)->finalize (object);
+}
+
+static void
nmt_page_dsl_class_init (NmtPageDslClass *dsl_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (dsl_class);
+ g_type_class_add_private (object_class, sizeof (NmtPageDslPrivate));
+
object_class->constructed = nmt_page_dsl_constructed;
+ object_class->finalize = nmt_page_dsl_finalize;
}
diff --git a/clients/tui/nmt-page-dsl.h b/clients/tui/nmt-page-dsl.h
index 61fc23a8f3..b938ead238 100644
--- a/clients/tui/nmt-page-dsl.h
+++ b/clients/tui/nmt-page-dsl.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_DSL_H
#define NMT_PAGE_DSL_H
-#include "nmt-editor-page.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -31,18 +31,19 @@ G_BEGIN_DECLS
#define NMT_PAGE_DSL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_DSL, NmtPageDslClass))
typedef struct {
- NmtEditorPage parent;
+ NmtEditorPageDevice parent;
} NmtPageDsl;
typedef struct {
- NmtEditorPageClass parent;
+ NmtEditorPageDeviceClass parent;
} NmtPageDslClass;
GType nmt_page_dsl_get_type (void);
-NmtNewtWidget *nmt_page_dsl_new (NMConnection *conn);
+NmtEditorPage *nmt_page_dsl_new (NMConnection *conn,
+ NmtDeviceEntry *deventry);
G_END_DECLS
diff --git a/clients/tui/nmt-page-ethernet.c b/clients/tui/nmt-page-ethernet.c
index 9eb08fe5b3..cf4ef2c458 100644
--- a/clients/tui/nmt-page-ethernet.c
+++ b/clients/tui/nmt-page-ethernet.c
@@ -30,17 +30,15 @@
#include "nmt-mac-entry.h"
#include "nmt-mtu-entry.h"
-G_DEFINE_TYPE (NmtPageEthernet, nmt_page_ethernet, NMT_TYPE_PAGE_DEVICE)
+G_DEFINE_TYPE (NmtPageEthernet, nmt_page_ethernet, NMT_TYPE_EDITOR_PAGE_DEVICE)
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_ethernet_new (NMConnection *conn,
NmtDeviceEntry *deventry)
{
return g_object_new (NMT_TYPE_PAGE_ETHERNET,
"connection", conn,
- "title", _("ETHERNET"),
"device-entry", deventry,
- "show-by-default", FALSE,
NULL);
}
@@ -54,7 +52,8 @@ nmt_page_ethernet_constructed (GObject *object)
{
NmtPageEthernet *ethernet = NMT_PAGE_ETHERNET (object);
NmtDeviceEntry *deventry;
- NmtPageGrid *grid;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NMSettingWired *s_wired;
NmtNewtWidget *widget;
NMConnection *conn;
@@ -66,24 +65,27 @@ nmt_page_ethernet_constructed (GObject *object)
s_wired = nm_connection_get_setting_wired (conn);
}
- deventry = nmt_page_device_get_device_entry (NMT_PAGE_DEVICE (object));
+ deventry = nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (object));
g_object_bind_property (s_wired, NM_SETTING_WIRED_MAC_ADDRESS,
deventry, "mac-address",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- grid = NMT_PAGE_GRID (ethernet);
+ section = nmt_editor_section_new (_("ETHERNET"), NULL, FALSE);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_mac_entry_new (40, ETH_ALEN);
g_object_bind_property (s_wired, NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
widget, "mac-address",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Cloned MAC address"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Cloned MAC address"), widget, NULL);
widget = nmt_mtu_entry_new ();
g_object_bind_property (s_wired, NM_SETTING_WIRED_MTU,
widget, "mtu",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("MTU"), widget, NULL);
+ nmt_editor_grid_append (grid, _("MTU"), widget, NULL);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (ethernet), section);
G_OBJECT_CLASS (nmt_page_ethernet_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-ethernet.h b/clients/tui/nmt-page-ethernet.h
index 5e001562f7..bdf3d67731 100644
--- a/clients/tui/nmt-page-ethernet.h
+++ b/clients/tui/nmt-page-ethernet.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_ETHERNET_H
#define NMT_PAGE_ETHERNET_H
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -31,18 +31,18 @@ G_BEGIN_DECLS
#define NMT_PAGE_ETHERNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_ETHERNET, NmtPageEthernetClass))
typedef struct {
- NmtPageDevice parent;
+ NmtEditorPageDevice parent;
} NmtPageEthernet;
typedef struct {
- NmtPageDeviceClass parent;
+ NmtEditorPageDeviceClass parent;
} NmtPageEthernetClass;
GType nmt_page_ethernet_get_type (void);
-NmtNewtWidget *nmt_page_ethernet_new (NMConnection *conn,
+NmtEditorPage *nmt_page_ethernet_new (NMConnection *conn,
NmtDeviceEntry *deventry);
G_END_DECLS
diff --git a/clients/tui/nmt-page-infiniband.c b/clients/tui/nmt-page-infiniband.c
index 59fa68000f..f39b0b84fd 100644
--- a/clients/tui/nmt-page-infiniband.c
+++ b/clients/tui/nmt-page-infiniband.c
@@ -29,15 +29,14 @@
#include "nmt-page-infiniband.h"
#include "nmt-mtu-entry.h"
-G_DEFINE_TYPE (NmtPageInfiniband, nmt_page_infiniband, NMT_TYPE_PAGE_DEVICE)
+G_DEFINE_TYPE (NmtPageInfiniband, nmt_page_infiniband, NMT_TYPE_EDITOR_PAGE_DEVICE)
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_infiniband_new (NMConnection *conn,
NmtDeviceEntry *deventry)
{
return g_object_new (NMT_TYPE_PAGE_INFINIBAND,
"connection", conn,
- "title", _("INFINIBAND"),
"device-entry", deventry,
NULL);
}
@@ -58,7 +57,8 @@ nmt_page_infiniband_constructed (GObject *object)
{
NmtPageInfiniband *infiniband = NMT_PAGE_INFINIBAND (object);
NmtDeviceEntry *deventry;
- NmtPageGrid *grid;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NMSettingInfiniband *s_ib;
NmtNewtWidget *widget;
NMConnection *conn;
@@ -76,24 +76,27 @@ nmt_page_infiniband_constructed (GObject *object)
NULL);
}
- deventry = nmt_page_device_get_device_entry (NMT_PAGE_DEVICE (object));
+ deventry = nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (object));
g_object_bind_property (s_ib, NM_SETTING_INFINIBAND_MAC_ADDRESS,
deventry, "mac-address",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- grid = NMT_PAGE_GRID (infiniband);
+ section = nmt_editor_section_new (_("INFINIBAND"), NULL, TRUE);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_newt_popup_new (transport_mode);
g_object_bind_property (s_ib, NM_SETTING_INFINIBAND_TRANSPORT_MODE,
widget, "active-id",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Transport mode"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Transport mode"), widget, NULL);
widget = nmt_mtu_entry_new ();
g_object_bind_property (s_ib, NM_SETTING_INFINIBAND_MTU,
widget, "mtu",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("MTU"), widget, NULL);
+ nmt_editor_grid_append (grid, _("MTU"), widget, NULL);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (infiniband), section);
G_OBJECT_CLASS (nmt_page_infiniband_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-infiniband.h b/clients/tui/nmt-page-infiniband.h
index 706b7b60c3..f51e0874ec 100644
--- a/clients/tui/nmt-page-infiniband.h
+++ b/clients/tui/nmt-page-infiniband.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_INFINIBAND_H
#define NMT_PAGE_INFINIBAND_H
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -31,18 +31,18 @@ G_BEGIN_DECLS
#define NMT_PAGE_INFINIBAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_INFINIBAND, NmtPageInfinibandClass))
typedef struct {
- NmtPageDevice parent;
+ NmtEditorPageDevice parent;
} NmtPageInfiniband;
typedef struct {
- NmtPageDeviceClass parent;
+ NmtEditorPageDeviceClass parent;
} NmtPageInfinibandClass;
GType nmt_page_infiniband_get_type (void);
-NmtNewtWidget *nmt_page_infiniband_new (NMConnection *conn,
+NmtEditorPage *nmt_page_infiniband_new (NMConnection *conn,
NmtDeviceEntry *deventry);
G_END_DECLS
diff --git a/clients/tui/nmt-page-ip4.c b/clients/tui/nmt-page-ip4.c
index 8d10b4aa7f..df3f0b6474 100644
--- a/clients/tui/nmt-page-ip4.c
+++ b/clients/tui/nmt-page-ip4.c
@@ -46,29 +46,14 @@ static NmtNewtPopupEntry ip4methods[] = {
{ NULL, NULL }
};
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_ip4_new (NMConnection *conn)
{
return g_object_new (NMT_TYPE_PAGE_IP4,
"connection", conn,
- "title", _("IPv4 CONFIGURATION"),
NULL);
}
-static gboolean
-nmt_page_ip4_show_by_default (NmtEditorPage *page)
-{
- NMConnection *conn;
- NMSettingIP4Config *s_ip4;
-
- conn = nmt_editor_page_get_connection (page);
- s_ip4 = nm_connection_get_setting_ip4_config (conn);
- if ( !g_strcmp0 (nm_setting_ip4_config_get_method (s_ip4), NM_SETTING_IP4_CONFIG_METHOD_MANUAL)
- || nm_setting_ip4_config_get_num_addresses (s_ip4))
- return TRUE;
- return FALSE;
-}
-
static void
nmt_page_ip4_init (NmtPageIP4 *ip4)
{
@@ -114,82 +99,96 @@ static void
nmt_page_ip4_constructed (GObject *object)
{
NmtPageIP4 *ip4 = NMT_PAGE_IP4 (object);
- NmtPageGrid *grid;
- NMSettingIP4Config *s_ip4;
+ gboolean show_by_default;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
+ NMSettingIPConfig *s_ip4;
NmtNewtWidget *widget, *button;
NMConnection *conn;
conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (ip4));
s_ip4 = nm_connection_get_setting_ip4_config (conn);
if (!s_ip4) {
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
nm_connection_add_setting (conn, (NMSetting *) s_ip4);
}
widget = nmt_newt_popup_new (ip4methods);
- g_object_bind_property (s_ip4, NM_SETTING_IP4_CONFIG_METHOD,
+ g_object_bind_property (s_ip4, NM_SETTING_IP_CONFIG_METHOD,
widget, "active-id",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_editor_page_set_header_widget (NMT_EDITOR_PAGE (ip4), widget);
- grid = NMT_PAGE_GRID (ip4);
+ if (!g_strcmp0 (nm_setting_ip_config_get_method (s_ip4), NM_SETTING_IP4_CONFIG_METHOD_MANUAL))
+ show_by_default = TRUE;
+ else if (nm_setting_ip_config_get_num_addresses (s_ip4))
+ show_by_default = TRUE;
+ else
+ show_by_default = FALSE;
+
+ section = nmt_editor_section_new (_("IPv4 CONFIGURATION"), widget, show_by_default);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP4_WITH_PREFIX);
- nm_editor_bind_ip4_addresses_with_prefix_to_strv (s_ip4, NM_SETTING_IP4_CONFIG_ADDRESSES,
- widget, "strings",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Addresses"), widget, NULL);
+ nm_editor_bind_ip_addresses_with_prefix_to_strv (AF_INET,
+ s_ip4, NM_SETTING_IP_CONFIG_ADDRESSES,
+ widget, "strings",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, _("Addresses"), widget, NULL);
widget = nmt_ip_entry_new (25, AF_INET, FALSE, TRUE);
- nm_editor_bind_ip4_gateway_to_string (s_ip4, NM_SETTING_IP4_CONFIG_ADDRESSES,
- widget, "text",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Gateway"), widget, NULL);
+ nm_editor_bind_ip_gateway_to_string (AF_INET,
+ s_ip4,
+ widget, "text", "sensitive",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, _("Gateway"), widget, NULL);
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP4);
- nm_editor_bind_ip4_addresses_to_strv (s_ip4, NM_SETTING_IP4_CONFIG_DNS,
- widget, "strings",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("DNS servers"), widget, NULL);
+ nm_editor_bind_ip_addresses_to_strv (AF_INET,
+ s_ip4, NM_SETTING_IP_CONFIG_DNS,
+ widget, "strings",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, _("DNS servers"), widget, NULL);
widget = nmt_address_list_new (NMT_ADDRESS_LIST_HOSTNAME);
- g_object_bind_property (s_ip4, NM_SETTING_IP4_CONFIG_DNS_SEARCH,
+ g_object_bind_property (s_ip4, NM_SETTING_IP_CONFIG_DNS_SEARCH,
widget, "strings",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Search domains"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Search domains"), widget, NULL);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
widget = g_object_new (NMT_TYPE_NEWT_LABEL,
"text", "",
"style", NMT_NEWT_LABEL_PLAIN,
NULL);
- g_object_bind_property_full (s_ip4, NM_SETTING_IP4_CONFIG_ROUTES,
+ g_object_bind_property_full (s_ip4, NM_SETTING_IP_CONFIG_ROUTES,
widget, "text",
G_BINDING_SYNC_CREATE,
ip4_routes_transform_to_description,
NULL, NULL, NULL);
button = nmt_newt_button_new (_("Edit..."));
g_signal_connect (button, "clicked", G_CALLBACK (edit_routes), s_ip4);
- nmt_page_grid_append (grid, _("Routing"), widget, button);
+ nmt_editor_grid_append (grid, _("Routing"), widget, button);
widget = nmt_newt_checkbox_new (_("Never use this network for default route"));
- g_object_bind_property (s_ip4, NM_SETTING_IP4_CONFIG_NEVER_DEFAULT,
+ g_object_bind_property (s_ip4, NM_SETTING_IP_CONFIG_NEVER_DEFAULT,
widget, "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
widget = nmt_newt_checkbox_new (_("Require IPv4 addressing for this connection"));
- g_object_bind_property (s_ip4, NM_SETTING_IP4_CONFIG_MAY_FAIL,
+ g_object_bind_property (s_ip4, NM_SETTING_IP_CONFIG_MAY_FAIL,
widget, "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL |
G_BINDING_INVERT_BOOLEAN);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (ip4), section);
G_OBJECT_CLASS (nmt_page_ip4_parent_class)->constructed (object);
}
@@ -198,9 +197,6 @@ static void
nmt_page_ip4_class_init (NmtPageIP4Class *ip4_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (ip4_class);
- NmtEditorPageClass *page_class = NMT_EDITOR_PAGE_CLASS (ip4_class);
object_class->constructed = nmt_page_ip4_constructed;
-
- page_class->show_by_default = nmt_page_ip4_show_by_default;
}
diff --git a/clients/tui/nmt-page-ip4.h b/clients/tui/nmt-page-ip4.h
index f631a91323..e3c5a00345 100644
--- a/clients/tui/nmt-page-ip4.h
+++ b/clients/tui/nmt-page-ip4.h
@@ -42,7 +42,7 @@ typedef struct {
GType nmt_page_ip4_get_type (void);
-NmtNewtWidget *nmt_page_ip4_new (NMConnection *conn);
+NmtEditorPage *nmt_page_ip4_new (NMConnection *conn);
G_END_DECLS
diff --git a/clients/tui/nmt-page-ip6.c b/clients/tui/nmt-page-ip6.c
index 7d3ef548fd..1513dbfa08 100644
--- a/clients/tui/nmt-page-ip6.c
+++ b/clients/tui/nmt-page-ip6.c
@@ -46,29 +46,14 @@ static NmtNewtPopupEntry ip6methods[] = {
{ NULL, NULL }
};
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_ip6_new (NMConnection *conn)
{
return g_object_new (NMT_TYPE_PAGE_IP6,
"connection", conn,
- "title", _("IPv6 CONFIGURATION"),
NULL);
}
-static gboolean
-nmt_page_ip6_show_by_default (NmtEditorPage *page)
-{
- NMConnection *conn;
- NMSettingIP6Config *s_ip6;
-
- conn = nmt_editor_page_get_connection (page);
- s_ip6 = nm_connection_get_setting_ip6_config (conn);
- if ( !g_strcmp0 (nm_setting_ip6_config_get_method (s_ip6), NM_SETTING_IP6_CONFIG_METHOD_MANUAL)
- || nm_setting_ip6_config_get_num_addresses (s_ip6))
- return TRUE;
- return FALSE;
-}
-
static void
nmt_page_ip6_init (NmtPageIP6 *ip6)
{
@@ -114,80 +99,94 @@ static void
nmt_page_ip6_constructed (GObject *object)
{
NmtPageIP6 *ip6 = NMT_PAGE_IP6 (object);
- NmtPageGrid *grid;
- NMSettingIP6Config *s_ip6;
+ gboolean show_by_default;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
+ NMSettingIPConfig *s_ip6;
NmtNewtWidget *widget, *button;
NMConnection *conn;
conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (ip6));
s_ip6 = nm_connection_get_setting_ip6_config (conn);
if (!s_ip6) {
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
NULL);
nm_connection_add_setting (conn, (NMSetting *) s_ip6);
}
widget = nmt_newt_popup_new (ip6methods);
- g_object_bind_property (s_ip6, NM_SETTING_IP6_CONFIG_METHOD,
+ g_object_bind_property (s_ip6, NM_SETTING_IP_CONFIG_METHOD,
widget, "active-id",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_editor_page_set_header_widget (NMT_EDITOR_PAGE (ip6), widget);
- grid = NMT_PAGE_GRID (ip6);
+ if (!g_strcmp0 (nm_setting_ip_config_get_method (s_ip6), NM_SETTING_IP6_CONFIG_METHOD_MANUAL))
+ show_by_default = TRUE;
+ else if (nm_setting_ip_config_get_num_addresses (s_ip6))
+ show_by_default = TRUE;
+ else
+ show_by_default = FALSE;
+
+ section = nmt_editor_section_new (_("IPv6 CONFIGURATION"), widget, show_by_default);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP6_WITH_PREFIX);
- nm_editor_bind_ip6_addresses_with_prefix_to_strv (s_ip6, NM_SETTING_IP6_CONFIG_ADDRESSES,
- widget, "strings",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Addresses"), widget, NULL);
+ nm_editor_bind_ip_addresses_with_prefix_to_strv (AF_INET6,
+ s_ip6, NM_SETTING_IP_CONFIG_ADDRESSES,
+ widget, "strings",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, _("Addresses"), widget, NULL);
widget = nmt_ip_entry_new (25, AF_INET6, FALSE, TRUE);
- nm_editor_bind_ip6_gateway_to_string (s_ip6, NM_SETTING_IP6_CONFIG_ADDRESSES,
- widget, "text",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Gateway"), widget, NULL);
+ nm_editor_bind_ip_gateway_to_string (AF_INET6,
+ s_ip6,
+ widget, "text", "sensitive",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, _("Gateway"), widget, NULL);
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP6);
- nm_editor_bind_ip6_addresses_to_strv (s_ip6, NM_SETTING_IP6_CONFIG_DNS,
- widget, "strings",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("DNS servers"), widget, NULL);
+ nm_editor_bind_ip_addresses_to_strv (AF_INET6,
+ s_ip6, NM_SETTING_IP_CONFIG_DNS,
+ widget, "strings",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ nmt_editor_grid_append (grid, _("DNS servers"), widget, NULL);
widget = nmt_address_list_new (NMT_ADDRESS_LIST_HOSTNAME);
- g_object_bind_property (s_ip6, NM_SETTING_IP6_CONFIG_DNS_SEARCH,
+ g_object_bind_property (s_ip6, NM_SETTING_IP_CONFIG_DNS_SEARCH,
widget, "strings",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Search domains"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Search domains"), widget, NULL);
widget = g_object_new (NMT_TYPE_NEWT_LABEL,
"text", "",
"style", NMT_NEWT_LABEL_PLAIN,
NULL);
- g_object_bind_property_full (s_ip6, NM_SETTING_IP6_CONFIG_ROUTES,
+ g_object_bind_property_full (s_ip6, NM_SETTING_IP_CONFIG_ROUTES,
widget, "text",
G_BINDING_SYNC_CREATE,
ip6_routes_transform_to_description,
NULL, NULL, NULL);
button = nmt_newt_button_new (_("Edit..."));
g_signal_connect (button, "clicked", G_CALLBACK (edit_routes), s_ip6);
- nmt_page_grid_append (grid, _("Routing"), widget, button);
+ nmt_editor_grid_append (grid, _("Routing"), widget, button);
widget = nmt_newt_checkbox_new (_("Never use this network for default route"));
- g_object_bind_property (s_ip6, NM_SETTING_IP6_CONFIG_NEVER_DEFAULT,
+ g_object_bind_property (s_ip6, NM_SETTING_IP_CONFIG_NEVER_DEFAULT,
widget, "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
widget = nmt_newt_checkbox_new (_("Require IPv6 addressing for this connection"));
- g_object_bind_property (s_ip6, NM_SETTING_IP6_CONFIG_MAY_FAIL,
+ g_object_bind_property (s_ip6, NM_SETTING_IP_CONFIG_MAY_FAIL,
widget, "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL |
G_BINDING_INVERT_BOOLEAN);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (ip6), section);
G_OBJECT_CLASS (nmt_page_ip6_parent_class)->constructed (object);
}
@@ -196,9 +195,6 @@ static void
nmt_page_ip6_class_init (NmtPageIP6Class *ip6_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (ip6_class);
- NmtEditorPageClass *page_class = NMT_EDITOR_PAGE_CLASS (ip6_class);
object_class->constructed = nmt_page_ip6_constructed;
-
- page_class->show_by_default = nmt_page_ip6_show_by_default;
}
diff --git a/clients/tui/nmt-page-ip6.h b/clients/tui/nmt-page-ip6.h
index 7ea4a578c7..498261e16c 100644
--- a/clients/tui/nmt-page-ip6.h
+++ b/clients/tui/nmt-page-ip6.h
@@ -42,7 +42,7 @@ typedef struct {
GType nmt_page_ip6_get_type (void);
-NmtNewtWidget *nmt_page_ip6_new (NMConnection *conn);
+NmtEditorPage *nmt_page_ip6_new (NMConnection *conn);
G_END_DECLS
diff --git a/clients/tui/nmt-page-main.c b/clients/tui/nmt-page-main.c
deleted file mode 100644
index 93d07dbc6a..0000000000
--- a/clients/tui/nmt-page-main.c
+++ /dev/null
@@ -1,328 +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, see <http://www.gnu.org/licenses/>.
- *
- * Copyright 2013 Red Hat, Inc.
- */
-
-/**
- * SECTION:nmt-page-main
- * @short_description: The top-level #NmtEditorPage for a connection
- *
- * #NmtPageMain is the top-level #NmtEditorPage for a connection. It
- * handles #NMSettingConnection properties, and embeds the other pages
- * within itself.
- */
-
-#include "config.h"
-
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-
-#include <NetworkManager.h>
-
-#include "nmt-page-main.h"
-#include "nmt-device-entry.h"
-#include "nmt-mac-entry.h"
-#include "nmt-mtu-entry.h"
-#include "nmtui.h"
-
-#include "nmt-page-bond.h"
-#include "nmt-page-bridge.h"
-#include "nmt-page-bridge-port.h"
-#include "nmt-page-dsl.h"
-#include "nmt-page-ethernet.h"
-#include "nmt-page-infiniband.h"
-#include "nmt-page-ip4.h"
-#include "nmt-page-ip6.h"
-#include "nmt-page-ppp.h"
-#include "nmt-page-team.h"
-#include "nmt-page-team-port.h"
-#include "nmt-page-vlan.h"
-#include "nmt-page-wifi.h"
-
-G_DEFINE_TYPE (NmtPageMain, nmt_page_main, NMT_TYPE_EDITOR_PAGE)
-
-#define NMT_PAGE_MAIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_MAIN, NmtPageMainPrivate))
-
-typedef struct {
- NMEditorConnectionTypeData *type_data;
-} NmtPageMainPrivate;
-
-enum {
- PROP_0,
-
- PROP_TYPE_DATA,
-
- LAST_PROP
-};
-
-/**
- * nmt_page_main_new:
- * @conn: the #NMConnection to display
- * @type_data: @conn's #NMEditorConnectionTypeData
- *
- * Creates a new #NmtPageMain
- *
- * Returns: a new #NmtPageMain
- */
-NmtNewtWidget *
-nmt_page_main_new (NMConnection *conn,
- NMEditorConnectionTypeData *type_data)
-{
- return g_object_new (NMT_TYPE_PAGE_MAIN,
- "connection", conn,
- "type-data", type_data,
- NULL);
-}
-
-static void
-nmt_page_main_init (NmtPageMain *page)
-{
-}
-
-static gboolean
-permissions_transform_to_allusers (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- char **perms = g_value_get_boxed (source_value);
-
- g_value_set_boolean (target_value, g_strv_length (perms) == 0);
- return TRUE;
-}
-
-static gboolean
-permissions_transform_from_allusers (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer user_data)
-{
- gboolean allusers = g_value_get_boolean (source_value);
- char **perms = NULL;
-
- if (allusers) {
- perms = g_new (char *, 2);
-
- perms[0] = g_strdup_printf ("user:%s:", g_get_user_name ());
- perms[1] = NULL;
- }
- g_value_take_boxed (target_value, perms);
- return TRUE;
-}
-
-static NmtNewtWidget *
-add_section_for_page (NmtPageGrid *grid, NmtNewtWidget *widget)
-{
- NmtEditorPage *page;
- NmtNewtWidget *section, *header, *toggle;
-
- g_return_val_if_fail (NMT_IS_EDITOR_PAGE (widget), NULL);
- g_return_val_if_fail (nmt_newt_widget_get_parent (widget) == NULL, NULL);
-
- page = NMT_EDITOR_PAGE (widget);
-
- section = nmt_newt_section_new (TRUE);
-
- toggle = nmt_newt_toggle_button_new (_("Hide"), _("Show"));
-
- header = nmt_page_grid_new ();
- nmt_page_grid_append (NMT_PAGE_GRID (header),
- nmt_editor_page_get_title (page),
- nmt_editor_page_get_header_widget (page),
- toggle);
- nmt_page_grid_set_row_flags (NMT_PAGE_GRID (header),
- nmt_editor_page_get_header_widget (page),
- NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT |
- NMT_PAGE_GRID_ROW_EXTRA_ALIGN_RIGHT);
- nmt_newt_section_set_header (NMT_NEWT_SECTION (section), header);
-
- nmt_newt_section_set_body (NMT_NEWT_SECTION (section), widget);
-
- g_object_bind_property (toggle, "active",
- section, "open",
- G_BINDING_SYNC_CREATE);
-
- if (nmt_editor_page_show_by_default (page) || !nmt_newt_widget_get_valid (section))
- nmt_newt_toggle_button_set_active (NMT_NEWT_TOGGLE_BUTTON (toggle), TRUE);
-
- nmt_page_grid_append (grid, NULL, section, NULL);
- return section;
-}
-
-static void
-nmt_page_main_constructed (GObject *object)
-{
- NmtPageMain *page_main = NMT_PAGE_MAIN (object);
- NmtPageMainPrivate *priv = NMT_PAGE_MAIN_GET_PRIVATE (page_main);
- NmtPageGrid *grid;
- NMConnection *conn;
- NMSettingConnection *s_con;
- NmtNewtWidget *widget, *section, *separator;
- const char *deventry_label;
- NmtDeviceEntry *deventry;
- GType hardware_type;
- const char *slave_type;
-
- conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (page_main));
- s_con = nm_connection_get_setting_connection (conn);
-
- grid = NMT_PAGE_GRID (page_main);
-
- widget = nmt_newt_entry_new (40, NMT_NEWT_ENTRY_NONEMPTY);
- g_object_bind_property (s_con, NM_SETTING_CONNECTION_ID,
- widget, "text",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Profile name"), widget, NULL);
-
- if (priv->type_data->virtual)
- hardware_type = G_TYPE_NONE;
- else
- hardware_type = priv->type_data->device_type;
-
- /* For connections involving multiple network devices, clarify which one
- * NMSettingConnection:interface-name refers to.
- */
- if (nm_connection_is_type (conn, NM_SETTING_PPPOE_SETTING_NAME))
- deventry_label = _("Ethernet device");
- else
- deventry_label = _("Device");
-
- widget = nmt_device_entry_new (deventry_label, 40, hardware_type);
- nmt_page_grid_append (grid, NULL, widget, NULL);
- deventry = NMT_DEVICE_ENTRY (widget);
- g_object_bind_property (s_con, NM_SETTING_CONNECTION_INTERFACE_NAME,
- deventry, "interface-name",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
-
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
-
- if (nm_connection_is_type (conn, NM_SETTING_BOND_SETTING_NAME))
- add_section_for_page (grid, nmt_page_bond_new (conn, deventry));
- else if (nm_connection_is_type (conn, NM_SETTING_BRIDGE_SETTING_NAME))
- add_section_for_page (grid, nmt_page_bridge_new (conn, deventry));
- else if (nm_connection_is_type (conn, NM_SETTING_INFINIBAND_SETTING_NAME))
- add_section_for_page (grid, nmt_page_infiniband_new (conn, deventry));
- else if (nm_connection_is_type (conn, NM_SETTING_PPPOE_SETTING_NAME)) {
- add_section_for_page (grid, nmt_page_dsl_new (conn));
- add_section_for_page (grid, nmt_page_ethernet_new (conn, deventry));
- add_section_for_page (grid, nmt_page_ppp_new (conn));
- } else if (nm_connection_is_type (conn, NM_SETTING_TEAM_SETTING_NAME))
- add_section_for_page (grid, nmt_page_team_new (conn, deventry));
- else if (nm_connection_is_type (conn, NM_SETTING_VLAN_SETTING_NAME))
- add_section_for_page (grid, nmt_page_vlan_new (conn, deventry));
- else if (nm_connection_is_type (conn, NM_SETTING_WIRED_SETTING_NAME))
- add_section_for_page (grid, nmt_page_ethernet_new (conn, deventry));
- else if (nm_connection_is_type (conn, NM_SETTING_WIRELESS_SETTING_NAME))
- add_section_for_page (grid, nmt_page_wifi_new (conn, deventry));
-
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
-
- slave_type = nm_setting_connection_get_slave_type (s_con);
- if (slave_type) {
- if (!strcmp (slave_type, NM_SETTING_BRIDGE_SETTING_NAME))
- add_section_for_page (grid, nmt_page_bridge_port_new (conn));
- else if (!strcmp (slave_type, NM_SETTING_TEAM_SETTING_NAME))
- add_section_for_page (grid, nmt_page_team_port_new (conn));
- } else {
- section = add_section_for_page (grid, nmt_page_ip4_new (conn));
-
- /* Add a separator between ip4 and ip6 that's only visible if ip4 is open */
- separator = nmt_newt_separator_new ();
- g_object_bind_property (section, "open", separator, "visible", G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, separator, NULL);
-
- add_section_for_page (grid, nmt_page_ip6_new (conn));
-
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
- }
-
- widget = nmt_newt_checkbox_new (_("Automatically connect"));
- g_object_bind_property (s_con, NM_SETTING_CONNECTION_AUTOCONNECT,
- widget, "active",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, widget, NULL);
-
- widget = nmt_newt_checkbox_new (_("Available to all users"));
- g_object_bind_property_full (s_con, NM_SETTING_CONNECTION_PERMISSIONS,
- widget, "active",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
- permissions_transform_to_allusers,
- permissions_transform_from_allusers,
- NULL, NULL);
- nmt_page_grid_append (grid, NULL, widget, NULL);
-
- G_OBJECT_CLASS (nmt_page_main_parent_class)->constructed (object);
-}
-
-static void
-nmt_page_main_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- NmtPageMainPrivate *priv = NMT_PAGE_MAIN_GET_PRIVATE (object);
-
- switch (prop_id) {
- case PROP_TYPE_DATA:
- priv->type_data = g_value_get_pointer (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nmt_page_main_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NmtPageMainPrivate *priv = NMT_PAGE_MAIN_GET_PRIVATE (object);
-
- switch (prop_id) {
- case PROP_TYPE_DATA:
- g_value_set_pointer (value, priv->type_data);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nmt_page_main_class_init (NmtPageMainClass *main_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (main_class);
-
- g_type_class_add_private (main_class, sizeof (NmtPageMainPrivate));
-
- object_class->constructed = nmt_page_main_constructed;
- object_class->set_property = nmt_page_main_set_property;
- object_class->get_property = nmt_page_main_get_property;
-
- /**
- * NmtPageMain:type-data:
- *
- * The page's connection's #NMEditorConnectionTypeData
- */
- g_object_class_install_property
- (object_class, PROP_TYPE_DATA,
- g_param_spec_pointer ("type-data", "", "",
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/clients/tui/nmt-page-main.h b/clients/tui/nmt-page-main.h
deleted file mode 100644
index 20de14f36a..0000000000
--- a/clients/tui/nmt-page-main.h
+++ /dev/null
@@ -1,51 +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, see <http://www.gnu.org/licenses/>.
- *
- * Copyright 2013 Red Hat, Inc.
- */
-
-#ifndef NMT_PAGE_MAIN_H
-#define NMT_PAGE_MAIN_H
-
-#include "nmt-editor-page.h"
-#include "nm-editor-utils.h"
-
-G_BEGIN_DECLS
-
-#define NMT_TYPE_PAGE_MAIN (nmt_page_main_get_type ())
-#define NMT_PAGE_MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_MAIN, NmtPageMain))
-#define NMT_PAGE_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_MAIN, NmtPageMainClass))
-#define NMT_IS_PAGE_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_PAGE_MAIN))
-#define NMT_IS_PAGE_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_PAGE_MAIN))
-#define NMT_PAGE_MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_MAIN, NmtPageMainClass))
-
-typedef struct {
- NmtEditorPage parent;
-
-} NmtPageMain;
-
-typedef struct {
- NmtEditorPageClass parent;
-
-} NmtPageMainClass;
-
-GType nmt_page_main_get_type (void);
-
-NmtNewtWidget *nmt_page_main_new (NMConnection *conn,
- NMEditorConnectionTypeData *type_data);
-
-G_END_DECLS
-
-#endif /* NMT_PAGE_MAIN_H */
diff --git a/clients/tui/nmt-page-ppp.c b/clients/tui/nmt-page-ppp.c
index bf0b84e50b..cec36549dc 100644
--- a/clients/tui/nmt-page-ppp.c
+++ b/clients/tui/nmt-page-ppp.c
@@ -41,12 +41,11 @@ typedef struct {
#define NMT_PAGE_PPP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_PPP, NmtPagePppPrivate))
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_ppp_new (NMConnection *conn)
{
return g_object_new (NMT_TYPE_PAGE_PPP,
"connection", conn,
- "title", _("PPP CONFIGURATION"),
NULL);
}
@@ -111,11 +110,12 @@ nmt_page_ppp_constructed (GObject *object)
{
NmtPagePpp *ppp = NMT_PAGE_PPP (object);
NmtPagePppPrivate *priv = NMT_PAGE_PPP_GET_PRIVATE (ppp);
- NmtPageGrid *grid;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NMSettingPpp *s_ppp;
NmtNewtWidget *widget, *use_mppe;
NmtNewtGrid *auth_grid, *mppe_grid;
- NmtNewtSection *section;
+ NmtNewtSection *auth_section, *mppe_section;
NMConnection *conn;
conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (ppp));
@@ -131,20 +131,21 @@ nmt_page_ppp_constructed (GObject *object)
priv->lcp_echo_failure = 5;
}
- grid = NMT_PAGE_GRID (ppp);
+ section = nmt_editor_section_new (_("PPP CONFIGURATION"), NULL, TRUE);
+ grid = nmt_editor_section_get_body (section);
/* Auth methods */
widget = nmt_newt_section_new (FALSE);
- section = NMT_NEWT_SECTION (widget);
- g_object_set (section, "open", TRUE, NULL);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ auth_section = NMT_NEWT_SECTION (widget);
+ g_object_set (auth_section, "open", TRUE, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
widget = nmt_newt_label_new (_("Allowed authentication methods:"));
- nmt_newt_section_set_header (section, widget);
+ nmt_newt_section_set_header (auth_section, widget);
widget = nmt_newt_grid_new ();
auth_grid = NMT_NEWT_GRID (widget);
- nmt_newt_section_set_body (section, widget);
+ nmt_newt_section_set_body (auth_section, widget);
widget = nmt_newt_checkbox_new (_("EAP"));
g_object_bind_property (s_ppp, NM_SETTING_PPP_REFUSE_EAP,
@@ -186,13 +187,13 @@ nmt_page_ppp_constructed (GObject *object)
G_BINDING_SYNC_CREATE);
nmt_newt_grid_add (auth_grid, widget, 0, 4);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
/* MPPE */
widget = nmt_newt_section_new (FALSE);
- section = NMT_NEWT_SECTION (widget);
- g_object_set (section, "open", TRUE, NULL);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ mppe_section = NMT_NEWT_SECTION (widget);
+ g_object_set (mppe_section, "open", TRUE, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
widget = nmt_newt_checkbox_new (_("Use point-to-point encryption (MPPE)"));
g_object_bind_property (s_ppp, NM_SETTING_PPP_REQUIRE_MPPE,
@@ -200,11 +201,11 @@ nmt_page_ppp_constructed (GObject *object)
G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
use_mppe = widget;
- nmt_newt_section_set_header (section, widget);
+ nmt_newt_section_set_header (mppe_section, widget);
widget = nmt_newt_grid_new ();
mppe_grid = NMT_NEWT_GRID (widget);
- nmt_newt_section_set_body (section, widget);
+ nmt_newt_section_set_body (mppe_section, widget);
widget = nmt_newt_checkbox_new (_("Require 128-bit encryption"));
g_object_bind_property (use_mppe, "active",
@@ -226,7 +227,7 @@ nmt_page_ppp_constructed (GObject *object)
G_BINDING_SYNC_CREATE);
nmt_newt_grid_add (mppe_grid, widget, 0, 1);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
widget = nmt_newt_checkbox_new (_("Allow BSD data compression"));
g_object_bind_property (s_ppp, NM_SETTING_PPP_NOBSDCOMP,
@@ -234,7 +235,7 @@ nmt_page_ppp_constructed (GObject *object)
G_BINDING_BIDIRECTIONAL |
G_BINDING_INVERT_BOOLEAN |
G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
widget = nmt_newt_checkbox_new (_("Allow Deflate data compression"));
g_object_bind_property (s_ppp, NM_SETTING_PPP_NODEFLATE,
@@ -242,7 +243,7 @@ nmt_page_ppp_constructed (GObject *object)
G_BINDING_BIDIRECTIONAL |
G_BINDING_INVERT_BOOLEAN |
G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
widget = nmt_newt_checkbox_new (_("Use TCP header compression"));
g_object_bind_property (s_ppp, NM_SETTING_PPP_NO_VJ_COMP,
@@ -250,9 +251,9 @@ nmt_page_ppp_constructed (GObject *object)
G_BINDING_BIDIRECTIONAL |
G_BINDING_INVERT_BOOLEAN |
G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
widget = nmt_newt_checkbox_new (_("Send PPP echo packets"));
g_object_bind_property_full (s_ppp, NM_SETTING_PPP_LCP_ECHO_INTERVAL,
@@ -269,7 +270,9 @@ nmt_page_ppp_constructed (GObject *object)
transform_lcp_echo_properties_to_checkbox,
transform_checkbox_to_lcp_echo_failure,
ppp, NULL);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (ppp), section);
G_OBJECT_CLASS (nmt_page_ppp_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-ppp.h b/clients/tui/nmt-page-ppp.h
index 4bc04d88f2..79103232f0 100644
--- a/clients/tui/nmt-page-ppp.h
+++ b/clients/tui/nmt-page-ppp.h
@@ -42,7 +42,7 @@ typedef struct {
GType nmt_page_ppp_get_type (void);
-NmtNewtWidget *nmt_page_ppp_new (NMConnection *conn);
+NmtEditorPage *nmt_page_ppp_new (NMConnection *conn);
G_END_DECLS
diff --git a/clients/tui/nmt-page-team-port.c b/clients/tui/nmt-page-team-port.c
index aec6b80394..645dc9d37d 100644
--- a/clients/tui/nmt-page-team-port.c
+++ b/clients/tui/nmt-page-team-port.c
@@ -37,12 +37,11 @@ typedef struct {
} NmtPageTeamPortPrivate;
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_team_port_new (NMConnection *conn)
{
return g_object_new (NMT_TYPE_PAGE_TEAM_PORT,
"connection", conn,
- "title", _("TEAM PORT"),
NULL);
}
@@ -79,6 +78,7 @@ nmt_page_team_port_constructed (GObject *object)
{
NmtPageTeamPort *team = NMT_PAGE_TEAM_PORT (object);
NmtPageTeamPortPrivate *priv = NMT_PAGE_TEAM_PORT_GET_PRIVATE (team);
+ NmtEditorSection *section;
NmtNewtGrid *grid;
NMSettingTeamPort *s_port;
NmtNewtWidget *widget;
@@ -92,8 +92,10 @@ nmt_page_team_port_constructed (GObject *object)
}
priv->s_port = s_port;
+ section = nmt_editor_section_new (_("TEAM PORT"), NULL, TRUE);
+
widget = nmt_newt_grid_new ();
- nmt_page_grid_append (NMT_PAGE_GRID (team), NULL, widget, NULL);
+ nmt_editor_grid_append (nmt_editor_section_get_body (section), NULL, widget, NULL);
grid = NMT_NEWT_GRID (widget);
@@ -111,6 +113,8 @@ nmt_page_team_port_constructed (GObject *object)
g_signal_connect (widget, "clicked", G_CALLBACK (edit_clicked), team);
nmt_newt_grid_add (grid, widget, 0, 4);
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (team), section);
+
G_OBJECT_CLASS (nmt_page_team_port_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-team-port.h b/clients/tui/nmt-page-team-port.h
index d4ec7a557f..2d8fa12183 100644
--- a/clients/tui/nmt-page-team-port.h
+++ b/clients/tui/nmt-page-team-port.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_TEAM_PORT_H
#define NMT_PAGE_TEAM_PORT_H
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -42,7 +42,7 @@ typedef struct {
GType nmt_page_team_port_get_type (void);
-NmtNewtWidget *nmt_page_team_port_new (NMConnection *conn);
+NmtEditorPage *nmt_page_team_port_new (NMConnection *conn);
G_END_DECLS
diff --git a/clients/tui/nmt-page-team.c b/clients/tui/nmt-page-team.c
index 5f0a5a027b..e520b02a3c 100644
--- a/clients/tui/nmt-page-team.c
+++ b/clients/tui/nmt-page-team.c
@@ -30,7 +30,7 @@
#include "nmt-slave-list.h"
-G_DEFINE_TYPE (NmtPageTeam, nmt_page_team, NMT_TYPE_PAGE_DEVICE)
+G_DEFINE_TYPE (NmtPageTeam, nmt_page_team, NMT_TYPE_EDITOR_PAGE_DEVICE)
#define NMT_PAGE_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_TEAM, NmtPageTeamPrivate))
@@ -42,13 +42,12 @@ typedef struct {
} NmtPageTeamPrivate;
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_team_new (NMConnection *conn,
NmtDeviceEntry *deventry)
{
return g_object_new (NMT_TYPE_PAGE_TEAM,
"connection", conn,
- "title", _("TEAM"),
"device-entry", deventry,
NULL);
}
@@ -132,6 +131,7 @@ nmt_page_team_constructed (GObject *object)
{
NmtPageTeam *team = NMT_PAGE_TEAM (object);
NmtPageTeamPrivate *priv = NMT_PAGE_TEAM_GET_PRIVATE (team);
+ NmtEditorSection *section;
NmtNewtGrid *grid;
NMSettingTeam *s_team;
NmtNewtWidget *widget;
@@ -145,8 +145,10 @@ nmt_page_team_constructed (GObject *object)
}
priv->s_team = s_team;
+ section = nmt_editor_section_new (_("TEAM"), NULL, TRUE);
+
widget = nmt_newt_grid_new ();
- nmt_page_grid_append (NMT_PAGE_GRID (team), NULL, widget, NULL);
+ nmt_editor_grid_append (nmt_editor_section_get_body (section), NULL, widget, NULL);
grid = NMT_NEWT_GRID (widget);
@@ -175,6 +177,8 @@ nmt_page_team_constructed (GObject *object)
g_signal_connect (widget, "clicked", G_CALLBACK (edit_clicked), team);
nmt_newt_grid_add (grid, widget, 0, 4);
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (team), section);
+
G_OBJECT_CLASS (nmt_page_team_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-team.h b/clients/tui/nmt-page-team.h
index 49a81dd55e..2d8bf07ad7 100644
--- a/clients/tui/nmt-page-team.h
+++ b/clients/tui/nmt-page-team.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_TEAM_H
#define NMT_PAGE_TEAM_H
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -31,18 +31,18 @@ G_BEGIN_DECLS
#define NMT_PAGE_TEAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_TEAM, NmtPageTeamClass))
typedef struct {
- NmtPageDevice parent;
+ NmtEditorPageDevice parent;
} NmtPageTeam;
typedef struct {
- NmtPageDeviceClass parent;
+ NmtEditorPageDeviceClass parent;
} NmtPageTeamClass;
GType nmt_page_team_get_type (void);
-NmtNewtWidget *nmt_page_team_new (NMConnection *conn,
+NmtEditorPage *nmt_page_team_new (NMConnection *conn,
NmtDeviceEntry *deventry);
G_END_DECLS
diff --git a/clients/tui/nmt-page-vlan.c b/clients/tui/nmt-page-vlan.c
index af80b7387d..9b9c8f52af 100644
--- a/clients/tui/nmt-page-vlan.c
+++ b/clients/tui/nmt-page-vlan.c
@@ -33,7 +33,7 @@
#include "nmt-mac-entry.h"
#include "nmt-mtu-entry.h"
-G_DEFINE_TYPE (NmtPageVlan, nmt_page_vlan, NMT_TYPE_PAGE_DEVICE)
+G_DEFINE_TYPE (NmtPageVlan, nmt_page_vlan, NMT_TYPE_EDITOR_PAGE_DEVICE)
#define NMT_PAGE_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_VLAN, NmtPageVlanPrivate))
@@ -42,13 +42,12 @@ typedef struct {
} NmtPageVlanPrivate;
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_vlan_new (NMConnection *conn,
NmtDeviceEntry *deventry)
{
return g_object_new (NMT_TYPE_PAGE_VLAN,
"connection", conn,
- "title", _("VLAN"),
"device-entry", deventry,
NULL);
}
@@ -72,7 +71,8 @@ nmt_page_vlan_constructed (GObject *object)
{
NmtPageVlan *vlan = NMT_PAGE_VLAN (object);
NmtPageVlanPrivate *priv = NMT_PAGE_VLAN_GET_PRIVATE (vlan);
- NmtPageGrid *grid;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NMSettingWired *s_wired;
NMSettingVlan *s_vlan;
NmtNewtWidget *widget, *parent, *id_entry;
@@ -94,7 +94,8 @@ nmt_page_vlan_constructed (GObject *object)
}
priv->s_wired = g_object_ref_sink (s_wired);
- grid = NMT_PAGE_GRID (vlan);
+ section = nmt_editor_section_new (_("VLAN"), NULL, TRUE);
+ grid = nmt_editor_section_get_body (section);
nm_editor_bind_vlan_name (s_vlan, nm_connection_get_setting_connection (conn));
@@ -107,27 +108,29 @@ nmt_page_vlan_constructed (GObject *object)
g_object_bind_property (s_wired, NM_SETTING_WIRED_MAC_ADDRESS,
widget, "mac-address",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, widget, NULL);
+ nmt_editor_grid_append (grid, NULL, widget, NULL);
widget = id_entry = nmt_newt_entry_numeric_new (8, 0, 4095);
g_object_bind_property (s_vlan, NM_SETTING_VLAN_ID,
widget, "text",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("VLAN id"), widget, NULL);
+ nmt_editor_grid_append (grid, _("VLAN id"), widget, NULL);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
widget = nmt_mac_entry_new (40, ETH_ALEN);
g_object_bind_property (s_wired, NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
widget, "mac-address",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Cloned MAC address"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Cloned MAC address"), widget, NULL);
widget = nmt_mtu_entry_new ();
g_object_bind_property (s_wired, NM_SETTING_WIRED_MTU,
widget, "mtu",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("MTU"), widget, NULL);
+ nmt_editor_grid_append (grid, _("MTU"), widget, NULL);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (vlan), section);
G_OBJECT_CLASS (nmt_page_vlan_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-vlan.h b/clients/tui/nmt-page-vlan.h
index 57d0024388..db7c40981b 100644
--- a/clients/tui/nmt-page-vlan.h
+++ b/clients/tui/nmt-page-vlan.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_VLAN_H
#define NMT_PAGE_VLAN_H
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -31,18 +31,18 @@ G_BEGIN_DECLS
#define NMT_PAGE_VLAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_VLAN, NmtPageVlanClass))
typedef struct {
- NmtPageDevice parent;
+ NmtEditorPageDevice parent;
} NmtPageVlan;
typedef struct {
- NmtPageDeviceClass parent;
+ NmtEditorPageDeviceClass parent;
} NmtPageVlanClass;
GType nmt_page_vlan_get_type (void);
-NmtNewtWidget *nmt_page_vlan_new (NMConnection *conn,
+NmtEditorPage *nmt_page_vlan_new (NMConnection *conn,
NmtDeviceEntry *deventry);
G_END_DECLS
diff --git a/clients/tui/nmt-page-wifi.c b/clients/tui/nmt-page-wifi.c
index f0ecc3572e..9cd20abf32 100644
--- a/clients/tui/nmt-page-wifi.c
+++ b/clients/tui/nmt-page-wifi.c
@@ -39,7 +39,7 @@
#include "nm-editor-bindings.h"
-G_DEFINE_TYPE (NmtPageWifi, nmt_page_wifi, NMT_TYPE_PAGE_DEVICE)
+G_DEFINE_TYPE (NmtPageWifi, nmt_page_wifi, NMT_TYPE_EDITOR_PAGE_DEVICE)
#define NMT_PAGE_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_WIFI, NmtPageWifiPrivate))
@@ -48,13 +48,12 @@ typedef struct {
} NmtPageWifiPrivate;
-NmtNewtWidget *
+NmtEditorPage *
nmt_page_wifi_new (NMConnection *conn,
NmtDeviceEntry *deventry)
{
return g_object_new (NMT_TYPE_PAGE_WIFI,
"connection", conn,
- "title", _("WI-FI"),
"device-entry", deventry,
NULL);
}
@@ -184,7 +183,8 @@ nmt_page_wifi_constructed (GObject *object)
NmtPageWifiPrivate *priv = NMT_PAGE_WIFI_GET_PRIVATE (object);
NmtPageWifi *wifi = NMT_PAGE_WIFI (object);
NmtDeviceEntry *deventry;
- NmtPageGrid *grid;
+ NmtEditorSection *section;
+ NmtEditorGrid *grid;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
NmtNewtWidget *widget, *hbox, *subgrid;
@@ -209,12 +209,13 @@ nmt_page_wifi_constructed (GObject *object)
}
priv->s_wsec = g_object_ref_sink (s_wsec);
- deventry = nmt_page_device_get_device_entry (NMT_PAGE_DEVICE (object));
+ deventry = nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (object));
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_MAC_ADDRESS,
deventry, "mac-address",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- grid = NMT_PAGE_GRID (wifi);
+ section = nmt_editor_section_new (_("WI-FI"), NULL, TRUE);
+ grid = nmt_editor_section_get_body (section);
widget = nmt_newt_entry_new (40, NMT_NEWT_ENTRY_NONEMPTY);
g_object_bind_property_full (s_wireless, NM_SETTING_WIRELESS_SSID,
@@ -223,13 +224,13 @@ nmt_page_wifi_constructed (GObject *object)
ssid_transform_to_entry,
ssid_transform_from_entry,
s_wireless, NULL);
- nmt_page_grid_append (grid, _("SSID"), widget, NULL);
+ nmt_editor_grid_append (grid, _("SSID"), widget, NULL);
widget = nmt_newt_popup_new (wifi_mode);
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_MODE,
widget, "active-id",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Mode"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Mode"), widget, NULL);
mode = widget;
hbox = nmt_newt_grid_new ();
@@ -255,28 +256,28 @@ nmt_page_wifi_constructed (GObject *object)
G_BINDING_SYNC_CREATE,
mode_transform_to_band_visibility,
NULL, NULL, NULL);
- nmt_page_grid_append (grid, _("Channel"), hbox, NULL);
+ nmt_editor_grid_append (grid, _("Channel"), hbox, NULL);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
widget = nmt_newt_popup_new (wifi_security);
- nmt_page_grid_append (grid, _("Security"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Security"), widget, NULL);
security = widget;
widget = nmt_newt_stack_new ();
stack = NMT_NEWT_STACK (widget);
/* none */
- subgrid = nmt_page_grid_new ();
+ subgrid = nmt_editor_grid_new ();
nmt_newt_stack_add (stack, "none", subgrid);
/* wpa-personal */
- subgrid = nmt_page_grid_new ();
+ subgrid = nmt_editor_grid_new ();
widget = nmt_password_fields_new (40, NMT_PASSWORD_FIELDS_SHOW_PASSWORD);
g_object_bind_property (s_wsec, NM_SETTING_WIRELESS_SECURITY_PSK,
widget, "password",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Password"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Password"), widget, NULL);
nmt_newt_stack_add (stack, "wpa-personal", subgrid);
/* "wpa-enterprise" */
@@ -285,13 +286,13 @@ nmt_page_wifi_constructed (GObject *object)
nmt_newt_stack_add (stack, "wpa-enterprise", widget);
/* wep-key */
- subgrid = nmt_page_grid_new ();
+ subgrid = nmt_editor_grid_new ();
widget = entry = nmt_password_fields_new (40, NMT_PASSWORD_FIELDS_SHOW_PASSWORD);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Key"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Key"), widget, NULL);
widget = nmt_newt_popup_new (wep_index);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("WEP index"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("WEP index"), widget, NULL);
nm_editor_bind_wireless_security_wep_key (s_wsec,
entry, "password",
@@ -299,18 +300,18 @@ nmt_page_wifi_constructed (GObject *object)
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
widget = nmt_newt_popup_new (wep_auth);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Authentication"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Authentication"), widget, NULL);
nmt_newt_stack_add (stack, "wep-key", subgrid);
/* wep-passphrase */
- subgrid = nmt_page_grid_new ();
+ subgrid = nmt_editor_grid_new ();
widget = entry = nmt_password_fields_new (40, NMT_PASSWORD_FIELDS_SHOW_PASSWORD);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Password"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Password"), widget, NULL);
widget = nmt_newt_popup_new (wep_index);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("WEP index"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("WEP index"), widget, NULL);
nm_editor_bind_wireless_security_wep_key (s_wsec,
entry, "password",
@@ -318,7 +319,7 @@ nmt_page_wifi_constructed (GObject *object)
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
widget = nmt_newt_popup_new (wep_auth);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Authentication"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Authentication"), widget, NULL);
nmt_newt_stack_add (stack, "wep-passphrase", subgrid);
@@ -328,10 +329,10 @@ nmt_page_wifi_constructed (GObject *object)
nmt_newt_stack_add (stack, "dynamic-wep", widget);
/* leap */
- subgrid = nmt_page_grid_new ();
+ subgrid = nmt_editor_grid_new ();
widget = nmt_newt_entry_new (40, NMT_NEWT_ENTRY_NONEMPTY);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Username"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Username"), widget, NULL);
g_object_bind_property (s_wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME,
widget, "text",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
@@ -340,36 +341,38 @@ nmt_page_wifi_constructed (GObject *object)
g_object_bind_property (s_wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD,
widget, "password",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
- nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Password"), widget, NULL);
+ nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Password"), widget, NULL);
nmt_newt_stack_add (stack, "leap", subgrid);
- nmt_page_grid_append (grid, NULL, NMT_NEWT_WIDGET (stack), NULL);
+ nmt_editor_grid_append (grid, NULL, NMT_NEWT_WIDGET (stack), NULL);
g_object_bind_property (security, "active-id",
stack, "active-id",
G_BINDING_SYNC_CREATE);
nm_editor_bind_wireless_security_method (conn, s_wsec, security, "active-id",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
+ nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
widget = nmt_mac_entry_new (40, ETH_ALEN);
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_BSSID,
widget, "mac-address",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("BSSID"), widget, NULL);
+ nmt_editor_grid_append (grid, _("BSSID"), widget, NULL);
widget = nmt_mac_entry_new (40, ETH_ALEN);
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS,
widget, "mac-address",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("Cloned MAC address"), widget, NULL);
+ nmt_editor_grid_append (grid, _("Cloned MAC address"), widget, NULL);
widget = nmt_mtu_entry_new ();
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_MTU,
widget, "mtu",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- nmt_page_grid_append (grid, _("MTU"), widget, NULL);
+ nmt_editor_grid_append (grid, _("MTU"), widget, NULL);
+
+ nmt_editor_page_add_section (NMT_EDITOR_PAGE (wifi), section);
G_OBJECT_CLASS (nmt_page_wifi_parent_class)->constructed (object);
}
diff --git a/clients/tui/nmt-page-wifi.h b/clients/tui/nmt-page-wifi.h
index 06cb2a9805..7ce5058462 100644
--- a/clients/tui/nmt-page-wifi.h
+++ b/clients/tui/nmt-page-wifi.h
@@ -19,7 +19,7 @@
#ifndef NMT_PAGE_WIFI_H
#define NMT_PAGE_WIFI_H
-#include "nmt-page-device.h"
+#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
@@ -31,18 +31,18 @@ G_BEGIN_DECLS
#define NMT_PAGE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_WIFI, NmtPageWifiClass))
typedef struct {
- NmtPageDevice parent;
+ NmtEditorPageDevice parent;
} NmtPageWifi;
typedef struct {
- NmtPageDeviceClass parent;
+ NmtEditorPageDeviceClass parent;
} NmtPageWifiClass;
GType nmt_page_wifi_get_type (void);
-NmtNewtWidget *nmt_page_wifi_new (NMConnection *conn,
+NmtEditorPage *nmt_page_wifi_new (NMConnection *conn,
NmtDeviceEntry *deventry);
G_END_DECLS
diff --git a/clients/tui/nmt-password-dialog.c b/clients/tui/nmt-password-dialog.c
index 22ba85d2c5..aeece1211f 100644
--- a/clients/tui/nmt-password-dialog.c
+++ b/clients/tui/nmt-password-dialog.c
@@ -29,7 +29,7 @@
#include <glib/gi18n-lib.h>
#include "nmt-password-dialog.h"
-#include "nmt-secret-agent.h"
+#include "nm-secret-agent-simple.h"
#include "nmtui.h"
G_DEFINE_TYPE (NmtPasswordDialog, nmt_password_dialog, NMT_TYPE_NEWT_FORM)
@@ -60,10 +60,10 @@ enum {
/**
* nmt_password_dialog_new:
- * @request_id: the request ID from the #NmtSecretAgent
+ * @request_id: the request ID from the #NMSecretAgentSimple
* @title: the dialog title
* @prompt: the prompt text to display
- * @secrets: (element-type #NmtSecretAgentSecret): the secrets requested
+ * @secrets: (element-type #NMSecretAgentSimpleSecret): the secrets requested
*
* Creates a new #NmtPasswordDialog to request passwords from
* the user.
@@ -109,7 +109,7 @@ maybe_save_input_and_exit (NmtNewtWidget *widget,
priv->succeeded = TRUE;
for (i = 0; i < priv->secrets->len; i++) {
- NmtSecretAgentSecret *secret = priv->secrets->pdata[i];
+ NMSecretAgentSimpleSecret *secret = priv->secrets->pdata[i];
g_free (secret->value);
g_object_get (priv->entries->pdata[i], "text", &secret->value, NULL);
@@ -143,7 +143,7 @@ nmt_password_dialog_constructed (GObject *object)
secret_grid = NMT_NEWT_GRID (widget);
for (i = 0; i < priv->secrets->len; i++) {
- NmtSecretAgentSecret *secret = priv->secrets->pdata[i];
+ NMSecretAgentSimpleSecret *secret = priv->secrets->pdata[i];
NmtNewtEntryFlags flags;
widget = nmt_newt_label_new (secret->name);
@@ -258,7 +258,7 @@ nmt_password_dialog_class_init (NmtPasswordDialogClass *dialog_class)
/**
* NmtPasswordDialog:request-id:
*
- * The request ID from the #NmtSecretAgent
+ * The request ID from the #NMSecretAgentSimple
*/
g_object_class_install_property
(object_class, PROP_REQUEST_ID,
@@ -284,7 +284,7 @@ nmt_password_dialog_class_init (NmtPasswordDialogClass *dialog_class)
*
* The array of request secrets
*
- * Element-Type: #NmtSecretAgentSecret.
+ * Element-Type: #NMSecretAgentSimpleSecret.
*/
g_object_class_install_property
(object_class, PROP_SECRETS,
diff --git a/clients/tui/nmt-route-editor.c b/clients/tui/nmt-route-editor.c
index 98fd9ccbb6..77bbec76de 100644
--- a/clients/tui/nmt-route-editor.c
+++ b/clients/tui/nmt-route-editor.c
@@ -77,21 +77,15 @@ save_routes_and_exit (NmtNewtButton *button,
{
NmtRouteEditor *editor = user_data;
NmtRouteEditorPrivate *priv = NMT_ROUTE_EDITOR_GET_PRIVATE (editor);
- const char *property;
- GBinding *binding;
+ GPtrArray *routes;
- if (NM_IS_SETTING_IP4_CONFIG (priv->edit_setting))
- property = NM_SETTING_IP4_CONFIG_ROUTES;
- else
- property = NM_SETTING_IP6_CONFIG_ROUTES;
-
- /* Because of the complicated dbus-glib GTypes, it's easier to cheat
- * and use GBinding to do this than it is to copy the value by hand.
- */
- binding = g_object_bind_property (priv->edit_setting, property,
- priv->orig_setting, property,
- G_BINDING_SYNC_CREATE);
- g_object_unref (binding);
+ g_object_get (priv->edit_setting,
+ NM_SETTING_IP_CONFIG_ROUTES, &routes,
+ NULL);
+ g_object_set (priv->orig_setting,
+ NM_SETTING_IP_CONFIG_ROUTES, routes,
+ NULL);
+ g_ptr_array_unref (routes);
nmt_newt_form_quit (NMT_NEWT_FORM (editor));
}
@@ -106,17 +100,13 @@ nmt_route_editor_constructed (GObject *object)
if (G_OBJECT_CLASS (nmt_route_editor_parent_class)->constructed)
G_OBJECT_CLASS (nmt_route_editor_parent_class)->constructed (object);
- if (NM_IS_SETTING_IP4_CONFIG (priv->edit_setting)) {
+ if (NM_IS_SETTING_IP4_CONFIG (priv->edit_setting))
routes = nmt_route_table_new (AF_INET);
- g_object_bind_property (priv->edit_setting, NM_SETTING_IP4_CONFIG_ROUTES,
- routes, "ip4-routes",
- G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
- } else {
+ else
routes = nmt_route_table_new (AF_INET6);
- g_object_bind_property (priv->edit_setting, NM_SETTING_IP6_CONFIG_ROUTES,
- routes, "ip6-routes",
- G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
- }
+ g_object_bind_property (priv->edit_setting, NM_SETTING_IP_CONFIG_ROUTES,
+ routes, "routes",
+ G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
vbox = nmt_newt_grid_new ();
nmt_newt_grid_add (NMT_NEWT_GRID (vbox), routes, 0, 0);
diff --git a/clients/tui/nmt-route-entry.c b/clients/tui/nmt-route-entry.c
index 9b22f389dc..3a87552089 100644
--- a/clients/tui/nmt-route-entry.c
+++ b/clients/tui/nmt-route-entry.c
@@ -49,8 +49,7 @@ typedef struct {
int family;
int ip_entry_width, metric_entry_width;
- NMIP4Route *ip4_route;
- NMIP6Route *ip6_route;
+ NMIPRoute *route;
} NmtRouteEntryPrivate;
enum {
@@ -58,8 +57,7 @@ enum {
PROP_FAMILY,
PROP_IP_ENTRY_WIDTH,
PROP_METRIC_ENTRY_WIDTH,
- PROP_IP4_ROUTE,
- PROP_IP6_ROUTE,
+ PROP_ROUTE,
LAST_PROP
};
@@ -143,20 +141,12 @@ nmt_route_entry_constructed (GObject *object)
nmt_newt_grid_add (grid, priv->metric, 4, 0);
nmt_newt_widget_set_padding (priv->metric, 1, 0, 0, 0);
- if (priv->family == AF_INET) {
- nm_editor_bind_ip4_route_to_strings (object, "ip4-route",
- priv->dest, "text",
- priv->next_hop, "text",
- priv->metric, "text",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- } else if (priv->family == AF_INET6) {
- nm_editor_bind_ip6_route_to_strings (object, "ip6-route",
- priv->dest, "text",
- priv->next_hop, "text",
- priv->metric, "text",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
- } else
- g_assert_not_reached ();
+ nm_editor_bind_ip_route_to_strings (priv->family,
+ object, "route",
+ priv->dest, "text",
+ priv->next_hop, "text",
+ priv->metric, "text",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
G_OBJECT_CLASS (nmt_route_entry_parent_class)->constructed (object);
}
@@ -174,8 +164,7 @@ nmt_route_entry_finalize (GObject *object)
{
NmtRouteEntryPrivate *priv = NMT_ROUTE_ENTRY_GET_PRIVATE (object);
- g_clear_pointer (&priv->ip4_route, nm_ip4_route_unref);
- g_clear_pointer (&priv->ip6_route, nm_ip6_route_unref);
+ g_clear_pointer (&priv->route, nm_ip_route_unref);
G_OBJECT_CLASS (nmt_route_entry_parent_class)->finalize (object);
}
@@ -198,17 +187,10 @@ nmt_route_entry_set_property (GObject *object,
case PROP_METRIC_ENTRY_WIDTH:
priv->metric_entry_width = g_value_get_int (value);
break;
- case PROP_IP4_ROUTE:
- g_return_if_fail (priv->family == AF_INET);
- if (priv->ip4_route)
- nm_ip4_route_unref (priv->ip4_route);
- priv->ip4_route = g_value_dup_boxed (value);
- break;
- case PROP_IP6_ROUTE:
- g_return_if_fail (priv->family == AF_INET6);
- if (priv->ip6_route)
- nm_ip6_route_unref (priv->ip6_route);
- priv->ip6_route = g_value_dup_boxed (value);
+ case PROP_ROUTE:
+ if (priv->route)
+ nm_ip_route_unref (priv->route);
+ priv->route = g_value_dup_boxed (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -234,13 +216,8 @@ nmt_route_entry_get_property (GObject *object,
case PROP_METRIC_ENTRY_WIDTH:
g_value_set_int (value, priv->metric_entry_width);
break;
- case PROP_IP4_ROUTE:
- g_return_if_fail (priv->family == AF_INET);
- g_value_set_boxed (value, priv->ip4_route);
- break;
- case PROP_IP6_ROUTE:
- g_return_if_fail (priv->family == AF_INET6);
- g_value_set_boxed (value, priv->ip6_route);
+ case PROP_ROUTE:
+ g_value_set_boxed (value, priv->route);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -301,27 +278,14 @@ nmt_route_entry_class_init (NmtRouteEntryClass *entry_class)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
/**
- * NmtRouteEntry:ip4-route:
- *
- * The contents of the entries, as an #NMIP4Route. Only valid
- * if #NmtRouteEntry:family is %AF_INET.
- */
- g_object_class_install_property
- (object_class, PROP_IP4_ROUTE,
- g_param_spec_boxed ("ip4-route", "", "",
- nm_ip4_route_get_type (),
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
- /**
- * NmtRouteEntry:ip6-route:
+ * NmtRouteEntry:route:
*
- * The contents of the entries, as an #NMIP6Route. Only valid
- * if #NmtRouteEntry:family is %AF_INET6.
+ * The contents of the entries, as an #NMIPRoute.
*/
g_object_class_install_property
- (object_class, PROP_IP6_ROUTE,
- g_param_spec_boxed ("ip6-route", "", "",
- nm_ip6_route_get_type (),
+ (object_class, PROP_ROUTE,
+ g_param_spec_boxed ("route", "", "",
+ nm_ip_route_get_type (),
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
}
diff --git a/clients/tui/nmt-route-table.c b/clients/tui/nmt-route-table.c
index 023928c34f..523d8ee32a 100644
--- a/clients/tui/nmt-route-table.c
+++ b/clients/tui/nmt-route-table.c
@@ -54,8 +54,7 @@ typedef struct {
enum {
PROP_0,
PROP_FAMILY,
- PROP_IP4_ROUTES,
- PROP_IP6_ROUTES,
+ PROP_ROUTES,
LAST_PROP
};
@@ -85,7 +84,7 @@ route_list_transform_to_route (GBinding *binding,
NmtRouteTable *table = NMT_ROUTE_TABLE (g_binding_get_source (binding));
NmtRouteTablePrivate *priv = NMT_ROUTE_TABLE_GET_PRIVATE (table);
int n = GPOINTER_TO_INT (user_data);
- gpointer route;
+ NMIPRoute *route;
if (n >= priv->routes->len)
return FALSE;
@@ -105,24 +104,17 @@ route_list_transform_from_route (GBinding *binding,
NmtRouteTablePrivate *priv = NMT_ROUTE_TABLE_GET_PRIVATE (table);
int n = GPOINTER_TO_INT (user_data);
GPtrArray *routes;
- gpointer route;
+ NMIPRoute *route;
if (n >= priv->routes->len)
return FALSE;
route = priv->routes->pdata[n];
routes = priv->routes;
- if (priv->family == AF_INET)
- priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip4_route_unref);
- else
- priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip6_route_unref);
+ priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref);
- if (route) {
- if (priv->family == AF_INET)
- nm_ip4_route_unref (route);
- else if (priv->family == AF_INET6)
- nm_ip6_route_unref (route);
- }
+ if (route)
+ nm_ip_route_unref (route);
routes->pdata[n] = g_value_dup_boxed (source_value);
g_value_take_boxed (target_value, routes);
@@ -141,21 +133,12 @@ create_route_entry (NmtWidgetList *list,
priv->ip_entry_width,
priv->metric_entry_width);
- if (priv->family == AF_INET) {
- g_object_bind_property_full (table, "ip4-routes",
- entry, "ip4-route",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
- route_list_transform_to_route,
- route_list_transform_from_route,
- GINT_TO_POINTER (num), NULL);
- } else {
- g_object_bind_property_full (table, "ip6-routes",
- entry, "ip6-route",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
- route_list_transform_to_route,
- route_list_transform_from_route,
- GINT_TO_POINTER (num), NULL);
- }
+ g_object_bind_property_full (table, "routes",
+ entry, "route",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
+ route_list_transform_to_route,
+ route_list_transform_from_route,
+ GINT_TO_POINTER (num), NULL);
return entry;
}
@@ -164,24 +147,15 @@ add_route (NmtWidgetList *list,
gpointer table)
{
NmtRouteTablePrivate *priv = NMT_ROUTE_TABLE_GET_PRIVATE (table);
+ NMIPRoute *route;
- if (priv->family == AF_INET) {
- NMIP4Route *route;
-
- route = nm_ip4_route_new ();
- nm_ip4_route_set_prefix (route, 32);
- g_ptr_array_add (priv->routes, route);
- nmt_widget_list_set_length (list, priv->routes->len);
- g_object_notify (table, "ip4-routes");
- } else {
- NMIP6Route *route;
-
- route = nm_ip6_route_new ();
- nm_ip6_route_set_prefix (route, 128);
- g_ptr_array_add (priv->routes, route);
- nmt_widget_list_set_length (list, priv->routes->len);
- g_object_notify (table, "ip6-routes");
- }
+ if (priv->family == AF_INET)
+ route = nm_ip_route_new (AF_INET, "0.0.0.0", 32, NULL, 0, NULL);
+ else
+ route = nm_ip_route_new (AF_INET6, "::", 128, NULL, 0, NULL);
+ g_ptr_array_add (priv->routes, route);
+ nmt_widget_list_set_length (list, priv->routes->len);
+ g_object_notify (table, "routes");
}
static void
@@ -190,7 +164,7 @@ remove_route (NmtWidgetList *list,
gpointer table)
{
NmtRouteTablePrivate *priv = NMT_ROUTE_TABLE_GET_PRIVATE (table);
- gpointer route;
+ NMIPRoute *route;
if (num >= priv->routes->len)
return;
@@ -199,10 +173,7 @@ remove_route (NmtWidgetList *list,
g_ptr_array_remove_index (priv->routes, num);
nmt_widget_list_set_length (list, priv->routes->len);
- if (priv->family == AF_INET)
- g_object_notify (table, "ip4-routes");
- else
- g_object_notify (table, "ip6-routes");
+ g_object_notify (table, "routes");
}
static void
@@ -214,6 +185,8 @@ nmt_route_table_init (NmtRouteTable *table)
int dest_prefix_width, next_hop_width, metric_width;
char *text;
+ priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref);
+
header = nmt_newt_grid_new ();
text = g_strdup_printf ("%s/%s", _("Destination"), _("Prefix"));
@@ -283,27 +256,12 @@ nmt_route_table_set_property (GObject *object,
switch (prop_id) {
case PROP_FAMILY:
priv->family = g_value_get_int (value);
- if (priv->family == AF_INET)
- priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip4_route_unref);
- else
- priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip6_route_unref);
- break;
- case PROP_IP4_ROUTES:
- g_return_if_fail (priv->family == AF_INET);
- array = g_value_get_boxed (value);
- g_ptr_array_set_size (priv->routes, 0);
- for (i = 0; i < array->len; i++) {
- nm_ip4_route_ref (array->pdata[i]);
- g_ptr_array_add (priv->routes, array->pdata[i]);
- }
- nmt_widget_list_set_length (NMT_WIDGET_LIST (priv->list), priv->routes->len);
break;
- case PROP_IP6_ROUTES:
- g_return_if_fail (priv->family == AF_INET6);
+ case PROP_ROUTES:
array = g_value_get_boxed (value);
g_ptr_array_set_size (priv->routes, 0);
for (i = 0; i < array->len; i++) {
- nm_ip6_route_ref (array->pdata[i]);
+ nm_ip_route_ref (array->pdata[i]);
g_ptr_array_add (priv->routes, array->pdata[i]);
}
nmt_widget_list_set_length (NMT_WIDGET_LIST (priv->list), priv->routes->len);
@@ -326,12 +284,7 @@ nmt_route_table_get_property (GObject *object,
case PROP_FAMILY:
g_value_set_int (value, priv->family);
break;
- case PROP_IP4_ROUTES:
- g_return_if_fail (priv->family == AF_INET);
- g_value_set_boxed (value, priv->routes);
- break;
- case PROP_IP6_ROUTES:
- g_return_if_fail (priv->family == AF_INET6);
+ case PROP_ROUTES:
g_value_set_boxed (value, priv->routes);
break;
default:
@@ -365,34 +318,16 @@ nmt_route_table_class_init (NmtRouteTableClass *table_class)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
/**
- * NmtRouteTable:ip4-routes:
- *
- * The array of routes, suitable for binding to
- * #NMSettingIP4Config:routes.
- *
- * Only valid if #NmtRouteTable:family is %AF_INET
- *
- * Element-type: NMIP4Route
- */
- g_object_class_install_property
- (object_class, PROP_IP4_ROUTES,
- g_param_spec_boxed ("ip4-routes", "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
- /**
- * NmtRouteTable:ip6-routes:
- *
- * The array of routes, suitable for binding to
- * #NMSettingIP6Config:routes.
+ * NmtRouteTable:routes:
*
- * Only valid if #NmtRouteTable:family is %AF_INET6
+ * The array of routes, suitable for binding to #NMSettingIP4Config:routes
+ * or #NMSettingIP6Config:routes.
*
- * Element-type: NMIP6Route
+ * Element-type: NMIPRoute
*/
g_object_class_install_property
- (object_class, PROP_IP6_ROUTES,
- g_param_spec_boxed ("ip6-routes", "", "",
+ (object_class, PROP_ROUTES,
+ g_param_spec_boxed ("routes", "", "",
G_TYPE_PTR_ARRAY,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
diff --git a/clients/tui/nmt-secret-agent.h b/clients/tui/nmt-secret-agent.h
deleted file mode 100644
index e7f6ef846b..0000000000
--- a/clients/tui/nmt-secret-agent.h
+++ /dev/null
@@ -1,57 +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, see <http://www.gnu.org/licenses/>.
- *
- * Copyright 2013 Red Hat, Inc.
- */
-
-#ifndef NMT_SECRET_AGENT_H
-#define NMT_SECRET_AGENT_H
-
-#include <NetworkManager.h>
-
-G_BEGIN_DECLS
-
-#define NMT_TYPE_SECRET_AGENT (nmt_secret_agent_get_type ())
-#define NMT_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_SECRET_AGENT, NmtSecretAgent))
-#define NMT_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_SECRET_AGENT, NmtSecretAgentClass))
-#define NMT_IS_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_SECRET_AGENT))
-#define NMT_IS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_SECRET_AGENT))
-#define NMT_SECRET_AGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_SECRET_AGENT, NmtSecretAgentClass))
-
-typedef struct {
- NMSecretAgent parent;
-
-} NmtSecretAgent;
-
-typedef struct {
- NMSecretAgentClass parent;
-
-} NmtSecretAgentClass;
-
-typedef struct {
- char *name, *value;
- gboolean password;
-} NmtSecretAgentSecret;
-
-GType nmt_secret_agent_get_type (void);
-
-NMSecretAgent *nmt_secret_agent_new (void);
-void nmt_secret_agent_response (NmtSecretAgent *self,
- const char *request_id,
- GPtrArray *secrets);
-
-G_END_DECLS
-
-#endif /* NMT_SECRET_AGENT_H */
diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c
index be03796986..438915d2a6 100644
--- a/clients/tui/nmtui-connect.c
+++ b/clients/tui/nmtui-connect.c
@@ -36,16 +36,16 @@
#include "nmtui-connect.h"
#include "nmt-connect-connection-list.h"
#include "nmt-password-dialog.h"
-#include "nmt-secret-agent.h"
+#include "nm-secret-agent-simple.h"
#include "nmt-utils.h"
static void
-secrets_requested (NmtSecretAgent *agent,
- const char *request_id,
- const char *title,
- const char *msg,
- GPtrArray *secrets,
- gpointer user_data)
+secrets_requested (NMSecretAgentSimple *agent,
+ const char *request_id,
+ const char *title,
+ const char *msg,
+ GPtrArray *secrets,
+ gpointer user_data)
{
NmtNewtForm *form;
@@ -53,9 +53,9 @@ secrets_requested (NmtSecretAgent *agent,
nmt_newt_form_run_sync (form);
if (nmt_password_dialog_succeeded (NMT_PASSWORD_DIALOG (form)))
- nmt_secret_agent_response (agent, request_id, secrets);
+ nm_secret_agent_simple_response (agent, request_id, secrets);
else
- nmt_secret_agent_response (agent, request_id, NULL);
+ nm_secret_agent_simple_response (agent, request_id, NULL);
g_object_unref (form);
}
@@ -132,7 +132,7 @@ activate_connection (NMConnection *connection,
NMObject *specific_object)
{
NmtNewtForm *form;
- NMSecretAgent *agent;
+ NMSecretAgentOld *agent;
NmtNewtWidget *label;
NmtSyncOp op;
const char *specific_object_path;
@@ -145,8 +145,14 @@ activate_connection (NMConnection *connection,
label = nmt_newt_label_new (_("Connecting..."));
nmt_newt_form_set_content (form, label);
- agent = nmt_secret_agent_new ();
- g_signal_connect (agent, "request-secrets", G_CALLBACK (secrets_requested), NULL);
+ agent = nm_secret_agent_simple_new ("nmtui");
+ if (agent) {
+ if (connection) {
+ nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (agent),
+ nm_object_get_path (NM_OBJECT (connection)));
+ }
+ g_signal_connect (agent, "request-secrets", G_CALLBACK (secrets_requested), NULL);
+ }
specific_object_path = specific_object ? nm_object_get_path (specific_object) : NULL;
@@ -182,6 +188,14 @@ activate_connection (NMConnection *connection,
goto done;
}
+ if (!connection) {
+ connection = NM_CONNECTION (nm_active_connection_get_connection (ac));
+ if (connection) {
+ nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (agent),
+ nm_object_get_path (NM_OBJECT (connection)));
+ }
+ }
+
/* Now wait for the connection to actually reach the ACTIVATED state,
* allowing the user to cancel if it takes too long.
*/
@@ -206,7 +220,7 @@ activate_connection (NMConnection *connection,
nmt_newt_form_quit (form);
g_object_unref (form);
- nm_secret_agent_unregister (agent, NULL, NULL);
+ nm_secret_agent_old_unregister (agent, NULL, NULL);
g_object_unref (agent);
}
diff --git a/clients/tui/nmtui-edit.c b/clients/tui/nmtui-edit.c
index 2cc6b773aa..0c3206da60 100644
--- a/clients/tui/nmtui-edit.c
+++ b/clients/tui/nmtui-edit.c
@@ -463,7 +463,7 @@ connection_deleted_callback (GObject *connection,
ConnectionDeleteData *data = user_data;
GError *error = NULL;
- if (!nm_remote_connection_delete_finish (data->connection, result, NULL)) {
+ if (!nm_remote_connection_delete_finish (data->connection, result, &error)) {
nmt_newt_message_dialog (_("Unable to delete connection: %s"),
error->message);
} else
@@ -515,7 +515,8 @@ remove_one_connection (NMRemoteConnection *connection)
void
nmt_remove_connection (NMRemoteConnection *connection)
{
- const GPtrArray *conns;
+ const GPtrArray *all_conns;
+ GSList *slaves, *iter;
int i;
NMRemoteConnection *slave;
NMSettingConnection *s_con;
@@ -535,16 +536,22 @@ nmt_remove_connection (NMRemoteConnection *connection)
uuid = nm_connection_get_uuid (NM_CONNECTION (connection));
iface = nm_connection_get_interface_name (NM_CONNECTION (connection));
- conns = nm_client_get_connections (nm_client);
- for (i = 0; i < conns->len; i++) {
- slave = conns->pdata[i];
+ all_conns = nm_client_get_connections (nm_client);
+ slaves = NULL;
+ for (i = 0; i < all_conns->len; i++) {
+ slave = all_conns->pdata[i];
s_con = nm_connection_get_setting_connection (NM_CONNECTION (slave));
master = nm_setting_connection_get_master (s_con);
if (master) {
if (!g_strcmp0 (master, uuid) || !g_strcmp0 (master, iface))
- remove_one_connection (slave);
+ slaves = g_slist_prepend (slaves, g_object_ref (slave));
}
}
+
+ for (iter = slaves; iter; iter = iter->next)
+ remove_one_connection (iter->data);
+ g_slist_free_full (slaves, g_object_unref);
+
g_object_unref (connection);
}
diff --git a/clients/tui/vpn-helpers.c b/clients/tui/vpn-helpers.c
index fb0ee6f7f8..ab6469183c 100644
--- a/clients/tui/vpn-helpers.c
+++ b/clients/tui/vpn-helpers.c
@@ -28,6 +28,8 @@
* FIXME.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
#include <gmodule.h>
diff --git a/configure.ac b/configure.ac
index f14fb8e0b5..45ff8156be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,12 +1,11 @@
AC_PREREQ([2.63])
dnl The NM version number
-m4_define([nm_major_version], [0])
-m4_define([nm_minor_version], [9])
-m4_define([nm_micro_version], [11])
-m4_define([nm_nano_version], [0])
+m4_define([nm_major_version], [1])
+m4_define([nm_minor_version], [1])
+m4_define([nm_micro_version], [0])
m4_define([nm_version],
- [nm_major_version.nm_minor_version.nm_micro_version.nm_nano_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 ])])
AC_INIT([NetworkManager], [nm_version],
@@ -60,6 +59,7 @@ AC_SUBST(NM_MAJOR_VERSION)
AC_SUBST(NM_MINOR_VERSION)
AC_SUBST(NM_MICRO_VERSION)
AC_SUBST(NM_VERSION)
+AC_DEFINE_UNQUOTED(NM_GIT_SHA,"$NM_GIT_SHA",[git commit id of the original source code version])
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
@@ -145,11 +145,26 @@ if ! test x"$ac_distver" = x""; then
AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
fi
+AC_ARG_ENABLE(wifi, AS_HELP_STRING([--enable-wifi], [enable Wi-Fi support]))
+if test "${enable_wifi}" != "no"; then
+ enable_wifi='yes'
+ AC_DEFINE(WITH_WIFI, 1, [Define if you have Wi-Fi support])
+else
+ AC_DEFINE(WITH_WIFI, 0, [Define if you have Wi-Fi support])
+fi
+AM_CONDITIONAL(WITH_WIFI, test "${enable_wifi}" = "yes")
+
dnl
dnl Default to using WEXT but allow it to be disabled
dnl
-AC_ARG_WITH(wext, AS_HELP_STRING([--with-wext=yes], [Enable or disable Linux Wireless Extensions]), ac_with_wext=$withval, ac_with_wext="yes")
+AC_ARG_WITH(wext, AS_HELP_STRING([--with-wext=yes], [Enable or disable Linux Wireless Extensions]), ac_with_wext=$withval, ac_with_wext="$enable_wifi")
+if test "$ac_with_wext" != 'no'; then
+ ac_with_wext='yes'
+fi
if test x"$ac_with_wext" = x"yes"; then
+ if test "$enable_wifi" != "yes"; then
+ AC_MSG_ERROR(Enabling WEXT support and disabling Wi-Fi makes no sense)
+ fi
AC_MSG_CHECKING([Linux kernel WEXT headers])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
@@ -193,20 +208,24 @@ if test "$ac_have_nl80211" = no; then
AC_MSG_ERROR(Linux kernel development header linux/nl80211.h not installed or not functional)
fi
-AC_MSG_CHECKING([Linux kernel nl80211 Critical Protocol Start/Stop])
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#ifndef __user
- #define __user
- #endif
- #include <sys/types.h>
- #include <linux/types.h>
- #include <sys/socket.h>
- #include <linux/nl80211.h>]],
- [[unsigned int a = NL80211_CMD_CRIT_PROTOCOL_START; a++;]])],
- [ac_have_nl80211_critproto=yes],
- [ac_have_nl80211_critproto=no])
-AC_MSG_RESULT($ac_have_nl80211_critproto)
+if test "$with_wifi" = "yes"; then
+ AC_MSG_CHECKING([Linux kernel nl80211 Critical Protocol Start/Stop])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifndef __user
+ #define __user
+ #endif
+ #include <sys/types.h>
+ #include <linux/types.h>
+ #include <sys/socket.h>
+ #include <linux/nl80211.h>]],
+ [[unsigned int a = NL80211_CMD_CRIT_PROTOCOL_START; a++;]])],
+ [ac_have_nl80211_critproto=yes],
+ [ac_have_nl80211_critproto=no])
+ AC_MSG_RESULT($ac_have_nl80211_critproto)
+else
+ ac_have_nl80211_critproto='no'
+fi
if test "$ac_have_nl80211_critproto" = yes; then
AC_DEFINE(HAVE_NL80211_CRITICAL_PROTOCOL_CMDS, 1, [Define if nl80211 has critical protocol support])
else
@@ -302,7 +321,7 @@ AM_CONDITIONAL(WITH_QT, test "${enable_qt}" = "yes")
AC_ARG_WITH(udev-dir, AS_HELP_STRING([--with-udev-dir=DIR], [Absolute path of the udev base directory. Set to 'no' not to install the udev rules]), [], [with_udev_dir="yes"])
if (test "$with_udev_dir" != 'no'); then
- if (test "$with_udev_dir" != 'yes' && echo -n "$with_udev_dir" | grep -v -q '^/'); then
+ if (test "$with_udev_dir" != 'yes' && printf '%s' "$with_udev_dir" | grep -v -q '^/'); then
AC_MSG_ERROR([--with-udev-dir must be an absolute path or 'yes' or 'no'. Instead it is '$with_udev_dir'])
fi
if (test "$with_udev_dir" = 'yes'); then
@@ -332,30 +351,40 @@ 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])
+# 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])])
+ [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="yes"])
+AS_IF([test -z "$use_consolekit"], [use_consolekit="yes"])
+# output
+session_tracking=
+if test "$use_systemd_logind" = "yes"; then
+ PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], , [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login])])
AC_SUBST(SYSTEMD_LOGIN_CFLAGS)
AC_SUBST(SYSTEMD_LOGIN_LIBS)
+ AC_DEFINE([SESSION_TRACKING_SYSTEMD], 1, [Define to 1 if libsystemd-login is available])
+ session_tracking="$session_tracking, systemd-logind"
fi
-if test "$with_session_tracking" = "consolekit"; then
- AC_SUBST(CKDB_PATH, /var/run/ConsoleKit/database)
+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
-AC_MSG_RESULT($with_session_tracking)
+session_tracking="$(printf '%s' "${session_tracking}" | sed 's/^, //')"
AC_ARG_WITH(suspend-resume, AS_HELP_STRING([--with-suspend-resume=upower|systemd], [Build NetworkManager with specific suspend/resume support]))
if test "z$with_suspend_resume" = "z"; then
@@ -419,10 +448,21 @@ AC_COMPILE_IFELSE(
#endif
#include <linux/if_link.h>]],
[[int a = IN6_ADDR_GEN_MODE_EUI64; a++;]])],
- [ac_have_kernel_gen_mode="1"],
- [ac_have_kernel_gen_mode="0"])
-AC_DEFINE_UNQUOTED(HAVE_KERNEL_INET6_ADDR_GEN_MODE,
- $ac_have_kernel_gen_mode, [Define if the kernel has IN6_ADDR_GEN_MODE_*])
+ [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_*])
+else
+ AC_DEFINE(HAVE_KERNEL_INET6_ADDR_GEN_MODE, 0, [Define if the kernel has IN6_ADDR_GEN_MODE_*])
+fi
+
+# 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()])
# uuid library
PKG_CHECK_MODULES(UUID, uuid)
@@ -498,6 +538,22 @@ else
fi
AC_SUBST(NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT)
+PKG_CHECK_MODULES(POLKIT, [polkit-agent-1 >= 0.97], [have_pk_agent=yes],[have_pk_agent=no])
+AC_ARG_ENABLE(polkit-agent, AS_HELP_STRING([--enable-polkit-agent], [enable polkit agent for clients]),
+ [enable_polkit_agent=${enableval}], [enable_polkit_agent=${have_pk_agent}])
+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])
+fi
+AM_CONDITIONAL(WITH_POLKIT_AGENT, test "${enable_polkit_agent}" = "yes")
+
AC_ARG_ENABLE(modify-system,
AS_HELP_STRING([--enable-modify-system], [Allow users to modify system connections]))
if test "${enable_modify_system}" = "yes"; then
@@ -642,7 +698,7 @@ if (test "${enable_bluez5_dun}" = "yes"); then
fi
AC_DEFINE(WITH_BLUEZ5_DUN, 1, [Define if you have Bluez 5 libraries])
else
- AC_DEFINE(HAVE_BLUEZ5_DUN, 0, [Define if you have Bluez 5 libraries])
+ AC_DEFINE(WITH_BLUEZ5_DUN, 0, [Define if you have Bluez 5 libraries])
fi
AM_CONDITIONAL(WITH_BLUEZ5_DUN, test "${enable_bluez5_dun}" = "yes")
@@ -665,10 +721,10 @@ fi
if test "$with_dhcpcd" = "yes"; then
AC_PATH_PROGS(with_dhcpcd, dhcpcd, no, /sbin:/usr/sbin:/usr/local/sbin)
if test "$with_dhcpcd" != "no"; then
- if ! $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [[456789]]\."; then
+ if ! $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [456789]\."; then
AC_MSG_WARN([Cannot use dhcpcd, version 4.x or higher is required])
with_dhcpcd=no
- elif $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [[6789]]\."; then
+ elif $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [6789]\."; then
AC_DEFINE(DHCPCD_SUPPORTS_IPV6, 1, [Define if dhcpcd supports IPv6 (6.x+)])
fi
fi
@@ -801,6 +857,14 @@ AM_CONDITIONAL(BUILD_NMTUI, test "$build_nmtui" = yes)
NM_COMPILER_WARNINGS
+AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size (default: no)]))
+if (test "${enable_lto}" = "yes"); then
+ CFLAGS="-flto $CFLAGS"
+else
+ enable_lto='no'
+fi
+
+
dnl -------------------------
dnl Vala bindings
dnl -------------------------
@@ -809,13 +873,13 @@ VAPIGEN_CHECK(0.17.1.24)
# Tests, utilities and documentation
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests=root|yes|no], [Build NetworkManager tests (default: yes)]))
-AC_ARG_WITH(valgrind, AS_HELP_STRING([--with-valgrind=yes|no|path], [Use valgrind to memory-check the tests (default: yes)]))
+AC_ARG_WITH(valgrind, AS_HELP_STRING([--with-valgrind=yes|no|path], [Use valgrind to memory-check the tests (default: no)]))
# Fallback to --with-tests
AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests (deprecated)]))
AS_IF([test -n "$with_tests"], enable_tests="$with_tests")
-# Default to --enable-tests --with-valgrind
+# Default to --enable-tests --with-valgrind=no
AS_IF([test -z "$enable_tests"], enable_tests="yes")
-AS_IF([test -z "$with_valgrind"], with_valgrind="yes")
+AS_IF([test -z "$with_valgrind"], with_valgrind="no")
# Normalize values
AS_IF([test "$enable_tests" != "yes" -a "$enable_tests" != "root"], enable_tests="no")
# Search for tools
@@ -827,6 +891,7 @@ AM_CONDITIONAL(REQUIRE_ROOT_TESTS, test "$enable_tests" == "root")
AS_IF([test "$with_valgrind" != "no"],
AC_SUBST(VALGRIND_RULES, 'TESTS_ENVIRONMENT = "$(top_srcdir)/tools/run-test-valgrind.sh" "$(LIBTOOL)" "$(with_valgrind)" "$(top_srcdir)/valgrind.suppressions"'),
AC_SUBST(VALGRIND_RULES, []))
+AM_CONDITIONAL(WITH_VALGRIND, test "${with_valgrind}" != "no")
GTK_DOC_CHECK(1.0)
@@ -877,7 +942,7 @@ if test "$build_setting_docs" != "yes" \
-a -f man/nm-settings-keyfile.xml \
-a -f man/nm-settings-ifcfg-rh.xml \
-a -f docs/api/settings-spec.xml \
- -a -f cli/src/settings-docs.c; then
+ -a -f clients/cli/settings-docs.c; then
AC_DEFINE(HAVE_SETTING_DOCS, [1], [Define if you have pre-built settings docs])
have_setting_docs=yes
fi
@@ -933,7 +998,6 @@ libnm-util/libnm-util.pc
libnm-util/nm-version.h
libnm-util/Makefile
libnm-util/tests/Makefile
-libnm-util/tests/certs/Makefile
libnm-glib/libnm-glib.pc
libnm-glib/libnm-glib-vpn.pc
libnm-glib/Makefile
@@ -959,6 +1023,7 @@ 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
@@ -979,6 +1044,8 @@ examples/python/Makefile
examples/python/dbus/Makefile
examples/python/gi/Makefile
examples/ruby/Makefile
+examples/lua/Makefile
+examples/lua/lgi/Makefile
examples/C/Makefile
examples/C/glib/Makefile
examples/C/qt/Makefile
@@ -1002,7 +1069,7 @@ 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
@@ -1013,11 +1080,13 @@ if test "${enable_polkit}" = "yes"; then
else
echo " policykit: no"
fi
+echo " polkit agent: ${enable_polkit_agent}"
echo " selinux: $have_selinux"
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"
@@ -1049,4 +1118,5 @@ echo " documentation: $enable_gtk_doc"
echo " tests: $enable_tests"
echo " valgrind: $with_valgrind"
echo " code coverage: $enable_code_coverage"
+echo " LTO: $enable_lto"
echo
diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES
new file mode 100644
index 0000000000..50dfbca571
--- /dev/null
+++ b/contrib/fedora/REQUIRED_PACKAGES
@@ -0,0 +1,45 @@
+# A list of packages useful/needed to build and develop
+# NetworkManager on Fedora and RHEL.
+#
+# Not all of these packages are available, depending
+# on your distribution/release. But yum will happily
+# skip them.
+#
+# Not all of these packages are strictly speaking necessary.
+# This is a generous list of related packages.
+
+yum install \
+ git \
+ bzip2 \
+ intltool \
+ bash-completion \
+ cscope \
+ gtk-doc \
+ libnl3-devel \
+ libndp-devel \
+ libtool \
+ autopoint \
+ gettext-devel \
+ dbus-devel \
+ dbus-glib-devel \
+ libgudev1-devel \
+ libuuid-devel \
+ nss-devel \
+ ppp-devel \
+ valgrind \
+ systemd-devel \
+ ModemManager-devel \
+ ModemManager-glib-devel \
+ newt-devel \
+ vala-devel \
+ vala-tools \
+ dbus-x11 \
+ wireless-tools-devel \
+ polkit-devel \
+ wimax-devel \
+ libsoup-devel \
+ readline-devel \
+ teamd-devel \
+ rpm-build \
+ perl-YAML-LibYAM \
+
diff --git a/contrib/fedora/rpm/10-ibft-plugin.conf b/contrib/fedora/rpm/10-ibft-plugin.conf
new file mode 100644
index 0000000000..482ae2a073
--- /dev/null
+++ b/contrib/fedora/rpm/10-ibft-plugin.conf
@@ -0,0 +1,11 @@
+# This file enables the standalone 'iBFT' settings plugin to read
+# iBFT information with iscsiadm and create connections from that
+# data.
+#
+# Do not edit this file; it will be overwritten on upgrades. If you
+# want to override the values here, or set additional values, you can
+# do so by adding another file (eg, "99-local.conf") to this directory
+# and setting keys there.
+
+[main]
+plugins+=ibft
diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec
index 20d1a43a0a..a488ca3648 100644
--- a/contrib/fedora/rpm/NetworkManager.spec
+++ b/contrib/fedora/rpm/NetworkManager.spec
@@ -58,19 +58,14 @@
%global with_wwan 1
%endif
-%ifarch s390 s390x
-# No hardware-based plugins on s390
-%global with_adsl 0
-%global with_bluetooth 0
-%global with_wifi 0
-%global with_wimax 0
-%global with_wwan 0
-%endif
-
%if (0%{?fedora} && 0%{?fedora} <= 19)
%global with_team 0
%endif
+%define with_modem_manager_1 0
+%if 0%{?with_bluetooth} || (0%{?with_wwan} && (0%{?rhel} || (0%{?fedora} && 0%{?fedora} > 19)))
+%define with_modem_manager_1 1
+%endif
%global _hardened_build 1
@@ -88,7 +83,8 @@ URL: http://www.gnome.org/projects/NetworkManager/
Source: __SOURCE1__
Source1: NetworkManager.conf
Source2: 00-server.conf
-Source3: 20-connectivity-fedora.conf
+Source3: 10-ibft-plugin.conf
+Source4: 20-connectivity-fedora.conf
#Patch1: 0001-some.patch
@@ -160,7 +156,7 @@ BuildRequires: wimax-devel
BuildRequires: systemd >= 200-3 systemd-devel
BuildRequires: libsoup-devel
BuildRequires: libndp-devel >= 1.0
-%if 0%{?with_bluetooth} || (0%{?with_wwan} && (0%{?rhel} || (0%{?fedora} && 0%{?fedora} > 19)))
+%if 0%{?with_modem_manager_1}
BuildRequires: ModemManager-glib-devel >= 1.0
%endif
%if 0%{?with_nmtui}
@@ -169,6 +165,8 @@ BuildRequires: newt-devel
BuildRequires: /usr/bin/dbus-launch
BuildRequires: pygobject3-base
BuildRequires: dbus-python
+BuildRequires: libselinux-devel
+BuildRequires: polkit-devel
%description
@@ -218,6 +216,8 @@ Group: System Environment/Base
BuildRequires: teamd-devel
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Obsoletes: NetworkManager < %{obsoletes_nmver}
+# Team was split from main NM binary between 0.9.10 and 1.0
+Obsoletes: NetworkManager < 1.0.0
%description team
This package contains NetworkManager support for team devices.
@@ -306,8 +306,6 @@ NetworkManager API. See also NetworkManager-libnm-devel.
%package libnm
Summary: Libraries for adding NetworkManager support to applications (new API).
Group: Development/Libraries
-Requires: dbus >= %{dbus_version}
-Requires: dbus-glib >= %{dbus_glib_version}
%description libnm
This package contains the libraries that make it easier to use some NetworkManager
@@ -322,7 +320,6 @@ Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
Requires: glib2-devel
Requires: pkgconfig
-Requires: dbus-glib-devel >= %{dbus_glib_version}
%description libnm-devel
This package contains the header and pkg-config files for development applications using
@@ -387,11 +384,16 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
--with-crypto=nss \
--enable-more-warnings=error \
--enable-ppp=yes \
-%if 0%{?rhel} || (0%{?fedora} > 19)
+%if 0%{?with_modem_manager_1}
--with-modem-manager-1=yes \
%else
--with-modem-manager-1=no \
%endif
+%if 0%{?with_wifi}
+ --enable-wifi=yes \
+%else
+ --enable-wifi=no \
+%endif
%if 0%{?with_wimax}
--enable-wimax=yes \
%else
@@ -413,7 +415,9 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%else
--enable-teamdctl=no \
%endif
+ --with-selinux=yes \
--enable-polkit=yes \
+ --enable-polkit-agent \
--enable-modify-system=yes \
--enable-concheck \
--with-session-tracking=systemd \
@@ -442,6 +446,7 @@ make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d
%{__cp} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d
%{__cp} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d
+%{__cp} %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d
# create a VPN directory
%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/VPN
@@ -452,6 +457,13 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d
# create a dnsmasq.d directory
%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dnsmasq.d
+# create dispatcher directories
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-down.d
+%{__cp} examples/dispatcher/10-ifcfg-rh-routes.sh $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/
+%{__ln_s} ../10-ifcfg-rh-routes.sh $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/
+
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/gnome-vpn-properties
%{__mkdir_p} $RPM_BUILD_ROOT%{_localstatedir}/lib/NetworkManager
@@ -477,6 +489,9 @@ make check
%post
+/usr/bin/udevadm control --reload-rules || :
+/usr/bin/udevadm trigger --subsystem-match=net || :
+
%systemd_post NetworkManager.service NetworkManager-wait-online.service NetworkManager-dispatcher.service
%preun
@@ -490,6 +505,9 @@ fi
%systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service
%postun
+/usr/bin/udevadm control --reload-rules || :
+/usr/bin/udevadm trigger --subsystem-match=net || :
+
%systemd_postun
@@ -509,8 +527,10 @@ fi
%{_datadir}/bash-completion/completions/nmcli
%dir %{_sysconfdir}/%{name}/
%dir %{_sysconfdir}/%{name}/dispatcher.d
+%{_sysconfdir}/%{name}/dispatcher.d/10-ifcfg-rh-routes.sh
%dir %{_sysconfdir}/%{name}/dispatcher.d/pre-down.d
%dir %{_sysconfdir}/%{name}/dispatcher.d/pre-up.d
+%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh
%dir %{_sysconfdir}/%{name}/dnsmasq.d
%dir %{_sysconfdir}/%{name}/VPN
%config(noreplace) %{_sysconfdir}/%{name}/NetworkManager.conf
@@ -518,8 +538,13 @@ fi
%{_libexecdir}/nm-dhcp-helper
%{_libexecdir}/nm-avahi-autoipd.action
%{_libexecdir}/nm-dispatcher
+%{_libexecdir}/nm-iface-helper
%dir %{_libdir}/NetworkManager
%{_libdir}/NetworkManager/libnm-settings-plugin*.so
+%if 0%{?with_nmtui}
+%exclude %{_mandir}/man1/nmtui*
+%endif
+%config %{_sysconfdir}/%{name}/conf.d/10-ibft-plugin.conf
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
@@ -542,6 +567,8 @@ fi
%files adsl
%defattr(-,root,root,0755)
%{_libdir}/%{name}/libnm-device-plugin-adsl.so
+%else
+%exclude %{_libdir}/%{name}/libnm-device-plugin-adsl.so
%endif
%if 0%{?with_bluetooth}
@@ -650,6 +677,7 @@ fi
%{_bindir}/nmtui-edit
%{_bindir}/nmtui-connect
%{_bindir}/nmtui-hostname
+%{_mandir}/man1/nmtui*
%endif
%changelog
diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh
index e70eb21491..c1ededb554 100755
--- a/contrib/fedora/rpm/build.sh
+++ b/contrib/fedora/rpm/build.sh
@@ -24,14 +24,14 @@ abs_path() {
}
get_version() {
- local major minor micro nano
+ local major minor micro
local F="${1:-"$GITDIR/configure.ac"}"
- vars="$(sed -n 's/^m4_define(\[nm_\(major\|minor\|micro\|nano\)_version\], *\[\([0-9]\+\)\]) *$/local \1='\''\2'\''/p' "$F" 2>/dev/null)"
+ vars="$(sed -n 's/^m4_define(\[nm_\(major\|minor\|micro\)_version\], *\[\([0-9]\+\)\]) *$/local \1='\''\2'\''/p' "$F" 2>/dev/null)"
eval "$vars"
- [[ -n "$major" && -n "$minor" && "$micro" && "$nano" ]] || return 1
- echo "$major.$minor.$micro.$nano"
+ [[ -n "$major" && -n "$minor" && "$micro" ]] || return 1
+ echo "$major.$minor.$micro"
}
write_changelog() {
@@ -73,6 +73,7 @@ SOURCE="$(abs_path "$SOURCE" "$(ls -1 "$GITDIR/NetworkManager-$VERSION"*.tar* 2>
[[ -f "$SOURCE" ]] || die "could not find source ${_SOURCE:-$GITDIR/NetworkManager-$VERSION*.tar*} . Did you execute \`make dist\`? Otherwise set \$SOURCE variable"
SOURCE_NETWORKMANAGER_CONF="$(abs_path "$SOURCE_NETWORKMANAGER_CONF" "$SCRIPTDIR/NetworkManager.conf")"
SOURCE_CONFIG_SERVER="$(abs_path "$SOURCE_CONFIG_SERVER" "$SCRIPTDIR/00-server.conf")"
+SOURCE_CONFIG_IBFT_PLUGIN="$(abs_path "$SOURCE_CONFIG_IBFT_PLUGIN" "$SCRIPTDIR/10-ibft-plugin.conf")"
SOURCE_CONFIG_CONNECTIVITY_FEDORA="$(abs_path "$SOURCE_CONFIG_CONNECTIVITY_FEDORA" "$SCRIPTDIR/20-connectivity-fedora.conf")"
TEMP="$(mktemp -d "$SCRIPTDIR/NetworkManager.$DATE.XXXXXX")"
@@ -87,6 +88,7 @@ LOG "SPECFILE=$SPECFILE"
LOG "SOURCE=$SOURCE"
LOG "SOURCE_NETWORKMANAGER_CONF=$SOURCE_NETWORKMANAGER_CONF"
LOG "SOURCE_CONFIG_SERVER=$SOURCE_CONFIG_SERVER"
+LOG "SOURCE_CONFIG_IBFT_PLUGIN=$SOURCE_CONFIG_IBFT_PLUGIN"
LOG "SOURCE_CONFIG_CONNECTIVITY_FEDORA=$SOURCE_CONFIG_CONNECTIVITY_FEDORA"
LOG "BASEDIR=$TEMP"
@@ -100,6 +102,7 @@ mkdir -p "$TEMP/SOURCES/" "$TEMP/SPECS/" || die "error creating SPECS directoy"
cp "$SOURCE" "$TEMP/SOURCES/" || die "Could not copy source $SOURCE to $TEMP/SOURCES"
cp "$SOURCE_NETWORKMANAGER_CONF" "$TEMP/SOURCES/NetworkManager.conf" || die "Could not copy source $SOURCE_NETWORKMANAGER_CONF to $TEMP/SOURCES"
cp "$SOURCE_CONFIG_SERVER" "$TEMP/SOURCES/00-server.conf" || die "Could not copy source $SOURCE_CONFIG_SERVER to $TEMP/SOURCES"
+cp "$SOURCE_CONFIG_IBFT_PLUGIN" "$TEMP/SOURCES/10-ibft-plugin.conf" || die "Could not copy source $SOURCE_CONFIG_IBFT_PLUGIN to $TEMP/SOURCES"
cp "$SOURCE_CONFIG_CONNECTIVITY_FEDORA" "$TEMP/SOURCES/20-connectivity-fedora.conf" || die "Could not copy source $SOURCE_CONFIG_CONNECTIVITY_FEDORA to $TEMP/SOURCES"
write_changelog
@@ -116,7 +119,16 @@ sed -e "/^__CHANGELOG__$/ \
d
}" > "$TEMPSPEC" || die "Error reading spec file"
-rpmbuild --define "_topdir $TEMP" -ba "$TEMPSPEC" || die "ERROR: rpmbuild FAILED"
+case "$BUILDTYPE" in
+ "SRPM")
+ RPM_BUILD_OPTION=-bs
+ ;;
+ *)
+ RPM_BUILD_OPTION=-ba
+ ;;
+esac
+
+rpmbuild --define "_topdir $TEMP" $RPM_BUILD_OPTION "$TEMPSPEC" || die "ERROR: rpmbuild FAILED"
ln -snf "$TEMPBASE" ./latest
TEMP_LATEST="$(readlink -f .)"/latest
@@ -128,6 +140,6 @@ LOG
LOG "See \"$TEMP_LATEST/\" which symlinks to \"$TEMPBASE\""
LOG
LOG "Result:"
-ls -dla "$TEMP_LATEST" "$(dirname "$TEMP_LATEST")/$TEMPBASE/" "$TEMP_LATEST"/RPMS/*/ "$TEMP_LATEST"/RPMS/*/*.rpm "$TEMP_LATEST"/SRPMS/ "$TEMP_LATEST"/SRPMS/*.rpm | sed 's/^/ /'
+ls -dla "$TEMP_LATEST" "$(dirname "$TEMP_LATEST")/$TEMPBASE/" "$TEMP_LATEST"/RPMS/*/ "$TEMP_LATEST"/RPMS/*/*.rpm "$TEMP_LATEST"/SRPMS/ "$TEMP_LATEST"/SRPMS/*.rpm 2>/dev/null | sed 's/^/ /'
diff --git a/contrib/fedora/rpm/build_clean.sh b/contrib/fedora/rpm/build_clean.sh
index 433bd59d5a..b57b7099e8 100755
--- a/contrib/fedora/rpm/build_clean.sh
+++ b/contrib/fedora/rpm/build_clean.sh
@@ -15,6 +15,7 @@ usage() {
echo " --force: force build, even if working directory is not clean and has local modifications"
echo " --clean: run \`git-clean -fdx :/\` before build"
echo " --quick: only run \`make dist\` instead of \`make distcheck\`"
+ echo " --srpm: only build the SRPM"
}
@@ -46,6 +47,9 @@ for A; do
-Q|--quick)
QUICK=1
;;
+ -S|--srpm)
+ BUILDTYPE=SRPM
+ ;;
*)
usage
die "Unexpected argument \"$A\""
@@ -61,7 +65,7 @@ if [[ $IGNORE_DIRTY != 1 ]]; then
# check for a clean working directory.
# We ignore the /contrib directory, because this is where the automation
# scripts and the build results will be.
- if [[ "x$(LANG=C git clean -ndx | grep '^Would remove contrib/.*$' -v)" != x ]]; then
+ if [[ "x$(LANG=C git clean -ndx | grep '^Would \(remove contrib/\|skip repository libgsystem/\).*$' -v)" != x ]]; then
die "The working directory is not clean. Refuse to run. Try \`$0 --force\`, \`$0 --clean\`, or \`git clean -e :/contrib -dx -n\`"
fi
if [[ "x$(git status --porcelain)" != x ]]; then
@@ -84,5 +88,7 @@ else
make distcheck || die "Error make distcheck"
fi
+export BUILDTYPE
+
"$SCRIPTDIR"/build.sh
diff --git a/callouts/77-nm-olpc-mesh.rules b/data/77-nm-olpc-mesh.rules
index a1a1554c2b..a1a1554c2b 100644
--- a/callouts/77-nm-olpc-mesh.rules
+++ b/data/77-nm-olpc-mesh.rules
diff --git a/data/85-nm-unmanaged.rules b/data/85-nm-unmanaged.rules
new file mode 100644
index 0000000000..aefab5c461
--- /dev/null
+++ b/data/85-nm-unmanaged.rules
@@ -0,0 +1,34 @@
+# Do not modify this file, it will get overwriten on updates.
+# To override or extend the rules place a file in /etc/udev/rules.d
+
+SUBSYSTEM!="net", GOTO="nm_unmanaged_end"
+
+# Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?)
+ENV{ID_NET_DRIVER}=="?*", GOTO="nm_unmanaged_driver"
+DRIVERS=="?*", GOTO="nm_unmanaged_driver"
+PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $env{INTERFACE} |/bin/sed -n s/^driver:\ //p'", RESULT=="?*", ENV{ID_NET_DRIVER}="%c"
+LABEL="nm_unmanaged_driver"
+
+# VirtualBox host networking. Out-of-tree driver that looks like an ordinary
+# Ethernet. No parent device (lives in /virtual/), no support for ethtool
+# to identify the driver, MAC address defaults to 08:00:27:, but can be
+# changed. Interface name will have to do, it's always vboxnet*.
+ENV{INTERFACE}=="vboxnet[0-9]*", ENV{NM_UNMANAGED}="1"
+
+# VMWare host networking. Out-of-tree driver that looks like an ordinary
+# Ethernet. No parent device (lives in /virtual/), no support for
+# ethtool to identify the driver. They have their own MAC prefix that
+# can not be changed.
+PROGRAM="/bin/cat %S%p/address", RESULT=="00:50:56:*", ENV{INTERFACE}=="vmnet[0-9]*", ENV{NM_UNMANAGED}="1"
+
+# Parallels Workstation host networking. Out-of-tree driver that looks like
+# an ordinary Ethernet. No parent device (lives in /virtual/), no support for
+# ethtool to identify the driver and the interface name is too generic.
+# However, they have their own MAC prefix that can not be changed.
+PROGRAM="/bin/cat %S%p/address", RESULT=="00:1c:42:*", ENV{INTERFACE}=="vnic[0-9]*", ENV{NM_UNMANAGED}="1"
+
+# Virtual Ethernet device pair. Often used to communicate with a peer interface
+# in another net namespace and managed by libvirt, Docker or the like.
+ENV{ID_NET_DRIVER}=="veth", ENV{NM_UNMANAGED}="1"
+
+LABEL="nm_unmanaged_end"
diff --git a/data/Makefile.am b/data/Makefile.am
index e91361a71b..5a95ea2a42 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -34,6 +34,13 @@ endif
examplesdir = $(docdir)/examples
examples_DATA = server.conf
+if WITH_UDEV_DIR
+udevrulesdir = $(UDEV_DIR)/rules.d
+udevrules_DATA = \
+ 85-nm-unmanaged.rules \
+ 77-nm-olpc-mesh.rules
+endif
+
server.conf: server.conf.in
$(edit) $< >$@
@@ -51,6 +58,8 @@ EXTRA_DIST = \
NetworkManager-wait-online-systemd-pre200.service.in \
NetworkManager-dispatcher.service.in \
org.freedesktop.NetworkManager.service.in \
+ 85-nm-unmanaged.rules \
+ 77-nm-olpc-mesh.rules \
server.conf.in
CLEANFILES = \
diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in
index 84a9c959c2..b2e61ffbca 100644
--- a/data/NetworkManager.service.in
+++ b/data/NetworkManager.service.in
@@ -7,6 +7,7 @@ Before=network.target @DISTRO_NETWORK_SERVICE@
Type=dbus
BusName=org.freedesktop.NetworkManager
ExecStart=@sbindir@/NetworkManager --no-daemon
+Restart=on-failure
# NM doesn't want systemd to kill its children for it
KillMode=process
diff --git a/docs/api/Makefile.am b/docs/api/Makefile.am
index 683340e684..1b50d02b65 100644
--- a/docs/api/Makefile.am
+++ b/docs/api/Makefile.am
@@ -15,7 +15,7 @@ GENERATED_FILES = spec.html
if SETTING_DOCS_AVAILABLE
-settings-spec.xml: settings-spec.xsl $(top_builddir)/libnm-util/nm-setting-docs.xml
+settings-spec.xml: settings-spec.xsl $(top_builddir)/libnm/nm-setting-docs.xml
$(AM_V_GEN) xsltproc --output $@ $^
# Top-level SGML file includes (depends on) settings-spec.xml
@@ -59,6 +59,7 @@ MKHTML_OPTIONS=--path="$(abs_srcdir)"
content_files = \
version.xml \
migrating-to-09.xml \
+ ../../COPYING \
$(NULL)
include $(top_srcdir)/gtk-doc.make
@@ -70,5 +71,10 @@ CLEANFILES += html/* tmpl/* xml/* \
NetworkManager-sections.txt \
NetworkManager-overrides.txt
-DISTCLEANFILES = $(GENERATED_FILES)
+if BUILD_SETTING_DOCS
+CLEANFILES += settings-spec.xml
+endif
+if ENABLE_GTK_DOC
+CLEANFILES += spec.html
+endif
diff --git a/docs/api/settings-spec.xsl b/docs/api/settings-spec.xsl
index 14163e244f..04feb3987f 100644
--- a/docs/api/settings-spec.xsl
+++ b/docs/api/settings-spec.xsl
@@ -42,7 +42,7 @@
<entry><screen><xsl:value-of select="@name"/></screen></entry>
<entry><screen><xsl:value-of select="@type"/></screen></entry>
<entry><screen><xsl:value-of select="@default"/></screen></entry>
- <entry><xsl:value-of select="@description"/><xsl:if test="contains(@name,'-flags') and $setting_name != 'dcb'"> (see <xref linkend="secrets-flags"/> for flag values)</xsl:if></entry>
+ <entry><xsl:value-of select="@description"/><xsl:if test="@type = 'NMSettingSecretFlags'"> (see <xref linkend="secrets-flags"/> for flag values)</xsl:if></entry>
</row>
</xsl:template>
diff --git a/docs/libnm-glib/Makefile.am b/docs/libnm-glib/Makefile.am
index 9c2dbb3921..5c3c492ffc 100644
--- a/docs/libnm-glib/Makefile.am
+++ b/docs/libnm-glib/Makefile.am
@@ -30,6 +30,7 @@ CFILE_GLOB=$(top_srcdir)/libnm-glib/*.c
# Header files to ignore when scanning.
IGNORE_HFILES= \
+ common.h \
nm-dbus-helpers-private.h \
nm-device-private.h \
nm-object-cache.h \
diff --git a/docs/libnm-util/Makefile.am b/docs/libnm-util/Makefile.am
index 07bd2fe32e..17022310c1 100644
--- a/docs/libnm-util/Makefile.am
+++ b/docs/libnm-util/Makefile.am
@@ -10,7 +10,9 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting functions and macros.
-DOC_SOURCE_DIR=$(top_srcdir)/libnm-util
+DOC_SOURCE_DIR= \
+ $(top_builddir)/libnm-util \
+ $(top_srcdir)/libnm-util
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS=--rebuild-types --rebuild-sections
@@ -35,7 +37,8 @@ IGNORE_HFILES= \
nm-utils-private.h \
nm-setting-private.h \
nm-param-spec-specialized.h \
- nm-test-utils.h
+ nm-test-utils.h \
+ nm-version.h
# Images to copy into HTML directory.
HTML_IMAGES =
diff --git a/docs/libnm-util/libnm-util-docs.sgml b/docs/libnm-util/libnm-util-docs.sgml
index 2a23a17366..14139181d6 100644
--- a/docs/libnm-util/libnm-util-docs.sgml
+++ b/docs/libnm-util/libnm-util-docs.sgml
@@ -73,6 +73,8 @@
<xi:include href="xml/nm-setting-pppoe.xml"/>
<xi:include href="xml/nm-setting-vpn.xml"/>
<xi:include href="xml/nm-utils.xml"/>
+ <xi:include href="xml/NetworkManager.xml"/>
+ <xi:include href="xml/NetworkManagerVPN.xml"/>
</chapter>
<chapter id="object-tree">
diff --git a/docs/libnm/Makefile.am b/docs/libnm/Makefile.am
index 1e1e9ae276..28938f89ff 100644
--- a/docs/libnm/Makefile.am
+++ b/docs/libnm/Makefile.am
@@ -10,7 +10,11 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting functions and macros.
-DOC_SOURCE_DIR=$(top_srcdir)/libnm-core $(top_srcdir)/libnm
+DOC_SOURCE_DIR= \
+ $(top_srcdir)/libnm-core \
+ $(top_builddir)/libnm-core \
+ $(top_srcdir)/libnm \
+ $(top_builddir)/libnm
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS=--rebuild-types --rebuild-sections
@@ -30,19 +34,26 @@ CFILE_GLOB=$(top_srcdir)/libnm-core/*.c $(top_srcdir)/libnm/*.c
# Header files to ignore when scanning.
IGNORE_HFILES= \
+ common.h \
crypto.h \
- nm-dbus-helpers-private.h \
+ nm-dbus-helpers.h \
nm-core-internal.h \
+ nm-core-types.h \
nm-device-private.h \
+ nm-dhcp4-config.h \
+ nm-dhcp6-config.h \
+ nm-ip4-config.h \
+ nm-ip6-config.h \
nm-manager.h \
nm-object-cache.h \
nm-object-private.h \
- nm-param-spec-dbus.h \
+ nm-property-compare.h \
nm-remote-connection-private.h \
nm-remote-settings.h \
nm-setting-private.h \
- nm-types-private.h \
- nm-utils-private.h
+ nm-types.h \
+ nm-utils-private.h \
+ nm-vpn-plugin-old.h
# Images to copy into HTML directory.
HTML_IMAGES = libnm.png
diff --git a/docs/libnm/libnm-docs.xml b/docs/libnm/libnm-docs.xml
index 007cbe4108..399ba5135a 100644
--- a/docs/libnm/libnm-docs.xml
+++ b/docs/libnm/libnm-docs.xml
@@ -66,13 +66,16 @@
<chapter>
<title>Client Object API Reference</title>
<xi:include href="xml/nm-client.xml"/>
- <xi:include href="xml/nm-secret-agent.xml"/>
+ <xi:include href="xml/nm-secret-agent-old.xml"/>
<xi:include href="xml/nm-object.xml"/>
+ <xi:include href="xml/nm-errors.xml"/>
+ <xi:include href="xml/nm-dbus-interface.xml"/>
</chapter>
<chapter>
<title>Connection and Setting API Reference</title>
<xi:include href="xml/nm-connection.xml"/>
+ <xi:include href="xml/nm-simple-connection.xml"/>
<xi:include href="xml/nm-setting.xml"/>
<xi:include href="xml/nm-setting-connection.xml"/>
<!-- begin alphabetical -->
@@ -87,6 +90,7 @@
<xi:include href="xml/nm-setting-generic.xml"/>
<xi:include href="xml/nm-setting-gsm.xml"/>
<xi:include href="xml/nm-setting-infiniband.xml"/>
+ <xi:include href="xml/nm-setting-ip-config.xml"/>
<xi:include href="xml/nm-setting-ip4-config.xml"/>
<xi:include href="xml/nm-setting-ip6-config.xml"/>
<xi:include href="xml/nm-setting-olpc-mesh.xml"/>
@@ -127,15 +131,20 @@
<xi:include href="xml/nm-remote-connection.xml"/>
<xi:include href="xml/nm-access-point.xml"/>
<xi:include href="xml/nm-wimax-nsp.xml"/>
- <xi:include href="xml/nm-ip4-config.xml"/>
- <xi:include href="xml/nm-ip6-config.xml"/>
- <xi:include href="xml/nm-dhcp4-config.xml"/>
- <xi:include href="xml/nm-dhcp6-config.xml"/>
+ <xi:include href="xml/nm-ip-config.xml"/>
+ <xi:include href="xml/nm-dhcp-config.xml"/>
</chapter>
<chapter>
<title>Utility API Reference</title>
<xi:include href="xml/nm-utils.xml"/>
+ <xi:include href="xml/nm-version.xml"/>
+ </chapter>
+
+ <chapter>
+ <title>VPN Plugin API Reference</title>
+ <xi:include href="xml/nm-vpn-dbus-interface.xml"/>
+ <xi:include href="xml/nm-vpn-editor-plugin.xml"/>
</chapter>
<chapter id="object-tree">
diff --git a/examples/C/glib/add-connection-gdbus.c b/examples/C/glib/add-connection-gdbus.c
index a7874fc51f..d390327399 100644
--- a/examples/C/glib/add-connection-gdbus.c
+++ b/examples/C/glib/add-connection-gdbus.c
@@ -27,6 +27,8 @@
* gcc -Wall `pkg-config --cflags libnm` `pkg-config --cflags --libs gio-2.0` -luuid add-connection-gdbus.c -o add-connection-gdbus
*/
+#include "config.h"
+
#include <gio/gio.h>
#include <uuid/uuid.h>
#include <NetworkManager.h>
@@ -86,7 +88,7 @@ add_connection (GDBusProxy *proxy, const char *con_name)
/* Build up the 'ipv4' Setting */
g_variant_builder_init (&setting_builder, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (&setting_builder, "{sv}",
- NM_SETTING_IP4_CONFIG_METHOD,
+ NM_SETTING_IP_CONFIG_METHOD,
g_variant_new_string (NM_SETTING_IP4_CONFIG_METHOD_AUTO));
g_variant_builder_add (&connection_builder, "{sa{sv}}",
NM_SETTING_IP4_CONFIG_SETTING_NAME,
diff --git a/examples/C/glib/add-connection-libnm.c b/examples/C/glib/add-connection-libnm.c
index 1288e79c51..75048bd8f1 100644
--- a/examples/C/glib/add-connection-libnm.c
+++ b/examples/C/glib/add-connection-libnm.c
@@ -27,6 +27,8 @@
* gcc -Wall `pkg-config --libs --cflags glib-2.0 libnm` add-connection-libnm.c -o add-connection-libnm
*/
+#include "config.h"
+
#include <glib.h>
#include <NetworkManager.h>
@@ -86,7 +88,7 @@ add_connection (NMClient *client, GMainLoop *loop, const char *con_name)
/* Build up the 'ipv4' Setting */
s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
diff --git a/examples/C/glib/get-active-connections-gdbus.c b/examples/C/glib/get-active-connections-gdbus.c
index 6a19bf895e..9b34f6b210 100644
--- a/examples/C/glib/get-active-connections-gdbus.c
+++ b/examples/C/glib/get-active-connections-gdbus.c
@@ -26,6 +26,8 @@
* gcc -Wall `pkg-config --cflags libnm` `pkg-config --cflags --libs gio-2.0` get-active-connections-gdbus.c -o get-active-connections-gdbus
*/
+#include "config.h"
+
#include <string.h>
#include <gio/gio.h>
#include <NetworkManager.h>
diff --git a/examples/C/glib/get-ap-info-libnm.c b/examples/C/glib/get-ap-info-libnm.c
index 5868c27904..90bc2d5e78 100644
--- a/examples/C/glib/get-ap-info-libnm.c
+++ b/examples/C/glib/get-ap-info-libnm.c
@@ -25,6 +25,8 @@
* gcc -Wall `pkg-config --libs --cflags glib-2.0 libnm` get-ap-info-libnm.c -o get-ap-info-libnm
*/
+#include "config.h"
+
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/examples/C/glib/list-connections-gdbus.c b/examples/C/glib/list-connections-gdbus.c
index f5922582ea..634bd90c82 100644
--- a/examples/C/glib/list-connections-gdbus.c
+++ b/examples/C/glib/list-connections-gdbus.c
@@ -27,6 +27,8 @@
* gcc -Wall `pkg-config --cflags libnm` `pkg-config --cflags --libs gio-2.0` list-connections-gdbus.c -o list-connections-gdbus
*/
+#include "config.h"
+
#include <gio/gio.h>
#include <NetworkManager.h>
diff --git a/examples/C/glib/list-connections-libnm.c b/examples/C/glib/list-connections-libnm.c
index f09c028b6b..d5cdf361d7 100644
--- a/examples/C/glib/list-connections-libnm.c
+++ b/examples/C/glib/list-connections-libnm.c
@@ -26,6 +26,8 @@
* gcc -Wall `pkg-config --libs --cflags glib-2.0 libnm` list-connections-libnm.c -o list-connections-libnm
*/
+#include "config.h"
+
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/examples/C/glib/monitor-nm-running-gdbus.c b/examples/C/glib/monitor-nm-running-gdbus.c
index 2e1a11c0c8..e4b3bbbfc9 100644
--- a/examples/C/glib/monitor-nm-running-gdbus.c
+++ b/examples/C/glib/monitor-nm-running-gdbus.c
@@ -28,6 +28,8 @@
* gcc -Wall `pkg-config --libs --cflags glib-2.0 gio-2.0` monitor-nm-running-gdbus.c -o monitor-nm-running-gdbus
*/
+#include "config.h"
+
#include <gio/gio.h>
static void
diff --git a/examples/C/glib/monitor-nm-state-gdbus.c b/examples/C/glib/monitor-nm-state-gdbus.c
index 05596399d9..aeabcfe16e 100644
--- a/examples/C/glib/monitor-nm-state-gdbus.c
+++ b/examples/C/glib/monitor-nm-state-gdbus.c
@@ -29,6 +29,8 @@
* gcc -Wall `pkg-config --libs --cflags glib-2.0 gio-2.0` `pkg-config --cflags libnm` monitor-nm-state-gdbus.c -o monitor-nm-state-gdbus
*/
+#include "config.h"
+
#include <gio/gio.h>
#include <string.h>
#include <nm-dbus-interface.h>
diff --git a/examples/Makefile.am b/examples/Makefile.am
index a227f0ea7a..3521b4cecd 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -2,5 +2,6 @@ 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
new file mode 100755
index 0000000000..75b8c5e5e9
--- /dev/null
+++ b/examples/dispatcher/10-ifcfg-rh-routes.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# This ifcfg-rh-specific script runs
+# /etc/sysconfig/network-scripts/ifup-routes when bringing up
+# interfaces that have routing rules associated with them that can't
+# be expressed by NMSettingIPConfig. (Eg, policy-based routing.)
+
+# This should be installed in both dispatcher.d/ and
+# dispatcher.d/pre-up.d/
+
+if [ "$2" != "pre-up" -a "$2" != "down" ]; then
+ exit 0
+fi
+
+dir=$(dirname "$CONNECTION_FILENAME")
+if [ "$dir" != "/etc/sysconfig/network-scripts" ]; then
+ exit 0
+fi
+profile=$(basename "$CONNECTION_FILENAME" | sed -ne 's/^ifcfg-//p')
+if [ -z "$profile" ]; then
+ exit 0
+fi
+if ! [ -f "$dir/rule-$profile" -o -f "$dir/rule6-$profile" ]; then
+ exit 0
+fi
+
+case "$2" in
+ pre-up)
+ /etc/sysconfig/network-scripts/ifup-routes "$DEVICE_IP_IFACE" "$profile"
+ ;;
+ down)
+ /etc/sysconfig/network-scripts/ifdown-routes "$DEVICE_IP_IFACE" "$profile"
+ ;;
+esac
diff --git a/examples/dispatcher/Makefile.am b/examples/dispatcher/Makefile.am
index 0db71a0d4f..0089d5fe7b 100644
--- a/examples/dispatcher/Makefile.am
+++ b/examples/dispatcher/Makefile.am
@@ -1,3 +1,4 @@
EXTRA_DIST = \
+ 10-ifcfg-rh-routes.sh \
70-wifi-wired-exclusive.sh
diff --git a/examples/lua/Makefile.am b/examples/lua/Makefile.am
new file mode 100644
index 0000000000..bf14f68299
--- /dev/null
+++ b/examples/lua/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS= lgi
+
diff --git a/examples/lua/lgi/Makefile.am b/examples/lua/lgi/Makefile.am
new file mode 100644
index 0000000000..ce5c8f5c90
--- /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/add-connection.lua b/examples/lua/lgi/add-connection.lua
new file mode 100755
index 0000000000..3daf5f32c9
--- /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 <connection name> [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 0000000000..2e93f9dd3a
--- /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 <vpn_profile> <username>", 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 0000000000..fb8e0ed535
--- /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 [<type>]", 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 0000000000..fe3c3ea3f4
--- /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 0000000000..9a70de4364
--- /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 <interface>\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 0000000000..f2eda44286
--- /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 0000000000..712d353e7d
--- /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 0000000000..69a065c67b
--- /dev/null
+++ b/examples/lua/lgi/show-wifi-networks.lua
@@ -0,0 +1,79 @@
+#!/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 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 print_ap_info(ap)
+ local strength = ap:get_strength()
+ local frequency = ap:get_frequency()
+ print("SSID: ", ssid_to_utf8(ap))
+ print("BSSID: ", ap:get_bssid())
+ print("Frequency: ", frequency)
+ print("Channel: ", NM.utils_wifi_freq_to_channel(frequency))
+ 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/dbus/Makefile.am b/examples/python/dbus/Makefile.am
index 0e88488496..dd77f1e9ba 100644
--- a/examples/python/dbus/Makefile.am
+++ b/examples/python/dbus/Makefile.am
@@ -1,6 +1,7 @@
EXTRA_DIST = \
nm-state.py \
add-connection.py \
+ add-connection-compat.py \
add-system-wifi-connection.py \
vpn.py \
update-secrets.py \
diff --git a/examples/python/dbus/add-connection-compat.py b/examples/python/dbus/add-connection-compat.py
new file mode 100755
index 0000000000..4792ac5eb6
--- /dev/null
+++ b/examples/python/dbus/add-connection-compat.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) 2010 - 2012 Red Hat, Inc.
+#
+
+#
+# This example adds a new ethernet connection via the AddConnection()
+# D-Bus call, using backward-compatible settings, so it will work with
+# both old and new versions of NetworkManager. Compare
+# add-connection.py, which only supports NM 1.0 and later.
+#
+# Configuration settings are described at
+# https://developer.gnome.org/NetworkManager/1.0/ref-settings.html
+#
+
+import socket, struct, dbus, uuid
+
+# Helper functions
+def ip_to_int(ip_string):
+ return struct.unpack("=I", socket.inet_aton(ip_string))[0]
+
+def int_to_ip(ip_int):
+ return socket.inet_ntoa(struct.pack("=I", ip_int))
+
+s_wired = dbus.Dictionary({'duplex': 'full'})
+s_con = dbus.Dictionary({
+ 'type': '802-3-ethernet',
+ 'uuid': str(uuid.uuid4()),
+ 'id': 'MyConnectionExample'})
+
+addr1 = dbus.Array([ip_to_int("10.1.2.3"), dbus.UInt32(8L), ip_to_int("10.1.2.1")], signature=dbus.Signature('u'))
+s_ip4 = dbus.Dictionary({
+ 'addresses': dbus.Array([addr1], signature=dbus.Signature('au')),
+ 'method': 'manual'})
+
+s_ip6 = dbus.Dictionary({'method': 'ignore'})
+
+con = dbus.Dictionary({
+ '802-3-ethernet': s_wired,
+ 'connection': s_con,
+ 'ipv4': s_ip4,
+ 'ipv6': s_ip6})
+
+
+print "Creating connection:", s_con['id'], "-", s_con['uuid']
+
+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-connection.py b/examples/python/dbus/add-connection.py
index 6df14c103c..5ebb82a38b 100755
--- a/examples/python/dbus/add-connection.py
+++ b/examples/python/dbus/add-connection.py
@@ -18,20 +18,17 @@
#
#
-# This example adds a new ethernet connection via AddConnection() D-Bus call.
+# This example adds a new ethernet connection via the AddConnection()
+# D-Bus call, using the new 'ipv4.address-data' and 'ipv4.gateway'
+# settings introduced in NetworkManager 1.0. Compare
+# add-connection-compat.py, which will work against older versions of
+# NetworkManager as well.
#
# Configuration settings are described at
-# https://developer.gnome.org/NetworkManager/0.9/ref-settings.html
+# https://developer.gnome.org/NetworkManager/1.0/ref-settings.html
#
-import socket, struct, dbus, uuid
-
-# Helper functions
-def ip_to_int(ip_string):
- return struct.unpack("=I", socket.inet_aton(ip_string))[0]
-
-def int_to_ip(ip_int):
- return socket.inet_ntoa(struct.pack("=I", ip_int))
+import dbus, uuid
s_wired = dbus.Dictionary({'duplex': 'full'})
s_con = dbus.Dictionary({
@@ -39,9 +36,12 @@ s_con = dbus.Dictionary({
'uuid': str(uuid.uuid4()),
'id': 'MyConnectionExample'})
-addr1 = dbus.Array([ip_to_int("10.1.2.3"), dbus.UInt32(8L), ip_to_int("10.1.2.1")], signature=dbus.Signature('u'))
+addr1 = dbus.Dictionary({
+ 'address': '10.1.2.3',
+ 'prefix': dbus.UInt32(8L)})
s_ip4 = dbus.Dictionary({
- 'addresses': dbus.Array([addr1], signature=dbus.Signature('au')),
+ 'address-data': dbus.Array([addr1], signature=dbus.Signature('a{sv}')),
+ 'gateway': '10.1.2.1',
'method': 'manual'})
s_ip6 = dbus.Dictionary({'method': 'ignore'})
diff --git a/examples/python/dbus/is-wwan-default.py b/examples/python/dbus/is-wwan-default.py
index 6131cda160..a4a3ff8e71 100755
--- a/examples/python/dbus/is-wwan-default.py
+++ b/examples/python/dbus/is-wwan-default.py
@@ -28,6 +28,8 @@ NM_SERVICE_NAME = "org.freedesktop.NetworkManager"
NM_MANAGER_IFACE = "org.freedesktop.NetworkManager"
DBUS_PROPS_IFACE = "org.freedesktop.DBus.Properties"
+NM_ACTIVE_CONNECTION_INTERFACE = "org.freedesktop.NetworkManager.Connection.Active"
+
bus = dbus.SystemBus()
# Exit early if NetworkManager is not running
@@ -42,34 +44,54 @@ proxy = bus.get_object(NM_SERVICE_NAME, "/org/freedesktop/NetworkManager")
manager = dbus.Interface(proxy, NM_MANAGER_IFACE)
props = dbus.Interface(proxy, DBUS_PROPS_IFACE)
-default_is_wwan = False
+def found_connection_type(ctype):
+ if ctype == '':
+ print "No active connection"
+ elif ctype in ["gsm", "cdma", "bluetooth"]:
+ print "WWAN is default"
+ else:
+ print "WWAN is not default"
+ sys.exit(0)
+
+# Shortcut #1, for NM 1.0
+try:
+ ctype = props.Get(NM_MANAGER_IFACE, "PrimaryConnectionType")
+ found_connection_type(ctype)
+except KeyError:
+ pass
-# Look through all active network connections for the default one
+# Shortcut #2, for NM 0.9.10
+try:
+ primary = props.Get(NM_MANAGER_IFACE, "PrimaryConnection")
+ if not primary:
+ found_connection_type('')
+ primary_proxy = bus.get_object(NM_SERVICE_NAME, primary)
+ primary_props = dbus.Interface(primary_proxy, DBUS_PROPS_IFACE)
+ ctype = primary_props.Get(NM_ACTIVE_CONNECTION_INTERFACE, "Type")
+ found_connection_type(ctype)
+except KeyError:
+ pass
+
+# Fallback for NM 0.9.8 and earlier; look through all active network
+# connections for the default one
+default_is_wwan = False
active = props.Get(NM_MANAGER_IFACE, "ActiveConnections")
for a in active:
a_proxy = bus.get_object(NM_SERVICE_NAME, a)
a_props = dbus.Interface(a_proxy, DBUS_PROPS_IFACE)
- all_props = a_props.GetAll("org.freedesktop.NetworkManager.Connection.Active")
+ all_props = a_props.GetAll(NM_ACTIVE_CONNECTION_INTERFACE)
# Ignore this network connection if it's not default for IPv4 or IPv6
if all_props["Default"] == False and all_props["Default6"] == False:
continue
- # Shortcut: check for Type property (only present in NM 0.9.9+)
- try:
- ctype = all_props["Type"]
- if ctype in ["gsm", "cdma", "bluetooth"]:
- default_is_wwan = True
- break
- except KeyError:
- # Fall back to checking the type of the network connection's device
- dev_path = all_props["Devices"][0]
- dev_proxy = bus.get_object(NM_SERVICE_NAME, dev_path)
- dev_props = dbus.Interface(dev_proxy, DBUS_PROPS_IFACE)
- devtype = dev_props.Get("org.freedesktop.NetworkManager.Device", "DeviceType")
- if devtype == NM_DEVICE_TYPE_MODEM or devtype == NM_DEVICE_TYPE_BLUETOOTH:
- default_is_wwan = True
- break
+ dev_path = all_props["Devices"][0]
+ dev_proxy = bus.get_object(NM_SERVICE_NAME, dev_path)
+ dev_props = dbus.Interface(dev_proxy, DBUS_PROPS_IFACE)
+ devtype = dev_props.Get("org.freedesktop.NetworkManager.Device", "DeviceType")
+ if devtype == NM_DEVICE_TYPE_MODEM or devtype == NM_DEVICE_TYPE_BLUETOOTH:
+ default_is_wwan = True
+ break
if default_is_wwan:
print "WWAN is default"
diff --git a/examples/python/dbus/nm-state.py b/examples/python/dbus/nm-state.py
index 94fa630999..176090f7c7 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/update-ip4-method.py b/examples/python/dbus/update-ip4-method.py
index bf14f7f9cc..28a222899b 100755
--- a/examples/python/dbus/update-ip4-method.py
+++ b/examples/python/dbus/update-ip4-method.py
@@ -21,15 +21,14 @@
#
# This example updates a connection's IPv4 method with the Update() method.
#
+# This uses the new NM 1.0 setting properties. See add-connection-compat.py
+# for a similar example using the backward-compatible properties
+#
# Configuration settings are described at
-# https://developer.gnome.org/NetworkManager/0.9/ref-settings.html
+# https://developer.gnome.org/NetworkManager/1.0/ref-settings.html
#
-import socket, struct, dbus, sys
-
-def ip_to_int(ip_string):
- return struct.unpack("=I", socket.inet_aton(ip_string))[0]
-
+import dbus, sys
if len(sys.argv) < 3:
print "Usage: %s <uuid> <auto|static> [address prefix gateway]" % sys.argv[0]
@@ -61,18 +60,22 @@ for c_path in settings.ListConnections():
if 'ipv4' not in c_settings:
c_settings['ipv4'] = {}
+ # clear existing address info
+ if c_settings['ipv4'].has_key('addresses'):
+ del c_settings['ipv4']['addresses']
+ if c_settings['ipv4'].has_key('address-data'):
+ del c_settings['ipv4']['address-data']
+ if c_settings['ipv4'].has_key('gateway'):
+ del c_settings['ipv4']['gateway']
+
# set the method and change properties
c_settings['ipv4']['method'] = method
- if method == "auto":
- # remove addresses
- c_settings['ipv4']['addresses'] = dbus.Array([], signature=dbus.Signature('au'))
- elif method == "manual":
+ if method == "manual":
# Add the static IP address, prefix, and (optional) gateway
- gw = 0
+ addr = dbus.Dictionary({'address': sys.argv[3], 'prefix': dbus.UInt32(int(sys.argv[4]))})
+ c_settings['ipv4']['address-data'] = dbus.Array([addr], signature=dbus.Signature('a{sv}'))
if len(sys.argv) == 6:
- gw = ip_to_int(sys.argv[5])
- addr = dbus.Array([ip_to_int(sys.argv[3]), dbus.UInt32(int(sys.argv[4])), gw], signature=dbus.Signature('u'))
- c_settings['ipv4']['addresses'] = dbus.Array([addr], signature=dbus.Signature('au'))
+ c_settings['ipv4']['gateway'] = sys.argv[5]
# Save all the updated settings back to NetworkManager
c_obj.Update(c_settings)
diff --git a/examples/python/dbus/vpn.py b/examples/python/dbus/vpn.py
index 59773a61fb..d60e470e05 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/gi/Makefile.am b/examples/python/gi/Makefile.am
index dcf2dff090..0212fbbad2 100644
--- a/examples/python/gi/Makefile.am
+++ b/examples/python/gi/Makefile.am
@@ -6,4 +6,5 @@ EXTRA_DIST = \
get_ips.py \
add_connection.py \
get-active-connections.py \
- update-ip4-method.py
+ update-ip4-method.py \
+ deactivate-all.py
diff --git a/examples/python/gi/add_connection.py b/examples/python/gi/add_connection.py
index 10623b6ec6..666509906d 100755
--- a/examples/python/gi/add_connection.py
+++ b/examples/python/gi/add_connection.py
@@ -48,10 +48,10 @@ def create_profile(name):
s_wired = NM.SettingWired.new()
s_ip4 = NM.SettingIP4Config.new()
- s_ip4.set_property(NM.SETTING_IP4_CONFIG_METHOD, "auto")
+ s_ip4.set_property(NM.SETTING_IP_CONFIG_METHOD, "auto")
s_ip6 = NM.SettingIP6Config.new()
- s_ip6.set_property(NM.SETTING_IP6_CONFIG_METHOD, "auto")
+ s_ip6.set_property(NM.SETTING_IP_CONFIG_METHOD, "auto")
profile.add_setting(s_con)
profile.add_setting(s_ip4)
@@ -64,11 +64,12 @@ def create_profile(name):
return profile
# callback function
-def added_cb(settings, con, error, data):
- if error is (None):
+def added_cb(client, result, data):
+ try:
+ client.add_connection_finish(result)
print("The connection profile has been succesfully added to NetworkManager.")
- else:
- print(error)
+ except Exception, e:
+ sys.stderr.write("Error: %s\n" % e)
main_loop.quit()
if __name__ == "__main__":
@@ -85,17 +86,14 @@ if __name__ == "__main__":
main_loop = GLib.MainLoop()
- # create RemoteSettings object
- settings = NM.RemoteSettings.new(None)
+ # create Client object
+ client = NM.Client.new(None)
# create a connection profile for NM
con = create_profile(profile_name)
# send the connection to NM
- if persistent:
- settings.add_connection(con, added_cb, None)
- else:
- settings.add_connection_unsaved(con, added_cb, None)
+ client.add_connection_async(con, persistent, None, added_cb, None)
main_loop.run()
diff --git a/examples/python/gi/deactivate-all.py b/examples/python/gi/deactivate-all.py
new file mode 100755
index 0000000000..571f3fe407
--- /dev/null
+++ b/examples/python/gi/deactivate-all.py
@@ -0,0 +1,81 @@
+#!/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
+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 [<type>]\nAllowed types: %s' % (sys.argv[0], allowed_types))
+ else:
+ sys.exit('Usage: %s [<type>]\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 8ec59fa0e1..10add3e631 100755
--- a/examples/python/gi/firewall-zone.py
+++ b/examples/python/gi/firewall-zone.py
@@ -48,8 +48,8 @@ if __name__ == "__main__":
sys.exit('Usage: %s <connection name or UUID> [new zone]' % sys.argv[0])
main_loop = GLib.MainLoop()
- settings = NM.RemoteSettings.new(None)
- connections = settings.list_connections()
+ client = NM.Client.new(None)
+ connections = client.get_connections()
con_name = sys.argv[1]
if len(sys.argv) == 3:
@@ -75,5 +75,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/get_ips.py b/examples/python/gi/get_ips.py
index f2f1e46ed3..690bd6ef89 100755
--- a/examples/python/gi/get_ips.py
+++ b/examples/python/gi/get_ips.py
@@ -20,7 +20,7 @@
# Copyright 2014 Red Hat, Inc.
#
-import sys, socket, struct
+import sys, socket
from gi.repository import GLib, NM
#
@@ -28,11 +28,11 @@ from gi.repository import GLib, NM
# from NMIP4Config and NMIP6Config (got out of NMDevice)
#
-def show_addresses(self, family):
+def show_addresses(dev, family):
if (family == socket.AF_INET):
- ip_cfg = self.get_ip4_config()
+ ip_cfg = dev.get_ip4_config()
else:
- ip_cfg = self.get_ip6_config()
+ ip_cfg = dev.get_ip6_config()
if ip_cfg is None:
print("None")
@@ -46,24 +46,29 @@ def show_addresses(self, family):
for nm_address in nm_addresses:
addr = nm_address.get_address()
prefix = nm_address.get_prefix()
- gateway = nm_address.get_gateway()
- if (family == socket.AF_INET):
- addr_struct = struct.pack("=I", addr)
- gateway_struct = struct.pack("=I", gateway)
- else:
- addr_struct = addr
- gateway_struct = gateway
- print("%s/%d %s") % (socket.inet_ntop(family, addr_struct),
- prefix,
- socket.inet_ntop(family, gateway_struct))
+ print("%s/%d") % (addr, prefix)
+def show_gateway(dev, family):
+ if (family == socket.AF_INET):
+ ip_cfg = dev.get_ip4_config()
+ else:
+ ip_cfg = dev.get_ip6_config()
+
+ if ip_cfg is None:
+ gw = "None"
+ else:
+ gw = ip_cfg.get_gateway()
+ if gw == '':
+ gw = "None"
-def show_routes(self, family):
+ print(gw)
+
+def show_routes(dev, family):
if (family == socket.AF_INET):
- ip_cfg = self.get_ip4_config()
+ ip_cfg = dev.get_ip4_config()
else:
- ip_cfg = self.get_ip6_config()
+ ip_cfg = dev.get_ip6_config()
if ip_cfg is None:
print("None")
@@ -80,23 +85,14 @@ def show_routes(self, family):
next_hop = nm_route.get_next_hop()
metric = nm_route.get_metric()
- if (family == socket.AF_INET):
- dest_struct = struct.pack("=I", dest)
- next_hop_struct = struct.pack("=I", next_hop)
- else:
- dest_struct = dest
- next_hop_struct = next_hop
- print("%s/%d %s %d") % (socket.inet_ntop(family, dest_struct),
- prefix,
- socket.inet_ntop(family, next_hop_struct),
- metric)
+ print("%s/%d %s %d") % (dest, prefix, next_hop, metric)
-def show_dns(self, family):
+def show_dns(dev, family):
if (family == socket.AF_INET):
- ip_cfg = self.get_ip4_config()
+ ip_cfg = dev.get_ip4_config()
else:
- ip_cfg = self.get_ip6_config()
+ ip_cfg = dev.get_ip6_config()
if ip_cfg is None:
print("None")
@@ -126,6 +122,11 @@ if __name__ == "__main__":
show_addresses(dev, socket.AF_INET)
print
+ print("IPv4 gateway:")
+ print("-------------")
+ show_gateway(dev, socket.AF_INET)
+ print
+
print("IPv4 routes:")
print("------------")
show_routes(dev, socket.AF_INET)
@@ -136,6 +137,11 @@ if __name__ == "__main__":
show_addresses(dev, socket.AF_INET6)
print
+ print("IPv6 gateway:")
+ print("-------------")
+ show_gateway(dev, socket.AF_INET6)
+ print
+
print "IPv6 routes:"
print("------------")
show_routes(dev, socket.AF_INET6)
diff --git a/examples/python/gi/list-connections.py b/examples/python/gi/list-connections.py
index b44ca1b858..34b559fc66 100755
--- a/examples/python/gi/list-connections.py
+++ b/examples/python/gi/list-connections.py
@@ -23,21 +23,16 @@
from gi.repository import NM
# This example asks settings service for all configured connections.
-# Unfortunately, at this time since libnm still makes heavy use of
-# GValue and GHashTable (rather than GVariant), libnm isn't fully
-# usable from GObject Introspection-ready languages. Most functions will
-# work fine, but e.g. nm_connection_to_dbus() causes failures.
-
def print_values(setting, key, value, flags, data):
print " %s.%s: %s" % (setting.get_name(), key, value)
if __name__ == "__main__":
- # create RemoteSettings object
- settings = NM.RemoteSettings.new(None)
+ # create Client object
+ client = NM.Client.new(None)
# get all connections
- connections = settings.list_connections()
+ connections = client.get_connections()
# print the connections' details
for c in connections:
diff --git a/examples/python/gi/show-wifi-networks.py b/examples/python/gi/show-wifi-networks.py
index c76d1c4cb9..7f3bd2dbb0 100755
--- a/examples/python/gi/show-wifi-networks.py
+++ b/examples/python/gi/show-wifi-networks.py
@@ -20,6 +20,7 @@
# Copyright (C) 2013 Red Hat, Inc.
#
+import locale
from gi.repository import NM
#
@@ -31,22 +32,20 @@ from gi.repository import NM
# an error without it: http://www.python.org/dev/peps/pep-0263/
#
-signal_bars = {
- 0 : "____",
- 1 : "â–‚___",
- 2 : "â–‚â–„__",
- 3 : "â–‚â–„â–†_",
- 4 : "▂▄▆█"
-}
-
def clamp(value, minvalue, maxvalue):
return max(minvalue, min(value, maxvalue))
+def ssid_to_utf8(ap):
+ ssid = ap.get_ssid()
+ if not ssid:
+ return ""
+ return NM.utils_ssid_to_utf8(ap.get_ssid().get_data())
+
def print_device_info(device):
active_ap = dev.get_active_access_point()
ssid = None
if active_ap is not None:
- ssid = active_ap.get_ssid()
+ ssid = ssid_to_utf8(active_ap)
info = "Device: %s | Driver: %s | Active AP: %s" % (dev.get_iface(), dev.get_driver(), ssid)
print info
print '=' * len(info)
@@ -54,14 +53,19 @@ def print_device_info(device):
def print_ap_info(ap):
strength = ap.get_strength()
frequency = ap.get_frequency()
- print "SSID: %s" % (ap.get_ssid())
+ 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 "Strength: %s %s%%" % (signal_bars[(clamp(strength-5, 0, 99)+24)/25], strength)
+ print "Strength: %s %s%%" % (NM.utils_wifi_strength_bars(strength), strength)
print
if __name__ == "__main__":
+ # Python apparently doesn't call setlocale() on its own? We have to call this or else
+ # NM.utils_wifi_strength_bars() will think the locale is ASCII-only, and return the
+ # fallback characters rather than the unicode bars
+ locale.setlocale(locale.LC_ALL, '')
+
nmc = NM.Client.new(None)
devs = nmc.get_devices()
diff --git a/examples/python/gi/update-ip4-method.py b/examples/python/gi/update-ip4-method.py
index 79889232ca..2aa4af3068 100755
--- a/examples/python/gi/update-ip4-method.py
+++ b/examples/python/gi/update-ip4-method.py
@@ -24,22 +24,11 @@
# using the libnm GObject-based convenience APIs.
#
# Configuration settings are described at
-# https://developer.gnome.org/NetworkManager/0.9/ref-settings.html
+# https://developer.gnome.org/NetworkManager/1.0/ref-settings.html
#
from gi.repository import GLib, NM
-import sys, struct, socket
-
-def ip_to_int(ip_string):
- return struct.unpack("=I", socket.inet_aton(ip_string))[0]
-
-# callback function
-def commit_cb(connection, error, data):
- if error is (None):
- print("The connection profile has been updated.")
- else:
- print(error)
- main_loop.quit()
+import sys, socket
if __name__ == "__main__":
# parse and validate arguments
@@ -48,7 +37,7 @@ if __name__ == "__main__":
sys.exit(1)
method = sys.argv[2]
- if method == "static" or method == "manual" and len(sys.argv) < 5:
+ if (method == "static" or method == "manual") and len(sys.argv) < 5:
print "Usage: %s %s static address prefix [gateway]" % (sys.argv[0], sys.argv[1])
sys.exit(1)
@@ -60,10 +49,10 @@ if __name__ == "__main__":
main_loop = GLib.MainLoop()
- # create RemoteSettings object
- settings = NM.RemoteSettings.new(None)
+ # create Client object
+ client = NM.Client.new(None)
- all_connections = settings.list_connections()
+ all_connections = client.get_connections()
for c in all_connections:
if c.get_uuid() != uuid:
continue
@@ -75,21 +64,22 @@ if __name__ == "__main__":
c.add_setting(s_ip4)
# set the method and change properties
- s_ip4.set_property(NM.SETTING_IP4_CONFIG_METHOD, method)
+ s_ip4.set_property(NM.SETTING_IP_CONFIG_METHOD, method)
if method == "auto":
- # remove addresses
+ # remove addresses and gateway
s_ip4.clear_addresses()
+ s_ip4.props.gateway = None
elif method == "manual":
# Add the static IP address, prefix, and (optional) gateway
- addr = NM.IP4Address.new()
- addr.set_address(ip_to_int(sys.argv[3]))
- addr.set_prefix(int(sys.argv[4]))
- if len(sys.argv) == 6:
- addr.set_gateway(ip_to_int(sys.argv[5]))
+ addr = NM.IPAddress.new(socket.AF_INET, sys.argv[3], int(sys.argv[4]))
s_ip4.add_address(addr)
-
- c.commit_changes(commit_cb, None)
-
- # run main loop
- main_loop.run()
+ if len(sys.argv) == 6:
+ s_ip4.props.gateway = sys.argv[5]
+
+ try:
+ c.commit_changes(True, None)
+ print("The connection profile has been updated.")
+ except Exception, e:
+ sys.stderr.write("Error: %s\n" % e)
+ break
diff --git a/examples/ruby/add-connection.rb b/examples/ruby/add-connection.rb
index 6af723bf13..645ad34865 100755
--- a/examples/ruby/add-connection.rb
+++ b/examples/ruby/add-connection.rb
@@ -27,8 +27,13 @@ require 'ipaddr'
# It also shows how to specify D-Bus signature for properties like "addresses"
# and "clone-mac-address".
#
+# This uses the old, backwards-compatible settings properties. The new 1.0
+# properties (eg, 'address-data' rather than 'addresses') would make this simpler;
+# see the python add-connection.py and add-connection-compat.py examples for
+# details
+#
# Configuration settings are described here:
-# https://developer.gnome.org/NetworkManager/0.9/ref-settings.html
+# https://developer.gnome.org/NetworkManager/1.0/ref-settings.html
#
# Helper functions
diff --git a/examples/shell/active-wifi.sh b/examples/shell/active-wifi.sh
index 1c9466b7a6..2ff5419017 100755
--- a/examples/shell/active-wifi.sh
+++ b/examples/shell/active-wifi.sh
@@ -76,7 +76,7 @@ show_active_ssids()
BSSID=`get_property $ACTIVE_AP $ACCESS_POINT_IFACE "HwAddress"`
echo "Device '$INTERFACE' is connected to '$SSID' (BSSID=$BSSID)"
else
- echo "No active AP on device '$INTERFACE'"
+ echo "No active AP on device '$INTERFACE'" >&2
fi
fi
done
diff --git a/examples/shell/disconnect-device.sh b/examples/shell/disconnect-device.sh
index 045d64d7f6..e8af42fccf 100755
--- a/examples/shell/disconnect-device.sh
+++ b/examples/shell/disconnect-device.sh
@@ -61,7 +61,7 @@ disconnect_device ()
fi
done
- echo "Device with interface '$1' not found."
+ echo "Device with interface '$1' not found." >&2
return 1
}
@@ -70,7 +70,7 @@ disconnect_device ()
if [ ! -n "$1" ]; then
echo "Usage: `basename $0` <interface name>"
exit 2
-fi
+fi
# disconnect device
disconnect_device $1
diff --git a/include/gsystem-local-alloc.h b/include/gsystem-local-alloc.h
index 68b1227425..51b6251974 100644
--- a/include/gsystem-local-alloc.h
+++ b/include/gsystem-local-alloc.h
@@ -43,22 +43,6 @@ G_BEGIN_DECLS
* 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_DEFINE_CLEANUP_FUNCTION0(GArray*, gs_local_array_unref, g_array_unref)
-GS_DEFINE_CLEANUP_FUNCTION0(GBytes*, gs_local_bytes_unref, g_bytes_unref)
-GS_DEFINE_CLEANUP_FUNCTION0(GChecksum*, gs_local_checksum_free, g_checksum_free)
-GS_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, gs_local_keyfile_unref, g_key_file_unref)
-GS_DEFINE_CLEANUP_FUNCTION0(GError*, gs_local_free_error, g_error_free)
-GS_DEFINE_CLEANUP_FUNCTION0(GHashTable*, gs_local_hashtable_unref, g_hash_table_unref)
-GS_DEFINE_CLEANUP_FUNCTION(GList*, gs_local_free_list, g_list_free)
-GS_DEFINE_CLEANUP_FUNCTION(GSList*, gs_local_free_slist, g_slist_free)
-GS_DEFINE_CLEANUP_FUNCTION0(GObject*, gs_local_obj_unref, g_object_unref)
-GS_DEFINE_CLEANUP_FUNCTION0(GPtrArray*, gs_local_ptrarray_unref, g_ptr_array_unref)
-GS_DEFINE_CLEANUP_FUNCTION0(GVariant*, gs_local_variant_unref, g_variant_unref)
-GS_DEFINE_CLEANUP_FUNCTION0(GVariantBuilder*, gs_local_variant_builder_unref, g_variant_builder_unref)
-GS_DEFINE_CLEANUP_FUNCTION0(GVariantIter*, gs_local_variant_iter_free, g_variant_iter_free)
-
-GS_DEFINE_CLEANUP_FUNCTION(char**, gs_local_strfreev, g_strfreev)
-GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
/**
* gs_free:
@@ -66,6 +50,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_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:
@@ -75,6 +60,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* %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:
@@ -84,6 +70,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* %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:
@@ -92,6 +79,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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:
@@ -100,6 +88,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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:
@@ -110,6 +99,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
*/
#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:
@@ -120,6 +110,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
*/
#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:
@@ -129,6 +120,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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:
@@ -137,6 +129,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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:
@@ -145,6 +138,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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:
@@ -154,6 +148,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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:
@@ -163,6 +158,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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:
@@ -170,6 +166,7 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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:
@@ -177,6 +174,34 @@ GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
* 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
diff --git a/include/nm-dbus-glib-types.h b/include/nm-dbus-glib-types.h
index 66f45685a7..ad11ab6812 100644
--- a/include/nm-dbus-glib-types.h
+++ b/include/nm-dbus-glib-types.h
@@ -37,4 +37,9 @@
#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
index 7a9bb3160a..1dc939feac 100644
--- a/include/nm-glib-compat.h
+++ b/include/nm-glib-compat.h
@@ -59,23 +59,22 @@ __g_type_ensure (GType type)
#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); \
- \
- (void) (0 ? (gpointer) *(pp) : 0); \
- do \
- _p = g_atomic_pointer_get (_pp); \
- while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_pp, _p, NULL)); \
- \
- if (_p) \
- _destroy (_p); \
- } G_STMT_END
+#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.
diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h
index 11ffd33033..ddea03745d 100644
--- a/include/nm-test-utils.h
+++ b/include/nm-test-utils.h
@@ -32,6 +32,7 @@
#include <errno.h>
#include "nm-utils.h"
+#include "nm-utils-internal.h"
#include "nm-glib-compat.h"
#include "gsystem-local-alloc.h"
@@ -75,7 +76,14 @@ struct __nmtst_internal
extern struct __nmtst_internal __nmtst_internal;
#define NMTST_DEFINE() \
- struct __nmtst_internal __nmtst_internal = { 0 };
+struct __nmtst_internal __nmtst_internal = { 0 }; \
+\
+__attribute__ ((destructor)) static void \
+_nmtst_exit (void) \
+{ \
+ nmtst_free (); \
+ g_test_assert_expected_messages (); \
+}
inline static gboolean
@@ -84,13 +92,13 @@ nmtst_initialized (void)
return !!__nmtst_internal.rand0;
}
-#define __NMTST_LOG(cmd, fmt, ...) \
+#define __NMTST_LOG(cmd, ...) \
G_STMT_START { \
g_assert (nmtst_initialized ()); \
if (!__nmtst_internal.assert_logging || __nmtst_internal.no_expect_message) { \
- cmd (fmt, __VA_ARGS__); \
+ cmd (__VA_ARGS__); \
} else { \
- printf (fmt "\n", __VA_ARGS__); \
+ printf (_NM_UTILS_MACRO_FIRST (__VA_ARGS__) "\n" _NM_UTILS_MACRO_REST (__VA_ARGS__)); \
} \
} G_STMT_END
@@ -163,8 +171,6 @@ nmtst_free (void)
inline static void
__nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_level, const char *log_domains)
{
- static gsize atexit_registered = 0;
- GError *error = NULL;
const char *nmtst_debug;
gboolean is_debug = FALSE;
char *c_log_level = NULL, *c_log_domains = NULL;
@@ -276,6 +282,18 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
* 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);
+ 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
@@ -300,10 +318,6 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
}
- if (!nm_utils_init (&error))
- g_error ("failed to initialize libnm-util: %s", error->message);
- g_assert (!error);
-
/* 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));
@@ -312,11 +326,6 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
g_free (c_log_level);
g_free (c_log_domains);
- if (g_once_init_enter (&atexit_registered)) {
- atexit (nmtst_free);
- g_once_init_leave (&atexit_registered, 1);
- }
-
#ifdef __NETWORKMANAGER_UTILS_H__
/* ensure that monotonic timestamp is called (because it initially logs a line) */
nm_utils_get_monotonic_timestamp_s ();
@@ -568,6 +577,39 @@ __nmtst_spawn_sync (const char *working_directory, char **standard_out, char **s
/*******************************************************************************/
+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 *
@@ -678,7 +720,7 @@ nmtst_platform_ip6_routes_equal (const NMPlatformIP6Route *a, const NMPlatformIP
inline static NMIP4Config *
nmtst_ip4_config_clone (NMIP4Config *config)
{
- NMIP4Config *copy = nm_ip4_config_new ();
+ NMIP4Config *copy = nm_ip4_config_new (-1);
g_assert (copy);
g_assert (config);
@@ -694,7 +736,7 @@ nmtst_ip4_config_clone (NMIP4Config *config)
inline static NMIP6Config *
nmtst_ip6_config_clone (NMIP6Config *config)
{
- NMIP6Config *copy = nm_ip6_config_new ();
+ NMIP6Config *copy = nm_ip6_config_new (-1);
g_assert (copy);
g_assert (config);
@@ -704,7 +746,7 @@ nmtst_ip6_config_clone (NMIP6Config *config)
#endif
-#ifdef __NM_SIMPLE_CONNECTION_H__
+#if defined(__NM_SIMPLE_CONNECTION_H__) && defined(__NM_SETTING_CONNECTION_H__)
inline static NMConnection *
nmtst_create_minimal_connection (const char *id, const char *uuid, const char *type, NMSettingConnection **out_s_con)
@@ -829,19 +871,40 @@ nmtst_assert_connection_equals (NMConnection *a, gboolean normalize_a, NMConnect
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) {
+ if (!compare || out_settings) {
const char *name, *pname;
GHashTable *setting;
GHashTableIter iter, iter2;
- 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);
+ __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, out_settings);
- while (g_hash_table_iter_next (&iter2, (gpointer *) &pname, NULL))
- __NMTST_LOG (g_message, ">>> differences in setting '%s.%s':", name, pname);
+ 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);
+ }
}
+
+#ifdef __NM_KEYFILE_INTERNAL_H__
+ {
+ gs_unref_keyfile GKeyFile *kf_a = NULL, *kf_b = NULL;
+ gs_free char *str_a = NULL, *str_b = NULL;
+
+ kf_a = nm_keyfile_write (a, NULL, NULL, NULL);
+ kf_b = nm_keyfile_write (b, NULL, NULL, NULL);
+
+ if (kf_a)
+ str_a = g_key_file_to_data (kf_a, NULL, NULL);
+ if (kf_b)
+ str_b = g_key_file_to_data (kf_b, NULL, NULL);
+
+ __NMTST_LOG (g_message, ">>> Connection A as kf (*WARNING: keyfile representation might not show the difference*):\n%s", str_a);
+ __NMTST_LOG (g_message, ">>> Connection B as kf (*WARNING: keyfile representation might not show the difference*):\n%s", str_b);
+ }
+#endif
}
g_assert (compare);
g_assert (!out_settings);
@@ -950,19 +1013,40 @@ nmtst_assert_connection_unnormalizable (NMConnection *con,
g_clear_error (&error);
}
-#endif
+inline static void
+nmtst_assert_setting_verifies (NMSetting *setting)
+{
+ /* assert that the setting verifies without an error */
-static inline void
-nmtst_assert_ip4_address_equals (guint32 addr, const char *expected, const char *loc)
+ 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)
{
- guint32 addr2 = nmtst_inet4_from_string (expected);
+ /* assert that the setting verification fails */
+
+ GError *error = NULL;
+ gboolean success;
- if (addr != addr2)
- g_error ("assert: %s: ip4 address '%s' expected, but got %s",
- loc, expected ? expected : "any", nm_utils_inet4_ntop (addr, NULL));
+ 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);
}
-#define nmtst_assert_ip4_address_equals(addr, expected) \
- nmtst_assert_ip4_address_equals (addr, expected, G_STRLOC)
+
+#endif
#ifdef __NM_UTILS_H__
static inline void
@@ -999,6 +1083,36 @@ nmtst_assert_hwaddr_equals (gconstpointer hwaddr1, gssize hwaddr1_len, const cha
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 {
@@ -1037,8 +1151,8 @@ typedef enum {
g_variant_builder_add (&__setting_builder, "{sv}", \
__cur_property_name, \
__property_val); \
- } else \
- g_variant_unref (__property_val); \
+ } \
+ g_variant_unref (__property_val); \
} \
\
if (__cur_setting_name) \
diff --git a/include/nm-utils-internal.h b/include/nm-utils-internal.h
index 4f5850aace..7ca44f3c4b 100644
--- a/include/nm-utils-internal.h
+++ b/include/nm-utils-internal.h
@@ -82,4 +82,82 @@
/********************************************************/
+/* macro to return strlen() of a compile time string. */
+#define STRLEN(str) ( sizeof ("" str) - 1 )
+
+#define NM_IN_SET(x, y, ...) \
+ ({ \
+ const typeof(y) _y = (y); \
+ typeof(_y) _x = (x); \
+ unsigned _i; \
+ gboolean _found = FALSE; \
+ for (_i = 0; _i < 1 + sizeof((typeof(_x)[]) { __VA_ARGS__ })/sizeof(typeof(_x)); _i++) { \
+ if (((typeof(_x)[]) { _y, __VA_ARGS__ })[_i] == _x) { \
+ _found = TRUE; \
+ break; \
+ } \
+ } \
+ _found; \
+ })
+
+/*****************************************************************************/
+
+#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)
+
+/*****************************************************************************/
+
#endif
diff --git a/introspection/nm-device-vlan.xml b/introspection/nm-device-vlan.xml
index 54b7bbe482..992340e009 100644
--- a/introspection/nm-device-vlan.xml
+++ b/introspection/nm-device-vlan.xml
@@ -15,6 +15,12 @@
</tp:docstring>
</property>
+ <property name="Parent" type="o" access="read">
+ <tp:docstring>
+ Object path of the parent device of this VLAN device.
+ </tp:docstring>
+ </property>
+
<property name="VlanId" type="u" access="read">
<tp:docstring>
The VLAN ID of this VLAN interface.
diff --git a/introspection/nm-device-wifi.xml b/introspection/nm-device-wifi.xml
index 2476fd7dd9..7d4d73c9db 100644
--- a/introspection/nm-device-wifi.xml
+++ b/introspection/nm-device-wifi.xml
@@ -37,7 +37,7 @@
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="options" type="a{sv}" direction="in">
<tp:docstring>
- Options of scan
+ Options of scan (currently unused argument).
</tp:docstring>
</arg>
<tp:docstring>
diff --git a/introspection/nm-ip4-config.xml b/introspection/nm-ip4-config.xml
index 6a8750b7f6..9807653495 100644
--- a/introspection/nm-ip4-config.xml
+++ b/introspection/nm-ip4-config.xml
@@ -2,20 +2,42 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.IP4Config">
+ <property name="Addresses" type="aau" access="read">
+ <tp:docstring>
+ Array of arrays of IPv4 address/prefix/gateway. All 3
+ elements of each array are in network byte order. Essentially:
+ [(addr, prefix, gateway), (addr, prefix, gateway), ...]
+
+ Deprecated: use AddressData and Gateway
+ </tp:docstring>
+ </property>
+ <property name="AddressData" type="aa{sv}" access="read">
+ <tp:docstring>
+ Array of IP address data objects. All addresses will include
+ "address" (an IP address string), and "prefix" (a uint). Some
+ addresses may include additional attributes.
+ </tp:docstring>
+ </property>
<property name="Gateway" type="s" access="read">
<tp:docstring>The gateway in use.</tp:docstring>
</property>
- <property name="Addresses" type="aau" access="read">
- <tp:docstring>Array of tuples of IPv4 address/prefix/gateway. All 3
- elements of each tuple are in network byte order. Essentially:
- [(addr, prefix, gateway), (addr, prefix, gateway), ...]
+ <property name="Routes" type="aau" access="read">
+ <tp:docstring>
+ Arrays of IPv4 route/prefix/next-hop/metric. All 4 elements of
+ each tuple are in network byte order. 'route' and 'next hop'
+ are IPv4 addresses, while prefix and metric are simple
+ unsigned integers. Essentially: [(route, prefix, next-hop,
+ metric), (route, prefix, next-hop, metric), ...]
+
+ Deprecated: use RouteData
</tp:docstring>
</property>
- <property name="Routes" type="aau" access="read">
- <tp:docstring>Tuples of IPv4 route/prefix/next-hop/metric. All 4 elements
- of each tuple are in network byte order. 'route' and 'next hop' are IPv4
- addresses, while prefix and metric are simple unsigned integers. Essentially:
- [(route, prefix, next-hop, metric), (route, prefix, next-hop, metric), ...]
+ <property name="RouteData" type="aa{sv}" access="read">
+ <tp:docstring>
+ Array of IP route data objects. All routes will include "dest"
+ (an IP address string) and "prefix" (a uint). Some routes may
+ include "next-hop" (an IP address string), "metric" (a uint),
+ and additional attributes.
</tp:docstring>
</property>
<property name="Nameservers" type="au" access="read">
diff --git a/introspection/nm-ip6-config.xml b/introspection/nm-ip6-config.xml
index 55c519e701..985dd2e331 100644
--- a/introspection/nm-ip6-config.xml
+++ b/introspection/nm-ip6-config.xml
@@ -2,14 +2,37 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.IP6Config">
+ <property name="Addresses" type="a(ayuay)" access="read">
+ <tp:docstring>
+ Array of tuples of IPv6 address/prefix/gateway.
+
+ Deprecated: use AddressData and Gateway.
+ </tp:docstring>
+ </property>
+ <property name="AddressData" type="aa{sv}" access="read">
+ <tp:docstring>
+ Array of IP address data objects. All addresses will include
+ "address" (an IP address string), and "prefix" (a uint). Some
+ addresses may include additional attributes.
+ </tp:docstring>
+ </property>
<property name="Gateway" type="s" access="read">
<tp:docstring>The gateway in use.</tp:docstring>
</property>
- <property name="Addresses" type="a(ayuay)" access="read">
- <tp:docstring>Tuples of IPv6 address/prefix/gateway.</tp:docstring>
- </property>
<property name="Routes" type="a(ayuayu)" access="read">
- <tp:docstring>Tuples of IPv6 route/prefix/next-hop/metric.</tp:docstring>
+ <tp:docstring>
+ Tuples of IPv6 route/prefix/next-hop/metric.
+
+ Deprecated: use RouteData
+ </tp:docstring>
+ </property>
+ <property name="RouteData" type="aa{sv}" access="read">
+ <tp:docstring>
+ Array of IP route data objects. All routes will include "dest"
+ (an IP address string) and "prefix" (a uint). Some routes may
+ include "next-hop" (an IP address string), "metric" (a uint),
+ and additional attributes.
+ </tp:docstring>
</property>
<property name="Nameservers" type="aay" access="read">
<tp:docstring>The nameservers in use.</tp:docstring>
diff --git a/libnm-core/Makefile.am b/libnm-core/Makefile.am
index 785db1d7df..8fab84bcbf 100644
--- a/libnm-core/Makefile.am
+++ b/libnm-core/Makefile.am
@@ -5,6 +5,7 @@ SUBDIRS = . tests
AM_CPPFLAGS = \
-I${top_srcdir}/include \
-DG_LOG_DOMAIN=\""libnm"\" \
+ -DLOCALEDIR=\"$(datadir)/locale\" \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
diff --git a/libnm-core/Makefile.libnm-core b/libnm-core/Makefile.libnm-core
index 481fc806ac..09a80c714b 100644
--- a/libnm-core/Makefile.libnm-core
+++ b/libnm-core/Makefile.libnm-core
@@ -24,6 +24,7 @@ libnm_core_headers = \
$(core)/nm-setting-generic.h \
$(core)/nm-setting-gsm.h \
$(core)/nm-setting-infiniband.h \
+ $(core)/nm-setting-ip-config.h \
$(core)/nm-setting-ip4-config.h \
$(core)/nm-setting-ip6-config.h \
$(core)/nm-setting-olpc-mesh.h \
@@ -47,6 +48,8 @@ libnm_core_private_headers = \
$(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
@@ -56,6 +59,9 @@ libnm_core_sources = \
$(core)/crypto.c \
$(core)/nm-connection.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 \
@@ -69,6 +75,7 @@ libnm_core_sources = \
$(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 \
diff --git a/libnm-core/crypto.c b/libnm-core/crypto.c
index a695747109..205d22c613 100644
--- a/libnm-core/crypto.c
+++ b/libnm-core/crypto.c
@@ -28,7 +28,7 @@
#include <strings.h>
#include <unistd.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "crypto.h"
#include "nm-errors.h"
@@ -78,7 +78,7 @@ find_tag (const char *tag,
static GByteArray *
parse_old_openssl_key_file (const guint8 *data,
gsize data_len,
- int key_type,
+ NMCryptoKeyType *out_key_type,
char **out_cipher,
char **out_iv,
GError **error)
@@ -89,6 +89,7 @@ parse_old_openssl_key_file (const guint8 *data,
gsize start = 0, end = 0;
GString *str = NULL;
int enc_tags = 0;
+ NMCryptoKeyType key_type;
char *iv = NULL;
char *cipher = NULL;
unsigned char *tmp = NULL;
@@ -97,20 +98,19 @@ parse_old_openssl_key_file (const guint8 *data,
const char *end_tag;
guint8 save_end = 0;
- switch (key_type) {
- case NM_CRYPTO_KEY_TYPE_RSA:
+ *out_key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN;
+ *out_iv = NULL;
+ *out_cipher = NULL;
+
+ if (find_tag (PEM_RSA_KEY_BEGIN, data, data_len, 0, &start)) {
+ key_type = NM_CRYPTO_KEY_TYPE_RSA;
start_tag = PEM_RSA_KEY_BEGIN;
end_tag = PEM_RSA_KEY_END;
- break;
- case NM_CRYPTO_KEY_TYPE_DSA:
+ } else if (find_tag (PEM_DSA_KEY_BEGIN, data, data_len, 0, &start)) {
+ key_type = NM_CRYPTO_KEY_TYPE_DSA;
start_tag = PEM_DSA_KEY_BEGIN;
end_tag = PEM_DSA_KEY_END;
- break;
- default:
- g_assert_not_reached ();
- }
-
- if (!find_tag (start_tag, data, data_len, 0, &start))
+ } else
goto parse_error;
start += strlen (start_tag);
@@ -144,7 +144,7 @@ parse_old_openssl_key_file (const guint8 *data,
continue;
if (!strncmp (p, PROC_TYPE_TAG, strlen (PROC_TYPE_TAG))) {
- if (enc_tags++ != 0) {
+ if (enc_tags++ != 0 || str->len != 0) {
g_set_error (error, NM_CRYPTO_ERROR,
NM_CRYPTO_ERROR_INVALID_DATA,
_("Malformed PEM file: Proc-Type was not first tag."));
@@ -162,7 +162,7 @@ parse_old_openssl_key_file (const guint8 *data,
} else if (!strncmp (p, DEK_INFO_TAG, strlen (DEK_INFO_TAG))) {
char *comma;
- if (enc_tags++ != 1) {
+ if (enc_tags++ != 1 || str->len != 0) {
g_set_error (error, NM_CRYPTO_ERROR,
NM_CRYPTO_ERROR_INVALID_DATA,
_("Malformed PEM file: DEK-Info was not the second tag."));
@@ -203,7 +203,7 @@ parse_old_openssl_key_file (const guint8 *data,
goto parse_error;
}
} else {
- if ((enc_tags != 0) && (enc_tags != 2)) {
+ if (enc_tags == 1) {
g_set_error (error, NM_CRYPTO_ERROR,
NM_CRYPTO_ERROR_INVALID_DATA,
"Malformed PEM file: both Proc-Type and DEK-Info tags are required.");
@@ -229,6 +229,7 @@ parse_old_openssl_key_file (const guint8 *data,
g_byte_array_append (bindata, tmp, tmp_len);
g_free (tmp);
+ *out_key_type = key_type;
*out_iv = iv;
*out_cipher = cipher;
return bindata;
@@ -367,13 +368,13 @@ error:
return NULL;
}
-static char *
-make_des_aes_key (const char *cipher,
- const char *salt,
- const gsize salt_len,
- const char *password,
- gsize *out_len,
- GError **error)
+char *
+crypto_make_des_aes_key (const char *cipher,
+ const char *salt,
+ const gsize salt_len,
+ const char *password,
+ gsize *out_len,
+ GError **error)
{
char *key;
guint32 digest_len;
@@ -403,25 +404,15 @@ make_des_aes_key (const char *cipher,
key = g_malloc0 (digest_len + 1);
- if (!crypto_md5_hash (salt,
- salt_len,
- password,
- strlen (password),
- key,
- digest_len,
- error))
- goto error;
+ crypto_md5_hash (salt,
+ 8,
+ password,
+ strlen (password),
+ key,
+ digest_len);
*out_len = digest_len;
return key;
-
-error:
- if (key) {
- /* Don't leak stale key material */
- memset (key, 0, digest_len);
- g_free (key);
- }
- return NULL;
}
static GByteArray *
@@ -448,7 +439,7 @@ decrypt_key (const char *cipher,
return NULL;
/* Convert the password and IV into a DES or AES key */
- key = make_des_aes_key (cipher, bin_iv, bin_iv_len, password, &key_len, error);
+ key = crypto_make_des_aes_key (cipher, bin_iv, bin_iv_len, password, &key_len, error);
if (!key || !key_len)
goto out;
@@ -475,14 +466,14 @@ out:
}
GByteArray *
-crypto_decrypt_private_key_data (const guint8 *data,
- gsize data_len,
- const char *password,
- NMCryptoKeyType *out_key_type,
- GError **error)
+crypto_decrypt_openssl_private_key_data (const guint8 *data,
+ gsize data_len,
+ const char *password,
+ NMCryptoKeyType *out_key_type,
+ GError **error)
{
GByteArray *decrypted = NULL;
- NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_RSA;
+ NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN;
GByteArray *parsed;
char *iv = NULL;
char *cipher = NULL;
@@ -491,30 +482,27 @@ crypto_decrypt_private_key_data (const guint8 *data,
if (out_key_type)
g_return_val_if_fail (*out_key_type == NM_CRYPTO_KEY_TYPE_UNKNOWN, NULL);
- /* OpenSSL non-standard legacy PEM files */
+ if (!crypto_init (error))
+ return NULL;
- /* Try RSA keys first */
- parsed = parse_old_openssl_key_file (data, data_len, key_type, &cipher, &iv, error);
- if (!parsed) {
- g_clear_error (error);
+ parsed = parse_old_openssl_key_file (data, data_len, &key_type, &cipher, &iv, NULL);
+ /* return the key type even if decryption failed */
+ if (out_key_type)
+ *out_key_type = key_type;
- /* DSA next */
- key_type = NM_CRYPTO_KEY_TYPE_DSA;
- parsed = parse_old_openssl_key_file (data, data_len, key_type, &cipher, &iv, error);
- if (!parsed) {
- g_clear_error (error);
- g_set_error (error, NM_CRYPTO_ERROR,
- NM_CRYPTO_ERROR_INVALID_DATA,
- _("Unable to determine private key type."));
- }
+ if (!parsed) {
+ g_set_error (error, NM_CRYPTO_ERROR,
+ NM_CRYPTO_ERROR_INVALID_DATA,
+ _("Unable to determine private key type."));
+ return NULL;
}
- if (parsed) {
- /* return the key type even if decryption failed */
- if (out_key_type)
- *out_key_type = key_type;
-
- if (password) {
+ if (password) {
+ if (!cipher || !iv) {
+ g_set_error (error, NM_CRYPTO_ERROR,
+ NM_CRYPTO_ERROR_INVALID_PASSWORD,
+ _("Password provided, but key was not encrypted."));
+ } else {
decrypted = decrypt_key (cipher,
key_type,
parsed->data,
@@ -523,9 +511,10 @@ crypto_decrypt_private_key_data (const guint8 *data,
password,
error);
}
- g_byte_array_free (parsed, TRUE);
- }
+ } else if (!cipher && !iv)
+ decrypted = g_byte_array_ref (parsed);
+ g_byte_array_unref (parsed);
g_free (cipher);
g_free (iv);
@@ -533,18 +522,21 @@ crypto_decrypt_private_key_data (const guint8 *data,
}
GByteArray *
-crypto_decrypt_private_key (const char *file,
- const char *password,
- NMCryptoKeyType *out_key_type,
- GError **error)
+crypto_decrypt_openssl_private_key (const char *file,
+ const char *password,
+ NMCryptoKeyType *out_key_type,
+ GError **error)
{
GByteArray *contents;
GByteArray *key = NULL;
+ if (!crypto_init (error))
+ return NULL;
+
contents = file_to_g_byte_array (file, error);
if (contents) {
- key = crypto_decrypt_private_key_data (contents->data, contents->len,
- password, out_key_type, error);
+ key = crypto_decrypt_openssl_private_key_data (contents->data, contents->len,
+ password, out_key_type, error);
g_byte_array_free (contents, TRUE);
}
return key;
@@ -608,12 +600,15 @@ crypto_load_and_verify_certificate (const char *file,
g_return_val_if_fail (out_file_format != NULL, NULL);
g_return_val_if_fail (*out_file_format == NM_CRYPTO_FILE_FORMAT_UNKNOWN, NULL);
+ if (!crypto_init (error))
+ return NULL;
+
contents = file_to_g_byte_array (file, error);
if (!contents)
return NULL;
/* Check for PKCS#12 */
- if (crypto_is_pkcs12_data (contents->data, contents->len)) {
+ if (crypto_is_pkcs12_data (contents->data, contents->len, NULL)) {
*out_file_format = NM_CRYPTO_FILE_FORMAT_PKCS12;
return contents;
}
@@ -642,20 +637,26 @@ crypto_load_and_verify_certificate (const char *file,
gboolean
crypto_is_pkcs12_data (const guint8 *data,
- gsize data_len)
+ gsize data_len,
+ GError **error)
{
- GError *error = NULL;
+ GError *local = NULL;
gboolean success;
g_return_val_if_fail (data != NULL, FALSE);
- success = crypto_verify_pkcs12 (data, data_len, NULL, &error);
+ if (!crypto_init (error))
+ return FALSE;
+
+ success = crypto_verify_pkcs12 (data, data_len, NULL, &local);
if (success == FALSE) {
/* If the error was just a decryption error, then it's pkcs#12 */
- if (error) {
- if (g_error_matches (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERROR_DECRYPTION_FAILED))
+ if (local) {
+ if (g_error_matches (local, NM_CRYPTO_ERROR, NM_CRYPTO_ERROR_DECRYPTION_FAILED)) {
success = TRUE;
- g_error_free (error);
+ g_error_free (local);
+ } else
+ g_propagate_error (error, local);
}
}
return success;
@@ -669,9 +670,12 @@ crypto_is_pkcs12_file (const char *file, GError **error)
g_return_val_if_fail (file != NULL, FALSE);
+ if (!crypto_init (error))
+ return FALSE;
+
contents = file_to_g_byte_array (file, error);
if (contents) {
- success = crypto_is_pkcs12_data (contents->data, contents->len);
+ success = crypto_is_pkcs12_data (contents->data, contents->len, error);
g_byte_array_free (contents, TRUE);
}
return success;
@@ -684,6 +688,7 @@ NMCryptoFileFormat
crypto_verify_private_key_data (const guint8 *data,
gsize data_len,
const char *password,
+ gboolean *out_is_encrypted,
GError **error)
{
GByteArray *tmp;
@@ -691,53 +696,121 @@ crypto_verify_private_key_data (const guint8 *data,
NMCryptoKeyType ktype = NM_CRYPTO_KEY_TYPE_UNKNOWN;
gboolean is_encrypted = FALSE;
- g_return_val_if_fail (data != NULL, FALSE);
+ g_return_val_if_fail (data != NULL, NM_CRYPTO_FILE_FORMAT_UNKNOWN);
+ g_return_val_if_fail (out_is_encrypted == NULL || *out_is_encrypted == FALSE, NM_CRYPTO_FILE_FORMAT_UNKNOWN);
+
+ if (!crypto_init (error))
+ return NM_CRYPTO_FILE_FORMAT_UNKNOWN;
/* Check for PKCS#12 first */
- if (crypto_is_pkcs12_data (data, data_len)) {
+ if (crypto_is_pkcs12_data (data, data_len, NULL)) {
+ is_encrypted = TRUE;
if (!password || crypto_verify_pkcs12 (data, data_len, password, error))
format = NM_CRYPTO_FILE_FORMAT_PKCS12;
} else {
/* Maybe it's PKCS#8 */
- tmp = parse_pkcs8_key_file (data, data_len, &is_encrypted, error);
+ tmp = parse_pkcs8_key_file (data, data_len, &is_encrypted, NULL);
if (tmp) {
if (crypto_verify_pkcs8 (tmp->data, tmp->len, is_encrypted, password, error))
format = NM_CRYPTO_FILE_FORMAT_RAW_KEY;
} else {
- g_clear_error (error);
+ char *cipher, *iv;
/* Or it's old-style OpenSSL */
- tmp = crypto_decrypt_private_key_data (data, data_len, password, &ktype, error);
- if (tmp)
- format = NM_CRYPTO_FILE_FORMAT_RAW_KEY;
- else if (!password && (ktype != NM_CRYPTO_KEY_TYPE_UNKNOWN))
+ tmp = parse_old_openssl_key_file (data, data_len, &ktype,
+ &cipher, &iv, NULL);
+ if (tmp) {
format = NM_CRYPTO_FILE_FORMAT_RAW_KEY;
+ is_encrypted = (cipher && iv);
+ g_free (cipher);
+ g_free (iv);
+ }
}
if (tmp) {
- /* Don't leave decrypted key data around */
+ /* Don't leave key data around */
memset (tmp->data, 0, tmp->len);
g_byte_array_free (tmp, TRUE);
}
}
+ if (out_is_encrypted)
+ *out_is_encrypted = is_encrypted;
return format;
}
NMCryptoFileFormat
crypto_verify_private_key (const char *filename,
const char *password,
+ gboolean *out_is_encrypted,
GError **error)
{
GByteArray *contents;
NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
- g_return_val_if_fail (filename != NULL, FALSE);
+ g_return_val_if_fail (filename != NULL, NM_CRYPTO_FILE_FORMAT_UNKNOWN);
+
+ if (!crypto_init (error))
+ return NM_CRYPTO_FILE_FORMAT_UNKNOWN;
contents = file_to_g_byte_array (filename, error);
if (contents) {
- format = crypto_verify_private_key_data (contents->data, contents->len, password, error);
+ format = crypto_verify_private_key_data (contents->data, contents->len, password, out_is_encrypted, error);
g_byte_array_free (contents, TRUE);
}
return format;
}
+
+void
+crypto_md5_hash (const char *salt,
+ gssize salt_len,
+ const char *password,
+ gssize password_len,
+ char *buffer,
+ gsize buflen)
+{
+ GChecksum *ctx;
+ int nkey = buflen;
+ gsize digest_len;
+ int count = 0;
+ char digest[16];
+ char *p = buffer;
+
+ g_assert_cmpint (g_checksum_type_get_length (G_CHECKSUM_MD5), ==, sizeof (digest));
+
+ g_return_if_fail (password_len == 0 || password);
+ g_return_if_fail (buffer != NULL);
+ g_return_if_fail (buflen > 0);
+ g_return_if_fail (salt_len == 0 || salt);
+
+ ctx = g_checksum_new (G_CHECKSUM_MD5);
+
+ if (salt_len < 0)
+ salt_len = strlen (salt);
+ if (password_len < 0)
+ password_len = strlen (password);
+
+ while (nkey > 0) {
+ int i = 0;
+
+ g_checksum_reset (ctx);
+ if (count++)
+ g_checksum_update (ctx, (const guchar *) digest, sizeof (digest));
+ if (password_len > 0)
+ g_checksum_update (ctx, (const guchar *) password, password_len);
+ if (salt_len > 0)
+ g_checksum_update (ctx, (const guchar *) salt, salt_len);
+
+ digest_len = sizeof (digest);
+ g_checksum_get_digest (ctx, (guchar *) digest, &digest_len);
+ g_assert (digest_len == sizeof (digest));
+
+ while (nkey && (i < sizeof (digest))) {
+ *(p++) = digest[i++];
+ nkey--;
+ }
+ }
+
+ memset (digest, 0, sizeof (digest));
+ g_checksum_free (ctx);
+}
diff --git a/libnm-core/crypto.h b/libnm-core/crypto.h
index 9173ba2203..434f108d0a 100644
--- a/libnm-core/crypto.h
+++ b/libnm-core/crypto.h
@@ -46,18 +46,16 @@ typedef enum {
gboolean crypto_init (GError **error);
-void crypto_deinit (void);
-
-GByteArray *crypto_decrypt_private_key_data (const guint8 *data,
- gsize data_len,
- const char *password,
- NMCryptoKeyType *out_key_type,
- GError **error);
-
-GByteArray *crypto_decrypt_private_key (const char *file,
- const char *password,
- NMCryptoKeyType *out_key_type,
- GError **error);
+GByteArray *crypto_decrypt_openssl_private_key_data (const guint8 *data,
+ gsize data_len,
+ const char *password,
+ NMCryptoKeyType *out_key_type,
+ GError **error);
+
+GByteArray *crypto_decrypt_openssl_private_key (const char *file,
+ const char *password,
+ NMCryptoKeyType *out_key_type,
+ GError **error);
GByteArray *crypto_load_and_verify_certificate (const char *file,
NMCryptoFileFormat *out_file_format,
@@ -65,26 +63,34 @@ GByteArray *crypto_load_and_verify_certificate (const char *file,
gboolean crypto_is_pkcs12_file (const char *file, GError **error);
-gboolean crypto_is_pkcs12_data (const guint8 *data, gsize len);
+gboolean crypto_is_pkcs12_data (const guint8 *data, gsize len, GError **error);
NMCryptoFileFormat crypto_verify_private_key_data (const guint8 *data,
gsize data_len,
const char *password,
+ gboolean *out_is_encrypted,
GError **error);
NMCryptoFileFormat crypto_verify_private_key (const char *file,
const char *password,
+ gboolean *out_is_encrypted,
GError **error);
/* Internal utils API bits for crypto providers */
-gboolean crypto_md5_hash (const char *salt,
- const gsize salt_len,
- const char *password,
- gsize password_len,
- char *buffer,
- gsize buflen,
- GError **error);
+void crypto_md5_hash (const char *salt,
+ gssize salt_len,
+ const char *password,
+ gssize password_len,
+ char *buffer,
+ gsize buflen);
+
+char *crypto_make_des_aes_key (const char *cipher,
+ const char *salt,
+ const gsize salt_len,
+ const char *password,
+ gsize *out_len,
+ GError **error);
char * crypto_decrypt (const char *cipher,
int key_type,
diff --git a/libnm-core/crypto_gnutls.c b/libnm-core/crypto_gnutls.c
index 28d9bf79b8..96dddb9029 100644
--- a/libnm-core/crypto_gnutls.c
+++ b/libnm-core/crypto_gnutls.c
@@ -22,8 +22,9 @@
*/
#include "config.h"
+
#include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gcrypt.h>
#include <gnutls/gnutls.h>
@@ -55,68 +56,6 @@ crypto_init (GError **error)
return TRUE;
}
-void
-crypto_deinit (void)
-{
-}
-
-gboolean
-crypto_md5_hash (const char *salt,
- const gsize salt_len,
- const char *password,
- gsize password_len,
- char *buffer,
- gsize buflen,
- GError **error)
-{
- gcry_md_hd_t ctx;
- gcry_error_t err;
- int nkey = buflen;
- const gsize digest_len = 16;
- int count = 0;
- char digest[MD5_HASH_LEN];
- char *p = buffer;
-
- if (salt)
- g_return_val_if_fail (salt_len >= SALT_LEN, FALSE);
-
- g_return_val_if_fail (password != NULL, FALSE);
- g_return_val_if_fail (password_len > 0, FALSE);
- 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) {
- g_set_error (error, NM_CRYPTO_ERROR,
- NM_CRYPTO_ERROR_FAILED,
- _("Failed to initialize the MD5 engine: %s / %s."),
- gcry_strsource (err), gcry_strerror (err));
- return FALSE;
- }
-
- while (nkey > 0) {
- int i = 0;
-
- if (count++)
- gcry_md_write (ctx, digest, digest_len);
- gcry_md_write (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);
-
- while (nkey && (i < digest_len)) {
- *(p++) = digest[i++];
- nkey--;
- }
- }
-
- memset (digest, 0, sizeof (digest));
- gcry_md_close (ctx);
- return TRUE;
-}
-
char *
crypto_decrypt (const char *cipher,
int key_type,
@@ -136,6 +75,9 @@ crypto_decrypt (const char *cipher,
gboolean success = FALSE;
gsize pad_len, real_iv_len;
+ if (!crypto_init (error))
+ return NULL;
+
if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) {
cipher_mech = GCRY_CIPHER_3DES;
real_iv_len = SALT_LEN;
@@ -257,6 +199,9 @@ crypto_encrypt (const char *cipher,
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;
@@ -352,6 +297,9 @@ crypto_verify_cert (const unsigned char *data,
gnutls_datum_t dt;
int err;
+ if (!crypto_init (error))
+ return NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+
err = gnutls_x509_crt_init (&der);
if (err < 0) {
g_set_error (error, NM_CRYPTO_ERROR,
@@ -396,6 +344,9 @@ crypto_verify_pkcs12 (const guint8 *data,
g_return_val_if_fail (data != NULL, FALSE);
+ if (!crypto_init (error))
+ return FALSE;
+
dt.data = (unsigned char *) data;
dt.size = data_len;
@@ -450,6 +401,9 @@ crypto_verify_pkcs8 (const guint8 *data,
g_return_val_if_fail (data != NULL, FALSE);
+ if (!crypto_init (error))
+ return FALSE;
+
dt.data = (unsigned char *) data;
dt.size = data_len;
@@ -492,6 +446,9 @@ crypto_verify_pkcs8 (const guint8 *data,
gboolean
crypto_randomize (void *buffer, gsize buffer_len, GError **error)
{
+ if (!crypto_init (error))
+ return FALSE;
+
gcry_randomize (buffer, buffer_len, GCRY_STRONG_RANDOM);
return TRUE;
}
diff --git a/libnm-core/crypto_nss.c b/libnm-core/crypto_nss.c
index b75fcf6662..d0c3506b88 100644
--- a/libnm-core/crypto_nss.c
+++ b/libnm-core/crypto_nss.c
@@ -24,7 +24,7 @@
#include "config.h"
#include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <prinit.h>
#include <nss.h>
@@ -72,66 +72,6 @@ crypto_init (GError **error)
return TRUE;
}
-void
-crypto_deinit (void)
-{
-}
-
-gboolean
-crypto_md5_hash (const char *salt,
- const gsize salt_len,
- const char *password,
- gsize password_len,
- char *buffer,
- gsize buflen,
- GError **error)
-{
- PK11Context *ctx;
- int nkey = buflen;
- unsigned int digest_len;
- int count = 0;
- char digest[MD5_HASH_LEN];
- char *p = buffer;
-
- if (salt)
- g_return_val_if_fail (salt_len >= 8, FALSE);
-
- g_return_val_if_fail (password != NULL, FALSE);
- g_return_val_if_fail (password_len > 0, FALSE);
- g_return_val_if_fail (buffer != NULL, FALSE);
- g_return_val_if_fail (buflen > 0, FALSE);
-
- ctx = PK11_CreateDigestContext (SEC_OID_MD5);
- if (!ctx) {
- g_set_error (error, NM_CRYPTO_ERROR,
- NM_CRYPTO_ERROR_FAILED,
- _("Failed to initialize the MD5 context: %d."),
- PORT_GetError ());
- return FALSE;
- }
-
- while (nkey > 0) {
- int i = 0;
-
- PK11_DigestBegin (ctx);
- if (count++)
- PK11_DigestOp (ctx, (const unsigned char *) digest, digest_len);
- PK11_DigestOp (ctx, (const unsigned char *) password, password_len);
- if (salt)
- PK11_DigestOp (ctx, (const unsigned char *) salt, 8); /* Only use 8 bytes of salt */
- PK11_DigestFinal (ctx, (unsigned char *) digest, &digest_len, sizeof (digest));
-
- while (nkey && (i < digest_len)) {
- *(p++) = digest[i++];
- nkey--;
- }
- }
-
- memset (digest, 0, sizeof (digest));
- PK11_DestroyContext (ctx, PR_TRUE);
- return TRUE;
-}
-
char *
crypto_decrypt (const char *cipher,
int key_type,
@@ -157,6 +97,9 @@ crypto_decrypt (const char *cipher,
unsigned int pad_len = 0, extra = 0;
guint32 i, real_iv_len = 0;
+ if (!crypto_init (error))
+ return NULL;
+
if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) {
cipher_mech = CKM_DES3_CBC_PAD;
real_iv_len = 8;
@@ -324,6 +267,9 @@ crypto_encrypt (const char *cipher,
gboolean success = FALSE;
gsize padded_buf_len, pad_len;
+ if (!crypto_init (error))
+ return NULL;
+
if (!strcmp (cipher, CIPHER_DES_EDE3_CBC))
cipher_mech = CKM_DES3_CBC_PAD;
else if (!strcmp (cipher, CIPHER_AES_CBC))
@@ -428,6 +374,9 @@ crypto_verify_cert (const unsigned char *data,
{
CERTCertificate *cert;
+ if (!crypto_init (error))
+ return NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+
/* Try DER/PEM first */
cert = CERT_DecodeCertFromPackage ((char *) data, len);
if (!cert) {
@@ -461,6 +410,9 @@ crypto_verify_pkcs12 (const guint8 *data,
if (error)
g_return_val_if_fail (*error == NULL, FALSE);
+ if (!crypto_init (error))
+ return FALSE;
+
/* PKCS#12 passwords are apparently UCS2 BIG ENDIAN, and NSS doesn't do
* any conversions for us.
*/
@@ -545,6 +497,9 @@ crypto_verify_pkcs8 (const guint8 *data,
{
g_return_val_if_fail (data != NULL, FALSE);
+ if (!crypto_init (error))
+ return FALSE;
+
/* NSS apparently doesn't do PKCS#8 natively, but you have to put the
* PKCS#8 key into a PKCS#12 file and import that?? So until we figure
* all that out, we can only assume the password is valid.
@@ -557,6 +512,9 @@ crypto_randomize (void *buffer, gsize buffer_len, GError **error)
{
SECStatus s;
+ if (!crypto_init (error))
+ return FALSE;
+
s = PK11_GenerateRandom (buffer, buffer_len);
if (s != SECSuccess) {
g_set_error_literal (error, NM_CRYPTO_ERROR,
diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c
index a6789b3195..acdc8b89c7 100644
--- a/libnm-core/nm-connection.c
+++ b/libnm-core/nm-connection.c
@@ -20,14 +20,17 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <glib-object.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <string.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
@@ -302,6 +305,8 @@ nm_connection_replace_settings (NMConnection *connection,
for (s = settings; s; s = s->next)
_nm_connection_add_setting (connection, s->data);
+ g_slist_free (settings);
+
if (changed)
g_signal_emit (connection, signals[CHANGED], 0);
return TRUE;
@@ -525,6 +530,24 @@ _nm_connection_find_base_type_setting (NMConnection *connection)
}
static gboolean
+_normalize_connection_uuid (NMConnection *self)
+{
+ NMSettingConnection *s_con = nm_connection_get_setting_connection (self);
+ char *uuid;
+
+ g_assert (s_con);
+
+ if (nm_setting_connection_get_uuid (s_con))
+ return FALSE;
+
+ uuid = nm_utils_uuid_generate ();
+ g_object_set (s_con, NM_SETTING_CONNECTION_UUID, uuid, NULL);
+ g_free (uuid);
+
+ return TRUE;
+}
+
+static gboolean
_normalize_connection_type (NMConnection *self)
{
NMSettingConnection *s_con = nm_connection_get_setting_connection (self);
@@ -631,8 +654,7 @@ _normalize_ip_config (NMConnection *self, GHashTable *parameters)
NMSettingConnection *s_con = nm_connection_get_setting_connection (self);
const char *default_ip4_method = NM_SETTING_IP4_CONFIG_METHOD_AUTO;
const char *default_ip6_method = NULL;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4, *s_ip6;
NMSetting *setting;
if (parameters)
@@ -663,7 +685,7 @@ _normalize_ip_config (NMConnection *self, GHashTable *parameters)
setting = nm_setting_ip4_config_new ();
g_object_set (setting,
- NM_SETTING_IP4_CONFIG_METHOD, default_ip4_method,
+ NM_SETTING_IP_CONFIG_METHOD, default_ip4_method,
NULL);
nm_connection_add_setting (self, setting);
}
@@ -671,8 +693,8 @@ _normalize_ip_config (NMConnection *self, GHashTable *parameters)
setting = nm_setting_ip6_config_new ();
g_object_set (setting,
- NM_SETTING_IP6_CONFIG_METHOD, default_ip6_method,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, default_ip6_method,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
nm_connection_add_setting (self, setting);
}
@@ -704,6 +726,27 @@ _normalize_infiniband_mtu (NMConnection *self, GHashTable *parameters)
return FALSE;
}
+static gboolean
+_normalize_bond_mode (NMConnection *self, GHashTable *parameters)
+{
+ NMSettingBond *s_bond = nm_connection_get_setting_bond (self);
+
+ /* Convert mode from numeric to string notation */
+ if (s_bond) {
+ const char *mode = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_MODE);
+ int mode_int = nm_utils_bond_mode_string_to_int (mode);
+
+ if (mode_int != -1) {
+ const char *mode_new = nm_utils_bond_mode_int_to_string (mode_int);
+ if (g_strcmp0 (mode_new, mode) != 0) {
+ nm_setting_bond_add_option (s_bond, NM_SETTING_BOND_OPTION_MODE, mode_new);
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
/**
* nm_connection_verify:
* @connection: the #NMConnection to verify
@@ -740,8 +783,7 @@ _nm_connection_verify (NMConnection *connection, GError **error)
{
NMConnectionPrivate *priv;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4, *s_ip6;
GHashTableIter iter;
gpointer value;
GSList *all_settings = NULL, *setting_i;
@@ -913,10 +955,12 @@ nm_connection_normalize (NMConnection *connection,
* We only do this, after verifying that the connection contains no un-normalizable
* errors, because in that case we rather fail without touching the settings. */
+ was_modified |= _normalize_connection_uuid (connection);
was_modified |= _normalize_connection_type (connection);
was_modified |= _normalize_connection_slave_type (connection);
was_modified |= _normalize_ip_config (connection, parameters);
was_modified |= _normalize_infiniband_mtu (connection, parameters);
+ was_modified |= _normalize_bond_mode (connection, parameters);
/* Verify anew. */
success = _nm_connection_verify (connection, error);
@@ -1263,6 +1307,19 @@ nm_connection_is_type (NMConnection *connection, const char *type)
return (g_strcmp0 (type2, type) == 0);
}
+static int
+_for_each_sort (NMSetting **p_a, NMSetting **p_b, void *unused)
+{
+ NMSetting *a = *p_a;
+ NMSetting *b = *p_b;
+ int c;
+
+ c = _nm_setting_compare_priority (a, b);
+ if (c != 0)
+ return c;
+ return strcmp (nm_setting_get_name (a), nm_setting_get_name (b));
+}
+
/**
* nm_connection_for_each_setting_value:
* @connection: the #NMConnection
@@ -1277,15 +1334,39 @@ nm_connection_for_each_setting_value (NMConnection *connection,
NMSettingValueIterFn func,
gpointer user_data)
{
+ NMConnectionPrivate *priv;
+ gs_free NMSetting **arr_free = NULL;
+ NMSetting *arr_temp[20], **arr;
GHashTableIter iter;
gpointer value;
+ guint i, size;
g_return_if_fail (NM_IS_CONNECTION (connection));
g_return_if_fail (func != NULL);
- g_hash_table_iter_init (&iter, NM_CONNECTION_GET_PRIVATE (connection)->settings);
- while (g_hash_table_iter_next (&iter, NULL, &value))
- nm_setting_enumerate_values (NM_SETTING (value), func, user_data);
+ priv = NM_CONNECTION_GET_PRIVATE (connection);
+
+ size = g_hash_table_size (priv->settings);
+ if (!size)
+ return;
+
+ if (size > G_N_ELEMENTS (arr_temp))
+ arr = arr_free = g_new (NMSetting *, size);
+ else
+ arr = arr_temp;
+
+ g_hash_table_iter_init (&iter, priv->settings);
+ for (i = 0; g_hash_table_iter_next (&iter, NULL, &value); i++)
+ arr[i] = NM_SETTING (value);
+ g_assert (i == size);
+
+ /* sort the settings. This has an effect on the order in which keyfile
+ * prints them. */
+ if (size > 1)
+ g_qsort_with_data (arr, size, sizeof (NMSetting *), (GCompareDataFunc) _for_each_sort, NULL);
+
+ for (i = 0; i < size; i++)
+ nm_setting_enumerate_values (arr[i], func, user_data);
}
/**
@@ -1739,14 +1820,19 @@ nm_connection_get_setting_infiniband (NMConnection *connection)
*
* A shortcut to return any #NMSettingIP4Config the connection might contain.
*
- * Returns: (transfer none): an #NMSettingIP4Config if the connection contains one, otherwise %NULL
+ * Note that it returns the value as type #NMSettingIPConfig, since the vast
+ * majority of IPv4-setting-related methods are on that type, not
+ * #NMSettingIP4Config.
+ *
+ * Returns: (type NMSettingIP4Config) (transfer none): an #NMSettingIP4Config if the
+ * connection contains one, otherwise %NULL
**/
-NMSettingIP4Config *
+NMSettingIPConfig *
nm_connection_get_setting_ip4_config (NMConnection *connection)
{
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
- return (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG);
+ return (NMSettingIPConfig *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG);
}
/**
@@ -1755,14 +1841,19 @@ nm_connection_get_setting_ip4_config (NMConnection *connection)
*
* A shortcut to return any #NMSettingIP6Config the connection might contain.
*
- * Returns: (transfer none): an #NMSettingIP6Config if the connection contains one, otherwise %NULL
+ * Note that it returns the value as type #NMSettingIPConfig, since the vast
+ * majority of IPv6-setting-related methods are on that type, not
+ * #NMSettingIP6Config.
+ *
+ * Returns: (type NMSettingIP6Config) (transfer none): an #NMSettingIP6Config if the
+ * connection contains one, otherwise %NULL
**/
-NMSettingIP6Config *
+NMSettingIPConfig *
nm_connection_get_setting_ip6_config (NMConnection *connection)
{
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
- return (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG);
+ return (NMSettingIPConfig *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG);
}
/**
diff --git a/libnm-core/nm-connection.h b/libnm-core/nm-connection.h
index ec5db7fa2b..c76ad60768 100644
--- a/libnm-core/nm-connection.h
+++ b/libnm-core/nm-connection.h
@@ -57,6 +57,13 @@ G_BEGIN_DECLS
* client side, and #NMSettingsConnection on the daemon side.
*/
+/**
+ * NMConnectionInterface:
+ * @parent: the parent interace struct
+ * @secrets_updated: emitted when the connection's secrets are updated
+ * @secrets_cleared: emitted when the connection's secrets are cleared
+ * @changed: emitted when any change to the connection's settings occurs
+ */
typedef struct {
GTypeInterface parent;
@@ -193,8 +200,8 @@ 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);
-NMSettingIP4Config * nm_connection_get_setting_ip4_config (NMConnection *connection);
-NMSettingIP6Config * nm_connection_get_setting_ip6_config (NMConnection *connection);
+NMSettingIPConfig * nm_connection_get_setting_ip4_config (NMConnection *connection);
+NMSettingIPConfig * nm_connection_get_setting_ip6_config (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);
diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h
index fced4ffe3d..86a301bd1b 100644
--- a/libnm-core/nm-core-internal.h
+++ b/libnm-core/nm-core-internal.h
@@ -74,12 +74,6 @@
g_clear_object (&c); \
}
-const char *_nm_setting_ip4_config_get_address_label (NMSettingIP4Config *setting,
- guint32 i);
-gboolean _nm_setting_ip4_config_add_address_with_label (NMSettingIP4Config *setting,
- NMIP4Address *address,
- const char *label);
-
/* 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
@@ -119,6 +113,29 @@ GPtrArray *_nm_utils_copy_object_array (const GPtrArray *array);
gboolean _nm_utils_string_in_list (const char *str,
const char **valid_strings);
+char ** _nm_utils_strsplit_set (const char *str,
+ const char *delimiters,
+ int max_tokens);
+
+#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);
+
+#define NM_UTILS_UUID_NS "b425e9fb-7598-44b4-9e3b-5a2e3aaa4905"
+
+char *_nm_utils_uuid_generate_from_strings (const char *string1, ...) G_GNUC_NULL_TERMINATED;
+
void _nm_dbus_errors_init (void);
+extern gboolean _nm_utils_is_manager_process;
+
+GByteArray *nm_utils_rsa_key_encrypt (const guint8 *data,
+ gsize len,
+ const char *in_password,
+ char **out_password,
+ GError **error);
+
+gint64 _nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback);
+
#endif
diff --git a/libnm-core/nm-core-types.h b/libnm-core/nm-core-types.h
index a6fc529fae..524d6396c5 100644
--- a/libnm-core/nm-core-types.h
+++ b/libnm-core/nm-core-types.h
@@ -40,6 +40,7 @@ typedef struct _NMSettingDcb NMSettingDcb;
typedef struct _NMSettingGeneric NMSettingGeneric;
typedef struct _NMSettingGsm NMSettingGsm;
typedef struct _NMSettingInfiniband NMSettingInfiniband;
+typedef struct _NMSettingIPConfig NMSettingIPConfig;
typedef struct _NMSettingIP4Config NMSettingIP4Config;
typedef struct _NMSettingIP6Config NMSettingIP6Config;
typedef struct _NMSettingOlpcMesh NMSettingOlpcMesh;
diff --git a/libnm-core/nm-dbus-interface.h b/libnm-core/nm-dbus-interface.h
index b4cbd1793e..dd2b70a0dc 100644
--- a/libnm-core/nm-dbus-interface.h
+++ b/libnm-core/nm-dbus-interface.h
@@ -526,8 +526,6 @@ typedef enum {
NM_DEVICE_STATE_REASON_MODEM_FAILED = 57,
NM_DEVICE_STATE_REASON_MODEM_AVAILABLE = 58,
NM_DEVICE_STATE_REASON_SIM_PIN_INCORRECT = 59,
-
- NM_DEVICE_STATE_REASON_LAST = 0xFFFF
} NMDeviceStateReason;
@@ -573,6 +571,8 @@ typedef enum {
* results or carrier changes.
* @NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM: Internal flag, not part of
* the D-Bus API.
+ * @NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS: Internal flag, not part of
+ * the D-Bus API.
*
* #NMSecretAgentGetSecretsFlags values modify the behavior of a GetSecrets request.
*
@@ -585,7 +585,8 @@ typedef enum { /*< flags >*/
NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED = 0x4,
/* Internal to NM; not part of the D-Bus API */
- NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM = 0x80000000
+ NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM = 0x80000000,
+ NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS = 0x40000000,
} NMSecretAgentGetSecretsFlags;
/**
diff --git a/libnm-core/nm-errors.c b/libnm-core/nm-errors.c
index 2fead92e77..229f14a00c 100644
--- a/libnm-core/nm-errors.c
+++ b/libnm-core/nm-errors.c
@@ -18,6 +18,8 @@
* Copyright 2004 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gio/gio.h>
diff --git a/libnm-core/nm-errors.h b/libnm-core/nm-errors.h
index fa6919c569..a9857445b7 100644
--- a/libnm-core/nm-errors.h
+++ b/libnm-core/nm-errors.h
@@ -63,21 +63,21 @@ GQuark nm_agent_manager_error_quark (void);
* was attempted on a non-secret property
* @NM_CONNECTION_ERROR_MISSING_SETTING: the #NMConnection object is missing an
* #NMSetting which is required for its configuration. The error message will
- * always be prefixed with "<setting-name>: ", where "<setting-name>" is the
+ * always be prefixed with "&lt;setting-name>: ", where "&lt;setting-name>" is the
* name of the setting that is missing.
* @NM_CONNECTION_ERROR_INVALID_SETTING: the #NMConnection object contains an
* invalid or inappropriate #NMSetting. The error message will always be
- * prefixed with "<setting-name>: ", where "<setting-name>" is the name of the
+ * prefixed with "&lt;setting-name>: ", where "&lt;setting-name>" is the name of the
* setting that is invalid.
* @NM_CONNECTION_ERROR_MISSING_PROPERTY: the #NMConnection object is invalid
* because it is missing a required property. The error message will always be
- * prefixed with "<setting-name>.<property-name>: ", where "<setting-name>" is
- * the name of the setting with the missing property, and "<property-name>" is
+ * prefixed with "&lt;setting-name>.&lt;property-name>: ", where "&lt;setting-name>" is
+ * the name of the setting with the missing property, and "&lt;property-name>" is
* the property that is missing.
* @NM_CONNECTION_ERROR_INVALID_PROPERTY: the #NMConnection object is invalid
* because a property has an invalid value. The error message will always be
- * prefixed with "<setting-name>.<property-name>: ", where "<setting-name>" is
- * the name of the setting with the invalid property, and "<property-name>" is
+ * prefixed with "&lt;setting-name>.&lt;property-name>: ", where "&lt;setting-name>" is
+ * the name of the setting with the invalid property, and "&lt;property-name>" is
* the property that is invalid.
*
* Describes errors that may result from operations involving a #NMConnection
diff --git a/libnm-core/nm-keyfile-internal.h b/libnm-core/nm-keyfile-internal.h
new file mode 100644
index 0000000000..90af562cdf
--- /dev/null
+++ b/libnm-core/nm-keyfile-internal.h
@@ -0,0 +1,166 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager system settings service - keyfile plugin
+ *
+ * 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) 2008 Novell, Inc.
+ * Copyright (C) 2015 Red Hat, Inc.
+ */
+
+#ifndef __NM_KEYFILE_INTERNAL_H__
+#define __NM_KEYFILE_INTERNAL_H__
+
+#include <glib.h>
+#include <sys/types.h>
+
+#include "nm-connection.h"
+#include "nm-setting-8021x.h"
+
+
+/*********************************************************/
+
+#define NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB "data:;base64,"
+#define NM_KEYFILE_CERT_SCHEME_PREFIX_PATH "file://"
+
+char *nm_keyfile_detect_unqualified_path_scheme (const char *base_dir,
+ gconstpointer pdata,
+ gsize data_len,
+ gboolean consider_exists,
+ gboolean *out_exists);
+
+typedef enum {
+ NM_KEYFILE_READ_TYPE_WARN = 1,
+} NMKeyfileReadType;
+
+/**
+ * NMKeyfileReadHandler:
+ *
+ * Hook to nm_keyfile_read(). The user might fail the reading by setting
+ * @error.
+ *
+ * Returns: should return TRUE, if the reading was handled. Otherwise,
+ * a default action will be performed that depends on the @type.
+ * For %NM_KEYFILE_READ_TYPE_WARN type, the default action is doing nothing.
+ */
+typedef gboolean (*NMKeyfileReadHandler) (GKeyFile *keyfile,
+ NMConnection *connection,
+ NMKeyfileReadType type,
+ void *type_data,
+ void *user_data,
+ GError **error);
+
+typedef enum {
+ NM_KEYFILE_WARN_SEVERITY_DEBUG = 1000,
+ NM_KEYFILE_WARN_SEVERITY_INFO = 2000,
+ NM_KEYFILE_WARN_SEVERITY_INFO_MISSING_FILE = 2901,
+ NM_KEYFILE_WARN_SEVERITY_WARN = 3000,
+} NMKeyfileWarnSeverity;
+
+/**
+ * NMKeyfileReadTypeDataWarn:
+ *
+ * this struct is passed as @type_data for the @NMKeyfileReadHandler of
+ * type %NM_KEYFILE_READ_TYPE_WARN.
+ */
+typedef struct {
+ /* might be %NULL, if the warning is not about a group. */
+ const char *group;
+
+ /* might be %NULL, if the warning is not about a setting. */
+ NMSetting *setting;
+
+ /* might be %NULL, if the warning is not about a property. */
+ const char *property_name;
+
+ NMKeyfileWarnSeverity severity;
+ const char *message;
+} NMKeyfileReadTypeDataWarn;
+
+
+NMConnection *nm_keyfile_read (GKeyFile *keyfile,
+ const char *keyfile_name,
+ const char *base_dir,
+ NMKeyfileReadHandler handler,
+ void *user_data,
+ GError **error);
+
+/*********************************************************/
+
+typedef enum {
+ NM_KEYFILE_WRITE_TYPE_CERT = 1,
+} NMKeyfileWriteType;
+
+/**
+ * NMKeyfileWriteHandler:
+ *
+ * This is a hook to tweak the serialization.
+ *
+ * Handler for certain properties or events that are not entirely contained
+ * within the keyfile or that might be serialized differently. The @type and
+ * @type_data arguments tell which kind of argument we have at hand.
+ *
+ * Currently only the type %NM_KEYFILE_WRITE_TYPE_CERT is supported, which provides
+ * @type_data as %NMKeyfileWriteTypeDataCert. However, this handler should be generic enough
+ * to support other types as well.
+ *
+ * This don't have to be only "properties". For example, nm_keyfile_read() uses
+ * a similar handler to push warnings to the caller.
+ *
+ * If the handler raises an error, it should set the @error value. This causes
+ * the an overall failure.
+ *
+ * Returns: whether the issue was handled. If the type was unhandled,
+ * a default action will be performed. This might be raise an error,
+ * do some fallback parsing, or do nothing.
+ */
+typedef gboolean (*NMKeyfileWriteHandler) (NMConnection *connection,
+ GKeyFile *keyfile,
+ NMKeyfileWriteType type,
+ void *type_data,
+ void *user_data,
+ GError **error);
+
+/**
+ * NMKeyfileWriteTypeDataCert:
+ *
+ * this struct is passed as @type_data for the @NMKeyfileWriteHandler of
+ * type %NM_KEYFILE_WRITE_TYPE_CERT.
+ */
+typedef struct {
+ NMSetting8021x *setting;
+ const char *property_name;
+
+ /* The following functions are helpers that simplify the implementation
+ * of the handler. */
+ const char *suffix;
+ NMSetting8021xCKScheme (*scheme_func) (NMSetting8021x *setting);
+ NMSetting8021xCKFormat (*format_func) (NMSetting8021x *setting);
+ const char * (*path_func) (NMSetting8021x *setting);
+ GBytes * (*blob_func) (NMSetting8021x *setting);
+} NMKeyfileWriteTypeDataCert;
+
+
+GKeyFile *nm_keyfile_write (NMConnection *connection,
+ NMKeyfileWriteHandler handler,
+ void *user_data,
+ GError **error);
+
+/*********************************************************/
+
+char *nm_keyfile_plugin_kf_get_string (GKeyFile *kf, const char *group, const char *key, GError **error);
+void nm_keyfile_plugin_kf_set_string (GKeyFile *kf, const char *group, const char *key, const char *value);
+
+
+#endif /* __NM_KEYFILE_INTERNAL_H__ */
diff --git a/libnm-core/nm-keyfile-reader.c b/libnm-core/nm-keyfile-reader.c
new file mode 100644
index 0000000000..910aad8a5d
--- /dev/null
+++ b/libnm-core/nm-keyfile-reader.c
@@ -0,0 +1,1656 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager system settings service - keyfile plugin
+ *
+ * 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) 2008 - 2009 Novell, Inc.
+ * Copyright (C) 2008 - 2015 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <glib/gi18n-lib.h>
+
+#include "nm-core-internal.h"
+#include "nm-utils-internal.h"
+#include "gsystem-local-alloc.h"
+#include "nm-glib-compat.h"
+#include "nm-keyfile-internal.h"
+#include "nm-keyfile-utils.h"
+
+
+typedef struct {
+ NMConnection *connection;
+ GKeyFile *keyfile;
+ const char *base_dir;
+ NMKeyfileReadHandler handler;
+ void *user_data;
+ GError *error;
+ const char *group;
+ NMSetting *setting;
+} KeyfileReaderInfo;
+
+
+static void
+_handle_warn (KeyfileReaderInfo *info,
+ const char *property_name,
+ NMKeyfileWarnSeverity severity,
+ char *message)
+{
+ NMKeyfileReadTypeDataWarn type_data = {
+ .group = info->group,
+ .setting = info->setting,
+ .property_name = property_name,
+ .severity = severity,
+ .message = message,
+ };
+
+ info->handler (info->keyfile,
+ info->connection,
+ NM_KEYFILE_READ_TYPE_WARN,
+ &type_data,
+ info->user_data,
+ &info->error);
+ g_free (message);
+}
+#define handle_warn(arg_info, arg_property_name, arg_severity, ...) \
+ ({ \
+ KeyfileReaderInfo *_info = (arg_info); \
+ \
+ if (_info->handler) { \
+ _handle_warn (_info, (arg_property_name), (arg_severity), \
+ g_strdup_printf (__VA_ARGS__)); \
+ } \
+ _info->error == NULL; \
+ })
+
+/* Some setting properties also contain setting names, such as
+ * NMSettingConnection's 'type' property (which specifies the base type of the
+ * connection, e.g. ethernet or wifi) or 'slave-type' (specifies type of slave
+ * connection, e.g. bond or bridge). This function handles translating those
+ * properties' values to the real setting name if they are an alias.
+ */
+static void
+setting_alias_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ char *s;
+ const char *key_setting_name;
+
+ s = nm_keyfile_plugin_kf_get_string (info->keyfile, setting_name, key, NULL);
+ if (s) {
+ key_setting_name = nm_keyfile_plugin_get_setting_name_for_alias (s);
+ g_object_set (G_OBJECT (setting),
+ key, key_setting_name ? key_setting_name : s,
+ NULL);
+ g_free (s);
+ }
+}
+
+static void
+read_array_of_uint (GKeyFile *file,
+ NMSetting *setting,
+ const char *key)
+{
+ GArray *array = NULL;
+ gsize length;
+ int i;
+ gint *tmp;
+
+ tmp = nm_keyfile_plugin_kf_get_integer_list (file, nm_setting_get_name (setting), key, &length, NULL);
+ array = g_array_sized_new (FALSE, FALSE, sizeof (guint32), length);
+
+ for (i = 0; i < length; i++)
+ g_array_append_val (array, tmp[i]);
+
+ g_object_set (setting, key, array, NULL);
+ g_array_unref (array);
+}
+
+static gboolean
+get_one_int (KeyfileReaderInfo *info, const char *property_name, const char *str, guint32 max_val, guint32 *out)
+{
+ long tmp;
+ char *endptr;
+
+ g_return_val_if_fail (!info == !property_name, FALSE);
+
+ if (!str || !str[0]) {
+ if (property_name)
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring missing number"));
+ return FALSE;
+ }
+
+ errno = 0;
+ tmp = strtol (str, &endptr, 10);
+ if (errno || (tmp < 0) || (tmp > max_val) || *endptr != 0) {
+ if (property_name)
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid number '%s'"),
+ str);
+ return FALSE;
+ }
+
+ *out = (guint32) tmp;
+ return TRUE;
+}
+
+static gpointer
+build_address (KeyfileReaderInfo *info, int family, const char *address_str, guint32 plen, const char *property_name)
+{
+ NMIPAddress *addr;
+ GError *error = NULL;
+
+ g_return_val_if_fail (address_str, NULL);
+
+ addr = nm_ip_address_new (family, address_str, plen, &error);
+ if (!addr) {
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid %s addresss: %s"),
+ family == AF_INET ? "IPv4" : "IPv6", error->message);
+ g_error_free (error);
+ }
+
+ return addr;
+}
+
+static gpointer
+build_route (KeyfileReaderInfo *info,
+ const char *property_name,
+ int family,
+ const char *dest_str, guint32 plen,
+ const char *gateway_str, const char *metric_str)
+{
+ NMIPRoute *route;
+ guint32 metric = 0;
+ GError *error = NULL;
+
+ g_return_val_if_fail (plen, NULL);
+ g_return_val_if_fail (dest_str, NULL);
+
+ /* Next hop */
+ if (gateway_str && gateway_str[0]) {
+ if (!nm_utils_ipaddr_valid (family, gateway_str)) {
+ /* Try workaround for routes written by broken keyfile writer.
+ * Due to bug bgo#719851, an older version of writer would have
+ * written "a:b:c:d::/plen,metric" if the gateway was ::, instead
+ * of "a:b:c:d::/plen,,metric" or "a:b:c:d::/plen,::,metric"
+ * Try workaround by interpreting gateway_str as metric to accept such
+ * invalid routes. This broken syntax should not be not officially
+ * supported.
+ **/
+ if ( family == AF_INET6
+ && !metric_str
+ && get_one_int (NULL, NULL, gateway_str, G_MAXUINT32, &metric))
+ gateway_str = NULL;
+ else {
+ if (!info->error) {
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid gateway '%s' for %s route"),
+ gateway_str, family == AF_INET ? "IPv4" : "IPv6");
+ }
+ return NULL;
+ }
+ }
+ } else
+ gateway_str = NULL;
+
+ /* parse metric, default to 0 */
+ if (metric_str) {
+ if (!get_one_int (info, property_name, metric_str, G_MAXUINT32, &metric))
+ return NULL;
+ }
+
+ route = nm_ip_route_new (family, dest_str, plen, gateway_str,
+ metric ? (gint64) metric : -1,
+ &error);
+ if (!route) {
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid %s route: %s"),
+ family == AF_INET ? "IPv4" : "IPv6",
+ error->message);
+ g_error_free (error);
+ }
+
+ return route;
+}
+
+/* On success, returns pointer to the zero-terminated field (original @current).
+ * The @current * pointer target is set to point to the rest of the input
+ * or %NULL if there is no more input. Sets error to %NULL for convenience.
+ *
+ * On failure, returns %NULL (unspecified). The @current pointer target is
+ * resets to its original value to allow skipping fields. The @error target
+ * is set to the character that breaks the parsing or %NULL if @current was %NULL.
+ *
+ * When @current target is %NULL, gracefully fail returning %NULL while
+ * leaving the @current target %NULL end setting @error to %NULL;
+ */
+static char *
+read_field (char **current, char **error, const char *characters, const char *delimiters)
+{
+ char *start;
+
+ g_return_val_if_fail (current, NULL);
+ g_return_val_if_fail (error, NULL);
+ g_return_val_if_fail (characters, NULL);
+ g_return_val_if_fail (delimiters, NULL);
+
+ *error = NULL;
+
+ if (!*current) {
+ /* graceful failure, leave '*current' NULL */
+ return NULL;
+ }
+
+ /* fail on empty input */
+ if (!**current)
+ return NULL;
+
+ /* remember beginning of input */
+ start = *current;
+
+ while (**current && strchr (characters, **current))
+ (*current)++;
+ if (**current)
+ if (strchr (delimiters, **current)) {
+ /* success, more data available */
+ *(*current)++ = '\0';
+ return start;
+ } else {
+ /* error, bad character */
+ *error = *current;
+ *current = start;
+ return NULL;
+ }
+ else {
+ /* success, end of input */
+ *current = NULL;
+ return start;
+ }
+}
+
+#define IP_ADDRESS_CHARS "0123456789abcdefABCDEF:.%"
+#define DIGITS "0123456789"
+#define DELIMITERS "/;,"
+
+
+/* The following IPv4 and IPv6 address formats are supported:
+ *
+ * address (DEPRECATED)
+ * address/plen
+ * address/gateway (DEPRECATED)
+ * address/plen,gateway
+ *
+ * The following IPv4 and IPv6 route formats are supported:
+ *
+ * address/plen (NETWORK dev DEVICE)
+ * address/plen,gateway (NETWORK via GATEWAY dev DEVICE)
+ * address/plen,,metric (NETWORK dev DEVICE metric METRIC)
+ * address/plen,gateway,metric (NETWORK via GATEWAY dev DEVICE metric METRIC)
+ *
+ * For backward, forward and sideward compatibility, slash (/),
+ * semicolon (;) and comma (,) are interchangable. The choice of
+ * separator in the above examples is therefore not significant.
+ *
+ * Leaving out the prefix length is discouraged and DEPRECATED. The
+ * default value of IPv6 prefix length was 64 and has not been
+ * changed. The default for IPv4 is now 24, which is the closest
+ * IPv4 equivalent. These defaults may just as well be changed to
+ * match the iproute2 defaults (32 for IPv4 and 128 for IPv6).
+ */
+static gpointer
+read_one_ip_address_or_route (KeyfileReaderInfo *info,
+ const char *property_name,
+ const char *setting_name,
+ const char *key_name,
+ gboolean ipv6,
+ gboolean route,
+ char **out_gateway,
+ NMSetting *setting)
+{
+ guint32 plen = G_MAXUINT32;
+ gpointer result;
+ char *address_str, *plen_str, *gateway_str, *metric_str, *current, *error;
+ gs_free char *value = NULL, *value_orig = NULL;
+
+#define VALUE_ORIG() (value_orig ? value_orig : (value_orig = nm_keyfile_plugin_kf_get_string (info->keyfile, setting_name, key_name, NULL)))
+
+ current = value = nm_keyfile_plugin_kf_get_string (info->keyfile, setting_name, key_name, NULL);
+ if (!value)
+ return NULL;
+
+ /* get address field */
+ address_str = read_field (&current, &error, IP_ADDRESS_CHARS, DELIMITERS);
+ if (error) {
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("unexpected character '%c' for address %s: '%s' (position %td)"),
+ *error, key_name, VALUE_ORIG (), error - current);
+ return NULL;
+ }
+ /* get prefix length field (skippable) */
+ plen_str = read_field (&current, &error, DIGITS, DELIMITERS);
+ /* get gateway field */
+ gateway_str = read_field (&current, &error, IP_ADDRESS_CHARS, DELIMITERS);
+ if (error) {
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("unexpected character '%c' for %s: '%s' (position %td)"),
+ *error, key_name, VALUE_ORIG (), error - current);
+ return NULL;
+ }
+ /* for routes, get metric */
+ if (route) {
+ metric_str = read_field (&current, &error, DIGITS, DELIMITERS);
+ if (error) {
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("unexpected character '%c' in prefix length for %s: '%s' (position %td)"),
+ *error, key_name, VALUE_ORIG (), error - current);
+ return NULL;
+ }
+ } else
+ metric_str = NULL;
+ if (current) {
+ /* there is still some data */
+ if (*current) {
+ /* another field follows */
+ handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("garbage at the end of value %s: '%s'"),
+ key_name, VALUE_ORIG ());
+ return NULL;
+ } else {
+ /* semicolon at the end of input */
+ if (!handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_INFO,
+ _("deprecated semicolon at the end of value %s: '%s'"),
+ key_name, VALUE_ORIG ()))
+ return NULL;
+ }
+ }
+
+#define DEFAULT_PREFIX(for_route, for_ipv6) ( (for_route) ? ( (for_ipv6) ? 128 : 24 ) : ( (for_ipv6) ? 64 : 24 ) )
+
+ /* parse plen, fallback to defaults */
+ if (plen_str) {
+ if (!get_one_int (info, property_name, plen_str, ipv6 ? 128 : 32, &plen)
+ || (route && plen == 0)) {
+ plen = DEFAULT_PREFIX (route, ipv6);
+ if ( info->error
+ || !handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid prefix length for %s '%s', defaulting to %d"),
+ key_name, VALUE_ORIG (), plen))
+ return NULL;
+ }
+ } else {
+ plen = DEFAULT_PREFIX (route, ipv6);
+ if (!handle_warn (info, property_name, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("missing prefix length for %s '%s', defaulting to %d"),
+ key_name, VALUE_ORIG (), plen))
+ return NULL;
+ }
+
+ /* build the appropriate data structure for NetworkManager settings */
+ if (route) {
+ result = build_route (info, property_name,
+ ipv6 ? AF_INET6 : AF_INET,
+ address_str, plen, gateway_str, metric_str);
+ } else {
+ result = build_address (info, ipv6 ? AF_INET6 : AF_INET,
+ address_str, plen, property_name);
+ if (!result)
+ return NULL;
+ if (out_gateway && gateway_str)
+ *out_gateway = g_strdup (gateway_str);
+ }
+
+#undef VALUE_ORIG
+
+ return result;
+}
+
+static void
+ip_address_or_route_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ gboolean ipv6 = !strcmp (setting_name, "ipv6");
+ gboolean routes = !strcmp (key, "routes");
+ static const char *key_names_routes[] = { "route", "routes", NULL };
+ static const char *key_names_addresses[] = { "address", "addresses", NULL };
+ const char **key_names = routes ? key_names_routes : key_names_addresses;
+ char *gateway = NULL;
+ GPtrArray *list;
+ GDestroyNotify free_func;
+ int i;
+
+ if (routes)
+ free_func = (GDestroyNotify) nm_ip_route_unref;
+ else
+ free_func = (GDestroyNotify) nm_ip_address_unref;
+ list = g_ptr_array_new_with_free_func (free_func);
+
+ for (i = -1; i < 1000; i++) {
+ const char **key_basename;
+
+ for (key_basename = key_names; *key_basename; key_basename++) {
+ char *key_name;
+ gpointer item;
+
+ /* -1 means no suffix */
+ if (i >= 0)
+ key_name = g_strdup_printf ("%s%d", *key_basename, i);
+ else
+ key_name = g_strdup (*key_basename);
+
+ item = read_one_ip_address_or_route (info, key, setting_name, key_name, ipv6, routes,
+ gateway ? NULL : &gateway, setting);
+ g_free (key_name);
+
+ if (info->error) {
+ g_ptr_array_unref (list);
+ g_free (gateway);
+ return;
+ }
+ if (item)
+ g_ptr_array_add (list, item);
+
+ }
+ }
+
+ if (list->len >= 1)
+ g_object_set (setting, key, list, NULL);
+
+ if (gateway) {
+ g_object_set (setting, "gateway", gateway, NULL);
+ g_free (gateway);
+ }
+
+ g_ptr_array_unref (list);
+}
+
+static void
+ip4_dns_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ GPtrArray *array;
+ gsize length;
+ char **list, **iter;
+ int ret;
+
+ list = nm_keyfile_plugin_kf_get_string_list (info->keyfile, setting_name, key, &length, NULL);
+ if (!list || !g_strv_length (list))
+ return;
+
+ array = g_ptr_array_sized_new (length + 1);
+ for (iter = list; *iter; iter++) {
+ guint32 addr;
+
+ ret = inet_pton (AF_INET, *iter, &addr);
+ if (ret <= 0) {
+ if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid DNS server IPv4 address '%s'"),
+ *iter)) {
+ g_ptr_array_unref (array);
+ g_strfreev (list);
+ return;
+ }
+ continue;
+ }
+
+ g_ptr_array_add (array, *iter);
+ }
+ g_ptr_array_add (array, NULL);
+
+ g_object_set (setting, key, array->pdata, NULL);
+ g_ptr_array_unref (array);
+ g_strfreev (list);
+}
+
+static void
+ip6_dns_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ GPtrArray *array = NULL;
+ gsize length;
+ char **list, **iter;
+ int ret;
+
+ list = nm_keyfile_plugin_kf_get_string_list (info->keyfile, setting_name, key, &length, NULL);
+ if (!list || !g_strv_length (list))
+ return;
+
+ array = g_ptr_array_sized_new (length + 1);
+
+ for (iter = list; *iter; iter++) {
+ struct in6_addr addr;
+
+ ret = inet_pton (AF_INET6, *iter, &addr);
+ if (ret <= 0) {
+ if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid DNS server IPv6 address '%s'"),
+ *iter)) {
+ g_ptr_array_unref (array);
+ g_strfreev (list);
+ return;
+ }
+ continue;
+ }
+
+ g_ptr_array_add (array, *iter);
+ }
+ g_ptr_array_add (array, NULL);
+
+ g_object_set (setting, key, array->pdata, NULL);
+ g_ptr_array_unref (array);
+ g_strfreev (list);
+}
+
+static void
+mac_address_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key, gsize enforce_length)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ char *tmp_string = NULL, *p, *mac_str;
+ gint *tmp_list;
+ GByteArray *array = NULL;
+ gsize length;
+
+ p = tmp_string = nm_keyfile_plugin_kf_get_string (info->keyfile, setting_name, key, NULL);
+ if (tmp_string && tmp_string[0]) {
+ /* Look for enough ':' characters to signify a MAC address */
+ guint i = 0;
+
+ while (*p) {
+ if (*p == ':')
+ i++;
+ p++;
+ }
+
+ if (enforce_length == 0 || enforce_length == i+1) {
+ /* If we found enough it's probably a string-format MAC address */
+ array = g_byte_array_sized_new (i+1);
+ g_byte_array_set_size (array, i+1);
+ if (!nm_utils_hwaddr_aton (tmp_string, array->data, array->len)) {
+ g_byte_array_unref (array);
+ array = NULL;
+ }
+ }
+ }
+ g_free (tmp_string);
+
+ if (array == NULL) {
+ /* Old format; list of ints */
+ tmp_list = nm_keyfile_plugin_kf_get_integer_list (info->keyfile, setting_name, key, &length, NULL);
+ if (length > 0 && (enforce_length == 0 || enforce_length == length)) {
+ gsize i;
+
+ array = g_byte_array_sized_new (length);
+ for (i = 0; i < length; i++) {
+ int val = tmp_list[i];
+ const guint8 v = (guint8) (val & 0xFF);
+
+ if (val < 0 || val > 255) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid byte element '%d' (not between 0 and 255 inclusive)"),
+ val);
+ g_byte_array_free (array, TRUE);
+ g_free (tmp_list);
+ return;
+ }
+ g_byte_array_append (array, &v, 1);
+ }
+ }
+ g_free (tmp_list);
+ }
+
+ if (!array) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid MAC address"));
+ return;
+ }
+
+ mac_str = nm_utils_hwaddr_ntoa (array->data, array->len);
+ g_object_set (setting, key, mac_str, NULL);
+ g_free (mac_str);
+ g_byte_array_free (array, TRUE);
+}
+
+static void
+mac_address_parser_ETHER (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ mac_address_parser (info, setting, key, ETH_ALEN);
+}
+
+static void
+mac_address_parser_INFINIBAND (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ mac_address_parser (info, setting, key, INFINIBAND_ALEN);
+}
+
+static void
+read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key)
+{
+ char **keys, **iter;
+ char *value;
+ const char *setting_name = nm_setting_get_name (setting);
+
+ keys = nm_keyfile_plugin_kf_get_keys (file, setting_name, NULL, NULL);
+ if (!keys || !*keys)
+ return;
+
+ for (iter = keys; *iter; iter++) {
+ value = nm_keyfile_plugin_kf_get_string (file, setting_name, *iter, NULL);
+ if (!value)
+ continue;
+
+ if (NM_IS_SETTING_VPN (setting)) {
+ /* Add any item that's not a class property to the data hash */
+ if (!g_object_class_find_property (G_OBJECT_GET_CLASS (setting), *iter))
+ nm_setting_vpn_add_data_item (NM_SETTING_VPN (setting), *iter, value);
+ }
+ if (NM_IS_SETTING_BOND (setting)) {
+ if (strcmp (*iter, "interface-name"))
+ nm_setting_bond_add_option (NM_SETTING_BOND (setting), *iter, value);
+ }
+ g_free (value);
+ }
+ g_strfreev (keys);
+}
+
+static void
+unescape_semicolons (char *str)
+{
+ int i;
+ gsize len = strlen (str);
+
+ for (i = 0; i < len; i++) {
+ if (str[i] == '\\' && str[i+1] == ';') {
+ memmove(str + i, str + i + 1, len - (i + 1));
+ len--;
+ }
+ str[len] = '\0';
+ }
+}
+
+static GBytes *
+get_bytes (KeyfileReaderInfo *info,
+ const char *setting_name,
+ const char *key,
+ gboolean zero_terminate,
+ gboolean unescape_semicolon)
+{
+ GByteArray *array = NULL;
+ char *tmp_string;
+ gint *tmp_list;
+ gsize length;
+ int i;
+
+ if (!nm_keyfile_plugin_kf_has_key (info->keyfile, setting_name, key, NULL))
+ return NULL;
+
+ /* New format: just a string
+ * Old format: integer list; e.g. 11;25;38;
+ */
+ tmp_string = nm_keyfile_plugin_kf_get_string (info->keyfile, setting_name, key, NULL);
+ if (tmp_string) {
+ GRegex *regex;
+ GMatchInfo *match_info;
+ const char *pattern = "^[[:space:]]*[[:digit:]]{1,3}[[:space:]]*;([[:space:]]*[[:digit:]]{1,3}[[:space:]]*;)*([[:space:]]*)?$";
+
+ regex = g_regex_new (pattern, 0, 0, NULL);
+ g_regex_match (regex, tmp_string, 0, &match_info);
+ if (!g_match_info_matches (match_info)) {
+ /* Handle as a simple string (ie, new format) */
+ if (unescape_semicolon)
+ unescape_semicolons (tmp_string);
+ length = strlen (tmp_string);
+ if (zero_terminate)
+ length++;
+ array = g_byte_array_sized_new (length);
+ g_byte_array_append (array, (guint8 *) tmp_string, length);
+ }
+ g_match_info_free (match_info);
+ g_regex_unref (regex);
+ g_free (tmp_string);
+ }
+
+ if (!array) {
+ gboolean already_warned = FALSE;
+
+ /* Old format; list of ints */
+ tmp_list = nm_keyfile_plugin_kf_get_integer_list (info->keyfile, setting_name, key, &length, NULL);
+ if (!tmp_list) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid binary property"));
+ return NULL;
+ }
+ array = g_byte_array_sized_new (length);
+ for (i = 0; i < length; i++) {
+ int val = tmp_list[i];
+ unsigned char v = (unsigned char) (val & 0xFF);
+
+ if (val < 0 || val > 255) {
+ if ( !already_warned
+ && !handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid byte element '%d' (not between 0 and 255 inclusive)"),
+ val)) {
+ g_free (tmp_list);
+ g_byte_array_free (array, TRUE);
+ return NULL;
+ }
+ already_warned = TRUE;
+ } else
+ g_byte_array_append (array, (const unsigned char *) &v, sizeof (v));
+ }
+ g_free (tmp_list);
+ }
+
+ if (array->len == 0) {
+ g_byte_array_free (array, TRUE);
+ return NULL;
+ } else
+ return g_byte_array_free_to_bytes (array);
+}
+
+static void
+ssid_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ GBytes *bytes;
+
+ bytes = get_bytes (info, setting_name, key, FALSE, TRUE);
+ if (bytes) {
+ g_object_set (setting, key, bytes, NULL);
+ g_bytes_unref (bytes);
+ } else if (!info->error) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid SSID"));
+ }
+}
+
+static void
+password_raw_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ GBytes *bytes;
+
+ bytes = get_bytes (info, setting_name, key, FALSE, TRUE);
+ if (bytes) {
+ g_object_set (setting, key, bytes, NULL);
+ g_bytes_unref (bytes);
+ } else if (!info->error) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid raw password"));
+ }
+}
+
+static char *
+get_cert_path (const char *base_dir, const guint8 *cert_path, gsize cert_path_len)
+{
+ const char *base;
+ char *p = NULL, *path, *tmp;
+
+ g_return_val_if_fail (base_dir != NULL, NULL);
+ g_return_val_if_fail (cert_path != NULL, NULL);
+
+ base = path = g_malloc0 (cert_path_len + 1);
+ memcpy (path, cert_path, cert_path_len);
+
+ if (path[0] == '/')
+ return path;
+
+ p = strrchr (path, '/');
+ if (p)
+ base = p + 1;
+
+ tmp = g_build_path ("/", base_dir, base, NULL);
+ g_free (path);
+ return tmp;
+}
+
+static const char *certext[] = { ".pem", ".cert", ".crt", ".cer", ".p12", ".der", ".key" };
+
+static gboolean
+has_cert_ext (const char *path)
+{
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS (certext); i++) {
+ if (g_str_has_suffix (path, certext[i]))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gboolean
+handle_as_scheme (KeyfileReaderInfo *info, GBytes *bytes, NMSetting *setting, const char *key)
+{
+ const char *data;
+ gsize data_len, bin_len;
+
+ data = g_bytes_get_data (bytes, &data_len);
+
+ g_return_val_if_fail (data && data_len > 0, FALSE);
+
+ /* to be a scheme, @data must be a zero terminated string, which is counted by @data_len */
+ if (data[data_len - 1] != '\0')
+ return FALSE;
+ data_len--;
+
+ /* It's the PATH scheme, can just set plain data.
+ * In this case, @data_len includes */
+ if ( data_len >= STRLEN (NM_KEYFILE_CERT_SCHEME_PREFIX_PATH)
+ && g_str_has_prefix (data, NM_KEYFILE_CERT_SCHEME_PREFIX_PATH)) {
+ if (nm_setting_802_1x_check_cert_scheme (data, data_len + 1, NULL) == NM_SETTING_802_1X_CK_SCHEME_PATH) {
+ const char *path = &data[STRLEN (NM_KEYFILE_CERT_SCHEME_PREFIX_PATH)];
+ gs_free char *path_free = NULL;
+
+ if (path[0] != '/') {
+ /* we want to read absolute paths because we use keyfile as exchange
+ * between different processes which might not have the same cwd. */
+ path = path_free = get_cert_path (info->base_dir, (const guint8 *) path,
+ data_len - STRLEN (NM_KEYFILE_CERT_SCHEME_PREFIX_PATH));
+ }
+
+ g_object_set (setting, key, bytes, NULL);
+ if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_INFO_MISSING_FILE,
+ _("certificate or key file '%s' does not exist"),
+ path);
+ }
+ } else {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid key/cert value path \"%s\""), data);
+ }
+ return TRUE;
+ }
+ if ( data_len > STRLEN (NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB)
+ && g_str_has_prefix (data, NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB)) {
+ const char *cdata = data + STRLEN (NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB);
+ guchar *bin;
+ GBytes *bytes2;
+ gsize i;
+ gboolean valid_base64;
+
+ data_len -= STRLEN (NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB);
+
+ /* Let's be strict here. We expect valid base64, no funny stuff!!
+ * We didn't write such invalid data ourselfes and refuse to read it as blob. */
+ if ((valid_base64 = (data_len % 4 == 0))) {
+ for (i = 0; i < data_len; i++) {
+ char c = cdata[i];
+
+ if (!( (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
+ || (c >= '0' && c <= '9')
+ || (c == '+' || c == '/'))) {
+ if (c != '=' || i < data_len - 2)
+ valid_base64 = FALSE;
+ else {
+ for (; i < data_len; i++) {
+ if (cdata[i] != '=')
+ valid_base64 = FALSE;
+ }
+ }
+ break;
+ }
+ }
+ }
+ if (!valid_base64) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid key/cert value data:;base64, is not base64"));
+ return TRUE;
+ }
+
+ bin = g_base64_decode (cdata, &bin_len);
+
+ g_return_val_if_fail (bin_len > 0, FALSE);
+ if (nm_setting_802_1x_check_cert_scheme (bin, bin_len, NULL) != NM_SETTING_802_1X_CK_SCHEME_BLOB) {
+ /* The blob probably starts with "file://". Setting the cert data will confuse NMSetting8021x.
+ * In fact this is a limitation of NMSetting8021x which does not support setting blobs that start
+ * with file://. Just warn and return TRUE to signal that we ~handled~ the setting. */
+ g_free (bin);
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid key/cert value data:;base64,file://"));
+ } else {
+ bytes2 = g_bytes_new_take (bin, bin_len);
+ g_object_set (setting, key, bytes2, NULL);
+ g_bytes_unref (bytes2);
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+char *
+nm_keyfile_detect_unqualified_path_scheme (const char *base_dir,
+ gconstpointer pdata,
+ gsize data_len,
+ gboolean consider_exists,
+ gboolean *out_exists)
+{
+ const char *data = pdata;
+ gboolean exists = FALSE;
+ gboolean success = FALSE;
+ gsize validate_len;
+ char *path;
+ GByteArray *tmp;
+
+ g_return_val_if_fail (base_dir && base_dir[0] == '/', NULL);
+
+ if (!pdata)
+ return NULL;
+ if (data_len == -1)
+ data_len = strlen (data);
+ if (data_len > 500 || data_len < 1)
+ return NULL;
+
+ /* If there's a trailing zero tell g_utf8_validate() to validate until the zero */
+ if (data[data_len - 1] == '\0') {
+ /* setting it to -1, would mean we accept data to contain NUL characters before the
+ * end. Don't accept any NUL in [0 .. data_len-1[ . */
+ validate_len = data_len - 1;
+ } else
+ validate_len = data_len;
+ if ( validate_len == 0
+ || g_utf8_validate ((const char *) data, validate_len, NULL) == FALSE)
+ return NULL;
+
+ /* Might be a bare path without the file:// prefix; in that case
+ * if it's an absolute path, use that, otherwise treat it as a
+ * relative path to the current directory.
+ */
+
+ path = get_cert_path (base_dir, (const guint8 *) data, data_len);
+ if ( !memchr (data, '/', data_len)
+ && !has_cert_ext (path)) {
+ if (!consider_exists)
+ goto out;
+ exists = g_file_test (path, G_FILE_TEST_EXISTS);
+ if (!exists)
+ goto out;
+ } else if (out_exists)
+ exists = g_file_test (path, G_FILE_TEST_EXISTS);
+
+ /* Construct the proper value as required for the PATH scheme */
+ tmp = g_byte_array_sized_new (strlen (NM_KEYFILE_CERT_SCHEME_PREFIX_PATH) + strlen (path) + 1);
+ g_byte_array_append (tmp, (const guint8 *) NM_KEYFILE_CERT_SCHEME_PREFIX_PATH, strlen (NM_KEYFILE_CERT_SCHEME_PREFIX_PATH));
+ g_byte_array_append (tmp, (const guint8 *) path, strlen (path) + 1);
+ if (nm_setting_802_1x_check_cert_scheme (tmp->data, tmp->len, NULL) == NM_SETTING_802_1X_CK_SCHEME_PATH) {
+ g_free (path);
+ path = (char *) g_byte_array_free (tmp, FALSE);
+ /* when returning TRUE, we must also be sure that @data_len does not look like
+ * the deprecated format of list of integers. With this implementation that is the
+ * case, as long as @consider_exists is FALSE. */
+ success = TRUE;
+ } else
+ g_byte_array_unref (tmp);
+
+out:
+ if (!success) {
+ g_free (path);
+ return NULL;
+ }
+ if (out_exists)
+ *out_exists = exists;
+ return path;
+}
+
+static gboolean
+handle_as_path (KeyfileReaderInfo *info,
+ GBytes *bytes,
+ NMSetting *setting,
+ const char *key)
+{
+ const guint8 *data;
+ gsize data_len;
+ char *path;
+ gboolean exists = FALSE;
+ GBytes *val;
+
+ data = g_bytes_get_data (bytes, &data_len);
+
+ path = nm_keyfile_detect_unqualified_path_scheme (info->base_dir, data, data_len, TRUE, &exists);
+ if (!path)
+ return FALSE;
+
+ /* Construct the proper value as required for the PATH scheme */
+ val = g_bytes_new_take (path, strlen (path) + 1);
+ g_object_set (setting, key, val, NULL);
+
+ /* Warn if the certificate didn't exist */
+ if (!exists) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_INFO_MISSING_FILE,
+ _("certificate or key file '%s' does not exist"),
+ path);
+ }
+ g_bytes_unref (val);
+
+ return TRUE;
+}
+
+static void
+cert_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ gs_unref_bytes GBytes *bytes = NULL;
+ gsize bin_len;
+ const char *bin;
+
+ bytes = get_bytes (info, setting_name, key, TRUE, FALSE);
+ if (bytes) {
+ /* Try as a path + scheme (ie, starts with "file://") */
+ if (handle_as_scheme (info, bytes, setting, key))
+ return;
+ if (info->error)
+ return;
+
+ /* If not, it might be a plain path */
+ if (handle_as_path (info, bytes, setting, key))
+ return;
+ if (info->error)
+ return;
+
+ bin = g_bytes_get_data (bytes, &bin_len);
+ if (nm_setting_802_1x_check_cert_scheme (bin, bin_len, NULL) != NM_SETTING_802_1X_CK_SCHEME_BLOB) {
+ /* The blob probably starts with "file://" but contains invalid characters for a path.
+ * Setting the cert data will confuse NMSetting8021x.
+ * In fact, NMSetting8021x does not support setting such binary data, so just warn and
+ * continue. */
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid key/cert value is not a valid blob"));
+ } else
+ g_object_set (setting, key, bytes, NULL);
+ } else if (!info->error) {
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid key/cert value"));
+ }
+}
+
+static void
+parity_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ NMSettingSerialParity parity;
+ int int_val;
+ gs_free char *str_val = NULL;
+
+ /* Keyfile traditionally stored this as the ASCII value for 'E', 'o', or 'n'.
+ * We now accept either that or the (case-insensitive) character itself (but
+ * still always write it the old way, for backward compatibility).
+ */
+ int_val = nm_keyfile_plugin_kf_get_integer (info->keyfile, setting_name, key, NULL);
+ if (!int_val) {
+ str_val = nm_keyfile_plugin_kf_get_string (info->keyfile, setting_name, key, NULL);
+ if (str_val) {
+ if (str_val[0] && !str_val[1])
+ int_val = str_val[0];
+ else {
+ /* This will hit the warning below */
+ int_val = 'X';
+ }
+ }
+ }
+
+ if (!int_val)
+ return;
+
+ switch (int_val) {
+ case 'E':
+ case 'e':
+ parity = NM_SETTING_SERIAL_PARITY_EVEN;
+ break;
+ case 'O':
+ case 'o':
+ parity = NM_SETTING_SERIAL_PARITY_ODD;
+ break;
+ case 'N':
+ case 'n':
+ parity = NM_SETTING_SERIAL_PARITY_NONE;
+ break;
+ default:
+ handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid parity value '%s'"),
+ str_val ? str_val : "");
+ return;
+ }
+
+ g_object_set (setting, key, parity, NULL);
+}
+
+typedef struct {
+ const char *setting_name;
+ const char *key;
+ gboolean check_for_key;
+ void (*parser) (KeyfileReaderInfo *info, NMSetting *setting, const char *key);
+} KeyParser;
+
+/* A table of keys that require further parsing/conversion because they are
+ * stored in a format that can't be automatically read using the key's type.
+ * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are
+ * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored
+ * in struct in6_addr internally, but as string in keyfiles.
+ */
+static KeyParser key_parsers[] = {
+ { NM_SETTING_CONNECTION_SETTING_NAME,
+ NM_SETTING_CONNECTION_TYPE,
+ TRUE,
+ setting_alias_parser },
+ { NM_SETTING_BRIDGE_SETTING_NAME,
+ NM_SETTING_BRIDGE_MAC_ADDRESS,
+ TRUE,
+ mac_address_parser_ETHER },
+ { NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ADDRESSES,
+ FALSE,
+ ip_address_or_route_parser },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ADDRESSES,
+ FALSE,
+ ip_address_or_route_parser },
+ { NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ROUTES,
+ FALSE,
+ ip_address_or_route_parser },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ROUTES,
+ FALSE,
+ ip_address_or_route_parser },
+ { NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_DNS,
+ FALSE,
+ ip4_dns_parser },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_DNS,
+ FALSE,
+ ip6_dns_parser },
+ { NM_SETTING_WIRED_SETTING_NAME,
+ NM_SETTING_WIRED_MAC_ADDRESS,
+ TRUE,
+ mac_address_parser_ETHER },
+ { NM_SETTING_WIRED_SETTING_NAME,
+ NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
+ TRUE,
+ mac_address_parser_ETHER },
+ { NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_MAC_ADDRESS,
+ TRUE,
+ mac_address_parser_ETHER },
+ { NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS,
+ TRUE,
+ mac_address_parser_ETHER },
+ { NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_BSSID,
+ TRUE,
+ mac_address_parser_ETHER },
+ { NM_SETTING_BLUETOOTH_SETTING_NAME,
+ NM_SETTING_BLUETOOTH_BDADDR,
+ TRUE,
+ mac_address_parser_ETHER },
+ { NM_SETTING_INFINIBAND_SETTING_NAME,
+ NM_SETTING_INFINIBAND_MAC_ADDRESS,
+ TRUE,
+ mac_address_parser_INFINIBAND },
+ { NM_SETTING_WIMAX_SETTING_NAME,
+ NM_SETTING_WIMAX_MAC_ADDRESS,
+ TRUE,
+ mac_address_parser_ETHER },
+ { NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_SSID,
+ TRUE,
+ ssid_parser },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PASSWORD_RAW,
+ TRUE,
+ password_raw_parser },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_CA_CERT,
+ TRUE,
+ cert_parser },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_CLIENT_CERT,
+ TRUE,
+ cert_parser },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PRIVATE_KEY,
+ TRUE,
+ cert_parser },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PHASE2_CA_CERT,
+ TRUE,
+ cert_parser },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
+ TRUE,
+ cert_parser },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
+ TRUE,
+ cert_parser },
+ { NM_SETTING_SERIAL_SETTING_NAME,
+ NM_SETTING_SERIAL_PARITY,
+ TRUE,
+ parity_parser },
+ { NULL, NULL, FALSE }
+};
+
+static void
+read_one_setting_value (NMSetting *setting,
+ const char *key,
+ const GValue *value,
+ GParamFlags flags,
+ gpointer user_data)
+{
+ KeyfileReaderInfo *info = user_data;
+ GKeyFile *keyfile = info->keyfile;
+ const char *setting_name;
+ int errsv;
+ GType type;
+ gs_free_error GError *err = NULL;
+ gboolean check_for_key = TRUE;
+ KeyParser *parser = &key_parsers[0];
+
+ if (info->error)
+ return;
+
+ /* Property is not writable */
+ if (!(flags & G_PARAM_WRITABLE))
+ return;
+
+ /* Setting name gets picked up from the keyfile's section name instead */
+ if (!strcmp (key, NM_SETTING_NAME))
+ return;
+
+ /* Don't read the NMSettingConnection object's 'read-only' property */
+ if ( NM_IS_SETTING_CONNECTION (setting)
+ && !strcmp (key, NM_SETTING_CONNECTION_READ_ONLY))
+ return;
+
+ setting_name = nm_setting_get_name (setting);
+
+ /* Look through the list of handlers for non-standard format key values */
+ while (parser->setting_name) {
+ if (!strcmp (parser->setting_name, setting_name) && !strcmp (parser->key, key)) {
+ check_for_key = parser->check_for_key;
+ break;
+ }
+ parser++;
+ }
+
+ /* VPN properties don't have the exact key name */
+ if (NM_IS_SETTING_VPN (setting))
+ check_for_key = FALSE;
+
+ /* Bonding 'options' don't have the exact key name. The options are right under [bond] group. */
+ if (NM_IS_SETTING_BOND (setting))
+ check_for_key = FALSE;
+
+ /* Check for the exact key in the GKeyFile if required. Most setting
+ * properties map 1:1 to a key in the GKeyFile, but for those properties
+ * like IP addresses and routes where more than one value is actually
+ * encoded by the setting property, this won't be true.
+ */
+ if (check_for_key && !nm_keyfile_plugin_kf_has_key (keyfile, setting_name, key, &err)) {
+ /* Key doesn't exist or an error ocurred, thus nothing to do. */
+ if (err) {
+ if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("error loading setting value: %s"),
+ err->message))
+ goto out_error;
+ }
+ return;
+ }
+
+ /* If there's a custom parser for this key, handle that before the generic
+ * parsers below.
+ */
+ if (parser->setting_name) {
+ (*parser->parser) (info, setting, key);
+ return;
+ }
+
+ type = G_VALUE_TYPE (value);
+
+ if (type == G_TYPE_STRING) {
+ char *str_val;
+
+ str_val = nm_keyfile_plugin_kf_get_string (keyfile, setting_name, key, NULL);
+ g_object_set (setting, key, str_val, NULL);
+ g_free (str_val);
+ } else if (type == G_TYPE_UINT) {
+ int int_val;
+
+ int_val = nm_keyfile_plugin_kf_get_integer (keyfile, setting_name, key, NULL);
+ if (int_val < 0) {
+ if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid negative value (%i)"),
+ int_val))
+ goto out_error;
+ }
+ g_object_set (setting, key, int_val, NULL);
+ } else if (type == G_TYPE_INT) {
+ int int_val;
+
+ int_val = nm_keyfile_plugin_kf_get_integer (keyfile, setting_name, key, NULL);
+ g_object_set (setting, key, int_val, NULL);
+ } else if (type == G_TYPE_BOOLEAN) {
+ gboolean bool_val;
+
+ bool_val = nm_keyfile_plugin_kf_get_boolean (keyfile, setting_name, key, NULL);
+ g_object_set (setting, key, bool_val, NULL);
+ } else if (type == G_TYPE_CHAR) {
+ int int_val;
+
+ int_val = nm_keyfile_plugin_kf_get_integer (keyfile, setting_name, key, NULL);
+ if (int_val < G_MININT8 || int_val > G_MAXINT8) {
+ if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid char value (%i)"),
+ int_val))
+ goto out_error;
+ }
+
+ g_object_set (setting, key, int_val, NULL);
+ } else if (type == G_TYPE_UINT64) {
+ char *tmp_str;
+ guint64 uint_val;
+
+ tmp_str = nm_keyfile_plugin_kf_get_value (keyfile, setting_name, key, NULL);
+ uint_val = g_ascii_strtoull (tmp_str, NULL, 10);
+ g_free (tmp_str);
+ g_object_set (setting, key, uint_val, NULL);
+ } else if (type == G_TYPE_INT64) {
+ gs_free char *tmp_str = NULL;
+ gint64 int_val;
+
+ tmp_str = nm_keyfile_plugin_kf_get_value (keyfile, setting_name, key, NULL);
+ int_val = _nm_utils_ascii_str_to_int64 (tmp_str, 10, G_MININT64, G_MAXINT64, 0);
+ errsv = errno;
+ if (errsv) {
+ if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid int64 value (%s)"),
+ tmp_str))
+ goto out_error;
+ } else
+ g_object_set (setting, key, int_val, NULL);
+ } else if (type == G_TYPE_BYTES) {
+ gint *tmp;
+ GByteArray *array;
+ GBytes *bytes;
+ gsize length;
+ int i;
+ gboolean already_warned = FALSE;
+
+ tmp = nm_keyfile_plugin_kf_get_integer_list (keyfile, setting_name, key, &length, NULL);
+
+ array = g_byte_array_sized_new (length);
+ for (i = 0; i < length; i++) {
+ int val = tmp[i];
+ unsigned char v = (unsigned char) (val & 0xFF);
+
+ if (val < 0 || val > 255) {
+ if ( !already_warned
+ && !handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("ignoring invalid byte element '%d' (not between 0 and 255 inclusive)"),
+ val)) {
+ g_byte_array_unref (array);
+ g_free (tmp);
+ goto out_error;
+ }
+ already_warned = TRUE;
+ } else
+ g_byte_array_append (array, (const unsigned char *) &v, sizeof (v));
+ }
+
+ bytes = g_byte_array_free_to_bytes (array);
+ g_object_set (setting, key, bytes, NULL);
+ g_bytes_unref (bytes);
+ g_free (tmp);
+ } else if (type == G_TYPE_STRV) {
+ gchar **sa;
+ gsize length;
+
+ sa = nm_keyfile_plugin_kf_get_string_list (keyfile, setting_name, key, &length, NULL);
+ g_object_set (setting, key, sa, NULL);
+ g_strfreev (sa);
+ } else if (type == G_TYPE_HASH_TABLE) {
+ read_hash_of_string (keyfile, setting, key);
+ } else if (type == G_TYPE_ARRAY) {
+ read_array_of_uint (keyfile, setting, key);
+ } else if (G_VALUE_HOLDS_FLAGS (value)) {
+ guint64 uint_val;
+
+ /* Flags are guint but GKeyFile has no uint reader, just uint64 */
+ uint_val = nm_keyfile_plugin_kf_get_uint64 (keyfile, setting_name, key, &err);
+ if (!err) {
+ if (uint_val <= G_MAXUINT)
+ g_object_set (setting, key, (guint) uint_val, NULL);
+ else {
+ if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("too large FLAGS property '%s' (%llu)"),
+ G_VALUE_TYPE_NAME (value), (long long unsigned) uint_val))
+ goto out_error;
+ }
+ }
+ } else if (G_VALUE_HOLDS_ENUM (value)) {
+ gint int_val;
+
+ int_val = nm_keyfile_plugin_kf_get_integer (keyfile, setting_name, key, &err);
+ if (!err)
+ g_object_set (setting, key, (gint) int_val, NULL);
+ } else {
+ if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("unhandled setting property type '%s'"),
+ G_VALUE_TYPE_NAME (value)))
+ goto out_error;
+ }
+out_error:
+ return;
+}
+
+static NMSetting *
+read_setting (KeyfileReaderInfo *info)
+{
+ const char *alias;
+ GType type;
+
+ alias = nm_keyfile_plugin_get_setting_name_for_alias (info->group);
+ if (!alias)
+ alias = info->group;
+
+ type = nm_setting_lookup_type (alias);
+ if (type) {
+ NMSetting *setting = g_object_new (type, NULL);
+
+ info->setting = setting;
+ nm_setting_enumerate_values (setting, read_one_setting_value, info);
+ info->setting = NULL;
+ if (!info->error)
+ return setting;
+
+ g_object_unref (setting);
+ } else {
+ handle_warn (info, NULL, NM_KEYFILE_WARN_SEVERITY_WARN,
+ _("invalid setting name '%s'"), info->group);
+ }
+
+ return NULL;
+}
+
+static void
+read_vpn_secrets (KeyfileReaderInfo *info, NMSettingVpn *s_vpn)
+{
+ char **keys, **iter;
+
+ keys = nm_keyfile_plugin_kf_get_keys (info->keyfile, VPN_SECRETS_GROUP, NULL, NULL);
+ for (iter = keys; *iter; iter++) {
+ char *secret;
+
+ secret = nm_keyfile_plugin_kf_get_string (info->keyfile, VPN_SECRETS_GROUP, *iter, NULL);
+ if (secret) {
+ nm_setting_vpn_add_secret (s_vpn, *iter, secret);
+ g_free (secret);
+ }
+ }
+ g_strfreev (keys);
+}
+
+/**
+ * nm_keyfile_read:
+ * @keyfile: the keyfile from which to create the connection
+ * @keyfile_name: keyfile allows missing connection id and uuid
+ * and NetworkManager will create those when reading a connection
+ * from file. By providing a filename you can reproduce that behavior,
+ * but of course, it can only recreate the same UUID if you provide the
+ * same filename as NetworkManager core daemon would.
+ * @keyfile_name has only a relevance for setting the id or uuid if it
+ * is missing and as fallback for @base_dir.
+ * @base_dir: when reading certificates from files with relative name,
+ * the relative path is made absolute using @base_dir.
+ * If @base_dir is missing, first try to get the pathname from @keyfile_name
+ * (if it is given as absolute path). As last, fallback to the current path.
+ * @handler: read handler
+ * @user_data: user data for read handler
+ * @error: error
+ *
+ * Tries to create a NMConnection from a keyfile. The resulting keyfile is
+ * not normalized and might not even verify.
+ *
+ * Returns: (transfer full): on success, returns the created connection.
+ */
+NMConnection *
+nm_keyfile_read (GKeyFile *keyfile,
+ const char *keyfile_name,
+ const char *base_dir,
+ NMKeyfileReadHandler handler,
+ void *user_data,
+ GError **error)
+{
+ NMConnection *connection = NULL;
+ NMSettingConnection *s_con;
+ NMSetting *setting;
+ gchar **groups;
+ gsize length;
+ int i;
+ gboolean vpn_secrets = FALSE;
+ KeyfileReaderInfo info = { 0 };
+ gs_free char *base_dir_free = NULL;
+
+ g_return_val_if_fail (keyfile, NULL);
+ g_return_val_if_fail (!error || !*error, NULL);
+
+ if (!base_dir) {
+ /* basedir is not given. Prefer it from the keyfile_name */
+ if (keyfile_name && keyfile_name[0] == '/') {
+ base_dir = base_dir_free = g_path_get_dirname (keyfile_name);
+ } else {
+ /* if keyfile is not given or not an absolute path, fallback
+ * to current working directory. */
+ base_dir = base_dir_free = g_get_current_dir ();
+ }
+ } else
+ g_return_val_if_fail ("/", NULL);
+
+ connection = nm_simple_connection_new ();
+
+ info.connection = connection;
+ info.keyfile = (GKeyFile *) keyfile;
+ info.base_dir = base_dir;
+ info.handler = handler;
+ info.user_data = user_data;
+
+ groups = g_key_file_get_groups (keyfile, &length);
+ for (i = 0; i < length; i++) {
+ /* Only read out secrets when needed */
+ if (!strcmp (groups[i], VPN_SECRETS_GROUP)) {
+ vpn_secrets = TRUE;
+ continue;
+ }
+
+ info.group = groups[i];
+ setting = read_setting (&info);
+ info.group = NULL;
+ if (info.error)
+ goto out_error;
+ if (setting)
+ nm_connection_add_setting (connection, setting);
+ }
+ g_strfreev (groups);
+
+ s_con = nm_connection_get_setting_connection (connection);
+ if (!s_con) {
+ s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
+ nm_connection_add_setting (connection, NM_SETTING (s_con));
+ }
+
+ /* Make sure that we have 'id' even if not explictly specified in the keyfile */
+ if ( keyfile_name
+ && !nm_setting_connection_get_id (s_con)) {
+ char *base_name;
+
+ base_name = g_path_get_basename (keyfile_name);
+ g_object_set (s_con, NM_SETTING_CONNECTION_ID, base_name, NULL);
+ g_free (base_name);
+ }
+
+ /* Make sure that we have 'uuid' even if not explictly specified in the keyfile */
+ if ( keyfile_name
+ && !nm_setting_connection_get_uuid (s_con)) {
+ char *hashed_uuid;
+
+ hashed_uuid = _nm_utils_uuid_generate_from_strings ("keyfile", keyfile_name, NULL);
+ g_object_set (s_con, NM_SETTING_CONNECTION_UUID, hashed_uuid, NULL);
+ g_free (hashed_uuid);
+ }
+
+ /* Make sure that we have 'interface-name' even if it was specified in the
+ * "wrong" (ie, deprecated) group.
+ */
+ if ( !nm_setting_connection_get_interface_name (s_con)
+ && nm_setting_connection_get_connection_type (s_con)) {
+ char *interface_name;
+
+ interface_name = g_key_file_get_string (keyfile,
+ nm_setting_connection_get_connection_type (s_con),
+ "interface-name",
+ NULL);
+ if (interface_name) {
+ g_object_set (s_con, NM_SETTING_CONNECTION_INTERFACE_NAME, interface_name, NULL);
+ g_free (interface_name);
+ }
+ }
+
+ /* Handle vpn secrets after the 'vpn' setting was read */
+ if (vpn_secrets) {
+ NMSettingVpn *s_vpn;
+
+ s_vpn = nm_connection_get_setting_vpn (connection);
+ if (s_vpn) {
+ read_vpn_secrets (&info, s_vpn);
+ if (info.error)
+ goto out_error;
+ }
+ }
+
+ return connection;
+out_error:
+ g_propagate_error (error, info.error);
+ g_free (connection);
+ return NULL;
+}
diff --git a/libnm-core/nm-keyfile-utils.c b/libnm-core/nm-keyfile-utils.c
new file mode 100644
index 0000000000..61b30ab9c8
--- /dev/null
+++ b/libnm-core/nm-keyfile-utils.c
@@ -0,0 +1,207 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager system settings service
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * (C) Copyright 2010 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <stdlib.h>
+#include <string.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;
+} SettingAlias;
+
+static const SettingAlias alias_list[] = {
+ { NM_SETTING_WIRED_SETTING_NAME, "ethernet" },
+ { NM_SETTING_WIRELESS_SETTING_NAME, "wifi" },
+ { NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, "wifi-security" },
+};
+
+const char *
+nm_keyfile_plugin_get_alias_for_setting_name (const char *setting_name)
+{
+ guint i;
+
+ g_return_val_if_fail (setting_name != NULL, NULL);
+
+ for (i = 0; i < G_N_ELEMENTS (alias_list); i++) {
+ if (strcmp (setting_name, alias_list[i].setting) == 0)
+ return alias_list[i].alias;
+ }
+ return NULL;
+}
+
+const char *
+nm_keyfile_plugin_get_setting_name_for_alias (const char *alias)
+{
+ guint i;
+
+ g_return_val_if_fail (alias != NULL, NULL);
+
+ for (i = 0; i < G_N_ELEMENTS (alias_list); i++) {
+ if (strcmp (alias, alias_list[i].alias) == 0)
+ return alias_list[i].setting;
+ }
+ return NULL;
+}
+
+/**********************************************************************/
+
+/* List helpers */
+#define DEFINE_KF_LIST_WRAPPER(stype, get_ctype, set_ctype) \
+get_ctype \
+nm_keyfile_plugin_kf_get_##stype##_list (GKeyFile *kf, \
+ const char *group, \
+ const char *key, \
+ gsize *out_length, \
+ GError **error) \
+{ \
+ get_ctype list; \
+ const char *alias; \
+ GError *local = NULL; \
+ \
+ list = g_key_file_get_##stype##_list (kf, group, key, out_length, &local); \
+ if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { \
+ alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
+ if (alias) { \
+ g_clear_error (&local); \
+ list = g_key_file_get_##stype##_list (kf, alias, key, out_length, &local); \
+ } \
+ } \
+ if (local) \
+ g_propagate_error (error, local); \
+ return list; \
+} \
+ \
+void \
+nm_keyfile_plugin_kf_set_##stype##_list (GKeyFile *kf, \
+ const char *group, \
+ const char *key, \
+ set_ctype list[], \
+ gsize length) \
+{ \
+ const char *alias; \
+ \
+ alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
+ g_key_file_set_##stype##_list (kf, alias ? alias : group, key, list, length); \
+}
+
+DEFINE_KF_LIST_WRAPPER(integer, gint*, gint);
+DEFINE_KF_LIST_WRAPPER(string, gchar **, const gchar* const);
+
+/* Single value helpers */
+#define DEFINE_KF_WRAPPER(stype, get_ctype, set_ctype) \
+get_ctype \
+nm_keyfile_plugin_kf_get_##stype (GKeyFile *kf, \
+ const char *group, \
+ const char *key, \
+ GError **error) \
+{ \
+ get_ctype val; \
+ const char *alias; \
+ GError *local = NULL; \
+ \
+ val = g_key_file_get_##stype (kf, group, key, &local); \
+ if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { \
+ alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
+ if (alias) { \
+ g_clear_error (&local); \
+ val = g_key_file_get_##stype (kf, alias, key, &local); \
+ } \
+ } \
+ if (local) \
+ g_propagate_error (error, local); \
+ return val; \
+} \
+ \
+void \
+nm_keyfile_plugin_kf_set_##stype (GKeyFile *kf, \
+ const char *group, \
+ const char *key, \
+ set_ctype value) \
+{ \
+ const char *alias; \
+ \
+ alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
+ g_key_file_set_##stype (kf, alias ? alias : group, key, value); \
+}
+
+DEFINE_KF_WRAPPER(string, gchar*, const gchar*);
+DEFINE_KF_WRAPPER(integer, gint, gint);
+DEFINE_KF_WRAPPER(uint64, guint64, guint64);
+DEFINE_KF_WRAPPER(boolean, gboolean, gboolean);
+DEFINE_KF_WRAPPER(value, gchar*, const gchar*);
+
+
+gchar **
+nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
+ const char *group,
+ gsize *out_length,
+ GError **error)
+{
+ gchar **keys;
+ const char *alias;
+ GError *local = NULL;
+
+ keys = g_key_file_get_keys (kf, group, out_length, &local);
+ if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
+ alias = nm_keyfile_plugin_get_alias_for_setting_name (group);
+ if (alias) {
+ g_clear_error (&local);
+ keys = g_key_file_get_keys (kf, alias, out_length, &local);
+ }
+ }
+ if (local)
+ g_propagate_error (error, local);
+ return keys;
+}
+
+gboolean
+nm_keyfile_plugin_kf_has_key (GKeyFile *kf,
+ const char *group,
+ const char *key,
+ GError **error)
+{
+ gboolean has;
+ const char *alias;
+ GError *local = NULL;
+
+ has = g_key_file_has_key (kf, group, key, &local);
+ if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
+ alias = nm_keyfile_plugin_get_alias_for_setting_name (group);
+ if (alias) {
+ g_clear_error (&local);
+ has = g_key_file_has_key (kf, alias, key, &local);
+ }
+ }
+ if (local)
+ g_propagate_error (error, local);
+ return has;
+}
+
+
diff --git a/libnm-core/nm-keyfile-utils.h b/libnm-core/nm-keyfile-utils.h
new file mode 100644
index 0000000000..fd4334d112
--- /dev/null
+++ b/libnm-core/nm-keyfile-utils.h
@@ -0,0 +1,79 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager system settings service
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * (C) Copyright 2010-2015 Red Hat, Inc.
+ */
+
+#ifndef __NM_KEYFILE_UTILS_H__
+#define __NM_KEYFILE_UTILS_H__
+
+#include <glib.h>
+
+#define VPN_SECRETS_GROUP "vpn-secrets"
+
+const char *nm_keyfile_plugin_get_alias_for_setting_name (const char *setting_name);
+
+const char *nm_keyfile_plugin_get_setting_name_for_alias (const char *alias);
+
+/*********************************************************/
+
+/* List helpers */
+#define DEFINE_KF_LIST_WRAPPER_PROTO(stype, get_ctype, set_ctype) \
+get_ctype nm_keyfile_plugin_kf_get_##stype##_list (GKeyFile *kf, \
+ const char *group, \
+ const char *key, \
+ gsize *out_length, \
+ GError **error); \
+\
+void nm_keyfile_plugin_kf_set_##stype##_list (GKeyFile *kf, \
+ const char *group, \
+ const char *key, \
+ set_ctype list[], \
+ gsize length);
+DEFINE_KF_LIST_WRAPPER_PROTO(integer, gint*, gint)
+DEFINE_KF_LIST_WRAPPER_PROTO(string, gchar**, const gchar* const)
+
+/* Single-value helpers */
+#define DEFINE_KF_WRAPPER_PROTO(stype, get_ctype, set_ctype) \
+get_ctype nm_keyfile_plugin_kf_get_##stype (GKeyFile *kf, \
+ const char *group, \
+ const char *key, \
+ GError **error); \
+\
+void nm_keyfile_plugin_kf_set_##stype (GKeyFile *kf, \
+ const char *group, \
+ const char *key, \
+ set_ctype value);
+DEFINE_KF_WRAPPER_PROTO(string, gchar*, const gchar*)
+DEFINE_KF_WRAPPER_PROTO(integer, gint, gint)
+DEFINE_KF_WRAPPER_PROTO(uint64, guint64, guint64)
+DEFINE_KF_WRAPPER_PROTO(boolean, gboolean, gboolean)
+DEFINE_KF_WRAPPER_PROTO(value, gchar*, const gchar*)
+
+/* Misc */
+gchar ** nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
+ const char *group,
+ gsize *out_length,
+ GError **error);
+
+gboolean nm_keyfile_plugin_kf_has_key (GKeyFile *kf,
+ const char *group,
+ const char *key,
+ GError **error);
+
+#endif /* __NM_KEYFILE_UTILS_H__ */
+
diff --git a/libnm-core/nm-keyfile-writer.c b/libnm-core/nm-keyfile-writer.c
new file mode 100644
index 0000000000..ff433b264a
--- /dev/null
+++ b/libnm-core/nm-keyfile-writer.c
@@ -0,0 +1,751 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager system settings service - keyfile plugin
+ *
+ * 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) 2008 Novell, Inc.
+ * Copyright (C) 2008 - 2015 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <glib/gi18n-lib.h>
+
+#include "nm-setting.h"
+#include "nm-setting-connection.h"
+#include "nm-setting-ip4-config.h"
+#include "nm-setting-ip6-config.h"
+#include "nm-setting-vpn.h"
+#include "nm-setting-wired.h"
+#include "nm-setting-wireless.h"
+#include "nm-setting-ip4-config.h"
+#include "nm-setting-bluetooth.h"
+#include "nm-setting-8021x.h"
+#include "nm-utils.h"
+
+#include "gsystem-local-alloc.h"
+#include "nm-glib-compat.h"
+#include "nm-keyfile-internal.h"
+#include "nm-keyfile-utils.h"
+
+typedef struct {
+ NMConnection *connection;
+ GKeyFile *keyfile;
+ GError *error;
+ NMKeyfileWriteHandler handler;
+ void *user_data;
+} KeyfileWriterInfo;
+
+
+/* Some setting properties also contain setting names, such as
+ * NMSettingConnection's 'type' property (which specifies the base type of the
+ * connection, eg ethernet or wifi) or the 802-11-wireless setting's
+ * 'security' property which specifies whether or not the AP requires
+ * encrpytion. This function handles translating those properties' values
+ * from the real setting name to the more-readable alias.
+ */
+static void
+setting_alias_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ const char *str, *alias;
+
+ str = g_value_get_string (value);
+ alias = nm_keyfile_plugin_get_alias_for_setting_name (str);
+ nm_keyfile_plugin_kf_set_string (info->keyfile,
+ nm_setting_get_name (setting),
+ key,
+ alias ? alias : str);
+}
+
+static void
+write_array_of_uint (GKeyFile *file,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ GArray *array;
+ int i;
+ int *tmp_array;
+
+ array = (GArray *) g_value_get_boxed (value);
+ if (!array || !array->len)
+ return;
+
+ tmp_array = g_new (gint, array->len);
+ for (i = 0; i < array->len; i++)
+ tmp_array[i] = g_array_index (array, int, i);
+
+ nm_keyfile_plugin_kf_set_integer_list (file, nm_setting_get_name (setting), key, tmp_array, array->len);
+ g_free (tmp_array);
+}
+
+static void
+dns_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ char **list;
+
+ list = g_value_get_boxed (value);
+ if (list && list[0]) {
+ nm_keyfile_plugin_kf_set_string_list (info->keyfile, nm_setting_get_name (setting), key,
+ (const char **) list, g_strv_length (list));
+ }
+}
+
+static void
+write_ip_values (GKeyFile *file,
+ const char *setting_name,
+ GPtrArray *array,
+ const char *gateway,
+ gboolean is_route)
+{
+ GString *output;
+ int family, i;
+ const char *addr, *gw;
+ guint32 plen, metric;
+ char key_name[30], *key_name_idx;
+
+ if (!array->len)
+ return;
+
+ family = !strcmp (setting_name, NM_SETTING_IP4_CONFIG_SETTING_NAME) ? AF_INET : AF_INET6;
+
+ strcpy (key_name, is_route ? "route" : "address");
+ key_name_idx = key_name + strlen (key_name);
+
+ output = g_string_sized_new (2*INET_ADDRSTRLEN + 10);
+ for (i = 0; i < array->len; i++) {
+ if (is_route) {
+ NMIPRoute *route = array->pdata[i];
+
+ addr = nm_ip_route_get_dest (route);
+ plen = nm_ip_route_get_prefix (route);
+ gw = nm_ip_route_get_next_hop (route);
+ metric = MAX (0, nm_ip_route_get_metric (route));
+ } else {
+ NMIPAddress *address = array->pdata[i];
+
+ addr = nm_ip_address_get_address (address);
+ plen = nm_ip_address_get_prefix (address);
+ gw = i == 0 ? gateway : NULL;
+ metric = 0;
+ }
+
+ g_string_set_size (output, 0);
+ g_string_append_printf (output, "%s/%u", addr, plen);
+ if (metric || gw) {
+ /* Older versions of the plugin do not support the form
+ * "a.b.c.d/plen,,metric", so, we always have to write the
+ * gateway, even if there isn't one.
+ * The current version supports reading of the above form.
+ */
+ if (!gw) {
+ if (family == AF_INET)
+ gw = "0.0.0.0";
+ else
+ gw = "::";
+ }
+
+ g_string_append_printf (output, ",%s", gw);
+ if (metric)
+ g_string_append_printf (output, ",%lu", (unsigned long) metric);
+ }
+
+ sprintf (key_name_idx, "%d", i + 1);
+ nm_keyfile_plugin_kf_set_string (file, setting_name, key_name, output->str);
+ }
+ g_string_free (output, TRUE);
+}
+
+static void
+addr_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ GPtrArray *array;
+ const char *setting_name = nm_setting_get_name (setting);
+ const char *gateway = nm_setting_ip_config_get_gateway (NM_SETTING_IP_CONFIG (setting));
+
+ array = (GPtrArray *) g_value_get_boxed (value);
+ if (array && array->len)
+ write_ip_values (info->keyfile, setting_name, array, gateway, FALSE);
+}
+
+static void
+ip4_addr_label_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ /* skip */
+}
+
+static void
+gateway_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ /* skip */
+}
+
+static void
+route_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ GPtrArray *array;
+ const char *setting_name = nm_setting_get_name (setting);
+
+ array = (GPtrArray *) g_value_get_boxed (value);
+ if (array && array->len)
+ write_ip_values (info->keyfile, setting_name, array, NULL, TRUE);
+}
+
+static void
+write_hash_of_string (GKeyFile *file,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ GHashTableIter iter;
+ const char *property = NULL, *data = NULL;
+ const char *group_name = nm_setting_get_name (setting);
+ gboolean vpn_secrets = FALSE;
+
+ /* Write VPN secrets out to a different group to keep them separate */
+ if (NM_IS_SETTING_VPN (setting) && !strcmp (key, NM_SETTING_VPN_SECRETS)) {
+ group_name = VPN_SECRETS_GROUP;
+ vpn_secrets = TRUE;
+ }
+
+ g_hash_table_iter_init (&iter, (GHashTable *) g_value_get_boxed (value));
+ while (g_hash_table_iter_next (&iter, (gpointer *) &property, (gpointer *) &data)) {
+ gboolean write_item = TRUE;
+
+ /* Handle VPN secrets specially; they are nested in the property's hash;
+ * we don't want to write them if the secret is not saved, not required,
+ * or owned by a user's secret agent.
+ */
+ if (vpn_secrets) {
+ NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
+
+ nm_setting_get_secret_flags (setting, property, &secret_flags, NULL);
+ if (secret_flags != NM_SETTING_SECRET_FLAG_NONE)
+ write_item = FALSE;
+ }
+
+ if (write_item)
+ nm_keyfile_plugin_kf_set_string (file, group_name, property, data);
+ }
+}
+
+static void
+ssid_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ GBytes *bytes;
+ const guint8 *ssid_data;
+ gsize ssid_len;
+ const char *setting_name = nm_setting_get_name (setting);
+ gboolean new_format = TRUE;
+ unsigned int semicolons = 0;
+ int i, *tmp_array;
+ char *ssid;
+
+ g_return_if_fail (G_VALUE_HOLDS (value, G_TYPE_BYTES));
+
+ bytes = g_value_get_boxed (value);
+ if (!bytes)
+ return;
+ ssid_data = g_bytes_get_data (bytes, &ssid_len);
+ if (ssid_len == 0)
+ return;
+
+ /* Check whether each byte is printable. If not, we have to use an
+ * integer list, otherwise we can just use a string.
+ */
+ for (i = 0; i < ssid_len; i++) {
+ char c = ssid_data[i] & 0xFF;
+ if (!g_ascii_isprint (c)) {
+ new_format = FALSE;
+ break;
+ }
+ if (c == ';')
+ semicolons++;
+ }
+
+ if (new_format) {
+ ssid = g_malloc0 (ssid_len + semicolons + 1);
+ if (semicolons == 0)
+ memcpy (ssid, ssid_data, ssid_len);
+ else {
+ /* Escape semicolons with backslashes to make strings
+ * containing ';', such as '16;17;' unambiguous */
+ int j = 0;
+ for (i = 0; i < ssid_len; i++) {
+ if (ssid_data[i] == ';')
+ ssid[j++] = '\\';
+ ssid[j++] = ssid_data[i];
+ }
+ }
+ nm_keyfile_plugin_kf_set_string (info->keyfile, setting_name, key, ssid);
+ g_free (ssid);
+ } else {
+ tmp_array = g_new (gint, ssid_len);
+ for (i = 0; i < ssid_len; i++)
+ tmp_array[i] = (int) ssid_data[i];
+ nm_keyfile_plugin_kf_set_integer_list (info->keyfile, setting_name, key, tmp_array, ssid_len);
+ g_free (tmp_array);
+ }
+}
+
+static void
+password_raw_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ const char *setting_name = nm_setting_get_name (setting);
+ GBytes *array;
+ int *tmp_array;
+ gsize i, len;
+ const char *data;
+
+ g_return_if_fail (G_VALUE_HOLDS (value, G_TYPE_BYTES));
+
+ array = (GBytes *) g_value_get_boxed (value);
+ if (!array)
+ return;
+ data = g_bytes_get_data (array, &len);
+ if (!data || !len)
+ return;
+
+ tmp_array = g_new (gint, len);
+ for (i = 0; i < len; i++)
+ tmp_array[i] = (int) data[i];
+ nm_keyfile_plugin_kf_set_integer_list (info->keyfile, setting_name, key, tmp_array, len);
+ g_free (tmp_array);
+}
+
+typedef struct ObjectType {
+ const char *key;
+ const char *suffix;
+ NMSetting8021xCKScheme (*scheme_func) (NMSetting8021x *setting);
+ NMSetting8021xCKFormat (*format_func) (NMSetting8021x *setting);
+ const char * (*path_func) (NMSetting8021x *setting);
+ GBytes * (*blob_func) (NMSetting8021x *setting);
+} ObjectType;
+
+static const ObjectType objtypes[10] = {
+ { NM_SETTING_802_1X_CA_CERT,
+ "ca-cert",
+ nm_setting_802_1x_get_ca_cert_scheme,
+ NULL,
+ nm_setting_802_1x_get_ca_cert_path,
+ nm_setting_802_1x_get_ca_cert_blob },
+
+ { NM_SETTING_802_1X_PHASE2_CA_CERT,
+ "inner-ca-cert",
+ nm_setting_802_1x_get_phase2_ca_cert_scheme,
+ NULL,
+ nm_setting_802_1x_get_phase2_ca_cert_path,
+ nm_setting_802_1x_get_phase2_ca_cert_blob },
+
+ { NM_SETTING_802_1X_CLIENT_CERT,
+ "client-cert",
+ nm_setting_802_1x_get_client_cert_scheme,
+ NULL,
+ nm_setting_802_1x_get_client_cert_path,
+ nm_setting_802_1x_get_client_cert_blob },
+
+ { NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
+ "inner-client-cert",
+ nm_setting_802_1x_get_phase2_client_cert_scheme,
+ NULL,
+ nm_setting_802_1x_get_phase2_client_cert_path,
+ nm_setting_802_1x_get_phase2_client_cert_blob },
+
+ { NM_SETTING_802_1X_PRIVATE_KEY,
+ "private-key",
+ nm_setting_802_1x_get_private_key_scheme,
+ nm_setting_802_1x_get_private_key_format,
+ nm_setting_802_1x_get_private_key_path,
+ nm_setting_802_1x_get_private_key_blob },
+
+ { NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
+ "inner-private-key",
+ nm_setting_802_1x_get_phase2_private_key_scheme,
+ nm_setting_802_1x_get_phase2_private_key_format,
+ nm_setting_802_1x_get_phase2_private_key_path,
+ nm_setting_802_1x_get_phase2_private_key_blob },
+
+ { NULL },
+};
+
+/**************************************************************************/
+
+static void
+cert_writer_default (NMConnection *connection,
+ GKeyFile *file,
+ NMKeyfileWriteTypeDataCert *cert_data)
+{
+ const char *setting_name = nm_setting_get_name (NM_SETTING (cert_data->setting));
+ NMSetting8021xCKScheme scheme;
+
+ scheme = cert_data->scheme_func (cert_data->setting);
+ if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) {
+ const char *path;
+ char *path_free = NULL, *tmp;
+ gs_free char *base_dir = NULL;
+
+ path = cert_data->path_func (cert_data->setting);
+ g_assert (path);
+
+ /* If the path is relative, make it an absolute path.
+ * Relative paths make a keyfile not easily usable in another
+ * context. */
+ if (path[0] && path[0] != '/') {
+ base_dir = g_get_current_dir ();
+ path = path_free = g_strconcat (base_dir, "/", path, NULL);
+ } else
+ base_dir = g_path_get_dirname (path);
+
+ /* path cannot start with "file://" or "data:;base64,", because it is an absolute path.
+ * Still, make sure that a prefix-less path will be recognized. This can happen
+ * for example if the path is longer then 500 chars. */
+ tmp = nm_keyfile_detect_unqualified_path_scheme (base_dir, path, -1, FALSE, NULL);
+ if (tmp)
+ g_clear_pointer (&tmp, g_free);
+ else
+ path = tmp = g_strconcat (NM_KEYFILE_CERT_SCHEME_PREFIX_PATH, path, NULL);
+
+ /* Path contains at least a '/', hence it cannot be recognized as the old
+ * binary format consisting of a list of integers. */
+
+ nm_keyfile_plugin_kf_set_string (file, setting_name, cert_data->property_name, path);
+ g_free (tmp);
+ g_free (path_free);
+ } else if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) {
+ GBytes *blob;
+ const guint8 *blob_data;
+ gsize blob_len;
+ char *blob_base64, *val;
+
+ blob = cert_data->blob_func (cert_data->setting);
+ g_assert (blob);
+ blob_data = g_bytes_get_data (blob, &blob_len);
+
+ blob_base64 = g_base64_encode (blob_data, blob_len);
+ val = g_strconcat (NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB, blob_base64, NULL);
+
+ nm_keyfile_plugin_kf_set_string (file, setting_name, cert_data->property_name, val);
+ g_free (val);
+ g_free (blob_base64);
+ } else {
+ /* scheme_func() returns UNKNOWN in all other cases. The only valid case
+ * where a scheme is allowed to be UNKNOWN, is unsetting the value. In this
+ * case, we don't expect the writer to be called, because the default value
+ * will not be serialized.
+ * The only other reason for the scheme to be UNKNOWN is an invalid cert.
+ * But our connection verifies, so that cannot happen either. */
+ g_return_if_reached ();
+ }
+}
+
+static void
+cert_writer (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value)
+{
+ const ObjectType *objtype = NULL;
+ guint i;
+ NMKeyfileWriteTypeDataCert type_data = { 0 };
+
+ for (i = 0; i < G_N_ELEMENTS (objtypes) && objtypes[i].key; i++) {
+ if (g_strcmp0 (objtypes[i].key, key) == 0) {
+ objtype = &objtypes[i];
+ break;
+ }
+ }
+ if (!objtype)
+ g_return_if_reached ();
+
+ type_data.setting = NM_SETTING_802_1X (setting);
+ type_data.property_name = key;
+ type_data.suffix = objtype->suffix;
+ type_data.scheme_func = objtype->scheme_func;
+ type_data.format_func = objtype->format_func;
+ type_data.path_func = objtype->path_func;
+ type_data.blob_func = objtype->blob_func;
+
+ if (info->handler) {
+ if (info->handler (info->connection,
+ info->keyfile,
+ NM_KEYFILE_WRITE_TYPE_CERT,
+ &type_data,
+ info->user_data,
+ &info->error))
+ return;
+ if (info->error)
+ return;
+ }
+
+ cert_writer_default (info->connection, info->keyfile, &type_data);
+}
+
+/**************************************************************************/
+
+typedef struct {
+ const char *setting_name;
+ const char *key;
+ void (*writer) (KeyfileWriterInfo *info,
+ NMSetting *setting,
+ const char *key,
+ const GValue *value);
+} KeyWriter;
+
+/* A table of keys that require further parsing/conversion because they are
+ * stored in a format that can't be automatically read using the key's type.
+ * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are
+ * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored
+ * in struct in6_addr internally, but as string in keyfiles.
+ */
+static KeyWriter key_writers[] = {
+ { NM_SETTING_CONNECTION_SETTING_NAME,
+ NM_SETTING_CONNECTION_TYPE,
+ setting_alias_writer },
+ { NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ADDRESSES,
+ addr_writer },
+ { NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ "address-labels",
+ ip4_addr_label_writer },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ADDRESSES,
+ addr_writer },
+ { NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_GATEWAY,
+ gateway_writer },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_GATEWAY,
+ gateway_writer },
+ { NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ROUTES,
+ route_writer },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ROUTES,
+ route_writer },
+ { NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_DNS,
+ dns_writer },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_DNS,
+ dns_writer },
+ { NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_SSID,
+ ssid_writer },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PASSWORD_RAW,
+ password_raw_writer },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_CA_CERT,
+ cert_writer },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_CLIENT_CERT,
+ cert_writer },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PRIVATE_KEY,
+ cert_writer },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PHASE2_CA_CERT,
+ cert_writer },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
+ cert_writer },
+ { NM_SETTING_802_1X_SETTING_NAME,
+ NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
+ cert_writer },
+ { NULL, NULL, NULL }
+};
+
+static void
+write_setting_value (NMSetting *setting,
+ const char *key,
+ const GValue *value,
+ GParamFlags flag,
+ gpointer user_data)
+{
+ KeyfileWriterInfo *info = user_data;
+ const char *setting_name;
+ GType type = G_VALUE_TYPE (value);
+ KeyWriter *writer = &key_writers[0];
+ GParamSpec *pspec;
+
+ if (info->error)
+ return;
+
+ /* Setting name gets picked up from the keyfile's section name instead */
+ if (!strcmp (key, NM_SETTING_NAME))
+ return;
+
+ /* Don't write the NMSettingConnection object's 'read-only' property */
+ if ( NM_IS_SETTING_CONNECTION (setting)
+ && !strcmp (key, NM_SETTING_CONNECTION_READ_ONLY))
+ return;
+
+ setting_name = nm_setting_get_name (setting);
+
+ /* If the value is the default value, remove the item from the keyfile */
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key);
+ if (pspec) {
+ if (g_param_value_defaults (pspec, (GValue *) value)) {
+ g_key_file_remove_key (info->keyfile, setting_name, key, NULL);
+ return;
+ }
+ }
+
+ /* Don't write secrets that are owned by user secret agents or aren't
+ * supposed to be saved. VPN secrets are handled specially though since
+ * the secret flags there are in a third-level hash in the 'secrets'
+ * property.
+ */
+ if (pspec && (pspec->flags & NM_SETTING_PARAM_SECRET) && !NM_IS_SETTING_VPN (setting)) {
+ NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
+
+ if (!nm_setting_get_secret_flags (setting, key, &secret_flags, NULL))
+ g_assert_not_reached ();
+ if (secret_flags != NM_SETTING_SECRET_FLAG_NONE)
+ return;
+ }
+
+ /* Look through the list of handlers for non-standard format key values */
+ while (writer->setting_name) {
+ if (!strcmp (writer->setting_name, setting_name) && !strcmp (writer->key, key)) {
+ (*writer->writer) (info, setting, key, value);
+ return;
+ }
+ writer++;
+ }
+
+ if (type == G_TYPE_STRING) {
+ const char *str;
+
+ str = g_value_get_string (value);
+ if (str)
+ nm_keyfile_plugin_kf_set_string (info->keyfile, setting_name, key, str);
+ } else if (type == G_TYPE_UINT)
+ nm_keyfile_plugin_kf_set_integer (info->keyfile, setting_name, key, (int) g_value_get_uint (value));
+ else if (type == G_TYPE_INT)
+ nm_keyfile_plugin_kf_set_integer (info->keyfile, setting_name, key, g_value_get_int (value));
+ else if (type == G_TYPE_UINT64) {
+ char *numstr;
+
+ numstr = g_strdup_printf ("%" G_GUINT64_FORMAT, g_value_get_uint64 (value));
+ nm_keyfile_plugin_kf_set_value (info->keyfile, setting_name, key, numstr);
+ g_free (numstr);
+ } else if (type == G_TYPE_INT64) {
+ char *numstr;
+
+ numstr = g_strdup_printf ("%" G_GINT64_FORMAT, g_value_get_int64 (value));
+ nm_keyfile_plugin_kf_set_value (info->keyfile, setting_name, key, numstr);
+ g_free (numstr);
+ } else if (type == G_TYPE_BOOLEAN) {
+ nm_keyfile_plugin_kf_set_boolean (info->keyfile, setting_name, key, g_value_get_boolean (value));
+ } else if (type == G_TYPE_CHAR) {
+ nm_keyfile_plugin_kf_set_integer (info->keyfile, setting_name, key, (int) g_value_get_schar (value));
+ } else if (type == G_TYPE_BYTES) {
+ GBytes *bytes;
+ const guint8 *data;
+ gsize len = 0;
+
+ bytes = g_value_get_boxed (value);
+ data = bytes ? g_bytes_get_data (bytes, &len) : NULL;
+
+ if (data != NULL && len > 0) {
+ int *tmp_array;
+ int i;
+
+ tmp_array = g_new (gint, len);
+ for (i = 0; i < len; i++)
+ tmp_array[i] = (int) data[i];
+
+ nm_keyfile_plugin_kf_set_integer_list (info->keyfile, setting_name, key, tmp_array, len);
+ g_free (tmp_array);
+ }
+ } else if (type == G_TYPE_STRV) {
+ char **array;
+
+ array = (char **) g_value_get_boxed (value);
+ nm_keyfile_plugin_kf_set_string_list (info->keyfile, setting_name, key, (const gchar **const) array, g_strv_length (array));
+ } else if (type == G_TYPE_HASH_TABLE) {
+ write_hash_of_string (info->keyfile, setting, key, value);
+ } else if (type == G_TYPE_ARRAY) {
+ write_array_of_uint (info->keyfile, setting, key, value);
+ } else if (G_VALUE_HOLDS_FLAGS (value)) {
+ /* Flags are guint but GKeyFile has no uint reader, just uint64 */
+ nm_keyfile_plugin_kf_set_uint64 (info->keyfile, setting_name, key, (guint64) g_value_get_flags (value));
+ } else if (G_VALUE_HOLDS_ENUM (value))
+ nm_keyfile_plugin_kf_set_integer (info->keyfile, setting_name, key, (gint) g_value_get_enum (value));
+ else
+ g_warn_if_reached ();
+}
+
+GKeyFile *
+nm_keyfile_write (NMConnection *connection,
+ NMKeyfileWriteHandler handler,
+ void *user_data,
+ GError **error)
+{
+ KeyfileWriterInfo info = { 0 };
+
+ g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (!error || !*error, NULL);
+
+ if (!nm_connection_verify (connection, error))
+ return NULL;
+
+ info.connection = connection;
+ info.keyfile = g_key_file_new ();
+ info.error = NULL;
+ info.handler = handler;
+ info.user_data = user_data;
+ nm_connection_for_each_setting_value (connection, write_setting_value, &info);
+
+ if (info.error) {
+ g_propagate_error (error, info.error);
+ g_key_file_unref (info.keyfile);
+ return NULL;
+ }
+ return info.keyfile;
+}
+
diff --git a/libnm-core/nm-property-compare.c b/libnm-core/nm-property-compare.c
index d3ff94de3d..5d270706e8 100644
--- a/libnm-core/nm-property-compare.c
+++ b/libnm-core/nm-property-compare.c
@@ -20,6 +20,8 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include "nm-property-compare.h"
#include "nm-glib-compat.h"
diff --git a/libnm-core/nm-setting-8021x.c b/libnm-core/nm-setting-8021x.c
index a1019060d1..f355c18e70 100644
--- a/libnm-core/nm-setting-8021x.c
+++ b/libnm-core/nm-setting-8021x.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-8021x.h"
#include "nm-utils.h"
@@ -29,6 +31,8 @@
#include "nm-utils-private.h"
#include "nm-setting-private.h"
#include "nm-core-enum-types.h"
+#include "nm-utils-internal.h"
+#include "gsystem-local-alloc.h"
/**
* SECTION:nm-setting-8021x
@@ -58,8 +62,6 @@
* ISBN: 978-1587051548
**/
-#define SCHEME_PATH "file://"
-
G_DEFINE_TYPE_WITH_CODE (NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING,
_nm_register_setting (802_1X, 2))
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_802_1X)
@@ -398,25 +400,122 @@ nm_setting_802_1x_get_system_ca_certs (NMSetting8021x *setting)
}
static NMSetting8021xCKScheme
-get_cert_scheme (GBytes *bytes)
+get_cert_scheme (GBytes *bytes, GError **error)
{
- gconstpointer data;
+ const char *data;
gsize length;
- if (!bytes)
+ if (!bytes) {
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("data missing"));
return NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
+ }
data = g_bytes_get_data (bytes, &length);
- if (!length)
+ return nm_setting_802_1x_check_cert_scheme (data, length, error);
+}
+
+/**
+ * nm_setting_802_1x_check_cert_scheme:
+ * @pdata: (allow-none): the data pointer
+ * @length: the length of the data
+ * @error: (allow-none): (out): validation reason
+ *
+ * Determines and verifies the blob type.
+ * When setting certificate properties of NMSetting8021x
+ * the blob must be not UNKNOWN (or NULL).
+ *
+ * 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)
+{
+ const char *data = pdata;
+
+ g_return_val_if_fail (!length || data, NM_SETTING_802_1X_CK_SCHEME_UNKNOWN);
+
+ if (!length || !data) {
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("binary data missing"));
return NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
+ }
+
+ /* interpret the blob as PATH if it starts with "file://". */
+ if ( length >= STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH)
+ && !memcmp (data, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH, STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH))) {
+ /* But it must also be NUL terminated, contain at least
+ * one non-NUL character, and contain only one trailing NUL
+ * chracter.
+ * And ensure it's UTF-8 valid too so we can pass it through
+ * D-Bus and stuff like that. */
+
+ if (data[length - 1] != '\0') {
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("file:// URI not NUL terminated"));
+ return NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
+ }
+ length--;
+
+ if (length <= STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH)) {
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("file:// URI is empty"));
+ return NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
+ }
+
+ if (!g_utf8_validate (data + STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH), length - STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH), NULL)) {
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("file:// URI is not valid UTF-8"));
+ return NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
+ }
- if ( (length > strlen (SCHEME_PATH))
- && !memcmp (data, SCHEME_PATH, strlen (SCHEME_PATH)))
return NM_SETTING_802_1X_CK_SCHEME_PATH;
+ }
return NM_SETTING_802_1X_CK_SCHEME_BLOB;
}
+static GByteArray *
+load_and_verify_certificate (const char *cert_path,
+ NMSetting8021xCKScheme scheme,
+ NMCryptoFileFormat *out_file_format,
+ GError **error)
+{
+ NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ GByteArray *array;
+
+ array = crypto_load_and_verify_certificate (cert_path, &format, error);
+
+ if (!array || !array->len || format == NM_CRYPTO_FILE_FORMAT_UNKNOWN) {
+ /* the array is empty or the format is already unknown. */
+ format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ } else if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) {
+ /* If we load the file as blob, we must ensure that the binary data does not
+ * start with file://. NMSetting8021x cannot represent blobs that start with
+ * file://.
+ * If that's the case, coerce the format to UNKNOWN. The callers will take care
+ * of that and not set the blob. */
+ if (nm_setting_802_1x_check_cert_scheme (array->data, array->len, NULL) != NM_SETTING_802_1X_CK_SCHEME_BLOB)
+ format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ }
+
+ if (out_file_format)
+ *out_file_format = format;
+ return array;
+}
+
/**
* nm_setting_802_1x_get_ca_cert_scheme:
* @setting: the #NMSetting8021x
@@ -432,7 +531,7 @@ nm_setting_802_1x_get_ca_cert_scheme (NMSetting8021x *setting)
{
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NM_SETTING_802_1X_CK_SCHEME_UNKNOWN);
- return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->ca_cert);
+ return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->ca_cert, NULL);
}
/**
@@ -446,7 +545,7 @@ nm_setting_802_1x_get_ca_cert_scheme (NMSetting8021x *setting)
* reduces security by allowing man-in-the-middle attacks, because the identity
* of the network cannot be confirmed by the client.
*
- * Returns: the CA certificate data
+ * Returns: (transfer none): the CA certificate data
**/
GBytes *
nm_setting_802_1x_get_ca_cert_blob (NMSetting8021x *setting)
@@ -486,20 +585,23 @@ nm_setting_802_1x_get_ca_cert_path (NMSetting8021x *setting)
g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL);
data = g_bytes_get_data (NM_SETTING_802_1X_GET_PRIVATE (setting)->ca_cert, NULL);
- return (const char *)data + strlen (SCHEME_PATH);
+ return (const char *)data + strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH);
}
static GBytes *
path_to_scheme_value (const char *path)
{
GByteArray *array;
+ gsize len;
- g_return_val_if_fail (path != NULL, NULL);
+ g_return_val_if_fail (path != NULL && path[0], NULL);
- /* Add the path scheme tag to the front, then the fielname */
- array = g_byte_array_sized_new (strlen (path) + strlen (SCHEME_PATH) + 1);
- g_byte_array_append (array, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH));
- g_byte_array_append (array, (const guint8 *) path, strlen (path));
+ len = strlen (path);
+
+ /* Add the path scheme tag to the front, then the filename */
+ array = g_byte_array_sized_new (len + strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH) + 1);
+ g_byte_array_append (array, (const guint8 *) NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH, strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH));
+ g_byte_array_append (array, (const guint8 *) path, len);
g_byte_array_append (array, (const guint8 *) "\0", 1);
return g_byte_array_free_to_bytes (array);
@@ -556,7 +658,7 @@ nm_setting_802_1x_set_ca_cert (NMSetting8021x *setting,
return TRUE;
}
- data = crypto_load_and_verify_certificate (cert_path, &format, error);
+ data = load_and_verify_certificate (cert_path, scheme, &format, error);
if (data) {
/* wpa_supplicant can only use raw x509 CA certs */
if (format == NM_CRYPTO_FILE_FORMAT_X509) {
@@ -764,7 +866,7 @@ nm_setting_802_1x_get_client_cert_scheme (NMSetting8021x *setting)
{
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NM_SETTING_802_1X_CK_SCHEME_UNKNOWN);
- return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->client_cert);
+ return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->client_cert, NULL);
}
/**
@@ -775,7 +877,7 @@ nm_setting_802_1x_get_client_cert_scheme (NMSetting8021x *setting)
* when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x
* authentication method.
*
- * Returns: the client certificate data
+ * Returns: (transfer none): the client certificate data
**/
GBytes *
nm_setting_802_1x_get_client_cert_blob (NMSetting8021x *setting)
@@ -812,7 +914,7 @@ nm_setting_802_1x_get_client_cert_path (NMSetting8021x *setting)
g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL);
data = g_bytes_get_data (NM_SETTING_802_1X_GET_PRIVATE (setting)->client_cert, NULL);
- return (const char *)data + strlen (SCHEME_PATH);
+ return (const char *)data + strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH);
}
/**
@@ -820,7 +922,7 @@ nm_setting_802_1x_get_client_cert_path (NMSetting8021x *setting)
* @setting: the #NMSetting8021x
* @cert_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH
* or %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the client
- * certificate file (PEM, DER, or PKCS#12 format). The path must be UTF-8
+ * certificate file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8
* encoded; use g_filename_to_utf8() to convert if needed. Passing %NULL with
* any @scheme clears the client certificate.
* @scheme: desired storage scheme for the certificate
@@ -870,7 +972,7 @@ nm_setting_802_1x_set_client_cert (NMSetting8021x *setting,
return TRUE;
}
- data = crypto_load_and_verify_certificate (cert_path, &format, error);
+ data = load_and_verify_certificate (cert_path, scheme, &format, error);
if (data) {
gboolean valid = FALSE;
@@ -1027,7 +1129,7 @@ nm_setting_802_1x_get_phase2_ca_cert_scheme (NMSetting8021x *setting)
{
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NM_SETTING_802_1X_CK_SCHEME_UNKNOWN);
- return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_ca_cert);
+ return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_ca_cert, NULL);
}
/**
@@ -1041,7 +1143,7 @@ nm_setting_802_1x_get_phase2_ca_cert_scheme (NMSetting8021x *setting)
* reduces security by allowing man-in-the-middle attacks, because the identity
* of the network cannot be confirmed by the client.
*
- * Returns: the "phase 2" CA certificate data
+ * Returns: (transfer none): the "phase 2" CA certificate data
**/
GBytes *
nm_setting_802_1x_get_phase2_ca_cert_blob (NMSetting8021x *setting)
@@ -1081,7 +1183,7 @@ nm_setting_802_1x_get_phase2_ca_cert_path (NMSetting8021x *setting)
g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL);
data = g_bytes_get_data (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_ca_cert, NULL);
- return (const char *)data + strlen (SCHEME_PATH);
+ return (const char *)data + strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH);
}
/**
@@ -1135,7 +1237,7 @@ nm_setting_802_1x_set_phase2_ca_cert (NMSetting8021x *setting,
return TRUE;
}
- data = crypto_load_and_verify_certificate (cert_path, &format, error);
+ data = load_and_verify_certificate (cert_path, scheme, &format, error);
if (data) {
/* wpa_supplicant can only use raw x509 CA certs */
if (format == NM_CRYPTO_FILE_FORMAT_X509) {
@@ -1347,7 +1449,7 @@ nm_setting_802_1x_get_phase2_client_cert_scheme (NMSetting8021x *setting)
{
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NM_SETTING_802_1X_CK_SCHEME_UNKNOWN);
- return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_client_cert);
+ return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_client_cert, NULL);
}
/**
@@ -1358,7 +1460,7 @@ nm_setting_802_1x_get_phase2_client_cert_scheme (NMSetting8021x *setting)
* when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x
* authentication method.
*
- * Returns: the "phase 2" client certificate data
+ * Returns: (transfer none): the "phase 2" client certificate data
**/
GBytes *
nm_setting_802_1x_get_phase2_client_cert_blob (NMSetting8021x *setting)
@@ -1395,7 +1497,7 @@ nm_setting_802_1x_get_phase2_client_cert_path (NMSetting8021x *setting)
g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL);
data = g_bytes_get_data (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_client_cert, NULL);
- return (const char *)data + strlen (SCHEME_PATH);
+ return (const char *)data + strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH);
}
/**
@@ -1403,7 +1505,7 @@ nm_setting_802_1x_get_phase2_client_cert_path (NMSetting8021x *setting)
* @setting: the #NMSetting8021x
* @cert_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH
* or %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the "phase2" client
- * certificate file (PEM, DER, or PKCS#12 format). The path must be UTF-8
+ * certificate file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8
* encoded; use g_filename_to_utf8() to convert if needed. Passing %NULL with
* any @scheme clears the "phase2" client certificate.
* @scheme: desired storage scheme for the certificate
@@ -1453,7 +1555,7 @@ nm_setting_802_1x_set_phase2_client_cert (NMSetting8021x *setting,
return TRUE;
}
- data = crypto_load_and_verify_certificate (cert_path, &format, error);
+ data = load_and_verify_certificate (cert_path, scheme, &format, error);
if (data) {
gboolean valid = FALSE;
@@ -1528,7 +1630,7 @@ nm_setting_802_1x_get_password_flags (NMSetting8021x *setting)
* nm_setting_802_1x_get_password_raw:
* @setting: the #NMSetting8021x
*
- * Returns: the password used by the authentication method as a
+ * Returns: (transfer none): the password used by the authentication method as a
* UTF-8-encoded array of bytes, as specified by the
* #NMSetting8021x:password-raw property
**/
@@ -1602,7 +1704,7 @@ nm_setting_802_1x_get_private_key_scheme (NMSetting8021x *setting)
{
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NM_SETTING_802_1X_CK_SCHEME_UNKNOWN);
- return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->private_key);
+ return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->private_key, NULL);
}
/**
@@ -1617,7 +1719,7 @@ nm_setting_802_1x_get_private_key_scheme (NMSetting8021x *setting)
* unencrypted private key data may be readable by unprivileged users. Private
* keys should always be encrypted with a private key password.
*
- * Returns: the private key data
+ * Returns: (transfer none): the private key data
**/
GBytes *
nm_setting_802_1x_get_private_key_blob (NMSetting8021x *setting)
@@ -1654,7 +1756,7 @@ nm_setting_802_1x_get_private_key_path (NMSetting8021x *setting)
g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL);
data = g_bytes_get_data (NM_SETTING_802_1X_GET_PRIVATE (setting)->private_key, NULL);
- return (const char *)data + strlen (SCHEME_PATH);
+ return (const char *)data + strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH);
}
static void
@@ -1676,10 +1778,11 @@ file_to_secure_bytes (const char *filename)
if (g_file_get_contents (filename, &contents, &length, NULL)) {
array = g_byte_array_sized_new (length);
g_byte_array_append (array, (guint8 *) contents, length);
- g_assert (array->len == length);
+ memset (contents, 0, length);
g_free (contents);
+ return g_bytes_new_with_free_func (array->data, array->len, free_secure_bytes, array);
}
- return g_bytes_new_with_free_func (array->data, array->len, free_secure_bytes, array);
+ return NULL;
}
/**
@@ -1687,7 +1790,7 @@ file_to_secure_bytes (const char *filename)
* @setting: the #NMSetting8021x
* @key_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH or
* %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the private key file
- * (PEM, DER, or PKCS#12 format). The path must be UTF-8 encoded; use
+ * (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8 encoded; use
* g_filename_to_utf8() to convert if needed. Passing %NULL with any @scheme
* clears the private key.
* @password: password used to decrypt the private key, or %NULL if the password
@@ -1750,7 +1853,7 @@ nm_setting_802_1x_set_private_key (NMSetting8021x *setting,
* given, that it decrypts the private key.
*/
if (key_path) {
- format = crypto_verify_private_key (key_path, password, &local_err);
+ format = crypto_verify_private_key (key_path, password, NULL, &local_err);
if (format == NM_CRYPTO_FILE_FORMAT_UNKNOWN) {
g_set_error_literal (error,
NM_CONNECTION_ERROR,
@@ -1787,7 +1890,8 @@ nm_setting_802_1x_set_private_key (NMSetting8021x *setting,
priv->private_key_password = g_strdup (password);
if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) {
- /* Shouldn't fail this since we just verified the private key above */
+ /* FIXME: potential race after verifying the private key above */
+ /* FIXME: ensure blob doesn't start with file:// */
priv->private_key = file_to_secure_bytes (key_path);
g_assert (priv->private_key);
} else if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH)
@@ -1869,18 +1973,19 @@ nm_setting_802_1x_get_private_key_format (NMSetting8021x *setting)
switch (nm_setting_802_1x_get_private_key_scheme (setting)) {
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
if (crypto_is_pkcs12_data (g_bytes_get_data (priv->private_key, NULL),
- g_bytes_get_size (priv->private_key)))
+ g_bytes_get_size (priv->private_key),
+ NULL))
return NM_SETTING_802_1X_CK_FORMAT_PKCS12;
return NM_SETTING_802_1X_CK_FORMAT_RAW_KEY;
case NM_SETTING_802_1X_CK_SCHEME_PATH:
path = nm_setting_802_1x_get_private_key_path (setting);
if (crypto_is_pkcs12_file (path, &error))
return NM_SETTING_802_1X_CK_FORMAT_PKCS12;
- if (error) {
- /* Couldn't read the file or something */
+ if (error && error->domain == G_FILE_ERROR) {
g_error_free (error);
return NM_SETTING_802_1X_CK_FORMAT_UNKNOWN;
}
+ g_error_free (error);
return NM_SETTING_802_1X_CK_FORMAT_RAW_KEY;
default:
break;
@@ -1937,7 +2042,7 @@ nm_setting_802_1x_get_phase2_private_key_scheme (NMSetting8021x *setting)
{
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NM_SETTING_802_1X_CK_SCHEME_UNKNOWN);
- return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_private_key);
+ return get_cert_scheme (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_private_key, NULL);
}
/**
@@ -1952,7 +2057,7 @@ nm_setting_802_1x_get_phase2_private_key_scheme (NMSetting8021x *setting)
* unencrypted private key data may be readable by unprivileged users. Private
* keys should always be encrypted with a private key password.
*
- * Returns: the "phase 2" private key data
+ * Returns: (transfer none): the "phase 2" private key data
**/
GBytes *
nm_setting_802_1x_get_phase2_private_key_blob (NMSetting8021x *setting)
@@ -1989,7 +2094,7 @@ nm_setting_802_1x_get_phase2_private_key_path (NMSetting8021x *setting)
g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL);
data = g_bytes_get_data (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_private_key, NULL);
- return (const char *)data + strlen (SCHEME_PATH);
+ return (const char *)data + strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH);
}
/**
@@ -1997,7 +2102,7 @@ nm_setting_802_1x_get_phase2_private_key_path (NMSetting8021x *setting)
* @setting: the #NMSetting8021x
* @key_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH or
* %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the "phase2" private
- * key file (PEM, DER, or PKCS#12 format). The path must be UTF-8 encoded;
+ * key file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8 encoded;
* use g_filename_to_utf8() to convert if needed. Passing %NULL with any
* @scheme clears the private key.
* @password: password used to decrypt the private key, or %NULL if the password
@@ -2060,7 +2165,7 @@ nm_setting_802_1x_set_phase2_private_key (NMSetting8021x *setting,
* given, that it decrypts the private key.
*/
if (key_path) {
- format = crypto_verify_private_key (key_path, password, &local_err);
+ format = crypto_verify_private_key (key_path, password, NULL, &local_err);
if (format == NM_CRYPTO_FILE_FORMAT_UNKNOWN) {
g_set_error_literal (error,
NM_CONNECTION_ERROR,
@@ -2097,7 +2202,8 @@ nm_setting_802_1x_set_phase2_private_key (NMSetting8021x *setting,
priv->phase2_private_key_password = g_strdup (password);
if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) {
- /* Shouldn't fail this since we just verified the private key above */
+ /* FIXME: potential race after verifying the private key above */
+ /* FIXME: ensure blob doesn't start with file:// */
priv->phase2_private_key = file_to_secure_bytes (key_path);
g_assert (priv->phase2_private_key);
} else if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH)
@@ -2149,18 +2255,19 @@ nm_setting_802_1x_get_phase2_private_key_format (NMSetting8021x *setting)
switch (nm_setting_802_1x_get_phase2_private_key_scheme (setting)) {
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
if (crypto_is_pkcs12_data (g_bytes_get_data (priv->phase2_private_key, NULL),
- g_bytes_get_size (priv->phase2_private_key)))
+ g_bytes_get_size (priv->phase2_private_key),
+ NULL))
return NM_SETTING_802_1X_CK_FORMAT_PKCS12;
return NM_SETTING_802_1X_CK_FORMAT_RAW_KEY;
case NM_SETTING_802_1X_CK_SCHEME_PATH:
path = nm_setting_802_1x_get_phase2_private_key_path (setting);
if (crypto_is_pkcs12_file (path, &error))
return NM_SETTING_802_1X_CK_FORMAT_PKCS12;
- if (error) {
- /* Couldn't read the file or something */
+ if (error && error->domain == G_FILE_ERROR) {
g_error_free (error);
return NM_SETTING_802_1X_CK_FORMAT_UNKNOWN;
}
+ g_error_free (error);
return NM_SETTING_802_1X_CK_FORMAT_RAW_KEY;
default:
break;
@@ -2204,11 +2311,11 @@ need_private_key_password (GBytes *blob,
/* Private key password is required */
if (password) {
if (path)
- format = crypto_verify_private_key (path, password, NULL);
+ format = crypto_verify_private_key (path, password, NULL, NULL);
else if (blob)
format = crypto_verify_private_key_data (g_bytes_get_data (blob, NULL),
g_bytes_get_size (blob),
- password, NULL);
+ password, NULL, NULL);
else
g_warning ("%s: unknown private key password scheme", __func__);
}
@@ -2298,7 +2405,8 @@ verify_tls (NMSetting8021x *self, gboolean phase2, GError **error)
/* If the private key is PKCS#12, check that it matches the client cert */
if (crypto_is_pkcs12_data (g_bytes_get_data (priv->phase2_private_key, NULL),
- g_bytes_get_size (priv->phase2_private_key))) {
+ g_bytes_get_size (priv->phase2_private_key),
+ NULL)) {
if (!g_bytes_equal (priv->phase2_private_key, priv->phase2_client_cert)) {
g_set_error (error,
NM_CONNECTION_ERROR,
@@ -2345,7 +2453,8 @@ verify_tls (NMSetting8021x *self, gboolean phase2, GError **error)
/* If the private key is PKCS#12, check that it matches the client cert */
if (crypto_is_pkcs12_data (g_bytes_get_data (priv->private_key, NULL),
- g_bytes_get_size (priv->private_key))) {
+ g_bytes_get_size (priv->private_key),
+ NULL)) {
if (!g_bytes_equal (priv->private_key, priv->client_cert)) {
g_set_error (error,
NM_CONNECTION_ERROR,
@@ -2568,35 +2677,18 @@ need_secrets (NMSetting *setting)
static gboolean
verify_cert (GBytes *bytes, const char *prop_name, GError **error)
{
- gconstpointer data;
- gsize length;
+ GError *local = NULL;
- if (!bytes)
- return TRUE;
-
- switch (get_cert_scheme (bytes)) {
- case NM_SETTING_802_1X_CK_SCHEME_BLOB:
+ if ( !bytes
+ || get_cert_scheme (bytes, &local) != NM_SETTING_802_1X_CK_SCHEME_UNKNOWN)
return TRUE;
- case NM_SETTING_802_1X_CK_SCHEME_PATH:
- /* For path-based schemes, verify that the path is zero-terminated */
- data = g_bytes_get_data (bytes, &length);
- if (((const guchar *)data)[length - 1] == '\0') {
- /* And ensure it's UTF-8 valid too so we can pass it through
- * D-Bus and stuff like that.
- */
- if (g_utf8_validate ((const char *)data + strlen (SCHEME_PATH), -1, NULL))
- return TRUE;
- }
- break;
- default:
- break;
- }
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("property is invalid"));
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("certificate is invalid: %s"), local->message);
g_prefix_error (error, "%s.%s: ", NM_SETTING_802_1X_SETTING_NAME, prop_name);
+ g_error_free (local);
return FALSE;
}
@@ -3076,7 +3168,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);
- GError *error = NULL;
g_type_class_add_private (setting_class, sizeof (NMSetting8021xPrivate));
@@ -3099,6 +3190,14 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* properties of this setting; refer to wpa_supplicant documentation for the
* allowed combinations.
**/
+ /* ---ifcfg-rh---
+ * property: eap
+ * variable: IEEE_8021X_EAP_METHODS(+)
+ * values: "LEAP", "PWD", "TLS", "PEAP", "TTLS", "FAST"
+ * description: EAP method for 802.1X authentication.
+ * example: IEEE_8021X_EAP_METHODS=PEAP
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_EAP,
g_param_spec_boxed (NM_SETTING_802_1X_EAP, "", "",
@@ -3112,6 +3211,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Identity string for EAP authentication methods. Often the user's user or
* login name.
**/
+ /* ---ifcfg-rh---
+ * property: identity
+ * variable: IEEE_8021X_IDENTITY(+)
+ * description: Identity for EAP authentication methods.
+ * example: IEEE_8021X_IDENTITY=itsme
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_IDENTITY,
g_param_spec_string (NM_SETTING_802_1X_IDENTITY, "", "",
@@ -3126,6 +3232,12 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* unencrypted identity with EAP types that support different tunneled
* identity like EAP-TTLS.
**/
+ /* ---ifcfg-rh---
+ * property: anonymous-identity
+ * variable: IEEE_8021X_ANON_IDENTITY(+)
+ * description: Anonymous identity for EAP authentication methods.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_ANONYMOUS_IDENTITY,
g_param_spec_string (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, "", "",
@@ -3138,6 +3250,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* UTF-8 encoded file path containing PAC for EAP-FAST.
**/
+ /* ---ifcfg-rh---
+ * property: pac-file
+ * variable: IEEE_8021X_PAC_FILE(+)
+ * description: File with PAC (Protected Access Credential) for EAP-FAST.
+ * example: IEEE_8021X_PAC_FILE=/home/joe/my-fast.pac
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PAC_FILE,
g_param_spec_string (NM_SETTING_802_1X_PAC_FILE, "", "",
@@ -3163,16 +3282,19 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_ca_cert() function instead.
**/
+ /* ---ifcfg-rh---
+ * property: ca-cert
+ * variable: IEEE_8021X_CA_CERT(+)
+ * description: CA certificate for EAP.
+ * example: IEEE_8021X_CA_CERT=/home/joe/cacert.crt
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_CA_CERT,
g_param_spec_boxed (NM_SETTING_802_1X_CA_CERT, "", "",
G_TYPE_BYTES,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_802_1X_CA_CERT,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSetting8021x:ca-path:
@@ -3181,6 +3303,12 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* certificates to be added to the verification chain in addition to the
* certificate specified in the #NMSetting8021x:ca-cert property.
**/
+ /* ---ifcfg-rh---
+ * property: ca-path
+ * variable: (none)
+ * description: The property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_CA_PATH,
g_param_spec_string (NM_SETTING_802_1X_CA_PATH, "", "",
@@ -3195,6 +3323,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* by the authentication server. When unset, no verification of the
* authentication server certificate's subject is performed.
**/
+ /* ---ifcfg-rh---
+ * property: subject-match
+ * variable: IEEE_8021X_SUBJECT_MATCH(+)
+ * description: Substring to match subject of server certificate against.
+ * example: IEEE_8021X_SUBJECT_MATCH="Red Hat"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_SUBJECT_MATCH,
g_param_spec_string (NM_SETTING_802_1X_SUBJECT_MATCH, "", "",
@@ -3209,6 +3344,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* certificate presented by the authentication server. If the list is empty,
* no verification of the server certificate's altSubjectName is performed.
**/
+ /* ---ifcfg-rh---
+ * property: altsubject-matches
+ * variable: IEEE_8021X_ALTSUBJECT_MATCHES(+)
+ * description: List of strings to be matched against the altSubjectName.
+ * example: IEEE_8021X_ALTSUBJECT_MATCHES="s1.domain.cc"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_ALTSUBJECT_MATCHES,
g_param_spec_boxed (NM_SETTING_802_1X_ALTSUBJECT_MATCHES, "", "",
@@ -3232,16 +3374,19 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_client_cert() function instead.
**/
+ /* ---ifcfg-rh---
+ * property: client-cert
+ * variable: IEEE_8021X_CLIENT_CERT(+)
+ * description: Client certificate for EAP.
+ * example: IEEE_8021X_CLIENT_CERT=/home/joe/mycert.crt
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_CLIENT_CERT,
g_param_spec_boxed (NM_SETTING_802_1X_CLIENT_CERT, "", "",
G_TYPE_BYTES,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_802_1X_CLIENT_CERT,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSetting8021x:phase1-peapver:
@@ -3253,6 +3398,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* so, this property may be set to "0" or "1" to force that specific PEAP
* version.
**/
+ /* ---ifcfg-rh---
+ * property: phase1-peapver
+ * variable: IEEE_8021X_PEAP_VERSION(+)
+ * values: 0, 1
+ * description: Use to force a specific PEAP version.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE1_PEAPVER,
g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPVER, "", "",
@@ -3268,6 +3420,14 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* PEAPv1. Set to "1" to force use of the new PEAP label. See the
* wpa_supplicant documentation for more details.
**/
+ /* ---ifcfg-rh---
+ * property: phase1-peaplabel
+ * variable: IEEE_8021X_PEAP_FORCE_NEW_LABEL(+)
+ * values: yes, no
+ * default: no
+ * description: Use to force the new PEAP label during key derivation.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE1_PEAPLABEL,
g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPLABEL, "", "",
@@ -3285,6 +3445,14 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* both authenticated and unauthenticated provisioning). See the
* wpa_supplicant documentation for more details.
**/
+ /* ---ifcfg-rh---
+ * property: phase1-fast-provisioning
+ * variable: IEEE_8021X_FAST_PROVISIONING(+)
+ * values: space-separated list of these values [allow-auth, allow-unauth]
+ * description: Enable in-line provisioning of EAP-FAST credentials.
+ * example: IEEE_8021X_FAST_PROVISIONING="allow-auth allow-unauth"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE1_FAST_PROVISIONING,
g_param_spec_string (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, "", "",
@@ -3302,6 +3470,15 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Each "phase 2" inner method requires specific parameters for successful
* authentication; see the wpa_supplicant documentation for more details.
**/
+ /* ---ifcfg-rh---
+ * property: phase2-auth
+ * variable: IEEE_8021X_INNER_AUTH_METHODS(+)
+ * values: "PAP", "CHAP", "MSCHAP", "MSCHAPV2", "GTC", "OTP", "MD5" and "TLS"
+ * description: Inner non-EAP authentication methods. IEEE_8021X_INNER_AUTH_METHODS
+ * can contain values both for 'phase2-auth' and 'phase2-autheap' properties.
+ * example: IEEE_8021X_INNER_AUTH_METHODS=PAP
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE2_AUTH,
g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTH, "", "",
@@ -3319,6 +3496,15 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* requires specific parameters for successful authentication; see the
* wpa_supplicant documentation for more details.
**/
+ /* ---ifcfg-rh---
+ * property: phase2-autheap
+ * variable: IEEE_8021X_INNER_AUTH_METHODS(+)
+ * values: "EAP-MD5", "EAP-MSCHAPV2", "EAP-GTC", "EAP-OTP" and "EAP-TLS"
+ * description: Inner EAP-based authentication methods. Note that
+ * IEEE_8021X_INNER_AUTH_METHODS is also used for 'phase2-auth' values.
+ * example: IEEE_8021X_INNER_AUTH_METHODS="MSCHAPV2 EAP-TLS"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE2_AUTHEAP,
g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTHEAP, "", "",
@@ -3351,10 +3537,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
G_TYPE_BYTES,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_802_1X_PHASE2_CA_CERT,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSetting8021x:phase2-ca-path:
@@ -3378,6 +3560,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* authentication. When unset, no verification of the authentication server
* certificate's subject is performed.
**/
+ /* ---ifcfg-rh---
+ * property: phase2-subject-match
+ * variable: IEEE_8021X_PHASE2_SUBJECT_MATCH(+)
+ * description: Substring to match subject of server certificate against.
+ * example: IEEE_8021X_PHASE2_SUBJECT_MATCH="Red Hat"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE2_SUBJECT_MATCH,
g_param_spec_string (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH, "", "",
@@ -3393,6 +3582,11 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* "phase 2" authentication. If the list is empty, no verification of the
* server certificate's altSubjectName is performed.
**/
+ /* ---ifcfg-rh---
+ * property: phase2-altsubject-matches
+ * variable: IEEE_8021X_PHASE2_ALTSUBJECT_MATCHES(+)
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE2_ALTSUBJECT_MATCHES,
g_param_spec_boxed (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, "", "",
@@ -3419,16 +3613,19 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_phase2_client_cert() function instead.
**/
+ /* ---ifcfg-rh---
+ * property: phase2-client-cert
+ * variable: IEEE_8021X_INNER_CLIENT_CERT(+)
+ * description: Client certificate for inner EAP method.
+ * example: IEEE_8021X_INNER_CLIENT_CERT=/home/joe/mycert.crt
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE2_CLIENT_CERT,
g_param_spec_boxed (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, "", "",
G_TYPE_BYTES,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSetting8021x:password:
@@ -3437,6 +3634,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* #NMSetting8021x:password property and the #NMSetting8021x:password-raw
* property are specified, #NMSetting8021x:password is preferred.
**/
+ /* ---ifcfg-rh---
+ * property: password
+ * variable: IEEE_8021X_PASSWORD(+)
+ * description: UTF-8 encoded password used for EAP. It can also go to "key-"
+ * lookaside file, or it can be owned by a secret agent.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PASSWORD,
g_param_spec_string (NM_SETTING_802_1X_PASSWORD, "", "",
@@ -3450,6 +3654,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* Flags indicating how to handle the #NMSetting8021x:password property.
**/
+ /* ---ifcfg-rh---
+ * property: password-flags
+ * variable: IEEE_8021X_PASSWORD_FLAGS(+)
+ * format: NMSettingSecretFlags
+ * description: Password flags for IEEE_8021X_PASSWORD password.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PASSWORD_FLAGS,
g_param_spec_flags (NM_SETTING_802_1X_PASSWORD_FLAGS, "", "",
@@ -3466,6 +3677,12 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* #NMSetting8021x:password property and the #NMSetting8021x:password-raw
* property are specified, #NMSetting8021x:password is preferred.
**/
+ /* ---ifcfg-rh---
+ * property: password-raw
+ * variable: (none)
+ * description: The property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PASSWORD_RAW,
g_param_spec_boxed (NM_SETTING_802_1X_PASSWORD_RAW, "", "",
@@ -3473,16 +3690,18 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
G_PARAM_READWRITE |
NM_SETTING_PARAM_SECRET |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_802_1X_PASSWORD_RAW,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSetting8021x:password-raw-flags:
*
* Flags indicating how to handle the #NMSetting8021x:password-raw property.
**/
+ /* ---ifcfg-rh---
+ * property: password-raw-flags
+ * variable: (none)
+ * description: The property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PASSWORD_RAW_FLAGS,
g_param_spec_flags (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS, "", "",
@@ -3502,15 +3721,16 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* should be set to the key's encrypted PEM encoded data. When using private
* keys with the path scheme, this property should be set to the full UTF-8
* encoded path of the key, prefixed with the string "file://" and ending
- * with a terminating NUL byte. When using PKCS#12 format private keys and
- * the blob scheme, this property should be set to the PKCS#12 data and the
- * #NMSetting8021x:private-key-password property must be set to password
- * used to decrypt the PKCS#12 certificate and key. When using PKCS#12 files
- * and the path scheme, this property should be set to the full UTF-8
- * encoded path of the key, prefixed with the string "file://" and and
- * ending with a terminating NUL byte, and as with the blob scheme the
- * "private-key-password" property must be set to the password used to
- * decode the PKCS#12 private key and certificate.
+ * with a terminating NUL byte. When using PKCS#<!-- -->12 format private
+ * keys and the blob scheme, this property should be set to the
+ * PKCS#<!-- -->12 data and the #NMSetting8021x:private-key-password
+ * property must be set to password used to decrypt the PKCS#<!-- -->12
+ * certificate and key. When using PKCS#<!-- -->12 files and the path
+ * scheme, this property should be set to the full UTF-8 encoded path of the
+ * key, prefixed with the string "file://" and and ending with a terminating
+ * NUL byte, and as with the blob scheme the "private-key-password" property
+ * must be set to the password used to decode the PKCS#<!-- -->12 private
+ * key and certificate.
*
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_private_key() function instead.
@@ -3521,27 +3741,37 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* private key password to prevent unauthorized access to unencrypted
* private key data.
**/
+ /* ---ifcfg-rh---
+ * property: private-key
+ * variable: IEEE_8021X_PRIVATE_KEY(+)
+ * description: Private key for EAP-TLS.
+ * example: IEEE_8021X_PRIVATE_KEY=/home/joe/mykey.p12
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIVATE_KEY,
g_param_spec_boxed (NM_SETTING_802_1X_PRIVATE_KEY, "", "",
G_TYPE_BYTES,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_802_1X_PRIVATE_KEY,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSetting8021x:private-key-password:
*
* The password used to decrypt the private key specified in the
* #NMSetting8021x:private-key property when the private key either uses the
- * path scheme, or if the private key is a PKCS#12 format key. Setting this
+ * path scheme, or if the private key is a PKCS#<!-- -->12 format key. Setting this
* property directly is not generally necessary except when returning
* secrets to NetworkManager; it is generally set automatically when setting
* the private key by the nm_setting_802_1x_set_private_key() function.
**/
+ /* ---ifcfg-rh---
+ * property: private-key-password
+ * variable: IEEE_8021X_PRIVATE_KEY_PASSWORD(+)
+ * description: Password for IEEE_8021X_PRIVATE_KEY. It can also go to "key-"
+ * lookaside file, or it can be owned by a secret agent.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIVATE_KEY_PASSWORD,
g_param_spec_string (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, "", "",
@@ -3556,6 +3786,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Flags indicating how to handle the #NMSetting8021x:private-key-password
* property.
**/
+ /* ---ifcfg-rh---
+ * property: private-key-password-flags
+ * variable: IEEE_8021X_PRIVATE_KEY_PASSWORD_FLAGS(+)
+ * format: NMSettingSecretFlags
+ * description: Password flags for IEEE_8021X_PRIVATE_KEY_PASSWORD password.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIVATE_KEY_PASSWORD_FLAGS,
g_param_spec_flags (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS, "", "",
@@ -3576,40 +3813,51 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* should be set to the key's encrypted PEM encoded data. When using private
* keys with the path scheme, this property should be set to the full UTF-8
* encoded path of the key, prefixed with the string "file://" and ending
- * with a terminating NUL byte. When using PKCS#12 format private keys and
- * the blob scheme, this property should be set to the PKCS#12 data and the
- * #NMSetting8021x:phase2-private-key-password property must be set to
- * password used to decrypt the PKCS#12 certificate and key. When using
- * PKCS#12 files and the path scheme, this property should be set to the
- * full UTF-8 encoded path of the key, prefixed with the string "file://"
- * and and ending with a terminating NUL byte, and as with the blob scheme
- * the #NMSetting8021x:phase2-private-key-password property must be set to
- * the password used to decode the PKCS#12 private key and certificate.
+ * with a terminating NUL byte. When using PKCS#<!-- -->12 format private
+ * keys and the blob scheme, this property should be set to the
+ * PKCS#<!-- -->12 data and the #NMSetting8021x:phase2-private-key-password
+ * property must be set to password used to decrypt the PKCS#<!-- -->12
+ * certificate and key. When using PKCS#<!-- -->12 files and the path
+ * scheme, this property should be set to the full UTF-8 encoded path of the
+ * key, prefixed with the string "file://" and and ending with a terminating
+ * NUL byte, and as with the blob scheme the
+ * #NMSetting8021x:phase2-private-key-password property must be set to the
+ * password used to decode the PKCS#<!-- -->12 private key and certificate.
*
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_phase2_private_key() function instead.
**/
+ /* ---ifcfg-rh---
+ * property: phase2-private-key
+ * variable: IEEE_8021X_INNER_PRIVATE_KEY(+)
+ * description: Private key for inner authentication method for EAP-TLS.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE2_PRIVATE_KEY,
g_param_spec_boxed (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, "", "",
G_TYPE_BYTES,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSetting8021x:phase2-private-key-password:
*
* The password used to decrypt the "phase 2" private key specified in the
* #NMSetting8021x:phase2-private-key property when the private key either
- * uses the path scheme, or is a PKCS#12 format key. Setting this property
- * directly is not generally necessary except when returning secrets to
- * NetworkManager; it is generally set automatically when setting the
- * private key by the nm_setting_802_1x_set_phase2_private_key() function.
+ * uses the path scheme, or is a PKCS#<!-- -->12 format key. Setting this
+ * property directly is not generally necessary except when returning
+ * secrets to NetworkManager; it is generally set automatically when setting
+ * the private key by the nm_setting_802_1x_set_phase2_private_key()
+ * function.
**/
+ /* ---ifcfg-rh---
+ * property: phase2-private-key-password
+ * variable: IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD(+)
+ * description: Password for IEEE_8021X_INNER_PRIVATE_KEY. It can also go to "key-"
+ * lookaside file, or it can be owned by a secret agent.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE2_PRIVATE_KEY_PASSWORD,
g_param_spec_string (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, "", "",
@@ -3624,6 +3872,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Flags indicating how to handle the
* #NMSetting8021x:phase2-private-key-password property.
**/
+ /* ---ifcfg-rh---
+ * property: phase2-private-key-password-flags
+ * variable: IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD_FLAGS(+)
+ * format: NMSettingSecretFlags
+ * description: Password flags for IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD password.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS,
g_param_spec_flags (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS, "", "",
@@ -3637,6 +3892,12 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* PIN used for EAP authentication methods.
**/
+ /* ---ifcfg-rh---
+ * property: pin
+ * variable: (none)
+ * description: The property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PIN,
g_param_spec_string (NM_SETTING_802_1X_PIN, "", "",
@@ -3650,6 +3911,12 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* Flags indicating how to handle the #NMSetting8021x:pin property.
**/
+ /* ---ifcfg-rh---
+ * property: pin-flags
+ * variable: (none)
+ * description: The property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PIN_FLAGS,
g_param_spec_flags (NM_SETTING_802_1X_PIN_FLAGS, "", "",
@@ -3668,6 +3935,12 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* addition to any certificates specified by the #NMSetting8021x:ca-cert and
* #NMSetting8021x:phase2-ca-cert properties.
**/
+ /* ---ifcfg-rh---
+ * property: system-ca-certs
+ * variable: (none)
+ * description: The property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_SYSTEM_CA_CERTS,
g_param_spec_boolean (NM_SETTING_802_1X_SYSTEM_CA_CERTS, "", "",
@@ -3675,11 +3948,4 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- /* Initialize crypto lbrary. */
- if (!nm_utils_init (&error)) {
- g_warning ("Couldn't initilize nm-utils/crypto system: %d %s",
- error->code, error->message);
- g_error_free (error);
- }
}
diff --git a/libnm-core/nm-setting-8021x.h b/libnm-core/nm-setting-8021x.h
index 10338de998..da86071a63 100644
--- a/libnm-core/nm-setting-8021x.h
+++ b/libnm-core/nm-setting-8021x.h
@@ -31,13 +31,15 @@
G_BEGIN_DECLS
+#define NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH "file://"
+
/**
* NMSetting8021xCKFormat:
* @NM_SETTING_802_1X_CK_FORMAT_UNKNOWN: unknown file format
* @NM_SETTING_802_1X_CK_FORMAT_X509: file contains an X.509 format certificate
* @NM_SETTING_802_1X_CK_FORMAT_RAW_KEY: file contains an old-style OpenSSL PEM
* or DER private key
- * @NM_SETTING_802_1X_CK_FORMAT_PKCS12: file contains a PKCS#12 certificate
+ * @NM_SETTING_802_1X_CK_FORMAT_PKCS12: file contains a PKCS#<!-- -->12 certificate
* and private key
*
* #NMSetting8021xCKFormat values indicate the general type of a certificate
@@ -147,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 dfd1e0107c..2e71f8e790 100644
--- a/libnm-core/nm-setting-adsl.c
+++ b/libnm-core/nm-setting-adsl.c
@@ -19,8 +19,10 @@
* Copyright 2011 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-adsl.h"
#include "nm-setting-ppp.h"
@@ -197,15 +199,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_ADSL_SETTING_NAME, NM_SETTING_ADSL_PASSWORD);
- return FALSE;
- }
-
if ( !priv->protocol
|| ( strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)
@@ -240,7 +233,7 @@ need_secrets (NMSetting *setting)
NMSettingAdslPrivate *priv = NM_SETTING_ADSL_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (!(priv->password_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED)) {
diff --git a/libnm-core/nm-setting-bluetooth.c b/libnm-core/nm-setting-bluetooth.c
index 952dd61b51..41a0b4c2ff 100644
--- a/libnm-core/nm-setting-bluetooth.c
+++ b/libnm-core/nm-setting-bluetooth.c
@@ -20,9 +20,11 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bluetooth.h"
#include "nm-setting-cdma.h"
@@ -79,7 +81,8 @@ NMSetting *nm_setting_bluetooth_new (void)
* Returns the connection method for communicating with the remote device (i.e.
* either DUN to a DUN-capable device or PANU to a NAP-capable device).
*
- * Returns: the type, either %NM_SETTING_BLUETOOTH_PANU or %NM_SETTING_BLUETOOTH_DUN
+ * Returns: the type, either %NM_SETTING_BLUETOOTH_TYPE_PANU or
+ * %NM_SETTING_BLUETOOTH_TYPE_DUN
**/
const char *
nm_setting_bluetooth_get_connection_type (NMSettingBluetooth *setting)
diff --git a/libnm-core/nm-setting-bond.c b/libnm-core/nm-setting-bond.c
index ab026aac78..5441a090da 100644
--- a/libnm-core/nm-setting-bond.c
+++ b/libnm-core/nm-setting-bond.c
@@ -19,12 +19,14 @@
* Copyright 2011 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bond.h"
#include "nm-utils.h"
@@ -134,10 +136,11 @@ nm_setting_bond_get_num_options (NMSettingBond *setting)
* @setting: the #NMSettingBond
* @idx: index of the desired option, from 0 to
* nm_setting_bond_get_num_options() - 1
- * @out_name: (out): on return, the name of the bonding option; this
- * value is owned by the setting and should not be modified
- * @out_value: (out): on return, the value of the name of the bonding
- * option; this value is owned by the setting and should not be modified
+ * @out_name: (out) (transfer none): on return, the name of the bonding option;
+ * this value is owned by the setting and should not be modified
+ * @out_value: (out) (transfer none): on return, the value of the name of the
+ * bonding option; this value is owned by the setting and should not be
+ * modified
*
* Given an index, return the value of the bonding option at that index. Indexes
* are *not* guaranteed to be static across modifications to options done by
@@ -437,15 +440,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
NMSettingBondPrivate *priv = NM_SETTING_BOND_GET_PRIVATE (setting);
GHashTableIter iter;
const char *key, *value;
- const char *valid_modes[] = { "balance-rr",
- "active-backup",
- "balance-xor",
- "broadcast",
- "802.3ad",
- "balance-tlb",
- "balance-alb",
- NULL };
- int miimon = 0, arp_interval = 0;
+ int mode, miimon = 0, arp_interval = 0;
+ const char *mode_orig, *mode_new;
const char *arp_ip_target = NULL;
const char *lacp_rate;
const char *primary;
@@ -481,7 +477,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
}
- value = g_hash_table_lookup (priv->options, NM_SETTING_BOND_OPTION_MODE);
+ /* Verify bond mode */
+ mode_orig = value = g_hash_table_lookup (priv->options, NM_SETTING_BOND_OPTION_MODE);
if (!value) {
g_set_error (error,
NM_CONNECTION_ERROR,
@@ -491,7 +488,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
return FALSE;
}
- if (!_nm_utils_string_in_list (value, valid_modes)) {
+ mode = nm_utils_bond_mode_string_to_int (value);
+ if (mode == -1) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
@@ -500,6 +498,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
return FALSE;
}
+ mode_new = value = nm_utils_bond_mode_int_to_string (mode);
/* Make sure mode is compatible with other settings */
if ( strcmp (value, "balance-alb") == 0
@@ -642,7 +641,22 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- return _nm_connection_verify_required_interface_name (connection, error);
+ if (!_nm_connection_verify_required_interface_name (connection, error))
+ return FALSE;
+
+ /* *** errors above here should be always fatal, below NORMALIZABLE_ERROR *** */
+
+ if (g_strcmp0 (mode_orig, mode_new) != 0) {
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("'%s' option should be string"),
+ NM_SETTING_BOND_OPTION_MODE);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
+ return NM_SETTING_VERIFY_NORMALIZABLE;
+ }
+
+ return TRUE;
}
static void
@@ -723,6 +737,13 @@ nm_setting_bond_class_init (NMSettingBondClass *setting_class)
*
* Type: GHashTable(utf8,utf8)
**/
+ /* ---ifcfg-rh---
+ * property: options
+ * variable: BONDING_OPTS
+ * description: Bonding options.
+ * example: BONDING_OPTS="miimon=100 mode=broadcast"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_OPTIONS,
g_param_spec_boxed (NM_SETTING_BOND_OPTIONS, "", "",
@@ -735,6 +756,14 @@ nm_setting_bond_class_init (NMSettingBondClass *setting_class)
_nm_utils_strdict_to_dbus,
_nm_utils_strdict_from_dbus);
+ /* ---dbus---
+ * property: interface-name
+ * format: string
+ * description: Deprecated in favor of connection.interface-name, but can
+ * be used for backward-compatibility with older daemons, to set the
+ * bond's interface name.
+ * ---end---
+ */
_nm_setting_class_add_dbus_only_property (parent_class, "interface-name",
G_VARIANT_TYPE_STRING,
_nm_setting_get_deprecated_virtual_interface_name,
diff --git a/libnm-core/nm-setting-bridge-port.c b/libnm-core/nm-setting-bridge-port.c
index d1ffdca3d3..763af37bcf 100644
--- a/libnm-core/nm-setting-bridge-port.c
+++ b/libnm-core/nm-setting-bridge-port.c
@@ -19,10 +19,12 @@
* Copyright 2012 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bridge-port.h"
#include "nm-utils.h"
@@ -256,6 +258,14 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *setting_class)
*
* The Spanning Tree Protocol (STP) priority of this bridge port.
**/
+ /* ---ifcfg-rh---
+ * property: priority
+ * variable: BRIDGING_OPTS: priority=
+ * values: 0 - 63
+ * default: 32
+ * description: STP priority.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIORITY,
g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PRIORITY, "", "",
@@ -271,6 +281,14 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *setting_class)
* The Spanning Tree Protocol (STP) port cost for destinations via this
* port.
**/
+ /* ---ifcfg-rh---
+ * property: path-cost
+ * variable: BRIDGING_OPTS: path_cost=
+ * values: 1 - 65535
+ * default: 100
+ * description: STP cost.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PATH_COST,
g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PATH_COST, "", "",
@@ -286,6 +304,13 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *setting_class)
* Enables or disabled "hairpin mode" for the port, which allows frames to
* be sent back out through the port the frame was received on.
**/
+ /* ---ifcfg-rh---
+ * property: hairpin-mode
+ * variable: BRIDGING_OPTS: hairpin_mode=
+ * default: yes
+ * description: Hairpin mode of the bridge port.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_HAIRPIN_MODE,
g_param_spec_boolean (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, "", "",
diff --git a/libnm-core/nm-setting-bridge.c b/libnm-core/nm-setting-bridge.c
index 100804a017..fe10ad69ad 100644
--- a/libnm-core/nm-setting-bridge.c
+++ b/libnm-core/nm-setting-bridge.c
@@ -19,10 +19,12 @@
* Copyright 2011 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bridge.h"
#include "nm-connection-private.h"
@@ -51,6 +53,7 @@ typedef struct {
guint16 hello_time;
guint16 max_age;
guint32 ageing_time;
+ gboolean multicast_snooping;
} NMSettingBridgePrivate;
enum {
@@ -62,6 +65,7 @@ enum {
PROP_HELLO_TIME,
PROP_MAX_AGE,
PROP_AGEING_TIME,
+ PROP_MULTICAST_SNOOPING,
LAST_PROP
};
@@ -176,6 +180,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
@@ -194,10 +214,14 @@ static inline gboolean
check_range (guint32 val,
guint32 min,
guint32 max,
+ gboolean zero,
const char *prop,
GError **error)
{
- if ((val != 0) && (val < min || val > max)) {
+ if (zero && val == 0)
+ return TRUE;
+
+ if (val < min || val > max) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
@@ -226,6 +250,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
if (!check_range (priv->forward_delay,
BR_MIN_FORWARD_DELAY,
BR_MAX_FORWARD_DELAY,
+ !priv->stp,
NM_SETTING_BRIDGE_FORWARD_DELAY,
error))
return FALSE;
@@ -233,6 +258,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
if (!check_range (priv->hello_time,
BR_MIN_HELLO_TIME,
BR_MAX_HELLO_TIME,
+ !priv->stp,
NM_SETTING_BRIDGE_HELLO_TIME,
error))
return FALSE;
@@ -240,6 +266,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
if (!check_range (priv->max_age,
BR_MIN_MAX_AGE,
BR_MAX_MAX_AGE,
+ !priv->stp,
NM_SETTING_BRIDGE_MAX_AGE,
error))
return FALSE;
@@ -247,6 +274,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
if (!check_range (priv->ageing_time,
BR_MIN_AGEING_TIME,
BR_MAX_AGEING_TIME,
+ !priv->stp,
NM_SETTING_BRIDGE_AGEING_TIME,
error))
return FALSE;
@@ -299,6 +327,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;
@@ -334,6 +365,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;
@@ -362,6 +396,22 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
* MAC address will be set. When matching an existing (outside
* NetworkManager created) bridge, this MAC address must match.
**/
+ /* ---keyfile---
+ * property: mac-address
+ * format: ususal hex-digits-and-colons notation
+ * description: MAC address in traditional hex-digits-and-colons notation,
+ * or semicolon separated list of 6 decimal bytes (obsolete)
+ * example: mac-address=00:22:68:12:79:A2
+ * mac-address=0;34;104;18;121;162;
+ * ---end---
+ * ---ifcfg-rh---
+ * property: mac-address
+ * variable: MACADDR(+)
+ * description: MAC address of the bridge. Note that this requires a recent
+ * kernel support, originally introduced in 3.15 upstream kernel)
+ * MACADDR for bridges is an NM extension.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
g_param_spec_string (NM_SETTING_BRIDGE_MAC_ADDRESS, "", "",
@@ -379,6 +429,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Controls whether Spanning Tree Protocol (STP) is enabled for this bridge.
**/
+ /* ---ifcfg-rh---
+ * property: stp
+ * variable: STP
+ * default: no
+ * description: Span tree protocol participation.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_STP,
g_param_spec_boolean (NM_SETTING_BRIDGE_STP, "", "",
@@ -395,6 +452,14 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
* values are "better"; the lowest priority bridge will be elected the root
* bridge.
**/
+ /* ---ifcfg-rh---
+ * property: priority
+ * variable: BRIDGING_OPTS: priority=
+ * values: 0 - 32768
+ * default: 32768
+ * description: STP priority.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIORITY,
g_param_spec_uint (NM_SETTING_BRIDGE_PRIORITY, "", "",
@@ -409,6 +474,14 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* The Spanning Tree Protocol (STP) forwarding delay, in seconds.
**/
+ /* ---ifcfg-rh---
+ * property: forward-delay
+ * variable: DELAY
+ * values: 2 - 30
+ * default: 15
+ * description: STP forwarding delay.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_FORWARD_DELAY,
g_param_spec_uint (NM_SETTING_BRIDGE_FORWARD_DELAY, "", "",
@@ -423,6 +496,14 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* The Spanning Tree Protocol (STP) hello time, in seconds.
**/
+ /* ---ifcfg-rh---
+ * property: hello-time
+ * variable: BRIDGING_OPTS: hello_time=
+ * values: 1 - 10
+ * default: 2
+ * description: STP hello time.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_HELLO_TIME,
g_param_spec_uint (NM_SETTING_BRIDGE_HELLO_TIME, "", "",
@@ -437,6 +518,14 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* The Spanning Tree Protocol (STP) maximum message age, in seconds.
**/
+ /* ---ifcfg-rh---
+ * property: max-age
+ * variable: BRIDGING_OPTS: max_age=
+ * values: 6 - 40
+ * default: 20
+ * description: STP maximum message age.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MAX_AGE,
g_param_spec_uint (NM_SETTING_BRIDGE_MAX_AGE, "", "",
@@ -451,6 +540,14 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* The Ethernet MAC address aging time, in seconds.
**/
+ /* ---ifcfg-rh---
+ * property: ageing-time
+ * variable: BRIDGING_OPTS: ageing_time=
+ * values: 0 - 1000000
+ * default: 300
+ * description: Ethernet MAC ageing time.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_AGEING_TIME,
g_param_spec_uint (NM_SETTING_BRIDGE_AGEING_TIME, "", "",
@@ -460,6 +557,41 @@ 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
+ * description: Deprecated in favor of connection.interface-name, but can
+ * be used for backward-compatibility with older daemons, to set the
+ * bridge's interface name.
+ * ---end---
+ */
_nm_setting_class_add_dbus_only_property (parent_class, "interface-name",
G_VARIANT_TYPE_STRING,
_nm_setting_get_deprecated_virtual_interface_name,
diff --git a/libnm-core/nm-setting-bridge.h b/libnm-core/nm-setting-bridge.h
index b4fe747726..020d6db63b 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 f611cc601c..ecc387c8f5 100644
--- a/libnm-core/nm-setting-cdma.c
+++ b/libnm-core/nm-setting-cdma.c
@@ -19,8 +19,10 @@
* Copyright 2007 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-cdma.h"
#include "nm-utils.h"
@@ -158,15 +160,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_CDMA_SETTING_NAME, NM_SETTING_CDMA_PASSWORD);
- return FALSE;
- }
-
return TRUE;
}
@@ -176,7 +169,7 @@ need_secrets (NMSetting *setting)
NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (priv->username) {
diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c
index e7f8518d43..7bc927bc1d 100644
--- a/libnm-core/nm-setting-connection.c
+++ b/libnm-core/nm-setting-connection.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-utils.h"
#include "nm-utils-private.h"
@@ -775,14 +777,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (!priv->uuid) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_MISSING_PROPERTY,
- _("property is missing"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_UUID);
- return FALSE;
- } else if (!nm_utils_is_uuid (priv->uuid)) {
+ if (priv->uuid && !nm_utils_is_uuid (priv->uuid)) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
@@ -872,10 +867,10 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
if (is_slave) {
if (!priv->master) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_MISSING_PROPERTY,
- _("Slave connections need a valid '" NM_SETTING_CONNECTION_MASTER "' property"));
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_MISSING_PROPERTY,
+ _("Slave connections need a valid '%s' property"), NM_SETTING_CONNECTION_MASTER);
g_prefix_error (error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_MASTER);
return FALSE;
}
@@ -893,10 +888,11 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
normerr_missing_slave_type = slave_type;
normerr_missing_slave_type_port = nm_setting_get_name (s_port);
} else {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_MISSING_PROPERTY,
- _("Cannot set '" NM_SETTING_CONNECTION_MASTER "' without '" NM_SETTING_CONNECTION_SLAVE_TYPE "'"));
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_MISSING_PROPERTY,
+ _("Cannot set '%s' without '%s'"),
+ NM_SETTING_CONNECTION_MASTER, NM_SETTING_CONNECTION_SLAVE_TYPE);
g_prefix_error (error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_SLAVE_TYPE);
return FALSE;
}
@@ -905,6 +901,15 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
/* *** errors above here should be always fatal, below NORMALIZABLE_ERROR *** */
+ if (!priv->uuid) {
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_MISSING_PROPERTY,
+ _("property is missing"));
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_UUID);
+ return NM_SETTING_VERIFY_NORMALIZABLE_ERROR;
+ }
+
if (normerr_base_type) {
g_set_error (error,
NM_CONNECTION_ERROR,
@@ -934,8 +939,9 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_MISSING_PROPERTY,
- _("Detect a slave connection with '" NM_SETTING_CONNECTION_MASTER "' set and a port type '%s'. '" NM_SETTING_CONNECTION_SLAVE_TYPE "' should be set to '%s'"),
- normerr_missing_slave_type_port, normerr_missing_slave_type);
+ _("Detect a slave connection with '%s' set and a port type '%s'. '%s' should be set to '%s'"),
+ NM_SETTING_CONNECTION_MASTER, normerr_missing_slave_type_port,
+ NM_SETTING_CONNECTION_SLAVE_TYPE, normerr_missing_slave_type);
g_prefix_error (error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_SLAVE_TYPE);
return NM_SETTING_VERIFY_NORMALIZABLE_ERROR;
}
@@ -962,8 +968,9 @@ find_virtual_interface_name (GVariant *connection_dict)
/* All of the deprecated virtual interface name properties were named "interface-name". */
if (!g_variant_lookup (setting_dict, "interface-name", "&s", &interface_name))
- return NULL;
+ interface_name = NULL;
+ g_variant_unref (setting_dict);
return interface_name;
}
@@ -1012,6 +1019,11 @@ compare_property (NMSetting *setting,
&& g_strcmp0 (prop_spec->name, NM_SETTING_CONNECTION_ID) == 0)
return TRUE;
+ /* Handle ignore timestamp */
+ if ( (flags & NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP)
+ && g_strcmp0 (prop_spec->name, NM_SETTING_CONNECTION_TIMESTAMP) == 0)
+ return TRUE;
+
/* Otherwise chain up to parent to handle generic compare */
return NM_SETTING_CLASS (nm_setting_connection_parent_class)->compare_property (setting, other, prop_spec, flags);
}
@@ -1216,6 +1228,12 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* A human readable unique identifier for the connection, like "Work Wi-Fi"
* or "T-Mobile 3G".
**/
+ /* ---ifcfg-rh---
+ * property: id
+ * variable: NAME(+)
+ * description: User friendly name for the connection profile.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_ID,
g_param_spec_string (NM_SETTING_CONNECTION_ID, "", "",
@@ -1240,6 +1258,13 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* be generated by nm_utils_uuid_generate() or
* nm_utils_uuid_generate_from_string().
**/
+ /* ---ifcfg-rh---
+ * property: uuid
+ * variable: UUID(+)
+ * description: UUID for the connection profile. When missing, NetworkManager
+ * creates the UUID itself (by hashing the file).
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_UUID,
g_param_spec_string (NM_SETTING_CONNECTION_UUID, "", "",
@@ -1263,6 +1288,14 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* can be used with, and if interface names change or are reordered the
* connection may be applied to the wrong interface.
**/
+ /* ---ifcfg-rh---
+ * property: interface-name
+ * variable: DEVICE
+ * description: Interface 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.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_CONNECTION_INTERFACE_NAME, "", "",
@@ -1285,6 +1318,15 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* non-hardware dependent connections like VPN or otherwise, should contain
* the setting name of that setting type (ie, "vpn" or "bridge", etc).
**/
+ /* ---ifcfg-rh---
+ * property: type
+ * variable: TYPE (DEVICETYPE, DEVICE)
+ * values: Ethernet, Wireless, InfiniBand, Bridge, Bond, Vlan, Team, TeamPort
+ * description: Base type of the connection. DEVICETYPE is used for teaming
+ * connections.
+ * example: TYPE=Ethernet; TYPE=Bond; TYPE=Bridge; DEVICETYPE=TeamPort
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_TYPE,
g_param_spec_string (NM_SETTING_CONNECTION_TYPE, "", "",
@@ -1308,6 +1350,14 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* [reserved] information present must be ignored and is reserved for future
* use. All of [type], [id], and [reserved] must be valid UTF-8.
*/
+ /* ---ifcfg-rh---
+ * property: permissions
+ * variable: USERS(+)
+ * description: USERS restrict the access for this conenction to certain
+ * users only.
+ * example: USERS="joe bob"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PERMISSIONS,
g_param_spec_boxed (NM_SETTING_CONNECTION_PERMISSIONS, "", "",
@@ -1323,6 +1373,13 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* %TRUE to automatically activate the connection, %FALSE to require manual
* intervention to activate the connection.
**/
+ /* ---ifcfg-rh---
+ * property: autoconnect
+ * variable: ONBOOT
+ * default: yes
+ * description: Whether the connection should be autoconnected (not only while booting).
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_AUTOCONNECT,
g_param_spec_boolean (NM_SETTING_CONNECTION_AUTOCONNECT, "", "",
@@ -1339,6 +1396,16 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* connections with higher priority will be preferred. Defaults to 0.
* The higher number means higher priority.
**/
+ /* ---ifcfg-rh---
+ * property: autoconnect-priority
+ * variable: AUTOCONNECT_PRIORITY(+)
+ * values: -999 to 999
+ * default: 0
+ * description: Connection priority for automatic activation. Connections with
+ * higher numbers are preferred when selecting profiles for automatic activation.
+ * example: AUTOCONNECT_PRIORITY=20
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_AUTOCONNECT_PRIORITY,
g_param_spec_int (NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY, "", "",
@@ -1394,6 +1461,14 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* the connection will be placed in the default zone as defined by the
* firewall.
**/
+ /* ---ifcfg-rh---
+ * property: zone
+ * variable: ZONE(+)
+ * description: Trust level of this connection. The string is usually used
+ * for a firewall.
+ * example: ZONE=Work
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_ZONE,
g_param_spec_string (NM_SETTING_CONNECTION_ZONE, "", "",
@@ -1408,6 +1483,13 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
*
* Interface name of the master device or UUID of the master connection.
**/
+ /* ---ifcfg-rh---
+ * property: master
+ * variable: MASTER, TEAM_MASTER, BRIDGE
+ * description: Reference to master connection. The variable used depends on
+ * the connection type.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MASTER,
g_param_spec_string (NM_SETTING_CONNECTION_MASTER, "", "",
@@ -1424,6 +1506,14 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* %NM_SETTING_BOND_SETTING_NAME), or %NULL if this connection is not a
* slave.
**/
+ /* ---ifcfg-rh---
+ * property: slave-type
+ * variable: MASTER, TEAM_MASTER, DEVICETYPE, BRIDGE
+ * description: Slave type doesn't map directly to a variable, but it is
+ * recognized using different variables. MASTER for bonding,
+ * TEAM_MASTER and DEVICETYPE for teaming, BRIDGE for bridging.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_SLAVE_TYPE,
g_param_spec_string (NM_SETTING_CONNECTION_SLAVE_TYPE, "", "",
@@ -1440,6 +1530,13 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* connection itself is activated. Currently only VPN connections are
* supported.
**/
+ /* ---ifcfg-rh---
+ * property: secondaries
+ * variable: SECONDARY_UUIDS(+)
+ * description: UUID of VPN connections that should be activated
+ * together with this connection.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_SECONDARIES,
g_param_spec_boxed (NM_SETTING_CONNECTION_SECONDARIES, "", "",
@@ -1454,6 +1551,15 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* If greater than zero, delay success of IP addressing until either the
* timeout is reached, or an IP gateway replies to a ping.
**/
+ /* ---ifcfg-rh---
+ * property: gateway-ping-timeout
+ * variable: GATEWAY_PING_TIMEOUT(+)
+ * default: 0
+ * description: If greater than zero, the IP connectivity will be checked by
+ * pinging the gateway and waiting for the specified timeout (in seconds).
+ * example: GATEWAY_PING_TIMEOUT=5
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_GATEWAY_PING_TIMEOUT,
g_param_spec_uint (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, "", "",
diff --git a/libnm-core/nm-setting-dcb.c b/libnm-core/nm-setting-dcb.c
index 8a99ec07bb..915cc41f2e 100644
--- a/libnm-core/nm-setting-dcb.c
+++ b/libnm-core/nm-setting-dcb.c
@@ -19,8 +19,10 @@
* Copyright 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-dcb.h"
#include "nm-utils.h"
@@ -48,7 +50,7 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_DCB)
typedef struct {
NMSettingDcbFlags app_fcoe_flags;
gint app_fcoe_priority;
- const char * app_fcoe_mode;
+ char * app_fcoe_mode;
NMSettingDcbFlags app_iscsi_flags;
gint app_iscsi_priority;
@@ -791,6 +793,7 @@ set_property (GObject *object, guint prop_id,
priv->app_fcoe_priority = g_value_get_int (value);
break;
case PROP_APP_FCOE_MODE:
+ g_free (priv->app_fcoe_mode);
priv->app_fcoe_mode = g_value_dup_string (value);
break;
case PROP_APP_ISCSI_FLAGS:
@@ -895,6 +898,16 @@ get_property (GObject *object, guint prop_id,
}
static void
+finalize (GObject *object)
+{
+ NMSettingDcbPrivate *priv = NM_SETTING_DCB_GET_PRIVATE (object);
+
+ g_free (priv->app_fcoe_mode);
+
+ G_OBJECT_CLASS (nm_setting_dcb_parent_class)->finalize (object);
+}
+
+static void
nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
@@ -905,6 +918,7 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
/* virtual methods */
object_class->set_property = set_property;
object_class->get_property = get_property;
+ object_class->finalize = finalize;
parent_class->verify = verify;
/* Properties */
@@ -915,6 +929,14 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* be any combination of %NM_SETTING_DCB_FLAG_ENABLE,
* %NM_SETTING_DCB_FLAG_ADVERTISE, and %NM_SETTING_DCB_FLAG_WILLING.
**/
+ /* ---ifcfg-rh---
+ * property: app-fcoe-flags
+ * variable: DCB_APP_FCOE_ENABLE, DCB_APP_FCOE_ADVERTISE, DCB_APP_FCOE_WILLING
+ * description: FCOE flags.
+ * default: no
+ * example: DCB_APP_FCOE_ENABLE=yes DCB_APP_FCOE_ADVERTISE=yes
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_APP_FCOE_FLAGS,
g_param_spec_flags (NM_SETTING_DCB_APP_FCOE_FLAGS, "", "",
@@ -930,6 +952,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* default priority. Only used when the #NMSettingDcb:app-fcoe-flags
* property includes the %NM_SETTING_DCB_FLAG_ENABLE flag.
**/
+ /* ---ifcfg-rh---
+ * property: app-fcoe-priority
+ * variable: DCB_APP_FCOE_PRIORITY
+ * values: 0 - 7
+ * description: Priority of FCoE frames.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_APP_FCOE_PRIORITY,
g_param_spec_int (NM_SETTING_DCB_APP_FCOE_PRIORITY, "", "",
@@ -944,6 +973,14 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* The FCoE controller mode; either %NM_SETTING_DCB_FCOE_MODE_FABRIC
* (default) or %NM_SETTING_DCB_FCOE_MODE_VN2VN.
**/
+ /* ---ifcfg-rh---
+ * property: app-fcoe-mode
+ * variable: DCB_APP_FCOE_MODE
+ * values: fabric, vn2vn
+ * default: fabric
+ * description: FCoE controller mode.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_APP_FCOE_MODE,
g_param_spec_string (NM_SETTING_DCB_APP_FCOE_MODE, "", "",
@@ -959,6 +996,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* may be any combination of %NM_SETTING_DCB_FLAG_ENABLE,
* %NM_SETTING_DCB_FLAG_ADVERTISE, and %NM_SETTING_DCB_FLAG_WILLING.
**/
+ /* ---ifcfg-rh---
+ * property: app-iscsi-flags
+ * variable: DCB_APP_ISCSI_ENABLE, DCB_APP_ISCSI_ADVERTISE, DCB_APP_ISCSI_WILLING
+ * default: no
+ * description: iSCSI flags.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_APP_ISCSI_FLAGS,
g_param_spec_flags (NM_SETTING_DCB_APP_ISCSI_FLAGS, "", "",
@@ -974,6 +1018,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* for default priority. Only used when the #NMSettingDcb:app-iscsi-flags
* property includes the %NM_SETTING_DCB_FLAG_ENABLE flag.
**/
+ /* ---ifcfg-rh---
+ * property: app-iscsi-priority
+ * variable: DCB_APP_ISCSI_PRIORITY
+ * values: 0 - 7
+ * description: Priority of iSCSI frames.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_APP_ISCSI_PRIORITY,
g_param_spec_int (NM_SETTING_DCB_APP_ISCSI_PRIORITY, "", "",
@@ -989,6 +1040,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* be any combination of %NM_SETTING_DCB_FLAG_ENABLE,
* %NM_SETTING_DCB_FLAG_ADVERTISE, and %NM_SETTING_DCB_FLAG_WILLING.
**/
+ /* ---ifcfg-rh---
+ * property: app-fip-flags
+ * variable: DCB_APP_FIP_ENABLE, DCB_APP_FIP_ADVERTISE, DCB_APP_FIP_WILLING
+ * default: no
+ * description: FIP flags.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_APP_FIP_FLAGS,
g_param_spec_flags (NM_SETTING_DCB_APP_FIP_FLAGS, "", "",
@@ -1004,6 +1062,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* default priority. Only used when the #NMSettingDcb:app-fip-flags
* property includes the %NM_SETTING_DCB_FLAG_ENABLE flag.
**/
+ /* ---ifcfg-rh---
+ * property: app-fip-priority
+ * variable: DCB_APP_FIP_PRIORITY
+ * values: 0 - 7
+ * description: Priority of FIP frames.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_APP_FIP_PRIORITY,
g_param_spec_int (NM_SETTING_DCB_APP_FIP_PRIORITY, "", "",
@@ -1019,6 +1084,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* Flags may be any combination of %NM_SETTING_DCB_FLAG_ENABLE,
* %NM_SETTING_DCB_FLAG_ADVERTISE, and %NM_SETTING_DCB_FLAG_WILLING.
**/
+ /* ---ifcfg-rh---
+ * property: priority-flow-control-flags
+ * variable: DCB_PFC_ENABLE, DCB_PFC_ADVERTISE, DCB_PFC_WILLING
+ * default: no
+ * description: Priority flow control flags.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PFC_FLAGS,
g_param_spec_flags (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS, "", "",
@@ -1036,6 +1108,14 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Element-type: gboolean
**/
+ /* ---ifcfg-rh---
+ * property: priority-flow-control
+ * variable: DCB_PFC_UP
+ * description: Priority flow control values. String of 8 "0" and "1", where "0".
+ * means "do not transmit priority pause", "1" means "transmit pause".
+ * example: DCB_PFC_UP=01101110
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PFC,
g_param_spec_boxed (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL, "", "",
@@ -1054,6 +1134,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
* any combination of %NM_SETTING_DCB_FLAG_ENABLE,
* %NM_SETTING_DCB_FLAG_ADVERTISE, and %NM_SETTING_DCB_FLAG_WILLING.
**/
+ /* ---ifcfg-rh---
+ * property: priority-group-flags
+ * variable: DCB_PG_ENABLE, DCB_PG_ADVERTISE, DCB_PG_WILLING
+ * default: no
+ * description: Priority groups flags.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIORITY_GROUP_FLAGS,
g_param_spec_flags (NM_SETTING_DCB_PRIORITY_GROUP_FLAGS, "", "",
@@ -1071,6 +1158,14 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Element-type: guint
**/
+ /* ---ifcfg-rh---
+ * property: priority-group-id
+ * variable: DCB_PG_ID
+ * description: Priority groups values. String of eight priorities (0 - 7) or "f"
+ * (unrestricted).
+ * example: DCB_PG_ID=1205f173
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIORITY_GROUP_ID,
g_param_spec_boxed (NM_SETTING_DCB_PRIORITY_GROUP_ID, "", "",
@@ -1092,6 +1187,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Element-type: guint
**/
+ /* ---ifcfg-rh---
+ * property: priority-group-bandwidth
+ * variable: DCB_PG_PCT
+ * description: Priority groups values. Eight bandwidths (in percent), separated with commas.
+ * example: DCB_PG_PCT=10,5,10,15,10,10,10,30
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIORITY_GROUP_BANDWIDTH,
g_param_spec_boxed (NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH, "", "",
@@ -1114,6 +1216,14 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Element-type: guint
**/
+ /* ---ifcfg-rh---
+ * property: priority-bandwidth
+ * variable: DCB_PG_UPPCT
+ * description: Priority values. Eight bandwidths (in percent), separated with commas.
+ * The sum of the numbers must be 100.
+ * example: DCB_PG_UPPCT=7,13,10,10,15,15,10,20
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIORITY_BANDWIDTH,
g_param_spec_boxed (NM_SETTING_DCB_PRIORITY_BANDWIDTH, "", "",
@@ -1134,6 +1244,14 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Element-type: gboolean
**/
+ /* ---ifcfg-rh---
+ * property: priority-strict-bandwidth
+ * variable: DCB_PG_STRICT
+ * description: Priority values. String of eight "0" or "1", where "0" means
+ * "may not utilize all bandwidth", "1" means "may utilize all bandwidth".
+ * example: DCB_PG_STRICT=01101110
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIORITY_STRICT,
g_param_spec_boxed (NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH, "", "",
@@ -1154,6 +1272,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Element-type: guint
**/
+ /* ---ifcfg-rh---
+ * property: priority-traffic-class
+ * variable: DCB_PG_UP2TC
+ * description: Priority values. String of eight trafic class values (0 - 7).
+ * example: DCB_PG_UP2TC=01623701
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PRIORITY_TRAFFIC_CLASS,
g_param_spec_boxed (NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS, "", "",
diff --git a/libnm-core/nm-setting-gsm.c b/libnm-core/nm-setting-gsm.c
index d537376db5..36557a256c 100644
--- a/libnm-core/nm-setting-gsm.c
+++ b/libnm-core/nm-setting-gsm.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-gsm.h"
#include "nm-utils.h"
@@ -283,15 +285,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- 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_USERNAME);
- return FALSE;
- }
-
if (priv->network_id) {
guint32 nid_len = strlen (priv->network_id);
guint32 i;
@@ -329,7 +322,7 @@ need_secrets (NMSetting *setting)
NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (priv->username) {
diff --git a/libnm-core/nm-setting-infiniband.c b/libnm-core/nm-setting-infiniband.c
index ed80a13609..b0afe04f11 100644
--- a/libnm-core/nm-setting-infiniband.c
+++ b/libnm-core/nm-setting-infiniband.c
@@ -19,8 +19,10 @@
* Copyright 2011 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-infiniband.h"
#include "nm-utils.h"
@@ -394,6 +396,21 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* permanent MAC address matches. This property does not change the MAC
* address of the device (i.e. MAC spoofing).
**/
+ /* ---keyfile---
+ * property: mac-address
+ * format: ususal hex-digits-and-colons notation
+ * description: MAC address in traditional hex-digits-and-colons notation, or
+ * or semicolon separated list of 20 decimal bytes (obsolete)
+ * example: mac-address= 80:00:00:6d:fe:80:00:00:00:00:00:00:00:02:55:00:70:33:cf:01
+ * ---end---
+ * ---ifcfg-rh---
+ * property: mac-address
+ * variable: HWADDR
+ * description: IBoIP 20-byte hardware address of the device (in traditional
+ * hex-digits-and-colons notation).
+ * example: HWADDR=01:02:03:04:05:06:07:08:09:0A:01:02:03:04:05:06:07:08:09:11
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
g_param_spec_string (NM_SETTING_INFINIBAND_MAC_ADDRESS, "", "",
@@ -412,6 +429,12 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* If non-zero, only transmit packets of the specified size or smaller,
* breaking larger packets up into multiple frames.
**/
+ /* ---ifcfg-rh---
+ * property: mtu
+ * variable: MTU
+ * description: MTU of the interface.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MTU,
g_param_spec_uint (NM_SETTING_INFINIBAND_MTU, "", "",
@@ -427,6 +450,14 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* The IP-over-InfiniBand transport mode. Either "datagram" or
* "connected".
**/
+ /* ---ifcfg-rh---
+ * property: transport-mode
+ * variable: CONNECTED_MODE
+ * default: CONNECTED_MODE=no
+ * description: CONNECTED_MODE=yes for "connected" mode, CONNECTED_MODE=no for
+ * "datagram" mode
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_TRANSPORT_MODE,
g_param_spec_string (NM_SETTING_INFINIBAND_TRANSPORT_MODE, "", "",
@@ -444,6 +475,16 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* unsigned integer, whose high bit is set if it is a "full membership"
* P_Key.
**/
+ /* ---ifcfg-rh---
+ * property: p-key
+ * variable: PKEY_ID (and PKEY=yes)
+ * default: PKEY=no
+ * description: InfiniBand P_Key. The value can be a hex number prefixed with "0x"
+ * or a decimal number.
+ * When PKEY_ID is specified, PHYSDEV and DEVICE also must be specified.
+ * example: PKEY=yes PKEY_ID=2 PHYSDEV=mlx4_ib0 DEVICE=mlx4_ib0.8002
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_P_KEY,
g_param_spec_int (NM_SETTING_INFINIBAND_P_KEY, "", "",
@@ -461,6 +502,14 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* specify the base device by setting either this property or
* #NMSettingInfiniband:mac-address.
**/
+ /* ---ifcfg-rh---
+ * property: parent
+ * variable: PHYSDEV (PKEY=yes)
+ * default: PKEY=no
+ * description: InfiniBand parent device.
+ * example: PHYSDEV=ib0
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PARENT,
g_param_spec_string (NM_SETTING_INFINIBAND_PARENT, "", "",
diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c
new file mode 100644
index 0000000000..e6f0401a01
--- /dev/null
+++ b/libnm-core/nm-setting-ip-config.c
@@ -0,0 +1,2363 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ * Copyright 2007 - 2014 Red Hat, Inc.
+ * Copyright 2007 - 2008 Novell, Inc.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <arpa/inet.h>
+#include <glib/gi18n-lib.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"
+
+/**
+ * SECTION:nm-setting-ip-config
+ * @short_description: Abstract base class for IPv4 and IPv6
+ * addressing, routing, and name service properties
+ * @include: nm-setting-ip-config.h
+ * @see_also: #NMSettingIP4Config, #NMSettingIP6Config
+ *
+ * #NMSettingIPConfig is the abstract base class of
+ * #NMSettingIP4Config and #NMSettingIP6Config, providing properties
+ * related to IP addressing, routing, and Domain Name Service.
+ **/
+
+static char *
+canonicalize_ip (int family, const char *ip, gboolean null_any)
+{
+ guint8 addr_bytes[sizeof (struct in6_addr)];
+ char addr_str[NM_UTILS_INET_ADDRSTRLEN];
+ int ret;
+
+ if (!ip) {
+ g_return_val_if_fail (null_any == TRUE, NULL);
+ return NULL;
+ }
+
+ ret = inet_pton (family, ip, addr_bytes);
+ g_return_val_if_fail (ret == 1, NULL);
+
+ if (null_any) {
+ int addrlen = (family == AF_INET ? sizeof (struct in_addr) : sizeof (struct in6_addr));
+
+ if (!memcmp (addr_bytes, &in6addr_any, addrlen))
+ return NULL;
+ }
+
+ return g_strdup (inet_ntop (family, addr_bytes, addr_str, sizeof (addr_str)));
+}
+
+static gboolean
+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"),
+ ip);
+ return FALSE;
+ } else
+ return TRUE;
+}
+
+static gboolean
+valid_prefix (int family, guint prefix, GError **error, gboolean allow_zero_prefix)
+{
+ if ( (family == AF_INET && prefix > 32)
+ || (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"),
+ prefix);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static gboolean
+valid_metric (gint64 metric, GError **error)
+{
+ if (metric < -1 || metric > G_MAXUINT32) {
+ if (error) {
+ char buf[64];
+
+ /* We can't concatenate G_GINT64_FORMAT into a translatable string */
+ g_snprintf (buf, sizeof (buf), "%" G_GINT64_FORMAT, metric);
+ g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_FAILED,
+ _("Invalid routing metric '%s'"), buf);
+ }
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+G_DEFINE_BOXED_TYPE (NMIPAddress, nm_ip_address, nm_ip_address_dup, nm_ip_address_unref)
+
+struct NMIPAddress {
+ guint refcount;
+
+ char *address;
+ int prefix, family;
+
+ GHashTable *attributes;
+};
+
+/**
+ * nm_ip_address_new:
+ * @family: the IP address family (<literal>AF_INET</literal> or
+ * <literal>AF_INET6</literal>)
+ * @addr: the IP address
+ * @prefix: the address prefix length
+ * @error: location to store error, or %NULL
+ *
+ * Creates a new #NMIPAddress object.
+ *
+ * Returns: (transfer full): the new #NMIPAddress object, or %NULL on error
+ **/
+NMIPAddress *
+nm_ip_address_new (int family,
+ const char *addr, guint prefix,
+ GError **error)
+{
+ NMIPAddress *address;
+
+ g_return_val_if_fail (family == AF_INET || family == AF_INET6, NULL);
+ g_return_val_if_fail (addr != NULL, NULL);
+
+ if (!valid_ip (family, addr, error))
+ return NULL;
+ if (!valid_prefix (family, prefix, error, FALSE))
+ return NULL;
+
+ address = g_slice_new0 (NMIPAddress);
+ address->refcount = 1;
+
+ address->family = family;
+ address->address = canonicalize_ip (family, addr, FALSE);
+ address->prefix = prefix;
+
+ return address;
+}
+
+/**
+ * nm_ip_address_new_binary:
+ * @family: the IP address family (<literal>AF_INET</literal> or
+ * <literal>AF_INET6</literal>)
+ * @addr: the IP address
+ * @prefix: the address prefix length
+ * @error: location to store error, or %NULL
+ *
+ * Creates a new #NMIPAddress object. @addr must point to a buffer of the
+ * correct size for @family.
+ *
+ * Returns: (transfer full): the new #NMIPAddress object, or %NULL on error
+ **/
+NMIPAddress *
+nm_ip_address_new_binary (int family,
+ gconstpointer addr, guint prefix,
+ GError **error)
+{
+ NMIPAddress *address;
+ char string[NM_UTILS_INET_ADDRSTRLEN];
+
+ g_return_val_if_fail (family == AF_INET || family == AF_INET6, NULL);
+ g_return_val_if_fail (addr != NULL, NULL);
+
+ if (!valid_prefix (family, prefix, error, FALSE))
+ return NULL;
+
+ address = g_slice_new0 (NMIPAddress);
+ address->refcount = 1;
+
+ address->family = family;
+ address->address = g_strdup (inet_ntop (family, addr, string, sizeof (string)));
+ address->prefix = prefix;
+
+ return address;
+}
+
+/**
+ * nm_ip_address_ref:
+ * @address: the #NMIPAddress
+ *
+ * Increases the reference count of the object.
+ **/
+void
+nm_ip_address_ref (NMIPAddress *address)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (address->refcount > 0);
+
+ address->refcount++;
+}
+
+/**
+ * nm_ip_address_unref:
+ * @address: the #NMIPAddress
+ *
+ * Decreases the reference count of the object. If the reference count
+ * reaches zero, the object will be destroyed.
+ **/
+void
+nm_ip_address_unref (NMIPAddress *address)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (address->refcount > 0);
+
+ address->refcount--;
+ if (address->refcount == 0) {
+ g_free (address->address);
+ if (address->attributes)
+ g_hash_table_unref (address->attributes);
+ g_slice_free (NMIPAddress, address);
+ }
+}
+
+/**
+ * nm_ip_address_equal:
+ * @address: the #NMIPAddress
+ * @other: the #NMIPAddress to compare @address to.
+ *
+ * Determines if two #NMIPAddress objects contain the same address and prefix
+ * (attributes are not compared).
+ *
+ * Returns: %TRUE if the objects contain the same values, %FALSE if they do not.
+ **/
+gboolean
+nm_ip_address_equal (NMIPAddress *address, NMIPAddress *other)
+{
+ g_return_val_if_fail (address != NULL, FALSE);
+ g_return_val_if_fail (address->refcount > 0, FALSE);
+
+ g_return_val_if_fail (other != NULL, FALSE);
+ g_return_val_if_fail (other->refcount > 0, FALSE);
+
+ if ( address->family != other->family
+ || address->prefix != other->prefix
+ || strcmp (address->address, other->address) != 0)
+ return FALSE;
+ return TRUE;
+}
+
+/**
+ * nm_ip_address_dup:
+ * @address: the #NMIPAddress
+ *
+ * Creates a copy of @address
+ *
+ * Returns: (transfer full): a copy of @address
+ **/
+NMIPAddress *
+nm_ip_address_dup (NMIPAddress *address)
+{
+ NMIPAddress *copy;
+
+ g_return_val_if_fail (address != NULL, NULL);
+ g_return_val_if_fail (address->refcount > 0, NULL);
+
+ copy = nm_ip_address_new (address->family,
+ address->address, address->prefix,
+ NULL);
+ if (address->attributes) {
+ GHashTableIter iter;
+ const char *key;
+ GVariant *value;
+
+ g_hash_table_iter_init (&iter, address->attributes);
+ while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value))
+ nm_ip_address_set_attribute (copy, key, value);
+ }
+
+ return copy;
+}
+
+/**
+ * nm_ip_address_get_family:
+ * @address: the #NMIPAddress
+ *
+ * Gets the IP address family (eg, AF_INET) property of this address
+ * object.
+ *
+ * Returns: the IP address family
+ **/
+int
+nm_ip_address_get_family (NMIPAddress *address)
+{
+ g_return_val_if_fail (address != NULL, 0);
+ g_return_val_if_fail (address->refcount > 0, 0);
+
+ return address->family;
+}
+
+/**
+ * nm_ip_address_get_address:
+ * @address: the #NMIPAddress
+ *
+ * Gets the IP address property of this address object.
+ *
+ * Returns: the IP address
+ **/
+const char *
+nm_ip_address_get_address (NMIPAddress *address)
+{
+ g_return_val_if_fail (address != NULL, NULL);
+ g_return_val_if_fail (address->refcount > 0, NULL);
+
+ return address->address;
+}
+
+/**
+ * nm_ip_address_set_address:
+ * @address: the #NMIPAddress
+ * @addr: the IP address, as a string
+ *
+ * Sets the IP address property of this address object.
+ *
+ * @addr must be a valid address of @address's family. If you aren't sure you
+ * have a valid address, use nm_utils_ipaddr_valid() to check it.
+ **/
+void
+nm_ip_address_set_address (NMIPAddress *address,
+ const char *addr)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (addr != NULL);
+ g_return_if_fail (nm_utils_ipaddr_valid (address->family, addr));
+
+ g_free (address->address);
+ address->address = canonicalize_ip (address->family, addr, FALSE);
+}
+
+/**
+ * nm_ip_address_get_address_binary: (skip)
+ * @address: the #NMIPAddress
+ * @addr: a buffer in which to store the address in binary format.
+ *
+ * Gets the IP address property of this address object.
+ *
+ * @addr must point to a buffer that is the correct size for @address's family.
+ **/
+void
+nm_ip_address_get_address_binary (NMIPAddress *address,
+ gpointer addr)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (addr != NULL);
+
+ inet_pton (address->family, address->address, addr);
+}
+
+/**
+ * nm_ip_address_set_address_binary: (skip)
+ * @address: the #NMIPAddress
+ * @addr: the address, in binary format
+ *
+ * Sets the IP address property of this address object.
+ *
+ * @addr must point to a buffer that is the correct size for @address's family.
+ **/
+void
+nm_ip_address_set_address_binary (NMIPAddress *address,
+ gconstpointer addr)
+{
+ char string[NM_UTILS_INET_ADDRSTRLEN];
+
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (addr != NULL);
+
+ g_free (address->address);
+ address->address = g_strdup (inet_ntop (address->family, addr, string, sizeof (string)));
+}
+
+/**
+ * nm_ip_address_get_prefix:
+ * @address: the #NMIPAddress
+ *
+ * Gets the IP address prefix (ie "24" or "30" etc) property of this address
+ * object.
+ *
+ * Returns: the IP address prefix
+ **/
+guint
+nm_ip_address_get_prefix (NMIPAddress *address)
+{
+ g_return_val_if_fail (address != NULL, 0);
+ g_return_val_if_fail (address->refcount > 0, 0);
+
+ return address->prefix;
+}
+
+/**
+ * nm_ip_address_set_prefix:
+ * @address: the #NMIPAddress
+ * @prefix: the IP address prefix
+ *
+ * Sets the IP address prefix property of this address object.
+ **/
+void
+nm_ip_address_set_prefix (NMIPAddress *address,
+ guint prefix)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (valid_prefix (address->family, prefix, NULL, FALSE));
+
+ address->prefix = prefix;
+}
+
+/**
+ * nm_ip_address_get_attribute_names:
+ * @address: the #NMIPAddress
+ *
+ * Gets an array of attribute names defined on @address.
+ *
+ * Returns: (transfer full): a %NULL-terminated array of attribute names,
+ **/
+char **
+nm_ip_address_get_attribute_names (NMIPAddress *address)
+{
+ GHashTableIter iter;
+ const char *key;
+ GPtrArray *names;
+
+ g_return_val_if_fail (address != NULL, NULL);
+
+ names = g_ptr_array_new ();
+
+ if (address->attributes) {
+ g_hash_table_iter_init (&iter, address->attributes);
+ 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_ip_address_get_attribute:
+ * @address: the #NMIPAddress
+ * @name: the name of an address attribute
+ *
+ * Gets the value of the attribute with name @name on @address
+ *
+ * Returns: (transfer none): the value of the attribute with name @name on
+ * @address, or %NULL if @address has no such attribute.
+ **/
+GVariant *
+nm_ip_address_get_attribute (NMIPAddress *address, const char *name)
+{
+ g_return_val_if_fail (address != NULL, NULL);
+ g_return_val_if_fail (name != NULL && *name != '\0', NULL);
+
+ if (address->attributes)
+ return g_hash_table_lookup (address->attributes, name);
+ else
+ return NULL;
+}
+
+/**
+ * nm_ip_address_set_attribute:
+ * @address: the #NMIPAddress
+ * @name: the name of an address attribute
+ * @value: (transfer none) (allow-none): the value
+ *
+ * Sets or clears the named attribute on @address to the given value.
+ **/
+void
+nm_ip_address_set_attribute (NMIPAddress *address, const char *name, GVariant *value)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (name != NULL && *name != '\0');
+ g_return_if_fail (strcmp (name, "address") != 0 && strcmp (name, "prefix") != 0);
+
+ if (!address->attributes) {
+ address->attributes = g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, (GDestroyNotify) g_variant_unref);
+ }
+
+ if (value)
+ g_hash_table_insert (address->attributes, g_strdup (name), g_variant_ref_sink (value));
+ else
+ g_hash_table_remove (address->attributes, name);
+}
+
+
+G_DEFINE_BOXED_TYPE (NMIPRoute, nm_ip_route, nm_ip_route_dup, nm_ip_route_unref)
+
+struct NMIPRoute {
+ guint refcount;
+
+ int family;
+ char *dest;
+ guint prefix;
+ char *next_hop;
+ gint64 metric;
+
+ GHashTable *attributes;
+};
+
+/**
+ * nm_ip_route_new:
+ * @family: the IP address family (<literal>AF_INET</literal> or
+ * <literal>AF_INET6</literal>)
+ * @dest: the IP address of the route's destination
+ * @prefix: the address prefix length
+ * @next_hop: (allow-none): the IP address of the next hop (or %NULL)
+ * @metric: the route metric (or -1 for "default")
+ * @error: location to store error, or %NULL
+ *
+ * Creates a new #NMIPRoute object.
+ *
+ * Returns: (transfer full): the new #NMIPRoute object, or %NULL on error
+ **/
+NMIPRoute *
+nm_ip_route_new (int family,
+ const char *dest,
+ guint prefix,
+ const char *next_hop,
+ gint64 metric,
+ GError **error)
+{
+ NMIPRoute *route;
+
+ g_return_val_if_fail (family == AF_INET || family == AF_INET6, NULL);
+
+ if (!valid_ip (family, dest, error))
+ return NULL;
+ if (!valid_prefix (family, prefix, error, TRUE))
+ return NULL;
+ if (next_hop && !valid_ip (family, next_hop, error))
+ return NULL;
+ if (!valid_metric (metric, error))
+ return NULL;
+
+ route = g_slice_new0 (NMIPRoute);
+ route->refcount = 1;
+
+ route->family = family;
+ route->dest = canonicalize_ip (family, dest, FALSE);
+ route->prefix = prefix;
+ route->next_hop = canonicalize_ip (family, next_hop, TRUE);
+ route->metric = metric;
+
+ return route;
+}
+
+/**
+ * nm_ip_route_new_binary:
+ * @family: the IP address family (<literal>AF_INET</literal> or
+ * <literal>AF_INET6</literal>)
+ * @dest: the IP address of the route's destination
+ * @prefix: the address prefix length
+ * @next_hop: (allow-none): the IP address of the next hop (or %NULL)
+ * @metric: the route metric (or -1 for "default")
+ * @error: location to store error, or %NULL
+ *
+ * Creates a new #NMIPRoute object. @dest and @next_hop (if non-%NULL) must
+ * point to buffers of the correct size for @family.
+ *
+ * Returns: (transfer full): the new #NMIPRoute object, or %NULL on error
+ **/
+NMIPRoute *
+nm_ip_route_new_binary (int family,
+ gconstpointer dest,
+ guint prefix,
+ gconstpointer next_hop,
+ gint64 metric,
+ GError **error)
+{
+ NMIPRoute *route;
+ char string[NM_UTILS_INET_ADDRSTRLEN];
+
+ g_return_val_if_fail (family == AF_INET || family == AF_INET6, NULL);
+
+ if (!valid_prefix (family, prefix, error, TRUE))
+ return NULL;
+ if (!valid_metric (metric, error))
+ return NULL;
+
+ route = g_slice_new0 (NMIPRoute);
+ route->refcount = 1;
+
+ route->family = family;
+ route->dest = g_strdup (inet_ntop (family, dest, string, sizeof (string)));
+ route->prefix = prefix;
+ if (next_hop)
+ route->next_hop = g_strdup (inet_ntop (family, next_hop, string, sizeof (string)));
+ route->metric = metric;
+
+ return route;
+}
+
+/**
+ * nm_ip_route_ref:
+ * @route: the #NMIPRoute
+ *
+ * Increases the reference count of the object.
+ **/
+void
+nm_ip_route_ref (NMIPRoute *route)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (route->refcount > 0);
+
+ route->refcount++;
+}
+
+/**
+ * nm_ip_route_unref:
+ * @route: the #NMIPRoute
+ *
+ * Decreases the reference count of the object. If the reference count
+ * reaches zero, the object will be destroyed.
+ **/
+void
+nm_ip_route_unref (NMIPRoute *route)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (route->refcount > 0);
+
+ route->refcount--;
+ if (route->refcount == 0) {
+ g_free (route->dest);
+ g_free (route->next_hop);
+ if (route->attributes)
+ g_hash_table_unref (route->attributes);
+ g_slice_free (NMIPRoute, route);
+ }
+}
+
+/**
+ * nm_ip_route_equal:
+ * @route: the #NMIPRoute
+ * @other: the #NMIPRoute to compare @route to.
+ *
+ * Determines if two #NMIPRoute objects contain the same destination, prefix,
+ * next hop, and metric. (Attributes are not compared.)
+ *
+ * Returns: %TRUE if the objects contain the same values, %FALSE if they do not.
+ **/
+gboolean
+nm_ip_route_equal (NMIPRoute *route, NMIPRoute *other)
+{
+ g_return_val_if_fail (route != NULL, FALSE);
+ g_return_val_if_fail (route->refcount > 0, FALSE);
+
+ g_return_val_if_fail (other != NULL, FALSE);
+ g_return_val_if_fail (other->refcount > 0, FALSE);
+
+ if ( route->prefix != other->prefix
+ || route->metric != other->metric
+ || strcmp (route->dest, other->dest) != 0
+ || g_strcmp0 (route->next_hop, other->next_hop) != 0)
+ return FALSE;
+ return TRUE;
+}
+
+/**
+ * nm_ip_route_dup:
+ * @route: the #NMIPRoute
+ *
+ * Creates a copy of @route
+ *
+ * Returns: (transfer full): a copy of @route
+ **/
+NMIPRoute *
+nm_ip_route_dup (NMIPRoute *route)
+{
+ NMIPRoute *copy;
+
+ g_return_val_if_fail (route != NULL, NULL);
+ g_return_val_if_fail (route->refcount > 0, NULL);
+
+ copy = nm_ip_route_new (route->family,
+ route->dest, route->prefix,
+ route->next_hop, route->metric,
+ NULL);
+ if (route->attributes) {
+ GHashTableIter iter;
+ const char *key;
+ GVariant *value;
+
+ g_hash_table_iter_init (&iter, route->attributes);
+ while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value))
+ nm_ip_route_set_attribute (copy, key, value);
+ }
+
+ return copy;
+}
+
+/**
+ * nm_ip_route_get_family:
+ * @route: the #NMIPRoute
+ *
+ * Gets the IP address family (eg, AF_INET) property of this route
+ * object.
+ *
+ * Returns: the IP address family
+ **/
+int
+nm_ip_route_get_family (NMIPRoute *route)
+{
+ g_return_val_if_fail (route != NULL, 0);
+ g_return_val_if_fail (route->refcount > 0, 0);
+
+ return route->family;
+}
+
+/**
+ * nm_ip_route_get_dest:
+ * @route: the #NMIPRoute
+ *
+ * Gets the IP destination address property of this route object.
+ *
+ * Returns: the IP address of the route's destination
+ **/
+const char *
+nm_ip_route_get_dest (NMIPRoute *route)
+{
+ g_return_val_if_fail (route != NULL, NULL);
+ g_return_val_if_fail (route->refcount > 0, NULL);
+
+ return route->dest;
+}
+
+/**
+ * nm_ip_route_set_dest:
+ * @route: the #NMIPRoute
+ * @dest: the route's destination, as a string
+ *
+ * Sets the destination property of this route object.
+ *
+ * @dest must be a valid address of @route's family. If you aren't sure you
+ * have a valid address, use nm_utils_ipaddr_valid() to check it.
+ **/
+void
+nm_ip_route_set_dest (NMIPRoute *route,
+ const char *dest)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (dest != NULL);
+ g_return_if_fail (nm_utils_ipaddr_valid (route->family, dest));
+
+ g_free (route->dest);
+ route->dest = canonicalize_ip (route->family, dest, FALSE);
+}
+
+/**
+ * nm_ip_route_get_dest_binary: (skip)
+ * @route: the #NMIPRoute
+ * @dest: a buffer in which to store the destination in binary format.
+ *
+ * Gets the destination property of this route object.
+ *
+ * @dest must point to a buffer that is the correct size for @route's family.
+ **/
+void
+nm_ip_route_get_dest_binary (NMIPRoute *route,
+ gpointer dest)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (dest != NULL);
+
+ inet_pton (route->family, route->dest, dest);
+}
+
+/**
+ * nm_ip_route_set_dest_binary: (skip)
+ * @route: the #NMIPRoute
+ * @dest: the route's destination, in binary format
+ *
+ * Sets the destination property of this route object.
+ *
+ * @dest must point to a buffer that is the correct size for @route's family.
+ **/
+void
+nm_ip_route_set_dest_binary (NMIPRoute *route,
+ gconstpointer dest)
+{
+ char string[NM_UTILS_INET_ADDRSTRLEN];
+
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (dest != NULL);
+
+ g_free (route->dest);
+ route->dest = g_strdup (inet_ntop (route->family, dest, string, sizeof (string)));
+}
+
+/**
+ * nm_ip_route_get_prefix:
+ * @route: the #NMIPRoute
+ *
+ * Gets the IP prefix (ie "24" or "30" etc) of this route.
+ *
+ * Returns: the IP prefix
+ **/
+guint
+nm_ip_route_get_prefix (NMIPRoute *route)
+{
+ g_return_val_if_fail (route != NULL, 0);
+ g_return_val_if_fail (route->refcount > 0, 0);
+
+ return route->prefix;
+}
+
+/**
+ * nm_ip_route_set_prefix:
+ * @route: the #NMIPRoute
+ * @prefix: the route prefix
+ *
+ * Sets the prefix property of this route object.
+ **/
+void
+nm_ip_route_set_prefix (NMIPRoute *route,
+ guint prefix)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (valid_prefix (route->family, prefix, NULL, TRUE));
+
+ route->prefix = prefix;
+}
+
+/**
+ * nm_ip_route_get_next_hop:
+ * @route: the #NMIPRoute
+ *
+ * Gets the IP address of the next hop of this route; this will be %NULL if the
+ * route has no next hop.
+ *
+ * Returns: the IP address of the next hop, or %NULL if this is a device route.
+ **/
+const char *
+nm_ip_route_get_next_hop (NMIPRoute *route)
+{
+ g_return_val_if_fail (route != NULL, NULL);
+ g_return_val_if_fail (route->refcount > 0, NULL);
+
+ return route->next_hop;
+}
+
+/**
+ * nm_ip_route_set_next_hop:
+ * @route: the #NMIPRoute
+ * @next_hop: (allow-none): the route's next hop, as a string
+ *
+ * Sets the next-hop property of this route object.
+ *
+ * @next_hop (if non-%NULL) must be a valid address of @route's family. If you
+ * aren't sure you have a valid address, use nm_utils_ipaddr_valid() to check
+ * it.
+ **/
+void
+nm_ip_route_set_next_hop (NMIPRoute *route,
+ const char *next_hop)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (!next_hop || nm_utils_ipaddr_valid (route->family, next_hop));
+
+ g_free (route->next_hop);
+ route->next_hop = canonicalize_ip (route->family, next_hop, TRUE);
+}
+
+/**
+ * nm_ip_route_get_next_hop_binary: (skip)
+ * @route: the #NMIPRoute
+ * @next_hop: a buffer in which to store the next hop in binary format.
+ *
+ * Gets the next hop property of this route object.
+ *
+ * @next_hop must point to a buffer that is the correct size for @route's family.
+ *
+ * Returns: %TRUE if @route has a next hop, %FALSE if not (in which case
+ * @next_hop will be zeroed out)
+ **/
+gboolean
+nm_ip_route_get_next_hop_binary (NMIPRoute *route,
+ gpointer next_hop)
+{
+ g_return_val_if_fail (route != NULL, FALSE);
+ g_return_val_if_fail (next_hop != NULL, FALSE);
+
+ if (route->next_hop) {
+ inet_pton (route->family, route->next_hop, next_hop);
+ return TRUE;
+ } else {
+ memset (next_hop, 0,
+ route->family == AF_INET ? sizeof (struct in_addr) : sizeof (struct in6_addr));
+ return FALSE;
+ }
+}
+
+/**
+ * nm_ip_route_set_next_hop_binary: (skip)
+ * @route: the #NMIPRoute
+ * @next_hop: the route's next hop, in binary format
+ *
+ * Sets the destination property of this route object.
+ *
+ * @next_hop (if non-%NULL) must point to a buffer that is the correct size for
+ * @route's family.
+ **/
+void
+nm_ip_route_set_next_hop_binary (NMIPRoute *route,
+ gconstpointer next_hop)
+{
+ char string[NM_UTILS_INET_ADDRSTRLEN];
+
+ g_return_if_fail (route != NULL);
+
+ g_free (route->next_hop);
+ if (next_hop)
+ route->next_hop = g_strdup (inet_ntop (route->family, next_hop, string, sizeof (string)));
+ else
+ route->next_hop = NULL;
+}
+
+/**
+ * nm_ip_route_get_metric:
+ * @route: the #NMIPRoute
+ *
+ * Gets the route metric property of this route object; lower values
+ * indicate "better" or more preferred routes; -1 indicates "default"
+ * (meaning NetworkManager will set it appropriately).
+ *
+ * Returns: the route metric
+ **/
+gint64
+nm_ip_route_get_metric (NMIPRoute *route)
+{
+ g_return_val_if_fail (route != NULL, 0);
+ g_return_val_if_fail (route->refcount > 0, 0);
+
+ return route->metric;
+}
+
+/**
+ * nm_ip_route_set_metric:
+ * @route: the #NMIPRoute
+ * @metric: the route metric (or -1 for "default")
+ *
+ * Sets the metric property of this route object.
+ **/
+void
+nm_ip_route_set_metric (NMIPRoute *route,
+ gint64 metric)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (valid_metric (metric, NULL));
+
+ route->metric = metric;
+}
+
+/**
+ * nm_ip_route_get_attribute_names:
+ * @route: the #NMIPRoute
+ *
+ * Gets an array of attribute names defined on @route.
+ *
+ * Returns: (transfer full): a %NULL-terminated array of attribute names
+ **/
+char **
+nm_ip_route_get_attribute_names (NMIPRoute *route)
+{
+ GHashTableIter iter;
+ const char *key;
+ GPtrArray *names;
+
+ g_return_val_if_fail (route != NULL, NULL);
+
+ names = g_ptr_array_new ();
+
+ if (route->attributes) {
+ g_hash_table_iter_init (&iter, route->attributes);
+ 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_ip_route_get_attribute:
+ * @route: the #NMIPRoute
+ * @name: the name of an route attribute
+ *
+ * Gets the value of the attribute with name @name on @route
+ *
+ * Returns: (transfer none): the value of the attribute with name @name on
+ * @route, or %NULL if @route has no such attribute.
+ **/
+GVariant *
+nm_ip_route_get_attribute (NMIPRoute *route, const char *name)
+{
+ g_return_val_if_fail (route != NULL, NULL);
+ g_return_val_if_fail (name != NULL && *name != '\0', NULL);
+
+ if (route->attributes)
+ return g_hash_table_lookup (route->attributes, name);
+ else
+ return NULL;
+}
+
+/**
+ * nm_ip_route_set_attribute:
+ * @route: the #NMIPRoute
+ * @name: the name of a route attribute
+ * @value: (transfer none) (allow-none): the value
+ *
+ * Sets the named attribute on @route to the given value.
+ **/
+void
+nm_ip_route_set_attribute (NMIPRoute *route, const char *name, GVariant *value)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (name != NULL && *name != '\0');
+ g_return_if_fail ( strcmp (name, "dest") != 0 && strcmp (name, "prefix") != 0
+ && strcmp (name, "next-hop") != 0 && strcmp (name, "metric") != 0);
+
+ if (!route->attributes) {
+ route->attributes = g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, (GDestroyNotify) g_variant_unref);
+ }
+
+ if (value)
+ g_hash_table_insert (route->attributes, g_strdup (name), g_variant_ref_sink (value));
+ else
+ g_hash_table_remove (route->attributes, name);
+}
+
+
+G_DEFINE_ABSTRACT_TYPE (NMSettingIPConfig, nm_setting_ip_config, NM_TYPE_SETTING)
+
+#define NM_SETTING_IP_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfigPrivate))
+
+typedef struct {
+ char *method;
+ GPtrArray *dns; /* array of IP address strings */
+ GPtrArray *dns_search; /* array of domain name strings */
+ GPtrArray *addresses; /* array of NMIPAddress */
+ GPtrArray *routes; /* array of NMIPRoute */
+ gint64 route_metric;
+ char *gateway;
+ gboolean ignore_auto_routes;
+ gboolean ignore_auto_dns;
+ char *dhcp_hostname;
+ gboolean dhcp_send_hostname;
+ gboolean never_default;
+ gboolean may_fail;
+} NMSettingIPConfigPrivate;
+
+enum {
+ PROP_0,
+ PROP_METHOD,
+ PROP_DNS,
+ PROP_DNS_SEARCH,
+ PROP_ADDRESSES,
+ PROP_GATEWAY,
+ PROP_ROUTES,
+ PROP_ROUTE_METRIC,
+ PROP_IGNORE_AUTO_ROUTES,
+ PROP_IGNORE_AUTO_DNS,
+ PROP_DHCP_HOSTNAME,
+ PROP_DHCP_SEND_HOSTNAME,
+ PROP_NEVER_DEFAULT,
+ PROP_MAY_FAIL,
+
+ LAST_PROP
+};
+
+#define NM_SETTING_IP_CONFIG_GET_FAMILY(setting) (NM_IS_SETTING_IP4_CONFIG (setting) ? AF_INET : AF_INET6)
+
+/**
+ * nm_setting_ip_config_get_method:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns: the #NMSettingIPConfig:method property of the setting; see
+ * #NMSettingIP4Config and #NMSettingIP6Config for details of the
+ * methods available with each type.
+ **/
+const char *
+nm_setting_ip_config_get_method (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), NULL);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->method;
+}
+
+/**
+ * nm_setting_ip_config_get_num_dns:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns: the number of configured DNS servers
+ **/
+guint
+nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), 0);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->dns->len;
+}
+
+/**
+ * nm_setting_ip_config_get_dns:
+ * @setting: the #NMSettingIPConfig
+ * @i: index number of the DNS server to return
+ *
+ * Returns: the IP address of the DNS server at index @i
+ **/
+const char *
+nm_setting_ip_config_get_dns (NMSettingIPConfig *setting, int i)
+{
+ 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);
+
+ return priv->dns->pdata[i];
+}
+
+/**
+ * nm_setting_ip_config_add_dns:
+ * @setting: the #NMSettingIPConfig
+ * @dns: the IP address of the DNS server to add
+ *
+ * Adds a new DNS server to the setting.
+ *
+ * Returns: %TRUE if the DNS server was added; %FALSE if the server was already
+ * known
+ **/
+gboolean
+nm_setting_ip_config_add_dns (NMSettingIPConfig *setting, const char *dns)
+{
+ NMSettingIPConfigPrivate *priv;
+ char *dns_canonical;
+ int i;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+ g_return_val_if_fail (dns != NULL, FALSE);
+ g_return_val_if_fail (nm_utils_ipaddr_valid (NM_SETTING_IP_CONFIG_GET_FAMILY (setting), dns), FALSE);
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+
+ dns_canonical = canonicalize_ip (NM_SETTING_IP_CONFIG_GET_FAMILY (setting), dns, FALSE);
+ for (i = 0; i < priv->dns->len; i++) {
+ if (!strcmp (dns_canonical, priv->dns->pdata[i])) {
+ g_free (dns_canonical);
+ return FALSE;
+ }
+ }
+
+ g_ptr_array_add (priv->dns, dns_canonical);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS);
+ return TRUE;
+}
+
+/**
+ * nm_setting_ip_config_remove_dns:
+ * @setting: the #NMSettingIPConfig
+ * @i: index number of the DNS server to remove
+ *
+ * Removes the DNS server at index @i.
+ **/
+void
+nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting, int i)
+{
+ 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_ptr_array_remove_index (priv->dns, i);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS);
+}
+
+/**
+ * nm_setting_ip_config_remove_dns_by_value:
+ * @setting: the #NMSettingIPConfig
+ * @dns: the DNS server to remove
+ *
+ * Removes the DNS server @dns.
+ *
+ * Returns: %TRUE if the DNS server was found and removed; %FALSE if it was not.
+ **/
+gboolean
+nm_setting_ip_config_remove_dns_by_value (NMSettingIPConfig *setting, const char *dns)
+{
+ NMSettingIPConfigPrivate *priv;
+ char *dns_canonical;
+ int i;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+ g_return_val_if_fail (dns != NULL, FALSE);
+ g_return_val_if_fail (nm_utils_ipaddr_valid (NM_SETTING_IP_CONFIG_GET_FAMILY (setting), dns), FALSE);
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+
+ dns_canonical = canonicalize_ip (NM_SETTING_IP_CONFIG_GET_FAMILY (setting), dns, FALSE);
+ for (i = 0; i < priv->dns->len; i++) {
+ if (!strcmp (dns_canonical, priv->dns->pdata[i])) {
+ g_ptr_array_remove_index (priv->dns, i);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS);
+ g_free (dns_canonical);
+ return TRUE;
+ }
+ }
+ g_free (dns_canonical);
+ return FALSE;
+}
+
+/**
+ * nm_setting_ip_config_clear_dns:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Removes all configured DNS servers.
+ **/
+void
+nm_setting_ip_config_clear_dns (NMSettingIPConfig *setting)
+{
+ NMSettingIPConfigPrivate *priv;
+
+ g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting));
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ g_ptr_array_set_size (priv->dns, 0);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS);
+}
+
+/**
+ * nm_setting_ip_config_get_num_dns_searches:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns: the number of configured DNS search domains
+ **/
+guint
+nm_setting_ip_config_get_num_dns_searches (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), 0);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->dns_search->len;
+}
+
+/**
+ * nm_setting_ip_config_get_dns_search:
+ * @setting: the #NMSettingIPConfig
+ * @i: index number of the DNS search domain to return
+ *
+ * Returns: the DNS search domain at index @i
+ **/
+const char *
+nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting, int i)
+{
+ 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);
+
+ return priv->dns_search->pdata[i];
+}
+
+/**
+ * nm_setting_ip_config_add_dns_search:
+ * @setting: the #NMSettingIPConfig
+ * @dns_search: the search domain to add
+ *
+ * Adds a new DNS search domain to the setting.
+ *
+ * Returns: %TRUE if the DNS search domain was added; %FALSE if the search
+ * domain was already known
+ **/
+gboolean
+nm_setting_ip_config_add_dns_search (NMSettingIPConfig *setting,
+ const char *dns_search)
+{
+ NMSettingIPConfigPrivate *priv;
+ int i;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+ g_return_val_if_fail (dns_search != NULL, FALSE);
+ g_return_val_if_fail (dns_search[0] != '\0', FALSE);
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ for (i = 0; i < priv->dns_search->len; i++) {
+ if (!strcmp (dns_search, priv->dns_search->pdata[i]))
+ return FALSE;
+ }
+
+ g_ptr_array_add (priv->dns_search, g_strdup (dns_search));
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_SEARCH);
+ return TRUE;
+}
+
+/**
+ * nm_setting_ip_config_remove_dns_search:
+ * @setting: the #NMSettingIPConfig
+ * @i: index number of the DNS search domain
+ *
+ * Removes the DNS search domain at index @i.
+ **/
+void
+nm_setting_ip_config_remove_dns_search (NMSettingIPConfig *setting, int i)
+{
+ 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_ptr_array_remove_index (priv->dns_search, i);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_SEARCH);
+}
+
+/**
+ * nm_setting_ip_config_remove_dns_search_by_value:
+ * @setting: the #NMSettingIPConfig
+ * @dns_search: the search domain to remove
+ *
+ * Removes the DNS search domain @dns_search.
+ *
+ * Returns: %TRUE if the DNS search domain was found and removed; %FALSE if it was not.
+ *
+ * Since 0.9.10
+ **/
+gboolean
+nm_setting_ip_config_remove_dns_search_by_value (NMSettingIPConfig *setting,
+ const char *dns_search)
+{
+ NMSettingIPConfigPrivate *priv;
+ int i;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+ g_return_val_if_fail (dns_search != NULL, FALSE);
+ g_return_val_if_fail (dns_search[0] != '\0', FALSE);
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ for (i = 0; i < priv->dns_search->len; i++) {
+ if (!strcmp (dns_search, priv->dns_search->pdata[i])) {
+ g_ptr_array_remove_index (priv->dns_search, i);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_SEARCH);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/**
+ * nm_setting_ip_config_clear_dns_searches:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Removes all configured DNS search domains.
+ **/
+void
+nm_setting_ip_config_clear_dns_searches (NMSettingIPConfig *setting)
+{
+ NMSettingIPConfigPrivate *priv;
+
+ g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting));
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ g_ptr_array_set_size (priv->dns_search, 0);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_SEARCH);
+}
+
+/**
+ * nm_setting_ip_config_get_num_addresses:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns: the number of configured addresses
+ **/
+guint
+nm_setting_ip_config_get_num_addresses (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), 0);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->addresses->len;
+}
+
+/**
+ * nm_setting_ip_config_get_address:
+ * @setting: the #NMSettingIPConfig
+ * @i: index number of the address to return
+ *
+ * Returns: the address at index @i
+ **/
+NMIPAddress *
+nm_setting_ip_config_get_address (NMSettingIPConfig *setting, int i)
+{
+ 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);
+
+ return priv->addresses->pdata[i];
+}
+
+/**
+ * nm_setting_ip_config_add_address:
+ * @setting: the #NMSettingIPConfig
+ * @address: the new address to add
+ *
+ * Adds a new IP address and associated information to the setting. The
+ * given address is duplicated internally and is not changed by this function.
+ *
+ * Returns: %TRUE if the address was added; %FALSE if the address was already
+ * known.
+ **/
+gboolean
+nm_setting_ip_config_add_address (NMSettingIPConfig *setting,
+ NMIPAddress *address)
+{
+ NMSettingIPConfigPrivate *priv;
+ int i;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+ g_return_val_if_fail (address != NULL, FALSE);
+ g_return_val_if_fail (address->family == NM_SETTING_IP_CONFIG_GET_FAMILY (setting), FALSE);
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ for (i = 0; i < priv->addresses->len; i++) {
+ if (nm_ip_address_equal (priv->addresses->pdata[i], address))
+ return FALSE;
+ }
+
+ g_ptr_array_add (priv->addresses, nm_ip_address_dup (address));
+
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ADDRESSES);
+ return TRUE;
+}
+
+/**
+ * nm_setting_ip_config_remove_address:
+ * @setting: the #NMSettingIPConfig
+ * @i: index number of the address to remove
+ *
+ * Removes the address at index @i.
+ **/
+void
+nm_setting_ip_config_remove_address (NMSettingIPConfig *setting, int i)
+{
+ 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_ptr_array_remove_index (priv->addresses, i);
+
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ADDRESSES);
+}
+
+/**
+ * nm_setting_ip_config_remove_address_by_value:
+ * @setting: the #NMSettingIPConfig
+ * @address: the IP address to remove
+ *
+ * Removes the address @address.
+ *
+ * Returns: %TRUE if the address was found and removed; %FALSE if it was not.
+ **/
+gboolean
+nm_setting_ip_config_remove_address_by_value (NMSettingIPConfig *setting,
+ NMIPAddress *address)
+{
+ NMSettingIPConfigPrivate *priv;
+ int i;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+ g_return_val_if_fail (address != NULL, FALSE);
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ for (i = 0; i < priv->addresses->len; i++) {
+ if (nm_ip_address_equal (priv->addresses->pdata[i], address)) {
+ g_ptr_array_remove_index (priv->addresses, i);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ADDRESSES);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/**
+ * nm_setting_ip_config_clear_addresses:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Removes all configured addresses.
+ **/
+void
+nm_setting_ip_config_clear_addresses (NMSettingIPConfig *setting)
+{
+ NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+
+ g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting));
+
+ g_ptr_array_set_size (priv->addresses, 0);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ADDRESSES);
+}
+
+/**
+ * nm_setting_ip_config_get_gateway:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns: the IP address of the gateway associated with this configuration, or
+ * %NULL.
+ **/
+const char *
+nm_setting_ip_config_get_gateway (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), NULL);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->gateway;
+}
+
+/**
+ * nm_setting_ip_config_get_num_routes:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns: the number of configured routes
+ **/
+guint
+nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), 0);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->routes->len;
+}
+
+/**
+ * nm_setting_ip_config_get_route:
+ * @setting: the #NMSettingIPConfig
+ * @i: index number of the route to return
+ *
+ * Returns: the route at index @i
+ **/
+NMIPRoute *
+nm_setting_ip_config_get_route (NMSettingIPConfig *setting, int i)
+{
+ 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);
+
+ return priv->routes->pdata[i];
+}
+
+/**
+ * nm_setting_ip_config_add_route:
+ * @setting: the #NMSettingIPConfig
+ * @route: the route to add
+ *
+ * Adds a new route and associated information to the setting. The
+ * given route is duplicated internally and is not changed by this function.
+ *
+ * Returns: %TRUE if the route was added; %FALSE if the route was already known.
+ **/
+gboolean
+nm_setting_ip_config_add_route (NMSettingIPConfig *setting,
+ NMIPRoute *route)
+{
+ NMSettingIPConfigPrivate *priv;
+ int i;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+ g_return_val_if_fail (route != NULL, FALSE);
+ g_return_val_if_fail (route->family == NM_SETTING_IP_CONFIG_GET_FAMILY (setting), FALSE);
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ for (i = 0; i < priv->routes->len; i++) {
+ if (nm_ip_route_equal (priv->routes->pdata[i], route))
+ return FALSE;
+ }
+
+ g_ptr_array_add (priv->routes, nm_ip_route_dup (route));
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ROUTES);
+ return TRUE;
+}
+
+/**
+ * nm_setting_ip_config_remove_route:
+ * @setting: the #NMSettingIPConfig
+ * @i: index number of the route
+ *
+ * Removes the route at index @i.
+ **/
+void
+nm_setting_ip_config_remove_route (NMSettingIPConfig *setting, int i)
+{
+ 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_ptr_array_remove_index (priv->routes, i);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ROUTES);
+}
+
+/**
+ * nm_setting_ip_config_remove_route_by_value:
+ * @setting: the #NMSettingIPConfig
+ * @route: the route to remove
+ *
+ * Removes the route @route.
+ *
+ * Returns: %TRUE if the route was found and removed; %FALSE if it was not.
+ **/
+gboolean
+nm_setting_ip_config_remove_route_by_value (NMSettingIPConfig *setting,
+ NMIPRoute *route)
+{
+ NMSettingIPConfigPrivate *priv;
+ int i;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+ g_return_val_if_fail (route != NULL, FALSE);
+
+ priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ for (i = 0; i < priv->routes->len; i++) {
+ if (nm_ip_route_equal (priv->routes->pdata[i], route)) {
+ g_ptr_array_remove_index (priv->routes, i);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ROUTES);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/**
+ * nm_setting_ip_config_clear_routes:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Removes all configured routes.
+ **/
+void
+nm_setting_ip_config_clear_routes (NMSettingIPConfig *setting)
+{
+ NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+
+ g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting));
+
+ g_ptr_array_set_size (priv->routes, 0);
+ g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ROUTES);
+}
+
+/**
+ * nm_setting_ip_config_get_route_metric:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns the value contained in the #NMSettingIPConfig:route-metric
+ * property.
+ *
+ * Returns: the route metric that is used for routes that don't explicitly
+ * specify a metric. See #NMSettingIPConfig:route-metric for more details.
+ **/
+gint64
+nm_setting_ip_config_get_route_metric (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), -1);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->route_metric;
+}
+
+
+/**
+ * nm_setting_ip_config_get_ignore_auto_routes:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns the value contained in the #NMSettingIPConfig:ignore-auto-routes
+ * property.
+ *
+ * Returns: %TRUE if automatically configured (ie via DHCP) routes should be
+ * ignored.
+ **/
+gboolean
+nm_setting_ip_config_get_ignore_auto_routes (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->ignore_auto_routes;
+}
+
+/**
+ * nm_setting_ip_config_get_ignore_auto_dns:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns the value contained in the #NMSettingIPConfig:ignore-auto-dns
+ * property.
+ *
+ * Returns: %TRUE if automatically configured (ie via DHCP) DNS information
+ * should be ignored.
+ **/
+gboolean
+nm_setting_ip_config_get_ignore_auto_dns (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->ignore_auto_dns;
+}
+
+/**
+ * nm_setting_ip_config_get_dhcp_hostname:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns the value contained in the #NMSettingIPConfig:dhcp-hostname
+ * property.
+ *
+ * Returns: the configured hostname to send to the DHCP server
+ **/
+const char *
+nm_setting_ip_config_get_dhcp_hostname (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), NULL);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->dhcp_hostname;
+}
+
+/**
+ * nm_setting_ip_config_get_dhcp_send_hostname:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns the value contained in the #NMSettingIPConfig:dhcp-send-hostname
+ * property.
+ *
+ * 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.
+ **/
+gboolean
+nm_setting_ip_config_get_dhcp_send_hostname (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->dhcp_send_hostname;
+}
+
+/**
+ * nm_setting_ip_config_get_never_default:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns the value contained in the #NMSettingIPConfig:never-default
+ * property.
+ *
+ * Returns: %TRUE if this connection should never be the default
+ * connection
+ **/
+gboolean
+nm_setting_ip_config_get_never_default (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->never_default;
+}
+
+/**
+ * nm_setting_ip_config_get_may_fail:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns the value contained in the #NMSettingIPConfig:may-fail
+ * property.
+ *
+ * Returns: %TRUE if this connection doesn't require this type of IP
+ * addressing to complete for the connection to succeed.
+ **/
+gboolean
+nm_setting_ip_config_get_may_fail (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->may_fail;
+}
+
+static gboolean
+verify_label (const char *label)
+{
+ const char *p;
+ char *iface;
+
+ p = strchr (label, ':');
+ if (!p)
+ return FALSE;
+ iface = g_strndup (label, p - label);
+ if (!nm_utils_iface_valid_name (iface)) {
+ g_free (iface);
+ return FALSE;
+ }
+ g_free (iface);
+
+ for (p++; *p; p++) {
+ if (!g_ascii_isalnum (*p) && *p != '_')
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static gboolean
+verify (NMSetting *setting, NMConnection *connection, GError **error)
+{
+ NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ int i;
+
+ if (!priv->method) {
+ g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_PROPERTY,
+ _("property is missing"));
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_METHOD);
+ return FALSE;
+ }
+
+ if (priv->dhcp_hostname && !*priv->dhcp_hostname) {
+ g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("property is empty"));
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_DHCP_HOSTNAME);
+ return FALSE;
+ }
+
+ /* Validate DNS */
+ for (i = 0; i < priv->dns->len; i++) {
+ const char *dns = priv->dns->pdata[i];
+
+ if (!nm_utils_ipaddr_valid (NM_SETTING_IP_CONFIG_GET_FAMILY (setting), dns)) {
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("%d. DNS server address is invalid"),
+ i+1);
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_DNS);
+ return FALSE;
+ }
+ }
+
+ /* Validate addresses */
+ for (i = 0; i < priv->addresses->len; i++) {
+ NMIPAddress *addr = (NMIPAddress *) priv->addresses->pdata[i];
+ GVariant *label;
+
+ if (nm_ip_address_get_family (addr) != NM_SETTING_IP_CONFIG_GET_FAMILY (setting)) {
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("%d. IP address is invalid"),
+ i+1);
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_ADDRESSES);
+ return FALSE;
+ }
+
+ label = nm_ip_address_get_attribute (addr, "label");
+ if (label) {
+ if (!g_variant_is_of_type (label, G_VARIANT_TYPE_STRING)) {
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("%d. IP address has 'label' property with invalid type"),
+ i+1);
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_ADDRESSES);
+ return FALSE;
+ }
+ if (!verify_label (g_variant_get_string (label, NULL))) {
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("%d. IP address has invalid label '%s'"),
+ i+1, g_variant_get_string (label, NULL));
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_ADDRESSES);
+ return FALSE;
+ }
+ }
+ }
+
+ /* Validate gateway */
+ if (priv->gateway) {
+ if (!priv->addresses->len) {
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("gateway cannot be set if there are no addresses configured"));
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_GATEWAY);
+ return FALSE;
+ }
+
+ if (!nm_utils_ipaddr_valid (NM_SETTING_IP_CONFIG_GET_FAMILY (setting), priv->gateway)) {
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("gateway is invalid"));
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_GATEWAY);
+ return FALSE;
+ }
+ }
+
+ /* Validate routes */
+ for (i = 0; i < priv->routes->len; i++) {
+ NMIPRoute *route = (NMIPRoute *) priv->routes->pdata[i];
+
+ if (nm_ip_route_get_family (route) != NM_SETTING_IP_CONFIG_GET_FAMILY (setting)) {
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("%d. route is invalid"),
+ i+1);
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_ROUTES);
+ return FALSE;
+ }
+ if (nm_ip_route_get_prefix (route) == 0) {
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("%d. route cannot be a default route"),
+ i+1);
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_ROUTES);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+
+static void
+nm_setting_ip_config_init (NMSettingIPConfig *setting)
+{
+ NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (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->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);
+}
+
+static void
+finalize (GObject *object)
+{
+ NMSettingIPConfig *self = NM_SETTING_IP_CONFIG (object);
+ NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (self);
+
+ g_free (priv->method);
+ g_free (priv->gateway);
+ g_free (priv->dhcp_hostname);
+
+ g_ptr_array_unref (priv->dns);
+ g_ptr_array_unref (priv->dns_search);
+ g_ptr_array_unref (priv->addresses);
+ g_ptr_array_unref (priv->routes);
+
+ G_OBJECT_CLASS (nm_setting_ip_config_parent_class)->finalize (object);
+}
+
+static void
+set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ NMSettingIPConfig *setting = NM_SETTING_IP_CONFIG (object);
+ NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+ const char *gateway;
+
+ switch (prop_id) {
+ case PROP_METHOD:
+ g_free (priv->method);
+ priv->method = g_value_dup_string (value);
+ break;
+ case PROP_DNS:
+ g_ptr_array_unref (priv->dns);
+ priv->dns = _nm_utils_strv_to_ptrarray (g_value_get_boxed (value));
+ break;
+ case PROP_DNS_SEARCH:
+ g_ptr_array_unref (priv->dns_search);
+ priv->dns_search = _nm_utils_strv_to_ptrarray (g_value_get_boxed (value));
+ break;
+ case PROP_ADDRESSES:
+ g_ptr_array_unref (priv->addresses);
+ priv->addresses = _nm_utils_copy_array (g_value_get_boxed (value),
+ (NMUtilsCopyFunc) nm_ip_address_dup,
+ (GDestroyNotify) nm_ip_address_unref);
+ break;
+ case PROP_GATEWAY:
+ gateway = g_value_get_string (value);
+ g_return_if_fail (!gateway || nm_utils_ipaddr_valid (NM_SETTING_IP_CONFIG_GET_FAMILY (setting), gateway));
+ g_free (priv->gateway);
+ priv->gateway = canonicalize_ip (NM_SETTING_IP_CONFIG_GET_FAMILY (setting), gateway, TRUE);
+ break;
+ case PROP_ROUTES:
+ g_ptr_array_unref (priv->routes);
+ priv->routes = _nm_utils_copy_array (g_value_get_boxed (value),
+ (NMUtilsCopyFunc) nm_ip_route_dup,
+ (GDestroyNotify) nm_ip_route_unref);
+ break;
+ case PROP_ROUTE_METRIC:
+ priv->route_metric = g_value_get_int64 (value);
+ break;
+ case PROP_IGNORE_AUTO_ROUTES:
+ priv->ignore_auto_routes = g_value_get_boolean (value);
+ break;
+ case PROP_IGNORE_AUTO_DNS:
+ priv->ignore_auto_dns = g_value_get_boolean (value);
+ break;
+ case PROP_DHCP_HOSTNAME:
+ g_free (priv->dhcp_hostname);
+ priv->dhcp_hostname = g_value_dup_string (value);
+ break;
+ case PROP_DHCP_SEND_HOSTNAME:
+ priv->dhcp_send_hostname = g_value_get_boolean (value);
+ break;
+ case PROP_NEVER_DEFAULT:
+ priv->never_default = g_value_get_boolean (value);
+ break;
+ case PROP_MAY_FAIL:
+ priv->may_fail = 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)
+{
+ NMSettingIPConfig *setting = NM_SETTING_IP_CONFIG (object);
+ NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
+
+ switch (prop_id) {
+ case PROP_METHOD:
+ g_value_set_string (value, nm_setting_ip_config_get_method (setting));
+ break;
+ case PROP_DNS:
+ g_value_take_boxed (value, _nm_utils_ptrarray_to_strv (priv->dns));
+ break;
+ case PROP_DNS_SEARCH:
+ g_value_take_boxed (value, _nm_utils_ptrarray_to_strv (priv->dns_search));
+ break;
+ case PROP_ADDRESSES:
+ g_value_take_boxed (value, _nm_utils_copy_array (priv->addresses,
+ (NMUtilsCopyFunc) nm_ip_address_dup,
+ (GDestroyNotify) nm_ip_address_unref));
+ break;
+ case PROP_GATEWAY:
+ g_value_set_string (value, nm_setting_ip_config_get_gateway (setting));
+ break;
+ case PROP_ROUTES:
+ g_value_take_boxed (value, _nm_utils_copy_array (priv->routes,
+ (NMUtilsCopyFunc) nm_ip_route_dup,
+ (GDestroyNotify) nm_ip_route_unref));
+ break;
+ case PROP_ROUTE_METRIC:
+ g_value_set_int64 (value, priv->route_metric);
+ break;
+ case PROP_IGNORE_AUTO_ROUTES:
+ g_value_set_boolean (value, nm_setting_ip_config_get_ignore_auto_routes (setting));
+ break;
+ case PROP_IGNORE_AUTO_DNS:
+ g_value_set_boolean (value, nm_setting_ip_config_get_ignore_auto_dns (setting));
+ break;
+ case PROP_DHCP_HOSTNAME:
+ g_value_set_string (value, nm_setting_ip_config_get_dhcp_hostname (setting));
+ break;
+ case PROP_DHCP_SEND_HOSTNAME:
+ g_value_set_boolean (value, nm_setting_ip_config_get_dhcp_send_hostname (setting));
+ break;
+ case PROP_NEVER_DEFAULT:
+ g_value_set_boolean (value, priv->never_default);
+ break;
+ case PROP_MAY_FAIL:
+ g_value_set_boolean (value, priv->may_fail);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+ip_gateway_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
+{
+ /* Don't set from 'gateway' if we're going to use the gateway in 'addresses' */
+ if (_nm_setting_use_legacy_property (setting, connection_dict, "addresses", "gateway"))
+ return;
+
+ g_object_set (setting, property, g_variant_get_string (value, NULL), NULL);
+}
+
+static void
+nm_setting_ip_config_class_init (NMSettingIPConfigClass *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 (NMSettingIPConfigPrivate));
+
+ /* virtual methods */
+ object_class->set_property = set_property;
+ object_class->get_property = get_property;
+ object_class->finalize = finalize;
+ parent_class->verify = verify;
+
+ /* Properties */
+
+ /**
+ * NMSettingIPConfig: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
+ * #NMSettingIPConfig:dns and #NMSettingIPConfig:routes specify information
+ * that is added on to the information returned from automatic
+ * configuration. The #NMSettingIPConfig:ignore-auto-routes and
+ * #NMSettingIPConfig: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.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_METHOD,
+ g_param_spec_string (NM_SETTING_IP_CONFIG_METHOD, "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ NM_SETTING_PARAM_INFERRABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:dns:
+ *
+ * Array of IP addresses of DNS servers.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_DNS,
+ g_param_spec_boxed (NM_SETTING_IP_CONFIG_DNS, "", "",
+ G_TYPE_STRV,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:dns-search:
+ *
+ * Array of DNS search domains.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_DNS_SEARCH,
+ g_param_spec_boxed (NM_SETTING_IP_CONFIG_DNS_SEARCH, "", "",
+ G_TYPE_STRV,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:addresses:
+ *
+ * Array of IP addresses.
+ *
+ * Element-Type: NMIPAddress
+ **/
+ g_object_class_install_property
+ (object_class, PROP_ADDRESSES,
+ g_param_spec_boxed (NM_SETTING_IP_CONFIG_ADDRESSES, "", "",
+ G_TYPE_PTR_ARRAY,
+ G_PARAM_READWRITE |
+ NM_SETTING_PARAM_INFERRABLE |
+ /* "addresses" is a legacy D-Bus property, because the
+ * "addresses" GObject property normally gets set from
+ * the "address-data" D-Bus property...
+ */
+ NM_SETTING_PARAM_LEGACY |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:gateway:
+ *
+ * The gateway associated with this configuration. This is only meaningful
+ * if #NMSettingIPConfig:addresses is also set.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_GATEWAY,
+ g_param_spec_string (NM_SETTING_IP_CONFIG_GATEWAY, "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ NM_SETTING_PARAM_INFERRABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ _nm_setting_class_override_property (parent_class,
+ NM_SETTING_IP_CONFIG_GATEWAY,
+ G_VARIANT_TYPE_STRING,
+ NULL,
+ ip_gateway_set,
+ NULL);
+
+ /**
+ * NMSettingIPConfig:routes:
+ *
+ * Array of IP routes.
+ *
+ * Element-Type: NMIPRoute
+ **/
+ g_object_class_install_property
+ (object_class, PROP_ROUTES,
+ g_param_spec_boxed (NM_SETTING_IP_CONFIG_ROUTES, "", "",
+ G_TYPE_PTR_ARRAY,
+ G_PARAM_READWRITE |
+ NM_SETTING_PARAM_INFERRABLE |
+ /* See :addresses above Re: LEGACY */
+ NM_SETTING_PARAM_LEGACY |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:route-metric:
+ *
+ * The 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.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_ROUTE_METRIC,
+ g_param_spec_int64 (NM_SETTING_IP_CONFIG_ROUTE_METRIC, "", "",
+ -1, G_MAXUINT32, -1,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:ignore-auto-routes:
+ *
+ * When #NMSettingIPConfig:method is set to "auto" and this property to
+ * %TRUE, automatically configured routes are ignored and only routes
+ * specified in the #NMSettingIPConfig:routes property, if any, are used.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_IGNORE_AUTO_ROUTES,
+ g_param_spec_boolean (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, "", "",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:ignore-auto-dns:
+ *
+ * When #NMSettingIPConfig: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
+ * #NMSettingIPConfig:dns and #NMSettingIPConfig:dns-search properties, if
+ * any, are used.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_IGNORE_AUTO_DNS,
+ g_param_spec_boolean (NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, "", "",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:dhcp-hostname:
+ *
+ * If the #NMSettingIPConfig:dhcp-send-hostname property is %TRUE, then the
+ * specified name will be sent to the DHCP server when acquiring a lease.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_DHCP_HOSTNAME,
+ g_param_spec_string (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ NM_SETTING_PARAM_INFERRABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig: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
+ * #NMSettingIPConfig:dhcp-hostname property is %NULL and this property is
+ * %TRUE, the current persistent hostname of the computer is sent.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_DHCP_SEND_HOSTNAME,
+ g_param_spec_boolean (NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, "", "",
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:never-default:
+ *
+ * If %TRUE, this connection will never be the default connection for this
+ * IP type, meaning it will never be assigned the default route by
+ * NetworkManager.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_NEVER_DEFAULT,
+ g_param_spec_boolean (NM_SETTING_IP_CONFIG_NEVER_DEFAULT, "", "",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig: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.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_MAY_FAIL,
+ g_param_spec_boolean (NM_SETTING_IP_CONFIG_MAY_FAIL, "", "",
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+}
diff --git a/libnm-core/nm-setting-ip-config.h b/libnm-core/nm-setting-ip-config.h
new file mode 100644
index 0000000000..12763fa857
--- /dev/null
+++ b/libnm-core/nm-setting-ip-config.h
@@ -0,0 +1,221 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ * Copyright 2007 - 2014 Red Hat, Inc.
+ * Copyright 2007 - 2008 Novell, Inc.
+ */
+
+#ifndef NM_SETTING_IP_CONFIG_H
+#define NM_SETTING_IP_CONFIG_H
+
+#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
+#error "Only <NetworkManager.h> can be included directly."
+#endif
+
+#include "nm-setting.h"
+
+G_BEGIN_DECLS
+
+typedef struct NMIPAddress NMIPAddress;
+
+GType nm_ip_address_get_type (void);
+
+NMIPAddress *nm_ip_address_new (int family,
+ const char *addr,
+ guint prefix,
+ GError **error);
+NMIPAddress *nm_ip_address_new_binary (int family,
+ gconstpointer addr,
+ guint prefix,
+ GError **error);
+
+void nm_ip_address_ref (NMIPAddress *address);
+void nm_ip_address_unref (NMIPAddress *address);
+gboolean nm_ip_address_equal (NMIPAddress *address,
+ NMIPAddress *other);
+NMIPAddress *nm_ip_address_dup (NMIPAddress *address);
+
+int nm_ip_address_get_family (NMIPAddress *address);
+const char *nm_ip_address_get_address (NMIPAddress *address);
+void nm_ip_address_set_address (NMIPAddress *address,
+ const char *addr);
+void nm_ip_address_get_address_binary (NMIPAddress *address,
+ gpointer addr);
+void nm_ip_address_set_address_binary (NMIPAddress *address,
+ gconstpointer addr);
+guint nm_ip_address_get_prefix (NMIPAddress *address);
+void nm_ip_address_set_prefix (NMIPAddress *address,
+ guint prefix);
+
+char **nm_ip_address_get_attribute_names (NMIPAddress *address);
+GVariant *nm_ip_address_get_attribute (NMIPAddress *address,
+ const char *name);
+void nm_ip_address_set_attribute (NMIPAddress *address,
+ const char *name,
+ GVariant *value);
+
+
+typedef struct NMIPRoute NMIPRoute;
+
+GType nm_ip_route_get_type (void);
+
+NMIPRoute *nm_ip_route_new (int family,
+ const char *dest,
+ guint prefix,
+ const char *next_hop,
+ gint64 metric,
+ GError **error);
+NMIPRoute *nm_ip_route_new_binary (int family,
+ gconstpointer dest,
+ guint prefix,
+ gconstpointer next_hop,
+ gint64 metric,
+ GError **error);
+
+void nm_ip_route_ref (NMIPRoute *route);
+void nm_ip_route_unref (NMIPRoute *route);
+gboolean nm_ip_route_equal (NMIPRoute *route,
+ NMIPRoute *other);
+NMIPRoute *nm_ip_route_dup (NMIPRoute *route);
+
+int nm_ip_route_get_family (NMIPRoute *route);
+const char *nm_ip_route_get_dest (NMIPRoute *route);
+void nm_ip_route_set_dest (NMIPRoute *route,
+ const char *dest);
+void nm_ip_route_get_dest_binary (NMIPRoute *route,
+ gpointer dest);
+void nm_ip_route_set_dest_binary (NMIPRoute *route,
+ gconstpointer dest);
+guint nm_ip_route_get_prefix (NMIPRoute *route);
+void nm_ip_route_set_prefix (NMIPRoute *route,
+ guint prefix);
+const char *nm_ip_route_get_next_hop (NMIPRoute *route);
+void nm_ip_route_set_next_hop (NMIPRoute *route,
+ const char *next_hop);
+gboolean nm_ip_route_get_next_hop_binary (NMIPRoute *route,
+ gpointer next_hop);
+void nm_ip_route_set_next_hop_binary (NMIPRoute *route,
+ gconstpointer next_hop);
+gint64 nm_ip_route_get_metric (NMIPRoute *route);
+void nm_ip_route_set_metric (NMIPRoute *route,
+ gint64 metric);
+
+char **nm_ip_route_get_attribute_names (NMIPRoute *route);
+GVariant *nm_ip_route_get_attribute (NMIPRoute *route,
+ const char *name);
+void nm_ip_route_set_attribute (NMIPRoute *route,
+ const char *name,
+ GVariant *value);
+
+
+#define NM_TYPE_SETTING_IP_CONFIG (nm_setting_ip_config_get_type ())
+#define NM_SETTING_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfig))
+#define NM_SETTING_IP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_IPCONFIG, NMSettingIPConfigClass))
+#define NM_IS_SETTING_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_IP_CONFIG))
+#define NM_IS_SETTING_IP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_IP_CONFIG))
+#define NM_SETTING_IP_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfigClass))
+
+#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_ADDRESSES "addresses"
+#define NM_SETTING_IP_CONFIG_GATEWAY "gateway"
+#define NM_SETTING_IP_CONFIG_ROUTES "routes"
+#define NM_SETTING_IP_CONFIG_ROUTE_METRIC "route-metric"
+#define NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
+#define NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
+#define NM_SETTING_IP_CONFIG_DHCP_HOSTNAME "dhcp-hostname"
+#define NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname"
+#define NM_SETTING_IP_CONFIG_NEVER_DEFAULT "never-default"
+#define NM_SETTING_IP_CONFIG_MAY_FAIL "may-fail"
+
+struct _NMSettingIPConfig {
+ NMSetting parent;
+};
+
+typedef struct {
+ NMSettingClass parent;
+
+ /* Padding for future expansion */
+ gpointer padding[8];
+} NMSettingIPConfigClass;
+
+GType nm_setting_ip_config_get_type (void);
+
+const char *nm_setting_ip_config_get_method (NMSettingIPConfig *setting);
+
+guint nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting);
+const char *nm_setting_ip_config_get_dns (NMSettingIPConfig *setting,
+ int i);
+gboolean nm_setting_ip_config_add_dns (NMSettingIPConfig *setting,
+ const char *dns);
+void nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting,
+ int i);
+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);
+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);
+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_addresses (NMSettingIPConfig *setting);
+NMIPAddress *nm_setting_ip_config_get_address (NMSettingIPConfig *setting,
+ int i);
+gboolean nm_setting_ip_config_add_address (NMSettingIPConfig *setting,
+ NMIPAddress *address);
+void nm_setting_ip_config_remove_address (NMSettingIPConfig *setting,
+ int i);
+gboolean nm_setting_ip_config_remove_address_by_value (NMSettingIPConfig *setting,
+ NMIPAddress *address);
+void nm_setting_ip_config_clear_addresses (NMSettingIPConfig *setting);
+
+const char *nm_setting_ip_config_get_gateway (NMSettingIPConfig *setting);
+
+guint nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting);
+NMIPRoute *nm_setting_ip_config_get_route (NMSettingIPConfig *setting,
+ int i);
+gboolean nm_setting_ip_config_add_route (NMSettingIPConfig *setting,
+ NMIPRoute *route);
+void nm_setting_ip_config_remove_route (NMSettingIPConfig *setting,
+ int i);
+gboolean nm_setting_ip_config_remove_route_by_value (NMSettingIPConfig *setting,
+ NMIPRoute *route);
+void nm_setting_ip_config_clear_routes (NMSettingIPConfig *setting);
+
+gint64 nm_setting_ip_config_get_route_metric (NMSettingIPConfig *setting);
+
+gboolean nm_setting_ip_config_get_ignore_auto_routes (NMSettingIPConfig *setting);
+gboolean nm_setting_ip_config_get_ignore_auto_dns (NMSettingIPConfig *setting);
+
+const char *nm_setting_ip_config_get_dhcp_hostname (NMSettingIPConfig *setting);
+gboolean nm_setting_ip_config_get_dhcp_send_hostname (NMSettingIPConfig *setting);
+
+gboolean nm_setting_ip_config_get_never_default (NMSettingIPConfig *setting);
+gboolean nm_setting_ip_config_get_may_fail (NMSettingIPConfig *setting);
+
+G_END_DECLS
+
+#endif /* NM_SETTING_IP_CONFIG_H */
diff --git a/libnm-core/nm-setting-ip4-config.c b/libnm-core/nm-setting-ip4-config.c
index 00f2df502e..81cc1f8889 100644
--- a/libnm-core/nm-setting-ip4-config.c
+++ b/libnm-core/nm-setting-ip4-config.c
@@ -16,69 +16,54 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2007 - 2014 Red Hat, Inc.
- * Copyright 2007 - 2008 Novell, Inc.
+ * Copyright 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
-#include <arpa/inet.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip4-config.h"
-#include "nm-utils.h"
-#include "nm-glib-compat.h"
#include "nm-setting-private.h"
-#include "nm-core-internal.h"
-#include "nm-utils-private.h"
/**
* SECTION:nm-setting-ip4-config
* @short_description: Describes IPv4 addressing, routing, and name service properties
*
* The #NMSettingIP4Config object is a #NMSetting subclass that describes
- * properties related to IPv4 addressing, routing, and Domain Name Service
- **/
-
-G_DEFINE_BOXED_TYPE (NMIP4Address, nm_ip4_address, nm_ip4_address_dup, nm_ip4_address_unref)
-G_DEFINE_BOXED_TYPE (NMIP4Route, nm_ip4_route, nm_ip4_route_dup, nm_ip4_route_unref)
-
-G_DEFINE_TYPE_WITH_CODE (NMSettingIP4Config, nm_setting_ip4_config, NM_TYPE_SETTING,
+ * properties related to IPv4 addressing, routing, and Domain Name Service.
+ *
+ * #NMSettingIP4Config has few properties or methods of its own; it inherits
+ * almost everything from #NMSettingIPConfig.
+ *
+ * NetworkManager supports 5 values for the #NMSettingIPConfig:method property
+ * for IPv4. If "auto" is specified then the appropriate automatic method
+ * (DHCP, PPP, etc) is used for the interface and most other properties can be
+ * left unset. If "link-local" is specified, then a link-local address in the
+ * 169.254/16 range will be assigned to the interface. If "manual" is
+ * specified, static IP addressing is used and at least one IP address must be
+ * given in the "addresses" property. If "shared" is specified (indicating that
+ * this connection will provide network access to other computers) then the
+ * interface is assigned an address in the 10.42.x.1/24 range and a DHCP and
+ * forwarding DNS server are started, and the interface is NAT-ed to the current
+ * default network connection. "disabled" means IPv4 will not be used on this
+ * connection.
+ **/
+
+G_DEFINE_TYPE_WITH_CODE (NMSettingIP4Config, nm_setting_ip4_config, NM_TYPE_SETTING_IP_CONFIG,
_nm_register_setting (IP4_CONFIG, 4))
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP4_CONFIG)
#define NM_SETTING_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigPrivate))
typedef struct {
- char *method;
- GSList *dns; /* list of IP address strings */
- GSList *dns_search; /* list of strings */
- GSList *addresses; /* array of NMIP4Address */
- GSList *address_labels; /* list of strings */
- GSList *routes; /* array of NMIP4Route */
- gboolean ignore_auto_routes;
- gboolean ignore_auto_dns;
char *dhcp_client_id;
- gboolean dhcp_send_hostname;
- char *dhcp_hostname;
- gboolean never_default;
- gboolean may_fail;
} NMSettingIP4ConfigPrivate;
enum {
PROP_0,
- PROP_METHOD,
- PROP_DNS,
- PROP_DNS_SEARCH,
- PROP_ADDRESSES,
- PROP_ADDRESS_LABELS,
- PROP_ROUTES,
- PROP_IGNORE_AUTO_ROUTES,
- PROP_IGNORE_AUTO_DNS,
PROP_DHCP_CLIENT_ID,
- PROP_DHCP_SEND_HOSTNAME,
- PROP_DHCP_HOSTNAME,
- PROP_NEVER_DEFAULT,
- PROP_MAY_FAIL,
LAST_PROP
};
@@ -97,660 +82,6 @@ nm_setting_ip4_config_new (void)
}
/**
- * nm_setting_ip4_config_get_method:
- * @setting: the #NMSettingIP4Config
- *
- * Returns: the #NMSettingIP4Config:method property of the setting
- **/
-const char *
-nm_setting_ip4_config_get_method (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL);
-
- return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->method;
-}
-
-/**
- * nm_setting_ip4_config_get_num_dns:
- * @setting: the #NMSettingIP4Config
- *
- * Returns: the number of configured DNS servers
- **/
-guint32
-nm_setting_ip4_config_get_num_dns (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), 0);
-
- return g_slist_length (NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns);
-}
-
-/**
- * nm_setting_ip4_config_get_dns:
- * @setting: the #NMSettingIP4Config
- * @i: index number of the DNS server to return
- *
- * Returns: the IPv4 address of the DNS server at index @i
- **/
-const char *
-nm_setting_ip4_config_get_dns (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->dns), NULL);
-
- return (const char *) g_slist_nth_data (priv->dns, i);
-}
-
-static const char *
-canonicalize_ip (const char *ip)
-{
- in_addr_t addr;
- int ret;
-
- ret = inet_pton (AF_INET, ip, &addr);
- g_return_val_if_fail (ret == 1, NULL);
- return nm_utils_inet4_ntop (addr, NULL);
-}
-
-/**
- * nm_setting_ip4_config_add_dns:
- * @setting: the #NMSettingIP4Config
- * @dns: the IPv4 address of the DNS server to add
- *
- * Adds a new DNS server to the setting.
- *
- * Returns: %TRUE if the DNS server was added; %FALSE if the server was already
- * known
- **/
-gboolean
-nm_setting_ip4_config_add_dns (NMSettingIP4Config *setting, const char *dns)
-{
- NMSettingIP4ConfigPrivate *priv;
- const char *dns_canonical;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- g_return_val_if_fail (dns != NULL, FALSE);
- g_return_val_if_fail (dns[0] != '\0', FALSE);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
-
- dns_canonical = canonicalize_ip (dns);
- g_return_val_if_fail (dns_canonical != NULL, FALSE);
-
- for (iter = priv->dns; iter; iter = g_slist_next (iter)) {
- if (!strcmp (dns_canonical, (char *) iter->data))
- return FALSE;
- }
-
- priv->dns = g_slist_append (priv->dns, g_strdup (dns_canonical));
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS);
- return TRUE;
-}
-
-/**
- * nm_setting_ip4_config_remove_dns:
- * @setting: the #NMSettingIP4Config
- * @i: index number of the DNS server to remove
- *
- * Removes the DNS server at index @i.
- **/
-void
-nm_setting_ip4_config_remove_dns (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
- GSList *elt;
-
- g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- elt = g_slist_nth (priv->dns, i);
- g_return_if_fail (elt != NULL);
-
- g_free (elt->data);
- priv->dns = g_slist_delete_link (priv->dns, elt);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS);
-}
-
-/**
- * nm_setting_ip4_config_remove_dns_by_value:
- * @setting: the #NMSettingIP4Config
- * @dns: the DNS server to remove
- *
- * Removes the DNS server @dns.
- *
- * Returns: %TRUE if the DNS server was found and removed; %FALSE if it was not.
- **/
-gboolean
-nm_setting_ip4_config_remove_dns_by_value (NMSettingIP4Config *setting, const char *dns)
-{
- NMSettingIP4ConfigPrivate *priv;
- const char *dns_canonical;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- g_return_val_if_fail (dns != NULL, FALSE);
- g_return_val_if_fail (dns[0] != '\0', FALSE);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
-
- dns_canonical = canonicalize_ip (dns);
- g_return_val_if_fail (dns_canonical != NULL, FALSE);
-
- for (iter = priv->dns; iter; iter = g_slist_next (iter)) {
- if (!strcmp (dns_canonical, (char *) iter->data)) {
- priv->dns = g_slist_delete_link (priv->dns, iter);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/**
- * nm_setting_ip4_config_clear_dns:
- * @setting: the #NMSettingIP4Config
- *
- * Removes all configured DNS servers.
- **/
-void
-nm_setting_ip4_config_clear_dns (NMSettingIP4Config *setting)
-{
- g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
-
- g_slist_free_full (NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns, g_free);
- NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns = NULL;
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS);
-}
-
-/**
- * nm_setting_ip4_config_get_num_dns_searches:
- * @setting: the #NMSettingIP4Config
- *
- * Returns: the number of configured DNS search domains
- **/
-guint32
-nm_setting_ip4_config_get_num_dns_searches (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), 0);
-
- return g_slist_length (NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns_search);
-}
-
-/**
- * nm_setting_ip4_config_get_dns_search:
- * @setting: the #NMSettingIP4Config
- * @i: index number of the DNS search domain to return
- *
- * Returns: the DNS search domain at index @i
- **/
-const char *
-nm_setting_ip4_config_get_dns_search (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->dns_search), NULL);
-
- return (const char *) g_slist_nth_data (priv->dns_search, i);
-}
-
-/**
- * nm_setting_ip4_config_add_dns_search:
- * @setting: the #NMSettingIP4Config
- * @dns_search: the search domain to add
- *
- * Adds a new DNS search domain to the setting.
- *
- * Returns: %TRUE if the DNS search domain was added; %FALSE if the search
- * domain was already known
- **/
-gboolean
-nm_setting_ip4_config_add_dns_search (NMSettingIP4Config *setting,
- const char *dns_search)
-{
- NMSettingIP4ConfigPrivate *priv;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- g_return_val_if_fail (dns_search != NULL, FALSE);
- g_return_val_if_fail (dns_search[0] != '\0', FALSE);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->dns_search; iter; iter = g_slist_next (iter)) {
- if (!strcmp (dns_search, (char *) iter->data))
- return FALSE;
- }
-
- priv->dns_search = g_slist_append (priv->dns_search, g_strdup (dns_search));
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS_SEARCH);
- return TRUE;
-}
-
-/**
- * nm_setting_ip4_config_remove_dns_search:
- * @setting: the #NMSettingIP4Config
- * @i: index number of the DNS search domain
- *
- * Removes the DNS search domain at index @i.
- **/
-void
-nm_setting_ip4_config_remove_dns_search (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
- GSList *elt;
-
- g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- elt = g_slist_nth (priv->dns_search, i);
- g_return_if_fail (elt != NULL);
-
- g_free (elt->data);
- priv->dns_search = g_slist_delete_link (priv->dns_search, elt);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS_SEARCH);
-}
-
-/**
- * nm_setting_ip4_config_remove_dns_search_by_value:
- * @setting: the #NMSettingIP4Config
- * @dns_search: the search domain to remove
- *
- * Removes the DNS search domain @dns_search.
- *
- * Returns: %TRUE if the DNS search domain was found and removed; %FALSE if it was not.
- **/
-gboolean
-nm_setting_ip4_config_remove_dns_search_by_value (NMSettingIP4Config *setting,
- const char *dns_search)
-{
- NMSettingIP4ConfigPrivate *priv;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- g_return_val_if_fail (dns_search != NULL, FALSE);
- g_return_val_if_fail (dns_search[0] != '\0', FALSE);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->dns_search; iter; iter = g_slist_next (iter)) {
- if (!strcmp (dns_search, (char *) iter->data)) {
- priv->dns_search = g_slist_delete_link (priv->dns_search, iter);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS_SEARCH);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/**
- * nm_setting_ip4_config_clear_dns_searches:
- * @setting: the #NMSettingIP4Config
- *
- * Removes all configured DNS search domains.
- **/
-void
-nm_setting_ip4_config_clear_dns_searches (NMSettingIP4Config *setting)
-{
- g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
-
- g_slist_free_full (NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns_search, g_free);
- NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns_search = NULL;
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS_SEARCH);
-}
-
-/**
- * nm_setting_ip4_config_get_num_addresses:
- * @setting: the #NMSettingIP4Config
- *
- * Returns: the number of configured addresses
- **/
-guint32
-nm_setting_ip4_config_get_num_addresses (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), 0);
-
- return g_slist_length (NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->addresses);
-}
-
-/**
- * nm_setting_ip4_config_get_address:
- * @setting: the #NMSettingIP4Config
- * @i: index number of the address to return
- *
- * Returns: the address at index @i
- **/
-NMIP4Address *
-nm_setting_ip4_config_get_address (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->addresses), NULL);
-
- return (NMIP4Address *) g_slist_nth_data (priv->addresses, i);
-}
-
-const char *
-_nm_setting_ip4_config_get_address_label (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->address_labels), NULL);
-
- return (const char *) g_slist_nth_data (priv->address_labels, i);
-}
-
-/**
- * nm_setting_ip4_config_add_address:
- * @setting: the #NMSettingIP4Config
- * @address: the new address to add
- *
- * Adds a new IPv4 address and associated information to the setting. The
- * given address is duplicated internally and is not changed by this function.
- *
- * Returns: %TRUE if the address was added; %FALSE if the address was already
- * known.
- **/
-gboolean
-nm_setting_ip4_config_add_address (NMSettingIP4Config *setting,
- NMIP4Address *address)
-{
- return _nm_setting_ip4_config_add_address_with_label (setting, address, "");
-}
-
-gboolean
-_nm_setting_ip4_config_add_address_with_label (NMSettingIP4Config *setting,
- NMIP4Address *address,
- const char *label)
-{
- NMSettingIP4ConfigPrivate *priv;
- NMIP4Address *copy;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- g_return_val_if_fail (address != NULL, FALSE);
- g_return_val_if_fail (label != NULL, FALSE);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->addresses; iter; iter = g_slist_next (iter)) {
- if (nm_ip4_address_compare ((NMIP4Address *) iter->data, address))
- return FALSE;
- }
-
- copy = nm_ip4_address_dup (address);
- priv->addresses = g_slist_append (priv->addresses, copy);
- priv->address_labels = g_slist_append (priv->address_labels, g_strdup (label));
-
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES);
- return TRUE;
-}
-
-/**
- * nm_setting_ip4_config_remove_address:
- * @setting: the #NMSettingIP4Config
- * @i: index number of the address to remove
- *
- * Removes the address at index @i.
- **/
-void
-nm_setting_ip4_config_remove_address (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
- GSList *addr, *label;
-
- g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- addr = g_slist_nth (priv->addresses, i);
- label = g_slist_nth (priv->address_labels, i);
- g_return_if_fail (addr != NULL && label != NULL);
-
- nm_ip4_address_unref ((NMIP4Address *) addr->data);
- priv->addresses = g_slist_delete_link (priv->addresses, addr);
- g_free (label->data);
- priv->address_labels = g_slist_delete_link (priv->address_labels, label);
-
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES);
-}
-
-/**
- * nm_setting_ip4_config_remove_address_by_value:
- * @setting: the #NMSettingIP4Config
- * @address: the IP address to remove
- *
- * Removes the address @address.
- *
- * Returns: %TRUE if the address was found and removed; %FALSE if it was not.
- **/
-gboolean
-nm_setting_ip4_config_remove_address_by_value (NMSettingIP4Config *setting,
- NMIP4Address *address)
-{
- NMSettingIP4ConfigPrivate *priv;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- g_return_val_if_fail (address != NULL, FALSE);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->addresses; iter; iter = g_slist_next (iter)) {
- if (nm_ip4_address_compare ((NMIP4Address *) iter->data, address)) {
- nm_ip4_address_unref ((NMIP4Address *) iter->data);
- priv->addresses = g_slist_delete_link (priv->addresses, iter);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/**
- * nm_setting_ip4_config_clear_addresses:
- * @setting: the #NMSettingIP4Config
- *
- * Removes all configured addresses.
- **/
-void
-nm_setting_ip4_config_clear_addresses (NMSettingIP4Config *setting)
-{
- NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
-
- g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
-
- g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref);
- priv->addresses = NULL;
- g_slist_free_full (priv->address_labels, g_free);
- priv->address_labels = NULL;
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES);
-}
-
-/**
- * nm_setting_ip4_config_get_num_routes:
- * @setting: the #NMSettingIP4Config
- *
- * Returns: the number of configured routes
- **/
-guint32
-nm_setting_ip4_config_get_num_routes (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), 0);
-
- return g_slist_length (NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->routes);
-}
-
-/**
- * nm_setting_ip4_config_get_route:
- * @setting: the #NMSettingIP4Config
- * @i: index number of the route to return
- *
- * Returns: the route at index @i
- **/
-NMIP4Route *
-nm_setting_ip4_config_get_route (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->routes), NULL);
-
- return (NMIP4Route *) g_slist_nth_data (priv->routes, i);
-}
-
-/**
- * nm_setting_ip4_config_add_route:
- * @setting: the #NMSettingIP4Config
- * @route: the route to add
- *
- * Adds a new IPv4 route and associated information to the setting. The
- * given route is duplicated internally and is not changed by this function.
- *
- * Returns: %TRUE if the route was added; %FALSE if the route was already known.
- **/
-gboolean
-nm_setting_ip4_config_add_route (NMSettingIP4Config *setting,
- NMIP4Route *route)
-{
- NMSettingIP4ConfigPrivate *priv;
- NMIP4Route *copy;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- g_return_val_if_fail (route != NULL, FALSE);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->routes; iter; iter = g_slist_next (iter)) {
- if (nm_ip4_route_compare ((NMIP4Route *) iter->data, route))
- return FALSE;
- }
-
- copy = nm_ip4_route_dup (route);
- priv->routes = g_slist_append (priv->routes, copy);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ROUTES);
- return TRUE;
-}
-
-/**
- * nm_setting_ip4_config_remove_route:
- * @setting: the #NMSettingIP4Config
- * @i: index number of the route
- *
- * Removes the route at index @i.
- **/
-void
-nm_setting_ip4_config_remove_route (NMSettingIP4Config *setting, guint32 i)
-{
- NMSettingIP4ConfigPrivate *priv;
- GSList *elt;
-
- g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- elt = g_slist_nth (priv->routes, i);
- g_return_if_fail (elt != NULL);
-
- nm_ip4_route_unref ((NMIP4Route *) elt->data);
- priv->routes = g_slist_delete_link (priv->routes, elt);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ROUTES);
-}
-
-/**
- * nm_setting_ip4_config_remove_route_by_value:
- * @setting: the #NMSettingIP4Config
- * @route: the route to remove
- *
- * Removes the route @route.
- *
- * Returns: %TRUE if the route was found and removed; %FALSE if it was not.
- **/
-gboolean
-nm_setting_ip4_config_remove_route_by_value (NMSettingIP4Config *setting,
- NMIP4Route *route)
-{
- NMSettingIP4ConfigPrivate *priv;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- g_return_val_if_fail (route != NULL, FALSE);
-
- priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->routes; iter; iter = g_slist_next (iter)) {
- if (nm_ip4_route_compare ((NMIP4Route *) iter->data, route)) {
- nm_ip4_route_unref ((NMIP4Route *) iter->data);
- priv->routes = g_slist_delete_link (priv->routes, iter);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ROUTES);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/**
- * nm_setting_ip4_config_clear_routes:
- * @setting: the #NMSettingIP4Config
- *
- * Removes all configured routes.
- **/
-void
-nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting)
-{
- NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
-
- g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
-
- g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref);
- priv->routes = NULL;
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ROUTES);
-}
-
-/**
- * nm_setting_ip4_config_get_ignore_auto_routes:
- * @setting: the #NMSettingIP4Config
- *
- * Returns the value contained in the #NMSettingIP4Config:ignore-auto-routes
- * property.
- *
- * Returns: %TRUE if automatically configured (ie via DHCP) routes should be
- * ignored.
- **/
-gboolean
-nm_setting_ip4_config_get_ignore_auto_routes (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->ignore_auto_routes;
-}
-
-/**
- * nm_setting_ip4_config_get_ignore_auto_dns:
- * @setting: the #NMSettingIP4Config
- *
- * Returns the value contained in the #NMSettingIP4Config:ignore-auto-dns
- * property.
- *
- * Returns: %TRUE if automatically configured (ie via DHCP) DNS information
- * should be ignored.
- **/
-gboolean
-nm_setting_ip4_config_get_ignore_auto_dns (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->ignore_auto_dns;
-}
-
-/**
* nm_setting_ip4_config_get_dhcp_client_id:
* @setting: the #NMSettingIP4Config
*
@@ -768,174 +99,75 @@ 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_send_hostname:
- * @setting: the #NMSettingIP4Config
- *
- * Returns the value contained in the #NMSettingIP4Config:dhcp-send-hostname
- * property.
- *
- * 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.
- **/
-gboolean
-nm_setting_ip4_config_get_dhcp_send_hostname (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_send_hostname;
-}
-
-/**
- * nm_setting_ip4_config_get_dhcp_hostname:
- * @setting: the #NMSettingIP4Config
- *
- * Returns the value contained in the #NMSettingIP4Config:dhcp-hostname
- * property.
- *
- * Returns: the configured hostname to send to the DHCP server
- **/
-const char *
-nm_setting_ip4_config_get_dhcp_hostname (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL);
-
- return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_hostname;
-}
-
-/**
- * nm_setting_ip4_config_get_never_default:
- * @setting: the #NMSettingIP4Config
- *
- * Returns the value contained in the #NMSettingIP4Config:never-default
- * property.
- *
- * Returns: %TRUE if this connection should never be the default connection
- * for IPv4 addressing
- **/
-gboolean
-nm_setting_ip4_config_get_never_default (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->never_default;
-}
-
-/**
- * nm_setting_ip4_config_get_may_fail:
- * @setting: the #NMSettingIP4Config
- *
- * Returns the value contained in the #NMSettingIP4Config:may-fail
- * property.
- *
- * Returns: %TRUE if this connection doesn't require IPv4 addressing to complete
- * for the connection to succeed.
- **/
-gboolean
-nm_setting_ip4_config_get_may_fail (NMSettingIP4Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->may_fail;
-}
-
-static gboolean
-verify_label (const char *label)
-{
- const char *p;
- char *iface;
-
- if (!*label)
- return TRUE;
-
- p = strchr (label, ':');
- if (!p)
- return FALSE;
- iface = g_strndup (label, p - label);
- if (!nm_utils_iface_valid_name (iface)) {
- g_free (iface);
- return FALSE;
- }
- g_free (iface);
-
- for (p++; *p; p++) {
- if (!g_ascii_isalnum (*p) && *p != '_')
- return FALSE;
- }
-
- return TRUE;
-}
-
static gboolean
verify (NMSetting *setting, NMConnection *connection, GError **error)
{
NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- GSList *iter, *l_iter;
- int i;
+ NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting);
+ NMSettingVerifyResult ret;
+ const char *method;
- if (!priv->method) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_MISSING_PROPERTY,
- _("property is missing"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD);
- return FALSE;
- }
+ ret = NM_SETTING_CLASS (nm_setting_ip4_config_parent_class)->verify (setting, connection, error);
+ if (ret != NM_SETTING_VERIFY_SUCCESS)
+ return ret;
+
+ method = nm_setting_ip_config_get_method (s_ip);
+ /* Base class already checked that it exists */
+ g_assert (method);
- if (!strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
- if (!priv->addresses) {
+ if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
+ if (nm_setting_ip_config_get_num_addresses (s_ip) == 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_MISSING_PROPERTY,
_("this property cannot be empty for '%s=%s'"),
- NM_SETTING_IP4_CONFIG_METHOD, priv->method);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_METHOD, method);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
return FALSE;
}
- } else if ( !strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)
- || !strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)
- || !strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) {
- if (priv->dns) {
+ } else if ( !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)
+ || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)
+ || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) {
+ if (nm_setting_ip_config_get_num_dns (s_ip) > 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("this property is not allowed for '%s=%s'"),
- NM_SETTING_IP4_CONFIG_METHOD, priv->method);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_METHOD, method);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS);
return FALSE;
}
- if (priv->dns_search) {
+ if (nm_setting_ip_config_get_num_dns_searches (s_ip) > 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("this property is not allowed for '%s=%s'"),
- NM_SETTING_IP4_CONFIG_METHOD, priv->method);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_METHOD, method);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS_SEARCH);
return FALSE;
}
/* Shared allows IP addresses; link-local and disabled do not */
- if (strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_SHARED) != 0) {
- if (priv->addresses) {
+ if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED) != 0) {
+ if (nm_setting_ip_config_get_num_addresses (s_ip) > 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("this property is not allowed for '%s=%s'"),
- NM_SETTING_IP4_CONFIG_METHOD, priv->method);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_METHOD, method);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
return FALSE;
}
}
- } else if (!strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
+ } else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
/* nothing to do */
} else {
g_set_error_literal (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("property is invalid"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD);
return FALSE;
}
@@ -948,111 +180,9 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->dhcp_hostname && !strlen (priv->dhcp_hostname)) {
- 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_HOSTNAME);
- return FALSE;
- }
-
- /* Validate addresses */
- for (iter = priv->addresses, l_iter = priv->address_labels, i = 0;
- iter && l_iter;
- iter = g_slist_next (iter), l_iter = g_slist_next (l_iter), i++) {
- NMIP4Address *addr = (NMIP4Address *) iter->data;
- const char *label = (const char *) l_iter->data;
- guint32 prefix = nm_ip4_address_get_prefix (addr);
-
- if (!nm_ip4_address_get_address (addr)) {
- g_set_error (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("%d. IPv4 address is invalid"),
- i+1);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES);
- return FALSE;
- }
-
- if (!prefix || prefix > 32) {
- g_set_error (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("%d. IPv4 address has invalid prefix"),
- i+1);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES);
- return FALSE;
- }
-
- if (!verify_label (label)) {
- g_set_error (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("%d. IPv4 address has invalid label '%s'"),
- i+1, label);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, "address-labels");
- return FALSE;
- }
- }
-
- if (iter || l_iter) {
- g_set_error (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("IPv4 address / label count mismatch (%d vs %d)"),
- g_slist_length (priv->addresses),
- g_slist_length (priv->address_labels));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, "address-labels");
- return FALSE;
- }
-
- /* Validate routes */
- for (iter = priv->routes, i = 0; iter; iter = g_slist_next (iter), i++) {
- NMIP4Route *route = (NMIP4Route *) iter->data;
- guint32 prefix = nm_ip4_route_get_prefix (route);
-
- if (!nm_ip4_route_get_dest (route)) {
- g_set_error (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("%d. route is invalid"),
- i+1);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ROUTES);
- return FALSE;
- }
-
- if (!prefix || prefix > 32) {
- g_set_error (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("%d. route has invalid prefix"),
- i+1);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ROUTES);
- return FALSE;
- }
- }
-
- /* Validate DNS */
- for (iter = priv->dns, i = 0; iter; iter = g_slist_next (iter), i++) {
- const char *dns = (const char *) iter->data;
- in_addr_t addr;
-
- if (inet_pton (AF_INET, dns, &addr) != 1) {
- g_set_error (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("%d. DNS server address is invalid"),
- i+1);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DNS);
- return FALSE;
- }
- }
-
return TRUE;
}
-
static void
nm_setting_ip4_config_init (NMSettingIP4Config *setting)
{
@@ -1061,126 +191,24 @@ nm_setting_ip4_config_init (NMSettingIP4Config *setting)
static void
finalize (GObject *object)
{
- NMSettingIP4Config *self = NM_SETTING_IP4_CONFIG (object);
- NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (self);
+ NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (object);
- g_free (priv->method);
- g_free (priv->dhcp_hostname);
g_free (priv->dhcp_client_id);
- g_slist_free_full (priv->dns, g_free);
- g_slist_free_full (priv->dns_search, g_free);
- g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref);
- g_slist_free_full (priv->address_labels, g_free);
- g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref);
-
G_OBJECT_CLASS (nm_setting_ip4_config_parent_class)->finalize (object);
}
-static GVariant *
-ip4_dns_to_dbus (const GValue *prop_value)
-{
- return nm_utils_ip4_dns_to_variant (g_value_get_boxed (prop_value));
-}
-
-static void
-ip4_dns_from_dbus (GVariant *dbus_value,
- GValue *prop_value)
-{
- g_value_take_boxed (prop_value, nm_utils_ip4_dns_from_variant (dbus_value));
-}
-
-static GVariant *
-ip4_addresses_to_dbus (const GValue *prop_value)
-{
- return nm_utils_ip4_addresses_to_variant (g_value_get_boxed (prop_value));
-}
-
-static void
-ip4_addresses_from_dbus (GVariant *dbus_value,
- GValue *prop_value)
-{
- g_value_take_boxed (prop_value, nm_utils_ip4_addresses_from_variant (dbus_value));
-}
-
-static GVariant *
-ip4_routes_to_dbus (const GValue *prop_value)
-{
- return nm_utils_ip4_routes_to_variant (g_value_get_boxed (prop_value));
-}
-
-static void
-ip4_routes_from_dbus (GVariant *dbus_value,
- GValue *prop_value)
-{
- g_value_take_boxed (prop_value, nm_utils_ip4_routes_from_variant (dbus_value));
-}
-
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
- NMSettingIP4Config *setting = NM_SETTING_IP4_CONFIG (object);
- NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
- GSList *iter;
+ NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (object);
switch (prop_id) {
- case PROP_METHOD:
- g_free (priv->method);
- priv->method = g_value_dup_string (value);
- break;
- case PROP_DNS:
- g_slist_free_full (priv->dns, g_free);
- priv->dns = _nm_utils_strv_to_slist (g_value_get_boxed (value));
- break;
- case PROP_DNS_SEARCH:
- g_slist_free_full (priv->dns_search, g_free);
- priv->dns_search = _nm_utils_strv_to_slist (g_value_get_boxed (value));
- break;
- case PROP_ADDRESSES:
- g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref);
- priv->addresses = _nm_utils_copy_array_to_slist (g_value_get_boxed (value),
- (NMUtilsCopyFunc) nm_ip4_address_dup);
-
- if (g_slist_length (priv->addresses) != g_slist_length (priv->address_labels)) {
- g_slist_free_full (priv->address_labels, g_free);
- priv->address_labels = NULL;
- for (iter = priv->addresses; iter; iter = iter->next)
- priv->address_labels = g_slist_prepend (priv->address_labels, g_strdup (""));
- }
- break;
- case PROP_ADDRESS_LABELS:
- g_slist_free_full (priv->address_labels, g_free);
- priv->address_labels = _nm_utils_strv_to_slist (g_value_get_boxed (value));
- break;
- case PROP_ROUTES:
- g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref);
- priv->routes = _nm_utils_copy_array_to_slist (g_value_get_boxed (value),
- (NMUtilsCopyFunc) nm_ip4_route_dup);
- break;
- case PROP_IGNORE_AUTO_ROUTES:
- priv->ignore_auto_routes = g_value_get_boolean (value);
- break;
- case PROP_IGNORE_AUTO_DNS:
- priv->ignore_auto_dns = g_value_get_boolean (value);
- break;
case PROP_DHCP_CLIENT_ID:
g_free (priv->dhcp_client_id);
priv->dhcp_client_id = g_value_dup_string (value);
break;
- case PROP_DHCP_SEND_HOSTNAME:
- priv->dhcp_send_hostname = g_value_get_boolean (value);
- break;
- case PROP_DHCP_HOSTNAME:
- g_free (priv->dhcp_hostname);
- priv->dhcp_hostname = g_value_dup_string (value);
- break;
- case PROP_NEVER_DEFAULT:
- priv->never_default = g_value_get_boolean (value);
- break;
- case PROP_MAY_FAIL:
- priv->may_fail = g_value_get_boolean (value);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1191,48 +219,11 @@ static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
- NMSettingIP4Config *setting = NM_SETTING_IP4_CONFIG (object);
- NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
+ NMSettingIP4Config *s_ip4 = NM_SETTING_IP4_CONFIG (object);
switch (prop_id) {
- case PROP_METHOD:
- g_value_set_string (value, nm_setting_ip4_config_get_method (setting));
- break;
- case PROP_DNS:
- g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->dns));
- break;
- case PROP_DNS_SEARCH:
- g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->dns_search));
- break;
- case PROP_ADDRESSES:
- g_value_take_boxed (value, _nm_utils_copy_slist_to_array (priv->addresses, (NMUtilsCopyFunc) nm_ip4_address_dup, (GDestroyNotify) nm_ip4_address_unref));
- break;
- case PROP_ADDRESS_LABELS:
- g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->address_labels));
- break;
- case PROP_ROUTES:
- g_value_take_boxed (value, _nm_utils_copy_slist_to_array (priv->routes, (NMUtilsCopyFunc) nm_ip4_route_dup, (GDestroyNotify) nm_ip4_route_unref));
- break;
- case PROP_IGNORE_AUTO_ROUTES:
- g_value_set_boolean (value, nm_setting_ip4_config_get_ignore_auto_routes (setting));
- break;
- case PROP_IGNORE_AUTO_DNS:
- g_value_set_boolean (value, nm_setting_ip4_config_get_ignore_auto_dns (setting));
- break;
case PROP_DHCP_CLIENT_ID:
- g_value_set_string (value, nm_setting_ip4_config_get_dhcp_client_id (setting));
- break;
- case PROP_DHCP_SEND_HOSTNAME:
- g_value_set_boolean (value, nm_setting_ip4_config_get_dhcp_send_hostname (setting));
- break;
- case PROP_DHCP_HOSTNAME:
- g_value_set_string (value, nm_setting_ip4_config_get_dhcp_hostname (setting));
- break;
- case PROP_NEVER_DEFAULT:
- g_value_set_boolean (value, priv->never_default);
- break;
- case PROP_MAY_FAIL:
- g_value_set_boolean (value, priv->may_fail);
+ g_value_set_string (value, nm_setting_ip4_config_get_dhcp_client_id (s_ip4));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1240,705 +231,474 @@ get_property (GObject *object, guint prop_id,
}
}
-static void
-nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
+static GVariant *
+ip4_dns_to_dbus (const GValue *prop_value)
{
- GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
- NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);
-
- g_type_class_add_private (setting_class, sizeof (NMSettingIP4ConfigPrivate));
-
- /* virtual methods */
- object_class->set_property = set_property;
- object_class->get_property = get_property;
- object_class->finalize = finalize;
- parent_class->verify = verify;
-
- /* Properties */
- /**
- * NMSettingIP4Config:method:
- *
- * IPv4 configuration method. If "auto" is specified then the appropriate
- * automatic method (DHCP, PPP, etc) is used for the interface and most
- * other properties can be left unset. If "link-local" is specified, then a
- * link-local address in the 169.254/16 range will be assigned to the
- * interface. If "manual" is specified, static IP addressing is used and at
- * least one IP address must be given in the "addresses" property. If
- * "shared" is specified (indicating that this connection will provide
- * network access to other computers) then the interface is assigned an
- * address in the 10.42.x.1/24 range and a DHCP and forwarding DNS server
- * are started, and the interface is NAT-ed to the current default network
- * connection. "disabled" means IPv4 will not be used on this connection.
- * This property must be set.
- **/
- g_object_class_install_property
- (object_class, PROP_METHOD,
- g_param_spec_string (NM_SETTING_IP4_CONFIG_METHOD, "", "",
- NULL,
- G_PARAM_READWRITE |
- NM_SETTING_PARAM_INFERRABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config:dns:
- *
- * Array of IPv4 addresses of DNS servers. For the 'auto' method, these
- * DNS servers are appended to those (if any) returned by automatic
- * configuration. DNS servers cannot be used with the "shared",
- * "link-local", or "disabled" methods as there is no upstream network. In
- * all other methods, these DNS servers are used as the only DNS servers for
- * this connection.
- **/
- g_object_class_install_property
- (object_class, PROP_DNS,
- g_param_spec_boxed (NM_SETTING_IP4_CONFIG_DNS, "", "",
- G_TYPE_STRV,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_IP4_CONFIG_DNS,
- G_VARIANT_TYPE ("au"),
- ip4_dns_to_dbus,
- ip4_dns_from_dbus);
-
- /**
- * NMSettingIP4Config:dns-search:
- *
- * List of DNS search domains. For the "auto" method, these search domains
- * are appended to those returned by automatic configuration. Search domains
- * cannot be used with the "shared", "link-local", or "disabled" methods as
- * there is no upstream network. In all other methods, these search domains
- * are used as the only search domains for this connection.
- **/
- g_object_class_install_property
- (object_class, PROP_DNS_SEARCH,
- g_param_spec_boxed (NM_SETTING_IP4_CONFIG_DNS_SEARCH, "", "",
- G_TYPE_STRV,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config:addresses:
- *
- * Array of IPv4 addresses. The gateway may be left as 0 if no gateway exists
- * for that subnet. For the 'auto' method, given IP addresses are appended
- * to those returned by automatic configuration. Addresses cannot be used
- * with the "shared", "link-local", or "disabled" methods as addressing is
- * either automatic or disabled with these methods.
- *
- * Element-Type: NMIP4Address
- **/
- g_object_class_install_property
- (object_class, PROP_ADDRESSES,
- g_param_spec_boxed (NM_SETTING_IP4_CONFIG_ADDRESSES, "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READWRITE |
- NM_SETTING_PARAM_INFERRABLE |
- G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_IP4_CONFIG_ADDRESSES,
- G_VARIANT_TYPE ("aau"),
- ip4_addresses_to_dbus,
- ip4_addresses_from_dbus);
-
- /**
- * NMSettingIP4Config:address-labels:
- *
- * Internal use only.
- **/
- g_object_class_install_property
- (object_class, PROP_ADDRESS_LABELS,
- g_param_spec_boxed ("address-labels", "", "",
- G_TYPE_STRV,
- G_PARAM_READWRITE |
- NM_SETTING_PARAM_INFERRABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config:routes:
- *
- * Array of IPv4 routes. For the 'auto' method, given IP routes are appended
- * to those returned by automatic configuration. Routes cannot be used with
- * the 'shared', 'link-local', or 'disabled' methods because there is no
- * upstream network.
- *
- * Element-Type: NMIP4Route
- **/
- g_object_class_install_property
- (object_class, PROP_ROUTES,
- g_param_spec_boxed (NM_SETTING_IP4_CONFIG_ROUTES, "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READWRITE |
- NM_SETTING_PARAM_INFERRABLE |
- G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_IP4_CONFIG_ROUTES,
- G_VARIANT_TYPE ("aau"),
- ip4_routes_to_dbus,
- ip4_routes_from_dbus);
-
- /**
- * NMSettingIP4Config:ignore-auto-routes:
- *
- * When the method is set to "auto" and this property to %TRUE,
- * automatically configured routes are ignored and only routes specified in
- * the #NMSettingIP4Config:routes property, if any, are used.
- **/
- g_object_class_install_property
- (object_class, PROP_IGNORE_AUTO_ROUTES,
- g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config:ignore-auto-dns:
- *
- * When the 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
- * #NMSettingIP4Config:dns and #NMSettingIP4Config:dns-search properties, if
- * any, are used.
- **/
- g_object_class_install_property
- (object_class, PROP_IGNORE_AUTO_DNS,
- g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config: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.
- **/
- g_object_class_install_property
- (object_class, PROP_DHCP_CLIENT_ID,
- g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, "", "",
- NULL,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config: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
- * #NMSettingIP4Config:dhcp-hostname property is empty and this property is
- * %TRUE, the current persistent hostname of the computer is sent.
- **/
- g_object_class_install_property
- (object_class, PROP_DHCP_SEND_HOSTNAME,
- g_param_spec_boolean (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, "", "",
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config:dhcp-hostname:
- *
- * If the #NMSettingIP4Config:dhcp-send-hostname property is %TRUE, then the
- * specified name will be sent to the DHCP server when acquiring a lease.
- **/
- g_object_class_install_property
- (object_class, PROP_DHCP_HOSTNAME,
- g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, "", "",
- NULL,
- G_PARAM_READWRITE |
- NM_SETTING_PARAM_INFERRABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config:never-default:
- *
- * If %TRUE, this connection will never be the default IPv4 connection,
- * meaning it will never be assigned the default route by NetworkManager.
- **/
- g_object_class_install_property
- (object_class, PROP_NEVER_DEFAULT,
- g_param_spec_boolean (NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP4Config:may-fail:
- *
- * If %TRUE, allow overall network configuration to proceed even if IPv4
- * configuration 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 allows the overall
- * network configuration to succeed if IPv4 configuration fails but IPv6
- * configuration completes successfully.
- **/
- g_object_class_install_property
- (object_class, PROP_MAY_FAIL,
- g_param_spec_boolean (NM_SETTING_IP4_CONFIG_MAY_FAIL, "", "",
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
+ return nm_utils_ip4_dns_to_variant (g_value_get_boxed (prop_value));
}
-
-struct NMIP4Address {
- guint32 refcount;
- guint32 address; /* network byte order */
- guint32 prefix;
- guint32 gateway; /* network byte order */
-};
-
-/**
- * nm_ip4_address_new:
- *
- * Creates and returns a new #NMIP4Address object.
- *
- * Returns: (transfer full): the new empty #NMIP4Address object
- **/
-NMIP4Address *
-nm_ip4_address_new (void)
+static void
+ip4_dns_from_dbus (GVariant *dbus_value,
+ GValue *prop_value)
{
- NMIP4Address *address;
-
- address = g_malloc0 (sizeof (NMIP4Address));
- address->refcount = 1;
- return address;
+ g_value_take_boxed (prop_value, nm_utils_ip4_dns_from_variant (dbus_value));
}
-/**
- * nm_ip4_address_dup:
- * @source: the #NMIP4Address object to copy
- *
- * Copies a given #NMIP4Address object and returns the copy.
- *
- * Returns: (transfer full): the copy of the given #NMIP4Address copy
- **/
-NMIP4Address *
-nm_ip4_address_dup (NMIP4Address *source)
+static GVariant *
+ip4_addresses_get (NMSetting *setting,
+ const char *property)
{
- NMIP4Address *address;
-
- g_return_val_if_fail (source != NULL, NULL);
- g_return_val_if_fail (source->refcount > 0, NULL);
+ GPtrArray *addrs;
+ const char *gateway;
+ GVariant *ret;
- address = nm_ip4_address_new ();
- address->address = source->address;
- address->prefix = source->prefix;
- address->gateway = source->gateway;
+ g_object_get (setting, property, &addrs, NULL);
+ gateway = nm_setting_ip_config_get_gateway (NM_SETTING_IP_CONFIG (setting));
+ ret = nm_utils_ip4_addresses_to_variant (addrs, gateway);
+ g_ptr_array_unref (addrs);
- return address;
+ return ret;
}
-/**
- * nm_ip4_address_ref:
- * @address: the #NMIP4Address
- *
- * Increases the reference count of the object.
- **/
-void
-nm_ip4_address_ref (NMIP4Address *address)
-{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
+static void
+ip4_addresses_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
+{
+ GPtrArray *addrs;
+ GVariant *s_ip4;
+ char **labels, *gateway = NULL;
+ int i;
- address->refcount++;
-}
+ if (!_nm_setting_use_legacy_property (setting, connection_dict, "addresses", "address-data"))
+ return;
-/**
- * nm_ip4_address_unref:
- * @address: the #NMIP4Address
- *
- * Decreases the reference count of the object. If the reference count
- * reaches zero, the object will be destroyed.
- **/
-void
-nm_ip4_address_unref (NMIP4Address *address)
-{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
+ addrs = nm_utils_ip4_addresses_from_variant (value, &gateway);
- address->refcount--;
- if (address->refcount == 0) {
- memset (address, 0, sizeof (NMIP4Address));
- g_free (address);
+ s_ip4 = g_variant_lookup_value (connection_dict, NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_VARIANT_TYPE_SETTING);
+ if (g_variant_lookup (s_ip4, "address-labels", "^as", &labels)) {
+ for (i = 0; i < addrs->len && labels[i]; i++)
+ if (*labels[i])
+ nm_ip_address_set_attribute (addrs->pdata[i], "label", g_variant_new_string (labels[i]));
+ g_strfreev (labels);
}
-}
+ g_variant_unref (s_ip4);
-/**
- * nm_ip4_address_compare:
- * @address: the #NMIP4Address
- * @other: the #NMIP4Address to compare @address to.
- *
- * Determines if two #NMIP4Address objects contain the same values.
- *
- * Returns: %TRUE if the objects contain the same values, %FALSE if they do not.
- **/
-gboolean
-nm_ip4_address_compare (NMIP4Address *address, NMIP4Address *other)
-{
- g_return_val_if_fail (address != NULL, FALSE);
- g_return_val_if_fail (address->refcount > 0, FALSE);
-
- g_return_val_if_fail (other != NULL, FALSE);
- g_return_val_if_fail (other->refcount > 0, FALSE);
-
- if ( address->address != other->address
- || address->prefix != other->prefix
- || address->gateway != other->gateway)
- return FALSE;
- return TRUE;
+ g_object_set (setting,
+ NM_SETTING_IP_CONFIG_ADDRESSES, addrs,
+ NM_SETTING_IP_CONFIG_GATEWAY, gateway,
+ NULL);
+ g_ptr_array_unref (addrs);
+ g_free (gateway);
}
-/**
- * nm_ip4_address_get_address:
- * @address: the #NMIP4Address
- *
- * Gets the IPv4 address property of this address object.
- *
- * Returns: the IPv4 address in network byte order
- **/
-guint32
-nm_ip4_address_get_address (NMIP4Address *address)
-{
- g_return_val_if_fail (address != NULL, 0);
- g_return_val_if_fail (address->refcount > 0, 0);
-
- return address->address;
-}
+static GVariant *
+ip4_address_labels_get (NMSetting *setting,
+ NMConnection *connection,
+ const char *property)
+{
+ NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting);
+ gboolean have_labels = FALSE;
+ GPtrArray *labels;
+ GVariant *ret;
+ int num_addrs, i;
+
+ num_addrs = nm_setting_ip_config_get_num_addresses (s_ip);
+ for (i = 0; i < num_addrs; i++) {
+ NMIPAddress *addr = nm_setting_ip_config_get_address (s_ip, i);
+ GVariant *label = nm_ip_address_get_attribute (addr, "label");
+
+ if (label) {
+ have_labels = TRUE;
+ break;
+ }
+ }
+ if (!have_labels)
+ return NULL;
-/**
- * nm_ip4_address_set_address:
- * @address: the #NMIP4Address
- * @addr: the IPv4 address in network byte order
- *
- * Sets the IPv4 address property of this object.
- **/
-void
-nm_ip4_address_set_address (NMIP4Address *address, guint32 addr)
-{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
+ labels = g_ptr_array_sized_new (num_addrs);
+ for (i = 0; i < num_addrs; i++) {
+ NMIPAddress *addr = nm_setting_ip_config_get_address (s_ip, i);
+ GVariant *label = nm_ip_address_get_attribute (addr, "label");
- address->address = addr;
-}
+ g_ptr_array_add (labels, (char *) (label ? g_variant_get_string (label, NULL) : ""));
+ }
-/**
- * nm_ip4_address_get_prefix:
- * @address: the #NMIP4Address
- *
- * Gets the IPv4 address prefix (ie "24" or "30" etc) property of this address
- * object.
- *
- * Returns: the IPv4 address prefix
- **/
-guint32
-nm_ip4_address_get_prefix (NMIP4Address *address)
-{
- g_return_val_if_fail (address != NULL, 0);
- g_return_val_if_fail (address->refcount > 0, 0);
+ ret = g_variant_new_strv ((const char * const *) labels->pdata, labels->len);
+ g_ptr_array_unref (labels);
- return address->prefix;
+ return ret;
}
-/**
- * nm_ip4_address_set_prefix:
- * @address: the #NMIP4Address
- * @prefix: the address prefix, a number between 1 and 32 inclusive
- *
- * Sets the IPv4 address prefix.
- **/
-void
-nm_ip4_address_set_prefix (NMIP4Address *address, guint32 prefix)
+static GVariant *
+ip4_address_data_get (NMSetting *setting,
+ NMConnection *connection,
+ const char *property)
{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
- g_return_if_fail (prefix <= 32);
- g_return_if_fail (prefix > 0);
-
- address->prefix = prefix;
-}
+ GPtrArray *addrs;
+ GVariant *ret;
-/**
- * nm_ip4_address_get_gateway:
- * @address: the #NMIP4Address
- *
- * Gets the IPv4 default gateway property of this address object.
- *
- * Returns: the IPv4 gateway address in network byte order
- **/
-guint32
-nm_ip4_address_get_gateway (NMIP4Address *address)
-{
- g_return_val_if_fail (address != NULL, 0);
- g_return_val_if_fail (address->refcount > 0, 0);
+ g_object_get (setting, NM_SETTING_IP_CONFIG_ADDRESSES, &addrs, NULL);
+ ret = nm_utils_ip_addresses_to_variant (addrs);
+ g_ptr_array_unref (addrs);
- return address->gateway;
+ return ret;
}
-/**
- * nm_ip4_address_set_gateway:
- * @address: the #NMIP4Address
- * @gateway: the IPv4 default gateway in network byte order
- *
- * Sets the IPv4 default gateway property of this address object.
- **/
-void
-nm_ip4_address_set_gateway (NMIP4Address *address, guint32 gateway)
+static void
+ip4_address_data_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
-
- address->gateway = gateway;
-}
+ GPtrArray *addrs;
+ /* Ignore 'address-data' if we're going to process 'addresses' */
+ if (_nm_setting_use_legacy_property (setting, connection_dict, "addresses", "address-data"))
+ return;
-struct NMIP4Route {
- guint32 refcount;
-
- guint32 dest; /* network byte order */
- guint32 prefix;
- guint32 next_hop; /* network byte order */
- guint32 metric; /* lower metric == more preferred */
-};
-
-/**
- * nm_ip4_route_new:
- *
- * Creates and returns a new #NMIP4Route object.
- *
- * Returns: (transfer full): the new empty #NMIP4Route object
- **/
-NMIP4Route *
-nm_ip4_route_new (void)
-{
- NMIP4Route *route;
-
- route = g_malloc0 (sizeof (NMIP4Route));
- route->refcount = 1;
- return route;
+ addrs = nm_utils_ip_addresses_from_variant (value, AF_INET);
+ g_object_set (setting, NM_SETTING_IP_CONFIG_ADDRESSES, addrs, NULL);
+ g_ptr_array_unref (addrs);
}
-/**
- * nm_ip4_route_dup:
- * @source: the #NMIP4Route object to copy
- *
- * Copies a given #NMIP4Route object and returns the copy.
- *
- * Returns: (transfer full): the copy of the given #NMIP4Route copy
- **/
-NMIP4Route *
-nm_ip4_route_dup (NMIP4Route *source)
+static GVariant *
+ip4_routes_get (NMSetting *setting,
+ const char *property)
{
- NMIP4Route *route;
+ GPtrArray *routes;
+ GVariant *ret;
- g_return_val_if_fail (source != NULL, NULL);
- g_return_val_if_fail (source->refcount > 0, NULL);
+ g_object_get (setting, property, &routes, NULL);
+ ret = nm_utils_ip4_routes_to_variant (routes);
+ g_ptr_array_unref (routes);
- route = nm_ip4_route_new ();
- route->dest = source->dest;
- route->prefix = source->prefix;
- route->next_hop = source->next_hop;
- route->metric = source->metric;
-
- return route;
+ return ret;
}
-/**
- * nm_ip4_route_ref:
- * @route: the #NMIP4Route
- *
- * Increases the reference count of the object.
- **/
-void
-nm_ip4_route_ref (NMIP4Route *route)
+static void
+ip4_routes_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
-
- route->refcount++;
-}
+ GPtrArray *routes;
-/**
- * nm_ip4_route_unref:
- * @route: the #NMIP4Route
- *
- * Decreases the reference count of the object. If the reference count
- * reaches zero, the object will be destroyed.
- **/
-void
-nm_ip4_route_unref (NMIP4Route *route)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
+ if (!_nm_setting_use_legacy_property (setting, connection_dict, "routes", "route-data"))
+ return;
- route->refcount--;
- if (route->refcount == 0) {
- memset (route, 0, sizeof (NMIP4Route));
- g_free (route);
- }
+ routes = nm_utils_ip4_routes_from_variant (value);
+ g_object_set (setting, property, routes, NULL);
+ g_ptr_array_unref (routes);
}
-/**
- * nm_ip4_route_compare:
- * @route: the #NMIP4Route
- * @other: the #NMIP4Route to compare @route to.
- *
- * Determines if two #NMIP4Route objects contain the same values.
- *
- * Returns: %TRUE if the objects contain the same values, %FALSE if they do not.
- **/
-gboolean
-nm_ip4_route_compare (NMIP4Route *route, NMIP4Route *other)
+static GVariant *
+ip4_route_data_get (NMSetting *setting,
+ NMConnection *connection,
+ const char *property)
{
- g_return_val_if_fail (route != NULL, FALSE);
- g_return_val_if_fail (route->refcount > 0, FALSE);
+ GPtrArray *routes;
+ GVariant *ret;
- g_return_val_if_fail (other != NULL, FALSE);
- g_return_val_if_fail (other->refcount > 0, FALSE);
+ g_object_get (setting, NM_SETTING_IP_CONFIG_ROUTES, &routes, NULL);
+ ret = nm_utils_ip_routes_to_variant (routes);
+ g_ptr_array_unref (routes);
- if ( route->dest != other->dest
- || route->prefix != other->prefix
- || route->next_hop != other->next_hop
- || route->metric != other->metric)
- return FALSE;
- return TRUE;
-}
-
-/**
- * nm_ip4_route_get_dest:
- * @route: the #NMIP4Route
- *
- * Gets the IPv4 destination address property of this route object.
- *
- * Returns: the IPv4 address in network byte order
- **/
-guint32
-nm_ip4_route_get_dest (NMIP4Route *route)
-{
- g_return_val_if_fail (route != NULL, 0);
- g_return_val_if_fail (route->refcount > 0, 0);
-
- return route->dest;
+ return ret;
}
-/**
- * nm_ip4_route_set_dest:
- * @route: the #NMIP4Route
- * @dest: the destination address in network byte order
- *
- * Sets the IPv4 destination address property of this route object.
- **/
-void
-nm_ip4_route_set_dest (NMIP4Route *route, guint32 dest)
+static void
+ip4_route_data_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
+ GPtrArray *routes;
- route->dest = dest;
-}
+ /* Ignore 'route-data' if we're going to process 'routes' */
+ if (_nm_setting_use_legacy_property (setting, connection_dict, "routes", "route-data"))
+ return;
-/**
- * nm_ip4_route_get_prefix:
- * @route: the #NMIP4Route
- *
- * Gets the IPv4 prefix (ie "24" or "30" etc) of this route.
- *
- * Returns: the IPv4 prefix
- **/
-guint32
-nm_ip4_route_get_prefix (NMIP4Route *route)
-{
- g_return_val_if_fail (route != NULL, 0);
- g_return_val_if_fail (route->refcount > 0, 0);
-
- return route->prefix;
+ routes = nm_utils_ip_routes_from_variant (value, AF_INET);
+ g_object_set (setting, NM_SETTING_IP_CONFIG_ROUTES, routes, NULL);
+ g_ptr_array_unref (routes);
}
-/**
- * nm_ip4_route_set_prefix:
- * @route: the #NMIP4Route
- * @prefix: the prefix, a number between 1 and 32 inclusive
- *
- * Sets the IPv4 prefix of this route.
- **/
-void
-nm_ip4_route_set_prefix (NMIP4Route *route, guint32 prefix)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
- g_return_if_fail (prefix <= 32);
- g_return_if_fail (prefix > 0);
-
- route->prefix = prefix;
-}
-/**
- * nm_ip4_route_get_next_hop:
- * @route: the #NMIP4Route
- *
- * Gets the IPv4 address of the next hop of this route.
- *
- * Returns: the IPv4 address in network byte order
- **/
-guint32
-nm_ip4_route_get_next_hop (NMIP4Route *route)
+static void
+nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *ip4_class)
{
- g_return_val_if_fail (route != NULL, 0);
- g_return_val_if_fail (route->refcount > 0, 0);
-
- return route->next_hop;
-}
+ NMSettingClass *setting_class = NM_SETTING_CLASS (ip4_class);
+ GObjectClass *object_class = G_OBJECT_CLASS (ip4_class);
-/**
- * nm_ip4_route_set_next_hop:
- * @route: the #NMIP4Route
- * @next_hop: the IPv4 address of the next hop in network byte order
- *
- * Sets the IPv4 address of the next hop of this route.
- **/
-void
-nm_ip4_route_set_next_hop (NMIP4Route *route, guint32 next_hop)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
+ g_type_class_add_private (setting_class, sizeof (NMSettingIP4ConfigPrivate));
- route->next_hop = next_hop;
-}
+ /* virtual methods */
+ object_class->set_property = set_property;
+ object_class->get_property = get_property;
+ object_class->finalize = finalize;
+ setting_class->verify = verify;
+
+ /* properties */
+
+ /* ---ifcfg-rh---
+ * property: method
+ * variable: BOOTPROTO
+ * format: string
+ * values: none, dhcp (bootp), static, ibft, autoip, shared
+ * default: none
+ * description: Method used for IPv4 protocol configuration.
+ * ---end---
+ */
+
+ /* ---keyfile---
+ * property: dns
+ * format: list of DNS IP addresses
+ * description: List of DNS servers.
+ * example: dns=1.2.3.4;8.8.8.8;8.8.4.4;
+ * ---end---
+ * ---ifcfg-rh---
+ * property: dns
+ * variable: DNS1, DNS2, ...
+ * format: string
+ * description: List of DNS servers. Even if NetworkManager supports many DNS
+ * servers, initscripts and resolver only care about the first three, usually.
+ * example: DNS1=1.2.3.4 DNS2=10.0.0.254 DNS3=8.8.8.8
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: dns-search
+ * variable: DOMAIN
+ * format: string (space-separated domains)
+ * description: List of DNS search domains.
+ * ---end---
+ */
+
+ /* ---keyfile---
+ * property: addresses
+ * variable: address1, address2, ...
+ * format: address/plen
+ * description: List of static IP addresses.
+ * example: address1=192.168.100.100/24 address2=10.1.1.5/24
+ * ---end---
+ * ---ifcfg-rh---
+ * property: addresses
+ * variable: IPADDR, PREFIX, IPADDR1, PREFIX1, ...
+ * description: List of static IP addresses.
+ * example: IPADDR=10.5.5.23 PREFIX=24 IPADDR1=1.1.1.2 PREFIX1=16
+ * ---end---
+ */
+
+ /* ---keyfile---
+ * property: gateway
+ * variable: gateway
+ * format: string
+ * description: Gateway IP addresses as a string.
+ * example: gateway=192.168.100.1
+ * ---end---
+ * ---ifcfg-rh---
+ * property: gateway
+ * variable: GATEWAY
+ * description: Gateway IP address.
+ * example: GATEWAY=10.5.5.1
+ * ---end---
+ */
+
+ /* ---keyfile---
+ * property: routes
+ * variable: route1, route2, ...
+ * format: route/plen[,gateway,metric]
+ * description: List of IP routes.
+ * example: route1=8.8.8.0/24,10.1.1.1,77
+ * route2=7.7.0.0/16
+ * ---end---
+ * ---ifcfg-rh---
+ * property: routes
+ * variable: ADDRESS1, NETMASK1, GATEWAY1, METRIC1, ...
+ * description: List of static routes. They are not stored in ifcfg-* file,
+ * but in route-* file instead.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: ignore-auto-routes
+ * variable: PEERROUTES(+)
+ * default: yes
+ * description: PEERROUTES has the opposite meaning as 'ignore-auto-routes' property.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: ignore-auto-dns
+ * variable: PEERDNS
+ * default: yes
+ * description: PEERDNS has the opposite meaning as 'ignore-auto-dns' property.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: dhcp-send-hostname
+ * variable: DHCP_SEND_HOSTNAME(+)
+ * default: yes
+ * description: Whether DHCP_HOSTNAME should be sent to the DHCP server.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: dhcp-hostname
+ * variable: DHCP_HOSTNAME
+ * description: Hostname to send to the DHCP server.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: never-default
+ * variable: DEFROUTE (GATEWAYDEV in /etc/sysconfig/network)
+ * default: yes
+ * description: DEFROUTE=no tells NetworkManager that this connection
+ * should not be assigned the default route. DEFROUTE has the opposite
+ * meaning as 'never-default' property.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: may-fail
+ * variable: IPV4_FAILURE_FATAL(+)
+ * default: no
+ * description: IPV4_FAILURE_FATAL has the opposite meaning as 'may-fail' property.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: route-metric
+ * variable: IPV4_ROUTE_METRIC(+)
+ * default: -1
+ * description: IPV4_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.
+ * ---end---
+ */
-/**
- * nm_ip4_route_get_metric:
- * @route: the #NMIP4Route
- *
- * Gets the route metric property of this route object; lower values indicate
- * "better" or more preferred routes.
- *
- * Returns: the route metric
- **/
-guint32
-nm_ip4_route_get_metric (NMIP4Route *route)
-{
- g_return_val_if_fail (route != NULL, 0);
- g_return_val_if_fail (route->refcount > 0, 0);
+ /**
+ * NMSettingIP4Config: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.
+ **/
+ /* ---ifcfg-rh---
+ * property: dhcp-client-id
+ * variable: DHCP_CLIENT_ID(+)
+ * description: A string sent to the DHCP server to identify the local machine.
+ * example: DHCP_CLIENT_ID=ax-srv-1
+ * ---end---
+ */
+ g_object_class_install_property
+ (object_class, PROP_DHCP_CLIENT_ID,
+ g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
- return route->metric;
-}
+ /* IP4-specific property overrides */
+
+ /* ---dbus---
+ * property: dns
+ * format: array of uint32
+ * description: Array of IP addresses of DNS servers (as network-byte-order
+ * integers)
+ * ---end---
+ */
+ _nm_setting_class_transform_property (setting_class,
+ NM_SETTING_IP_CONFIG_DNS,
+ G_VARIANT_TYPE ("au"),
+ ip4_dns_to_dbus,
+ ip4_dns_from_dbus);
-/**
- * nm_ip4_route_set_metric:
- * @route: the #NMIP4Route
- * @metric: the route metric
- *
- * Sets the route metric property of this route object; lower values indicate
- * "better" or more preferred routes.
- **/
-void
-nm_ip4_route_set_metric (NMIP4Route *route, guint32 metric)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
+ /* ---dbus---
+ * property: addresses
+ * format: array of array of uint32
+ * description: 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.
+ * ---end---
+ */
+ _nm_setting_class_override_property (setting_class,
+ NM_SETTING_IP_CONFIG_ADDRESSES,
+ G_VARIANT_TYPE ("aau"),
+ ip4_addresses_get,
+ ip4_addresses_set,
+ NULL);
+
+ _nm_setting_class_add_dbus_only_property (setting_class,
+ "address-labels",
+ G_VARIANT_TYPE_STRING_ARRAY,
+ ip4_address_labels_get,
+ NULL);
+
+ /* ---dbus---
+ * property: address-data
+ * format: array of vardict
+ * description: Array 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.
+ * ---end---
+ */
+ _nm_setting_class_add_dbus_only_property (setting_class,
+ "address-data",
+ G_VARIANT_TYPE ("aa{sv}"),
+ ip4_address_data_get,
+ ip4_address_data_set);
+
+ /* ---dbus---
+ * property: routes
+ * format: array of array of uint32
+ * description: 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.)
+ * ---end---
+ */
+ _nm_setting_class_override_property (setting_class,
+ NM_SETTING_IP_CONFIG_ROUTES,
+ G_VARIANT_TYPE ("aau"),
+ ip4_routes_get,
+ ip4_routes_set,
+ NULL);
+
+ /* ---dbus---
+ * property: route-data
+ * format: array of vardict
+ * description: Array of IPv4 routes. Each route dictionary contains at
+ * least 'dest' and 'prefix' entries, containing the destination IP
+ * address as a string, and the prefix length as a uint32. Most routes
+ * will also have a 'gateway' entry, containing the gateway IP address as
+ * a string. If the route has a 'metric' entry (containing a uint32), that
+ * 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.
+ * ---end---
+ */
+ _nm_setting_class_add_dbus_only_property (setting_class,
+ "route-data",
+ G_VARIANT_TYPE ("aa{sv}"),
+ ip4_route_data_get,
+ ip4_route_data_set);
- route->metric = metric;
}
diff --git a/libnm-core/nm-setting-ip4-config.h b/libnm-core/nm-setting-ip4-config.h
index 369e1d46d2..e944dfe391 100644
--- a/libnm-core/nm-setting-ip4-config.h
+++ b/libnm-core/nm-setting-ip4-config.h
@@ -27,7 +27,7 @@
#error "Only <NetworkManager.h> can be included directly."
#endif
-#include "nm-setting.h"
+#include "nm-setting-ip-config.h"
G_BEGIN_DECLS
@@ -40,18 +40,7 @@ G_BEGIN_DECLS
#define NM_SETTING_IP4_CONFIG_SETTING_NAME "ipv4"
-#define NM_SETTING_IP4_CONFIG_METHOD "method"
-#define NM_SETTING_IP4_CONFIG_DNS "dns"
-#define NM_SETTING_IP4_CONFIG_DNS_SEARCH "dns-search"
-#define NM_SETTING_IP4_CONFIG_ADDRESSES "addresses"
-#define NM_SETTING_IP4_CONFIG_ROUTES "routes"
-#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
-#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
#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_NEVER_DEFAULT "never-default"
-#define NM_SETTING_IP4_CONFIG_MAY_FAIL "may-fail"
/**
* NM_SETTING_IP4_CONFIG_METHOD_AUTO:
@@ -97,63 +86,12 @@ G_BEGIN_DECLS
*/
#define NM_SETTING_IP4_CONFIG_METHOD_DISABLED "disabled"
-typedef struct NMIP4Address NMIP4Address;
-
-GType nm_ip4_address_get_type (void);
-
-NMIP4Address * nm_ip4_address_new (void);
-NMIP4Address * nm_ip4_address_dup (NMIP4Address *source);
-void nm_ip4_address_ref (NMIP4Address *address);
-void nm_ip4_address_unref (NMIP4Address *address);
-/* Return TRUE if addresses are identical */
-gboolean nm_ip4_address_compare (NMIP4Address *address, NMIP4Address *other);
-
-guint32 nm_ip4_address_get_address (NMIP4Address *address);
-void nm_ip4_address_set_address (NMIP4Address *address,
- guint32 addr); /* network byte order */
-
-guint32 nm_ip4_address_get_prefix (NMIP4Address *address);
-void nm_ip4_address_set_prefix (NMIP4Address *address,
- guint32 prefix);
-
-guint32 nm_ip4_address_get_gateway (NMIP4Address *address);
-void nm_ip4_address_set_gateway (NMIP4Address *address,
- guint32 gateway); /* network byte order */
-
-typedef struct NMIP4Route NMIP4Route;
-
-GType nm_ip4_route_get_type (void);
-
-NMIP4Route * nm_ip4_route_new (void);
-NMIP4Route * nm_ip4_route_dup (NMIP4Route *source);
-void nm_ip4_route_ref (NMIP4Route *route);
-void nm_ip4_route_unref (NMIP4Route *route);
-/* Return TRUE if routes are identical */
-gboolean nm_ip4_route_compare (NMIP4Route *route, NMIP4Route *other);
-
-guint32 nm_ip4_route_get_dest (NMIP4Route *route);
-void nm_ip4_route_set_dest (NMIP4Route *route,
- guint32 dest); /* network byte order */
-
-guint32 nm_ip4_route_get_prefix (NMIP4Route *route);
-void nm_ip4_route_set_prefix (NMIP4Route *route,
- guint32 prefix);
-
-guint32 nm_ip4_route_get_next_hop (NMIP4Route *route);
-void nm_ip4_route_set_next_hop (NMIP4Route *route,
- guint32 next_hop); /* network byte order */
-
-guint32 nm_ip4_route_get_metric (NMIP4Route *route);
-void nm_ip4_route_set_metric (NMIP4Route *route,
- guint32 metric);
-
-
struct _NMSettingIP4Config {
- NMSetting parent;
+ NMSettingIPConfig parent;
};
typedef struct {
- NMSettingClass parent;
+ NMSettingIPConfigClass parent;
/*< private >*/
gpointer padding[4];
@@ -161,46 +99,9 @@ typedef struct {
GType nm_setting_ip4_config_get_type (void);
-NMSetting * nm_setting_ip4_config_new (void);
-const char * nm_setting_ip4_config_get_method (NMSettingIP4Config *setting);
-
-guint32 nm_setting_ip4_config_get_num_dns (NMSettingIP4Config *setting);
-const char * nm_setting_ip4_config_get_dns (NMSettingIP4Config *setting, guint32 i);
-gboolean nm_setting_ip4_config_add_dns (NMSettingIP4Config *setting, const char *dns);
-void nm_setting_ip4_config_remove_dns (NMSettingIP4Config *setting, guint32 i);
-gboolean nm_setting_ip4_config_remove_dns_by_value (NMSettingIP4Config *setting, const char *dns);
-void nm_setting_ip4_config_clear_dns (NMSettingIP4Config *setting);
-
-guint32 nm_setting_ip4_config_get_num_dns_searches (NMSettingIP4Config *setting);
-const char * nm_setting_ip4_config_get_dns_search (NMSettingIP4Config *setting, guint32 i);
-gboolean nm_setting_ip4_config_add_dns_search (NMSettingIP4Config *setting, const char *dns_search);
-void nm_setting_ip4_config_remove_dns_search (NMSettingIP4Config *setting, guint32 i);
-gboolean nm_setting_ip4_config_remove_dns_search_by_value (NMSettingIP4Config *setting, const char *dns_search);
-void nm_setting_ip4_config_clear_dns_searches (NMSettingIP4Config *setting);
-
-guint32 nm_setting_ip4_config_get_num_addresses (NMSettingIP4Config *setting);
-NMIP4Address *nm_setting_ip4_config_get_address (NMSettingIP4Config *setting, guint32 i);
-gboolean nm_setting_ip4_config_add_address (NMSettingIP4Config *setting, NMIP4Address *address);
-void nm_setting_ip4_config_remove_address (NMSettingIP4Config *setting, guint32 i);
-gboolean nm_setting_ip4_config_remove_address_by_value (NMSettingIP4Config *setting, NMIP4Address *address);
-void nm_setting_ip4_config_clear_addresses (NMSettingIP4Config *setting);
-
-guint32 nm_setting_ip4_config_get_num_routes (NMSettingIP4Config *setting);
-NMIP4Route * nm_setting_ip4_config_get_route (NMSettingIP4Config *setting, guint32 i);
-gboolean nm_setting_ip4_config_add_route (NMSettingIP4Config *setting, NMIP4Route *route);
-void nm_setting_ip4_config_remove_route (NMSettingIP4Config *setting, guint32 i);
-gboolean nm_setting_ip4_config_remove_route_by_value (NMSettingIP4Config *setting, NMIP4Route *route);
-void nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting);
-
-gboolean nm_setting_ip4_config_get_ignore_auto_routes (NMSettingIP4Config *setting);
-gboolean nm_setting_ip4_config_get_ignore_auto_dns (NMSettingIP4Config *setting);
-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);
-
-gboolean nm_setting_ip4_config_get_never_default (NMSettingIP4Config *setting);
-
-gboolean nm_setting_ip4_config_get_may_fail (NMSettingIP4Config *setting);
+NMSetting *nm_setting_ip4_config_new (void);
+
+const char *nm_setting_ip4_config_get_dhcp_client_id (NMSettingIP4Config *setting);
G_END_DECLS
diff --git a/libnm-core/nm-setting-ip6-config.c b/libnm-core/nm-setting-ip6-config.c
index cbc5e2c8be..29ca551525 100644
--- a/libnm-core/nm-setting-ip6-config.c
+++ b/libnm-core/nm-setting-ip6-config.c
@@ -19,13 +19,12 @@
* Copyright 2007 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip6-config.h"
-#include "nm-utils.h"
-#include "nm-utils-private.h"
-#include "nm-glib-compat.h"
#include "nm-setting-private.h"
#include "nm-core-enum-types.h"
@@ -35,44 +34,35 @@
*
* The #NMSettingIP6Config object is a #NMSetting subclass that describes
* properties related to IPv6 addressing, routing, and Domain Name Service
+ *
+ * #NMSettingIP6Config has few properties or methods of its own; it inherits
+ * almost everything from #NMSettingIPConfig.
+ *
+ * NetworkManager supports 6 values for the #NMSettingIPConfig:method property
+ * for IPv6. If "auto" is specified then the appropriate automatic method (PPP,
+ * router advertisement, etc) is used for the device and most other properties
+ * can be left unset. To force the use of DHCP only, specify "dhcp"; this
+ * method is only valid for Ethernet- based hardware. If "link-local" is
+ * specified, then an IPv6 link-local address will be assigned to the interface.
+ * If "manual" is specified, static IP addressing is used and at least one IP
+ * address must be given in the "addresses" property. If "ignore" is specified,
+ * IPv6 configuration is not done. Note: the "shared" method is not yet
+ * supported.
**/
-G_DEFINE_BOXED_TYPE (NMIP6Address, nm_ip6_address, nm_ip6_address_dup, nm_ip6_address_unref)
-G_DEFINE_BOXED_TYPE (NMIP6Route, nm_ip6_route, nm_ip6_route_dup, nm_ip6_route_unref)
-
-G_DEFINE_TYPE_WITH_CODE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING,
+G_DEFINE_TYPE_WITH_CODE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING_IP_CONFIG,
_nm_register_setting (IP6_CONFIG, 4))
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP6_CONFIG)
#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate))
typedef struct {
- char *method;
- char *dhcp_hostname;
- GSList *dns; /* array of struct in6_addr */
- GSList *dns_search; /* list of strings */
- GSList *addresses; /* array of NMIP6Address */
- GSList *routes; /* array of NMIP6Route */
- gboolean ignore_auto_routes;
- gboolean ignore_auto_dns;
- gboolean never_default;
- gboolean may_fail;
NMSettingIP6ConfigPrivacy ip6_privacy;
} NMSettingIP6ConfigPrivate;
enum {
PROP_0,
- PROP_METHOD,
- PROP_DHCP_HOSTNAME,
- PROP_DNS,
- PROP_DNS_SEARCH,
- PROP_ADDRESSES,
- PROP_ROUTES,
- PROP_IGNORE_AUTO_ROUTES,
- PROP_IGNORE_AUTO_DNS,
- PROP_NEVER_DEFAULT,
- PROP_MAY_FAIL,
PROP_IP6_PRIVACY,
LAST_PROP
@@ -92,683 +82,6 @@ nm_setting_ip6_config_new (void)
}
/**
- * nm_setting_ip6_config_get_method:
- * @setting: the #NMSettingIP6Config
- *
- * Returns: the #NMSettingIP6Config:method property of the setting
- **/
-const char *
-nm_setting_ip6_config_get_method (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
-
- return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->method;
-}
-
-/**
- * nm_setting_ip6_config_get_dhcp_hostname:
- * @setting: the #NMSettingIP6Config
- *
- * Returns the value contained in the #NMSettingIP6Config:dhcp-hostname
- * property.
- *
- * Returns: the configured hostname to send to the DHCP server
- **/
-const char *
-nm_setting_ip6_config_get_dhcp_hostname (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
-
- return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dhcp_hostname;
-}
-
-/**
- * nm_setting_ip6_config_get_num_dns:
- * @setting: the #NMSettingIP6Config
- *
- * Returns: the number of configured DNS servers
- **/
-guint32
-nm_setting_ip6_config_get_num_dns (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
-
- return g_slist_length (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns);
-}
-
-/**
- * nm_setting_ip6_config_get_dns:
- * @setting: the #NMSettingIP6Config
- * @i: index number of the DNS server to return
- *
- * Returns: (transfer none): the IPv6 address of the DNS server at index @i
- **/
-const char *
-nm_setting_ip6_config_get_dns (NMSettingIP6Config *setting, guint32 i)
-{
- NMSettingIP6ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->dns), NULL);
-
- return (const char *) g_slist_nth_data (priv->dns, i);
-}
-
-static const char *
-canonicalize_ip (const char *ip)
-{
- struct in6_addr addr;
- int ret;
-
- ret = inet_pton (AF_INET6, ip, &addr);
- g_return_val_if_fail (ret == 1, NULL);
- return nm_utils_inet6_ntop (&addr, NULL);
-}
-
-/**
- * nm_setting_ip6_config_add_dns:
- * @setting: the #NMSettingIP6Config
- * @dns: the IPv6 address of the DNS server to add
- *
- * Adds a new DNS server to the setting.
- *
- * Returns: %TRUE if the DNS server was added; %FALSE if the server was already
- * known
- **/
-gboolean
-nm_setting_ip6_config_add_dns (NMSettingIP6Config *setting, const char *dns)
-{
- NMSettingIP6ConfigPrivate *priv;
- const char *dns_canonical;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- g_return_val_if_fail (dns != NULL, FALSE);
- g_return_val_if_fail (dns[0] != '\0', FALSE);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
-
- dns_canonical = canonicalize_ip (dns);
- g_return_val_if_fail (dns_canonical != NULL, FALSE);
-
- for (iter = priv->dns; iter; iter = g_slist_next (iter)) {
- if (!strcmp (dns_canonical, (char *) iter->data))
- return FALSE;
- }
-
- priv->dns = g_slist_append (priv->dns, g_strdup (dns_canonical));
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS);
- return TRUE;
-}
-
-/**
- * nm_setting_ip6_config_remove_dns:
- * @setting: the #NMSettingIP6Config
- * @i: index number of the DNS server to remove
- *
- * Removes the DNS server at index @i.
- **/
-void
-nm_setting_ip6_config_remove_dns (NMSettingIP6Config *setting, guint32 i)
-{
- NMSettingIP6ConfigPrivate *priv;
- GSList *elt;
-
- g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- elt = g_slist_nth (priv->dns, i);
- g_return_if_fail (elt != NULL);
-
- g_free (elt->data);
- priv->dns = g_slist_delete_link (priv->dns, elt);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS);
-}
-
-/**
- * nm_setting_ip6_config_remove_dns_by_value:
- * @setting: the #NMSettingIP6Config
- * @dns: the IPv6 address of the DNS server to remove
- *
- * Removes the DNS server at index @i.
- *
- * Returns: %TRUE if the DNS server was found and removed; %FALSE if it was not.
- **/
-gboolean
-nm_setting_ip6_config_remove_dns_by_value (NMSettingIP6Config *setting,
- const char *dns)
-{
- NMSettingIP6ConfigPrivate *priv;
- const char *dns_canonical;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- g_return_val_if_fail (dns != NULL, FALSE);
- g_return_val_if_fail (dns[0] != '\0', FALSE);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
-
- dns_canonical = canonicalize_ip (dns);
- g_return_val_if_fail (dns_canonical != NULL, FALSE);
-
- for (iter = priv->dns; iter; iter = g_slist_next (iter)) {
- if (!strcmp (dns_canonical, (char *) iter->data)) {
- priv->dns = g_slist_delete_link (priv->dns, iter);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/**
- * nm_setting_ip6_config_clear_dns:
- * @setting: the #NMSettingIP6Config
- *
- * Removes all configured DNS servers.
- **/
-void
-nm_setting_ip6_config_clear_dns (NMSettingIP6Config *setting)
-{
- g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
-
- g_slist_free_full (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns, g_free);
- NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns = NULL;
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS);
-}
-
-/**
- * nm_setting_ip6_config_get_num_dns_searches:
- * @setting: the #NMSettingIP6Config
- *
- * Returns: the number of configured DNS search domains
- **/
-guint32
-nm_setting_ip6_config_get_num_dns_searches (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
-
- return g_slist_length (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns_search);
-}
-
-/**
- * nm_setting_ip6_config_get_dns_search:
- * @setting: the #NMSettingIP6Config
- * @i: index number of the DNS search domain to return
- *
- * Returns: the DNS search domain at index @i
- **/
-const char *
-nm_setting_ip6_config_get_dns_search (NMSettingIP6Config *setting, guint32 i)
-{
- NMSettingIP6ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->dns_search), NULL);
-
- return (const char *) g_slist_nth_data (priv->dns_search, i);
-}
-
-/**
- * nm_setting_ip6_config_add_dns_search:
- * @setting: the #NMSettingIP6Config
- * @dns_search: the search domain to add
- *
- * Adds a new DNS search domain to the setting.
- *
- * Returns: %TRUE if the DNS search domain was added; %FALSE if the search
- * domain was already known
- **/
-gboolean
-nm_setting_ip6_config_add_dns_search (NMSettingIP6Config *setting,
- const char *dns_search)
-{
- NMSettingIP6ConfigPrivate *priv;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- g_return_val_if_fail (dns_search != NULL, FALSE);
- g_return_val_if_fail (dns_search[0] != '\0', FALSE);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->dns_search; iter; iter = g_slist_next (iter)) {
- if (!strcmp (dns_search, (char *) iter->data))
- return FALSE;
- }
-
- priv->dns_search = g_slist_append (priv->dns_search, g_strdup (dns_search));
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS_SEARCH);
- return TRUE;
-}
-
-/**
- * nm_setting_ip6_config_remove_dns_search:
- * @setting: the #NMSettingIP6Config
- * @i: index number of the DNS search domain
- *
- * Removes the DNS search domain at index @i.
- **/
-void
-nm_setting_ip6_config_remove_dns_search (NMSettingIP6Config *setting, guint32 i)
-{
- NMSettingIP6ConfigPrivate *priv;
- GSList *elt;
-
- g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- elt = g_slist_nth (priv->dns_search, i);
- g_return_if_fail (elt != NULL);
-
- g_free (elt->data);
- priv->dns_search = g_slist_delete_link (priv->dns_search, elt);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS_SEARCH);
-}
-
-/**
- * nm_setting_ip6_config_remove_dns_search_by_value:
- * @setting: the #NMSettingIP6Config
- * @dns_search: the search domain to remove
- *
- * Removes the DNS search domain @dns_search.
- *
- * Returns: %TRUE if the DNS search domain was found and removed; %FALSE if it was not.
- **/
-gboolean
-nm_setting_ip6_config_remove_dns_search_by_value (NMSettingIP6Config *setting,
- const char *dns_search)
-{
- NMSettingIP6ConfigPrivate *priv;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- g_return_val_if_fail (dns_search != NULL, FALSE);
- g_return_val_if_fail (dns_search[0] != '\0', FALSE);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->dns_search; iter; iter = g_slist_next (iter)) {
- if (!strcmp (dns_search, (char *) iter->data)) {
- priv->dns_search = g_slist_delete_link (priv->dns_search, iter);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS_SEARCH);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/**
- * nm_setting_ip6_config_clear_dns_searches:
- * @setting: the #NMSettingIP6Config
- *
- * Removes all configured DNS search domains.
- **/
-void
-nm_setting_ip6_config_clear_dns_searches (NMSettingIP6Config *setting)
-{
- g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
-
- g_slist_free_full (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns_search, g_free);
- NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns_search = NULL;
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS_SEARCH);
-}
-
-/**
- * nm_setting_ip6_config_get_num_addresses:
- * @setting: the #NMSettingIP6Config
- *
- * Returns: the number of configured addresses
- **/
-guint32
-nm_setting_ip6_config_get_num_addresses (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
-
- return g_slist_length (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->addresses);
-}
-
-/**
- * nm_setting_ip6_config_get_address:
- * @setting: the #NMSettingIP6Config
- * @i: index number of the address to return
- *
- * Returns: the address at index @i
- **/
-NMIP6Address *
-nm_setting_ip6_config_get_address (NMSettingIP6Config *setting, guint32 i)
-{
- NMSettingIP6ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->addresses), NULL);
-
- return (NMIP6Address *) g_slist_nth_data (priv->addresses, i);
-}
-
-/**
- * nm_setting_ip6_config_add_address:
- * @setting: the #NMSettingIP6Config
- * @address: the new address to add
- *
- * Adds a new IPv6 address and associated information to the setting. The
- * given address is duplicated internally and is not changed by this function.
- *
- * Returns: %TRUE if the address was added; %FALSE if the address was already
- * known.
- **/
-gboolean
-nm_setting_ip6_config_add_address (NMSettingIP6Config *setting,
- NMIP6Address *address)
-{
- NMSettingIP6ConfigPrivate *priv;
- NMIP6Address *copy;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- g_return_val_if_fail (address != NULL, FALSE);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->addresses; iter; iter = g_slist_next (iter)) {
- if (nm_ip6_address_compare ((NMIP6Address *) iter->data, address))
- return FALSE;
- }
-
- copy = nm_ip6_address_dup (address);
- priv->addresses = g_slist_append (priv->addresses, copy);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ADDRESSES);
- return TRUE;
-}
-
-/**
- * nm_setting_ip6_config_remove_address:
- * @setting: the #NMSettingIP6Config
- * @i: index number of the address to remove
- *
- * Removes the address at index @i.
- **/
-void
-nm_setting_ip6_config_remove_address (NMSettingIP6Config *setting, guint32 i)
-{
- NMSettingIP6ConfigPrivate *priv;
- GSList *elt;
-
- g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- elt = g_slist_nth (priv->addresses, i);
- g_return_if_fail (elt != NULL);
-
- nm_ip6_address_unref ((NMIP6Address *) elt->data);
- priv->addresses = g_slist_delete_link (priv->addresses, elt);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ADDRESSES);
-}
-
-/**
- * nm_setting_ip6_config_remove_address_by_value:
- * @setting: the #NMSettingIP6Config
- * @address: the address to remove
- *
- * Removes the address @address.
- *
- * Returns: %TRUE if the address was found and removed; %FALSE if it was not.
- **/
-gboolean
-nm_setting_ip6_config_remove_address_by_value (NMSettingIP6Config *setting,
- NMIP6Address *address)
-{
- NMSettingIP6ConfigPrivate *priv;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- g_return_val_if_fail (address != NULL, FALSE);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->addresses; iter; iter = g_slist_next (iter)) {
- if (nm_ip6_address_compare ((NMIP6Address *) iter->data, address)) {
- priv->addresses = g_slist_delete_link (priv->addresses, iter);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ADDRESSES);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/**
- * nm_setting_ip6_config_clear_addresses:
- * @setting: the #NMSettingIP6Config
- *
- * Removes all configured addresses.
- **/
-void
-nm_setting_ip6_config_clear_addresses (NMSettingIP6Config *setting)
-{
- NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
-
- g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
-
- g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip6_address_unref);
- priv->addresses = NULL;
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ADDRESSES);
-}
-
-/**
- * nm_setting_ip6_config_get_num_routes:
- * @setting: the #NMSettingIP6Config
- *
- * Returns: the number of configured routes
- **/
-guint32
-nm_setting_ip6_config_get_num_routes (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
-
- return g_slist_length (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->routes);
-}
-
-/**
- * nm_setting_ip6_config_get_route:
- * @setting: the #NMSettingIP6Config
- * @i: index number of the route to return
- *
- * Returns: the route at index @i
- **/
-NMIP6Route *
-nm_setting_ip6_config_get_route (NMSettingIP6Config *setting, guint32 i)
-{
- NMSettingIP6ConfigPrivate *priv;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- g_return_val_if_fail (i < g_slist_length (priv->routes), NULL);
-
- return (NMIP6Route *) g_slist_nth_data (priv->routes, i);
-}
-
-/**
- * nm_setting_ip6_config_add_route:
- * @setting: the #NMSettingIP6Config
- * @route: the route to add
- *
- * Adds a new IPv6 route and associated information to the setting. The
- * given route is duplicated internally and is not changed by this function.
- *
- * Returns: %TRUE if the route was added; %FALSE if the route was already known.
- **/
-gboolean
-nm_setting_ip6_config_add_route (NMSettingIP6Config *setting,
- NMIP6Route *route)
-{
- NMSettingIP6ConfigPrivate *priv;
- NMIP6Route *copy;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- g_return_val_if_fail (route != NULL, FALSE);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->routes; iter; iter = g_slist_next (iter)) {
- if (nm_ip6_route_compare ((NMIP6Route *) iter->data, route))
- return FALSE;
- }
-
- copy = nm_ip6_route_dup (route);
- priv->routes = g_slist_append (priv->routes, copy);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ROUTES);
- return TRUE;
-}
-
-/**
- * nm_setting_ip6_config_remove_route:
- * @setting: the #NMSettingIP6Config
- * @i: index number of the route
- *
- * Removes the route at index @i.
- **/
-void
-nm_setting_ip6_config_remove_route (NMSettingIP6Config *setting, guint32 i)
-{
- NMSettingIP6ConfigPrivate *priv;
- GSList *elt;
-
- g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- elt = g_slist_nth (priv->routes, i);
- g_return_if_fail (elt != NULL);
-
- nm_ip6_route_unref ((NMIP6Route *) elt->data);
- priv->routes = g_slist_delete_link (priv->routes, elt);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ROUTES);
-}
-
-/**
- * nm_setting_ip6_config_remove_route_by_value:
- * @setting: the #NMSettingIP6Config
- * @route: the route to remove
- *
- * Removes the route @route.
- *
- * Returns: %TRUE if the route was found and removed; %FALSE if it was not.
- **/
-gboolean
-nm_setting_ip6_config_remove_route_by_value (NMSettingIP6Config *setting,
- NMIP6Route *route)
-{
- NMSettingIP6ConfigPrivate *priv;
- GSList *iter;
-
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- g_return_val_if_fail (route != NULL, FALSE);
-
- priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- for (iter = priv->routes; iter; iter = g_slist_next (iter)) {
- if (nm_ip6_route_compare ((NMIP6Route *) iter->data, route)) {
- nm_ip6_route_unref ((NMIP6Route *) iter->data);
- priv->routes = g_slist_delete_link (priv->routes, iter);
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ROUTES);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/**
- * nm_setting_ip6_config_clear_routes:
- * @setting: the #NMSettingIP6Config
- *
- * Removes all configured routes.
- **/
-void
-nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting)
-{
- NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
-
- g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
-
- g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip6_route_unref);
- priv->routes = NULL;
- g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ROUTES);
-}
-
-/**
- * nm_setting_ip6_config_get_ignore_auto_routes:
- * @setting: the #NMSettingIP6Config
- *
- * Returns the value contained in the #NMSettingIP6Config:ignore-auto-routes
- * property.
- *
- * Returns: %TRUE if automatically configured (ie via DHCP) routes should be
- * ignored.
- **/
-gboolean
-nm_setting_ip6_config_get_ignore_auto_routes (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->ignore_auto_routes;
-}
-
-/**
- * nm_setting_ip6_config_get_ignore_auto_dns:
- * @setting: the #NMSettingIP6Config
- *
- * Returns the value contained in the #NMSettingIP6Config:ignore-auto-dns
- * property.
- *
- * Returns: %TRUE if automatically configured (ie via DHCP or router
- * advertisements) DNS information should be ignored.
- **/
-gboolean
-nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->ignore_auto_dns;
-}
-
-/**
- * nm_setting_ip6_config_get_never_default:
- * @setting: the #NMSettingIP6Config
- *
- * Returns the value contained in the #NMSettingIP6Config:never-default
- * property.
- *
- * Returns: %TRUE if this connection should never be the default connection
- * for IPv6 addressing
- **/
-gboolean
-nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->never_default;
-}
-
-/**
- * nm_setting_ip6_config_get_may_fail:
- * @setting: the #NMSettingIP6Config
- *
- * Returns the value contained in the #NMSettingIP6Config:may-fail
- * property.
- *
- * Returns: %TRUE if this connection doesn't require IPv6 addressing to complete
- * for the connection to succeed.
- **/
-gboolean
-nm_setting_ip6_config_get_may_fail (NMSettingIP6Config *setting)
-{
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
-
- return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->may_fail;
-}
-
-/**
* nm_setting_ip6_config_get_ip6_privacy:
* @setting: the #NMSettingIP6Config
*
@@ -788,98 +101,73 @@ nm_setting_ip6_config_get_ip6_privacy (NMSettingIP6Config *setting)
static gboolean
verify (NMSetting *setting, NMConnection *connection, GError **error)
{
- NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- GSList *iter;
- int i;
+ NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting);
+ NMSettingVerifyResult ret;
+ const char *method;
- if (!priv->method) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_MISSING_PROPERTY,
- _("property is missing"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_METHOD);
- return FALSE;
- }
+ ret = NM_SETTING_CLASS (nm_setting_ip6_config_parent_class)->verify (setting, connection, error);
+ if (ret != NM_SETTING_VERIFY_SUCCESS)
+ return ret;
- if (!strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
- if (!priv->addresses) {
+ method = nm_setting_ip_config_get_method (s_ip);
+ /* Base class already checked that it exists */
+ g_assert (method);
+
+ if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
+ if (nm_setting_ip_config_get_num_addresses (s_ip) == 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_MISSING_PROPERTY,
_("this property cannot be empty for '%s=%s'"),
- NM_SETTING_IP6_CONFIG_METHOD, priv->method);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_METHOD, method);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
return FALSE;
}
- } else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)
- || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)
- || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
- if (priv->dns) {
+ } else if ( !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)
+ || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)
+ || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
+ if (nm_setting_ip_config_get_num_dns (s_ip) > 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("'%s' not allowed for %s=%s"),
_("this property is not allowed for '%s=%s'"),
- NM_SETTING_IP6_CONFIG_METHOD, priv->method);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_METHOD, method);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS);
return FALSE;
}
- if (priv->dns_search) {
+ if (nm_setting_ip_config_get_num_dns_searches (s_ip) > 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("this property is not allowed for '%s=%s'"),
- NM_SETTING_IP6_CONFIG_METHOD, priv->method);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_METHOD, method);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS_SEARCH);
return FALSE;
}
- if (priv->addresses) {
+ if (nm_setting_ip_config_get_num_addresses (s_ip) > 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("this property is not allowed for '%s=%s'"),
- NM_SETTING_IP6_CONFIG_METHOD, priv->method);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_METHOD, method);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
return FALSE;
}
- } else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)
- || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
+ } else if ( !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)
+ || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
/* nothing to do */
} else {
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_IP6_CONFIG_METHOD);
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD);
return FALSE;
}
- if (priv->dhcp_hostname && !strlen (priv->dhcp_hostname)) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("property is missing"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME);
- return FALSE;
- }
-
- for (iter = priv->dns, i = 0; iter; iter = g_slist_next (iter), i++) {
- const char *dns = (const char *) iter->data;
- struct in6_addr addr;
-
- if (inet_pton (AF_INET6, dns, &addr) != 1) {
- g_set_error (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("%d. DNS server address is invalid"),
- i+1);
- g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_DNS);
- return FALSE;
- }
- }
-
return TRUE;
}
@@ -889,59 +177,149 @@ nm_setting_ip6_config_init (NMSettingIP6Config *setting)
{
}
+static GVariant *
+ip6_dns_to_dbus (const GValue *prop_value)
+{
+ return nm_utils_ip6_dns_to_variant (g_value_get_boxed (prop_value));
+}
+
static void
-finalize (GObject *object)
+ip6_dns_from_dbus (GVariant *dbus_value,
+ GValue *prop_value)
{
- NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object);
+ g_value_take_boxed (prop_value, nm_utils_ip6_dns_from_variant (dbus_value));
+}
- g_free (priv->method);
- g_free (priv->dhcp_hostname);
+static GVariant *
+ip6_addresses_get (NMSetting *setting,
+ const char *property)
+{
+ GPtrArray *addrs;
+ const char *gateway;
+ GVariant *ret;
+
+ g_object_get (setting, property, &addrs, NULL);
+ gateway = nm_setting_ip_config_get_gateway (NM_SETTING_IP_CONFIG (setting));
+ ret = nm_utils_ip6_addresses_to_variant (addrs, gateway);
+ g_ptr_array_unref (addrs);
+
+ return ret;
+}
- g_slist_free_full (priv->dns, g_free);
- g_slist_free_full (priv->dns_search, g_free);
- g_slist_free_full (priv->addresses, g_free);
- g_slist_free_full (priv->routes, g_free);
+static void
+ip6_addresses_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
+{
+ GPtrArray *addrs;
+ char *gateway = NULL;
+
+ if (!_nm_setting_use_legacy_property (setting, connection_dict, "addresses", "address-data"))
+ return;
- G_OBJECT_CLASS (nm_setting_ip6_config_parent_class)->finalize (object);
+ addrs = nm_utils_ip6_addresses_from_variant (value, &gateway);
+
+ g_object_set (setting,
+ NM_SETTING_IP_CONFIG_ADDRESSES, addrs,
+ NM_SETTING_IP_CONFIG_GATEWAY, gateway,
+ NULL);
+ g_ptr_array_unref (addrs);
+ g_free (gateway);
}
static GVariant *
-ip6_dns_to_dbus (const GValue *prop_value)
+ip6_address_data_get (NMSetting *setting,
+ NMConnection *connection,
+ const char *property)
{
- return nm_utils_ip6_dns_to_variant (g_value_get_boxed (prop_value));
+ GPtrArray *addrs;
+ GVariant *ret;
+
+ g_object_get (setting, NM_SETTING_IP_CONFIG_ADDRESSES, &addrs, NULL);
+ ret = nm_utils_ip_addresses_to_variant (addrs);
+ g_ptr_array_unref (addrs);
+
+ return ret;
}
static void
-ip6_dns_from_dbus (GVariant *dbus_value,
- GValue *prop_value)
+ip6_address_data_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
{
- g_value_take_boxed (prop_value, nm_utils_ip6_dns_from_variant (dbus_value));
+ GPtrArray *addrs;
+
+ /* Ignore 'address-data' if we're going to process 'addresses' */
+ if (_nm_setting_use_legacy_property (setting, connection_dict, "addresses", "address-data"))
+ return;
+
+ addrs = nm_utils_ip_addresses_from_variant (value, AF_INET6);
+ g_object_set (setting, NM_SETTING_IP_CONFIG_ADDRESSES, addrs, NULL);
+ g_ptr_array_unref (addrs);
}
static GVariant *
-ip6_addresses_to_dbus (const GValue *prop_value)
+ip6_routes_get (NMSetting *setting,
+ const char *property)
{
- return nm_utils_ip6_addresses_to_variant (g_value_get_boxed (prop_value));
+ GPtrArray *routes;
+ GVariant *ret;
+
+ g_object_get (setting, property, &routes, NULL);
+ ret = nm_utils_ip6_routes_to_variant (routes);
+ g_ptr_array_unref (routes);
+
+ return ret;
}
static void
-ip6_addresses_from_dbus (GVariant *dbus_value,
- GValue *prop_value)
+ip6_routes_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
{
- g_value_take_boxed (prop_value, nm_utils_ip6_addresses_from_variant (dbus_value));
+ GPtrArray *routes;
+
+ if (!_nm_setting_use_legacy_property (setting, connection_dict, "routes", "route-data"))
+ return;
+
+ routes = nm_utils_ip6_routes_from_variant (value);
+ g_object_set (setting, property, routes, NULL);
+ g_ptr_array_unref (routes);
}
static GVariant *
-ip6_routes_to_dbus (const GValue *prop_value)
+ip6_route_data_get (NMSetting *setting,
+ NMConnection *connection,
+ const char *property)
{
- return nm_utils_ip6_routes_to_variant (g_value_get_boxed (prop_value));
+ GPtrArray *routes;
+ GVariant *ret;
+
+ g_object_get (setting, NM_SETTING_IP_CONFIG_ROUTES, &routes, NULL);
+ ret = nm_utils_ip_routes_to_variant (routes);
+ g_ptr_array_unref (routes);
+
+ return ret;
}
static void
-ip6_routes_from_dbus (GVariant *dbus_value,
- GValue *prop_value)
+ip6_route_data_set (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property,
+ GVariant *value)
{
- g_value_take_boxed (prop_value, nm_utils_ip6_routes_from_variant (dbus_value));
+ GPtrArray *routes;
+
+ /* Ignore 'route-data' if we're going to process 'routes' */
+ if (_nm_setting_use_legacy_property (setting, connection_dict, "routes", "route-data"))
+ return;
+
+ routes = nm_utils_ip_routes_from_variant (value, AF_INET6);
+ g_object_set (setting, NM_SETTING_IP_CONFIG_ROUTES, routes, NULL);
+ g_ptr_array_unref (routes);
}
static void
@@ -951,44 +329,6 @@ set_property (GObject *object, guint prop_id,
NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object);
switch (prop_id) {
- case PROP_METHOD:
- g_free (priv->method);
- priv->method = g_value_dup_string (value);
- break;
- case PROP_DNS:
- g_slist_free_full (priv->dns, g_free);
- priv->dns = _nm_utils_strv_to_slist (g_value_get_boxed (value));
- break;
- case PROP_DNS_SEARCH:
- g_slist_free_full (priv->dns_search, g_free);
- priv->dns_search = _nm_utils_strv_to_slist (g_value_get_boxed (value));
- break;
- case PROP_ADDRESSES:
- g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip6_address_unref);
- priv->addresses = _nm_utils_copy_array_to_slist (g_value_get_boxed (value),
- (NMUtilsCopyFunc) nm_ip6_address_dup);
- break;
- case PROP_ROUTES:
- g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip6_route_unref);
- priv->routes = _nm_utils_copy_array_to_slist (g_value_get_boxed (value),
- (NMUtilsCopyFunc) nm_ip6_route_dup);
- break;
- case PROP_IGNORE_AUTO_ROUTES:
- priv->ignore_auto_routes = g_value_get_boolean (value);
- break;
- case PROP_IGNORE_AUTO_DNS:
- priv->ignore_auto_dns = g_value_get_boolean (value);
- break;
- case PROP_DHCP_HOSTNAME:
- g_free (priv->dhcp_hostname);
- priv->dhcp_hostname = g_value_dup_string (value);
- break;
- case PROP_NEVER_DEFAULT:
- priv->never_default = g_value_get_boolean (value);
- break;
- case PROP_MAY_FAIL:
- priv->may_fail = g_value_get_boolean (value);
- break;
case PROP_IP6_PRIVACY:
priv->ip6_privacy = g_value_get_enum (value);
break;
@@ -1005,36 +345,6 @@ get_property (GObject *object, guint prop_id,
NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object);
switch (prop_id) {
- case PROP_METHOD:
- g_value_set_string (value, priv->method);
- break;
- case PROP_DNS:
- g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->dns));
- break;
- case PROP_DNS_SEARCH:
- g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->dns_search));
- break;
- case PROP_ADDRESSES:
- g_value_take_boxed (value, _nm_utils_copy_slist_to_array (priv->addresses, (NMUtilsCopyFunc) nm_ip6_address_dup, (GDestroyNotify) nm_ip6_address_unref));
- break;
- case PROP_ROUTES:
- g_value_take_boxed (value, _nm_utils_copy_slist_to_array (priv->routes, (NMUtilsCopyFunc) nm_ip6_route_dup, (GDestroyNotify) nm_ip6_route_unref));
- break;
- case PROP_IGNORE_AUTO_ROUTES:
- g_value_set_boolean (value, priv->ignore_auto_routes);
- break;
- case PROP_IGNORE_AUTO_DNS:
- g_value_set_boolean (value, priv->ignore_auto_dns);
- break;
- case PROP_DHCP_HOSTNAME:
- g_value_set_string (value, priv->dhcp_hostname);
- break;
- case PROP_NEVER_DEFAULT:
- g_value_set_boolean (value, priv->never_default);
- break;
- case PROP_MAY_FAIL:
- g_value_set_boolean (value, priv->may_fail);
- break;
case PROP_IP6_PRIVACY:
g_value_set_enum (value, priv->ip6_privacy);
break;
@@ -1045,199 +355,147 @@ get_property (GObject *object, guint prop_id,
}
static void
-nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
+nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *ip6_class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
- NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);
+ GObjectClass *object_class = G_OBJECT_CLASS (ip6_class);
+ NMSettingClass *setting_class = NM_SETTING_CLASS (ip6_class);
- g_type_class_add_private (setting_class, sizeof (NMSettingIP6ConfigPrivate));
+ g_type_class_add_private (ip6_class, sizeof (NMSettingIP6ConfigPrivate));
/* virtual methods */
object_class->set_property = set_property;
object_class->get_property = get_property;
- object_class->finalize = finalize;
- parent_class->verify = verify;
+ setting_class->verify = verify;
/* Properties */
- /**
- * NMSettingIP6Config:method:
- *
- * IPv6 configuration method. If "auto" is specified then the appropriate
- * automatic method (PPP, router advertisement, etc) is used for the device
- * and most other properties can be left unset. To force the use of DHCP
- * only, specify "dhcp"; this method is only valid for Ethernet- based
- * hardware. If "link-local" is specified, then an IPv6 link-local address
- * will be assigned to the interface. If "manual" is specified, static IP
- * addressing is used and at least one IP address must be given in the
- * "addresses" property. If "ignore" is specified, IPv6 configuration is
- * not done. This property must be set. Note: the "shared" method is not
- * yet supported.
- **/
- g_object_class_install_property
- (object_class, PROP_METHOD,
- g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD, "", "",
- NULL,
- G_PARAM_READWRITE |
- NM_SETTING_PARAM_INFERRABLE |
- G_PARAM_STATIC_STRINGS));
- /**
- * NMSettingIP6Config:dhcp-hostname:
- *
- * The specified name will be sent to the DHCP server when acquiring a
- * lease.
- **/
- g_object_class_install_property
- (object_class, PROP_DHCP_HOSTNAME,
- g_param_spec_string (NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME, "", "",
- NULL,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP6Config:dns:
- *
- * Array of IPv6 addresses of DNS servers. For the "auto" method, these DNS
- * servers are appended to those (if any) returned by automatic
- * configuration. DNS servers cannot be used with the "shared" or
- * "link-local" methods as there is no usptream network. In all other
- * methods, these DNS servers are used as the only DNS servers for this
- * connection.
- **/
- g_object_class_install_property
- (object_class, PROP_DNS,
- g_param_spec_boxed (NM_SETTING_IP6_CONFIG_DNS, "", "",
- G_TYPE_STRV,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_IP6_CONFIG_DNS,
- G_VARIANT_TYPE ("aay"),
- ip6_dns_to_dbus,
- ip6_dns_from_dbus);
-
- /**
- * NMSettingIP6Config:dns-search:
- *
- * List of DNS search domains. For the "auto" method, these search domains
- * are appended to those returned by automatic configuration. Search domains
- * cannot be used with the "shared" or "link-local" methods as there is no
- * upstream network. In all other methods, these search domains are used as
- * the only search domains for this connection.
- **/
- g_object_class_install_property
- (object_class, PROP_DNS_SEARCH,
- g_param_spec_boxed (NM_SETTING_IP6_CONFIG_DNS_SEARCH, "", "",
- G_TYPE_STRV,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP6Config:addresses:
- *
- * Array of IPv6 addresses. For the 'auto' method, given IP addresses are
- * appended to those returned by automatic configuration. Addresses cannot
- * be used with the 'shared' or 'link-local' methods as the interface is
- * automatically assigned an address with these methods.
- *
- * Element-Type: NMIP6Address
- **/
- g_object_class_install_property
- (object_class, PROP_ADDRESSES,
- g_param_spec_boxed (NM_SETTING_IP6_CONFIG_ADDRESSES, "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READWRITE |
- NM_SETTING_PARAM_INFERRABLE |
- G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_IP6_CONFIG_ADDRESSES,
- G_VARIANT_TYPE ("a(ayuay)"),
- ip6_addresses_to_dbus,
- ip6_addresses_from_dbus);
-
- /**
- * NMSettingIP6Config:routes:
- *
- * Array of IPv6 routes. For the 'auto' method, given IP routes are appended
- * to those returned by automatic configuration. Routes cannot be used with
- * the 'shared' or 'link-local' methods because there is no upstream network.
- *
- * Element-Type: NMIP6Route
- **/
- g_object_class_install_property
- (object_class, PROP_ROUTES,
- g_param_spec_boxed (NM_SETTING_IP6_CONFIG_ROUTES, "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READWRITE |
- NM_SETTING_PARAM_INFERRABLE |
- G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_IP6_CONFIG_ROUTES,
- G_VARIANT_TYPE ("a(ayuayu)"),
- ip6_routes_to_dbus,
- ip6_routes_from_dbus);
-
- /**
- * NMSettingIP6Config:ignore-auto-routes:
- *
- * When the method is set to "auto" or "dhcp" and this property is set to
- * %TRUE, automatically configured routes are ignored and only routes
- * specified in the #NMSettingIP6Config:routes property, if any, are used.
- **/
- g_object_class_install_property
- (object_class, PROP_IGNORE_AUTO_ROUTES,
- g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP6Config:ignore-auto-dns:
- *
- * When the method is set to "auto" or "dhcp" and this property is set to
- * %TRUE, automatically configured nameservers and search domains are
- * ignored and only nameservers and search domains specified in the
- * #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search properties, if
- * any, are used.
- **/
- g_object_class_install_property
- (object_class, PROP_IGNORE_AUTO_DNS,
- g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP6Config:never-default:
- *
- * If %TRUE, this connection will never be the default IPv6 connection,
- * meaning it will never be assigned the default IPv6 route by
- * NetworkManager.
- **/
- g_object_class_install_property
- (object_class, PROP_NEVER_DEFAULT,
- g_param_spec_boolean (NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMSettingIP6Config:may-fail:
- *
- * If %TRUE, allow overall network configuration to proceed even if IPv6
- * configuration times out. Note that at least one IP configuration must
- * succeed or overall network configuration will still fail. For example,
- * in IPv4-only networks, setting this property to %TRUE allows the overall
- * network configuration to succeed if IPv6 configuration fails but IPv4
- * configuration completes successfully.
- **/
- g_object_class_install_property
- (object_class, PROP_MAY_FAIL,
- g_param_spec_boolean (NM_SETTING_IP6_CONFIG_MAY_FAIL, "", "",
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
+ /* ---ifcfg-rh---
+ * property: method
+ * variable: IPV6INIT, IPV6FORWARDING, IPV6_AUTOCONF, DHCPV6C
+ * default: IPV6INIT=yes; IPV6FORWARDING=no; IPV6_AUTOCONF=!IPV6FORWARDING, DHCPV6=no
+ * description: Method used for IPv6 protocol configuration.
+ * ignore ~ IPV6INIT=no; auto ~ IPV6_AUTOCONF=yes; dhcp ~ IPV6_AUTOCONF=no and DHCPV6C=yes
+ * ---end---
+ */
+
+ /* ---keyfile---
+ * property: dns
+ * format: list of DNS IP addresses
+ * description: List of DNS servers.
+ * example: dns=2001:4860:4860::8888;2001:4860:4860::8844;
+ * ---end---
+ * ---ifcfg-rh---
+ * property: dns
+ * variable: DNS1, DNS2, ...
+ * format: string
+ * description: List of DNS servers. NetworkManager uses the variables both
+ * for IPv4 and IPv6.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: dns-search
+ * variable: DOMAIN
+ * format: string (space-separated domains)
+ * description: List of DNS search domains.
+ * ---end---
+ */
+
+ /* ---keyfile---
+ * property: addresses
+ * variable: address1, address2, ...
+ * format: address/plen
+ * description: List of static IP addresses.
+ * example: address1=abbe::cafe/96 address2=2001::1234
+ * ---end---
+ * ---ifcfg-rh---
+ * property: addresses
+ * variable: IPV6ADDR, IPV6ADDR_SECONDARIES
+ * description: List of static IP addresses.
+ * example: IPV6ADDR=ab12:9876::1
+ * IPV6ADDR_SECONDARIES="ab12:9876::2 ab12:9876::3"
+ * ---end---
+ */
+
+ /* ---keyfile---
+ * property: gateway
+ * variable: gateway
+ * format: string
+ * description: Gateway IP addresses as a string.
+ * example: gateway=abbe::1
+ * ---end---
+ * ---ifcfg-rh---
+ * property: gateway
+ * variable: IPV6_DEFAULTGW
+ * description: Gateway IP address.
+ * example: IPV6_DEFAULTGW=abbe::1
+ * ---end---
+ */
+
+ /* ---keyfile---
+ * property: routes
+ * variable: route1, route2, ...
+ * format: route/plen[,gateway,metric]
+ * description: List of IP routes.
+ * example: route1=2001:4860:4860::/64,2620:52:0:2219:222:68ff:fe11:5403
+ * ---end---
+ * ---ifcfg-rh---
+ * property: routes
+ * variable: (none)
+ * description: List of static routes. They are not stored in ifcfg-* file,
+ * but in route6-* file instead in the form of command line for 'ip route add'.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: ignore-auto-routes
+ * variable: IPV6_PEERROUTES(+)
+ * default: yes
+ * description: IPV6_PEERROUTES has the opposite meaning as 'ignore-auto-routes' property.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: ignore-auto-dns
+ * variable: IPV6_PEERDNS(+)
+ * default: yes
+ * description: IPV6_PEERDNS has the opposite meaning as 'ignore-auto-dns' property.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: dhcp-hostname
+ * variable: DHCP_HOSTNAME
+ * description: Hostname to send the DHCP server.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: never-default
+ * variable: IPV6_DEFROUTE(+), (and IPV6_DEFAULTGW, IPV6_DEFAULTDEV in /etc/sysconfig/network)
+ * default: IPV6_DEFROUTE=yes (when no variable specified)
+ * description: IPV6_DEFROUTE=no tells NetworkManager that this connection
+ * should not be assigned the default IPv6 route. IPV6_DEFROUTE has the opposite
+ * meaning as 'never-default' property.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: may-fail
+ * variable: IPV6_FAILURE_FATAL(+)
+ * default: no
+ * description: IPV6_FAILURE_FATAL has the opposite meaning as 'may-fail' property.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
+ * property: route-metric
+ * variable: IPV6_ROUTE_METRIC(+)
+ * default: -1
+ * description: IPV6_ROUTE_METRIC is the default IPv6 metric for routes on this connection.
+ * If set to -1, a default metric based on the device type is used.
+ * ---end---
+ */
/**
* NMSettingIP6Config:ip6-privacy:
@@ -1250,6 +508,16 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* 1: enabled (prefer public address), 2: enabled (prefer temporary
* addresses).
**/
+ /* ---ifcfg-rh---
+ * property: ip6-privacy
+ * variable: IPV6_PRIVACY, IPV6_PRIVACY_PREFER_PUBLIC_IP(+)
+ * values: IPV6_PRIVACY: no, yes (rfc3041 or rfc4941);
+ * IPV6_PRIVACY_PREFER_PUBLIC_IP: yes, no
+ * default: no
+ * description: Configure IPv6 Privacy Extensions for SLAAC (RFC4941).
+ * example: IPV6_PRIVACY=rfc3041 IPV6_PRIVACY_PREFER_PUBLIC_IP=yes
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_IP6_PRIVACY,
g_param_spec_enum (NM_SETTING_IP6_CONFIG_IP6_PRIVACY, "", "",
@@ -1258,473 +526,94 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-}
-
-/********************************************************************/
-
-struct NMIP6Address {
- guint32 refcount;
- struct in6_addr address;
- guint32 prefix;
- struct in6_addr gateway;
-};
-
-/**
- * nm_ip6_address_new:
- *
- * Creates and returns a new #NMIP6Address object.
- *
- * Returns: (transfer full): the new empty #NMIP6Address object
- **/
-NMIP6Address *
-nm_ip6_address_new (void)
-{
- NMIP6Address *address;
-
- address = g_malloc0 (sizeof (NMIP6Address));
- address->refcount = 1;
- return address;
-}
-
-/**
- * nm_ip6_address_dup:
- * @source: the #NMIP6Address object to copy
- *
- * Copies a given #NMIP6Address object and returns the copy.
- *
- * Returns: (transfer full): the copy of the given #NMIP6Address copy
- **/
-NMIP6Address *
-nm_ip6_address_dup (NMIP6Address *source)
-{
- NMIP6Address *address;
-
- g_return_val_if_fail (source != NULL, NULL);
- g_return_val_if_fail (source->refcount > 0, NULL);
-
- address = nm_ip6_address_new ();
- address->prefix = source->prefix;
- memcpy (&address->address, &source->address, sizeof (struct in6_addr));
- memcpy (&address->gateway, &source->gateway, sizeof (struct in6_addr));
-
- return address;
-}
-
-/**
- * nm_ip6_address_ref:
- * @address: the #NMIP6Address
- *
- * Increases the reference count of the object.
- **/
-void
-nm_ip6_address_ref (NMIP6Address *address)
-{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
-
- address->refcount++;
-}
-
-/**
- * nm_ip6_address_unref:
- * @address: the #NMIP6Address
- *
- * Decreases the reference count of the object. If the reference count
- * reaches zero, the object will be destroyed.
- **/
-void
-nm_ip6_address_unref (NMIP6Address *address)
-{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
-
- address->refcount--;
- if (address->refcount == 0) {
- memset (address, 0, sizeof (NMIP6Address));
- g_free (address);
- }
-}
-
-/**
- * nm_ip6_address_compare:
- * @address: the #NMIP6Address
- * @other: the #NMIP6Address to compare @address to.
- *
- * Determines if two #NMIP6Address objects contain the same values.
- *
- * Returns: %TRUE if the objects contain the same values, %FALSE if they do not.
- **/
-gboolean
-nm_ip6_address_compare (NMIP6Address *address, NMIP6Address *other)
-{
- g_return_val_if_fail (address != NULL, FALSE);
- g_return_val_if_fail (address->refcount > 0, FALSE);
-
- g_return_val_if_fail (other != NULL, FALSE);
- g_return_val_if_fail (other->refcount > 0, FALSE);
- if ( memcmp (&address->address, &other->address, sizeof (struct in6_addr))
- || address->prefix != other->prefix
- || memcmp (&address->gateway, &other->gateway, sizeof (struct in6_addr)))
- return FALSE;
- return TRUE;
-}
-
-/**
- * nm_ip6_address_get_address:
- * @address: the #NMIP6Address
- *
- * Gets the IPv6 address property of this address object.
- *
- * Returns: (array fixed-size=16) (element-type guint8) (transfer none):
- * the IPv6 address
- **/
-const struct in6_addr *
-nm_ip6_address_get_address (NMIP6Address *address)
-{
- g_return_val_if_fail (address != NULL, NULL);
- g_return_val_if_fail (address->refcount > 0, NULL);
-
- return &address->address;
-}
-
-/**
- * nm_ip6_address_set_address:
- * @address: the #NMIP6Address
- * @addr: the IPv6 address
- *
- * Sets the IPv6 address property of this object.
- **/
-void
-nm_ip6_address_set_address (NMIP6Address *address, const struct in6_addr *addr)
-{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
- g_return_if_fail (addr != NULL);
-
- memcpy (&address->address, addr, sizeof (struct in6_addr));
-}
+ /* IP6-specific property overrides */
-/**
- * nm_ip6_address_get_prefix:
- * @address: the #NMIP6Address
- *
- * Gets the IPv6 address prefix property of this address object.
- *
- * Returns: the IPv6 address prefix
- **/
-guint32
-nm_ip6_address_get_prefix (NMIP6Address *address)
-{
- g_return_val_if_fail (address != NULL, 0);
- g_return_val_if_fail (address->refcount > 0, 0);
-
- return address->prefix;
-}
-
-/**
- * nm_ip6_address_set_prefix:
- * @address: the #NMIP6Address
- * @prefix: the address prefix, a number between 0 and 128 inclusive
- *
- * Sets the IPv6 address prefix.
- **/
-void
-nm_ip6_address_set_prefix (NMIP6Address *address, guint32 prefix)
-{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
- g_return_if_fail (prefix <= 128);
- g_return_if_fail (prefix > 0);
-
- address->prefix = prefix;
-}
-
-/**
- * nm_ip6_address_get_gateway:
- * @address: the #NMIP6Address
- *
- * Gets the IPv6 default gateway property of this address object.
- *
- * Returns: (array fixed-size=16) (element-type guint8) (transfer none):
- * the IPv6 gateway address
- **/
-const struct in6_addr *
-nm_ip6_address_get_gateway (NMIP6Address *address)
-{
- g_return_val_if_fail (address != NULL, NULL);
- g_return_val_if_fail (address->refcount > 0, NULL);
-
- return &address->gateway;
-}
-
-/**
- * nm_ip6_address_set_gateway:
- * @address: the #NMIP6Address
- * @gateway: the IPv6 default gateway
- *
- * Sets the IPv6 default gateway property of this address object.
- **/
-void
-nm_ip6_address_set_gateway (NMIP6Address *address, const struct in6_addr *gateway)
-{
- g_return_if_fail (address != NULL);
- g_return_if_fail (address->refcount > 0);
- g_return_if_fail (gateway != NULL);
-
- memcpy (&address->gateway, gateway, sizeof (struct in6_addr));
-}
-
-/********************************************************************/
-
-struct NMIP6Route {
- guint32 refcount;
-
- struct in6_addr dest;
- guint32 prefix;
- struct in6_addr next_hop;
- guint32 metric; /* lower metric == more preferred */
-};
-
-/**
- * nm_ip6_route_new:
- *
- * Creates and returns a new #NMIP6Route object.
- *
- * Returns: (transfer full): the new empty #NMIP6Route object
- **/
-NMIP6Route *
-nm_ip6_route_new (void)
-{
- NMIP6Route *route;
-
- route = g_malloc0 (sizeof (NMIP6Route));
- route->refcount = 1;
- return route;
-}
-
-/**
- * nm_ip6_route_dup:
- * @source: the #NMIP6Route object to copy
- *
- * Copies a given #NMIP6Route object and returns the copy.
- *
- * Returns: (transfer full): the copy of the given #NMIP6Route copy
- **/
-NMIP6Route *
-nm_ip6_route_dup (NMIP6Route *source)
-{
- NMIP6Route *route;
-
- g_return_val_if_fail (source != NULL, NULL);
- g_return_val_if_fail (source->refcount > 0, NULL);
-
- route = nm_ip6_route_new ();
- route->prefix = source->prefix;
- route->metric = source->metric;
- memcpy (&route->dest, &source->dest, sizeof (struct in6_addr));
- memcpy (&route->next_hop, &source->next_hop, sizeof (struct in6_addr));
-
- return route;
-}
-
-/**
- * nm_ip6_route_ref:
- * @route: the #NMIP6Route
- *
- * Increases the reference count of the object.
- **/
-void
-nm_ip6_route_ref (NMIP6Route *route)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
-
- route->refcount++;
-}
-
-/**
- * nm_ip6_route_unref:
- * @route: the #NMIP6Route
- *
- * Decreases the reference count of the object. If the reference count
- * reaches zero, the object will be destroyed.
- **/
-void
-nm_ip6_route_unref (NMIP6Route *route)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
-
- route->refcount--;
- if (route->refcount == 0) {
- memset (route, 0, sizeof (NMIP6Route));
- g_free (route);
- }
-}
-
-/**
- * nm_ip6_route_compare:
- * @route: the #NMIP6Route
- * @other: the #NMIP6Route to compare @route to.
- *
- * Determines if two #NMIP6Route objects contain the same values.
- *
- * Returns: %TRUE if the objects contain the same values, %FALSE if they do not.
- **/
-gboolean
-nm_ip6_route_compare (NMIP6Route *route, NMIP6Route *other)
-{
- g_return_val_if_fail (route != NULL, FALSE);
- g_return_val_if_fail (route->refcount > 0, FALSE);
-
- g_return_val_if_fail (other != NULL, FALSE);
- g_return_val_if_fail (other->refcount > 0, FALSE);
-
- if ( memcmp (&route->dest, &other->dest, sizeof (struct in6_addr))
- || route->prefix != other->prefix
- || memcmp (&route->next_hop, &other->next_hop, sizeof (struct in6_addr))
- || route->metric != other->metric)
- return FALSE;
- return TRUE;
-}
-
-/**
- * nm_ip6_route_get_dest:
- * @route: the #NMIP6Route
- *
- * Gets the IPv6 destination address property of this route object.
- *
- * Returns: (array fixed-size=16) (element-type guint8) (transfer none):
- * the IPv6 address of destination
- **/
-const struct in6_addr *
-nm_ip6_route_get_dest (NMIP6Route *route)
-{
- g_return_val_if_fail (route != NULL, NULL);
- g_return_val_if_fail (route->refcount > 0, NULL);
-
- return &route->dest;
-}
-
-/**
- * nm_ip6_route_set_dest:
- * @route: the #NMIP6Route
- * @dest: the destination address
- *
- * Sets the IPv6 destination address property of this route object.
- **/
-void
-nm_ip6_route_set_dest (NMIP6Route *route, const struct in6_addr *dest)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
- g_return_if_fail (dest != NULL);
-
- memcpy (&route->dest, dest, sizeof (struct in6_addr));
-}
-
-/**
- * nm_ip6_route_get_prefix:
- * @route: the #NMIP6Route
- *
- * Gets the IPv6 prefix (ie "32" or "64" etc) of this route.
- *
- * Returns: the IPv6 prefix
- **/
-guint32
-nm_ip6_route_get_prefix (NMIP6Route *route)
-{
- g_return_val_if_fail (route != NULL, 0);
- g_return_val_if_fail (route->refcount > 0, 0);
-
- return route->prefix;
-}
-
-/**
- * nm_ip6_route_set_prefix:
- * @route: the #NMIP6Route
- * @prefix: the prefix, a number between 1 and 128 inclusive
- *
- * Sets the IPv6 prefix of this route.
- **/
-void
-nm_ip6_route_set_prefix (NMIP6Route *route, guint32 prefix)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
- g_return_if_fail (prefix <= 128);
- g_return_if_fail (prefix > 0);
-
- route->prefix = prefix;
-}
-
-/**
- * nm_ip6_route_get_next_hop:
- * @route: the #NMIP6Route
- *
- * Gets the IPv6 address of the next hop of this route.
- *
- * Returns: (array fixed-size=16) (element-type guint8) (transfer none):
- * the IPv6 address of next hop
- **/
-const struct in6_addr *
-nm_ip6_route_get_next_hop (NMIP6Route *route)
-{
- g_return_val_if_fail (route != NULL, NULL);
- g_return_val_if_fail (route->refcount > 0, NULL);
-
- return &route->next_hop;
-}
-
-/**
- * nm_ip6_route_set_next_hop:
- * @route: the #NMIP6Route
- * @next_hop: the IPv6 address of the next hop
- *
- * Sets the IPv6 address of the next hop of this route.
- **/
-void
-nm_ip6_route_set_next_hop (NMIP6Route *route, const struct in6_addr *next_hop)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
- g_return_if_fail (next_hop != NULL);
-
- memcpy (&route->next_hop, next_hop, sizeof (struct in6_addr));
-}
-
-/**
- * nm_ip6_route_get_metric:
- * @route: the #NMIP6Route
- *
- * Gets the route metric property of this route object; lower values indicate
- * "better" or more preferred routes.
- *
- * Returns: the route metric
- **/
-guint32
-nm_ip6_route_get_metric (NMIP6Route *route)
-{
- g_return_val_if_fail (route != NULL, 0);
- g_return_val_if_fail (route->refcount > 0, 0);
-
- return route->metric;
-}
-
-/**
- * nm_ip6_route_set_metric:
- * @route: the #NMIP6Route
- * @metric: the route metric
- *
- * Sets the route metric property of this route object; lower values indicate
- * "better" or more preferred routes.
- **/
-void
-nm_ip6_route_set_metric (NMIP6Route *route, guint32 metric)
-{
- g_return_if_fail (route != NULL);
- g_return_if_fail (route->refcount > 0);
+ /* ---dbus---
+ * property: dns
+ * format: array of byte array
+ * description: Array of IP addresses of DNS servers (in network byte order)
+ * ---end---
+ */
+ _nm_setting_class_transform_property (setting_class,
+ NM_SETTING_IP_CONFIG_DNS,
+ G_VARIANT_TYPE ("aay"),
+ ip6_dns_to_dbus,
+ ip6_dns_from_dbus);
- route->metric = metric;
+ /* ---dbus---
+ * property: addresses
+ * format: array of legacy IPv6 address struct (a(ayuay))
+ * description: 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.
+ * ---end---
+ */
+ _nm_setting_class_override_property (setting_class,
+ NM_SETTING_IP_CONFIG_ADDRESSES,
+ G_VARIANT_TYPE ("a(ayuay)"),
+ ip6_addresses_get,
+ ip6_addresses_set,
+ NULL);
+
+ /* ---dbus---
+ * property: address-data
+ * format: array of vardict
+ * description: Array 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.
+ * ---end---
+ */
+ _nm_setting_class_add_dbus_only_property (setting_class,
+ "address-data",
+ G_VARIANT_TYPE ("aa{sv}"),
+ ip6_address_data_get,
+ ip6_address_data_set);
+
+ /* ---dbus---
+ * property: routes
+ * format: array of legacy IPv6 route struct (a(ayuayu))
+ * description: 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.
+ * ---end---
+ */
+ _nm_setting_class_override_property (setting_class,
+ NM_SETTING_IP_CONFIG_ROUTES,
+ G_VARIANT_TYPE ("a(ayuayu)"),
+ ip6_routes_get,
+ ip6_routes_set,
+ NULL);
+
+ /* ---dbus---
+ * property: route-data
+ * format: array of vardict
+ * description: Array of IPv6 routes. Each route dictionary contains at
+ * least 'dest' and 'prefix' entries, containing the destination IP
+ * address as a string, and the prefix length as a uint32. Most routes
+ * will also have a 'next-hop' entry, containing the next hop IP address as
+ * a string. If the route has a 'metric' entry (containing a uint32), that
+ * 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.
+ * ---end---
+ */
+ _nm_setting_class_add_dbus_only_property (setting_class,
+ "route-data",
+ G_VARIANT_TYPE ("aa{sv}"),
+ ip6_route_data_get,
+ ip6_route_data_set);
}
diff --git a/libnm-core/nm-setting-ip6-config.h b/libnm-core/nm-setting-ip6-config.h
index 831f212bb6..b791e937b4 100644
--- a/libnm-core/nm-setting-ip6-config.h
+++ b/libnm-core/nm-setting-ip6-config.h
@@ -26,9 +26,7 @@
#error "Only <NetworkManager.h> can be included directly."
#endif
-#include <arpa/inet.h>
-
-#include "nm-setting.h"
+#include "nm-setting-ip-config.h"
G_BEGIN_DECLS
@@ -41,18 +39,7 @@ G_BEGIN_DECLS
#define NM_SETTING_IP6_CONFIG_SETTING_NAME "ipv6"
-#define NM_SETTING_IP6_CONFIG_METHOD "method"
-#define NM_SETTING_IP6_CONFIG_DNS "dns"
-#define NM_SETTING_IP6_CONFIG_DNS_SEARCH "dns-search"
-#define NM_SETTING_IP6_CONFIG_ADDRESSES "addresses"
-#define NM_SETTING_IP6_CONFIG_ROUTES "routes"
-#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
-#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
-#define NM_SETTING_IP6_CONFIG_NEVER_DEFAULT "never-default"
-#define NM_SETTING_IP6_CONFIG_MAY_FAIL "may-fail"
-#define NM_SETTING_IP6_CONFIG_IP6_PRIVACY "ip6-privacy"
-#define NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME "dhcp-hostname"
-
+#define NM_SETTING_IP6_CONFIG_IP6_PRIVACY "ip6-privacy"
/**
* NM_SETTING_IP6_CONFIG_METHOD_IGNORE:
@@ -127,63 +114,12 @@ typedef enum {
NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR = 2
} NMSettingIP6ConfigPrivacy;
-
-typedef struct NMIP6Address NMIP6Address;
-
-GType nm_ip6_address_get_type (void);
-
-NMIP6Address * nm_ip6_address_new (void);
-NMIP6Address * nm_ip6_address_dup (NMIP6Address *source);
-void nm_ip6_address_ref (NMIP6Address *address);
-void nm_ip6_address_unref (NMIP6Address *address);
-/* Return TRUE if addresses are identical */
-gboolean nm_ip6_address_compare (NMIP6Address *address, NMIP6Address *other);
-
-const struct in6_addr *nm_ip6_address_get_address (NMIP6Address *address);
-void nm_ip6_address_set_address (NMIP6Address *address,
- const struct in6_addr *addr);
-
-guint32 nm_ip6_address_get_prefix (NMIP6Address *address);
-void nm_ip6_address_set_prefix (NMIP6Address *address,
- guint32 prefix);
-
-const struct in6_addr *nm_ip6_address_get_gateway (NMIP6Address *address);
-void nm_ip6_address_set_gateway (NMIP6Address *address,
- const struct in6_addr *gateway);
-
-typedef struct NMIP6Route NMIP6Route;
-
-GType nm_ip6_route_get_type (void);
-
-NMIP6Route * nm_ip6_route_new (void);
-NMIP6Route * nm_ip6_route_dup (NMIP6Route *source);
-void nm_ip6_route_ref (NMIP6Route *route);
-void nm_ip6_route_unref (NMIP6Route *route);
-/* Return TRUE if routes are identical */
-gboolean nm_ip6_route_compare (NMIP6Route *route, NMIP6Route *other);
-
-const struct in6_addr *nm_ip6_route_get_dest (NMIP6Route *route);
-void nm_ip6_route_set_dest (NMIP6Route *route,
- const struct in6_addr *dest);
-
-guint32 nm_ip6_route_get_prefix (NMIP6Route *route);
-void nm_ip6_route_set_prefix (NMIP6Route *route,
- guint32 prefix);
-
-const struct in6_addr *nm_ip6_route_get_next_hop (NMIP6Route *route);
-void nm_ip6_route_set_next_hop (NMIP6Route *route,
- const struct in6_addr *next_hop);
-
-guint32 nm_ip6_route_get_metric (NMIP6Route *route);
-void nm_ip6_route_set_metric (NMIP6Route *route,
- guint32 metric);
-
struct _NMSettingIP6Config {
- NMSetting parent;
+ NMSettingIPConfig parent;
};
typedef struct {
- NMSettingClass parent;
+ NMSettingIPConfigClass parent;
/*< private >*/
gpointer padding[4];
@@ -191,42 +127,8 @@ typedef struct {
GType nm_setting_ip6_config_get_type (void);
-NMSetting * nm_setting_ip6_config_new (void);
-const char * nm_setting_ip6_config_get_method (NMSettingIP6Config *setting);
-
-guint32 nm_setting_ip6_config_get_num_dns (NMSettingIP6Config *setting);
-const char * nm_setting_ip6_config_get_dns (NMSettingIP6Config *setting, guint32 i);
-gboolean nm_setting_ip6_config_add_dns (NMSettingIP6Config *setting, const char *dns);
-void nm_setting_ip6_config_remove_dns (NMSettingIP6Config *setting, guint32 i);
-gboolean nm_setting_ip6_config_remove_dns_by_value (NMSettingIP6Config *setting, const char *dns);
-void nm_setting_ip6_config_clear_dns (NMSettingIP6Config *setting);
-
-guint32 nm_setting_ip6_config_get_num_dns_searches (NMSettingIP6Config *setting);
-const char * nm_setting_ip6_config_get_dns_search (NMSettingIP6Config *setting, guint32 i);
-gboolean nm_setting_ip6_config_add_dns_search (NMSettingIP6Config *setting, const char *dns_search);
-void nm_setting_ip6_config_remove_dns_search (NMSettingIP6Config *setting, guint32 i);
-gboolean nm_setting_ip6_config_remove_dns_search_by_value (NMSettingIP6Config *setting, const char *dns_search);
-void nm_setting_ip6_config_clear_dns_searches (NMSettingIP6Config *setting);
-
-guint32 nm_setting_ip6_config_get_num_addresses (NMSettingIP6Config *setting);
-NMIP6Address * nm_setting_ip6_config_get_address (NMSettingIP6Config *setting, guint32 i);
-gboolean nm_setting_ip6_config_add_address (NMSettingIP6Config *setting, NMIP6Address *address);
-void nm_setting_ip6_config_remove_address (NMSettingIP6Config *setting, guint32 i);
-gboolean nm_setting_ip6_config_remove_address_by_value (NMSettingIP6Config *setting, NMIP6Address *address);
-void nm_setting_ip6_config_clear_addresses (NMSettingIP6Config *setting);
-
-guint32 nm_setting_ip6_config_get_num_routes (NMSettingIP6Config *setting);
-NMIP6Route * nm_setting_ip6_config_get_route (NMSettingIP6Config *setting, guint32 i);
-gboolean nm_setting_ip6_config_add_route (NMSettingIP6Config *setting, NMIP6Route *route);
-void nm_setting_ip6_config_remove_route (NMSettingIP6Config *setting, guint32 i);
-gboolean nm_setting_ip6_config_remove_route_by_value (NMSettingIP6Config *setting, NMIP6Route *route);
-void nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting);
-gboolean nm_setting_ip6_config_get_ignore_auto_routes (NMSettingIP6Config *setting);
-
-gboolean nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting);
-const char * nm_setting_ip6_config_get_dhcp_hostname (NMSettingIP6Config *setting);
-gboolean nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting);
-gboolean nm_setting_ip6_config_get_may_fail (NMSettingIP6Config *setting);
+NMSetting *nm_setting_ip6_config_new (void);
+
NMSettingIP6ConfigPrivacy nm_setting_ip6_config_get_ip6_privacy (NMSettingIP6Config *setting);
G_END_DECLS
diff --git a/libnm-core/nm-setting-olpc-mesh.c b/libnm-core/nm-setting-olpc-mesh.c
index 968be898bb..c1d54bee89 100644
--- a/libnm-core/nm-setting-olpc-mesh.c
+++ b/libnm-core/nm-setting-olpc-mesh.c
@@ -20,8 +20,10 @@
* Copyright 2009 One Laptop per Child
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-olpc-mesh.h"
#include "nm-dbus-interface.h"
@@ -69,6 +71,11 @@ nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting)
{
}
+/**
+ * nm_setting_olpc_mesh_get_ssid:
+ *
+ * Returns: (transfer none):
+ */
GBytes *
nm_setting_olpc_mesh_get_ssid (NMSettingOlpcMesh *setting)
{
@@ -226,10 +233,6 @@ nm_setting_olpc_mesh_class_init (NMSettingOlpcMeshClass *setting_class)
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_OLPC_MESH_SSID,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSettingOlpcMesh:channel:
diff --git a/libnm-core/nm-setting-ppp.c b/libnm-core/nm-setting-ppp.c
index c3511fb896..01f798ea7b 100644
--- a/libnm-core/nm-setting-ppp.c
+++ b/libnm-core/nm-setting-ppp.c
@@ -20,7 +20,9 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
-#include <glib/gi18n.h>
+#include "config.h"
+
+#include <glib/gi18n-lib.h>
#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 403560221a..ac6764d069 100644
--- a/libnm-core/nm-setting-pppoe.c
+++ b/libnm-core/nm-setting-pppoe.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#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 56c4f46c48..2d34d509a5 100644
--- a/libnm-core/nm-setting-private.h
+++ b/libnm-core/nm-setting-private.h
@@ -86,6 +86,9 @@ gboolean _nm_setting_clear_secrets_with_flags (NMSetting *setting,
*/
#define NM_SETTING_PARAM_INFERRABLE (1 << (4 + G_PARAM_USER_SHIFT))
+/* This is a legacy property, which clients should not send to the daemon. */
+#define NM_SETTING_PARAM_LEGACY (1 << (5 + 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) \
@@ -111,6 +114,8 @@ NMSetting *_nm_setting_new_from_dbus (GType setting_type,
GError **error);
typedef GVariant * (*NMSettingPropertyGetFunc) (NMSetting *setting,
+ const char *property);
+typedef GVariant * (*NMSettingPropertySynthFunc) (NMSetting *setting,
NMConnection *connection,
const char *property);
typedef void (*NMSettingPropertySetFunc) (NMSetting *setting,
@@ -124,7 +129,7 @@ typedef void (*NMSettingPropertyNotSetFunc) (NMSetting *setting,
void _nm_setting_class_add_dbus_only_property (NMSettingClass *setting_class,
const char *property_name,
const GVariantType *dbus_type,
- NMSettingPropertyGetFunc get_func,
+ NMSettingPropertySynthFunc synth_func,
NMSettingPropertySetFunc set_func);
void _nm_setting_class_override_property (NMSettingClass *setting_class,
@@ -143,6 +148,11 @@ void _nm_setting_class_transform_property (NMSettingClass *setting_class,
NMSettingPropertyTransformToFunc to_dbus,
NMSettingPropertyTransformFromFunc from_dbus);
+gboolean _nm_setting_use_legacy_property (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *legacy_property,
+ const char *new_property);
+
GPtrArray *_nm_setting_need_secrets (NMSetting *setting);
#endif /* NM_SETTING_PRIVATE_H */
diff --git a/libnm-core/nm-setting-serial.c b/libnm-core/nm-setting-serial.c
index 8676cb4e6a..3fd780c838 100644
--- a/libnm-core/nm-setting-serial.c
+++ b/libnm-core/nm-setting-serial.c
@@ -20,6 +20,8 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "nm-setting-serial.h"
@@ -291,6 +293,21 @@ nm_setting_serial_class_init (NMSettingSerialClass *setting_class)
*
* Parity setting of the serial port.
**/
+ /* ---keyfile---
+ * property: parity
+ * format: 'e', 'o', or 'n'
+ * description: 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.
+ * example: parity=n
+ * ---end---
+ * ---dbus---
+ * property: parity
+ * format: byte
+ * description: The connection parity: 69 (ASCII 'E') for even parity,
+ * 111 (ASCII 'o') for odd, 110 (ASCII 'n') for none.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PARITY,
g_param_spec_enum (NM_SETTING_SERIAL_PARITY, "", "",
diff --git a/libnm-core/nm-setting-team-port.c b/libnm-core/nm-setting-team-port.c
index cbdae158e1..7fbf8620f1 100644
--- a/libnm-core/nm-setting-team-port.c
+++ b/libnm-core/nm-setting-team-port.c
@@ -18,10 +18,12 @@
* Copyright 2013 Jiri Pirko <jiri@resnulli.us>
*/
+#include "config.h"
+
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-team-port.h"
#include "nm-utils.h"
@@ -128,6 +130,7 @@ set_property (GObject *object, guint prop_id,
switch (prop_id) {
case PROP_CONFIG:
+ g_free (priv->config);
priv->config = g_value_dup_string (value);
break;
default:
@@ -153,6 +156,16 @@ get_property (GObject *object, guint prop_id,
}
static void
+finalize (GObject *object)
+{
+ NMSettingTeamPortPrivate *priv = NM_SETTING_TEAM_PORT_GET_PRIVATE (object);
+
+ g_free (priv->config);
+
+ G_OBJECT_CLASS (nm_setting_team_port_parent_class)->finalize (object);
+}
+
+static void
nm_setting_team_port_class_init (NMSettingTeamPortClass *setting_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
@@ -163,6 +176,7 @@ nm_setting_team_port_class_init (NMSettingTeamPortClass *setting_class)
/* virtual methods */
object_class->set_property = set_property;
object_class->get_property = get_property;
+ object_class->finalize = finalize;
parent_class->verify = verify;
/* Properties */
@@ -174,6 +188,12 @@ nm_setting_team_port_class_init (NMSettingTeamPortClass *setting_class)
* directly to teamd. If not specified, the default configuration is
* used. See man teamd.conf for the format details.
**/
+ /* ---ifcfg-rh---
+ * property: config
+ * variable: TEAM_PORT_CONFIG
+ * description: Team port configuration in JSON. See man teamd.conf for details.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_CONFIG,
g_param_spec_string (NM_SETTING_TEAM_PORT_CONFIG, "", "",
diff --git a/libnm-core/nm-setting-team.c b/libnm-core/nm-setting-team.c
index 91d80b178b..04b98243f1 100644
--- a/libnm-core/nm-setting-team.c
+++ b/libnm-core/nm-setting-team.c
@@ -18,9 +18,11 @@
* Copyright 2013 Jiri Pirko <jiri@resnulli.us>
*/
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-team.h"
#include "nm-utils.h"
@@ -155,6 +157,12 @@ nm_setting_team_class_init (NMSettingTeamClass *setting_class)
* the value is passed directly to teamd. If not specified, the default
* configuration is used. See man teamd.conf for the format details.
**/
+ /* ---ifcfg-rh---
+ * property: config
+ * variable: TEAM_CONFIG
+ * description: Team configuration in JSON. See man teamd.conf for details.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_CONFIG,
g_param_spec_string (NM_SETTING_TEAM_CONFIG, "", "",
@@ -163,6 +171,14 @@ nm_setting_team_class_init (NMSettingTeamClass *setting_class)
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
+ /* ---dbus---
+ * property: interface-name
+ * format: string
+ * description: Deprecated in favor of connection.interface-name, but can
+ * be used for backward-compatibility with older daemons, to set the
+ * team's interface name.
+ * ---end---
+ */
_nm_setting_class_add_dbus_only_property (parent_class, "interface-name",
G_VARIANT_TYPE_STRING,
_nm_setting_get_deprecated_virtual_interface_name,
diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c
index b0d19c7520..f622ddcbfd 100644
--- a/libnm-core/nm-setting-vlan.c
+++ b/libnm-core/nm-setting-vlan.c
@@ -19,9 +19,11 @@
* Copyright 2011 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-vlan.h"
#include "nm-utils.h"
@@ -221,7 +223,8 @@ nm_setting_vlan_add_priority_str (NMSettingVlan *setting,
list = get_map (setting, map);
item = priority_map_new_from_str (map, str);
- g_return_val_if_fail (item != NULL, FALSE);
+ if (!item)
+ g_return_val_if_reached (FALSE);
/* Duplicates get replaced */
for (iter = list; iter; iter = g_slist_next (iter)) {
@@ -690,6 +693,12 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* not specified, the connection must contain an #NMSettingWired setting
* with a #NMSettingWired:mac-address property.
**/
+ /* ---ifcfg-rh---
+ * property: parent
+ * variable: DEVICE or PHYSDEV
+ * description: Parent interface of the VLAN.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PARENT,
g_param_spec_string (NM_SETTING_VLAN_PARENT, "", "",
@@ -705,6 +714,12 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* The VLAN identifier that the interface created by this connection should
* be assigned.
**/
+ /* ---ifcfg-rh---
+ * property: id
+ * variable: VLAN_ID or DEVICE
+ * description: VLAN identifier.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_ID,
g_param_spec_uint (NM_SETTING_VLAN_ID, "", "",
@@ -723,6 +738,13 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* and %NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its
* master device's operating state).
**/
+ /* ---ifcfg-rh---
+ * property: flags
+ * variable: VLAN_FLAGS, REORDER_HDR
+ * values: "GVRP", "LOOSE_BINDING" for VLAN_FLAGS; 0 or 1 for REORDER_HDR
+ * description: Parent interface of the VLAN.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_FLAGS,
g_param_spec_flags (NM_SETTING_VLAN_FLAGS, "", "",
@@ -740,6 +762,13 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* SKB priorities. The mapping is given in the format "from:to" where both
* "from" and "to" are unsigned integers, ie "7:3".
**/
+ /* ---ifcfg-rh---
+ * property: ingress-property-map
+ * variable: VLAN_INGRESS_PRIORITY_MAP
+ * description: Ingress priority mapping.
+ * example: VLAN_INGRESS_PRIORITY_MAP=4:2,3:5
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_INGRESS_PRIORITY_MAP,
g_param_spec_boxed (NM_SETTING_VLAN_INGRESS_PRIORITY_MAP, "", "",
@@ -755,6 +784,13 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* 802.1p priorities. The mapping is given in the format "from:to" where
* both "from" and "to" are unsigned integers, ie "7:3".
**/
+ /* ---ifcfg-rh---
+ * property: egress-property-map
+ * variable: VLAN_EGRESS_PRIORITY_MAP
+ * description: Egress priority mapping.
+ * example: VLAN_EGRESS_PRIORITY_MAP=5:4,4:1,3:7
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_EGRESS_PRIORITY_MAP,
g_param_spec_boxed (NM_SETTING_VLAN_EGRESS_PRIORITY_MAP, "", "",
@@ -763,6 +799,22 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
+ /* ---ifcfg-rh---
+ * property: interface-name
+ * variable: PHYSDEV and VLAN_ID, or DEVICE
+ * description: VLAN 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
+ * ---end---
+ * ---dbus---
+ * property: interface-name
+ * format: string
+ * description: Deprecated in favor of connection.interface-name, but can
+ * be used for backward-compatibility with older daemons, to set the
+ * vlan's interface name.
+ * ---end---
+ */
_nm_setting_class_add_dbus_only_property (parent_class, "interface-name",
G_VARIANT_TYPE_STRING,
_nm_setting_get_deprecated_virtual_interface_name,
diff --git a/libnm-core/nm-setting-vpn.c b/libnm-core/nm-setting-vpn.c
index 4130412b65..e6fffa8797 100644
--- a/libnm-core/nm-setting-vpn.c
+++ b/libnm-core/nm-setting-vpn.c
@@ -19,10 +19,12 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <errno.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-vpn.h"
#include "nm-utils.h"
@@ -862,6 +864,14 @@ nm_setting_vpn_class_init (NMSettingVpnClass *setting_class)
*
* Type: GHashTable(utf8,utf8)
**/
+ /* ---keyfile---
+ * property: data
+ * variable: separate variables named after keys of the dictionary
+ * description: The keys of the data dictionary are used as variable names directly
+ * under [vpn] section.
+ * example: remote=ovpn.corp.com cipher=AES-256-CBC username=joe
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_DATA,
g_param_spec_boxed (NM_SETTING_VPN_DATA, "", "",
@@ -881,6 +891,14 @@ nm_setting_vpn_class_init (NMSettingVpnClass *setting_class)
*
* Type: GHashTable(utf8,utf8)
**/
+ /* ---keyfile---
+ * property: secrets
+ * variable: separate variables named after keys of the dictionary
+ * description: The keys of the secrets dictionary are used as variable names directly
+ * under [vpn-secrets] section.
+ * example: password=Popocatepetl
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_SECRETS,
g_param_spec_boxed (NM_SETTING_VPN_SECRETS, "", "",
diff --git a/libnm-core/nm-setting-wimax.c b/libnm-core/nm-setting-wimax.c
index ccc46fe4ef..541c0bbfe7 100644
--- a/libnm-core/nm-setting-wimax.c
+++ b/libnm-core/nm-setting-wimax.c
@@ -20,9 +20,11 @@
* Copyright 2009 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wimax.h"
#include "nm-setting-private.h"
diff --git a/libnm-core/nm-setting-wired.c b/libnm-core/nm-setting-wired.c
index 7bf1ae2f26..2a7479405d 100644
--- a/libnm-core/nm-setting-wired.c
+++ b/libnm-core/nm-setting-wired.c
@@ -20,9 +20,11 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wired.h"
#include "nm-utils.h"
@@ -410,10 +412,11 @@ nm_setting_wired_get_num_s390_options (NMSettingWired *setting)
* @setting: the #NMSettingWired
* @idx: index of the desired option, from 0 to
* nm_setting_wired_get_num_s390_options() - 1
- * @out_key: (out): on return, the key name of the s390 specific option; this
- * value is owned by the setting and should not be modified
- * @out_value: (out): on return, the value of the key of the s390 specific
- * option; this value is owned by the setting and should not be modified
+ * @out_key: (out) (transfer none): on return, the key name of the s390 specific
+ * option; this value is owned by the setting and should not be modified
+ * @out_value: (out) (transfer none): on return, the value of the key of the
+ * s390 specific option; this value is owned by the setting and should not be
+ * modified
*
* Given an index, return the value of the s390 option at that index. indexes
* are *not* guaranteed to be static across modifications to options done by
@@ -431,27 +434,24 @@ nm_setting_wired_get_s390_option (NMSettingWired *setting,
const char **out_key,
const char **out_value)
{
- NMSettingWiredPrivate *priv;
- guint32 num_keys;
- GList *keys;
- const char *_key = NULL, *_value = NULL;
+ const char *_key, *_value;
+ GHashTableIter iter;
+ guint i = 0;
g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE);
- priv = NM_SETTING_WIRED_GET_PRIVATE (setting);
-
- num_keys = nm_setting_wired_get_num_s390_options (setting);
- g_return_val_if_fail (idx < num_keys, FALSE);
-
- keys = g_hash_table_get_keys (priv->s390_options);
- _key = g_list_nth_data (keys, idx);
- _value = g_hash_table_lookup (priv->s390_options, _key);
-
- if (out_key)
- *out_key = _key;
- if (out_value)
- *out_value = _value;
- return TRUE;
+ g_hash_table_iter_init (&iter, NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options);
+ while (g_hash_table_iter_next (&iter, (gpointer) &_key, (gpointer) &_value)) {
+ if (i == idx) {
+ if (out_key)
+ *out_key = _key;
+ if (out_value)
+ *out_value = _value;
+ return TRUE;
+ }
+ i++;
+ }
+ g_return_val_if_reached (FALSE);
}
/**
@@ -832,6 +832,12 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* Interface), "bnc" (Thin Ethernet) or "mii" (Media Independent Interface.
* If the device supports only one port type, this setting is ignored.
**/
+ /* ---ifcfg-rh---
+ * property: port
+ * variable: (none)
+ * description: The property is not saved by the plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PORT,
g_param_spec_string (NM_SETTING_WIRED_PORT, "", "",
@@ -845,6 +851,12 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* If non-zero, request that the device use only the specified speed. In
* Mbit/s, ie 100 == 100Mbit/s.
**/
+ /* ---ifcfg-rh---
+ * property: speed
+ * variable: (none)
+ * description: The property is not saved by the plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_SPEED,
g_param_spec_uint (NM_SETTING_WIRED_SPEED, "", "",
@@ -859,6 +871,12 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* If specified, request that the device only use the specified duplex mode.
* Either "half" or "full".
**/
+ /* ---ifcfg-rh---
+ * property: duplex
+ * variable: (none)
+ * description: The property is not saved by the plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_DUPLEX,
g_param_spec_string (NM_SETTING_WIRED_DUPLEX, "", "",
@@ -873,6 +891,12 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* %FALSE, do not allow auto-negotiation, in which case the "speed" and
* "duplex" properties should be set.
**/
+ /* ---ifcfg-rh---
+ * property: auto-negotiate
+ * variable: (none)
+ * description: The property is not saved by the plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_AUTO_NEGOTIATE,
g_param_spec_boolean (NM_SETTING_WIRED_AUTO_NEGOTIATE, "", "",
@@ -888,6 +912,20 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* whose permanent MAC address matches. This property does not change the
* MAC address of the device (i.e. MAC spoofing).
**/
+ /* ---keyfile---
+ * property: mac-address
+ * format: ususal hex-digits-and-colons notation
+ * description: MAC 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)
+ * ---end---
+ * ---ifcfg-rh---
+ * property: mac-address
+ * variable: HWADDR
+ * description: Hardware address of the device in traditional hex-digits-and-colons
+ * notation (e.g. 00:22:68:14:5A:05).
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
g_param_spec_string (NM_SETTING_WIRED_MAC_ADDRESS, "", "",
@@ -906,6 +944,20 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* If specified, request that the device use this MAC address instead of its
* permanent MAC address. This is known as MAC cloning or spoofing.
**/
+ /* ---keyfile---
+ * property: cloned-mac-address
+ * format: ususal hex-digits-and-colons notation
+ * description: Cloned 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).
+ * ---end---
+ * ---ifcfg-rh---
+ * property: cloned-mac-address
+ * variable: MACADDR
+ * description: Cloned (spoofed) MAC address in traditional hex-digits-and-colons
+ * notation (e.g. 00:22:68:14:5A:99).
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_CLONED_MAC_ADDRESS,
g_param_spec_string (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, "", "",
@@ -926,6 +978,20 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* address is in the standard hex-digits-and-colons notation
* (00:11:22:33:44:55).
**/
+ /* ---keyfile---
+ * property: mac-address-blacklist
+ * format: list of MACs (separated with semicolons)
+ * description: MAC address blacklist.
+ * example: mac-address-blacklist= 00:22:68:12:79:A6;00:22:68:12:79:78
+ * ---end---
+ * ---ifcfg-rh---
+ * property: mac-address-blacklist
+ * variable: HWADDR_BLACKLIST(+)
+ * description: 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"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS_BLACKLIST,
g_param_spec_boxed (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, "", "",
@@ -940,6 +1006,12 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* If non-zero, only transmit packets of the specified size or smaller,
* breaking larger packets up into multiple Ethernet frames.
**/
+ /* ---ifcfg-rh---
+ * property: mtu
+ * variable: MTU
+ * description: MTU of the interface.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MTU,
g_param_spec_uint (NM_SETTING_WIRED_MTU, "", "",
@@ -960,6 +1032,13 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* and each string may only be composed of hexadecimal characters and the
* period (.) character.
**/
+ /* ---ifcfg-rh---
+ * property: s390-subchannels
+ * variable: SUBCHANNELS
+ * description: Subchannels for IBM S390 hosts.
+ * example: SUBCHANNELS=0.0.b00a,0.0.b00b,0.0.b00c
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_S390_SUBCHANNELS,
g_param_spec_boxed (NM_SETTING_WIRED_S390_SUBCHANNELS, "", "",
@@ -974,6 +1053,14 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* s390 network device type; one of "qeth", "lcs", or "ctc", representing
* the different types of virtual network devices available on s390 systems.
**/
+ /* ---ifcfg-rh---
+ * property: s390-nettype
+ * variable: NETTYPE
+ * values: "qeth", "lcs" or "ctc"
+ * description: Network type of the S390 host.
+ * example: NETTYPE=qeth
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_S390_NETTYPE,
g_param_spec_string (NM_SETTING_WIRED_S390_NETTYPE, "", "",
@@ -992,6 +1079,13 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
*
* Type: GHashTable(utf8,utf8)
**/
+ /* ---ifcfg-rh---
+ * property: s390-options
+ * variable: OPTIONS and PORTNAME, CTCPROTO,
+ * description: S390 device options. All options go to OPTIONS, except for
+ * "portname" and "ctcprot" that have their own variables.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_S390_OPTIONS,
g_param_spec_boxed (NM_SETTING_WIRED_S390_OPTIONS, "", "",
diff --git a/libnm-core/nm-setting-wireless-security.c b/libnm-core/nm-setting-wireless-security.c
index 35ef2fdcbe..a56a8e9757 100644
--- a/libnm-core/nm-setting-wireless-security.c
+++ b/libnm-core/nm-setting-wireless-security.c
@@ -20,9 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wireless-security.h"
#include "nm-setting-8021x.h"
@@ -821,7 +822,7 @@ need_secrets (NMSetting *setting)
if ( priv->auth_alg
&& !strcmp (priv->auth_alg, "leap")
&& !strcmp (priv->key_mgmt, "ieee8021x")) {
- if (!priv->leap_password || !strlen (priv->leap_password)) {
+ if (!priv->leap_password || !*priv->leap_password) {
g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
return secrets;
}
@@ -892,14 +893,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME);
return FALSE;
}
- if (priv->leap_password && !strlen (priv->leap_password)) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_MISSING_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
- return FALSE;
- }
} else {
if ( (strcmp (priv->key_mgmt, "ieee8021x") == 0)
|| (strcmp (priv->key_mgmt, "wpa-eap") == 0)) {
@@ -944,39 +937,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->wep_key0 && !nm_utils_wep_key_valid (priv->wep_key0, priv->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, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0);
- return FALSE;
- }
- if (priv->wep_key1 && !nm_utils_wep_key_valid (priv->wep_key1, priv->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, NM_SETTING_WIRELESS_SECURITY_WEP_KEY1);
- return FALSE;
- }
- if (priv->wep_key2 && !nm_utils_wep_key_valid (priv->wep_key2, priv->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, NM_SETTING_WIRELESS_SECURITY_WEP_KEY2);
- return FALSE;
- }
- if (priv->wep_key3 && !nm_utils_wep_key_valid (priv->wep_key3, priv->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, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3);
- return FALSE;
- }
-
if (priv->auth_alg && !_nm_utils_string_in_list (priv->auth_alg, valid_auth_algs)) {
g_set_error_literal (error,
NM_CONNECTION_ERROR,
@@ -986,15 +946,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- 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;
- }
-
if (priv->proto && !_nm_utils_string_slist_validate (priv->proto, valid_protos)) {
g_set_error_literal (error,
NM_CONNECTION_ERROR,
@@ -1329,6 +1280,13 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* WPA-PSK), or "wpa-eap" (WPA-Enterprise). This property must be set for
* any Wi-Fi connection that uses security.
**/
+ /* ---ifcfg-rh---
+ * property: key-mgmt
+ * variable: KEY_MGMT(+)
+ * values: IEEE8021X, WPA-PSK, WPA-EAP
+ * description: Key management menthod.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_KEY_MGMT,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "", "",
@@ -1345,6 +1303,14 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* (default key) through 3. Note that some consumer access points (like the
* Linksys WRT54G) number the keys 1 - 4.
**/
+ /* ---ifcfg-rh---
+ * property: wep-tx-keyidx
+ * variable: DEFAULTKEY
+ * values: 1, 2, 3, 4
+ * default: 1
+ * description: Index of active WEP key.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_WEP_TX_KEYIDX,
g_param_spec_uint (NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, "", "",
@@ -1362,6 +1328,13 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* using Cisco LEAP (ie, key-mgmt = "ieee8021x" and auth-alg = "leap") the
* "leap-username" and "leap-password" properties must be specified.
**/
+ /* ---ifcfg-rh---
+ * property: auth-alg
+ * variable: SECURITYMODE(+)
+ * values: restricted, open, leap
+ * description: Authentication algorithm for WEP.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_AUTH_ALG,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "", "",
@@ -1376,6 +1349,14 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Each element may be one "wpa" (allow WPA) or "rsn" (allow WPA2/RSN). If
* not specified, both WPA and RSN connections are allowed.
**/
+ /* ---ifcfg-rh---
+ * property: proto
+ * variable: WPA_ALLOW_WPA(+), WPA_ALLOW_WPA2(+)
+ * values: yes, no
+ * default: no
+ * description: Allowed WPA protocols, WPA and WPA2 (RSN).
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PROTO,
g_param_spec_boxed (NM_SETTING_WIRELESS_SECURITY_PROTO, "", "",
@@ -1391,6 +1372,14 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* For maximum compatibility leave this property empty. Each list element
* may be one of "tkip" or "ccmp".
**/
+ /* ---ifcfg-rh---
+ * property: pairwise
+ * variable: CIPHER_PAIRWISE(+)
+ * values: CCMP, TKIP
+ * description: Restrict pairwise encryption algorithms, specified as a space
+ * separated list.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PAIRWISE,
g_param_spec_boxed (NM_SETTING_WIRELESS_SECURITY_PAIRWISE, "", "",
@@ -1406,6 +1395,14 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* in the list. For maximum compatibility leave this property empty. Each
* list element may be one of "wep40", "wep104", "tkip", or "ccmp".
**/
+ /* ---ifcfg-rh---
+ * property: group
+ * variable: CIPHER_GROUP(+)
+ * values: CCMP, TKIP, WEP40, WEP104
+ * description: Restrict group/broadcast encryption algorithms, specified as a space
+ * separated list.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_GROUP,
g_param_spec_boxed (NM_SETTING_WIRELESS_SECURITY_GROUP, "", "",
@@ -1419,6 +1416,12 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* The login username for legacy LEAP connections (ie, key-mgmt =
* "ieee8021x" and auth-alg = "leap").
**/
+ /* ---ifcfg-rh---
+ * property: leap-username
+ * variable: IEEE_8021X_IDENTITY(+)
+ * description: Login name for LEAP.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_LEAP_USERNAME,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, "", "",
@@ -1432,6 +1435,12 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Index 0 WEP key. This is the WEP key used in most networks. See the
* "wep-key-type" property for a description of how this key is interpreted.
**/
+ /* ---ifcfg-rh---
+ * property: wep-key0
+ * variable: KEY1, KEY_PASSPHRASE1(+)
+ * description: The first WEP key (used in most networks). See also DEFAULTKEY for key index.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_WEP_KEY0,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, "", "",
@@ -1446,6 +1455,12 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Index 1 WEP key. This WEP index is not used by most networks. See the
* "wep-key-type" property for a description of how this key is interpreted.
**/
+ /* ---ifcfg-rh---
+ * property: wep-key1
+ * variable: KEY2, KEY_PASSPHRASE2(+)
+ * description: WEP key with index 1. See also DEFAULTKEY for key index.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_WEP_KEY1,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, "", "",
@@ -1460,6 +1475,12 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Index 2 WEP key. This WEP index is not used by most networks. See the
* "wep-key-type" property for a description of how this key is interpreted.
**/
+ /* ---ifcfg-rh---
+ * property: wep-key2
+ * variable: KEY3, KEY_PASSPHRASE3(+)
+ * description: WEP key with index 2. See also DEFAULTKEY for key index.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_WEP_KEY2,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, "", "",
@@ -1474,6 +1495,12 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Index 3 WEP key. This WEP index is not used by most networks. See the
* "wep-key-type" property for a description of how this key is interpreted.
**/
+ /* ---ifcfg-rh---
+ * property: wep-key3
+ * variable: KEY4, KEY_PASSPHRASE4(+)
+ * description: WEP key with index 3. See also DEFAULTKEY for key index.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_WEP_KEY3,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, "", "",
@@ -1489,6 +1516,13 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* #NMSettingWirelessSecurity:wep-key1, #NMSettingWirelessSecurity:wep-key2,
* and #NMSettingWirelessSecurity:wep-key3 properties.
**/
+ /* ---ifcfg-rh---
+ * property: wep-key-flags
+ * variable: WEP_KEY_FLAGS(+)
+ * format: NMSettingSecretFlags
+ * description: Password flags for KEY<i>, KEY_PASSPHRASE<i> password.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_WEP_KEY_FLAGS,
g_param_spec_flags (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_FLAGS, "", "",
@@ -1507,6 +1541,12 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* WPA passphrase, and is hashed to derive the actual WPA-PSK used when
* connecting to the Wi-Fi network.
**/
+ /* ---ifcfg-rh---
+ * property: psk
+ * variable: WPA_PSK
+ * description: Pre-Shared-Key for WPA networks.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PSK,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_PSK, "", "",
@@ -1521,6 +1561,14 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Flags indicating how to handle the #NMSettingWirelessSecurity:psk
* property.
**/
+ /* ---ifcfg-rh---
+ * property: psk-flags
+ * variable: WPA_PSK_FLAGS(+)
+ * format: NMSettingSecretFlags
+ * description: Password flags for WPA_PSK_FLAGS.
+ * example: WPA_PSK_FLAGS=user
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_PSK_FLAGS,
g_param_spec_flags (NM_SETTING_WIRELESS_SECURITY_PSK_FLAGS, "", "",
@@ -1535,6 +1583,13 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* The login password for legacy LEAP connections (ie, key-mgmt =
* "ieee8021x" and auth-alg = "leap").
**/
+ /* ---ifcfg-rh---
+ * property: leap-password
+ * variable: IEEE_8021X_PASSWORD(+)
+ * description: Password for LEAP. It can also go to "key-"
+ * lookaside file, or it can be owned by a secret agent.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_LEAP_PASSWORD,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, "", "",
@@ -1549,6 +1604,13 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Flags indicating how to handle the
* #NMSettingWirelessSecurity:leap-password property.
**/
+ /* ---ifcfg-rh---
+ * property: leap-password-flags
+ * variable: IEEE_8021X_PASSWORD_FLAGS(+)
+ * format: NMSettingSecretFlags
+ * description: Password flags for IEEE_8021X_PASSWORD_FLAGS.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_LEAP_PASSWORD_FLAGS,
g_param_spec_flags (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD_FLAGS, "", "",
@@ -1567,6 +1629,15 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* as a string and will be hashed using the de-facto MD5 method to derive
* the actual WEP key.
**/
+ /* ---ifcfg-rh---
+ * property: wep-key-type
+ * variable: KEY<i> or KEY_PASSPHRASE<i>(+)
+ * description: KEY is used for "key" type (10 or 26 hexadecimal characters,
+ * or 5 or 13 character string prefixed with "s:"). KEY_PASSPHRASE is used
+ * for WEP passphrases.
+ * example: KEY1=s:ahoj, KEY1=0a1c45bc02, KEY_PASSPHRASE1=mysupersecretkey
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_WEP_KEY_TYPE,
g_param_spec_enum (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, "", "",
diff --git a/libnm-core/nm-setting-wireless.c b/libnm-core/nm-setting-wireless.c
index d374d91b7c..075af10224 100644
--- a/libnm-core/nm-setting-wireless.c
+++ b/libnm-core/nm-setting-wireless.c
@@ -20,9 +20,11 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wireless.h"
#include "nm-dbus-interface.h"
@@ -58,6 +60,7 @@ typedef struct {
guint32 mtu;
GSList *seen_bssids;
gboolean hidden;
+ guint32 powersave;
} NMSettingWirelessPrivate;
enum {
@@ -75,6 +78,7 @@ enum {
PROP_MTU,
PROP_SEEN_BSSIDS,
PROP_HIDDEN,
+ PROP_POWERSAVE,
LAST_PROP
};
@@ -293,7 +297,7 @@ nm_setting_wireless_new (void)
* nm_setting_wireless_get_ssid:
* @setting: the #NMSettingWireless
*
- * Returns: the #NMSettingWireless:ssid property of the setting
+ * Returns: (transfer none): the #NMSettingWireless:ssid property of the setting
**/
GBytes *
nm_setting_wireless_get_ssid (NMSettingWireless *setting)
@@ -600,6 +604,22 @@ nm_setting_wireless_get_hidden (NMSettingWireless *setting)
}
/**
+ * 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
* @bssid: the new BSSID to add to the list
@@ -914,6 +934,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;
@@ -967,6 +990,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;
@@ -993,16 +1019,25 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
*
* SSID of the Wi-Fi network. Must be specified.
**/
+ /* ---keyfile---
+ * property: ssid
+ * format: string (or decimal-byte list - obsolete)
+ * description: SSID of Wi-Fi network.
+ * example: ssid=Quick Net
+ * ---end---
+ * ---ifcfg-rh---
+ * property: ssid
+ * variable: ESSID
+ * description: SSID of Wi-Fi network.
+ * example: ESSID="Quick Net"
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_SSID,
g_param_spec_boxed (NM_SETTING_WIRELESS_SSID, "", "",
G_TYPE_BYTES,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
- _nm_setting_class_transform_property (parent_class, NM_SETTING_WIRELESS_SSID,
- G_VARIANT_TYPE_BYTESTRING,
- _nm_utils_bytes_to_dbus,
- _nm_utils_bytes_from_dbus);
/**
* NMSettingWireless:mode:
@@ -1010,6 +1045,13 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* Wi-Fi network mode; one of "infrastructure", "adhoc" or "ap". If blank,
* infrastructure is assumed.
**/
+ /* ---ifcfg-rh---
+ * property: mode
+ * variable: MODE
+ * values: Ad-Hoc, Managed (Auto) [case insensitive]
+ * description: Wi-Fi network mode.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MODE,
g_param_spec_string (NM_SETTING_WIRELESS_MODE, "", "",
@@ -1027,6 +1069,15 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* settings are compatible. This setting depends on specific driver
* capability and may not work with all drivers.
**/
+ /* ---ifcfg-rh---
+ * property: band
+ * variable: BAND(+)
+ * values: a, bg
+ * description: BAND alone is honored, but CHANNEL overrides BAND since it
+ * implies a band.
+ * example: BAND=bg
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_BAND,
g_param_spec_string (NM_SETTING_WIRELESS_BAND, "", "",
@@ -1042,6 +1093,15 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* channel. Because channel numbers overlap between bands, this property
* also requires the "band" property to be set.
**/
+ /* ---ifcfg-rh---
+ * property: channel
+ * variable: CHANNEL
+ * description: Channel used for the Wi-Fi communication.
+ * Channels greater than 14 mean "a" band, otherwise the
+ * band is "bg".
+ * example: CHANNEL=6
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_CHANNEL,
g_param_spec_uint (NM_SETTING_WIRELESS_CHANNEL, "", "",
@@ -1058,6 +1118,13 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* all devices. Note: this property does not control the BSSID used when
* creating an Ad-Hoc network and is unlikely to in the future.
**/
+ /* ---ifcfg-rh---
+ * property: bssid
+ * variable: BSSID(+)
+ * description: Restricts association only to a single AP.
+ * example: BSSID=00:1E:BD:64:83:21
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_BSSID,
g_param_spec_string (NM_SETTING_WIRELESS_BSSID, "", "",
@@ -1077,6 +1144,12 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* Mbit/s. This property is highly driver dependent and not all devices
* support setting a static bitrate.
**/
+ /* ---ifcfg-rh---
+ * property: rate
+ * variable: (none)
+ * description: This property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_RATE,
g_param_spec_uint (NM_SETTING_WIRELESS_RATE, "", "",
@@ -1093,6 +1166,12 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* Units are dBm. This property is highly driver dependent and not all
* devices support setting a static transmit power.
**/
+ /* ---ifcfg-rh---
+ * property: tx-power
+ * variable: (none)
+ * description: This property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_TX_POWER,
g_param_spec_uint (NM_SETTING_WIRELESS_TX_POWER, "", "",
@@ -1109,6 +1188,20 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* permanent MAC address matches. This property does not change the MAC
* address of the device (i.e. MAC spoofing).
**/
+ /* ---keyfile---
+ * property: mac-address
+ * format: ususal hex-digits-and-colons notation
+ * description: MAC 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).
+ * ---end---
+ * ---ifcfg-rh---
+ * property: mac-address
+ * variable: HWADDR
+ * description: Hardware address of the device in traditional hex-digits-and-colons
+ * notation (e.g. 00:22:68:14:5A:05).
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
g_param_spec_string (NM_SETTING_WIRELESS_MAC_ADDRESS, "", "",
@@ -1126,6 +1219,20 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* If specified, request that the Wi-Fi device use this MAC address instead
* of its permanent MAC address. This is known as MAC cloning or spoofing.
**/
+ /* ---keyfile---
+ * property: cloned-mac-address
+ * format: ususal hex-digits-and-colons notation
+ * description: Cloned 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).
+ * ---end---
+ * ---ifcfg-rh---
+ * property: cloned-mac-address
+ * variable: MACADDR
+ * description: Cloned (spoofed) MAC address in traditional hex-digits-and-colons
+ * notation (e.g. 00:22:68:14:5A:99).
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_CLONED_MAC_ADDRESS,
g_param_spec_string (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, "", "",
@@ -1144,6 +1251,19 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* 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").
**/
+ /* ---keyfile---
+ * property: mac-address-blacklist
+ * format: list of MACs (separated with semicolons)
+ * description: MAC address blacklist.
+ * example: mac-address-blacklist= 00:22:68:12:79:A6;00:22:68:12:79:78
+ * ---end---
+ * ---ifcfg-rh---
+ * property: mac-address-blacklist
+ * variable: HWADDR_BLACKLIST(+)
+ * description: It denies usage of the connection for any device whose address
+ * is listed.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS_BLACKLIST,
g_param_spec_boxed (NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST, "", "",
@@ -1162,6 +1282,12 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* NetworkManager. The changes you make to this property will not be
* preserved.
**/
+ /* ---ifcfg-rh---
+ * property: seen-bssids
+ * variable: (none)
+ * description: This property is not handled by ifcfg-rh plugin.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_SEEN_BSSIDS,
g_param_spec_boxed (NM_SETTING_WIRELESS_SEEN_BSSIDS, "", "",
@@ -1176,6 +1302,12 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* If non-zero, only transmit packets of the specified size or smaller,
* breaking larger packets up into multiple Ethernet frames.
**/
+ /* ---ifcfg-rh---
+ * property: mtu
+ * variable: MTU
+ * description: MTU of the wireless interface.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_MTU,
g_param_spec_uint (NM_SETTING_WIRELESS_MTU, "", "",
@@ -1194,6 +1326,12 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* these workarounds expose inherent insecurities with hidden SSID networks,
* and thus hidden SSID networks should be used with caution.
**/
+ /* ---ifcfg-rh---
+ * property: hidden
+ * variable: SSID_HIDDEN(+)
+ * description: Whether the network hides the SSID.
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_HIDDEN,
g_param_spec_boolean (NM_SETTING_WIRELESS_HIDDEN, "", "",
@@ -1201,7 +1339,37 @@ 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
+ **/
+ 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));
+
/* Compatibility for deprecated property */
+ /* ---ifcfg-rh---
+ * property: security
+ * variable: (none)
+ * description: This property is deprecated and not handled by ifcfg-rh-plugin.
+ * ---end---
+ * ---dbus---
+ * property: security
+ * description: This 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.
+ * ---end---
+ */
_nm_setting_class_add_dbus_only_property (parent_class, "security",
G_VARIANT_TYPE_STRING,
nm_setting_wireless_get_security, NULL);
diff --git a/libnm-core/nm-setting-wireless.h b/libnm-core/nm-setting-wireless.h
index 98fa98dc6c..46ae6e6dba 100644
--- a/libnm-core/nm-setting-wireless.h
+++ b/libnm-core/nm-setting-wireless.h
@@ -55,6 +55,7 @@ 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"
/**
* NM_SETTING_WIRELESS_MODE_ADHOC:
@@ -118,6 +119,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-core/nm-setting.c b/libnm-core/nm-setting.c
index 645d8d3a8f..b78d9376ff 100644
--- a/libnm-core/nm-setting.c
+++ b/libnm-core/nm-setting.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include "nm-setting.h"
@@ -291,6 +293,7 @@ typedef struct {
const GVariantType *dbus_type;
NMSettingPropertyGetFunc get_func;
+ NMSettingPropertySynthFunc synth_func;
NMSettingPropertySetFunc set_func;
NMSettingPropertyNotSetFunc not_set_func;
@@ -325,6 +328,7 @@ add_property_override (NMSettingClass *setting_class,
GParamSpec *param_spec,
const GVariantType *dbus_type,
NMSettingPropertyGetFunc get_func,
+ NMSettingPropertySynthFunc synth_func,
NMSettingPropertySetFunc set_func,
NMSettingPropertyNotSetFunc not_set_func,
NMSettingPropertyTransformToFunc to_dbus,
@@ -341,6 +345,7 @@ add_property_override (NMSettingClass *setting_class,
override.param_spec = param_spec;
override.dbus_type = dbus_type;
override.get_func = get_func;
+ override.synth_func = synth_func;
override.set_func = set_func;
override.not_set_func = not_set_func;
override.to_dbus = to_dbus;
@@ -361,30 +366,27 @@ add_property_override (NMSettingClass *setting_class,
* @setting_class: the setting class
* @property_name: the name of the property to override
* @dbus_type: the type of the property (in its D-Bus representation)
- * @get_func: (allow-none): function to call to get the value of the property
+ * @synth_func: (allow-none): function to call to synthesize a value for the property
* @set_func: (allow-none): function to call to set the value of the property
*
* Registers a property named @property_name, which will be used in the D-Bus
* serialization of objects of @setting_class, but which does not correspond to
* a #GObject property.
*
- * When serializing a setting to D-Bus, @get_func will be called to get the
- * property's value. (If it returns %NULL, no value will be added to the
- * serialization. If @get_func is %NULL, the property will always be omitted in
- * the serialization.)
+ * When serializing a setting to D-Bus, @synth_func will be called to synthesize
+ * a value for the property. (If it returns %NULL, no value will be added to the
+ * serialization. If @synth_func is %NULL, the property will always be omitted
+ * in the serialization.)
*
* When deserializing a D-Bus representation into a setting, if @property_name
- * is present, then @set_func will be called to set (and/or verify) it. If it
- * returns %TRUE, the value is considered to have been successfully set; if it
- * returns %FALSE then the deserializing operation as a whole will fail with the
- * returned #GError. (If @set_func is %NULL then the property will be ignored
- * when deserializing.)
+ * is present, then @set_func will be called to set it. (If @set_func is %NULL
+ * then the property will be ignored when deserializing.)
*/
void
_nm_setting_class_add_dbus_only_property (NMSettingClass *setting_class,
const char *property_name,
const GVariantType *dbus_type,
- NMSettingPropertyGetFunc get_func,
+ NMSettingPropertySynthFunc synth_func,
NMSettingPropertySetFunc set_func)
{
g_return_if_fail (NM_IS_SETTING_CLASS (setting_class));
@@ -395,7 +397,7 @@ _nm_setting_class_add_dbus_only_property (NMSettingClass *setting_class,
add_property_override (setting_class,
property_name, NULL, dbus_type,
- get_func, set_func, NULL,
+ NULL, synth_func, set_func, NULL,
NULL, NULL);
}
@@ -412,17 +414,15 @@ _nm_setting_class_add_dbus_only_property (NMSettingClass *setting_class,
* @property_name on @setting_class.
*
* When serializing a setting to D-Bus, if @get_func is non-%NULL, then it will
- * be called to get the property's value. If it returns %TRUE, the value will be
- * added to the hash, and if %FALSE, it will not. (If @get_func is %NULL, the
- * property will be read normally with g_object_get_property(), and added to the
- * hash if it is not the default value.)
+ * be called to get the property's value. If it returns a #GVariant, the
+ * property will be added to the hash, and if it returns %NULL, the property
+ * will be omitted. (If @get_func is %NULL, the property will be read normally
+ * with g_object_get_property(), and added to the hash if it is not the default
+ * value.)
*
* When deserializing a D-Bus representation into a setting, if @property_name
- * is present, then @set_func will be called to set (and/or verify) it. If it
- * returns %TRUE, the value is considered to have been successfully set; if it
- * returns %FALSE then the deserializing operation as a whole will fail with the
- * returned #GError. (If @set_func is %NULL then the property will be set normally
- * with g_object_set_property().)
+ * is present, then @set_func will be called to set it. (If @set_func is %NULL
+ * then the property will be set normally with g_object_set_property().)
*
* If @not_set_func is non-%NULL, then it will be called when deserializing a
* representation that does NOT contain @property_name. This can be used, eg, if
@@ -444,7 +444,7 @@ _nm_setting_class_override_property (NMSettingClass *setting_class,
add_property_override (setting_class,
property_name, param_spec, dbus_type,
- get_func, set_func, not_set_func,
+ get_func, NULL, set_func, not_set_func,
NULL, NULL);
}
@@ -478,10 +478,46 @@ _nm_setting_class_transform_property (NMSettingClass *setting_class,
add_property_override (setting_class,
property, param_spec, dbus_type,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
to_dbus, from_dbus);
}
+gboolean
+_nm_setting_use_legacy_property (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *legacy_property,
+ const char *new_property)
+{
+ GVariant *setting_dict, *value;
+
+ setting_dict = g_variant_lookup_value (connection_dict, nm_setting_get_name (NM_SETTING (setting)), NM_VARIANT_TYPE_SETTING);
+ g_return_val_if_fail (setting_dict != NULL, FALSE);
+
+ /* If the new property isn't set, we have to use the legacy property. */
+ value = g_variant_lookup_value (setting_dict, new_property, NULL);
+ if (!value) {
+ g_variant_unref (setting_dict);
+ return TRUE;
+ }
+ g_variant_unref (value);
+
+ /* Otherwise, clients always prefer new properties sent from the daemon. */
+ if (!_nm_utils_is_manager_process) {
+ g_variant_unref (setting_dict);
+ return FALSE;
+ }
+
+ /* The daemon prefers the legacy property if it exists. */
+ value = g_variant_lookup_value (setting_dict, legacy_property, NULL);
+ g_variant_unref (setting_dict);
+
+ if (value) {
+ g_variant_unref (value);
+ return TRUE;
+ } else
+ return FALSE;
+}
+
static GArray *
nm_setting_class_ensure_properties (NMSettingClass *setting_class)
{
@@ -576,6 +612,12 @@ variant_type_for_gtype (GType type)
return G_VARIANT_TYPE_DOUBLE;
else if (type == G_TYPE_STRV)
return G_VARIANT_TYPE_STRING_ARRAY;
+ else if (type == G_TYPE_BYTES)
+ return G_VARIANT_TYPE_BYTESTRING;
+ else if (g_type_is_a (type, G_TYPE_ENUM))
+ return G_VARIANT_TYPE_INT32;
+ else if (g_type_is_a (type, G_TYPE_FLAGS))
+ return G_VARIANT_TYPE_UINT32;
else
g_assert_not_reached ();
}
@@ -588,7 +630,10 @@ get_property_for_dbus (NMSetting *setting,
GValue prop_value = { 0, };
GVariant *dbus_value;
- g_return_val_if_fail (property->param_spec != NULL, NULL);
+ if (property->get_func)
+ return property->get_func (setting, property->name);
+ else
+ g_return_val_if_fail (property->param_spec != NULL, NULL);
g_value_init (&prop_value, property->param_spec->value_type);
g_object_get_property (G_OBJECT (setting), property->param_spec->name, &prop_value);
@@ -606,6 +651,8 @@ get_property_for_dbus (NMSetting *setting,
dbus_value = g_variant_new_int32 (g_value_get_enum (&prop_value));
else if (g_type_is_a (prop_value.g_type, G_TYPE_FLAGS))
dbus_value = g_variant_new_uint32 (g_value_get_flags (&prop_value));
+ else if (prop_value.g_type == G_TYPE_BYTES)
+ dbus_value = _nm_utils_bytes_to_dbus (&prop_value);
else
dbus_value = g_dbus_gvalue_to_gvariant (&prop_value, variant_type_for_gtype (prop_value.g_type));
g_value_unset (&prop_value);
@@ -613,15 +660,40 @@ get_property_for_dbus (NMSetting *setting,
return dbus_value;
}
-static void
-set_property_from_dbus (const NMSettingProperty *property, GVariant *src_value, GValue *dst_value)
+static gboolean
+set_property_from_dbus (const NMSettingProperty *property,
+ GVariant *src_value,
+ GValue *dst_value)
{
- g_return_if_fail (property->param_spec != NULL);
+ g_return_val_if_fail (property->param_spec != NULL, FALSE);
+
+ if (property->from_dbus) {
+ if (!g_variant_type_equal (g_variant_get_type (src_value), property->dbus_type))
+ return FALSE;
- if (property->from_dbus)
property->from_dbus (src_value, dst_value);
- else
- g_dbus_gvariant_to_gvalue (src_value, dst_value);
+ } else if (dst_value->g_type == G_TYPE_BYTES) {
+ if (!g_variant_is_of_type (src_value, G_VARIANT_TYPE_BYTESTRING))
+ return FALSE;
+
+ _nm_utils_bytes_from_dbus (src_value, dst_value);
+ } else {
+ GValue tmp = G_VALUE_INIT;
+
+ g_dbus_gvariant_to_gvalue (src_value, &tmp);
+ if (G_VALUE_TYPE (&tmp) == G_VALUE_TYPE (dst_value))
+ *dst_value = tmp;
+ else {
+ gboolean success;
+
+ success = g_value_transform (&tmp, dst_value);
+ g_value_unset (&tmp);
+ if (!success)
+ return FALSE;
+ }
+ }
+
+ return TRUE;
}
@@ -656,14 +728,18 @@ _nm_setting_to_dbus (NMSetting *setting, NMConnection *connection, NMConnectionS
const NMSettingProperty *property = &properties[i];
GParamSpec *prop_spec = property->param_spec;
- if (!prop_spec && !property->get_func) {
- /* Override property with no get_func, so we skip it. */
+ if (!prop_spec && !property->synth_func) {
+ /* D-Bus-only property with no synth_func, so we skip it. */
continue;
}
if (prop_spec && !(prop_spec->flags & G_PARAM_WRITABLE))
continue;
+ if ( prop_spec && (prop_spec->flags & NM_SETTING_PARAM_LEGACY)
+ && !_nm_utils_is_manager_process)
+ continue;
+
if ( (flags & NM_CONNECTION_SERIALIZE_NO_SECRETS)
&& (prop_spec && (prop_spec->flags & NM_SETTING_PARAM_SECRET)))
continue;
@@ -672,12 +748,10 @@ _nm_setting_to_dbus (NMSetting *setting, NMConnection *connection, NMConnectionS
&& !(prop_spec && (prop_spec->flags & NM_SETTING_PARAM_SECRET)))
continue;
- if (property->get_func)
- dbus_value = property->get_func (setting, connection, property->name);
- else if (prop_spec)
- dbus_value = get_property_for_dbus (setting, property, TRUE);
+ if (property->synth_func)
+ dbus_value = property->synth_func (setting, connection, property->name);
else
- g_assert_not_reached ();
+ dbus_value = get_property_for_dbus (setting, property, TRUE);
if (dbus_value) {
/* Allow dbus_value to be either floating or not. */
g_variant_take_ref (dbus_value);
@@ -715,10 +789,7 @@ _nm_setting_new_from_dbus (GType setting_type,
GVariant *connection_dict,
GError **error)
{
- NMSettingClass *class;
NMSetting *setting;
- GVariantIter iter;
- const char *prop_name;
const NMSettingProperty *properties;
guint n_properties;
guint i;
@@ -732,30 +803,40 @@ _nm_setting_new_from_dbus (GType setting_type,
if (connection_dict)
g_return_val_if_fail (g_variant_is_of_type (connection_dict, NM_VARIANT_TYPE_CONNECTION), NULL);
- /* g_type_class_ref() ensures the setting class is created if it hasn't
- * already been used.
+ /* Build the setting object from the properties we know about; we assume
+ * that any propreties in @setting_dict that we don't know about can
+ * either be ignored or else has a backward-compatibility equivalent
+ * that we do know about.
*/
- class = g_type_class_ref (setting_type);
-
- /* Check for invalid properties first. */
- g_variant_iter_init (&iter, setting_dict);
- while (g_variant_iter_next (&iter, "{&sv}", &prop_name, NULL)) {
- if (!nm_setting_class_find_property (class, prop_name)) {
- /* Oh, we're so nice and only warn, maybe it should be a fatal error? */
- g_warning ("Ignoring invalid property '%s'", prop_name);
- continue;
- }
- }
-
- /* Now build the setting object from the legitimate properties */
setting = (NMSetting *) g_object_new (setting_type, NULL);
- properties = nm_setting_class_get_properties (class, &n_properties);
+ properties = nm_setting_class_get_properties (NM_SETTING_GET_CLASS (setting), &n_properties);
for (i = 0; i < n_properties; i++) {
const NMSettingProperty *property = &properties[i];
- GVariant *value = g_variant_lookup_value (setting_dict, property->name, NULL);
+ GVariant *value;
+
+ if (property->param_spec && !(property->param_spec->flags & G_PARAM_WRITABLE))
+ continue;
+
+ value = g_variant_lookup_value (setting_dict, property->name, NULL);
if (value && property->set_func) {
+ if (!g_variant_type_equal (g_variant_get_type (value), property->dbus_type)) {
+ property_type_error:
+ g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("can't set property of type '%s' from value of type '%s'"),
+ property->dbus_type ?
+ g_variant_type_peek_string (property->dbus_type) :
+ property->param_spec ?
+ g_type_name (property->param_spec->value_type) : "(unknown)",
+ g_variant_get_type_string (value));
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), property->name);
+
+ g_variant_unref (value);
+ g_object_unref (setting);
+ return NULL;
+ }
+
property->set_func (setting,
connection_dict,
property->name,
@@ -767,11 +848,10 @@ _nm_setting_new_from_dbus (GType setting_type,
} else if (value && property->param_spec) {
GValue object_value = { 0, };
- if (!(property->param_spec->flags & G_PARAM_WRITABLE))
- continue;
-
g_value_init (&object_value, property->param_spec->value_type);
- set_property_from_dbus (property, value, &object_value);
+ if (!set_property_from_dbus (property, value, &object_value))
+ goto property_type_error;
+
g_object_set_property (G_OBJECT (setting), property->param_spec->name, &object_value);
g_value_unset (&object_value);
}
@@ -780,11 +860,37 @@ _nm_setting_new_from_dbus (GType setting_type,
g_variant_unref (value);
}
- g_type_class_unref (class);
-
return setting;
}
+/**
+ * nm_setting_get_dbus_property_type:
+ * @setting: an #NMSetting
+ * @property_name: the property of @setting to get the type of
+ *
+ * Gets the D-Bus marshalling type of a property. @property_name is a D-Bus
+ * property name, which may not necessarily be a #GObject property.
+ *
+ * Returns: the D-Bus marshalling type of @property on @setting.
+ */
+const GVariantType *
+nm_setting_get_dbus_property_type (NMSetting *setting,
+ const char *property_name)
+{
+ const NMSettingProperty *property;
+
+ g_return_val_if_fail (NM_IS_SETTING (setting), NULL);
+ g_return_val_if_fail (property_name != NULL, NULL);
+
+ property = nm_setting_class_find_property (NM_SETTING_GET_CLASS (setting), property_name);
+ g_return_val_if_fail (property != NULL, NULL);
+
+ if (property->dbus_type)
+ return property->dbus_type;
+ else
+ return variant_type_for_gtype (property->param_spec->value_type);
+}
+
gboolean
_nm_setting_get_property (NMSetting *setting, const char *property_name, GValue *value)
{
@@ -1050,6 +1156,11 @@ should_compare_prop (NMSetting *setting,
&& !strcmp (prop_name, NM_SETTING_CONNECTION_ID))
return FALSE;
+ if ( (comp_flags & NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP)
+ && NM_IS_SETTING_CONNECTION (setting)
+ && !strcmp (prop_name, NM_SETTING_CONNECTION_TIMESTAMP))
+ return FALSE;
+
return TRUE;
}
@@ -1203,6 +1314,33 @@ nm_setting_diff (NMSetting *a,
return !(*results);
}
+#define CMP_AND_RETURN(n_a, n_b, name) \
+ G_STMT_START { \
+ gboolean _is = (strcmp (n_a, ""name) == 0); \
+ \
+ if (_is || (strcmp (n_b, ""name) == 0)) \
+ return _is ? -1 : 1; \
+ } G_STMT_END
+
+static int
+_enumerate_values_sort (GParamSpec **p_a, GParamSpec **p_b, GType *p_type)
+{
+ const char *n_a = (*p_a)->name;
+ const char *n_b = (*p_b)->name;
+ int c = strcmp (n_a, n_b);
+
+ if (c) {
+ if (*p_type == NM_TYPE_SETTING_CONNECTION) {
+ /* for [connection], report first id, uuid, type in that order. */
+ CMP_AND_RETURN (n_a, n_b, NM_SETTING_CONNECTION_ID);
+ CMP_AND_RETURN (n_a, n_b, NM_SETTING_CONNECTION_UUID);
+ CMP_AND_RETURN (n_a, n_b, NM_SETTING_CONNECTION_TYPE);
+ }
+ }
+ return c;
+}
+#undef CMP_AND_RETURN
+
/**
* nm_setting_enumerate_values:
* @setting: the #NMSetting
@@ -1220,11 +1358,19 @@ nm_setting_enumerate_values (NMSetting *setting,
GParamSpec **property_specs;
guint n_property_specs;
int i;
+ GType type;
g_return_if_fail (NM_IS_SETTING (setting));
g_return_if_fail (func != NULL);
property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs);
+
+ /* sort the properties. This has an effect on the order in which keyfile
+ * prints them. */
+ type = G_OBJECT_TYPE (setting);
+ g_qsort_with_data (property_specs, n_property_specs, sizeof (gpointer),
+ (GCompareDataFunc) _enumerate_values_sort, &type);
+
for (i = 0; i < n_property_specs; i++) {
GParamSpec *prop_spec = property_specs[i];
GValue value = G_VALUE_INIT;
diff --git a/libnm-core/nm-setting.h b/libnm-core/nm-setting.h
index 30a2c577d9..3601fce30b 100644
--- a/libnm-core/nm-setting.h
+++ b/libnm-core/nm-setting.h
@@ -91,25 +91,26 @@ typedef enum { /*< flags >*/
* @NM_SETTING_COMPARE_FLAG_IGNORE_ID: ignore the connection's ID
* @NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS: ignore all secrets
* @NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS: ignore secrets for which
- * the secret's flags indicate the secret is owned by a user secret agent
- * (ie, the secret's flag includes @NM_SETTING_SECRET_FLAG_AGENT_OWNED)
+ * the secret's flags indicate the secret is owned by a user secret agent
+ * (ie, the secret's flag includes @NM_SETTING_SECRET_FLAG_AGENT_OWNED)
* @NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS: ignore secrets for which
- * the secret's flags indicate the secret should not be saved to persistent
- * storage (ie, the secret's flag includes @NM_SETTING_SECRET_FLAG_NOT_SAVED)
+ * the secret's flags indicate the secret should not be saved to persistent
+ * storage (ie, the secret's flag includes @NM_SETTING_SECRET_FLAG_NOT_SAVED)
* @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT: if this flag is set,
- * nm_setting_diff() and nm_connection_diff() will also include properties that
- * are set to their default value. See also @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT.
+ * nm_setting_diff() and nm_connection_diff() will also include properties that
+ * are set to their default value. See also @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT.
* @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT: if this flag is set,
- * nm_setting_diff() and nm_connection_diff() will not include properties that
- * are set to their default value. This is the opposite of
- * @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT. If both flags are set together,
- * @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT wins. If both flags are unset,
- * this means to exclude default properties if there is a setting to compare,
- * but include all properties, if the setting 'b' is missing. This is the legacy
- * behaviour of libnm-util, where nm_setting_diff() behaved differently depending
- * on whether the setting 'b' was available. If @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT
- * is set, nm_setting_diff() will also set the flags @NM_SETTING_DIFF_RESULT_IN_A_DEFAULT
- * and @NM_SETTING_DIFF_RESULT_IN_B_DEFAULT, if the values are default values.
+ * nm_setting_diff() and nm_connection_diff() will not include properties that
+ * are set to their default value. This is the opposite of
+ * @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT. If both flags are set together,
+ * @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT wins. If both flags are unset,
+ * this means to exclude default properties if there is a setting to compare,
+ * but include all properties, if the setting 'b' is missing. This is the legacy
+ * behaviour of libnm-util, where nm_setting_diff() behaved differently depending
+ * on whether the setting 'b' was available. If @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT
+ * is set, nm_setting_diff() will also set the flags @NM_SETTING_DIFF_RESULT_IN_A_DEFAULT
+ * and @NM_SETTING_DIFF_RESULT_IN_B_DEFAULT, if the values are default values.
+ * @NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP: ignore the connection's timestamp
*
* These flags modify the comparison behavior when comparing two settings or
* two connections.
@@ -124,6 +125,7 @@ typedef enum {
NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS = 0x00000010,
NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT = 0x00000020,
NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT = 0x00000040,
+ NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP = 0x00000080,
/* 0x80000000 is used for a private flag */
} NMSettingCompareFlags;
@@ -271,6 +273,10 @@ gboolean nm_setting_set_secret_flags (NMSetting *setting,
NMSettingSecretFlags flags,
GError **error);
+/* Properties */
+const GVariantType *nm_setting_get_dbus_property_type (NMSetting *setting,
+ const char *property_name);
+
G_END_DECLS
#endif /* __NM_SETTING_H__ */
diff --git a/libnm-core/nm-simple-connection.c b/libnm-core/nm-simple-connection.c
index 03e5a92d81..c67f624454 100644
--- a/libnm-core/nm-simple-connection.c
+++ b/libnm-core/nm-simple-connection.c
@@ -19,6 +19,8 @@
* Copyright 2007 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include "nm-simple-connection.h"
#include "nm-setting-private.h"
@@ -71,7 +73,7 @@ nm_simple_connection_new_from_dbus (GVariant *dict, GError **error)
connection = nm_simple_connection_new ();
if ( !nm_connection_replace_settings (connection, dict, error)
- || !nm_connection_verify (connection, error))
+ || !nm_connection_normalize (connection, NULL, NULL, error))
g_clear_object (&connection);
return connection;
}
diff --git a/libnm-core/nm-utils-private.h b/libnm-core/nm-utils-private.h
index bc42921514..3854d67951 100644
--- a/libnm-core/nm-utils-private.h
+++ b/libnm-core/nm-utils-private.h
@@ -40,32 +40,11 @@ GVariant * _nm_utils_bytes_to_dbus (const GValue *prop_value);
void _nm_utils_bytes_from_dbus (GVariant *dbus_value,
GValue *prop_value);
-GVariant * _nm_utils_ip4_dns_to_dbus (const GValue *prop_value);
-void _nm_utils_ip4_dns_from_dbus (GVariant *dbus_value,
- GValue *prop_value);
-GVariant * _nm_utils_ip4_addresses_to_dbus (const GValue *prop_value);
-void _nm_utils_ip4_addresses_from_dbus (GVariant *dbus_value,
- GValue *prop_value);
-GVariant * _nm_utils_ip4_routes_to_dbus (const GValue *prop_value);
-void _nm_utils_ip4_routes_from_dbus (GVariant *dbus_value,
- GValue *prop_value);
-
-GVariant * _nm_utils_ip6_dns_to_dbus (const GValue *prop_value);
-void _nm_utils_ip6_dns_from_dbus (GVariant *dbus_value,
- GValue *prop_value);
-GVariant * _nm_utils_ip6_addresses_to_dbus (const GValue *prop_value);
-void _nm_utils_ip6_addresses_from_dbus (GVariant *dbus_value,
- GValue *prop_value);
-GVariant * _nm_utils_ip6_routes_to_dbus (const GValue *prop_value);
-void _nm_utils_ip6_routes_from_dbus (GVariant *dbus_value,
- GValue *prop_value);
-
GSList * _nm_utils_strv_to_slist (char **strv);
char ** _nm_utils_slist_to_strv (GSList *slist);
-char ** _nm_utils_strsplit_set (const char *str,
- const char *delimiters,
- int max_tokens);
+GPtrArray * _nm_utils_strv_to_ptrarray (char **strv);
+char ** _nm_utils_ptrarray_to_strv (GPtrArray *ptrarray);
char * _nm_utils_hwaddr_canonical_or_invalid (const char *mac, gssize length);
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index dfa0d7cf81..d3557f578a 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -22,16 +22,22 @@
#include "config.h"
#include <string.h>
+#include <errno.h>
#include <stdlib.h>
#include <netinet/ether.h>
+#include <arpa/inet.h>
#include <uuid/uuid.h>
+#include <libintl.h>
#include <gmodule.h>
+#include <glib/gi18n-lib.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-utils-internal.h"
#include "nm-setting-bond.h"
#include "nm-setting-bridge.h"
@@ -42,6 +48,9 @@
#include "nm-setting-wired.h"
#include "nm-setting-wireless.h"
+/* Embed the commit id in the build binary */
+static const char *const __nm_git_sha = STRLEN (NM_GIT_SHA) > 0 ? "NM_GIT_SHA:"NM_GIT_SHA : "";
+
/**
* SECTION:nm-utils
* @short_description: Utility functions
@@ -207,69 +216,42 @@ get_encodings_for_lang (const char *lang,
return success;
}
-/* init, deinit for libnm_util */
+/* init libnm */
+
+static gboolean initialized = FALSE;
static void __attribute__((constructor))
-_check_symbols (void)
+_nm_utils_init (void)
{
GModule *self;
gpointer func;
+ (void) __nm_git_sha;
+
+ if (initialized)
+ return;
+ initialized = TRUE;
+
self = g_module_open (NULL, 0);
if (g_module_symbol (self, "nm_util_get_private", &func))
g_error ("libnm-util symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported");
g_module_close (self);
-}
-static gboolean initialized = FALSE;
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-/**
- * nm_utils_init:
- * @error: location to store error, or %NULL
- *
- * Initializes libnm; should be called when starting and program that
- * uses libnm. Sets up an atexit() handler to ensure de-initialization
- * is performed, but calling nm_utils_deinit() to explicitly deinitialize
- * libnm can also be done. This function can be called more than once.
- *
- * Returns: %TRUE if the initialization was successful, %FALSE on failure.
- **/
-gboolean
-nm_utils_init (GError **error)
-{
- if (!initialized) {
- initialized = TRUE;
-
- if (!crypto_init (error))
- return FALSE;
+ g_type_init ();
- _nm_dbus_errors_init ();
- }
- return TRUE;
+ _nm_dbus_errors_init ();
}
-/**
- * nm_utils_deinit:
- *
- * Frees all resources used internally by libnm. This function is called
- * from an atexit() handler, set up by nm_utils_init(), but is safe to be called
- * more than once. Subsequent calls have no effect until nm_utils_init() is
- * called again.
- **/
-void
-nm_utils_deinit (void)
-{
- if (initialized) {
- crypto_deinit ();
- initialized = FALSE;
- }
-}
+gboolean _nm_utils_is_manager_process;
/* ssid helpers */
/**
* nm_utils_ssid_to_utf8:
- * @ssid: pointer to a buffer containing the SSID data
+ * @ssid: (array length=len): pointer to a buffer containing the SSID data
* @len: length of the SSID data in @ssid
*
* Wi-Fi SSIDs are byte arrays, they are _not_ strings. Thus, an SSID may
@@ -341,7 +323,7 @@ nm_utils_ssid_to_utf8 (const guint8 *ssid, gsize len)
/* Shamelessly ripped from the Linux kernel ieee80211 stack */
/**
* nm_utils_is_empty_ssid:
- * @ssid: pointer to a buffer containing the SSID data
+ * @ssid: (array length=len): pointer to a buffer containing the SSID data
* @len: length of the SSID data in @ssid
*
* Different manufacturers use different mechanisms for not broadcasting the
@@ -369,7 +351,7 @@ nm_utils_is_empty_ssid (const guint8 *ssid, gsize len)
/**
* nm_utils_escape_ssid:
- * @ssid: pointer to a buffer containing the SSID data
+ * @ssid: (array length=len): pointer to a buffer containing the SSID data
* @len: length of the SSID data in @ssid
*
* This function does a quick printable character conversion of the SSID, simply
@@ -408,9 +390,9 @@ nm_utils_escape_ssid (const guint8 *ssid, gsize len)
/**
* nm_utils_same_ssid:
- * @ssid1: the first SSID to compare
+ * @ssid1: (array length=len1): the first SSID to compare
* @len1: length of the SSID data in @ssid1
- * @ssid2: the second SSID to compare
+ * @ssid2: (array length=len2): the second SSID to compare
* @len2: length of the SSID data in @ssid2
* @ignore_trailing_null: %TRUE to ignore one trailing NULL byte
*
@@ -662,7 +644,7 @@ _nm_utils_slist_to_strv (GSList *slist)
{
GSList *iter;
char **strv;
- int len, i = 0;
+ int len, i;
len = g_slist_length (slist);
strv = g_new (char *, len + 1);
@@ -674,6 +656,40 @@ _nm_utils_slist_to_strv (GSList *slist)
return strv;
}
+GPtrArray *
+_nm_utils_strv_to_ptrarray (char **strv)
+{
+ GPtrArray *ptrarray;
+ int i;
+
+ ptrarray = g_ptr_array_new_with_free_func (g_free);
+
+ if (strv) {
+ for (i = 0; strv[i]; i++)
+ g_ptr_array_add (ptrarray, g_strdup (strv[i]));
+ }
+
+ return ptrarray;
+}
+
+char **
+_nm_utils_ptrarray_to_strv (GPtrArray *ptrarray)
+{
+ char **strv;
+ int i;
+
+ if (!ptrarray)
+ return g_new0 (char *, 1);
+
+ strv = g_new (char *, ptrarray->len + 1);
+
+ for (i = 0; i < ptrarray->len; i++)
+ strv[i] = g_strdup (ptrarray->pdata[i]);
+ strv[i] = NULL;
+
+ return strv;
+}
+
/**
* _nm_utils_strsplit_set:
* @str: string to split
@@ -983,9 +999,13 @@ nm_utils_wep_key_valid (const char *key, NMWepKeyType wep_type)
if (!key)
return FALSE;
+ if (wep_type == NM_WEP_KEY_TYPE_UNKNOWN) {
+ return nm_utils_wep_key_valid (key, NM_WEP_KEY_TYPE_KEY) ||
+ nm_utils_wep_key_valid (key, NM_WEP_KEY_TYPE_PASSPHRASE);
+ }
+
keylen = strlen (key);
- if ( wep_type == NM_WEP_KEY_TYPE_KEY
- || wep_type == NM_WEP_KEY_TYPE_UNKNOWN) {
+ if (wep_type == NM_WEP_KEY_TYPE_KEY) {
if (keylen == 10 || keylen == 26) {
/* Hex key */
for (i = 0; i < keylen; i++) {
@@ -1000,7 +1020,6 @@ nm_utils_wep_key_valid (const char *key, NMWepKeyType wep_type)
}
} else
return FALSE;
-
} else if (wep_type == NM_WEP_KEY_TYPE_PASSPHRASE) {
if (!keylen || keylen > 64)
return FALSE;
@@ -1100,16 +1119,19 @@ nm_utils_ip4_dns_from_variant (GVariant *value)
/**
* nm_utils_ip4_addresses_to_variant:
- * @addresses: (element-type NMIP4Address): an array of #NMIP4Address objects
+ * @addresses: (element-type NMIPAddress): an array of #NMIPAddress objects
+ * @gateway: (allow-none): the gateway IP address
*
- * Utility function to convert a #GPtrArray of #NMIP4Address objects into a
- * #GVariant of type 'aau' representing an array of NetworkManager IPv4
- * addresses (which are tuples of address, prefix, and gateway).
+ * Utility function to convert a #GPtrArray of #NMIPAddress objects representing
+ * IPv4 addresses into a #GVariant of type 'aau' representing an array of
+ * NetworkManager IPv4 addresses (which are tuples of address, prefix, and
+ * gateway). The "gateway" field of the first address will get the value of
+ * @gateway (if non-%NULL). In all of the other addresses, that field will be 0.
*
* Returns: (transfer none): a new floating #GVariant representing @addresses.
**/
GVariant *
-nm_utils_ip4_addresses_to_variant (GPtrArray *addresses)
+nm_utils_ip4_addresses_to_variant (GPtrArray *addresses, const char *gateway)
{
GVariantBuilder builder;
int i;
@@ -1118,12 +1140,18 @@ nm_utils_ip4_addresses_to_variant (GPtrArray *addresses)
if (addresses) {
for (i = 0; i < addresses->len; i++) {
- NMIP4Address *addr = addresses->pdata[i];
+ NMIPAddress *addr = addresses->pdata[i];
guint32 array[3];
- array[0] = nm_ip4_address_get_address (addr);
- array[1] = nm_ip4_address_get_prefix (addr);
- array[2] = nm_ip4_address_get_gateway (addr);
+ if (nm_ip_address_get_family (addr) != AF_INET)
+ continue;
+
+ nm_ip_address_get_address_binary (addr, &array[0]);
+ array[1] = nm_ip_address_get_prefix (addr);
+ if (i == 0 && gateway)
+ inet_pton (AF_INET, gateway, &array[2]);
+ else
+ array[2] = 0;
g_variant_builder_add (&builder, "@au",
g_variant_new_fixed_array (G_VARIANT_TYPE_UINT32,
@@ -1137,16 +1165,19 @@ nm_utils_ip4_addresses_to_variant (GPtrArray *addresses)
/**
* nm_utils_ip4_addresses_from_variant:
* @value: a #GVariant of type 'aau'
+ * @out_gateway: (out) (allow-none) (transfer full): on return, will contain the IP gateway
*
* Utility function to convert a #GVariant of type 'aau' representing a list of
* NetworkManager IPv4 addresses (which are tuples of address, prefix, and
- * gateway) into a #GPtrArray of #NMIP4Address objects.
+ * gateway) into a #GPtrArray of #NMIPAddress objects. The "gateway" field of
+ * the first address (if set) will be returned in @out_gateway; the "gateway" fields
+ * of the other addresses are ignored.
*
- * Returns: (transfer full) (element-type NMIP4Address): a newly allocated
- * #GPtrArray of #NMIP4Address objects
+ * Returns: (transfer full) (element-type NMIPAddress): a newly allocated
+ * #GPtrArray of #NMIPAddress objects
**/
GPtrArray *
-nm_utils_ip4_addresses_from_variant (GVariant *value)
+nm_utils_ip4_addresses_from_variant (GVariant *value, char **out_gateway)
{
GPtrArray *addresses;
GVariantIter iter;
@@ -1154,13 +1185,17 @@ nm_utils_ip4_addresses_from_variant (GVariant *value)
g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("aau")), NULL);
+ if (out_gateway)
+ *out_gateway = NULL;
+
g_variant_iter_init (&iter, value);
- addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip4_address_unref);
+ addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_address_unref);
while (g_variant_iter_next (&iter, "@au", &addr_var)) {
const guint32 *addr_array;
gsize length;
- NMIP4Address *addr;
+ NMIPAddress *addr;
+ GError *error = NULL;
addr_array = g_variant_get_fixed_array (addr_var, &length, sizeof (guint32));
if (length < 3) {
@@ -1169,12 +1204,17 @@ nm_utils_ip4_addresses_from_variant (GVariant *value)
continue;
}
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, addr_array[0]);
- nm_ip4_address_set_prefix (addr, addr_array[1]);
- nm_ip4_address_set_gateway (addr, addr_array[2]);
+ addr = nm_ip_address_new_binary (AF_INET, &addr_array[0], addr_array[1], &error);
+ if (addr) {
+ g_ptr_array_add (addresses, addr);
+
+ if (addr_array[2] && out_gateway && !*out_gateway)
+ *out_gateway = g_strdup (nm_utils_inet4_ntop (addr_array[2], NULL));
+ } else {
+ g_warning ("Ignoring invalid IP4 address: %s", error->message);
+ g_clear_error (&error);
+ }
- g_ptr_array_add (addresses, addr);
g_variant_unref (addr_var);
}
@@ -1183,11 +1223,12 @@ nm_utils_ip4_addresses_from_variant (GVariant *value)
/**
* nm_utils_ip4_routes_to_variant:
- * @routes: (element-type NMIP4Route): an array of #NMIP4Route objects
+ * @routes: (element-type NMIPRoute): an array of #NMIP4Route objects
*
- * Utility function to convert a #GPtrArray of #NMIP4Route objects into a
- * #GVariant of type 'aau' representing an array of NetworkManager IPv4 routes
- * (which are tuples of route, prefix, next hop, and metric).
+ * Utility function to convert a #GPtrArray of #NMIPRoute objects representing
+ * IPv4 routes into a #GVariant of type 'aau' representing an array of
+ * NetworkManager IPv4 routes (which are tuples of route, prefix, next hop, and
+ * metric).
*
* Returns: (transfer none): a new floating #GVariant representing @routes.
**/
@@ -1201,13 +1242,17 @@ nm_utils_ip4_routes_to_variant (GPtrArray *routes)
if (routes) {
for (i = 0; i < routes->len; i++) {
- NMIP4Route *route = routes->pdata[i];
+ NMIPRoute *route = routes->pdata[i];
guint32 array[4];
- array[0] = nm_ip4_route_get_dest (route);
- array[1] = nm_ip4_route_get_prefix (route);
- array[2] = nm_ip4_route_get_next_hop (route);
- array[3] = nm_ip4_route_get_metric (route);
+ if (nm_ip_route_get_family (route) != AF_INET)
+ continue;
+
+ nm_ip_route_get_dest_binary (route, &array[0]);
+ array[1] = nm_ip_route_get_prefix (route);
+ nm_ip_route_get_next_hop_binary (route, &array[2]);
+ /* The old routes format uses "0" for default, not "-1" */
+ array[3] = MAX (0, nm_ip_route_get_metric (route));
g_variant_builder_add (&builder, "@au",
g_variant_new_fixed_array (G_VARIANT_TYPE_UINT32,
@@ -1224,10 +1269,10 @@ nm_utils_ip4_routes_to_variant (GPtrArray *routes)
*
* Utility function to convert a #GVariant of type 'aau' representing an array
* of NetworkManager IPv4 routes (which are tuples of route, prefix, next hop,
- * and metric) into a #GPtrArray of #NMIP4Route objects.
+ * and metric) into a #GPtrArray of #NMIPRoute objects.
*
- * Returns: (transfer full) (element-type NMIP4Route): a newly allocated
- * #GPtrArray of #NMIP4Route objects
+ * Returns: (transfer full) (element-type NMIPRoute): a newly allocated
+ * #GPtrArray of #NMIPRoute objects
**/
GPtrArray *
nm_utils_ip4_routes_from_variant (GVariant *value)
@@ -1239,12 +1284,13 @@ nm_utils_ip4_routes_from_variant (GVariant *value)
g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("aau")), NULL);
g_variant_iter_init (&iter, value);
- routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip4_route_unref);
+ routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref);
while (g_variant_iter_next (&iter, "@au", &route_var)) {
const guint32 *route_array;
gsize length;
- NMIP4Route *route;
+ NMIPRoute *route;
+ GError *error = NULL;
route_array = g_variant_get_fixed_array (route_var, &length, sizeof (guint32));
if (length < 4) {
@@ -1253,13 +1299,19 @@ nm_utils_ip4_routes_from_variant (GVariant *value)
continue;
}
- route = nm_ip4_route_new ();
- nm_ip4_route_set_dest (route, route_array[0]);
- nm_ip4_route_set_prefix (route, route_array[1]);
- nm_ip4_route_set_next_hop (route, route_array[2]);
- nm_ip4_route_set_metric (route, route_array[3]);
-
- g_ptr_array_add (routes, route);
+ route = nm_ip_route_new_binary (AF_INET,
+ &route_array[0],
+ route_array[1],
+ &route_array[2],
+ /* The old routes format uses "0" for default, not "-1" */
+ route_array[3] ? (gint64) route_array[3] : -1,
+ &error);
+ if (route)
+ g_ptr_array_add (routes, route);
+ else {
+ g_warning ("Ignoring invalid IP4 route: %s", error->message);
+ g_clear_error (&error);
+ }
g_variant_unref (route_var);
}
@@ -1412,16 +1464,20 @@ nm_utils_ip6_dns_from_variant (GVariant *value)
/**
* nm_utils_ip6_addresses_to_variant:
- * @addresses: (element-type NMIP6Address): an array of #NMIP6Address objects
+ * @addresses: (element-type NMIPAddress): an array of #NMIPAddress objects
+ * @gateway: (allow-none): the gateway IP address
*
- * Utility function to convert a #GPtrArray of #NMIP6Address objects into a
- * #GVariant of type 'a(ayuay)' representing an array of NetworkManager IPv6
- * addresses (which are tuples of address, prefix, and gateway).
+ * Utility function to convert a #GPtrArray of #NMIPAddress objects representing
+ * IPv6 addresses into a #GVariant of type 'a(ayuay)' representing an array of
+ * NetworkManager IPv6 addresses (which are tuples of address, prefix, and
+ * gateway). The "gateway" field of the first address will get the value of
+ * @gateway (if non-%NULL). In all of the other addresses, that field will be
+ * all 0s.
*
* Returns: (transfer none): a new floating #GVariant representing @addresses.
**/
GVariant *
-nm_utils_ip6_addresses_to_variant (GPtrArray *addresses)
+nm_utils_ip6_addresses_to_variant (GPtrArray *addresses, const char *gateway)
{
GVariantBuilder builder;
int i;
@@ -1430,19 +1486,26 @@ nm_utils_ip6_addresses_to_variant (GPtrArray *addresses)
if (addresses) {
for (i = 0; i < addresses->len; i++) {
- NMIP6Address *addr = addresses->pdata[i];
- GVariant *ip, *gateway;
+ NMIPAddress *addr = addresses->pdata[i];
+ struct in6_addr ip_bytes, gateway_bytes;
+ GVariant *ip_var, *gateway_var;
guint32 prefix;
- ip = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
- nm_ip6_address_get_address (addr),
- 16, 1);
- prefix = nm_ip6_address_get_prefix (addr);
- gateway = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
- nm_ip6_address_get_gateway (addr),
- 16, 1);
+ if (nm_ip_address_get_family (addr) != AF_INET6)
+ continue;
+
+ nm_ip_address_get_address_binary (addr, &ip_bytes);
+ ip_var = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, &ip_bytes, 16, 1);
+
+ prefix = nm_ip_address_get_prefix (addr);
- g_variant_builder_add (&builder, "(@ayu@ay)", ip, prefix, gateway);
+ if (i == 0 && gateway)
+ inet_pton (AF_INET6, gateway, &gateway_bytes);
+ else
+ memset (&gateway_bytes, 0, sizeof (gateway_bytes));
+ gateway_var = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, &gateway_bytes, 16, 1);
+
+ g_variant_builder_add (&builder, "(@ayu@ay)", ip_var, prefix, gateway_var);
}
}
@@ -1452,16 +1515,19 @@ nm_utils_ip6_addresses_to_variant (GPtrArray *addresses)
/**
* nm_utils_ip6_addresses_from_variant:
* @value: a #GVariant of type 'a(ayuay)'
+ * @out_gateway: (out) (allow-none) (transfer full): on return, will contain the IP gateway
*
* Utility function to convert a #GVariant of type 'a(ayuay)' representing a
* list of NetworkManager IPv6 addresses (which are tuples of address, prefix,
- * and gateway) into a #GPtrArray of #NMIP6Address objects.
+ * and gateway) into a #GPtrArray of #NMIPAddress objects. The "gateway" field
+ * of the first address (if set) will be returned in @out_gateway; the "gateway"
+ * fields of the other addresses are ignored.
*
- * Returns: (transfer full) (element-type NMIP6Address): a newly allocated
- * #GPtrArray of #NMIP6Address objects
+ * Returns: (transfer full) (element-type NMIPAddress): a newly allocated
+ * #GPtrArray of #NMIPAddress objects
**/
GPtrArray *
-nm_utils_ip6_addresses_from_variant (GVariant *value)
+nm_utils_ip6_addresses_from_variant (GVariant *value, char **out_gateway)
{
GVariantIter iter;
GVariant *addr_var, *gateway_var;
@@ -1470,13 +1536,17 @@ nm_utils_ip6_addresses_from_variant (GVariant *value)
g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("a(ayuay)")), NULL);
+ if (out_gateway)
+ *out_gateway = NULL;
+
g_variant_iter_init (&iter, value);
- addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip6_address_unref);
+ addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_address_unref);
while (g_variant_iter_next (&iter, "(@ayu@ay)", &addr_var, &prefix, &gateway_var)) {
- NMIP6Address *addr;
+ NMIPAddress *addr;
const struct in6_addr *addr_bytes, *gateway_bytes;
gsize addr_len, gateway_len;
+ GError *error = NULL;
if ( !g_variant_is_of_type (addr_var, G_VARIANT_TYPE_BYTESTRING)
|| !g_variant_is_of_type (gateway_var, G_VARIANT_TYPE_BYTESTRING)) {
@@ -1490,23 +1560,25 @@ nm_utils_ip6_addresses_from_variant (GVariant *value)
__func__, (int) addr_len);
goto next;
}
- if (prefix > 128) {
- g_warning ("%s: ignoring invalid IP6 prefix %d",
- __func__, prefix);
- goto next;
- }
- gateway_bytes = g_variant_get_fixed_array (gateway_var, &gateway_len, 1);
- if (gateway_len != 16) {
- g_warning ("%s: ignoring invalid IP6 address of length %d",
- __func__, (int) gateway_len);
- goto next;
- }
- addr = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr, addr_bytes);
- nm_ip6_address_set_prefix (addr, prefix);
- nm_ip6_address_set_gateway (addr, gateway_bytes);
- g_ptr_array_add (addresses, addr);
+ addr = nm_ip_address_new_binary (AF_INET6, addr_bytes, prefix, &error);
+ if (addr) {
+ g_ptr_array_add (addresses, addr);
+
+ if (out_gateway && !*out_gateway) {
+ gateway_bytes = g_variant_get_fixed_array (gateway_var, &gateway_len, 1);
+ if (gateway_len != 16) {
+ g_warning ("%s: ignoring invalid IP6 address of length %d",
+ __func__, (int) gateway_len);
+ goto next;
+ }
+ if (!IN6_IS_ADDR_UNSPECIFIED (gateway_bytes))
+ *out_gateway = g_strdup (nm_utils_inet6_ntop (gateway_bytes, NULL));
+ }
+ } else {
+ g_warning ("Ignoring invalid IP4 address: %s", error->message);
+ g_clear_error (&error);
+ }
next:
g_variant_unref (addr_var);
@@ -1518,11 +1590,12 @@ nm_utils_ip6_addresses_from_variant (GVariant *value)
/**
* nm_utils_ip6_routes_to_variant:
- * @routes: (element-type NMIP6Route): an array of #NMIP6Route objects
+ * @routes: (element-type NMIPRoute): an array of #NMIPRoute objects
*
- * Utility function to convert a #GPtrArray of #NMIP6Route objects into a
- * #GVariant of type 'a(ayuayu)' representing an array of NetworkManager IPv6
- * routes (which are tuples of route, prefix, next hop, and metric).
+ * Utility function to convert a #GPtrArray of #NMIPRoute objects representing
+ * IPv6 routes into a #GVariant of type 'a(ayuayu)' representing an array of
+ * NetworkManager IPv6 routes (which are tuples of route, prefix, next hop, and
+ * metric).
*
* Returns: (transfer none): a new floating #GVariant representing @routes.
**/
@@ -1536,18 +1609,21 @@ nm_utils_ip6_routes_to_variant (GPtrArray *routes)
if (routes) {
for (i = 0; i < routes->len; i++) {
- NMIP6Route *route = routes->pdata[i];
+ NMIPRoute *route = routes->pdata[i];
+ struct in6_addr dest_bytes, next_hop_bytes;
GVariant *dest, *next_hop;
guint32 prefix, metric;
- dest = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
- nm_ip6_route_get_dest (route),
- 16, 1);
- prefix = nm_ip6_route_get_prefix (route);
- next_hop = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
- nm_ip6_route_get_next_hop (route),
- 16, 1);
- metric = nm_ip6_route_get_metric (route);
+ if (nm_ip_route_get_family (route) != AF_INET6)
+ continue;
+
+ nm_ip_route_get_dest_binary (route, &dest_bytes);
+ dest = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, &dest_bytes, 16, 1);
+ prefix = nm_ip_route_get_prefix (route);
+ nm_ip_route_get_next_hop_binary (route, &next_hop_bytes);
+ next_hop = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, &next_hop_bytes, 16, 1);
+ /* The old routes format uses "0" for default, not "-1" */
+ metric = MAX (0, nm_ip_route_get_metric (route));
g_variant_builder_add (&builder, "(@ayu@ayu)", dest, prefix, next_hop, metric);
}
@@ -1562,10 +1638,10 @@ nm_utils_ip6_routes_to_variant (GPtrArray *routes)
*
* Utility function to convert a #GVariant of type 'a(ayuayu)' representing an
* array of NetworkManager IPv6 routes (which are tuples of route, prefix, next
- * hop, and metric) into a #GPtrArray of #NMIP6Route objects.
+ * hop, and metric) into a #GPtrArray of #NMIPRoute objects.
*
- * Returns: (transfer full) (element-type NMIP6Route): a newly allocated
- * #GPtrArray of #NMIP6Route objects
+ * Returns: (transfer full) (element-type NMIPRoute): a newly allocated
+ * #GPtrArray of #NMIPRoute objects
**/
GPtrArray *
nm_utils_ip6_routes_from_variant (GVariant *value)
@@ -1579,11 +1655,12 @@ nm_utils_ip6_routes_from_variant (GVariant *value)
g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("a(ayuayu)")), NULL);
- routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip6_route_unref);
+ routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref);
g_variant_iter_init (&iter, value);
while (g_variant_iter_next (&iter, "(@ayu@ayu)", &dest_var, &prefix, &next_hop_var, &metric)) {
- NMIP6Route *route;
+ NMIPRoute *route;
+ GError *error = NULL;
if ( !g_variant_is_of_type (dest_var, G_VARIANT_TYPE_BYTESTRING)
|| !g_variant_is_of_type (next_hop_var, G_VARIANT_TYPE_BYTESTRING)) {
@@ -1597,6 +1674,7 @@ nm_utils_ip6_routes_from_variant (GVariant *value)
__func__, (int) dest_len);
goto next;
}
+
next_hop = g_variant_get_fixed_array (next_hop_var, &next_hop_len, 1);
if (next_hop_len != 16) {
g_warning ("%s: ignoring invalid IP6 address of length %d",
@@ -1604,12 +1682,15 @@ nm_utils_ip6_routes_from_variant (GVariant *value)
goto next;
}
- route = nm_ip6_route_new ();
- nm_ip6_route_set_dest (route, dest);
- nm_ip6_route_set_prefix (route, prefix);
- nm_ip6_route_set_next_hop (route, next_hop);
- nm_ip6_route_set_metric (route, metric);
- g_ptr_array_add (routes, route);
+ route = nm_ip_route_new_binary (AF_INET6, dest, prefix, next_hop,
+ metric ? (gint64) metric : -1,
+ &error);
+ if (route)
+ g_ptr_array_add (routes, route);
+ else {
+ g_warning ("Ignoring invalid IP6 route: %s", error->message);
+ g_clear_error (&error);
+ }
next:
g_variant_unref (dest_var);
@@ -1620,6 +1701,251 @@ nm_utils_ip6_routes_from_variant (GVariant *value)
}
/**
+ * nm_utils_ip_addresses_to_variant:
+ * @addresses: (element-type NMIPAddress): an array of #NMIPAddress objects
+ *
+ * Utility function to convert a #GPtrArray of #NMIPAddress objects representing
+ * IPv4 or IPv6 addresses into a #GVariant of type 'aa{sv}' representing an
+ * array of new-style NetworkManager IP addresses. All addresses will include
+ * "address" (an IP address string), and "prefix" (a uint). Some addresses may
+ * include additional attributes.
+ *
+ * Returns: (transfer none): a new floating #GVariant representing @addresses.
+ **/
+GVariant *
+nm_utils_ip_addresses_to_variant (GPtrArray *addresses)
+{
+ GVariantBuilder builder;
+ int i;
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}"));
+
+ if (addresses) {
+ for (i = 0; i < addresses->len; i++) {
+ NMIPAddress *addr = addresses->pdata[i];
+ GVariantBuilder addr_builder;
+ char **names;
+ int n;
+
+ g_variant_builder_init (&addr_builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_add (&addr_builder, "{sv}",
+ "address",
+ g_variant_new_string (nm_ip_address_get_address (addr)));
+ g_variant_builder_add (&addr_builder, "{sv}",
+ "prefix",
+ g_variant_new_uint32 (nm_ip_address_get_prefix (addr)));
+
+ names = nm_ip_address_get_attribute_names (addr);
+ for (n = 0; names[n]; n++) {
+ g_variant_builder_add (&addr_builder, "{sv}",
+ names[n],
+ nm_ip_address_get_attribute (addr, names[n]));
+ }
+ g_strfreev (names);
+
+ g_variant_builder_add (&builder, "a{sv}", &addr_builder);
+ }
+ }
+
+ return g_variant_builder_end (&builder);
+}
+
+/**
+ * nm_utils_ip_addresses_from_variant:
+ * @value: a #GVariant of type 'aa{sv}'
+ * @family: an IP address family
+ *
+ * Utility function to convert a #GVariant representing a list of new-style
+ * NetworkManager IPv4 or IPv6 addresses (as described in the documentation for
+ * nm_utils_ip_addresses_to_variant()) into a #GPtrArray of #NMIPAddress
+ * objects.
+ *
+ * Returns: (transfer full) (element-type NMIPAddress): a newly allocated
+ * #GPtrArray of #NMIPAddress objects
+ **/
+GPtrArray *
+nm_utils_ip_addresses_from_variant (GVariant *value,
+ int family)
+{
+ GPtrArray *addresses;
+ GVariantIter iter, attrs_iter;
+ GVariant *addr_var;
+ const char *ip;
+ guint32 prefix;
+ const char *attr_name;
+ GVariant *attr_val;
+ NMIPAddress *addr;
+ GError *error = NULL;
+
+ g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("aa{sv}")), NULL);
+
+ g_variant_iter_init (&iter, value);
+ addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_address_unref);
+
+ while (g_variant_iter_next (&iter, "@a{sv}", &addr_var)) {
+ if ( !g_variant_lookup (addr_var, "address", "&s", &ip)
+ || !g_variant_lookup (addr_var, "prefix", "u", &prefix)) {
+ g_warning ("Ignoring invalid address");
+ g_variant_unref (addr_var);
+ continue;
+ }
+
+ addr = nm_ip_address_new (family, ip, prefix, &error);
+ if (!addr) {
+ g_warning ("Ignoring invalid address: %s", error->message);
+ g_clear_error (&error);
+ g_variant_unref (addr_var);
+ continue;
+ }
+
+ g_variant_iter_init (&attrs_iter, addr_var);
+ while (g_variant_iter_next (&attrs_iter, "{&sv}", &attr_name, &attr_val)) {
+ if ( strcmp (attr_name, "address") != 0
+ && strcmp (attr_name, "prefix") != 0)
+ nm_ip_address_set_attribute (addr, attr_name, attr_val);
+ g_variant_unref (attr_val);
+ }
+
+ g_variant_unref (addr_var);
+ g_ptr_array_add (addresses, addr);
+ }
+
+ return addresses;
+}
+
+/**
+ * nm_utils_ip_routes_to_variant:
+ * @routes: (element-type NMIPRoute): an array of #NMIPRoute objects
+ *
+ * Utility function to convert a #GPtrArray of #NMIPRoute objects representing
+ * IPv4 or IPv6 routes into a #GVariant of type 'aa{sv}' representing an array
+ * of new-style NetworkManager IP routes (which are tuples of destination,
+ * prefix, next hop, metric, and additional attributes).
+ *
+ * Returns: (transfer none): a new floating #GVariant representing @routes.
+ **/
+GVariant *
+nm_utils_ip_routes_to_variant (GPtrArray *routes)
+{
+ GVariantBuilder builder;
+ int i;
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}"));
+
+ if (routes) {
+ for (i = 0; i < routes->len; i++) {
+ NMIPRoute *route = routes->pdata[i];
+ GVariantBuilder route_builder;
+ char **names;
+ int n;
+
+ g_variant_builder_init (&route_builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_add (&route_builder, "{sv}",
+ "dest",
+ g_variant_new_string (nm_ip_route_get_dest (route)));
+ g_variant_builder_add (&route_builder, "{sv}",
+ "prefix",
+ g_variant_new_uint32 (nm_ip_route_get_prefix (route)));
+ if (nm_ip_route_get_next_hop (route)) {
+ g_variant_builder_add (&route_builder, "{sv}",
+ "next-hop",
+ g_variant_new_string (nm_ip_route_get_next_hop (route)));
+ }
+ if (nm_ip_route_get_metric (route) != -1) {
+ g_variant_builder_add (&route_builder, "{sv}",
+ "metric",
+ g_variant_new_uint32 ((guint32) nm_ip_route_get_metric (route)));
+ }
+
+ names = nm_ip_route_get_attribute_names (route);
+ for (n = 0; names[n]; n++) {
+ g_variant_builder_add (&route_builder, "{sv}",
+ names[n],
+ nm_ip_route_get_attribute (route, names[n]));
+ }
+ g_strfreev (names);
+
+ g_variant_builder_add (&builder, "a{sv}", &route_builder);
+ }
+ }
+
+ return g_variant_builder_end (&builder);
+}
+
+/**
+ * nm_utils_ip_routes_from_variant:
+ * @value: a #GVariant of type 'aa{sv}'
+ * @family: an IP address family
+ *
+ * Utility function to convert a #GVariant representing a list of new-style
+ * NetworkManager IPv4 or IPv6 addresses (which are tuples of destination,
+ * prefix, next hop, metric, and additional attributes) into a #GPtrArray of
+ * #NMIPRoute objects.
+ *
+ * Returns: (transfer full) (element-type NMIPRoute): a newly allocated
+ * #GPtrArray of #NMIPRoute objects
+ **/
+GPtrArray *
+nm_utils_ip_routes_from_variant (GVariant *value,
+ int family)
+{
+ GPtrArray *routes;
+ GVariantIter iter, attrs_iter;
+ GVariant *route_var;
+ const char *dest, *next_hop;
+ guint32 prefix, metric32;
+ gint64 metric;
+ const char *attr_name;
+ GVariant *attr_val;
+ NMIPRoute *route;
+ GError *error = NULL;
+
+ g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("aa{sv}")), NULL);
+
+ g_variant_iter_init (&iter, value);
+ routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref);
+
+ while (g_variant_iter_next (&iter, "@a{sv}", &route_var)) {
+ if ( !g_variant_lookup (route_var, "dest", "&s", &dest)
+ || !g_variant_lookup (route_var, "prefix", "u", &prefix)) {
+ g_warning ("Ignoring invalid address");
+ g_variant_unref (route_var);
+ continue;
+ }
+ if (!g_variant_lookup (route_var, "next-hop", "&s", &next_hop))
+ next_hop = NULL;
+ if (g_variant_lookup (route_var, "metric", "u", &metric32))
+ metric = metric32;
+ else
+ metric = -1;
+
+ route = nm_ip_route_new (family, dest, prefix, next_hop, metric, &error);
+ if (!route) {
+ g_warning ("Ignoring invalid route: %s", error->message);
+ g_clear_error (&error);
+ g_variant_unref (route_var);
+ continue;
+ }
+
+ g_variant_iter_init (&attrs_iter, route_var);
+ while (g_variant_iter_next (&attrs_iter, "{&sv}", &attr_name, &attr_val)) {
+ if ( strcmp (attr_name, "dest") != 0
+ && strcmp (attr_name, "prefix") != 0
+ && strcmp (attr_name, "next-hop") != 0
+ && strcmp (attr_name, "metric") != 0)
+ nm_ip_route_set_attribute (route, attr_name, attr_val);
+ g_variant_unref (attr_val);
+ }
+
+ g_ptr_array_add (routes, route);
+ }
+
+ return routes;
+}
+
+/**********************************************************************************************/
+
+/**
* nm_utils_uuid_generate:
*
* Returns: a newly allocated UUID suitable for use as the #NMSettingConnection
@@ -1640,6 +1966,11 @@ nm_utils_uuid_generate (void)
/**
* nm_utils_uuid_generate_from_string:
* @s: a string to use as the seed for the UUID
+ * @slen: if negative, treat @s as zero terminated C string.
+ * Otherwise, assume the length as given (and allow @s to be
+ * non-null terminated or contain '\0').
+ * @uuid_type: a type identifier which UUID format to generate.
+ * @type_args: additional arguments, depending on the uuid_type
*
* For a given @s, this function will always return the same UUID.
*
@@ -1647,97 +1978,111 @@ nm_utils_uuid_generate (void)
* object's #NMSettingConnection:id: property
**/
char *
-nm_utils_uuid_generate_from_string (const char *s)
+nm_utils_uuid_generate_from_string (const char *s, gssize slen, int uuid_type, gpointer type_args)
{
- GError *error = NULL;
- uuid_t *uuid;
- char *buf = NULL;
-
- if (!nm_utils_init (&error)) {
- g_warning ("error initializing crypto: (%d) %s",
- error ? error->code : 0,
- error ? error->message : "unknown");
- if (error)
- g_error_free (error);
- return NULL;
- }
+ uuid_t uuid;
+ char *buf;
- uuid = g_malloc0 (sizeof (*uuid));
- if (!crypto_md5_hash (NULL, 0, s, strlen (s), (char *) uuid, sizeof (*uuid), &error)) {
- g_warning ("error generating UUID: (%d) %s",
- error ? error->code : 0,
- error ? error->message : "unknown");
- if (error)
- g_error_free (error);
- goto out;
+ g_return_val_if_fail (slen == 0 || s, FALSE);
+
+ g_return_val_if_fail (uuid_type == NM_UTILS_UUID_TYPE_LEGACY || uuid_type == NM_UTILS_UUID_TYPE_VARIANT3, NULL);
+ g_return_val_if_fail (!type_args || uuid_type == NM_UTILS_UUID_TYPE_VARIANT3, NULL);
+
+ switch (uuid_type) {
+ case NM_UTILS_UUID_TYPE_LEGACY:
+ crypto_md5_hash (NULL, 0, s, slen, (char *) uuid, sizeof (uuid));
+ break;
+ case NM_UTILS_UUID_TYPE_VARIANT3: {
+ uuid_t ns_uuid = { 0 };
+
+ if (type_args) {
+ /* type_args can be a name space UUID. Interpret it as (char *) */
+ if (uuid_parse ((char *) type_args, ns_uuid) != 0)
+ g_return_val_if_reached (NULL);
+ }
+
+ crypto_md5_hash (s, slen, (char *) ns_uuid, sizeof (ns_uuid), (char *) uuid, sizeof (uuid));
+
+ uuid[6] = (uuid[6] & 0x0F) | 0x30;
+ uuid[8] = (uuid[8] & 0x3F) | 0x80;
+ break;
+ }
+ default:
+ g_return_val_if_reached (NULL);
}
buf = g_malloc0 (37);
- uuid_unparse_lower (*uuid, &buf[0]);
+ uuid_unparse_lower (uuid, &buf[0]);
-out:
- g_free (uuid);
return buf;
}
-static char *
-make_key (const char *cipher,
- const char *salt,
- const gsize salt_len,
- const char *password,
- gsize *out_len,
- GError **error)
+/**
+ * _nm_utils_uuid_generate_from_strings:
+ * @string1: a variadic list of strings. Must be NULL terminated.
+ *
+ * Returns a variant3 UUID based on the concatenated C strings.
+ * It does not simply concatenate them, but also includes the
+ * terminating '\0' character. For example "a", "b", gives
+ * "a\0b\0".
+ *
+ * This has the advantage, that the following invocations
+ * all give different UUIDs: (NULL), (""), ("",""), ("","a"), ("a",""),
+ * ("aa"), ("aa", ""), ("", "aa"), ...
+ */
+char *
+_nm_utils_uuid_generate_from_strings (const char *string1, ...)
{
- char *key;
- guint32 digest_len = 24; /* DES-EDE3-CBC */
+ GString *str;
+ va_list args;
+ const char *s;
+ char *uuid;
- g_return_val_if_fail (salt != NULL, NULL);
- g_return_val_if_fail (salt_len >= 8, NULL);
- g_return_val_if_fail (password != NULL, NULL);
- g_return_val_if_fail (out_len != NULL, NULL);
+ if (!string1)
+ return nm_utils_uuid_generate_from_string (NULL, 0, NM_UTILS_UUID_TYPE_VARIANT3, NM_UTILS_UUID_NS);
- if (!strcmp (cipher, "DES-EDE3-CBC"))
- digest_len = 24;
- else if (!strcmp (cipher, "AES-128-CBC"))
- digest_len = 16;
+ str = g_string_sized_new (120); /* effectively allocates power of 2 (128)*/
- key = g_malloc0 (digest_len + 1);
+ g_string_append_len (str, string1, strlen (string1) + 1);
- if (!crypto_md5_hash (salt, salt_len, password, strlen (password), key, digest_len, error)) {
- *out_len = 0;
- memset (key, 0, digest_len);
- g_free (key);
- key = NULL;
- } else
- *out_len = digest_len;
+ va_start (args, string1);
+ s = va_arg (args, const char *);
+ while (s) {
+ g_string_append_len (str, s, strlen (s) + 1);
+ s = va_arg (args, const char *);
+ }
+ va_end (args);
- return key;
+ uuid = nm_utils_uuid_generate_from_string (str->str, str->len, NM_UTILS_UUID_TYPE_VARIANT3, NM_UTILS_UUID_NS);
+
+ g_string_free (str, TRUE);
+ return uuid;
}
+/**********************************************************************************************/
+
/**
- * nm_utils_rsa_key_encrypt_helper:
- * @cipher: cipher to use for encryption ("DES-EDE3-CBC" or "AES-128-CBC")
- * @data: RSA private key data to be encrypted
+ * nm_utils_rsa_key_encrypt:
+ * @data: (array length=len): RSA private key data to be encrypted
* @len: length of @data
* @in_password: (allow-none): existing password to use, if any
- * @out_password: (out) (allow-none): if @in_password was %NULL, a random password will be generated
- * and returned in this argument
+ * @out_password: (out) (allow-none): if @in_password was %NULL, a random
+ * password will be generated and returned in this argument
* @error: detailed error information on return, if an error occurred
*
* Encrypts the given RSA private key data with the given password (or generates
* a password if no password was given) and converts the data to PEM format
- * suitable for writing to a file.
+ * suitable for writing to a file. It uses Triple DES cipher for the encryption.
*
- * Returns: (transfer full): on success, PEM-formatted data suitable for writing to a PEM-formatted
- * certificate/private key file.
+ * Returns: (transfer full): on success, PEM-formatted data suitable for writing
+ * to a PEM-formatted certificate/private key file.
**/
-static GByteArray *
-nm_utils_rsa_key_encrypt_helper (const char *cipher,
- const guint8 *data,
- gsize len,
- const char *in_password,
- char **out_password,
- GError **error)
+GByteArray *
+nm_utils_rsa_key_encrypt (const guint8 *data,
+ gsize len,
+ const char *in_password,
+ char **out_password,
+ GError **error)
{
char salt[16];
int salt_len;
@@ -1749,7 +2094,6 @@ nm_utils_rsa_key_encrypt_helper (const char *cipher,
const char *p;
GByteArray *ret = NULL;
- g_return_val_if_fail (!g_strcmp0 (cipher, CIPHER_DES_EDE3_CBC) || !g_strcmp0 (cipher, CIPHER_AES_CBC), NULL);
g_return_val_if_fail (data != NULL, NULL);
g_return_val_if_fail (len > 0, NULL);
if (out_password)
@@ -1759,22 +2103,18 @@ nm_utils_rsa_key_encrypt_helper (const char *cipher,
if (!in_password) {
if (!crypto_randomize (pw_buf, sizeof (pw_buf), error))
return NULL;
- in_password = tmp_password = nm_utils_bin2hexstr ((const char *) pw_buf, sizeof (pw_buf), -1);
+ in_password = tmp_password = nm_utils_bin2hexstr (pw_buf, sizeof (pw_buf), -1);
}
- if (g_strcmp0 (cipher, CIPHER_AES_CBC) == 0)
- salt_len = 16;
- else
- salt_len = 8;
-
+ salt_len = 8;
if (!crypto_randomize (salt, salt_len, error))
goto out;
- key = make_key (cipher, &salt[0], salt_len, in_password, &key_len, error);
+ key = crypto_make_des_aes_key (CIPHER_DES_EDE3_CBC, &salt[0], salt_len, in_password, &key_len, NULL);
if (!key)
- goto out;
+ g_return_val_if_reached (NULL);
- enc = crypto_encrypt (cipher, data, len, salt, salt_len, key, key_len, &enc_len, error);
+ enc = crypto_encrypt (CIPHER_DES_EDE3_CBC, data, len, salt, salt_len, key, key_len, &enc_len, error);
if (!enc)
goto out;
@@ -1783,8 +2123,8 @@ nm_utils_rsa_key_encrypt_helper (const char *cipher,
g_string_append (pem, "Proc-Type: 4,ENCRYPTED\n");
/* Convert the salt to a hex string */
- tmp = nm_utils_bin2hexstr ((const char *) salt, salt_len, salt_len * 2);
- g_string_append_printf (pem, "DEK-Info: %s,%s\n\n", cipher, tmp);
+ tmp = nm_utils_bin2hexstr (salt, salt_len, salt_len * 2);
+ g_string_append_printf (pem, "DEK-Info: %s,%s\n\n", CIPHER_DES_EDE3_CBC, tmp);
g_free (tmp);
/* Convert the encrypted key to a base64 string */
@@ -1825,83 +2165,170 @@ out:
return ret;
}
+static gboolean
+file_has_extension (const char *filename, const char *extensions[])
+{
+ const char *ext;
+ int i;
+
+ ext = strrchr (filename, '.');
+ if (!ext)
+ return FALSE;
+
+ for (i = 0; extensions[i]; i++) {
+ if (!g_ascii_strcasecmp (ext, extensions[i]))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/**
- * nm_utils_rsa_key_encrypt:
- * @data: RSA private key data to be encrypted
- * @len: length of @data
- * @in_password: (allow-none): existing password to use, if any
- * @out_password: (out) (allow-none): if @in_password was %NULL, a random password will be generated
- * and returned in this argument
- * @error: detailed error information on return, if an error occurred
+ * nm_utils_file_is_certificate:
+ * @filename: name of the file to test
*
- * Encrypts the given RSA private key data with the given password (or generates
- * a password if no password was given) and converts the data to PEM format
- * suitable for writing to a file. It uses Triple DES cipher for the encryption.
+ * Tests if @filename has a valid extension for an X.509 certificate file
+ * (".cer", ".crt", ".der", or ".pem"), and contains a certificate in a format
+ * recognized by NetworkManager.
*
- * Returns: (transfer full): on success, PEM-formatted data suitable for writing to a PEM-formatted
- * certificate/private key file.
+ * Returns: %TRUE if the file is a certificate, %FALSE if it is not
**/
-GByteArray *
-nm_utils_rsa_key_encrypt (const guint8 *data,
- gsize len,
- const char *in_password,
- char **out_password,
- GError **error)
+gboolean
+nm_utils_file_is_certificate (const char *filename)
{
+ const char *extensions[] = { ".der", ".pem", ".crt", ".cer", NULL };
+ NMCryptoFileFormat file_format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ GByteArray *cert;
+
+ g_return_val_if_fail (filename != NULL, FALSE);
+ if (!file_has_extension (filename, extensions))
+ return FALSE;
- return nm_utils_rsa_key_encrypt_helper (CIPHER_DES_EDE3_CBC,
- data, len,
- in_password,
- out_password,
- error);
+ cert = crypto_load_and_verify_certificate (filename, &file_format, NULL);
+ if (cert)
+ g_byte_array_unref (cert);
+
+ return file_format = NM_CRYPTO_FILE_FORMAT_X509;
}
/**
- * nm_utils_rsa_key_encrypt_aes:
- * @data: RSA private key data to be encrypted
- * @len: length of @data
- * @in_password: (allow-none): existing password to use, if any
- * @out_password: (out) (allow-none): if @in_password was %NULL, a random password will be generated
- * and returned in this argument
- * @error: detailed error information on return, if an error occurred
+ * nm_utils_file_is_private_key:
+ * @filename: name of the file to test
+ * @out_encrypted: (out): on return, whether the file is encrypted
*
- * Encrypts the given RSA private key data with the given password (or generates
- * a password if no password was given) and converts the data to PEM format
- * suitable for writing to a file. It uses AES cipher for the encryption.
+ * Tests if @filename has a valid extension for an X.509 private key file
+ * (".der", ".key", ".pem", or ".p12"), and contains a private key in a format
+ * recognized by NetworkManager.
*
- * Returns: (transfer full): on success, PEM-formatted data suitable for writing to a PEM-formatted
- * certificate/private key file.
+ * Returns: %TRUE if the file is a private key, %FALSE if it is not
**/
-GByteArray *
-nm_utils_rsa_key_encrypt_aes (const guint8 *data,
- gsize len,
- const char *in_password,
- char **out_password,
- GError **error)
+gboolean
+nm_utils_file_is_private_key (const char *filename, gboolean *out_encrypted)
{
+ const char *extensions[] = { ".der", ".pem", ".p12", ".key", NULL };
+
+ g_return_val_if_fail (filename != NULL, FALSE);
+ g_return_val_if_fail (out_encrypted == NULL || *out_encrypted == FALSE, FALSE);
- return nm_utils_rsa_key_encrypt_helper (CIPHER_AES_CBC,
- data, len,
- in_password,
- out_password,
- error);
+ if (!file_has_extension (filename, extensions))
+ return FALSE;
+
+ return crypto_verify_private_key (filename, NULL, out_encrypted, NULL) != NM_CRYPTO_FILE_FORMAT_UNKNOWN;
}
/**
* nm_utils_file_is_pkcs12:
* @filename: name of the file to test
*
- * Utility function to find out if the @filename is in PKCS#12 format.
+ * Tests if @filename is a PKCS#<!-- -->12 file.
*
- * Returns: %TRUE if the file is PKCS#12, %FALSE if it is not
+ * Returns: %TRUE if the file is PKCS#<!-- -->12, %FALSE if it is not
**/
gboolean
nm_utils_file_is_pkcs12 (const char *filename)
{
+ g_return_val_if_fail (filename != NULL, FALSE);
+
return crypto_is_pkcs12_file (filename, NULL);
}
+/**********************************************************************************************/
+
+/**
+ * nm_utils_file_search_in_paths:
+ * @progname: the helper program name, like "iptables"
+ * Must be a non-empty string, without path separator (/).
+ * @try_first: (allow-none): a custom path to try first before searching.
+ * It is silently ignored if it is empty or not an absolute path.
+ * @paths: (allow-none): a %NULL terminated list of search paths.
+ * Can be empty or %NULL, in which case only @try_first is checked.
+ * @file_test_flags: the flags passed to g_file_test() when searching
+ * for @progname. Set it to 0 to skip the g_file_test().
+ * @predicate: (scope call): if given, pass the file name to this function
+ * for additional checks. This check is performed after the check for
+ * @file_test_flags. You cannot omit both @file_test_flags and @predicate.
+ * @user_data: (closure): (allow-none): user data for @predicate function.
+ * @error: (allow-none): on failure, set a "not found" error %G_IO_ERROR %G_IO_ERROR_NOT_FOUND.
+ *
+ * Searches for a @progname file in a list of search @paths.
+ *
+ * Returns: (transfer none): 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.
+ */
+const char *
+nm_utils_file_search_in_paths (const char *progname,
+ const char *try_first,
+ const char *const *paths,
+ GFileTest file_test_flags,
+ NMUtilsFileSearchInPathsPredicate predicate,
+ gpointer user_data,
+ GError **error)
+{
+ GString *tmp;
+ const char *ret;
+
+ g_return_val_if_fail (!error || !*error, NULL);
+ g_return_val_if_fail (progname && progname[0] && !strchr (progname, '/'), NULL);
+ g_return_val_if_fail (file_test_flags || predicate, NULL);
+
+ /* Only consider @try_first if it is a valid, absolute path. This makes
+ * it simpler to pass in a path from configure checks. */
+ if ( try_first
+ && try_first[0] == '/'
+ && (file_test_flags == 0 || g_file_test (try_first, file_test_flags))
+ && (!predicate || predicate (try_first, user_data)))
+ return g_intern_string (try_first);
+
+ if (!paths || !*paths)
+ goto NOT_FOUND;
+
+ tmp = g_string_sized_new (50);
+ for (; *paths; paths++) {
+ if (!*paths)
+ continue;
+ g_string_append (tmp, *paths);
+ if (tmp->str[tmp->len - 1] != '/')
+ g_string_append_c (tmp, '/');
+ g_string_append (tmp, progname);
+ if ( (file_test_flags == 0 || g_file_test (tmp->str, file_test_flags))
+ && (!predicate || predicate (tmp->str, user_data))) {
+ ret = g_intern_string (tmp->str);
+ g_string_free (tmp, TRUE);
+ return ret;
+ }
+ g_string_set_size (tmp, 0);
+ }
+ g_string_free (tmp, TRUE);
+
+NOT_FOUND:
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, _("Could not find \"%s\" binary"), progname);
+ return NULL;
+}
+
+/**********************************************************************************************/
+
/* Band, channel/frequency stuff for wireless */
struct cf_pair {
guint32 chan;
@@ -2173,12 +2600,13 @@ nm_utils_wifi_strength_bars (guint8 strength)
/**
* nm_utils_hwaddr_len:
- * @type: the type of address; either %ARPHRD_ETHER or %ARPHRD_INFINIBAND
+ * @type: the type of address; either <literal>ARPHRD_ETHER</literal> or
+ * <literal>ARPHRD_INFINIBAND</literal>
*
* Returns the length in octets of a hardware address of type @type.
*
- * It is an error to call this function with any value other than %ARPHRD_ETHER
- * or %ARPHRD_INFINIBAND.
+ * It is an error to call this function with any value other than
+ * <literal>ARPHRD_ETHER</literal> or <literal>ARPHRD_INFINIBAND</literal>.
*
* Return value: the length.
*/
@@ -2289,7 +2717,7 @@ nm_utils_hwaddr_aton (const char *asc, gpointer buffer, gsize length)
/**
* nm_utils_hwaddr_ntoa:
- * @addr: a binary hardware address
+ * @addr: (type guint8) (array length=length): a binary hardware address
* @length: the length of @addr
*
* Converts @addr to textual form.
@@ -2325,6 +2753,9 @@ hwaddr_binary_len (const char *asc)
{
int octets = 1;
+ if (!*asc)
+ return 0;
+
for (; *asc; asc++) {
if (*asc == ':' || *asc == '-')
octets++;
@@ -2391,7 +2822,7 @@ nm_utils_hwaddr_canonical (const char *asc, gssize length)
if (nm_utils_hwaddr_aton (asc, buf, length) == NULL)
return NULL;
- return g_strdup (nm_utils_hwaddr_ntoa (buf, length));
+ return nm_utils_hwaddr_ntoa (buf, length);
}
/* This is used to possibly canonicalize values passed to MAC address property
@@ -2433,10 +2864,11 @@ _nm_utils_hwaddr_canonical_or_invalid (const char *mac, gssize length)
* a zero-filled buffer @hwaddr1_len or @hwaddr2_len bytes long.
*
* 3. If @hwaddr1 and @hwaddr2 are InfiniBand hardware addresses (that is, if
- * they are %INFINIBAND_ALEN bytes long in binary form) then only the last
- * 8 bytes are compared, since those are the only bytes that actually
- * identify the hardware. (The other 12 bytes will change depending on the
- * configuration of the InfiniBand fabric that the device is connected to.)
+ * they are <literal>INFINIBAND_ALEN</literal> bytes long in binary form)
+ * then only the last 8 bytes are compared, since those are the only bytes
+ * that actually identify the hardware. (The other 12 bytes will change
+ * depending on the configuration of the InfiniBand fabric that the device
+ * is connected to.)
*
* If a passed-in ASCII hardware address cannot be parsed, or would parse to an
* address larger than %NM_UTILS_HWADDR_LEN_MAX, then it will silently fail to
@@ -2459,7 +2891,7 @@ nm_utils_hwaddr_matches (gconstpointer hwaddr1,
g_return_val_if_fail (hwaddr1 != NULL, FALSE);
hwaddr1_len = hwaddr_binary_len (hwaddr1);
- if (hwaddr1_len > NM_UTILS_HWADDR_LEN_MAX)
+ if (hwaddr1_len == 0 || hwaddr1_len > NM_UTILS_HWADDR_LEN_MAX)
return FALSE;
if (!nm_utils_hwaddr_aton (hwaddr1, buf1, hwaddr1_len))
return FALSE;
@@ -2512,7 +2944,7 @@ _nm_utils_hwaddr_to_dbus (const GValue *prop_value)
if (str) {
len = hwaddr_binary_len (str);
- g_return_val_if_fail (len <= NM_UTILS_HWADDR_LEN_MAX, NULL);
+ g_return_val_if_fail (len > 0 && len <= NM_UTILS_HWADDR_LEN_MAX, NULL);
if (!nm_utils_hwaddr_aton (str, buf, len))
len = 0;
} else
@@ -2535,13 +2967,13 @@ _nm_utils_hwaddr_from_dbus (GVariant *dbus_value,
/**
* nm_utils_bin2hexstr:
- * @bytes: an array of bytes
- * @len: the length of the @bytes array
+ * @src: (type guint8) (array length=len): an array of bytes
+ * @len: the length of the @src array
* @final_len: an index where to cut off the returned string, or -1
*
- * Converts a byte-array @bytes into a hexadecimal string.
- * If @final_len is greater than -1, the returned string is terminated at
- * that index (returned_string[final_len] == '\0'),
+ * Converts the byte array @src into a hexadecimal string. If @final_len is
+ * greater than -1, the returned string is terminated at that index
+ * (returned_string[final_len] == '\0'),
*
* Return value: (transfer full): the textual form of @bytes
*/
@@ -2550,9 +2982,10 @@ _nm_utils_hwaddr_from_dbus (GVariant *dbus_value,
* copyright Red Hat, Inc. under terms of the LGPL.
*/
char *
-nm_utils_bin2hexstr (const char *bytes, int len, int final_len)
+nm_utils_bin2hexstr (gconstpointer src, gsize len, int final_len)
{
static char hex_digits[] = "0123456789abcdef";
+ const guint8 *bytes = src;
char *result;
int i;
gsize buflen = (len * 2) + 1;
@@ -2577,64 +3010,61 @@ nm_utils_bin2hexstr (const char *bytes, int len, int final_len)
return result;
}
-/* From hostap, Copyright (c) 2002-2005, Jouni Malinen <jkmaline@cc.hut.fi> */
/**
- * nm_utils_hex2byte:
- * @hex: a string representing a hex byte
+ * nm_utils_hexstr2bin:
+ * @hex: a string of hexadecimal characters with optional ':' separators
*
- * Converts a hex string (2 characters) into its byte representation.
+ * Converts a hexadecimal string @hex into an array of bytes. The optional
+ * separator ':' may be used between single or pairs of hexadecimal characters,
+ * eg "00:11" or "0:1". Any "0x" at the beginning of @hex is ignored. @hex
+ * may not start or end with ':'.
*
- * Return value: a byte, or -1 if @hex doesn't represent a hex byte
+ * Return value: (transfer full): the converted bytes, or %NULL on error
*/
-int
-nm_utils_hex2byte (const char *hex)
+GBytes *
+nm_utils_hexstr2bin (const char *hex)
{
+ guint i = 0, x = 0;
+ gs_free guint8 *c = NULL;
int a, b;
- a = g_ascii_xdigit_value (*hex++);
- if (a < 0)
- return -1;
- b = g_ascii_xdigit_value (*hex++);
- if (b < 0)
- return -1;
- return (a << 4) | b;
-}
+ gboolean found_colon = FALSE;
-/**
- * nm_utils_hexstr2bin:
- * @hex: an hex string
- * @len: the length of the @hex string (it has to be even)
- *
- * Converts a hexadecimal string @hex into a byte-array. The returned array
- * length is @len/2.
- *
- * Return value: (transfer full): a array of bytes, or %NULL on error
- */
-char *
-nm_utils_hexstr2bin (const char *hex, size_t len)
-{
- size_t i;
- int a;
- const char * ipos = hex;
- char * buf = NULL;
- char * opos;
+ g_return_val_if_fail (hex != NULL, NULL);
- /* Length must be a multiple of 2 */
- if ((len % 2) != 0)
- return NULL;
+ if (strncasecmp (hex, "0x", 2) == 0)
+ hex += 2;
+ found_colon = !!strchr (hex, ':');
- opos = buf = g_malloc0 ((len / 2) + 1);
- for (i = 0; i < len; i += 2) {
- a = nm_utils_hex2byte (ipos);
- if (a < 0) {
- g_free (buf);
+ c = g_malloc (strlen (hex) / 2 + 1);
+ for (;;) {
+ a = g_ascii_xdigit_value (hex[i++]);
+ if (a < 0)
+ return NULL;
+
+ if (hex[i] && hex[i] != ':') {
+ b = g_ascii_xdigit_value (hex[i++]);
+ if (b < 0)
+ return NULL;
+ c[x++] = ((guint) a << 4) | ((guint) b);
+ } else
+ c[x++] = (guint) a;
+
+ if (!hex[i])
+ break;
+ if (hex[i] == ':') {
+ if (!hex[i + 1]) {
+ /* trailing ':' is invalid */
+ return NULL;
+ }
+ i++;
+ } else if (found_colon) {
+ /* If colons exist, they must delimit 1 or 2 hex chars */
return NULL;
}
- *opos++ = a;
- ipos += 2;
}
- return buf;
+
+ return g_bytes_new (c, x);
}
-/* End from hostap */
/**
* nm_utils_iface_valid_name:
@@ -2705,13 +3135,14 @@ static char _nm_utils_inet_ntop_buffer[NM_UTILS_INET_ADDRSTRLEN];
/**
* nm_utils_inet4_ntop: (skip)
* @inaddr: the address that should be converted to string.
- * @dst: the destination buffer, it must contain at least %INET_ADDRSTRLEN
- * or %NM_UTILS_INET_ADDRSTRLEN characters. If set to %NULL, it will return
- * a pointer to an internal, static buffer (shared with nm_utils_inet6_ntop()).
- * Beware, that the internal buffer will be overwritten with ever new call
- * of nm_utils_inet4_ntop() or nm_utils_inet6_ntop() that does not provied it's
- * own @dst buffer. Also, using the internal buffer is not thread safe. When
- * in doubt, pass your own @dst buffer to avoid these issues.
+ * @dst: the destination buffer, it must contain at least
+ * <literal>INET_ADDRSTRLEN</literal> or %NM_UTILS_INET_ADDRSTRLEN
+ * characters. If set to %NULL, it will return a pointer to an internal, static
+ * buffer (shared with nm_utils_inet6_ntop()). Beware, that the internal
+ * buffer will be overwritten with ever new call of nm_utils_inet4_ntop() or
+ * nm_utils_inet6_ntop() that does not provied it's own @dst buffer. Also,
+ * using the internal buffer is not thread safe. When in doubt, pass your own
+ * @dst buffer to avoid these issues.
*
* Wrapper for inet_ntop.
*
@@ -2728,13 +3159,14 @@ nm_utils_inet4_ntop (in_addr_t inaddr, char *dst)
/**
* nm_utils_inet6_ntop: (skip)
* @in6addr: the address that should be converted to string.
- * @dst: the destination buffer, it must contain at least %INET6_ADDRSTRLEN
- * or %NM_UTILS_INET_ADDRSTRLEN characters. If set to %NULL, it will return
- * a pointer to an internal, static buffer (shared with nm_utils_inet4_ntop()).
- * Beware, that the internal buffer will be overwritten with ever new call
- * of nm_utils_inet4_ntop() or nm_utils_inet6_ntop() that does not provied it's
- * own @dst buffer. Also, using the internal buffer is not thread safe. When
- * in doubt, pass your own @dst buffer to avoid these issues.
+ * @dst: the destination buffer, it must contain at least
+ * <literal>INET6_ADDRSTRLEN</literal> or %NM_UTILS_INET_ADDRSTRLEN
+ * characters. If set to %NULL, it will return a pointer to an internal, static
+ * buffer (shared with nm_utils_inet4_ntop()). Beware, that the internal
+ * buffer will be overwritten with ever new call of nm_utils_inet4_ntop() or
+ * nm_utils_inet6_ntop() that does not provied it's own @dst buffer. Also,
+ * using the internal buffer is not thread safe. When in doubt, pass your own
+ * @dst buffer to avoid these issues.
*
* Wrapper for inet_ntop.
*
@@ -2751,6 +3183,29 @@ nm_utils_inet6_ntop (const struct in6_addr *in6addr, char *dst)
}
/**
+ * nm_utils_ipaddr_valid:
+ * @family: <literal>AF_INET</literal> or <literal>AF_INET6</literal>, or
+ * <literal>AF_UNSPEC</literal> to accept either
+ * @ip: an IP address
+ *
+ * Checks if @ip contains a valid IP address of the given family.
+ *
+ * Return value: %TRUE or %FALSE
+ */
+gboolean
+nm_utils_ipaddr_valid (int family, const char *ip)
+{
+ guint8 buf[sizeof (struct in6_addr)];
+
+ g_return_val_if_fail (family == AF_INET || family == AF_INET6 || family == AF_UNSPEC, FALSE);
+
+ if (family == AF_UNSPEC)
+ family = strchr (ip, ':') ? AF_INET6 : AF_INET;
+
+ return inet_pton (family, ip, buf) == 1;
+}
+
+/**
* nm_utils_check_virtual_device_compatibility:
* @virtual_type: a virtual connection type
* @other_type: a connection type to test against @virtual_type
@@ -2810,4 +3265,144 @@ nm_utils_check_virtual_device_compatibility (GType virtual_type, GType other_typ
}
}
+typedef struct {
+ const char *str;
+ const char *num;
+} BondMode;
+
+static BondMode bond_mode_table[] = {
+ [0] = { "balance-rr", "0" },
+ [1] = { "active-backup", "1" },
+ [2] = { "balance-xor", "2" },
+ [3] = { "broadcast", "3" },
+ [4] = { "802.3ad", "4" },
+ [5] = { "balance-tlb", "5" },
+ [6] = { "balance-alb", "6" },
+};
+
+/**
+ * nm_utils_bond_mode_int_to_string:
+ * @mode: bonding mode as a numeric value
+ *
+ * Convert bonding mode from integer value to descriptive name.
+ * See https://www.kernel.org/doc/Documentation/networking/bonding.txt for
+ * available modes.
+ *
+ * Returns: bonding mode string, or NULL on error
+ *
+ * Since: 1.2
+ */
+const char *
+nm_utils_bond_mode_int_to_string (int mode)
+{
+ if (mode >= 0 && mode < G_N_ELEMENTS (bond_mode_table))
+ return bond_mode_table[mode].str;
+ return NULL;
+}
+
+/**
+ * nm_utils_bond_mode_string_to_int:
+ * @mode: bonding mode as string
+ *
+ * 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).
+ *
+ * Returns: numeric bond mode, or -1 on error
+ *
+ * Since: 1.2
+ */
+int
+nm_utils_bond_mode_string_to_int (const char *mode)
+{
+ int i;
+
+ if (!mode || !*mode)
+ return -1;
+
+ for (i = 0; i < G_N_ELEMENTS (bond_mode_table); i++) {
+ if ( strcmp (mode, bond_mode_table[i].str) == 0
+ || strcmp (mode, bond_mode_table[i].num) == 0)
+ return i;
+ }
+ return -1;
+}
+
+/**********************************************************************************************/
+
+/* _nm_utils_ascii_str_to_int64:
+ *
+ * A wrapper for g_ascii_strtoll, that checks whether the whole string
+ * can be successfully converted to a number and is within a given
+ * range. On any error, @fallback will be returned and %errno will be set
+ * to a non-zero value. On success, %errno will be set to zero, check %errno
+ * for errors. Any trailing or leading (ascii) white space is ignored and the
+ * functions is locale independent.
+ *
+ * The function is guaranteed to return a value between @min and @max
+ * (inclusive) or @fallback. Also, the parsing is rather strict, it does
+ * not allow for any unrecognized characters, except leading and trailing
+ * white space.
+ **/
+gint64
+_nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback)
+{
+ gint64 v;
+ size_t len;
+ char buf[64], *s, *str_free = NULL;
+
+ if (str) {
+ while (g_ascii_isspace (str[0]))
+ str++;
+ }
+ if (!str || !str[0]) {
+ errno = EINVAL;
+ return fallback;
+ }
+
+ len = strlen (str);
+ if (g_ascii_isspace (str[--len])) {
+ /* backward search the first non-ws character.
+ * We already know that str[0] is non-ws. */
+ while (g_ascii_isspace (str[--len]))
+ ;
+
+ /* str[len] is now the last non-ws character... */
+ len++;
+
+ if (len >= sizeof (buf))
+ s = str_free = g_malloc (len + 1);
+ else
+ s = buf;
+
+ memcpy (s, str, len);
+ s[len] = 0;
+
+ /*
+ g_assert (len > 0 && len < strlen (str) && len == strlen (s));
+ g_assert (!g_ascii_isspace (str[len-1]) && g_ascii_isspace (str[len]));
+ g_assert (strncmp (str, s, len) == 0);
+ */
+
+ str = s;
+ }
+
+ errno = 0;
+ v = g_ascii_strtoll (str, &s, base);
+
+ if (errno != 0)
+ v = fallback;
+ else if (s[0] != 0) {
+ errno = EINVAL;
+ v = fallback;
+ } else if (v > max || v < min) {
+ errno = ERANGE;
+ v = fallback;
+ }
+
+ if (G_UNLIKELY (str_free))
+ g_free (str_free);
+ return v;
+}
diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
index 5dd3a84342..727f000568 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__
@@ -39,10 +39,6 @@
G_BEGIN_DECLS
-/* init, deinit nm_utils */
-gboolean nm_utils_init (GError **error);
-void nm_utils_deinit (void);
-
/* SSID helpers */
gboolean nm_utils_is_empty_ssid (const guint8 *ssid, gsize len);
const char *nm_utils_escape_ssid (const guint8 *ssid, gsize len);
@@ -97,8 +93,10 @@ gboolean nm_utils_wpa_psk_valid (const char *psk);
GVariant *nm_utils_ip4_dns_to_variant (char **dns);
char **nm_utils_ip4_dns_from_variant (GVariant *value);
-GVariant *nm_utils_ip4_addresses_to_variant (GPtrArray *addresses);
-GPtrArray *nm_utils_ip4_addresses_from_variant (GVariant *value);
+GVariant *nm_utils_ip4_addresses_to_variant (GPtrArray *addresses,
+ const char *gateway);
+GPtrArray *nm_utils_ip4_addresses_from_variant (GVariant *value,
+ char **out_gateway);
GVariant *nm_utils_ip4_routes_to_variant (GPtrArray *routes);
GPtrArray *nm_utils_ip4_routes_from_variant (GVariant *value);
@@ -108,26 +106,36 @@ guint32 nm_utils_ip4_get_default_prefix (guint32 ip);
GVariant *nm_utils_ip6_dns_to_variant (char **dns);
char **nm_utils_ip6_dns_from_variant (GVariant *value);
-GVariant *nm_utils_ip6_addresses_to_variant (GPtrArray *addresses);
-GPtrArray *nm_utils_ip6_addresses_from_variant (GVariant *value);
+GVariant *nm_utils_ip6_addresses_to_variant (GPtrArray *addresses,
+ const char *gateway);
+GPtrArray *nm_utils_ip6_addresses_from_variant (GVariant *value,
+ char **out_gateway);
GVariant *nm_utils_ip6_routes_to_variant (GPtrArray *routes);
GPtrArray *nm_utils_ip6_routes_from_variant (GVariant *value);
+GVariant *nm_utils_ip_addresses_to_variant (GPtrArray *addresses);
+GPtrArray *nm_utils_ip_addresses_from_variant (GVariant *value,
+ int family);
+GVariant *nm_utils_ip_routes_to_variant (GPtrArray *routes);
+GPtrArray *nm_utils_ip_routes_from_variant (GVariant *value,
+ int family);
+
char *nm_utils_uuid_generate (void);
-char *nm_utils_uuid_generate_from_string (const char *s);
-
-GByteArray *nm_utils_rsa_key_encrypt (const guint8 *data,
- gsize len,
- const char *in_password,
- char **out_password,
- GError **error);
-GByteArray *nm_utils_rsa_key_encrypt_aes (const guint8 *data,
- gsize len,
- const char *in_password,
- char **out_password,
- GError **error);
+
+gboolean nm_utils_file_is_certificate (const char *filename);
+gboolean nm_utils_file_is_private_key (const char *filename, gboolean *out_encrypted);
gboolean nm_utils_file_is_pkcs12 (const char *filename);
+typedef gboolean (*NMUtilsFileSearchInPathsPredicate) (const char *filename, gpointer user_data);
+
+const char *nm_utils_file_search_in_paths (const char *progname,
+ const char *try_first,
+ const char *const *paths,
+ GFileTest file_test_flags,
+ NMUtilsFileSearchInPathsPredicate predicate,
+ gpointer user_data,
+ GError **error);
+
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);
@@ -156,9 +164,8 @@ gboolean nm_utils_hwaddr_matches (gconstpointer hwaddr1,
gconstpointer hwaddr2,
gssize hwaddr2_len);
-char *nm_utils_bin2hexstr (const char *bytes, int len, int final_len);
-int nm_utils_hex2byte (const char *hex);
-char *nm_utils_hexstr2bin (const char *hex, size_t len);
+char *nm_utils_bin2hexstr (gconstpointer src, gsize len, int final_len);
+GBytes *nm_utils_hexstr2bin (const char *hex);
gboolean nm_utils_iface_valid_name(const char *name);
@@ -174,8 +181,15 @@ gboolean nm_utils_is_uuid (const char *str);
const char *nm_utils_inet4_ntop (in_addr_t inaddr, char *dst);
const char *nm_utils_inet6_ntop (const struct in6_addr *in6addr, char *dst);
+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_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);
+
G_END_DECLS
#endif /* __NM_UTILS_H__ */
diff --git a/libnm-core/nm-version.h.in b/libnm-core/nm-version.h.in
index 0a33ac295e..3ba7cfd832 100644
--- a/libnm-core/nm-version.h.in
+++ b/libnm-core/nm-version.h.in
@@ -67,9 +67,10 @@
#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_2 (NM_ENCODE_VERSION (1, 2, 0))
-#define NM_VERSION_CUR_STABLE NM_VERSION_0_9_10
-#define NM_VERSION_NEXT_STABLE NM_VERSION_1_0
+#define NM_VERSION_CUR_STABLE NM_VERSION_1_0
+#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2
#if !defined (NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0)
# undef NM_VERSION_MIN_REQUIRED
@@ -100,6 +101,12 @@
# define NM_DEPRECATED_IN_0_9_10_FOR(f)
#endif
+#if NM_VERSION_MAX_ALLOWED < NM_VERSION_0_9_10
+# define NM_AVAILABLE_IN_0_9_10 G_UNAVAILABLE(0.9,10)
+#else
+# define NM_AVAILABLE_IN_0_9_10
+#endif
+
#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_0
# define NM_DEPRECATED_IN_1_0 G_DEPRECATED
# define NM_DEPRECATED_IN_1_0_FOR(f) G_DEPRECATED_FOR(f)
@@ -108,16 +115,24 @@
# define NM_DEPRECATED_IN_1_0_FOR(f)
#endif
-#if NM_VERSION_MAX_ALLOWED < NM_VERSION_0_9_10
-# define NM_AVAILABLE_IN_0_9_10 G_UNAVAILABLE(0.9,10)
-#else
-# define NM_AVAILABLE_IN_0_9_10
-#endif
-
#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0
# define NM_AVAILABLE_IN_1_0 G_UNAVAILABLE(1,0)
#else
# define NM_AVAILABLE_IN_1_0
#endif
+#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_DEPRECATED_IN_1_2
+# define NM_DEPRECATED_IN_1_2_FOR(f)
+#endif
+
+#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_2
+#endif
+
#endif /* NM_VERSION_H */
diff --git a/libnm-core/tests/Makefile.am b/libnm-core/tests/Makefile.am
index eea0fc198e..daa5825b50 100644
--- a/libnm-core/tests/Makefile.am
+++ b/libnm-core/tests/Makefile.am
@@ -1,6 +1,6 @@
if ENABLE_TESTS
-certsdir = $(top_srcdir)/libnm-util/tests/certs
+certsdir = $(srcdir)/certs
AM_CPPFLAGS = \
-I${top_srcdir}/include \
@@ -15,6 +15,7 @@ noinst_PROGRAMS = \
test-compare \
test-crypto \
test-general \
+ test-keyfile \
test-secrets \
test-setting-8021x \
test-setting-dcb \
@@ -24,6 +25,36 @@ LDADD = \
$(top_builddir)/libnm-core/libnm-core.la \
$(GLIB_LIBS)
+@VALGRIND_RULES@
TESTS = $(noinst_PROGRAMS)
endif
+
+# test-cert.p12 created with:
+#
+# openssl pkcs12 -export \
+# -in test_key_and_cert.pem \
+# -inkey test_key_and_cert.pem \
+# -certfile test_ca_cert.pem \
+# -name "test-pkcs12" \
+# -out test-cert.p12
+
+EXTRA_DIST = \
+ certs/ca-no-ending-newline.pem \
+ certs/pkcs8-decrypted.der \
+ certs/pkcs8-enc-key.pem \
+ certs/pkcs8-noenc-key.pem \
+ certs/test2_ca_cert.pem \
+ certs/test2-cert.p12 \
+ certs/test2_key_and_cert.pem \
+ certs/test-aes-key.pem \
+ certs/test_ca_cert.der \
+ certs/test_ca_cert.pem \
+ certs/test-ca-cert.pem \
+ certs/test-cert.p12 \
+ certs/test_key_and_cert.pem \
+ certs/test-key-and-cert.pem \
+ certs/test-key-only-decrypted.der \
+ certs/test-key-only-decrypted.pem \
+ certs/test-key-only.pem
+
diff --git a/libnm-util/tests/certs/ca-no-ending-newline.pem b/libnm-core/tests/certs/ca-no-ending-newline.pem
index 664e299aa7..664e299aa7 100644
--- a/libnm-util/tests/certs/ca-no-ending-newline.pem
+++ b/libnm-core/tests/certs/ca-no-ending-newline.pem
diff --git a/libnm-util/tests/certs/pkcs8-decrypted.der b/libnm-core/tests/certs/pkcs8-decrypted.der
index 2cbdeb5e30..2cbdeb5e30 100644
--- a/libnm-util/tests/certs/pkcs8-decrypted.der
+++ b/libnm-core/tests/certs/pkcs8-decrypted.der
Binary files differ
diff --git a/libnm-util/tests/certs/pkcs8-enc-key.pem b/libnm-core/tests/certs/pkcs8-enc-key.pem
index 0d08f2d299..0d08f2d299 100644
--- a/libnm-util/tests/certs/pkcs8-enc-key.pem
+++ b/libnm-core/tests/certs/pkcs8-enc-key.pem
diff --git a/libnm-util/tests/certs/pkcs8-noenc-key.pem b/libnm-core/tests/certs/pkcs8-noenc-key.pem
index f73fb55ab2..f73fb55ab2 100644
--- a/libnm-util/tests/certs/pkcs8-noenc-key.pem
+++ b/libnm-core/tests/certs/pkcs8-noenc-key.pem
diff --git a/libnm-util/tests/certs/test-aes-key.pem b/libnm-core/tests/certs/test-aes-key.pem
index aab8f463ca..aab8f463ca 100644
--- a/libnm-util/tests/certs/test-aes-key.pem
+++ b/libnm-core/tests/certs/test-aes-key.pem
diff --git a/libnm-core/tests/certs/test-ca-cert.pem b/libnm-core/tests/certs/test-ca-cert.pem
new file mode 100644
index 0000000000..ef1be20d2b
--- /dev/null
+++ b/libnm-core/tests/certs/test-ca-cert.pem
@@ -0,0 +1,27 @@
+-----BEGIN CERTIFICATE-----
+MIIEjzCCA3egAwIBAgIJAOvnZPt59yIZMA0GCSqGSIb3DQEBBQUAMIGLMQswCQYD
+VQQGEwJVUzESMBAGA1UECBMJQmVya3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcw
+FQYDVQQKEw5NeSBDb21wYW55IEx0ZDEQMA4GA1UECxMHVGVzdGluZzENMAsGA1UE
+AxMEdGVzdDEcMBoGCSqGSIb3DQEJARYNdGVzdEB0ZXN0LmNvbTAeFw0wOTAzMTAx
+NTEyMTRaFw0xOTAzMDgxNTEyMTRaMIGLMQswCQYDVQQGEwJVUzESMBAGA1UECBMJ
+QmVya3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcwFQYDVQQKEw5NeSBDb21wYW55
+IEx0ZDEQMA4GA1UECxMHVGVzdGluZzENMAsGA1UEAxMEdGVzdDEcMBoGCSqGSIb3
+DQEJARYNdGVzdEB0ZXN0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBAKot9j+/+CX1/gZLgJHIXCRgCItKLGnf7qGbgqB9T2ACBqR0jllKWwDKrcWU
+xjXNIc+GF9Wnv+lX6G0Okn4Zt3/uRNobL+2b/yOF7M3Td3/9W873zdkQQX930YZc
+Rr8uxdRPP5bxiCgtcw632y21sSEbG9mjccAUnV/0jdvfmMNj0i8gN6E0fMBiJ9S3
+FkxX/KFvt9JWE9CtoyL7ki7UIDq+6vj7Gd5N0B3dOa1y+rRHZzKlJPcSXQSEYUS4
+HmKDwiKSVahft8c4tDn7KPi0vex91hlgZVd3usL2E/Vq7o5D9FAZ5kZY0AdFXwdm
+J4lO4Mj7ac7GE4vNERNcXVIX59sCAwEAAaOB8zCB8DAdBgNVHQ4EFgQUuDU3Mr7P
+T3n1e3Sy8hBauoDFahAwgcAGA1UdIwSBuDCBtYAUuDU3Mr7PT3n1e3Sy8hBauoDF
+ahChgZGkgY4wgYsxCzAJBgNVBAYTAlVTMRIwEAYDVQQIEwlCZXJrc2hpcmUxEDAO
+BgNVBAcTB05ld2J1cnkxFzAVBgNVBAoTDk15IENvbXBhbnkgTHRkMRAwDgYDVQQL
+EwdUZXN0aW5nMQ0wCwYDVQQDEwR0ZXN0MRwwGgYJKoZIhvcNAQkBFg10ZXN0QHRl
+c3QuY29tggkA6+dk+3n3IhkwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOC
+AQEAVRG4aALIvCXCiKfe7K+iJxjBVRDFPEf7JWA9LGgbFOn6pNvbxonrR+0BETdc
+JV1ET4ct2xsE7QNFIkp9GKRC+6J32zCo8qtLCD5+v436r8TUG2/t2JRMkb9I2XVT
+p7RJoot6M0Ltf8KNQUPYh756xmKZ4USfQUwc58MOSDGY8VWEXJOYij9Pf0e0c52t
+qiCEjXH7uXiS8Pgq9TYm7AkWSOrglYhSa83x0f8mtT8Q15nBESIHZ6o8FAS2bBgn
+B0BkrKRjtBUkuJG3vTox+bYINh2Gxi1JZHWSV1tN5z3hd4VFcKqanW5OgQwToBqp
+3nniskIjbH0xjgZf/nVMyLnjxg==
+-----END CERTIFICATE-----
diff --git a/libnm-util/tests/certs/test-cert.p12 b/libnm-core/tests/certs/test-cert.p12
index ae4a683049..ae4a683049 100644
--- a/libnm-util/tests/certs/test-cert.p12
+++ b/libnm-core/tests/certs/test-cert.p12
Binary files differ
diff --git a/libnm-core/tests/certs/test-key-and-cert.pem b/libnm-core/tests/certs/test-key-and-cert.pem
new file mode 100644
index 0000000000..dec9aa1b8f
--- /dev/null
+++ b/libnm-core/tests/certs/test-key-and-cert.pem
@@ -0,0 +1,118 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,4DE0615F23D82107
+
+QPNCO5Dobvz9dDhN32KkZRoEifW+HDm2PCbRQhKDiscGwB6LgypvVjHNsZiFKwzz
+L4R51UqgQeJx7GSGJqE626e9z9J+UNBhop02aOO2X0eSPdvBzr/uJ6Umiyr1xqD7
+zWf7u9l5kXElDJRhK+87GMBewp4Ie9NeXDjhF8hzC5Kiulen4AH3AYnfH3S7DimU
+h8GFMg8inrudrTbcjBhCdPeHG2jCygOxw3InRFz7uaN6LIhOaPQvmvpP4Cc1WRnW
+ZPq9o+eU3fPWPD5t+Op/VzYLvKwgBy/yK1rQXUm6ZMO7MhhRJ94ZCsJv+nVWpJlv
+QyBlxDKxwfkfYbDELdnnDQdHdMbKatLqa0KhSkgpp8LywBtanPz731tyT0r7b3na
+eLdra59lRU7ZQLPEdS3lPZd2O/KQvWf8wbg7MjXS9LxQ7R5HOPu6DNJlwXVZBmmo
+cAfu2q8ubU2IePvWLD1GOrBi6hE9TiGvFJkw+wBK+t72sz3njv9Xm/zlxruaEk5m
+RW/kybU3FP4PtjriBbskz3/VZaaxuRN7OoOYTkmyHmG1ADgcRUV6fea19qqsBlN8
+xb+SRtoH28oT/JVWU5neE2dbNzk5LeVO+w70NNdR5s5xqkBhbGGaJxvXwNP4ltFr
+T06SMh8znOLKwWB00aRtwfU7jOwR3mOleQO4ugIHmau3zp1TqzAHW8XtpuV7qVeI
+ESZOZuf0vW43BtNzgLXt1+r+bmsMsRwhnyomL9M0TUyyBdVYY9GkzTG9pOESheRo
+RSvAZ8qKGUliTpgBcbt2v1+NqkszcHa6FxuvS8YU4uo5/GqsgTxHTNIB232hIrrZ
+EIm6QL9TC5oFXMjy6UNqoCm5Nb8DBJ6aErt7pt7aoktqUW3O3QIzQT3IbZ4nAcTt
+lVF4d7j29I9t7bcC8GOVU1neilguZUss4ghJg9x4zI5UZdR7hZ8fbFT47TyxB+j5
+r0YdmjbjVTaSyaN2JGh1wvb4TzawGNVx/U2EJE16HigOtPfsfQRJ3x+FROKBdVa4
+aIFYXkRBeIPxX6n9pcw0lBCsnXo6/5iTjQSk2VqO3rHO/wyWiEjNczhL33dY2A8W
+GG5ECMO5SqXZHQQzpABqK94dxe3UC8aEESO5NhEqDuV7qQGol0qPKrUA3wb0jb2e
+DrejJ9HS2m1SUDmjpvvmEGy6GN7CRibbKt5rNZdJNNvWArOF5d0F6wkixQLl73oE
+lq5gLQQk9n7ClleKLhlQpBCorxilBbzmSUekkJLi0eaZiBBFWBX9udqnUZloXTgO
+8qwuO8K/GPR9Jy1/UH2Vh1H+wivaqKTVgEb0NotzgzECgTEFKJafl7rUNs1OZRZ3
+VBjevi6+iDpxVFgF71kXfdUC4ph0E1XDl0ja2rrKQGivMkUhWJ57+4EV5+hBkAnt
+G0RV45NwHXLrK2bd8F9PlRk2XHW6mIcFRXsW1DjeBhk/sQjvlO9R01GRSgcXtekJ
+tmX17FWrMrzXHpvy1IC3fk4RVnSjpzQ8O+17YE8/la9wVaeZZzHyYFmMT7VXjIhW
+QozJQ0vJ2jxJRh5GYn3tpJzdaeRfvTBik0pChNdUTnWP+BJ35xoCTs8iwJbmgVZ1
+-----END RSA PRIVATE KEY-----
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 1 (0x1)
+ Signature Algorithm: md5WithRSAEncryption
+ Issuer: C=US, ST=Berkshire, L=Newbury, O=My Company Ltd, OU=Testing, CN=test/emailAddress=test@test.com
+ Validity
+ Not Before: Mar 10 15:13:16 2009 GMT
+ Not After : Mar 8 15:13:16 2019 GMT
+ Subject: C=US, ST=Berkshire, O=My Company Ltd, OU=Testing, CN=test1/emailAddress=test@test.com
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (2048 bit)
+ Modulus (2048 bit):
+ 00:cd:34:b1:2e:b0:04:c6:f4:2b:a2:c0:a0:39:7a:
+ 82:ed:96:c4:f7:19:83:91:5c:b4:e7:9c:de:ec:48:
+ ec:2d:e4:51:08:26:42:ac:d3:98:26:7a:72:f7:49:
+ c2:9e:66:05:c6:47:29:fe:3b:ac:6b:af:6f:5e:a8:
+ 03:5a:73:33:ba:19:03:00:35:f5:00:bc:a8:be:14:
+ ce:46:69:e3:6d:ed:34:37:85:55:87:62:b3:b7:c9:
+ c0:cc:9a:aa:61:05:5b:cd:a2:17:42:d3:e5:6f:1c:
+ 60:8d:c2:15:41:46:f8:12:54:d0:38:57:e1:fd:8d:
+ 44:c8:fb:56:b3:b9:6c:e9:f8:9e:21:11:57:1b:8b:
+ f9:cf:e3:17:e7:d8:fd:ac:d1:01:c6:92:30:f3:2d:
+ c9:d6:c1:f0:3d:fd:ca:30:dd:75:74:e7:d1:6b:75:
+ d8:c5:4d:43:61:fe:f6:ad:7e:4c:63:7c:03:17:a2:
+ 06:8f:d0:8b:69:d3:7a:07:0f:0b:a2:cf:0c:70:38:
+ ba:cc:55:35:60:84:58:d8:d2:be:1f:ef:76:a9:ba:
+ ae:6a:dc:08:97:80:de:42:00:b7:d4:ce:9a:b0:36:
+ 2a:c7:6f:45:04:7c:ea:41:19:d8:b9:19:04:1f:11:
+ a9:22:80:bd:69:08:15:0d:3c:de:cd:7e:88:6c:0f:
+ a3:43
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ CE:03:7E:EF:E7:DE:C9:87:BF:DE:56:F4:C8:A3:40:F6:C8:6F:05:8C
+ X509v3 Authority Key Identifier:
+ keyid:B8:35:37:32:BE:CF:4F:79:F5:7B:74:B2:F2:10:5A:BA:80:C5:6A:10
+ DirName:/C=US/ST=Berkshire/L=Newbury/O=My Company Ltd/OU=Testing/CN=test/emailAddress=test@test.com
+ serial:EB:E7:64:FB:79:F7:22:19
+
+ Signature Algorithm: md5WithRSAEncryption
+ 7a:20:93:63:40:73:7d:33:01:2e:c0:13:52:a4:a7:e1:4d:82:
+ f4:fb:b2:7b:d0:2b:5a:3f:0e:3c:28:61:71:ab:01:4d:fe:89:
+ b5:cd:2f:97:59:93:53:9d:51:86:48:dd:b9:e4:73:5e:22:0b:
+ 12:0d:25:39:76:16:44:06:0c:40:45:21:6b:a6:b1:e0:bf:76:
+ 1b:36:f3:1e:41:82:57:d9:59:b7:60:40:43:1c:1d:79:f6:48:
+ 32:5c:4e:e2:06:89:96:41:d2:54:1f:4a:6f:f6:78:a5:3c:02:
+ 85:21:e2:65:e1:8a:6d:24:19:95:f8:c0:35:ab:bd:ff:3d:f1:
+ fb:50:2d:30:1e:67:a6:7c:50:f9:d5:77:66:77:5a:14:0f:5c:
+ cd:21:09:9b:a3:92:57:19:dd:01:a4:18:c5:f9:70:e4:17:43:
+ 8d:b1:e6:61:e9:50:89:83:4f:ce:a4:57:68:58:40:70:ae:71:
+ 1c:47:66:d2:30:54:50:ea:3a:87:32:64:3b:18:42:fe:5a:19:
+ 07:64:f7:f1:b1:10:07:fd:a7:d2:a7:a8:05:79:5b:25:ba:69:
+ 7b:1a:3e:b1:3e:e4:17:17:01:ba:eb:54:ae:83:00:ed:66:62:
+ 8d:c0:3e:8a:b4:27:5f:e9:01:ce:20:c3:34:a9:28:c0:6f:c7:
+ 3b:65:fe:f9
+-----BEGIN CERTIFICATE-----
+MIIEojCCA4qgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBizELMAkGA1UEBhMCVVMx
+EjAQBgNVBAgTCUJlcmtzaGlyZTEQMA4GA1UEBxMHTmV3YnVyeTEXMBUGA1UEChMO
+TXkgQ29tcGFueSBMdGQxEDAOBgNVBAsTB1Rlc3RpbmcxDTALBgNVBAMTBHRlc3Qx
+HDAaBgkqhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wHhcNMDkwMzEwMTUxMzE2WhcN
+MTkwMzA4MTUxMzE2WjB6MQswCQYDVQQGEwJVUzESMBAGA1UECBMJQmVya3NoaXJl
+MRcwFQYDVQQKEw5NeSBDb21wYW55IEx0ZDEQMA4GA1UECxMHVGVzdGluZzEOMAwG
+A1UEAxMFdGVzdDExHDAaBgkqhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNNLEusATG9CuiwKA5eoLtlsT3GYOR
+XLTnnN7sSOwt5FEIJkKs05gmenL3ScKeZgXGRyn+O6xrr29eqANaczO6GQMANfUA
+vKi+FM5GaeNt7TQ3hVWHYrO3ycDMmqphBVvNohdC0+VvHGCNwhVBRvgSVNA4V+H9
+jUTI+1azuWzp+J4hEVcbi/nP4xfn2P2s0QHGkjDzLcnWwfA9/cow3XV059FrddjF
+TUNh/vatfkxjfAMXogaP0Itp03oHDwuizwxwOLrMVTVghFjY0r4f73apuq5q3AiX
+gN5CALfUzpqwNirHb0UEfOpBGdi5GQQfEakigL1pCBUNPN7NfohsD6NDAgMBAAGj
+ggEfMIIBGzAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVy
+YXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUzgN+7+feyYe/3lb0yKNA9shvBYww
+gcAGA1UdIwSBuDCBtYAUuDU3Mr7PT3n1e3Sy8hBauoDFahChgZGkgY4wgYsxCzAJ
+BgNVBAYTAlVTMRIwEAYDVQQIEwlCZXJrc2hpcmUxEDAOBgNVBAcTB05ld2J1cnkx
+FzAVBgNVBAoTDk15IENvbXBhbnkgTHRkMRAwDgYDVQQLEwdUZXN0aW5nMQ0wCwYD
+VQQDEwR0ZXN0MRwwGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29tggkA6+dk+3n3
+IhkwDQYJKoZIhvcNAQEEBQADggEBAHogk2NAc30zAS7AE1Kkp+FNgvT7snvQK1o/
+DjwoYXGrAU3+ibXNL5dZk1OdUYZI3bnkc14iCxINJTl2FkQGDEBFIWumseC/dhs2
+8x5BglfZWbdgQEMcHXn2SDJcTuIGiZZB0lQfSm/2eKU8AoUh4mXhim0kGZX4wDWr
+vf898ftQLTAeZ6Z8UPnVd2Z3WhQPXM0hCZujklcZ3QGkGMX5cOQXQ42x5mHpUImD
+T86kV2hYQHCucRxHZtIwVFDqOocyZDsYQv5aGQdk9/GxEAf9p9KnqAV5WyW6aXsa
+PrE+5BcXAbrrVK6DAO1mYo3APoq0J1/pAc4gwzSpKMBvxztl/vk=
+-----END CERTIFICATE-----
diff --git a/libnm-util/tests/certs/test-key-only-decrypted.der b/libnm-core/tests/certs/test-key-only-decrypted.der
index c8652537a6..c8652537a6 100644
--- a/libnm-util/tests/certs/test-key-only-decrypted.der
+++ b/libnm-core/tests/certs/test-key-only-decrypted.der
Binary files differ
diff --git a/libnm-core/tests/certs/test-key-only-decrypted.pem b/libnm-core/tests/certs/test-key-only-decrypted.pem
new file mode 100644
index 0000000000..1a25da5e7d
--- /dev/null
+++ b/libnm-core/tests/certs/test-key-only-decrypted.pem
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAztLp+/SkzmaHzIst0sO4+r7qUwiVnidKBHgxoTbS5UL1dvck
+cbjTEP23V4ZoKQIb6ZMrr8B+PVgWNBAlhX4oLUL8NH/WTwrntrlAUcjliWDNc1Fj
+Z+FZNjFe0IdLXZeKQiLTQvKDYnmERVvYIJfi0TQjXuy/ikF8rYBQ85scUV3kKRzB
+xnyhAHAP9nl3AyL1S6t2yiCr4U5TbIZo6dYPbpVLtbXP02zUc9vAPR0gIHKrPiW7
+P81fLXf91wuo6wxzwD90JxdWzzGaqe3BOSfHqul3SPRtVok1XHlb9i+Mn5O8ExzQ
+dF8wGxVDcY7/Gt9lZWnCilqrBEqA3iApjUgcgwIDAQABAoIBAQC77HCmepf04ryp
+Yhz00NoXG7mWUMqBtXlPrlaKAWKG5dxbiBwZKLK/UYlxgbLK8BuklBCx1Nnfq1Yh
+YDp3nTWsSp0WpsF3eJUqNhD3Pu8xcD+9dEo6bUu+LgXUu9oC5Fq/1RzYS7qNk5RX
+4Sf0FY4GQLWS3tL7MJ20mE71yg5k7qRbDydOyhTh1m1CpRYONWxSsWVLM8KGRDJp
+iF0cdPfD5yoPFpgDk8gwzrnXJH2Wqzv8GvyYykRK5AW7tE50y0rTAM42WZ7YS6aZ
+FNMmtYxeyzXLY3LgPP0uko5anz3OXRcqCfHfFANG0y7B9MehbrjMgI6S1BbzFl07
+V1zVQVqhAoGBAPIfrWMlh1fHlRh4iRGXK2Hvxyv2oNz9KvQ4qRaLV9ejRDzdt7Pi
+/utbi5LGBuDw9016nXM3I77b6PukHzsHFnWGRnyRSbkMMt6mE17nggmNqcpFWfE8
+E7HcKMhk4gbuo5AHD3Ee1Gac2AUDnzYiE+sS6WI3O9d77cc5ych5jZ+nAoGBANqt
+VZCttjY0E+hEyTP37eaE8u0jfdK8AflTJlNUHWKXglES525iu8I/Bso8KaQYsYF3
+SezGRd3KQepQhtMjFKfSpF+tbnboP57Y3XGo8xhbxqV4kRX+XGsVoW3Vg2nPKBrR
++dIY5nMwua+gkHWp9RDcemD2reiIZBVx95fK8dfFAoGAdCSH2pBs/MlrFqLzNTHr
+iH4pb0hN39O9YAsx6POMfo79s6izbyHLIID4Ub6WHB7ashrIHjVr+yin+NXAeWMr
+/dIcS7Kxx4c3e5/0mMi6kvSWZsWfoF0uIVo3YfEqjyK36OXKHXwpbNN9t+IF5ESy
+g0e+FfPiy7nR1Ig+5+CO8+8CgYEAp/75+Ug677FaidouaMpT7gC9UAkwJLFjItQK
+YYIBgTi8WOSY/2jCrhwVb1CA/RwrYjbuiARasGUt9oEe0x3kRHnC5e4rKxaJqdMZ
+bLRK7a+0EHNrouXiwjG/7s1VQ/ht6wzdS9btVBlezdogoQSMzQNU0SExwa7mlMMV
+X3v+B7ECgYAK+Yt4jnLH1LNWoDTU0Ug5hyXsQXV8lVBSnrkvS7GtP6ZA/4OqG7lJ
+/bTYFZGoiAGzOnC+YlAqSIu45CEnpr2xBsThQiWUVxspmQD1lEWWFcd77DPUwn3C
+59pLgx0AqJE3n6lBOwehiXbFKBdVzX8PfPZpuCK6qc/RiTILktwURA==
+-----END RSA PRIVATE KEY-----
diff --git a/libnm-util/tests/certs/test-key-only.pem b/libnm-core/tests/certs/test-key-only.pem
index 5ef530e9ab..5ef530e9ab 100644
--- a/libnm-util/tests/certs/test-key-only.pem
+++ b/libnm-core/tests/certs/test-key-only.pem
diff --git a/libnm-util/tests/certs/test2-cert.p12 b/libnm-core/tests/certs/test2-cert.p12
index 9d5732b0a9..9d5732b0a9 100644
--- a/libnm-util/tests/certs/test2-cert.p12
+++ b/libnm-core/tests/certs/test2-cert.p12
Binary files differ
diff --git a/libnm-util/tests/certs/test2_ca_cert.pem b/libnm-core/tests/certs/test2_ca_cert.pem
index 9a487ca4b4..9a487ca4b4 100644
--- a/libnm-util/tests/certs/test2_ca_cert.pem
+++ b/libnm-core/tests/certs/test2_ca_cert.pem
diff --git a/libnm-util/tests/certs/test2_key_and_cert.pem b/libnm-core/tests/certs/test2_key_and_cert.pem
index a668596eef..a668596eef 100644
--- a/libnm-util/tests/certs/test2_key_and_cert.pem
+++ b/libnm-core/tests/certs/test2_key_and_cert.pem
diff --git a/libnm-util/tests/certs/test_ca_cert.der b/libnm-core/tests/certs/test_ca_cert.der
index e844f65b2c..e844f65b2c 100644
--- a/libnm-util/tests/certs/test_ca_cert.der
+++ b/libnm-core/tests/certs/test_ca_cert.der
Binary files differ
diff --git a/libnm-util/tests/certs/test_ca_cert.pem b/libnm-core/tests/certs/test_ca_cert.pem
index faa3fc2905..faa3fc2905 100644
--- a/libnm-util/tests/certs/test_ca_cert.pem
+++ b/libnm-core/tests/certs/test_ca_cert.pem
diff --git a/libnm-util/tests/certs/test_key_and_cert.pem b/libnm-core/tests/certs/test_key_and_cert.pem
index c00495d0b0..c00495d0b0 100644
--- a/libnm-util/tests/certs/test_key_and_cert.pem
+++ b/libnm-core/tests/certs/test_key_and_cert.pem
diff --git a/libnm-core/tests/test-compare.c b/libnm-core/tests/test-compare.c
index e6ab047d64..12db9c23b3 100644
--- a/libnm-core/tests/test-compare.c
+++ b/libnm-core/tests/test-compare.c
@@ -19,6 +19,8 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <arpa/inet.h>
#include <netinet/in.h>
diff --git a/libnm-core/tests/test-crypto.c b/libnm-core/tests/test-crypto.c
index b1dd3f4e09..e4ca808659 100644
--- a/libnm-core/tests/test-crypto.c
+++ b/libnm-core/tests/test-crypto.c
@@ -21,6 +21,8 @@
* Copyright 2007 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <unistd.h>
#include <stdlib.h>
@@ -30,6 +32,8 @@
#include "crypto.h"
#include "nm-utils.h"
+#include "nm-errors.h"
+#include "nm-core-internal.h"
#include "nm-test-utils.h"
@@ -94,7 +98,7 @@ out:
static void
test_cert (gconstpointer test_data)
{
- char *path;
+ gs_free char *path = NULL;
GByteArray *array;
NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
GError *error = NULL;
@@ -102,15 +106,12 @@ test_cert (gconstpointer test_data)
path = g_build_filename (TEST_CERT_DIR, (const char *) test_data, NULL);
array = crypto_load_and_verify_certificate (path, &format, &error);
- ASSERT (array != NULL, "cert",
- "couldn't read certificate file '%s': %d %s",
- path, error->code, error->message);
-
- ASSERT (format == NM_CRYPTO_FILE_FORMAT_X509, "cert",
- "%s: unexpected certificate format (expected %d, got %d)",
- path, NM_CRYPTO_FILE_FORMAT_X509, format);
+ g_assert_no_error (error);
+ g_assert_cmpint (format, ==, NM_CRYPTO_FILE_FORMAT_X509);
g_byte_array_free (array, TRUE);
+
+ g_assert (nm_utils_file_is_certificate (path));
}
static GByteArray *
@@ -133,50 +134,41 @@ static void
test_load_private_key (const char *path,
const char *password,
const char *decrypted_path,
- gboolean expect_fail,
- const char *desc)
+ int expected_error)
{
NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN;
+ gboolean is_encrypted = FALSE;
GByteArray *array, *decrypted;
GError *error = NULL;
- array = crypto_decrypt_private_key (path, password, &key_type, &error);
- if (expect_fail) {
- ASSERT (array == NULL, desc,
- "unexpected success reading private key file '%s' with "
- "invalid password",
- path);
-
- ASSERT (key_type != NM_CRYPTO_KEY_TYPE_UNKNOWN, desc,
- "unexpected failure determining private key file '%s' "
- "type with invalid password (expected %d, got %d)",
- path, NM_CRYPTO_KEY_TYPE_UNKNOWN, key_type);
+ g_assert (nm_utils_file_is_private_key (path, &is_encrypted));
+ g_assert (is_encrypted);
+
+ array = crypto_decrypt_openssl_private_key (path, password, &key_type, &error);
+ /* Even if the password is wrong, we should determine the key type */
+ g_assert_cmpint (key_type, ==, NM_CRYPTO_KEY_TYPE_RSA);
+
+ if (expected_error != -1) {
+ g_assert (array == NULL);
+ g_assert_error (error, NM_CRYPTO_ERROR, expected_error);
+ g_clear_error (&error);
return;
}
- ASSERT (array != NULL, desc,
- "couldn't read private key file '%s': %d %s",
- path, error->code, error->message);
+ if (password == NULL) {
+ g_assert (array == NULL);
+ g_assert_no_error (error);
+ return;
+ }
- ASSERT (key_type == NM_CRYPTO_KEY_TYPE_RSA, desc,
- "%s: unexpected private key type (expected %d, got %d)",
- path, NM_CRYPTO_KEY_TYPE_RSA, key_type);
+ g_assert (array != NULL);
if (decrypted_path) {
/* Compare the crypto decrypted key against a known-good decryption */
decrypted = file_to_byte_array (decrypted_path);
- ASSERT (decrypted != NULL, desc,
- "couldn't read decrypted private key file '%s': %d %s",
- decrypted_path, error->code, error->message);
-
- ASSERT (decrypted->len > 0, desc, "decrypted key file invalid (size 0)");
-
- ASSERT (decrypted->len == array->len,
- desc, "decrypted key file (%d) and decrypted key data (%d) lengths don't match",
- decrypted->len, array->len);
-
- ASSERT (memcmp (decrypted->data, array->data, array->len) == 0,
- desc, "decrypted key file and decrypted key data don't match");
+ g_assert (decrypted != NULL);
+ g_assert (decrypted->len == array->len);
+ g_assert (memcmp (decrypted->data, array->data, array->len) == 0);
g_byte_array_free (decrypted, TRUE);
}
@@ -187,147 +179,112 @@ test_load_private_key (const char *path,
static void
test_load_pkcs12 (const char *path,
const char *password,
- gboolean expect_fail,
- const char *desc)
+ int expected_error)
{
NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ gboolean is_encrypted = FALSE;
GError *error = NULL;
- format = crypto_verify_private_key (path, password, &error);
- if (expect_fail) {
- ASSERT (format == NM_CRYPTO_FILE_FORMAT_UNKNOWN, desc,
- "unexpected success reading PKCS#12 private key file "
- "'%s' with invalid password",
- path);
+ g_assert (nm_utils_file_is_private_key (path, NULL));
+
+ format = crypto_verify_private_key (path, password, &is_encrypted, &error);
+ if (expected_error != -1) {
+ g_assert_error (error, NM_CRYPTO_ERROR, expected_error);
+ g_assert_cmpint (format, ==, NM_CRYPTO_FILE_FORMAT_UNKNOWN);
+ g_clear_error (&error);
} else {
- ASSERT (format == NM_CRYPTO_FILE_FORMAT_PKCS12, desc,
- "%s: unexpected PKCS#12 private key file format (expected %d, got "
- "%d): %d %s",
- path, NM_CRYPTO_FILE_FORMAT_PKCS12, format, error->code, error->message);
+ g_assert_no_error (error);
+ g_assert_cmpint (format, ==, NM_CRYPTO_FILE_FORMAT_PKCS12);
+ g_assert (is_encrypted);
}
}
static void
-test_load_pkcs12_no_password (const char *path, const char *desc)
+test_load_pkcs12_no_password (const char *path)
{
NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ gboolean is_encrypted = FALSE;
GError *error = NULL;
+ g_assert (nm_utils_file_is_private_key (path, NULL));
+
/* We should still get a valid returned crypto file format */
- format = crypto_verify_private_key (path, NULL, &error);
- ASSERT (format == NM_CRYPTO_FILE_FORMAT_PKCS12, desc,
- "%s: unexpected PKCS#12 private key file format (expected %d, got "
- "%d): %d %s",
- path, NM_CRYPTO_FILE_FORMAT_PKCS12, format, error->code, error->message);
+ format = crypto_verify_private_key (path, NULL, &is_encrypted, &error);
+ g_assert_no_error (error);
+ g_assert_cmpint (format, ==, NM_CRYPTO_FILE_FORMAT_PKCS12);
+ g_assert (is_encrypted);
}
static void
-test_is_pkcs12 (const char *path, gboolean expect_fail, const char *desc)
+test_is_pkcs12 (const char *path, gboolean expect_fail)
{
gboolean is_pkcs12;
+ GError *error = NULL;
+
+ is_pkcs12 = crypto_is_pkcs12_file (path, &error);
- is_pkcs12 = crypto_is_pkcs12_file (path, NULL);
if (expect_fail) {
- ASSERT (is_pkcs12 == FALSE, desc,
- "unexpected success reading non-PKCS#12 file '%s'",
- path);
+ g_assert_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERROR_INVALID_DATA);
+ g_assert (!is_pkcs12);
+ g_clear_error (&error);
} else {
- ASSERT (is_pkcs12 == TRUE, desc, "couldn't read PKCS#12 file '%s'", path);
+ g_assert_no_error (error);
+ g_assert (is_pkcs12);
}
}
static void
test_load_pkcs8 (const char *path,
const char *password,
- gboolean expect_fail,
- const char *desc)
+ int expected_error)
{
NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ gboolean is_encrypted = FALSE;
GError *error = NULL;
- format = crypto_verify_private_key (path, password, &error);
- if (expect_fail) {
- ASSERT (format == NM_CRYPTO_FILE_FORMAT_UNKNOWN, desc,
- "unexpected success reading PKCS#8 private key file "
- "'%s' with invalid password",
- path);
- } else {
- ASSERT (format == NM_CRYPTO_FILE_FORMAT_RAW_KEY, desc,
- "%s: unexpected PKCS#8 private key file format (expected %d, got "
- "%d): %d %s",
- path, NM_CRYPTO_FILE_FORMAT_RAW_KEY, format, error->code, error->message);
- }
-}
-
-static gboolean
-is_cipher_aes (const char *path)
-{
- char *contents;
- gsize length = 0;
- const char *cipher;
- gboolean is_aes = FALSE;
-
- if (!g_file_get_contents (path, &contents, &length, NULL))
- return FALSE;
+ g_assert (nm_utils_file_is_private_key (path, NULL));
- cipher = strstr (contents, "DEK-Info: ");
- if (cipher) {
- cipher += strlen ("DEK-Info: ");
- if (g_str_has_prefix (cipher, "AES-128-CBC"))
- is_aes = TRUE;
+ format = crypto_verify_private_key (path, password, &is_encrypted, &error);
+ if (expected_error != -1) {
+ g_assert_error (error, NM_CRYPTO_ERROR, expected_error);
+ g_assert_cmpint (format, ==, NM_CRYPTO_FILE_FORMAT_UNKNOWN);
+ g_clear_error (&error);
+ } else {
+ g_assert_no_error (error);
+ g_assert_cmpint (format, ==, NM_CRYPTO_FILE_FORMAT_RAW_KEY);
+ g_assert (is_encrypted);
}
-
- g_free (contents);
- return is_aes;
}
static void
test_encrypt_private_key (const char *path,
- const char *password,
- const char *desc)
+ const char *password)
{
NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN;
GByteArray *array, *encrypted, *re_decrypted;
GError *error = NULL;
- array = crypto_decrypt_private_key (path, password, &key_type, &error);
- ASSERT (array != NULL, desc,
- "couldn't read private key file '%s': %d %s",
- path, error->code, error->message);
-
- ASSERT (key_type == NM_CRYPTO_KEY_TYPE_RSA, desc,
- "%s: unexpected private key type (expected %d, got %d)",
- path, NM_CRYPTO_KEY_TYPE_RSA, key_type);
+ array = crypto_decrypt_openssl_private_key (path, password, &key_type, &error);
+ g_assert_no_error (error);
+ g_assert (array != NULL);
+ g_assert_cmpint (key_type, ==, NM_CRYPTO_KEY_TYPE_RSA);
/* Now re-encrypt the private key */
- if (is_cipher_aes (path))
- encrypted = nm_utils_rsa_key_encrypt_aes (array->data, array->len, password, NULL, &error);
- else
- encrypted = nm_utils_rsa_key_encrypt (array->data, array->len, password, NULL, &error);
- ASSERT (encrypted != NULL, desc,
- "couldn't re-encrypt private key file '%s': %d %s",
- path, error->code, error->message);
+ encrypted = nm_utils_rsa_key_encrypt (array->data, array->len, password, NULL, &error);
+ g_assert_no_error (error);
+ g_assert (encrypted != NULL);
/* Then re-decrypt the private key */
key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN;
- re_decrypted = crypto_decrypt_private_key_data (encrypted->data, encrypted->len,
- password, &key_type, &error);
- ASSERT (re_decrypted != NULL, desc,
- "couldn't read private key file '%s': %d %s",
- path, error->code, error->message);
-
- ASSERT (key_type == NM_CRYPTO_KEY_TYPE_RSA, desc,
- "%s: unexpected private key type (expected %d, got %d)",
- path, NM_CRYPTO_KEY_TYPE_RSA, key_type);
+ re_decrypted = crypto_decrypt_openssl_private_key_data (encrypted->data, encrypted->len,
+ password, &key_type, &error);
+ g_assert_no_error (error);
+ g_assert (re_decrypted != NULL);
+ g_assert_cmpint (key_type, ==, NM_CRYPTO_KEY_TYPE_RSA);
/* Compare the original decrypted key with the re-decrypted key */
- ASSERT (array->len == re_decrypted->len, desc,
- "%s: unexpected re-decrypted private key length (expected %d, got %d)",
- path, array->len, re_decrypted->len);
-
- ASSERT (!memcmp (array->data, re_decrypted->data, array->len), desc,
- "%s: unexpected private key data",
- path);
+ g_assert_cmpint (array->len, ==, re_decrypted->len);
+ g_assert (!memcmp (array->data, re_decrypted->data, array->len));
g_byte_array_free (re_decrypted, TRUE);
g_byte_array_free (encrypted, TRUE);
@@ -342,18 +299,18 @@ test_key (gconstpointer test_data)
parts = g_strsplit ((const char *) test_data, ", ", -1);
len = g_strv_length (parts);
- ASSERT (len == 2 || len == 3, "test-crypto",
- "wrong number of arguments (<key file>, <password>, [<decrypted key file>])");
+ if (len != 2 && len != 3)
+ g_error ("wrong number of arguments (<key file>, <password>, [<decrypted key file>])");
path = g_build_filename (TEST_CERT_DIR, parts[0], NULL);
password = parts[1];
decrypted_path = parts[2] ? g_build_filename (TEST_CERT_DIR, parts[2], NULL) : NULL;
- test_is_pkcs12 (path, TRUE, "not-pkcs12");
- test_load_private_key (path, password, decrypted_path, FALSE, "private-key");
- test_load_private_key (path, "blahblahblah", NULL, TRUE, "private-key-bad-password");
- test_load_private_key (path, NULL, NULL, TRUE, "private-key-no-password");
- test_encrypt_private_key (path, password, "private-key-rencrypt");
+ test_is_pkcs12 (path, TRUE);
+ test_load_private_key (path, password, decrypted_path, -1);
+ test_load_private_key (path, "blahblahblah", NULL, NM_CRYPTO_ERROR_DECRYPTION_FAILED);
+ test_load_private_key (path, NULL, NULL, -1);
+ test_encrypt_private_key (path, password);
g_free (path);
g_free (decrypted_path);
@@ -361,21 +318,36 @@ test_key (gconstpointer test_data)
}
static void
+test_key_decrypted (gconstpointer test_data)
+{
+ const char *file = (const char *) test_data;
+ gboolean is_encrypted = FALSE;
+ char *path;
+
+ path = g_build_filename (TEST_CERT_DIR, file, NULL);
+
+ g_assert (nm_utils_file_is_private_key (path, &is_encrypted));
+ g_assert (!is_encrypted);
+
+ g_free (path);
+}
+
+static void
test_pkcs12 (gconstpointer test_data)
{
char **parts, *path, *password;
parts = g_strsplit ((const char *) test_data, ", ", -1);
- ASSERT (g_strv_length (parts) == 2, "test-crypto",
- "wrong number of arguments (<file>, <password>)");
+ if (g_strv_length (parts) != 2)
+ g_error ("wrong number of arguments (<file>, <password>)");
path = g_build_filename (TEST_CERT_DIR, parts[0], NULL);
password = parts[1];
- test_is_pkcs12 (path, FALSE, "is-pkcs12");
- test_load_pkcs12 (path, password, FALSE, "pkcs12-private-key");
- test_load_pkcs12 (path, "blahblahblah", TRUE, "pkcs12-private-key-bad-password");
- test_load_pkcs12_no_password (path, "pkcs12-private-key-no-password");
+ test_is_pkcs12 (path, FALSE);
+ test_load_pkcs12 (path, password, -1);
+ test_load_pkcs12 (path, "blahblahblah", NM_CRYPTO_ERROR_DECRYPTION_FAILED);
+ test_load_pkcs12_no_password (path);
g_free (path);
g_strfreev (parts);
@@ -387,24 +359,81 @@ test_pkcs8 (gconstpointer test_data)
char **parts, *path, *password;
parts = g_strsplit ((const char *) test_data, ", ", -1);
- ASSERT (g_strv_length (parts) == 2, "test-crypto",
- "wrong number of arguments (<file>, <password>)");
+ if (g_strv_length (parts) != 2)
+ g_error ("wrong number of arguments (<file>, <password>)");
path = g_build_filename (TEST_CERT_DIR, parts[0], NULL);
password = parts[1];
- test_is_pkcs12 (path, TRUE, "not-pkcs12");
- test_load_pkcs8 (path, password, FALSE, "pkcs8-private-key");
+ test_is_pkcs12 (path, TRUE);
+ test_load_pkcs8 (path, password, -1);
/* Until gnutls and NSS grow support for all the ciphers that openssl
* can use with PKCS#8, we can't actually verify the password. So we
* expect a bad password to work for the time being.
*/
- test_load_pkcs8 (path, "blahblahblah", FALSE, "pkcs8-private-key-bad-password");
+ test_load_pkcs8 (path, "blahblahblah", -1);
g_free (path);
g_strfreev (parts);
}
+#define SALT "sodium chloride"
+#define SHORT_PASSWORD "short"
+#define LONG_PASSWORD "this is a longer password than the short one"
+#define SHORT_DIGEST 16
+#define LONG_DIGEST 57
+
+struct {
+ const char *salt, *password;
+ gsize digest_size;
+ const char *result;
+} md5_tests[] = {
+ { NULL, SHORT_PASSWORD, SHORT_DIGEST,
+ "4f09daa9d95bcb166a302407a0e0babe" },
+ { NULL, SHORT_PASSWORD, LONG_DIGEST,
+ "4f09daa9d95bcb166a302407a0e0babeb7d62e5baf706830d007c253f0fe7584ad7e92dc00a599ec277293c298ae70ee3904c348e23be61c91" },
+ { SALT, SHORT_PASSWORD, SHORT_DIGEST,
+ "774771f7292210233b5724991d1f9894" },
+ { SALT, SHORT_PASSWORD, LONG_DIGEST,
+ "774771f7292210233b5724991d1f98941a6ffdb45e4dc7fa04b1fa6aceed379c1ade0577bc8f261d109942ed5736921c052664d72e0d5bade9" },
+ { NULL, LONG_PASSWORD, SHORT_DIGEST,
+ "e9c03517f81ff29bb777dac21fb1699c" },
+ { NULL, LONG_PASSWORD, LONG_DIGEST,
+ "e9c03517f81ff29bb777dac21fb1699c50968c7ccd8db4f0a59d00ffd87b05876d45f25a927d51a8400c35af60fbd64584349a8b7435d62fd9" },
+ { SALT, LONG_PASSWORD, SHORT_DIGEST,
+ "4e5c076e2f85f5e03994acbf3a9e10d6" },
+ { SALT, LONG_PASSWORD, LONG_DIGEST,
+ "4e5c076e2f85f5e03994acbf3a9e10d61a6969c9fdf47ae8b1f7e2725b3767b05cc974bfcb5344b630c91761e015e09d7794b5065662533bc9" },
+ { NULL, "", SHORT_DIGEST,
+ "d41d8cd98f00b204e9800998ecf8427e" },
+ { SALT, "", SHORT_DIGEST,
+ "7df1e0494c977195005d82a1809685e4" },
+};
+
+static void
+test_md5 (void)
+{
+ char digest[LONG_DIGEST], *hex;
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS (md5_tests); i++) {
+ memset (digest, 0, sizeof (digest));
+ crypto_md5_hash (md5_tests[i].salt,
+ /* crypto_md5_hash() used to clamp salt_len to 8. It
+ * doesn't any more, so we need to do it here now to
+ * get output that matches md5_tests[i].result.
+ */
+ md5_tests[i].salt ? 8 : 0,
+ md5_tests[i].password,
+ strlen (md5_tests[i].password),
+ digest, md5_tests[i].digest_size);
+
+ hex = nm_utils_bin2hexstr (digest, md5_tests[i].digest_size, -1);
+ g_assert_cmpstr (hex, ==, md5_tests[i].result);
+ g_free (hex);
+ }
+}
+
NMTST_DEFINE ();
int
@@ -449,6 +478,9 @@ main (int argc, char **argv)
g_test_add_data_func ("/libnm/crypto/key/aes",
"test-aes-key.pem, test-aes-password",
test_key);
+ g_test_add_data_func ("/libnm/crypto/key/decrypted",
+ "test-key-only-decrypted.pem",
+ test_key_decrypted);
g_test_add_data_func ("/libnm/crypto/PKCS#12/1",
"test-cert.p12, test",
@@ -461,9 +493,9 @@ main (int argc, char **argv)
"pkcs8-enc-key.pem, 1234567890",
test_pkcs8);
- ret = g_test_run ();
+ g_test_add_func ("/libnm/crypto/md5", test_md5);
- crypto_deinit ();
+ ret = g_test_run ();
return ret;
}
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c
index a71238929f..a417d3fe31 100644
--- a/libnm-core/tests/test-general.c
+++ b/libnm-core/tests/test-general.c
@@ -19,10 +19,13 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <nm-utils.h>
+#include "gsystem-local-alloc.h"
#include "nm-setting-private.h"
#include "nm-utils.h"
@@ -323,159 +326,330 @@ test_setting_vpn_modify_during_foreach (void)
static void
test_setting_ip4_config_labels (void)
{
- NMSettingIP4Config *s_ip4;
- NMIP4Address *addr;
- const char *label;
+ NMSettingIPConfig *s_ip4;
+ NMIPAddress *addr;
+ GVariant *label;
GPtrArray *addrs;
char **labels;
+ NMConnection *conn;
+ GVariant *dict, *dict2, *setting_dict, *value;
GError *error = NULL;
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
NULL);
/* addr 1 */
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, 0x01010101);
- nm_ip4_address_set_prefix (addr, 24);
-
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
+ addr = nm_ip_address_new (AF_INET, "1.2.3.4", 24, &error);
g_assert_no_error (error);
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 0);
- g_assert_cmpstr (label, ==, "");
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
+ nmtst_assert_setting_verifies (NM_SETTING (s_ip4));
- /* addr 2 */
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, 0x02020202);
- nm_ip4_address_set_prefix (addr, 24);
+ addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label == NULL);
+
+ /* The 'address-labels' property should be omitted from the serialization if
+ * there are no non-NULL labels.
+ */
+ conn = nmtst_create_minimal_connection ("label test", NULL, NM_SETTING_WIRED_SETTING_NAME, NULL);
+ nm_connection_add_setting (conn, nm_setting_duplicate (NM_SETTING (s_ip4)));
+ dict = nm_connection_to_dbus (conn, NM_CONNECTION_SERIALIZE_ALL);
+ g_object_unref (conn);
+
+ setting_dict = g_variant_lookup_value (dict, NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_VARIANT_TYPE_SETTING);
+ g_assert (setting_dict != NULL);
+
+ value = g_variant_lookup_value (setting_dict, "address-labels", NULL);
+ g_assert (value == NULL);
+
+ g_variant_unref (setting_dict);
+ g_variant_unref (dict);
- _nm_setting_ip4_config_add_address_with_label (s_ip4, addr, "eth0:1");
- nm_ip4_address_unref (addr);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
+ /* Now back to constructing the original s_ip4... */
+
+ /* addr 2 */
+ addr = nm_ip_address_new (AF_INET, "2.3.4.5", 24, &error);
g_assert_no_error (error);
+ nm_ip_address_set_attribute (addr, "label", g_variant_new_string ("eth0:1"));
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 1);
- g_assert_cmpstr (label, ==, "eth0:1");
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
+ nmtst_assert_setting_verifies (NM_SETTING (s_ip4));
- /* addr 3 */
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, 0x03030303);
- nm_ip4_address_set_prefix (addr, 24);
+ addr = nm_setting_ip_config_get_address (s_ip4, 1);
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label != NULL);
+ g_assert_cmpstr (g_variant_get_string (label, NULL), ==, "eth0:1");
- _nm_setting_ip4_config_add_address_with_label (s_ip4, addr, "");
- nm_ip4_address_unref (addr);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
+ /* addr 3 */
+ addr = nm_ip_address_new (AF_INET, "3.4.5.6", 24, &error);
g_assert_no_error (error);
+ nm_ip_address_set_attribute (addr, "label", NULL);
+
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
+ nmtst_assert_setting_verifies (NM_SETTING (s_ip4));
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 2);
- g_assert_cmpstr (label, ==, "");
+ addr = nm_setting_ip_config_get_address (s_ip4, 2);
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label == NULL);
/* Remove addr 1 and re-verify remaining addresses */
- nm_setting_ip4_config_remove_address (s_ip4, 0);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
+ nm_setting_ip_config_remove_address (s_ip4, 0);
+ nmtst_assert_setting_verifies (NM_SETTING (s_ip4));
+
+ addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "2.3.4.5");
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label != NULL);
+ g_assert_cmpstr (g_variant_get_string (label, NULL), ==, "eth0:1");
+
+ addr = nm_setting_ip_config_get_address (s_ip4, 1);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "3.4.5.6");
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label == NULL);
+
+ /* If we serialize as the daemon, the labels should appear in the D-Bus
+ * serialization under both 'address-labels' and 'address-data'.
+ */
+ conn = nmtst_create_minimal_connection ("label test", NULL, NM_SETTING_WIRED_SETTING_NAME, NULL);
+ nm_connection_add_setting (conn, NM_SETTING (s_ip4));
+ _nm_utils_is_manager_process = TRUE;
+ dict = nm_connection_to_dbus (conn, NM_CONNECTION_SERIALIZE_ALL);
+ _nm_utils_is_manager_process = FALSE;
+ g_object_unref (conn);
+
+ setting_dict = g_variant_lookup_value (dict, NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_VARIANT_TYPE_SETTING);
+ g_assert (setting_dict != NULL);
+
+ value = g_variant_lookup_value (setting_dict, "address-labels", G_VARIANT_TYPE_STRING_ARRAY);
+ g_assert (value != NULL);
+ g_variant_get (value, "^as", &labels);
+ g_assert_cmpint (g_strv_length (labels), ==, 2);
+ g_assert_cmpstr (labels[0], ==, "eth0:1");
+ g_assert_cmpstr (labels[1], ==, "");
+ g_variant_unref (value);
+ g_strfreev (labels);
+
+ value = g_variant_lookup_value (setting_dict, "address-data", G_VARIANT_TYPE ("aa{sv}"));
+ addrs = nm_utils_ip_addresses_from_variant (value, AF_INET);
+ g_variant_unref (value);
+ g_assert (addrs != NULL);
+ g_assert_cmpint (addrs->len, ==, 2);
+ addr = addrs->pdata[0];
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label != NULL);
+ g_assert_cmpstr (g_variant_get_string (label, NULL), ==, "eth0:1");
+ addr = addrs->pdata[1];
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label == NULL);
+ g_ptr_array_unref (addrs);
+
+ g_variant_unref (setting_dict);
+
+ /* We should be able to deserialize the labels from either 'address-labels'
+ * or 'address-data'.
+ */
+ dict2 = g_variant_ref (dict);
+
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_DROP_PROPERTY (NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ "address-data");
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert_no_error (error);
+ g_variant_unref (dict);
+
+ s_ip4 = nm_connection_get_setting_ip4_config (conn);
+
+ addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "2.3.4.5");
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label != NULL);
+ g_assert_cmpstr (g_variant_get_string (label, NULL), ==, "eth0:1");
+
+ addr = nm_setting_ip_config_get_address (s_ip4, 1);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "3.4.5.6");
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label == NULL);
+
+ g_object_unref (conn);
+
+ NMTST_VARIANT_EDITOR (dict2,
+ NMTST_VARIANT_DROP_PROPERTY (NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ "address-labels");
+ );
+ conn = nm_simple_connection_new_from_dbus (dict2, &error);
g_assert_no_error (error);
+ g_variant_unref (dict2);
- addr = nm_setting_ip4_config_get_address (s_ip4, 0);
- g_assert_cmpint (nm_ip4_address_get_address (addr), ==, 0x02020202);
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 0);
- g_assert_cmpstr (label, ==, "eth0:1");
+ s_ip4 = nm_connection_get_setting_ip4_config (conn);
- addr = nm_setting_ip4_config_get_address (s_ip4, 1);
- g_assert_cmpint (nm_ip4_address_get_address (addr), ==, 0x03030303);
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 1);
- g_assert_cmpstr (label, ==, "");
+ addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "2.3.4.5");
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert_cmpstr (g_variant_get_string (label, NULL), ==, "eth0:1");
+ addr = nm_setting_ip_config_get_address (s_ip4, 1);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "3.4.5.6");
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label == NULL);
/* Test explicit property assignment */
g_object_get (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_ADDRESSES, &addrs,
- "address-labels", &labels,
+ NM_SETTING_IP_CONFIG_ADDRESSES, &addrs,
NULL);
- nm_setting_ip4_config_clear_addresses (s_ip4);
- g_assert_cmpint (nm_setting_ip4_config_get_num_addresses (s_ip4), ==, 0);
+ nm_setting_ip_config_clear_addresses (s_ip4);
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 0);
- /* Setting addrs but not labels will result in empty labels */
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_ADDRESSES, addrs,
+ NM_SETTING_IP_CONFIG_ADDRESSES, addrs,
NULL);
g_ptr_array_unref (addrs);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
- g_assert_no_error (error);
- g_assert_cmpint (nm_setting_ip4_config_get_num_addresses (s_ip4), ==, 2);
+ nmtst_assert_setting_verifies (NM_SETTING (s_ip4));
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 2);
+
+ addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "2.3.4.5");
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label != NULL);
+ g_assert_cmpstr (g_variant_get_string (label, NULL), ==, "eth0:1");
- addr = nm_setting_ip4_config_get_address (s_ip4, 0);
- g_assert_cmpint (nm_ip4_address_get_address (addr), ==, 0x02020202);
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 0);
- g_assert_cmpstr (label, ==, "");
+ addr = nm_setting_ip_config_get_address (s_ip4, 1);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "3.4.5.6");
+ label = nm_ip_address_get_attribute (addr, "label");
+ g_assert (label == NULL);
- addr = nm_setting_ip4_config_get_address (s_ip4, 1);
- g_assert_cmpint (nm_ip4_address_get_address (addr), ==, 0x03030303);
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 1);
- g_assert_cmpstr (label, ==, "");
+ g_object_unref (conn);
+}
+
+static void
+test_setting_ip4_config_address_data (void)
+{
+ NMSettingIPConfig *s_ip4;
+ NMIPAddress *addr;
+ GPtrArray *addrs;
+ NMConnection *conn;
+ GVariant *dict, *setting_dict, *value;
+ GError *error = NULL;
- /* Setting labels now will leave addresses untouched */
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_object_set (G_OBJECT (s_ip4),
- "address-labels", labels,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
NULL);
- g_strfreev (labels);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
+
+ /* addr 1 */
+ addr = nm_ip_address_new (AF_INET, "1.2.3.4", 24, &error);
g_assert_no_error (error);
- g_assert_cmpint (nm_setting_ip4_config_get_num_addresses (s_ip4), ==, 2);
+ nm_ip_address_set_attribute (addr, "one", g_variant_new_string ("foo"));
+ nm_ip_address_set_attribute (addr, "two", g_variant_new_int32 (42));
- addr = nm_setting_ip4_config_get_address (s_ip4, 0);
- g_assert_cmpint (nm_ip4_address_get_address (addr), ==, 0x02020202);
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 0);
- g_assert_cmpstr (label, ==, "eth0:1");
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
+ nmtst_assert_setting_verifies (NM_SETTING (s_ip4));
+
+ /* addr 2 */
+ addr = nm_ip_address_new (AF_INET, "2.3.4.5", 24, &error);
+ g_assert_no_error (error);
- addr = nm_setting_ip4_config_get_address (s_ip4, 1);
- g_assert_cmpint (nm_ip4_address_get_address (addr), ==, 0x03030303);
- label = _nm_setting_ip4_config_get_address_label (s_ip4, 1);
- g_assert_cmpstr (label, ==, "");
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
+ nmtst_assert_setting_verifies (NM_SETTING (s_ip4));
- /* Setting labels to a value that's too short or too long will result in
- * the setting not verifying.
+ /* The client-side D-Bus serialization should include the attributes in
+ * "address-data", and should not have an "addresses" property.
*/
- labels = g_strsplit ("eth0:2", ",", -1);
- g_object_set (G_OBJECT (s_ip4),
- "address-labels", labels,
- NULL);
- g_strfreev (labels);
+ conn = nmtst_create_minimal_connection ("address-data test", NULL, NM_SETTING_WIRED_SETTING_NAME, NULL);
+ nm_connection_add_setting (conn, NM_SETTING (s_ip4));
+ dict = nm_connection_to_dbus (conn, NM_CONNECTION_SERIALIZE_ALL);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
- g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
- g_assert (g_str_has_prefix (error->message, "ipv4.address-labels:"));
- g_clear_error (&error);
+ setting_dict = g_variant_lookup_value (dict, NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_VARIANT_TYPE_SETTING);
+ g_assert (setting_dict != NULL);
- labels = g_strsplit ("eth0:2,eth0:3", ",", -1);
- g_object_set (G_OBJECT (s_ip4),
- "address-labels", labels,
- NULL);
- g_strfreev (labels);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
+ value = g_variant_lookup_value (setting_dict, "addresses", NULL);
+ g_assert (value == NULL);
+
+ value = g_variant_lookup_value (setting_dict, "address-data", G_VARIANT_TYPE ("aa{sv}"));
+ addrs = nm_utils_ip_addresses_from_variant (value, AF_INET);
+ g_variant_unref (value);
+ g_assert (addrs != NULL);
+ g_assert_cmpint (addrs->len, ==, 2);
+
+ addr = addrs->pdata[0];
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "1.2.3.4");
+ value = nm_ip_address_get_attribute (addr, "one");
+ g_assert (value != NULL);
+ g_assert_cmpstr (g_variant_get_string (value, NULL), ==, "foo");
+ value = nm_ip_address_get_attribute (addr, "two");
+ g_assert (value != NULL);
+ g_assert_cmpint (g_variant_get_int32 (value), ==, 42);
+
+ g_ptr_array_unref (addrs);
+ g_variant_unref (setting_dict);
+ g_variant_unref (dict);
+
+ /* The daemon-side serialization should include both 'addresses' and 'address-data' */
+ _nm_utils_is_manager_process = TRUE;
+ dict = nm_connection_to_dbus (conn, NM_CONNECTION_SERIALIZE_ALL);
+ _nm_utils_is_manager_process = FALSE;
+
+ setting_dict = g_variant_lookup_value (dict, NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_VARIANT_TYPE_SETTING);
+ g_assert (setting_dict != NULL);
+
+ value = g_variant_lookup_value (setting_dict, "addresses", G_VARIANT_TYPE ("aau"));
+ g_assert (value != NULL);
+ g_variant_unref (value);
+
+ value = g_variant_lookup_value (setting_dict, "address-data", G_VARIANT_TYPE ("aa{sv}"));
+ g_assert (value != NULL);
+ g_variant_unref (value);
+
+ g_variant_unref (setting_dict);
+ g_object_unref (conn);
+
+ /* When we reserialize that dictionary as a client, 'address-data' will be preferred. */
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
g_assert_no_error (error);
- labels = g_strsplit ("eth0:2,eth0:3,eth0:4", ",", -1);
- g_object_set (G_OBJECT (s_ip4),
- "address-labels", labels,
- NULL);
- g_strfreev (labels);
- nm_setting_verify (NM_SETTING (s_ip4), NULL, &error);
- g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
- g_assert (g_str_has_prefix (error->message, "ipv4.address-labels:"));
- g_clear_error (&error);
+ s_ip4 = nm_connection_get_setting_ip4_config (conn);
+
+ addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "1.2.3.4");
+ value = nm_ip_address_get_attribute (addr, "one");
+ g_assert (value != NULL);
+ g_assert_cmpstr (g_variant_get_string (value, NULL), ==, "foo");
+ value = nm_ip_address_get_attribute (addr, "two");
+ g_assert (value != NULL);
+ g_assert_cmpint (g_variant_get_int32 (value), ==, 42);
+
+ /* But on the server side, 'addresses' will have precedence. */
+ _nm_utils_is_manager_process = TRUE;
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ _nm_utils_is_manager_process = FALSE;
+ g_assert_no_error (error);
+ g_variant_unref (dict);
+
+ s_ip4 = nm_connection_get_setting_ip4_config (conn);
+
+ addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert_cmpstr (nm_ip_address_get_address (addr), ==, "1.2.3.4");
+ value = nm_ip_address_get_attribute (addr, "one");
+ g_assert (value == NULL);
+ value = nm_ip_address_get_attribute (addr, "two");
+ g_assert (value == NULL);
- g_object_unref (s_ip4);
+ g_object_unref (conn);
}
static void
test_setting_gsm_apn_spaces (void)
{
- NMSettingGsm *s_gsm;
+ gs_unref_object NMSettingGsm *s_gsm = NULL;
const char *tmp;
s_gsm = (NMSettingGsm *) nm_setting_gsm_new ();
@@ -503,7 +677,7 @@ test_setting_gsm_apn_spaces (void)
static void
test_setting_gsm_apn_bad_chars (void)
{
- NMSettingGsm *s_gsm;
+ gs_unref_object NMSettingGsm *s_gsm = NULL;
s_gsm = (NMSettingGsm *) nm_setting_gsm_new ();
ASSERT (s_gsm != NULL,
@@ -541,9 +715,7 @@ test_setting_gsm_apn_bad_chars (void)
static void
test_setting_gsm_apn_underscore (void)
{
- NMSettingGsm *s_gsm;
- GError *error = NULL;
- gboolean success;
+ gs_unref_object NMSettingGsm *s_gsm = NULL;
s_gsm = (NMSettingGsm *) nm_setting_gsm_new ();
g_assert (s_gsm);
@@ -552,30 +724,23 @@ test_setting_gsm_apn_underscore (void)
/* 65-character long */
g_object_set (s_gsm, NM_SETTING_GSM_APN, "foobar_baz", NULL);
- success = nm_setting_verify (NM_SETTING (s_gsm), NULL, &error);
- g_assert_no_error (error);
- g_assert (success == TRUE);
+ nmtst_assert_setting_verifies (NM_SETTING (s_gsm));
}
static void
test_setting_gsm_without_number (void)
{
- NMSettingGsm *s_gsm;
- GError *error = NULL;
- gboolean success;
+ gs_unref_object NMSettingGsm *s_gsm = NULL;
s_gsm = (NMSettingGsm *) nm_setting_gsm_new ();
g_assert (s_gsm);
g_object_set (s_gsm, NM_SETTING_GSM_NUMBER, NULL, NULL);
- success = nm_setting_verify (NM_SETTING (s_gsm), NULL, &error);
- g_assert_no_error (error);
- g_assert (success == TRUE);
+ nmtst_assert_setting_verifies (NM_SETTING (s_gsm));
g_object_set (s_gsm, NM_SETTING_GSM_NUMBER, "", NULL);
- success = nm_setting_verify (NM_SETTING (s_gsm), NULL, &error);
- g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
- g_error_free (error);
+ nmtst_assert_setting_verify_fails (NM_SETTING (s_gsm), NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY);
}
static NMSettingWirelessSecurity *
@@ -976,6 +1141,183 @@ test_setting_new_from_dbus_enum (void)
g_object_unref (s_serial);
}
+static void
+test_setting_new_from_dbus_bad (void)
+{
+ NMSetting *setting;
+ NMConnection *conn;
+ GBytes *ssid;
+ GPtrArray *addrs;
+ GVariant *orig_dict, *dict;
+ GError *error = NULL;
+
+ /* We want to test:
+ * - ordinary scalar properties
+ * - string properties
+ * - GBytes-valued properties (which are handled specially by set_property_from_dbus())
+ * - enum/flags-valued properties
+ * - overridden properties
+ * - transformed properties
+ *
+ * No single setting class has examples of all of these, so we need two settings.
+ */
+
+ conn = nm_simple_connection_new ();
+
+ setting = nm_setting_connection_new ();
+ g_object_set (setting,
+ NM_SETTING_CONNECTION_ID, "test",
+ NM_SETTING_CONNECTION_UUID, "83c5a841-1759-4cdb-bfce-8d4087956497",
+ NULL);
+ nm_connection_add_setting (conn, setting);
+
+ setting = nm_setting_wireless_new ();
+ ssid = g_bytes_new ("my-ssid", 7);
+ g_object_set (setting,
+ /* scalar */
+ NM_SETTING_WIRELESS_RATE, 100,
+ /* string */
+ NM_SETTING_WIRELESS_MODE, NM_SETTING_WIRELESS_MODE_INFRA,
+ /* GBytes */
+ NM_SETTING_WIRELESS_SSID, ssid,
+ /* transformed */
+ NM_SETTING_WIRELESS_BSSID, "00:11:22:33:44:55",
+ NULL);
+ g_bytes_unref (ssid);
+ nm_connection_add_setting (conn, setting);
+
+ setting = nm_setting_ip6_config_new ();
+ addrs = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_address_unref);
+ g_ptr_array_add (addrs, nm_ip_address_new (AF_INET6, "1234::5678", 64, NULL));
+ g_object_set (setting,
+ /* enum */
+ NM_SETTING_IP6_CONFIG_IP6_PRIVACY, NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR,
+ /* overridden */
+ NM_SETTING_IP_CONFIG_ADDRESSES, addrs,
+ /* (needed in order to verify()) */
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NULL);
+ g_ptr_array_unref (addrs);
+ nm_connection_add_setting (conn, setting);
+
+ orig_dict = nm_connection_to_dbus (conn, NM_CONNECTION_SERIALIZE_ALL);
+ g_object_unref (conn);
+
+ /* sanity-check */
+ conn = nm_simple_connection_new_from_dbus (orig_dict, &error);
+ g_assert_no_error (error);
+ g_assert (conn);
+ g_object_unref (conn);
+
+ /* Compatible mismatches */
+
+ dict = g_variant_ref (orig_dict);
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_RATE,
+ "i", 10);
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert (conn);
+ g_assert_no_error (error);
+ setting = nm_connection_get_setting (conn, NM_TYPE_SETTING_WIRELESS);
+ g_assert (setting);
+ g_assert_cmpint (nm_setting_wireless_get_rate (NM_SETTING_WIRELESS (setting)), ==, 10);
+ g_object_unref (conn);
+ g_variant_unref (dict);
+
+ dict = g_variant_ref (orig_dict);
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP6_CONFIG_IP6_PRIVACY,
+ "i", NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR);
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert (conn);
+ g_assert_no_error (error);
+ setting = nm_connection_get_setting (conn, NM_TYPE_SETTING_IP6_CONFIG);
+ g_assert (setting);
+ g_assert_cmpint (nm_setting_ip6_config_get_ip6_privacy (NM_SETTING_IP6_CONFIG (setting)), ==, NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR);
+ g_object_unref (conn);
+ g_variant_unref (dict);
+
+ /* Incompatible mismatches */
+
+ dict = g_variant_ref (orig_dict);
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_RATE,
+ "s", "ten");
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
+ g_assert (g_str_has_prefix (error->message, "802-11-wireless.rate:"));
+ g_clear_error (&error);
+ g_variant_unref (dict);
+
+ dict = g_variant_ref (orig_dict);
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_MODE,
+ "b", FALSE);
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
+ g_assert (g_str_has_prefix (error->message, "802-11-wireless.mode:"));
+ g_clear_error (&error);
+ g_variant_unref (dict);
+
+ dict = g_variant_ref (orig_dict);
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_SSID,
+ "s", "fred");
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
+ g_assert (g_str_has_prefix (error->message, "802-11-wireless.ssid:"));
+ g_clear_error (&error);
+ g_variant_unref (dict);
+
+ dict = g_variant_ref (orig_dict);
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_WIRELESS_SETTING_NAME,
+ NM_SETTING_WIRELESS_BSSID,
+ "i", 42);
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
+ g_assert (g_str_has_prefix (error->message, "802-11-wireless.bssid:"));
+ g_clear_error (&error);
+ g_variant_unref (dict);
+
+ dict = g_variant_ref (orig_dict);
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP6_CONFIG_IP6_PRIVACY,
+ "s", "private");
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
+ g_assert (g_str_has_prefix (error->message, "ipv6.ip6-privacy:"));
+ g_clear_error (&error);
+ g_variant_unref (dict);
+
+ dict = g_variant_ref (orig_dict);
+ NMTST_VARIANT_EDITOR (dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_ADDRESSES,
+ "s", "1234::5678");
+ );
+ conn = nm_simple_connection_new_from_dbus (dict, &error);
+ g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
+ g_assert (g_str_has_prefix (error->message, "ipv6.addresses:"));
+ g_clear_error (&error);
+ g_variant_unref (dict);
+
+ g_variant_unref (orig_dict);
+}
+
static NMConnection *
new_test_connection (void)
{
@@ -1005,8 +1347,8 @@ new_test_connection (void)
setting = nm_setting_ip4_config_new ();
g_object_set (G_OBJECT (setting),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
- NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, "eyeofthetiger",
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, "eyeofthetiger",
NULL);
nm_connection_add_setting (connection, setting);
@@ -1054,7 +1396,7 @@ new_connection_dict (char **out_uuid,
/* IP6 */
g_variant_builder_init (&setting_builder, NM_VARIANT_TYPE_SETTING);
g_variant_builder_add (&setting_builder, "{sv}",
- NM_SETTING_IP6_CONFIG_METHOD,
+ NM_SETTING_IP_CONFIG_METHOD,
g_variant_new_string (*out_expected_ip6_method));
g_variant_builder_add (&conn_builder, "{sa{sv}}",
NM_SETTING_IP6_CONFIG_SETTING_NAME,
@@ -1071,7 +1413,7 @@ test_connection_replace_settings (void)
GError *error = NULL;
gboolean success;
NMSettingConnection *s_con;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
char *uuid = NULL;
const char *expected_id = NULL, *expected_method = NULL;
@@ -1095,7 +1437,7 @@ test_connection_replace_settings (void)
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
- g_assert_cmpstr (nm_setting_ip6_config_get_method (s_ip6), ==, expected_method);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, expected_method);
g_free (uuid);
g_variant_unref (new_settings);
@@ -1210,6 +1552,7 @@ test_connection_replace_settings_bad (void)
connection = new_test_connection ();
success = nm_connection_replace_settings (connection, new_settings, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING);
+ g_clear_error (&error);
g_assert (!success);
g_assert (nm_connection_verify (connection, NULL));
@@ -1226,7 +1569,7 @@ test_connection_new_from_dbus (void)
GVariant *new_settings;
GError *error = NULL;
NMSettingConnection *s_con;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
char *uuid = NULL;
const char *expected_id = NULL, *expected_method = NULL;
@@ -1244,11 +1587,11 @@ test_connection_new_from_dbus (void)
g_assert_cmpstr (nm_setting_connection_get_uuid (s_con), ==, uuid);
g_assert (nm_connection_get_setting_wired (connection));
- g_assert (!nm_connection_get_setting_ip4_config (connection));
+ g_assert (nm_connection_get_setting_ip4_config (connection));
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
- g_assert_cmpstr (nm_setting_ip6_config_get_method (s_ip6), ==, expected_method);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, expected_method);
g_free (uuid);
g_variant_unref (new_settings);
@@ -1639,19 +1982,20 @@ test_connection_diff_a_only (void)
{ NULL, NM_SETTING_DIFF_RESULT_UNKNOWN },
} },
{ NM_SETTING_IP4_CONFIG_SETTING_NAME, {
- { NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_DIFF_RESULT_IN_A },
- { NM_SETTING_IP4_CONFIG_DNS, NM_SETTING_DIFF_RESULT_IN_A },
- { NM_SETTING_IP4_CONFIG_DNS_SEARCH, NM_SETTING_DIFF_RESULT_IN_A },
- { NM_SETTING_IP4_CONFIG_ADDRESSES, NM_SETTING_DIFF_RESULT_IN_A },
- { "address-labels", NM_SETTING_DIFF_RESULT_IN_A },
- { NM_SETTING_IP4_CONFIG_ROUTES, NM_SETTING_DIFF_RESULT_IN_A },
- { 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_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 },
- { NM_SETTING_IP4_CONFIG_MAY_FAIL, NM_SETTING_DIFF_RESULT_IN_A },
+ { 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_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 },
+ { NM_SETTING_IP_CONFIG_ROUTE_METRIC, NM_SETTING_DIFF_RESULT_IN_A },
+ { 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_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_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 },
} },
};
@@ -1691,11 +2035,11 @@ test_connection_diff_different (void)
{
NMConnection *a, *b;
GHashTable *out_diffs = NULL;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
gboolean same;
const DiffSetting settings[] = {
{ NM_SETTING_IP4_CONFIG_SETTING_NAME, {
- { NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_DIFF_RESULT_IN_A | NM_SETTING_DIFF_RESULT_IN_B },
+ { NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_DIFF_RESULT_IN_A | NM_SETTING_DIFF_RESULT_IN_B },
{ NULL, NM_SETTING_DIFF_RESULT_UNKNOWN },
} },
};
@@ -1705,7 +2049,7 @@ test_connection_diff_different (void)
s_ip4 = nm_connection_get_setting_ip4_config (a);
g_assert (s_ip4);
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
NULL);
same = nm_connection_diff (a, b, NM_SETTING_COMPARE_FLAG_EXACT, &out_diffs);
@@ -1776,7 +2120,7 @@ test_connection_diff_inferrable (void)
gboolean same;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *uuid;
const DiffSetting settings[] = {
{ NM_SETTING_CONNECTION_SETTING_NAME, {
@@ -1804,7 +2148,7 @@ test_connection_diff_inferrable (void)
s_ip4 = nm_connection_get_setting_ip4_config (a);
g_assert (s_ip4);
- g_object_set (G_OBJECT (s_ip4), NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, TRUE, NULL);
+ g_object_set (G_OBJECT (s_ip4), NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, TRUE, NULL);
/* Make sure the diff returns no results as secrets are ignored */
same = nm_connection_diff (a, b, NM_SETTING_COMPARE_FLAG_INFERRABLE, &out_diffs);
@@ -1846,11 +2190,11 @@ add_generic_settings (NMConnection *connection, const char *ctype)
g_free (uuid);
setting = nm_setting_ip4_config_new ();
- g_object_set (setting, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (setting, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, setting);
setting = nm_setting_ip6_config_new ();
- g_object_set (setting, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (setting, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, setting);
}
@@ -2046,7 +2390,7 @@ test_connection_bad_base_types (void)
static void
test_setting_compare_id (void)
{
- NMSetting *old, *new;
+ gs_unref_object NMSetting *old = NULL, *new = NULL;
gboolean success;
old = nm_setting_connection_new ();
@@ -2067,6 +2411,31 @@ test_setting_compare_id (void)
g_assert (success);
}
+static void
+test_setting_compare_timestamp (void)
+{
+ gs_unref_object NMSetting *old = NULL, *new = NULL;
+ gboolean success;
+
+ old = nm_setting_connection_new ();
+ g_object_set (old,
+ NM_SETTING_CONNECTION_ID, "ignore timestamp connection",
+ NM_SETTING_CONNECTION_UUID, "b047a198-0e0a-4f0e-a653-eea09bb35e40",
+ NM_SETTING_CONNECTION_AUTOCONNECT, FALSE,
+ NM_SETTING_CONNECTION_TIMESTAMP, (guint64) 1234567890,
+ NULL);
+
+ new = nm_setting_duplicate (old);
+ g_object_set (new, NM_SETTING_CONNECTION_TIMESTAMP, (guint64) 1416316539, NULL);
+
+ /* First make sure they are different */
+ success = nm_setting_compare (old, new, NM_SETTING_COMPARE_FLAG_EXACT);
+ g_assert (success == FALSE);
+
+ success = nm_setting_compare (old, new, NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP);
+ g_assert (success);
+}
+
typedef struct {
NMSettingSecretFlags secret_flags;
NMSettingCompareFlags comp_flags;
@@ -2090,7 +2459,7 @@ static void
test_setting_compare_secrets (gconstpointer test_data)
{
const TestDataCompareSecrets *data = test_data;
- NMSetting *old, *new;
+ gs_unref_object NMSetting *old = NULL, *new = NULL;
gboolean success;
/* Make sure that a connection with transient/unsaved secrets compares
@@ -2121,7 +2490,7 @@ static void
test_setting_compare_vpn_secrets (gconstpointer test_data)
{
const TestDataCompareSecrets *data = test_data;
- NMSetting *old, *new;
+ gs_unref_object NMSetting *old = NULL, *new = NULL;
gboolean success;
/* Make sure that a connection with transient/unsaved secrets compares
@@ -2397,7 +2766,7 @@ test_setting_connection_changed_signal (void)
NMConnection *connection;
gboolean changed = FALSE;
NMSettingConnection *s_con;
- char *uuid;
+ gs_free char *uuid = NULL;
connection = nm_simple_connection_new ();
g_signal_connect (connection,
@@ -2456,9 +2825,10 @@ test_setting_ip4_changed_signal (void)
{
NMConnection *connection;
gboolean changed = FALSE;
- NMSettingIP4Config *s_ip4;
- NMIP4Address *addr;
- NMIP4Route *route;
+ NMSettingIPConfig *s_ip4;
+ NMIPAddress *addr;
+ NMIPRoute *route;
+ GError *error = NULL;
connection = nm_simple_connection_new ();
g_signal_connect (connection,
@@ -2466,58 +2836,56 @@ test_setting_ip4_changed_signal (void)
(GCallback) test_connection_changed_cb,
&changed);
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- ASSERT_CHANGED (nm_setting_ip4_config_add_dns (s_ip4, "11.22.0.0"));
- ASSERT_CHANGED (nm_setting_ip4_config_remove_dns (s_ip4, 0));
+ 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, "*elt != NULL*");
- ASSERT_UNCHANGED (nm_setting_ip4_config_remove_dns (s_ip4, 1));
+ g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->dns->len*");
+ ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns (s_ip4, 1));
g_test_assert_expected_messages ();
- nm_setting_ip4_config_add_dns (s_ip4, "33.44.0.0");
- ASSERT_CHANGED (nm_setting_ip4_config_clear_dns (s_ip4));
+ nm_setting_ip_config_add_dns (s_ip4, "33.44.0.0");
+ ASSERT_CHANGED (nm_setting_ip_config_clear_dns (s_ip4));
- ASSERT_CHANGED (nm_setting_ip4_config_add_dns_search (s_ip4, "foobar.com"));
- ASSERT_CHANGED (nm_setting_ip4_config_remove_dns_search (s_ip4, 0));
+ 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, "*elt != NULL*");
- ASSERT_UNCHANGED (nm_setting_ip4_config_remove_dns_search (s_ip4, 1));
+ g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->dns_search->len*");
+ ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns_search (s_ip4, 1));
g_test_assert_expected_messages ();
- ASSERT_CHANGED (nm_setting_ip4_config_add_dns_search (s_ip4, "foobar.com"));
- ASSERT_CHANGED (nm_setting_ip4_config_clear_dns_searches (s_ip4));
+ ASSERT_CHANGED (nm_setting_ip_config_add_dns_search (s_ip4, "foobar.com"));
+ ASSERT_CHANGED (nm_setting_ip_config_clear_dns_searches (s_ip4));
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, 0x2233);
- nm_ip4_address_set_prefix (addr, 24);
- ASSERT_CHANGED (nm_setting_ip4_config_add_address (s_ip4, addr));
- ASSERT_CHANGED (nm_setting_ip4_config_remove_address (s_ip4, 0));
+ addr = nm_ip_address_new (AF_INET, "22.33.0.0", 24, &error);
+ g_assert_no_error (error);
+ 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, "*addr != NULL && label != NULL*");
- ASSERT_UNCHANGED (nm_setting_ip4_config_remove_address (s_ip4, 1));
+ g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->addresses->len*");
+ ASSERT_UNCHANGED (nm_setting_ip_config_remove_address (s_ip4, 1));
g_test_assert_expected_messages ();
- nm_setting_ip4_config_add_address (s_ip4, addr);
- ASSERT_CHANGED (nm_setting_ip4_config_clear_addresses (s_ip4));
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ ASSERT_CHANGED (nm_setting_ip_config_clear_addresses (s_ip4));
- route = nm_ip4_route_new ();
- nm_ip4_route_set_dest (route, 0x2233);
- nm_ip4_route_set_prefix (route, 24);
+ route = nm_ip_route_new (AF_INET, "22.33.0.0", 24, NULL, 0, &error);
+ g_assert_no_error (error);
- ASSERT_CHANGED (nm_setting_ip4_config_add_route (s_ip4, route));
- ASSERT_CHANGED (nm_setting_ip4_config_remove_route (s_ip4, 0));
+ 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, "*elt != NULL*");
- ASSERT_UNCHANGED (nm_setting_ip4_config_remove_route (s_ip4, 1));
+ g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->routes->len*");
+ ASSERT_UNCHANGED (nm_setting_ip_config_remove_route (s_ip4, 1));
g_test_assert_expected_messages ();
- nm_setting_ip4_config_add_route (s_ip4, route);
- ASSERT_CHANGED (nm_setting_ip4_config_clear_routes (s_ip4));
+ nm_setting_ip_config_add_route (s_ip4, route);
+ ASSERT_CHANGED (nm_setting_ip_config_clear_routes (s_ip4));
- nm_ip4_address_unref (addr);
- nm_ip4_route_unref (route);
+ nm_ip_address_unref (addr);
+ nm_ip_route_unref (route);
g_object_unref (connection);
}
@@ -2526,10 +2894,10 @@ test_setting_ip6_changed_signal (void)
{
NMConnection *connection;
gboolean changed = FALSE;
- NMSettingIP6Config *s_ip6;
- NMIP6Address *addr;
- NMIP6Route *route;
- const struct in6_addr t = { { { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 } } };
+ NMSettingIPConfig *s_ip6;
+ NMIPAddress *addr;
+ NMIPRoute *route;
+ GError *error = NULL;
connection = nm_simple_connection_new ();
g_signal_connect (connection,
@@ -2537,59 +2905,57 @@ test_setting_ip6_changed_signal (void)
(GCallback) test_connection_changed_cb,
&changed);
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
- ASSERT_CHANGED (nm_setting_ip6_config_add_dns (s_ip6, "1:2:3::4:5:6"));
- ASSERT_CHANGED (nm_setting_ip6_config_remove_dns (s_ip6, 0));
+ 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, "*elt != NULL*");
- ASSERT_UNCHANGED (nm_setting_ip6_config_remove_dns (s_ip6, 1));
+ g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->dns->len*");
+ ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns (s_ip6, 1));
g_test_assert_expected_messages ();
- nm_setting_ip6_config_add_dns (s_ip6, "1:2:3::4:5:6");
- ASSERT_CHANGED (nm_setting_ip6_config_clear_dns (s_ip6));
+ nm_setting_ip_config_add_dns (s_ip6, "1:2:3::4:5:6");
+ ASSERT_CHANGED (nm_setting_ip_config_clear_dns (s_ip6));
- ASSERT_CHANGED (nm_setting_ip6_config_add_dns_search (s_ip6, "foobar.com"));
- ASSERT_CHANGED (nm_setting_ip6_config_remove_dns_search (s_ip6, 0));
+ 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, "*elt != NULL*");
- ASSERT_UNCHANGED (nm_setting_ip6_config_remove_dns_search (s_ip6, 1));
+ g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->dns_search->len*");
+ ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns_search (s_ip6, 1));
g_test_assert_expected_messages ();
- nm_setting_ip6_config_add_dns_search (s_ip6, "foobar.com");
- ASSERT_CHANGED (nm_setting_ip6_config_clear_dns_searches (s_ip6));
+ nm_setting_ip_config_add_dns_search (s_ip6, "foobar.com");
+ ASSERT_CHANGED (nm_setting_ip_config_clear_dns_searches (s_ip6));
- addr = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr, &t);
- nm_ip6_address_set_prefix (addr, 64);
+ addr = nm_ip_address_new (AF_INET6, "1:2:3::4:5:6", 64, &error);
+ g_assert_no_error (error);
- ASSERT_CHANGED (nm_setting_ip6_config_add_address (s_ip6, addr));
- ASSERT_CHANGED (nm_setting_ip6_config_remove_address (s_ip6, 0));
+ 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, "*elt != NULL*");
- ASSERT_UNCHANGED (nm_setting_ip6_config_remove_address (s_ip6, 1));
+ g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->addresses->len*");
+ ASSERT_UNCHANGED (nm_setting_ip_config_remove_address (s_ip6, 1));
g_test_assert_expected_messages ();
- nm_setting_ip6_config_add_address (s_ip6, addr);
- ASSERT_CHANGED (nm_setting_ip6_config_clear_addresses (s_ip6));
+ nm_setting_ip_config_add_address (s_ip6, addr);
+ ASSERT_CHANGED (nm_setting_ip_config_clear_addresses (s_ip6));
- route = nm_ip6_route_new ();
- nm_ip6_route_set_dest (route, &t);
- nm_ip6_route_set_prefix (route, 128);
+ route = nm_ip_route_new (AF_INET6, "1:2:3::4:5:6", 128, NULL, 0, &error);
+ g_assert_no_error (error);
- ASSERT_CHANGED (nm_setting_ip6_config_add_route (s_ip6, route));
- ASSERT_CHANGED (nm_setting_ip6_config_remove_route (s_ip6, 0));
+ 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, "*elt != NULL*");
- ASSERT_UNCHANGED (nm_setting_ip6_config_remove_route (s_ip6, 1));
+ g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->routes->len*");
+ ASSERT_UNCHANGED (nm_setting_ip_config_remove_route (s_ip6, 1));
g_test_assert_expected_messages ();
- nm_setting_ip6_config_add_route (s_ip6, route);
- ASSERT_CHANGED (nm_setting_ip6_config_clear_routes (s_ip6));
+ nm_setting_ip_config_add_route (s_ip6, route);
+ ASSERT_CHANGED (nm_setting_ip_config_clear_routes (s_ip6));
- nm_ip6_address_unref (addr);
- nm_ip6_route_unref (route);
+ nm_ip_address_unref (addr);
+ nm_ip_route_unref (route);
g_object_unref (connection);
}
@@ -2806,9 +3172,7 @@ test_setting_802_1x_changed_signal (void)
static void
test_setting_old_uuid (void)
{
- GError *error = NULL;
- NMSetting *setting;
- gboolean success;
+ gs_unref_object NMSetting *setting = NULL;
/* NetworkManager-0.9.4.0 generated 40-character UUIDs with no dashes,
* like this one. Test that we maintain compatibility. */
@@ -2821,11 +3185,28 @@ test_setting_old_uuid (void)
NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME,
NULL);
- success = nm_setting_verify (NM_SETTING (setting), NULL, &error);
- g_assert_no_error (error);
- g_assert (success == TRUE);
+ nmtst_assert_setting_verifies (NM_SETTING (setting));
}
+/******************************************************************************/
+
+static void
+test_connection_normalize_uuid (void)
+{
+ gs_unref_object NMConnection *con = NULL;
+
+ con = nmtst_create_minimal_connection ("test1", NULL, NM_SETTING_WIRED_SETTING_NAME, NULL);
+
+ nmtst_assert_connection_verifies_and_normalizable (con);
+
+ g_object_set (nm_connection_get_setting_connection (con),
+ NM_SETTING_CONNECTION_UUID, NULL,
+ NULL);
+ nmtst_assert_connection_verifies_after_normalization (con, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_PROPERTY);
+}
+
+/******************************************************************************/
+
/*
* Test normalization of interface-name
*/
@@ -2847,12 +3228,12 @@ test_connection_normalize_virtual_iface_name (void)
nm_connection_add_setting (con,
g_object_new (NM_TYPE_SETTING_IP4_CONFIG,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL));
nm_connection_add_setting (con,
g_object_new (NM_TYPE_SETTING_IP6_CONFIG,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL));
s_vlan = nm_connection_get_setting_vlan (con);
@@ -3349,6 +3730,494 @@ test_connection_normalize_infiniband_mtu (void)
g_assert_cmpint (65520, ==, nm_setting_infiniband_get_mtu (s_infini));
}
+static void
+test_setting_ip4_gateway (void)
+{
+ NMConnection *conn;
+ NMSettingIPConfig *s_ip4;
+ NMIPAddress *addr;
+ GVariant *conn_dict, *ip4_dict, *value;
+ GVariantIter iter;
+ GVariant *addr_var;
+ guint32 addr_vals_0[] = { htonl (0xc0a8010a), 0x00000018, htonl (0x00000000) };
+ guint32 addr_vals_1[] = { htonl (0xc0a8010b), 0x00000018, htonl (0xc0a80101) };
+ GVariantBuilder addrs_builder;
+ GError *error = NULL;
+
+ g_assert_cmpstr (nm_utils_inet4_ntop (addr_vals_0[0], NULL), ==, "192.168.1.10");
+
+ /* When serializing on the daemon side, ipv4.gateway is copied to the first
+ * entry of ipv4.addresses
+ */
+ conn = nmtst_create_minimal_connection ("test_setting_ip4_gateway", NULL,
+ NM_SETTING_WIRED_SETTING_NAME, NULL);
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
+ g_object_set (s_ip4,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "192.168.1.1",
+ NULL);
+ nm_connection_add_setting (conn, NM_SETTING (s_ip4));
+
+ addr = nm_ip_address_new (AF_INET, "192.168.1.10", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
+
+ _nm_utils_is_manager_process = TRUE;
+ conn_dict = nm_connection_to_dbus (conn, NM_CONNECTION_SERIALIZE_ALL);
+ _nm_utils_is_manager_process = FALSE;
+ g_object_unref (conn);
+
+ ip4_dict = g_variant_lookup_value (conn_dict, NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_VARIANT_TYPE_SETTING);
+ g_assert (ip4_dict != NULL);
+
+ value = g_variant_lookup_value (ip4_dict, NM_SETTING_IP_CONFIG_GATEWAY, G_VARIANT_TYPE_STRING);
+ g_assert (value != NULL);
+ g_assert_cmpstr (g_variant_get_string (value, NULL), ==, "192.168.1.1");
+ g_variant_unref (value);
+
+ value = g_variant_lookup_value (ip4_dict, NM_SETTING_IP_CONFIG_ADDRESSES, G_VARIANT_TYPE ("aau"));
+ g_assert (value != NULL);
+
+ g_variant_iter_init (&iter, value);
+ while (g_variant_iter_next (&iter, "@au", &addr_var)) {
+ const guint32 *addr_array;
+ gsize length;
+
+ addr_array = g_variant_get_fixed_array (addr_var, &length, sizeof (guint32));
+ g_assert_cmpint (length, ==, 3);
+ g_assert_cmpstr (nm_utils_inet4_ntop (addr_array[2], NULL), ==, "192.168.1.1");
+ g_variant_unref (addr_var);
+ }
+ g_variant_unref (value);
+
+ g_variant_unref (ip4_dict);
+
+ /* When deserializing an old-style connection, the first non-0 gateway in
+ * ipv4.addresses is copied to :gateway.
+ */
+ NMTST_VARIANT_EDITOR (conn_dict,
+ NMTST_VARIANT_DROP_PROPERTY (NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_GATEWAY);
+ NMTST_VARIANT_DROP_PROPERTY (NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ "address-data");
+ );
+
+ conn = nm_simple_connection_new_from_dbus (conn_dict, &error);
+ g_assert_no_error (error);
+
+ s_ip4 = (NMSettingIPConfig *) nm_connection_get_setting_ip4_config (conn);
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.1.1");
+
+ g_object_unref (conn);
+
+ /* Try again with the gateway in the second address. */
+ g_variant_builder_init (&addrs_builder, G_VARIANT_TYPE ("aau"));
+ g_variant_builder_add (&addrs_builder, "@au",
+ g_variant_new_fixed_array (G_VARIANT_TYPE_UINT32,
+ addr_vals_0, 3, 4));
+ g_variant_builder_add (&addrs_builder, "@au",
+ g_variant_new_fixed_array (G_VARIANT_TYPE_UINT32,
+ addr_vals_1, 3, 4));
+
+ NMTST_VARIANT_EDITOR (conn_dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ "addresses", "aau", &addrs_builder);
+ );
+
+ conn = nm_simple_connection_new_from_dbus (conn_dict, &error);
+ g_assert_no_error (error);
+ g_variant_unref (conn_dict);
+
+ s_ip4 = (NMSettingIPConfig *) nm_connection_get_setting_ip4_config (conn);
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.1.1");
+
+ g_object_unref (conn);
+}
+
+static void
+test_setting_ip6_gateway (void)
+{
+ NMConnection *conn;
+ NMSettingIPConfig *s_ip6;
+ NMIPAddress *addr;
+ GVariant *conn_dict, *ip6_dict, *value;
+ GVariantIter iter;
+ GVariant *gateway_var;
+ GVariantBuilder addrs_builder;
+ guint8 addr_bytes_0[] = { 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a };
+ guint8 addr_bytes_1[] = { 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b };
+ guint8 gateway_bytes_1[] = { 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
+ GError *error = NULL;
+
+ /* When serializing on the daemon side, ipv6.gateway is copied to the first
+ * entry of ipv6.addresses
+ */
+ conn = nmtst_create_minimal_connection ("test_setting_ip6_gateway", NULL,
+ NM_SETTING_WIRED_SETTING_NAME, NULL);
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
+ g_object_set (s_ip6,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "abcd::1",
+ NULL);
+ nm_connection_add_setting (conn, NM_SETTING (s_ip6));
+
+ addr = nm_ip_address_new (AF_INET6, "abcd::10", 64, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip6, addr);
+ nm_ip_address_unref (addr);
+
+ _nm_utils_is_manager_process = TRUE;
+ conn_dict = nm_connection_to_dbus (conn, NM_CONNECTION_SERIALIZE_ALL);
+ _nm_utils_is_manager_process = FALSE;
+ g_object_unref (conn);
+
+ ip6_dict = g_variant_lookup_value (conn_dict, NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_VARIANT_TYPE_SETTING);
+ g_assert (ip6_dict != NULL);
+
+ value = g_variant_lookup_value (ip6_dict, NM_SETTING_IP_CONFIG_GATEWAY, G_VARIANT_TYPE_STRING);
+ g_assert (value != NULL);
+ g_assert_cmpstr (g_variant_get_string (value, NULL), ==, "abcd::1");
+ g_variant_unref (value);
+
+ value = g_variant_lookup_value (ip6_dict, NM_SETTING_IP_CONFIG_ADDRESSES, G_VARIANT_TYPE ("a(ayuay)"));
+ g_assert (value != NULL);
+
+ g_variant_iter_init (&iter, value);
+ while (g_variant_iter_next (&iter, "(@ayu@ay)", NULL, NULL, &gateway_var)) {
+ const guint8 *gateway_bytes;
+ gsize length;
+
+ gateway_bytes = g_variant_get_fixed_array (gateway_var, &length, 1);
+ g_assert_cmpint (length, ==, 16);
+ g_assert_cmpstr (nm_utils_inet6_ntop ((struct in6_addr *) gateway_bytes, NULL), ==, "abcd::1");
+ g_variant_unref (gateway_var);
+ }
+ g_variant_unref (value);
+
+ g_variant_unref (ip6_dict);
+
+ /* When deserializing an old-style connection, the first non-0 gateway in
+ * ipv6.addresses is copied to :gateway.
+ */
+ NMTST_VARIANT_EDITOR (conn_dict,
+ NMTST_VARIANT_DROP_PROPERTY (NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_GATEWAY);
+ NMTST_VARIANT_DROP_PROPERTY (NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ "address-data");
+ );
+
+ conn = nm_simple_connection_new_from_dbus (conn_dict, &error);
+ g_assert_no_error (error);
+
+ s_ip6 = (NMSettingIPConfig *) nm_connection_get_setting_ip6_config (conn);
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip6), ==, "abcd::1");
+
+ g_object_unref (conn);
+
+ /* Try again with the gateway in the second address. */
+ g_variant_builder_init (&addrs_builder, G_VARIANT_TYPE ("a(ayuay)"));
+ g_variant_builder_add (&addrs_builder, "(@ayu@ay)",
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ addr_bytes_0, 16, 1),
+ 64,
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ &in6addr_any, 16, 1));
+ g_variant_builder_add (&addrs_builder, "(@ayu@ay)",
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ addr_bytes_1, 16, 1),
+ 64,
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ gateway_bytes_1, 16, 1));
+
+ NMTST_VARIANT_EDITOR (conn_dict,
+ NMTST_VARIANT_CHANGE_PROPERTY (NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ "addresses", "a(ayuay)", &addrs_builder);
+ );
+
+ conn = nm_simple_connection_new_from_dbus (conn_dict, &error);
+ g_assert_no_error (error);
+ g_variant_unref (conn_dict);
+
+ s_ip6 = (NMSettingIPConfig *) nm_connection_get_setting_ip6_config (conn);
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip6), ==, "abcd::1");
+
+ g_object_unref (conn);
+}
+
+typedef struct {
+ const char *str;
+ const guint8 expected[20];
+ const guint expected_len;
+} HexItem;
+
+static void
+test_hexstr2bin (void)
+{
+ static const HexItem items[] = {
+ { "aaBBCCddDD10496a", { 0xaa, 0xbb, 0xcc, 0xdd, 0xdd, 0x10, 0x49, 0x6a }, 8 },
+ { "aa:bb:cc:dd:10:49:6a", { 0xaa, 0xbb, 0xcc, 0xdd, 0x10, 0x49, 0x6a }, 7 },
+ { "0xccddeeff", { 0xcc, 0xdd, 0xee, 0xff }, 4 },
+ { "1:2:66:77:80", { 0x01, 0x02, 0x66, 0x77, 0x80 }, 5 },
+ { "e", { 0x0e }, 1 },
+ { "aabb1199:" },
+ { ":aabb1199" },
+ { "aabb$$dd" },
+ { "aab:ccc:ddd" },
+ { "aab::ccc:ddd" },
+ };
+ GBytes *b;
+ guint i;
+
+ for (i = 0; i < G_N_ELEMENTS (items); i++) {
+ b = nm_utils_hexstr2bin (items[i].str);
+ if (items[i].expected_len) {
+ g_assert (b);
+ g_assert_cmpint (g_bytes_get_size (b), ==, items[i].expected_len);
+ g_assert (memcmp (g_bytes_get_data (b, NULL), items[i].expected, g_bytes_get_size (b)) == 0);
+ g_bytes_unref (b);
+ } else
+ g_assert (b == NULL);
+ }
+}
+
+/******************************************************************************/
+
+#define UUID_NIL "00000000-0000-0000-0000-000000000000"
+#define UUID_NS_DNS "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
+
+static void
+_test_uuid (int uuid_type, const char *expected_uuid, const char *str, gssize slen, gpointer type_args)
+{
+ gs_free char *uuid_test = NULL;
+
+ uuid_test = nm_utils_uuid_generate_from_string (str, slen, uuid_type, type_args);
+
+ g_assert (uuid_test);
+ g_assert (nm_utils_is_uuid (uuid_test));
+
+ if (strcmp (uuid_test, expected_uuid)) {
+ g_error ("UUID test failed: type=%d; text=%s, len=%lld, uuid=%s, expected=%s", uuid_type,
+ str, (long long) slen, uuid_test, expected_uuid);
+ }
+
+ if (slen < 0) {
+ /* also test that passing slen==-1 yields the same result as passing strlen(str). */
+ _test_uuid (uuid_type, expected_uuid, str, strlen (str), type_args);
+ } else if (str && slen == 0) {
+ /* also test if we accept NULL for slen==0 */
+ _test_uuid (uuid_type, expected_uuid, NULL, 0, type_args);
+ }
+
+ if (uuid_type == NM_UTILS_UUID_TYPE_VARIANT3 && !type_args) {
+ /* For NM_UTILS_UUID_TYPE_VARIANT3, a missing @type_args is equal to UUID_NIL */
+ _test_uuid (uuid_type, expected_uuid, str, slen, UUID_NIL);
+ }
+}
+
+static void
+test_nm_utils_uuid_generate_from_string (void)
+{
+ _test_uuid (NM_UTILS_UUID_TYPE_LEGACY, "d41d8cd9-8f00-b204-e980-0998ecf8427e", "", -1, NULL);
+ _test_uuid (NM_UTILS_UUID_TYPE_LEGACY, "0cc175b9-c0f1-b6a8-31c3-99e269772661", "a", -1, NULL);
+ _test_uuid (NM_UTILS_UUID_TYPE_LEGACY, "098f6bcd-4621-d373-cade-4e832627b4f6", "test", -1, NULL);
+ _test_uuid (NM_UTILS_UUID_TYPE_LEGACY, "70350f60-27bc-e371-3f6b-76473084309b", "a\0b", 3, NULL);
+ _test_uuid (NM_UTILS_UUID_TYPE_LEGACY, "59c0547b-7fe2-1c15-2cce-e328e8bf6742", "/etc/NetworkManager/system-connections/em1", -1, NULL);
+
+ _test_uuid (NM_UTILS_UUID_TYPE_VARIANT3, "4ae71336-e44b-39bf-b9d2-752e234818a5", "", -1, NULL);
+ _test_uuid (NM_UTILS_UUID_TYPE_VARIANT3, "0531103a-d8fc-3dd4-b972-d98e4750994e", "a", -1, NULL);
+ _test_uuid (NM_UTILS_UUID_TYPE_VARIANT3, "96e17d7a-ac89-38cf-95e1-bf5098da34e1", "test", -1, NULL);
+ _test_uuid (NM_UTILS_UUID_TYPE_VARIANT3, "8156568e-4ae6-3f34-a93e-18e2c6cbbf78", "a\0b", 3, NULL);
+
+ _test_uuid (NM_UTILS_UUID_TYPE_VARIANT3, "c87ee674-4ddc-3efe-a74e-dfe25da5d7b3", "", -1, UUID_NS_DNS);
+ _test_uuid (NM_UTILS_UUID_TYPE_VARIANT3, "4c104dd0-4821-30d5-9ce3-0e7a1f8b7c0d", "a", -1, UUID_NS_DNS);
+ _test_uuid (NM_UTILS_UUID_TYPE_VARIANT3, "45a113ac-c7f2-30b0-90a5-a399ab912716", "test", -1, UUID_NS_DNS);
+ _test_uuid (NM_UTILS_UUID_TYPE_VARIANT3, "002a0ada-f547-375a-bab5-896a11d1927e", "a\0b", 3, UUID_NS_DNS);
+}
+
+/*******************************************/
+
+static void
+__test_uuid (const char *expected_uuid, const char *str, gssize slen, char *uuid_test)
+{
+ g_assert (uuid_test);
+ g_assert (nm_utils_is_uuid (uuid_test));
+
+ if (strcmp (uuid_test, expected_uuid)) {
+ g_error ("UUID test failed (1): text=%s, len=%lld, expected=%s, uuid_test=%s",
+ str, (long long) slen, expected_uuid, uuid_test);
+ }
+ g_free (uuid_test);
+
+ uuid_test = nm_utils_uuid_generate_from_string (str, slen, NM_UTILS_UUID_TYPE_VARIANT3, NM_UTILS_UUID_NS);
+
+ g_assert (uuid_test);
+ g_assert (nm_utils_is_uuid (uuid_test));
+
+ if (strcmp (uuid_test, expected_uuid)) {
+ g_error ("UUID test failed (2): text=%s; len=%lld, expected=%s, uuid2=%s",
+ str, (long long) slen, expected_uuid, uuid_test);
+ }
+ g_free (uuid_test);
+}
+
+#define _test_uuid(expected_uuid, str, strlen, ...) __test_uuid (expected_uuid, str, strlen, _nm_utils_uuid_generate_from_strings(__VA_ARGS__, NULL))
+
+static void
+test_nm_utils_uuid_generate_from_strings (void)
+{
+ _test_uuid ("b07c334a-399b-32de-8d50-58e4e08f98e3", "", 0, NULL);
+ _test_uuid ("b8a426cb-bcb5-30a3-bd8f-6786fea72df9", "\0", 1, "");
+ _test_uuid ("12a4a982-7aae-39e1-951e-41aeb1250959", "a\0", 2, "a");
+ _test_uuid ("69e22c7e-f89f-3a43-b239-1cb52ed8db69", "aa\0", 3, "aa");
+ _test_uuid ("59829fd3-5ad5-3d90-a7b0-4911747e4088", "\0\0", 2, "", "");
+ _test_uuid ("01ad0e06-6c50-3384-8d86-ddab81421425", "a\0\0", 3, "a", "");
+ _test_uuid ("e1ed8647-9ed3-3ec8-8c6d-e8204524d71d", "aa\0\0", 4, "aa", "");
+ _test_uuid ("fb1c7cd6-275c-3489-9382-83b900da8af0", "\0a\0", 3, "", "a");
+ _test_uuid ("5d79494e-c4ba-31a6-80a2-d6016ccd7e17", "a\0a\0", 4, "a", "a");
+ _test_uuid ("fd698d86-1b60-3ebe-855f-7aada9950a8d", "aa\0a\0", 5, "aa", "a");
+ _test_uuid ("8c573b48-0f01-30ba-bb94-c5f59f4fe517", "\0aa\0", 4, "", "aa");
+ _test_uuid ("2bdd3d46-eb83-3c53-a41b-a724d04b5544", "a\0aa\0", 5, "a", "aa");
+ _test_uuid ("13d4b780-07c1-3ba7-b449-81c4844ef039", "aa\0aa\0", 6, "aa", "aa");
+ _test_uuid ("dd265bf7-c05a-3037-9939-b9629858a477", "a\0b\0", 4, "a", "b");
+}
+
+/******************************************************************************/
+
+static void
+test_nm_utils_ascii_str_to_int64_check (const char *str, guint base, gint64 min,
+ gint64 max, gint64 fallback, int exp_errno,
+ gint64 exp_val)
+{
+ gint64 v;
+
+ errno = 1;
+ v = _nm_utils_ascii_str_to_int64 (str, base, min, max, fallback);
+ g_assert_cmpint (errno, ==, exp_errno);
+ g_assert_cmpint (v, ==, exp_val);
+}
+
+static void
+test_nm_utils_ascii_str_to_int64_do (const char *str, guint base, gint64 min,
+ gint64 max, gint64 fallback, int exp_errno,
+ gint64 exp_val)
+{
+ const char *sign = "";
+ const char *val;
+ static const char *whitespaces[] = {
+ "",
+ " ",
+ "\r\n\t",
+ " \r\n\t ",
+ " \r\n\t \t\r\n\t",
+ NULL,
+ };
+ static const char *nulls[] = {
+ "",
+ "0",
+ "00",
+ "0000",
+ "0000000000000000",
+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ NULL,
+ };
+ const char **ws_pre, **ws_post, **null;
+ guint i;
+
+ if (str == NULL || exp_errno != 0) {
+ test_nm_utils_ascii_str_to_int64_check (str, base, min, max, fallback, exp_errno, exp_val);
+ return;
+ }
+
+ if (strncmp (str, "-", 1) == 0)
+ sign = "-";
+
+ val = str + strlen (sign);
+
+ for (ws_pre = whitespaces; *ws_pre; ws_pre++) {
+ for (ws_post = whitespaces; *ws_post; ws_post++) {
+ for (null = nulls; *null; null++) {
+ for (i = 0; ; i++) {
+ char *s;
+ const char *str_base = "";
+
+ if (base == 16) {
+ if (i == 1)
+ str_base = "0x";
+ else if (i > 1)
+ break;
+ } else if (base == 8) {
+ if (i == 1)
+ str_base = "0";
+ else if (i > 1)
+ break;
+ } else if (base == 0) {
+ if (i > 0)
+ break;
+ /* with base==0, a leading zero would be interpreted as octal. Only test without *null */
+ if ((*null)[0])
+ break;
+ } else {
+ if (i > 0)
+ break;
+ }
+
+ s = g_strdup_printf ("%s%s%s%s%s%s", *ws_pre, sign, str_base, *null, val, *ws_post);
+
+ test_nm_utils_ascii_str_to_int64_check (s, base, min, max, fallback, exp_errno, exp_val);
+ g_free (s);
+ }
+ }
+ }
+ }
+}
+
+static void
+test_nm_utils_ascii_str_to_int64 (void)
+{
+ test_nm_utils_ascii_str_to_int64_do (NULL, 10, 0, 10000, -1, EINVAL, -1);
+ test_nm_utils_ascii_str_to_int64_do ("", 10, 0, 10000, -1, EINVAL, -1);
+ test_nm_utils_ascii_str_to_int64_do ("1x", 10, 0, 10000, -1, EINVAL, -1);
+ test_nm_utils_ascii_str_to_int64_do ("4711", 10, 0, 10000, -1, 0, 4711);
+ test_nm_utils_ascii_str_to_int64_do ("10000", 10, 0, 10000, -1, 0, 10000);
+ test_nm_utils_ascii_str_to_int64_do ("10001", 10, 0, 10000, -1, ERANGE, -1);
+ test_nm_utils_ascii_str_to_int64_do ("FF", 16, 0, 10000, -1, 0, 255);
+ test_nm_utils_ascii_str_to_int64_do ("FF", 10, 0, 10000, -2, EINVAL, -2);
+ test_nm_utils_ascii_str_to_int64_do ("9223372036854775807", 10, 0, G_MAXINT64, -2, 0, G_MAXINT64);
+ test_nm_utils_ascii_str_to_int64_do ("7FFFFFFFFFFFFFFF", 16, 0, G_MAXINT64, -2, 0, G_MAXINT64);
+ test_nm_utils_ascii_str_to_int64_do ("9223372036854775808", 10, 0, G_MAXINT64, -2, ERANGE, -2);
+ test_nm_utils_ascii_str_to_int64_do ("-9223372036854775808", 10, G_MININT64, 0, -2, 0, G_MININT64);
+ test_nm_utils_ascii_str_to_int64_do ("-9223372036854775808", 10, G_MININT64+1, 0, -2, ERANGE, -2);
+ test_nm_utils_ascii_str_to_int64_do ("-9223372036854775809", 10, G_MININT64, 0, -2, ERANGE, -2);
+ test_nm_utils_ascii_str_to_int64_do ("1.0", 10, 1, 1, -1, EINVAL, -1);
+ test_nm_utils_ascii_str_to_int64_do ("1x0", 16, -10, 10, -100, EINVAL, -100);
+ test_nm_utils_ascii_str_to_int64_do ("0", 16, -10, 10, -100, 0, 0);
+ test_nm_utils_ascii_str_to_int64_do ("10001111", 2, -1000, 1000, -100000, 0, 0x8F);
+ test_nm_utils_ascii_str_to_int64_do ("-10001111", 2, -1000, 1000, -100000, 0, -0x8F);
+ test_nm_utils_ascii_str_to_int64_do ("1111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7F);
+ test_nm_utils_ascii_str_to_int64_do ("111111111111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7FFF);
+ test_nm_utils_ascii_str_to_int64_do ("11111111111111111111111111111111111111111111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7FFFFFFFFFFF);
+ test_nm_utils_ascii_str_to_int64_do ("111111111111111111111111111111111111111111111111111111111111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7FFFFFFFFFFFFFFF);
+ test_nm_utils_ascii_str_to_int64_do ("100000000000000000000000000000000000000000000000000000000000000", 2, G_MININT64, G_MAXINT64, -1, 0, 0x4000000000000000);
+ test_nm_utils_ascii_str_to_int64_do ("1000000000000000000000000000000000000000000000000000000000000000", 2, G_MININT64, G_MAXINT64, -1, ERANGE, -1);
+ test_nm_utils_ascii_str_to_int64_do ("-100000000000000000000000000000000000000000000000000000000000000", 2, G_MININT64, G_MAXINT64, -1, 0, -0x4000000000000000);
+ test_nm_utils_ascii_str_to_int64_do ("111111111111111111111111111111111111111111111111111111111111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7FFFFFFFFFFFFFFF);
+ test_nm_utils_ascii_str_to_int64_do ("-100000000000000000000000000000000000000000000000000000000000000", 2, G_MININT64, G_MAXINT64, -1, 0, -0x4000000000000000);
+ test_nm_utils_ascii_str_to_int64_do ("0x70", 10, G_MININT64, G_MAXINT64, -1, EINVAL, -1);
+ test_nm_utils_ascii_str_to_int64_do ("4711", 0, G_MININT64, G_MAXINT64, -1, 0, 4711);
+ test_nm_utils_ascii_str_to_int64_do ("04711", 0, G_MININT64, G_MAXINT64, -1, 0, 04711);
+ test_nm_utils_ascii_str_to_int64_do ("0x4711", 0, G_MININT64, G_MAXINT64, -1, 0, 0x4711);
+ test_nm_utils_ascii_str_to_int64_do ("080", 0, G_MININT64, G_MAXINT64, -1, EINVAL, -1);
+ test_nm_utils_ascii_str_to_int64_do ("070", 0, G_MININT64, G_MAXINT64, -1, 0, 7*8);
+ test_nm_utils_ascii_str_to_int64_do ("0x70", 0, G_MININT64, G_MAXINT64, -1, 0, 0x70);
+}
+
+/******************************************************************************/
+
NMTST_DEFINE ();
int main (int argc, char **argv)
@@ -3360,6 +4229,7 @@ int main (int argc, char **argv)
g_test_add_func ("/core/general/test_setting_vpn_update_secrets", test_setting_vpn_update_secrets);
g_test_add_func ("/core/general/test_setting_vpn_modify_during_foreach", test_setting_vpn_modify_during_foreach);
g_test_add_func ("/core/general/test_setting_ip4_config_labels", test_setting_ip4_config_labels);
+ g_test_add_func ("/core/general/test_setting_ip4_config_address_data", test_setting_ip4_config_address_data);
g_test_add_func ("/core/general/test_setting_gsm_apn_spaces", test_setting_gsm_apn_spaces);
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);
@@ -3370,6 +4240,7 @@ int main (int argc, char **argv)
g_test_add_func ("/core/general/test_setting_to_dbus_transform", test_setting_to_dbus_transform);
g_test_add_func ("/core/general/test_setting_to_dbus_enum", test_setting_to_dbus_enum);
g_test_add_func ("/core/general/test_setting_compare_id", test_setting_compare_id);
+ g_test_add_func ("/core/general/test_setting_compare_timestamp", test_setting_compare_timestamp);
#define ADD_FUNC(func, secret_flags, comp_flags, remove_secret) \
g_test_add_data_func_full ("/core/general/" G_STRINGIFY (func), \
test_data_compare_secrets_new (secret_flags, comp_flags, remove_secret), \
@@ -3389,11 +4260,13 @@ int main (int argc, char **argv)
g_test_add_func ("/core/general/test_setting_new_from_dbus", test_setting_new_from_dbus);
g_test_add_func ("/core/general/test_setting_new_from_dbus_transform", test_setting_new_from_dbus_transform);
g_test_add_func ("/core/general/test_setting_new_from_dbus_enum", test_setting_new_from_dbus_enum);
+ g_test_add_func ("/core/general/test_setting_new_from_dbus_bad", test_setting_new_from_dbus_bad);
g_test_add_func ("/core/general/test_connection_replace_settings", test_connection_replace_settings);
g_test_add_func ("/core/general/test_connection_replace_settings_from_connection", test_connection_replace_settings_from_connection);
g_test_add_func ("/core/general/test_connection_replace_settings_bad", test_connection_replace_settings_bad);
g_test_add_func ("/core/general/test_connection_new_from_dbus", test_connection_new_from_dbus);
g_test_add_func ("/core/general/test_connection_normalize_virtual_iface_name", test_connection_normalize_virtual_iface_name);
+ g_test_add_func ("/core/general/test_connection_normalize_uuid", test_connection_normalize_uuid);
g_test_add_func ("/core/general/test_connection_normalize_type", test_connection_normalize_type);
g_test_add_func ("/core/general/test_connection_normalize_slave_type_1", test_connection_normalize_slave_type_1);
g_test_add_func ("/core/general/test_connection_normalize_slave_type_2", test_connection_normalize_slave_type_2);
@@ -3437,6 +4310,14 @@ int main (int argc, char **argv)
g_test_add_func ("/core/general/test_setting_wireless_changed_signal", test_setting_wireless_changed_signal);
g_test_add_func ("/core/general/test_setting_wireless_security_changed_signal", test_setting_wireless_security_changed_signal);
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/hexstr2bin", test_hexstr2bin);
+ g_test_add_func ("/core/general/test_nm_utils_uuid_generate_from_string", test_nm_utils_uuid_generate_from_string);
+ g_test_add_func ("/core/general/_nm_utils_uuid_generate_from_strings", test_nm_utils_uuid_generate_from_strings);
+
+ g_test_add_func ("/core/general/_nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64);
return g_test_run ();
}
diff --git a/libnm-core/tests/test-keyfile.c b/libnm-core/tests/test-keyfile.c
new file mode 100644
index 0000000000..0f0548ad85
--- /dev/null
+++ b/libnm-core/tests/test-keyfile.c
@@ -0,0 +1,567 @@
+/* -*- 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 2015 Red Hat, Inc.
+ *
+ */
+
+#include "config.h"
+
+#include "nm-utils-internal.h"
+#include "nm-keyfile-utils.h"
+#include "nm-keyfile-internal.h"
+
+#include "nm-simple-connection.h"
+#include "nm-setting-connection.h"
+#include "nm-setting-wired.h"
+#include "nm-setting-8021x.h"
+
+#include "nm-test-utils.h"
+
+
+#define TEST_WIRED_TLS_CA_CERT TEST_CERT_DIR"/test-ca-cert.pem"
+#define TEST_WIRED_TLS_PRIVKEY TEST_CERT_DIR"/test-key-and-cert.pem"
+
+
+/******************************************************************************/
+
+#define CLEAR(con, keyfile) \
+ G_STMT_START { \
+ NMConnection **_con = (con); \
+ GKeyFile **_keyfile = (keyfile); \
+ \
+ g_clear_object (_con); \
+ g_clear_pointer (_keyfile, g_key_file_unref); \
+ } G_STMT_END
+
+static void
+_assert_gbytes (GBytes *bytes, gconstpointer data, gssize len)
+{
+ g_assert ((data && len > 0) || !len || (data && len == -1));
+
+ if (len == -1)
+ len = strlen (data);
+
+ if (!len)
+ g_assert (!bytes);
+ else {
+ g_assert_cmpint (g_bytes_get_size (bytes), ==, len);
+ g_assert (memcmp (g_bytes_get_data (bytes, NULL), data, len) == 0);
+ }
+}
+
+static GKeyFile *
+_keyfile_load_from_data (const char *str)
+{
+ GError *error = NULL;
+ gboolean success;
+ GKeyFile *keyfile;
+
+ g_assert (str);
+
+ keyfile = g_key_file_new ();
+ success = g_key_file_load_from_data (keyfile, str, strlen (str), G_KEY_FILE_NONE, &error);
+ g_assert_no_error (error);
+ g_assert (success);
+
+ return keyfile;
+}
+
+static gboolean
+_keyfile_a_contains_all_in_b (GKeyFile *kf_a, GKeyFile *kf_b)
+{
+ gs_strfreev char **groups = NULL;
+ guint i, j;
+
+ if (kf_a == kf_b)
+ return TRUE;
+
+ groups = g_key_file_get_groups (kf_a, NULL);
+ for (i = 0; groups && groups[i]; i++) {
+ gs_strfreev char **keys = NULL;
+
+ keys = g_key_file_get_keys (kf_a, groups[i], NULL, NULL);
+ if (keys) {
+ for (j = 0; keys[j]; j++) {
+ gs_free char *key_a = g_key_file_get_value (kf_a, groups[i], keys[j], NULL);
+ gs_free char *key_b = g_key_file_get_value (kf_b, groups[i], keys[j], NULL);
+
+ if (g_strcmp0 (key_a, key_b) != 0)
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+}
+
+static gboolean
+_keyfile_equals (GKeyFile *kf_a, GKeyFile *kf_b)
+{
+ return _keyfile_a_contains_all_in_b (kf_a, kf_b) && _keyfile_a_contains_all_in_b (kf_b, kf_a);
+}
+
+static GKeyFile *
+_nm_keyfile_write (NMConnection *connection,
+ NMKeyfileWriteHandler handler,
+ void *user_data)
+{
+ GError *error = NULL;
+ GKeyFile *kf;
+
+ g_assert (NM_IS_CONNECTION (connection));
+
+ kf = nm_keyfile_write (connection, handler, user_data, &error);
+ g_assert_no_error (error);
+ g_assert (kf);
+ return kf;
+}
+
+static NMConnection *
+_nm_keyfile_read (GKeyFile *keyfile,
+ const char *keyfile_name,
+ const char *base_dir,
+ NMKeyfileReadHandler read_handler,
+ void *read_data,
+ gboolean needs_normalization)
+{
+ GError *error = NULL;
+ NMConnection *con;
+
+ g_assert (keyfile);
+
+ con = nm_keyfile_read (keyfile, keyfile_name, base_dir, read_handler, read_data, &error);
+ g_assert_no_error (error);
+ g_assert (NM_IS_CONNECTION (con));
+ if (needs_normalization)
+ nmtst_assert_connection_verifies_after_normalization (con, 0, 0);
+ else
+ nmtst_assert_connection_verifies_without_normalization (con);
+ return con;
+}
+
+
+static void
+_keyfile_convert (NMConnection **con,
+ GKeyFile **keyfile,
+ const char *keyfile_name,
+ const char *base_dir,
+ NMKeyfileReadHandler read_handler,
+ void *read_data,
+ NMKeyfileWriteHandler write_handler,
+ void *write_data,
+ gboolean needs_normalization)
+{
+ NMConnection *c0;
+ GKeyFile *k0;
+ gs_unref_object NMConnection *c0_k1_c2 = NULL, *k0_c1 = NULL, *k0_c1_k2_c3 = NULL;
+ gs_unref_keyfile GKeyFile *k0_c1_k2 = NULL, *c0_k1 = NULL, *c0_k1_c2_k3 = NULL;
+
+ /* convert from @con to @keyfile and check that we can make
+ * full round trips and obtaining the same result. */
+
+ g_assert (con);
+ g_assert (keyfile);
+ g_assert (*con || *keyfile);
+
+ c0 = *con;
+ k0 = *keyfile;
+
+ if (c0) {
+ c0_k1 = _nm_keyfile_write (c0, write_handler, write_data);
+ c0_k1_c2 = _nm_keyfile_read (c0_k1, keyfile_name, base_dir, read_handler, read_data, FALSE);
+ c0_k1_c2_k3 = _nm_keyfile_write (c0_k1_c2, write_handler, write_data);
+
+ _keyfile_equals (c0_k1, c0_k1_c2_k3);
+ }
+ if (k0) {
+ NMSetting8021x *s1, *s2;
+
+ k0_c1 = _nm_keyfile_read (k0, keyfile_name, base_dir, read_handler, read_data, needs_normalization);
+ k0_c1_k2 = _nm_keyfile_write (k0_c1, write_handler, write_data);
+ k0_c1_k2_c3 = _nm_keyfile_read (k0_c1_k2, keyfile_name, base_dir, read_handler, read_data, FALSE);
+
+ /* It is a expeced behavior, that if @k0 contains a relative path ca-cert, @k0_c1 will
+ * contain that path as relative. But @k0_c1_k2 and @k0_c1_k2_c3 will have absolute paths.
+ * In this case, hack up @k0_c1_k2_c3 to contain the same relative path. */
+ s1 = nm_connection_get_setting_802_1x (k0_c1);
+ s2 = nm_connection_get_setting_802_1x (k0_c1_k2_c3);
+ if (s1 || s2) {
+ g_assert_cmpint (nm_setting_802_1x_get_ca_cert_scheme (s1), ==, nm_setting_802_1x_get_ca_cert_scheme (s2));
+ switch (nm_setting_802_1x_get_ca_cert_scheme (s1)) {
+ case NM_SETTING_802_1X_CK_SCHEME_PATH:
+ {
+ const char *p1 = nm_setting_802_1x_get_ca_cert_path (s1);
+ const char *p2 = nm_setting_802_1x_get_ca_cert_path (s2);
+
+ nmtst_assert_resolve_relative_path_equals (p1, p2);
+ if (strcmp (p1, p2) != 0) {
+ gs_free char *puri = NULL;
+ gs_unref_bytes GBytes *pfile = NULL;
+
+ g_assert (p1[0] != '/' && p2[0] == '/');
+
+ /* one of the paths is a relative path and the other is absolute. This is an
+ * expected difference.
+ * Make the paths of s2 identical to s1... */
+ puri = g_strconcat (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH, p1, NULL);
+ pfile = g_bytes_new (puri, strlen (puri) + 1);
+ g_object_set (s2, NM_SETTING_802_1X_CA_CERT, pfile, NULL);
+ }
+ }
+ break;
+ case NM_SETTING_802_1X_CK_SCHEME_BLOB: {
+ GBytes *b1, *b2;
+
+ b1 = nm_setting_802_1x_get_ca_cert_blob (s1);
+ b2 = nm_setting_802_1x_get_ca_cert_blob (s2);
+ g_assert_cmpint (g_bytes_get_size (b1), ==, g_bytes_get_size (b2));
+ g_assert (memcmp (g_bytes_get_data (b1, NULL), g_bytes_get_data (b2, NULL), g_bytes_get_size (b1)) == 0);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ nmtst_assert_connection_equals (k0_c1, FALSE, k0_c1_k2_c3, FALSE);
+ }
+
+ if (!k0)
+ *keyfile = g_key_file_ref (c0_k1);
+ else if (!c0)
+ *con = g_object_ref (k0_c1);
+ else {
+ /* finally, if both a keyfile and a connection are given, assert that they are equal
+ * after a round of conversion. */
+ _keyfile_equals (c0_k1, k0_c1_k2);
+ nmtst_assert_connection_equals (k0_c1, FALSE, c0_k1_c2, FALSE);
+ }
+}
+
+/******************************************************************************/
+
+static void
+_test_8021x_cert_check (NMConnection *con,
+ NMSetting8021xCKScheme expected_scheme,
+ const void *value,
+ gssize val_len)
+{
+ GKeyFile *keyfile = NULL;
+ NMSetting8021x *s_8021x;
+ gs_free char *kval = NULL;
+
+ _keyfile_convert (&con, &keyfile, NULL, NULL, NULL, NULL, NULL, NULL, FALSE);
+
+ s_8021x = nm_connection_get_setting_802_1x (con);
+
+ g_assert (nm_setting_802_1x_get_ca_cert_scheme (s_8021x) == expected_scheme);
+
+ if (expected_scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) {
+ const char *path = nm_setting_802_1x_get_ca_cert_path (s_8021x);
+
+ g_assert_cmpstr (path, ==, value);
+ g_assert (val_len == -1 || strlen (path) == val_len);
+
+ kval = g_key_file_get_string (keyfile, "802-1x", "ca-cert", NULL);
+ g_assert (kval);
+ g_assert_cmpstr (kval, ==, value);
+ } else if (expected_scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) {
+ GBytes *blob = nm_setting_802_1x_get_ca_cert_blob (s_8021x);
+ gs_free char *file_blob = NULL;
+
+ if (val_len == -1) {
+ gsize l;
+ gboolean success;
+
+ success = g_file_get_contents (value, &file_blob, &l, NULL);
+ g_assert (success);
+
+ value = file_blob;
+ val_len = l;
+ }
+
+ g_assert (blob);
+ g_assert_cmpint (g_bytes_get_size (blob), ==, val_len);
+ g_assert (!memcmp (g_bytes_get_data (blob, NULL), value, val_len));
+
+ kval = g_key_file_get_string (keyfile, "802-1x", "ca-cert", NULL);
+ g_assert (kval);
+ g_assert (g_str_has_prefix (kval, NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB));
+ }
+
+ g_key_file_unref (keyfile);
+}
+
+static void
+_test_8021x_cert_check_blob_full (NMConnection *con, const void *data, gsize len)
+{
+ GBytes *bytes;
+ NMSetting8021x *s_8021x = nm_connection_get_setting_802_1x (con);
+
+ bytes = g_bytes_new (data, len);
+ g_object_set (s_8021x,
+ NM_SETTING_802_1X_CA_CERT,
+ bytes,
+ NULL);
+ _test_8021x_cert_check (con, NM_SETTING_802_1X_CK_SCHEME_BLOB, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
+ g_bytes_unref (bytes);
+}
+#define _test_8021x_cert_check_blob(con, data) _test_8021x_cert_check_blob_full(con, data, STRLEN (data))
+
+static void
+test_8021x_cert (void)
+{
+ NMSetting8021x *s_8021x;
+ gs_unref_object NMConnection *con = nmtst_create_minimal_connection ("test-cert", NULL, NM_SETTING_WIRED_SETTING_NAME, NULL);
+ GError *error = NULL;
+ gboolean success;
+ NMSetting8021xCKScheme scheme = NM_SETTING_802_1X_CK_SCHEME_PATH;
+ gs_free char *full_TEST_WIRED_TLS_CA_CERT = nmtst_file_resolve_relative_path (TEST_WIRED_TLS_CA_CERT, NULL);
+ gs_free char *full_TEST_WIRED_TLS_PRIVKEY = nmtst_file_resolve_relative_path (TEST_WIRED_TLS_PRIVKEY, NULL);
+
+ /* test writing/reading of certificates of NMSetting8021x */
+
+ /* create a valid connection with NMSetting8021x */
+ s_8021x = (NMSetting8021x *) nm_setting_802_1x_new ();
+ nm_setting_802_1x_add_eap_method (s_8021x, "tls");
+ g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, "Bill Smith", NULL);
+ success = nm_setting_802_1x_set_ca_cert (s_8021x,
+ full_TEST_WIRED_TLS_CA_CERT,
+ scheme,
+ NULL,
+ &error);
+ g_assert_no_error (error);
+ g_assert (success);
+ success = nm_setting_802_1x_set_client_cert (s_8021x,
+ full_TEST_WIRED_TLS_CA_CERT,
+ scheme,
+ NULL,
+ &error);
+ g_assert_no_error (error);
+ g_assert (success);
+ success = nm_setting_802_1x_set_private_key (s_8021x,
+ full_TEST_WIRED_TLS_PRIVKEY,
+ "test1",
+ scheme,
+ NULL,
+ &error);
+ g_assert_no_error (error);
+ g_assert (success);
+
+
+ /* test reseting ca-cert to different values and see whether we can write/read. */
+
+ nm_connection_add_setting (con, NM_SETTING (s_8021x));
+ nmtst_assert_connection_verifies_and_normalizable (con);
+
+
+ _test_8021x_cert_check (con, scheme, full_TEST_WIRED_TLS_CA_CERT, -1);
+
+ scheme = NM_SETTING_802_1X_CK_SCHEME_BLOB;
+ success = nm_setting_802_1x_set_ca_cert (s_8021x,
+ full_TEST_WIRED_TLS_CA_CERT,
+ scheme,
+ NULL,
+ &error);
+ g_assert_no_error (error);
+ g_assert (success);
+ _test_8021x_cert_check (con, scheme, full_TEST_WIRED_TLS_CA_CERT, -1);
+
+ _test_8021x_cert_check_blob (con, "a");
+ _test_8021x_cert_check_blob (con, "\0");
+ _test_8021x_cert_check_blob (con, "10");
+ _test_8021x_cert_check_blob (con, "data:;base64,a");
+ _test_8021x_cert_check_blob_full (con, "data:;base64,a", STRLEN ("data:;base64,a") + 1);
+ _test_8021x_cert_check_blob (con, "data:;base64,file://a");
+ _test_8021x_cert_check_blob (con, "123");
+
+}
+
+/******************************************************************************/
+
+static void
+test_8021x_cert_read (void)
+{
+ GKeyFile *keyfile = NULL;
+ gs_unref_object NMConnection *con = NULL;
+ NMSetting8021x *s_8021x;
+
+ con = nmtst_create_connection_from_keyfile (
+ "[connection]\n"
+ "type=ethernet",
+ "/test_8021x_cert_read/test0", NULL);
+ CLEAR (&con, &keyfile);
+
+
+ keyfile = _keyfile_load_from_data (
+ "[connection]\n"
+ "type=ethernet"
+ );
+ _keyfile_convert (&con, &keyfile, "/test_8021x_cert_read/test1", NULL, NULL, NULL, NULL, NULL, TRUE);
+ CLEAR (&con, &keyfile);
+
+ keyfile = _keyfile_load_from_data (
+ "[connection]\n"
+ "type=802-3-ethernet\n"
+
+ "[802-1x]\n"
+ "eap=tls;\n"
+ "identity=Bill Smith\n"
+ "ca-cert=48;130;2;52;48;130;1;161;2;16;2;173;102;126;78;69;254;94;87;111;60;152;25;94;221;192;48;13;6;9;42;134;72;134;247;13;1;1;2;5;0;48;95;49;11;48;9;6;3;85;4;6;19;2;85;83;49;32;48;30;6;3;85;4;10;19;23;82;83;65;32;68;97;116;97;32;83;101;99;117;114;105;116;121;44;32;73;110;99;46;49;46;48;44;6;3;85;4;11;19;37;83;101;99;117;114;101;32;83;101;114;118;101;114;32;67;101;114;116;105;102;105;99;97;116;105;111;110;32;65;117;116;104;111;114;105;116;121;48;30;23;13;57;52;49;49;48;57;48;48;48;48;48;48;90;23;13;49;48;48;49;48;55;50;51;53;57;53;57;90;48;95;49;11;48;9;6;3;85;4;6;19;2;85;83;49;32;48;30;6;3;85;4;10;19;23;82;83;65;32;68;97;116;97;32;83;101;99;117;114;105;116;121;44;32;73;110;99;46;49;46;48;44;6;3;85;4;11;19;37;83;101;99;117;114;101;32;83;101;114;118;101;114;32;67;101;114;116;105;102;105;99;97;116;105;111;110;32;65;117;116;104;111;114;105;116;121;48;129;155;48;13;6;9;42;134;72;134;247;13;1;1;1;5;0;3;129;137;0;48;129;133;2;126;0;146;206;122;193;174;131;62;90;170;137;131;87;172;37;1;118;12;173;174;142;44;55;206;235;53;120;100;84;3;229;132;64;81;201;191;143;8;226;138;130;8;210;22;134;55;85;233;177;33;2;173;118;104;129;154;5;162;75;201;75;37;102;34;86;108;136;7;143;247;129;89;109;132;7;101;112;19;113;118;62;155;119;76;227;80;137;86;152;72;185;29;167;41;26;19;46;74;17;89;156;30;21;213;73;84;44;115;58;105;130;177;151;57;156;109;112;103;72;229;221;45;214;200;30;123;2;3;1;0;1;48;13;6;9;42;134;72;134;247;13;1;1;2;5;0;3;126;0;101;221;126;225;178;236;176;226;58;224;236;113;70;154;25;17;184;211;199;160;180;3;64;38;2;62;9;156;225;18;179;209;90;246;55;165;183;97;3;182;91;22;105;59;198;68;8;12;136;83;12;107;151;73;199;62;53;220;108;185;187;170;223;92;187;58;47;147;96;182;169;75;77;242;32;247;205;95;127;100;123;142;220;0;92;215;250;119;202;57;22;89;111;14;234;211;181;131;127;77;77;66;86;118;180;201;95;4;248;56;248;235;210;95;117;95;205;123;252;229;142;128;124;252;80;\n"
+ "client-cert=102;105;108;101;58;47;47;47;104;111;109;101;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;\n"
+ "private-key=102;105;108;101;58;47;47;47;104;111;109;101;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;\n"
+ "private-key-password=12345testing\n"
+ );
+ _keyfile_convert (&con, &keyfile, "/test_8021x_cert_read/test2", NULL, NULL, NULL, NULL, NULL, TRUE);
+ CLEAR (&con, &keyfile);
+
+
+ keyfile = _keyfile_load_from_data (
+ "[connection]\n"
+ "type=802-3-ethernet\n"
+
+ "[802-1x]\n"
+ "eap=tls;\n"
+ "identity=Bill Smith\n"
+ /* unqualified strings are only recognized as path up to 500 chars*/
+ "ca-cert=" "/111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+ "/111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+ "/111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+ "/111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+ "/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n"
+ "client-cert=/222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221"
+ "/222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221"
+ "/222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221"
+ "/222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221"
+ "/222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222\n"
+ "private-key=file://"
+ "/333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333331"
+ "/333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333331"
+ "/333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333331"
+ "/333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333331"
+ "/33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333111111\n"
+ "private-key-password=12345testing\n"
+ );
+ _keyfile_convert (&con, &keyfile, "/test_8021x_cert_read/test2", NULL, NULL, NULL, NULL, NULL, TRUE);
+ s_8021x = nm_connection_get_setting_802_1x (con);
+
+ g_assert (nm_setting_802_1x_get_ca_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH);
+ g_assert (g_str_has_prefix (nm_setting_802_1x_get_ca_cert_path (s_8021x), "/111111111111"));
+ g_assert_cmpint (strlen (nm_setting_802_1x_get_ca_cert_path (s_8021x)), ==, 499);
+
+ g_assert (nm_setting_802_1x_get_client_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_BLOB);
+ g_assert (g_str_has_prefix (g_bytes_get_data (nm_setting_802_1x_get_client_cert_blob (s_8021x), NULL), "/2222222222"));
+ g_assert_cmpint (g_bytes_get_size (nm_setting_802_1x_get_client_cert_blob (s_8021x)), ==, 500 + 1 /* keyfile reader adds a trailing NUL */);
+
+ g_assert (nm_setting_802_1x_get_private_key_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH);
+ g_assert (g_str_has_prefix (nm_setting_802_1x_get_private_key_path (s_8021x), "/333333333"));
+ g_assert_cmpint (strlen (nm_setting_802_1x_get_private_key_path (s_8021x)), ==, 505);
+ CLEAR (&con, &keyfile);
+
+
+ keyfile = _keyfile_load_from_data (
+ "[connection]\n"
+ "type=802-3-ethernet\n"
+
+ "[802-1x]\n"
+ "eap=tls;\n"
+ "identity=Bill Smith\n"
+ "ca-cert=/\n"
+ "client-cert=a.pem\n"
+ "private-key=data:;base64,aGFsbG8=\n" // hallo
+ "private-key-password=12345testing\n"
+ );
+ _keyfile_convert (&con, &keyfile, "/test_8021x_cert_read/test2", NULL, NULL, NULL, NULL, NULL, TRUE);
+ s_8021x = nm_connection_get_setting_802_1x (con);
+
+ g_assert (nm_setting_802_1x_get_ca_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH);
+ g_assert_cmpstr (nm_setting_802_1x_get_ca_cert_path (s_8021x), ==, "/");
+
+ g_assert (nm_setting_802_1x_get_client_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH);
+ g_assert_cmpstr (nm_setting_802_1x_get_client_cert_path (s_8021x), ==, "/test_8021x_cert_read/a.pem");
+
+ g_assert (nm_setting_802_1x_get_private_key_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_BLOB);
+ _assert_gbytes (nm_setting_802_1x_get_private_key_blob (s_8021x), "hallo", -1);
+ CLEAR (&con, &keyfile);
+
+
+ keyfile = _keyfile_load_from_data (
+ "[connection]\n"
+ "type=802-3-ethernet\n"
+
+ "[802-1x]\n"
+ "eap=tls;\n"
+ "identity=Bill Smith\n"
+ "ca-cert=file://data:;base64,x\n"
+ "client-cert=abc.der\n"
+ "private-key=abc.deR\n"
+ "private-key-password=12345testing\n"
+ );
+ _keyfile_convert (&con, &keyfile, "/test_8021x_cert_read/test2", NULL, NULL, NULL, NULL, NULL, TRUE);
+ s_8021x = nm_connection_get_setting_802_1x (con);
+
+ g_assert (nm_setting_802_1x_get_ca_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH);
+ g_assert_cmpstr (nm_setting_802_1x_get_ca_cert_path (s_8021x), ==, "data:;base64,x");
+
+ g_assert (nm_setting_802_1x_get_client_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH);
+ g_assert_cmpstr (nm_setting_802_1x_get_client_cert_path (s_8021x), ==, "/test_8021x_cert_read/abc.der");
+
+ g_assert (nm_setting_802_1x_get_private_key_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_BLOB);
+ _assert_gbytes (nm_setting_802_1x_get_private_key_blob (s_8021x), "abc.deR\0", 8);
+ CLEAR (&con, &keyfile);
+
+
+ keyfile = _keyfile_load_from_data (
+ "[connection]\n"
+ "type=802-3-ethernet\n"
+
+ "[802-1x]\n"
+ "eap=tls;\n"
+ "identity=Bill Smith\n"
+ "ca-cert=104;97;108;108;111;\n" /* "hallo" without trailing NUL */
+ "client-cert=104;097;108;108;111;0;\n"
+ "private-key=hallo\n"
+ "private-key-password=12345testing\n"
+ );
+ _keyfile_convert (&con, &keyfile, "/test_8021x_cert_read/test2", NULL, NULL, NULL, NULL, NULL, TRUE);
+ s_8021x = nm_connection_get_setting_802_1x (con);
+
+ g_assert (nm_setting_802_1x_get_ca_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_BLOB);
+ _assert_gbytes (nm_setting_802_1x_get_ca_cert_blob (s_8021x), "hallo", 5);
+
+ g_assert (nm_setting_802_1x_get_client_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_BLOB);
+ _assert_gbytes (nm_setting_802_1x_get_client_cert_blob (s_8021x), "hallo\0", 6);
+
+ g_assert (nm_setting_802_1x_get_private_key_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_BLOB);
+ _assert_gbytes (nm_setting_802_1x_get_private_key_blob (s_8021x), "hallo\0", 6);
+ CLEAR (&con, &keyfile);
+}
+
+/******************************************************************************/
+
+NMTST_DEFINE ();
+
+int main (int argc, char **argv)
+{
+ nmtst_init (&argc, &argv, TRUE);
+
+ g_test_add_func ("/core/keyfile/test_8021x_cert", test_8021x_cert);
+ g_test_add_func ("/core/keyfile/test_8021x_cert_read", test_8021x_cert_read);
+
+ return g_test_run ();
+}
+
diff --git a/libnm-core/tests/test-secrets.c b/libnm-core/tests/test-secrets.c
index b93a1ba155..a915ae7d4e 100644
--- a/libnm-core/tests/test-secrets.c
+++ b/libnm-core/tests/test-secrets.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
@@ -125,7 +127,7 @@ make_tls_connection (const char *detail, NMSetting8021xCKScheme scheme)
s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
detail, "failed to verify connection: %s",
@@ -174,6 +176,7 @@ test_need_tls_secrets_path (void)
"need-tls-secrets-path-key-password",
"expected to require private key password, but it wasn't");
+ g_ptr_array_free (hints, TRUE);
g_object_unref (connection);
}
@@ -217,6 +220,7 @@ test_need_tls_secrets_blob (void)
"need-tls-secrets-blob-key-password",
"expected to require private key password, but it wasn't");
+ g_ptr_array_free (hints, TRUE);
g_object_unref (connection);
}
@@ -293,7 +297,7 @@ make_tls_phase2_connection (const char *detail, NMSetting8021xCKScheme scheme)
s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
detail, "failed to verify connection: %s",
@@ -343,6 +347,7 @@ test_need_tls_phase2_secrets_path (void)
"need-tls-phase2-secrets-path-key-password",
"expected to require private key password, but it wasn't");
+ g_ptr_array_free (hints, TRUE);
g_object_unref (connection);
}
@@ -387,6 +392,7 @@ test_need_tls_phase2_secrets_blob (void)
"need-tls-phase2-secrets-blob-key-password",
"expected to require private key password, but it wasn't");
+ g_ptr_array_free (hints, TRUE);
g_object_unref (connection);
}
@@ -557,8 +563,8 @@ test_update_secrets_wifi_bad_setting_name (void)
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND);
g_assert (success == FALSE);
+ g_clear_error (&error);
g_variant_unref (secrets);
-
g_object_unref (connection);
}
@@ -666,6 +672,7 @@ test_update_secrets_whole_connection_bad_setting (void)
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND);
g_assert (success == FALSE);
+ g_clear_error (&error);
g_variant_unref (copy);
g_object_unref (connection);
}
diff --git a/libnm-core/tests/test-setting-8021x.c b/libnm-core/tests/test-setting-8021x.c
index a0c006de51..16f6016e23 100644
--- a/libnm-core/tests/test-setting-8021x.c
+++ b/libnm-core/tests/test-setting-8021x.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
@@ -55,15 +57,13 @@ compare_blob_data (const char *test,
g_free (contents);
}
-#define SCHEME_PATH "file://"
-
static void
check_scheme_path (GBytes *value, const char *path)
{
const guint8 *p = g_bytes_get_data (value, NULL);
- g_assert (memcmp (p, SCHEME_PATH, strlen (SCHEME_PATH)) == 0);
- p += strlen (SCHEME_PATH);
+ g_assert (memcmp (p, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH, strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH)) == 0);
+ p += strlen (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH);
g_assert (memcmp (p, path, strlen (path)) == 0);
p += strlen (path);
g_assert (*p == '\0');
@@ -184,6 +184,7 @@ test_phase2_private_key_import (const char *path,
g_object_get (s_8021x, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, &tmp_key, NULL);
ASSERT (tmp_key != NULL, "phase2-private-key-import", "missing private key value");
check_scheme_path (tmp_key, path);
+ g_bytes_unref (tmp_key);
} else
g_assert_not_reached ();
@@ -243,6 +244,7 @@ test_wrong_password_keeps_data (const char *path, const char *password)
"wrong-password-keeps-data", "unexpected missing error");
ASSERT (format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN,
"wrong-password-keeps-data", "unexpected success reading private key format");
+ g_clear_error (&error);
/* Make sure the password hasn't changed */
pw = nm_setting_802_1x_get_private_key_password (s_8021x);
@@ -340,6 +342,7 @@ test_wrong_phase2_password_keeps_data (const char *path, const char *password)
"wrong-phase2-password-keeps-data", "unexpected missing error");
ASSERT (format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN,
"wrong-phase2-password-keeps-data", "unexpected success reading private key format");
+ g_clear_error (&error);
/* Make sure the password hasn't changed */
pw = nm_setting_802_1x_get_phase2_private_key_password (s_8021x);
diff --git a/libnm-core/tests/test-setting-dcb.c b/libnm-core/tests/test-setting-dcb.c
index 8d861a0390..f7554e81a5 100644
--- a/libnm-core/tests/test-setting-dcb.c
+++ b/libnm-core/tests/test-setting-dcb.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <nm-utils.h>
@@ -26,6 +28,7 @@
#include "nm-setting-dcb.h"
#include "nm-connection.h"
#include "nm-errors.h"
+#include "gsystem-local-alloc.h"
#define DCB_FLAGS_ALL (NM_SETTING_DCB_FLAG_ENABLE | \
NM_SETTING_DCB_FLAG_ADVERTISE | \
@@ -34,7 +37,7 @@
static void
test_dcb_flags_valid (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
guint i;
@@ -87,7 +90,7 @@ test_dcb_flags_valid (void)
static void
test_dcb_flags_invalid (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
@@ -146,7 +149,7 @@ test_dcb_flags_invalid (void)
static void
test_dcb_app_priorities (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
@@ -208,7 +211,7 @@ test_dcb_app_priorities (void)
static void
test_dcb_priorities_valid (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
guint i;
@@ -267,7 +270,7 @@ test_dcb_priorities_valid (void)
static void
test_dcb_bandwidth_sums (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
@@ -300,21 +303,15 @@ test_dcb_bandwidth_sums (void)
#define TPATH "/libnm/settings/dcb/"
-int main (int argc, char **argv)
+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
diff --git a/libnm-core/tests/test-settings-defaults.c b/libnm-core/tests/test-settings-defaults.c
index c13416c122..0e78618723 100644
--- a/libnm-core/tests/test-settings-defaults.c
+++ b/libnm-core/tests/test-settings-defaults.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
@@ -99,18 +101,15 @@ test_defaults (GType type, const char *name)
g_object_unref (setting);
}
-int main (int argc, char **argv)
+int
+main (int argc, char **argv)
{
- GError *error = NULL;
char *base;
#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
#endif
- if (!nm_utils_init (&error))
- FAIL ("nm-utils-init", "failed to initialize libnm: %s", error->message);
-
/* The tests */
test_defaults (NM_TYPE_SETTING_CONNECTION, NM_SETTING_CONNECTION_SETTING_NAME);
test_defaults (NM_TYPE_SETTING_802_1X, NM_SETTING_802_1X_SETTING_NAME);
diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am
index 57eff9a71a..20a2481120 100644
--- a/libnm-glib/Makefile.am
+++ b/libnm-glib/Makefile.am
@@ -151,7 +151,7 @@ libnm_glib_la_LIBADD = \
SYMBOL_VIS_FILE=$(srcdir)/libnm-glib.ver
libnm_glib_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \
- -version-info "12:0:8"
+ -version-info "13:0:9"
noinst_PROGRAMS = libnm-glib-test
diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c
index e38457f06b..7dc6823e20 100644
--- a/libnm-glib/libnm-glib-test.c
+++ b/libnm-glib/libnm-glib-test.c
@@ -20,6 +20,8 @@
* Copyright (C) 2007 - 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <signal.h>
#include <string.h>
diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver
index c0f1bba0dc..9219c4a2bb 100644
--- a/libnm-glib/libnm-glib.ver
+++ b/libnm-glib/libnm-glib.ver
@@ -183,6 +183,7 @@ global:
nm_device_vlan_error_quark;
nm_device_vlan_get_carrier;
nm_device_vlan_get_hw_address;
+ nm_device_vlan_get_parent;
nm_device_vlan_get_type;
nm_device_vlan_get_vlan_id;
nm_device_vlan_new;
diff --git a/libnm-glib/libnm_glib.c b/libnm-glib/libnm_glib.c
index a2a6d26ed0..fed8016066 100644
--- a/libnm-glib/libnm_glib.c
+++ b/libnm-glib/libnm_glib.c
@@ -21,6 +21,8 @@
* Copyright (C) 2005 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/libnm-glib/nm-access-point.c b/libnm-glib/nm-access-point.c
index b462a6b169..abf61cc923 100644
--- a/libnm-glib/nm-access-point.c
+++ b/libnm-glib/nm-access-point.c
@@ -19,7 +19,8 @@
* Copyright 2007 - 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-active-connection.c b/libnm-glib/nm-active-connection.c
index 358264fd25..7067a1100d 100644
--- a/libnm-glib/nm-active-connection.c
+++ b/libnm-glib/nm-active-connection.c
@@ -19,6 +19,8 @@
* Copyright 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "NetworkManager.h"
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index f4efc607e5..d62a8b6320 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -19,6 +19,8 @@
* Copyright 2007 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <dbus/dbus-glib.h>
#include <string.h>
#include <nm-utils.h>
@@ -358,9 +360,9 @@ client_recheck_permissions (DBusGProxy *proxy, gpointer user_data)
* @client: a #NMClient
*
* Gets all the known network devices. Use nm_device_get_type() or the
- * NM_IS_DEVICE_XXXX() functions to determine what kind of device member of the
- * returned array is, and then you may use device-specific methods such as
- * nm_device_ethernet_get_hw_address().
+ * <literal>NM_IS_DEVICE_XXXX</literal> functions to determine what kind of
+ * device member of the returned array is, and then you may use device-specific
+ * methods such as nm_device_ethernet_get_hw_address().
*
* Returns: (transfer none) (element-type NMDevice): a #GPtrArray
* containing all the #NMDevices. The returned array is owned by the
@@ -1418,7 +1420,7 @@ nm_client_get_connectivity (NMClient *client)
{
NMClientPrivate *priv;
- g_return_val_if_fail (NM_IS_CLIENT (client), NM_STATE_UNKNOWN);
+ g_return_val_if_fail (NM_IS_CLIENT (client), NM_CONNECTIVITY_UNKNOWN);
priv = NM_CLIENT_GET_PRIVATE (client);
_nm_object_ensure_inited (NM_OBJECT (client));
@@ -1546,7 +1548,7 @@ nm_client_check_connectivity_async (NMClient *client,
g_return_if_fail (NM_IS_CLIENT (client));
priv = NM_CLIENT_GET_PRIVATE (client);
- ccd = g_slice_new (CheckConnectivityData);
+ ccd = g_slice_new0 (CheckConnectivityData);
ccd->client = client;
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
diff --git a/libnm-glib/nm-dbus-helpers.c b/libnm-glib/nm-dbus-helpers.c
index 25004310d9..00e04ab435 100644
--- a/libnm-glib/nm-dbus-helpers.c
+++ b/libnm-glib/nm-dbus-helpers.c
@@ -18,8 +18,9 @@
* Copyright 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <config.h>
#include <gio/gio.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
diff --git a/libnm-glib/nm-device-adsl.c b/libnm-glib/nm-device-adsl.c
index eb54957413..6812168370 100644
--- a/libnm-glib/nm-device-adsl.c
+++ b/libnm-glib/nm-device-adsl.c
@@ -19,6 +19,8 @@
* Copyright 2009 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include "nm-device-adsl.h"
#include "nm-device-private.h"
#include "nm-object-private.h"
diff --git a/libnm-glib/nm-device-bond.c b/libnm-glib/nm-device-bond.c
index 0529ccb932..786d4f1680 100644
--- a/libnm-glib/nm-device-bond.c
+++ b/libnm-glib/nm-device-bond.c
@@ -18,7 +18,8 @@
* Copyright 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-device-bridge.c b/libnm-glib/nm-device-bridge.c
index bf19737555..ef69fb2647 100644
--- a/libnm-glib/nm-device-bridge.c
+++ b/libnm-glib/nm-device-bridge.c
@@ -18,7 +18,8 @@
* Copyright 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-device-bt.c b/libnm-glib/nm-device-bt.c
index 00616a95a8..58d483443a 100644
--- a/libnm-glib/nm-device-bt.c
+++ b/libnm-glib/nm-device-bt.c
@@ -19,7 +19,8 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c
index 690041a515..d27a980fe9 100644
--- a/libnm-glib/nm-device-ethernet.c
+++ b/libnm-glib/nm-device-ethernet.c
@@ -19,7 +19,8 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-device-generic.c b/libnm-glib/nm-device-generic.c
index 875ea8eb39..a17a67355a 100644
--- a/libnm-glib/nm-device-generic.c
+++ b/libnm-glib/nm-device-generic.c
@@ -18,7 +18,7 @@
* Copyright 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <string.h>
diff --git a/libnm-glib/nm-device-infiniband.c b/libnm-glib/nm-device-infiniband.c
index 3aa6e03ab5..663b36516d 100644
--- a/libnm-glib/nm-device-infiniband.c
+++ b/libnm-glib/nm-device-infiniband.c
@@ -18,7 +18,8 @@
* Copyright 2011 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <linux/if_infiniband.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-device-modem.c b/libnm-glib/nm-device-modem.c
index 7d286190f3..524d86cea0 100644
--- a/libnm-glib/nm-device-modem.c
+++ b/libnm-glib/nm-device-modem.c
@@ -19,7 +19,8 @@
* Copyright 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include "nm-glib-compat.h"
diff --git a/libnm-glib/nm-device-olpc-mesh.c b/libnm-glib/nm-device-olpc-mesh.c
index 666ddc2636..e68fda6261 100644
--- a/libnm-glib/nm-device-olpc-mesh.c
+++ b/libnm-glib/nm-device-olpc-mesh.c
@@ -18,7 +18,8 @@
* Copyright 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include "nm-glib-compat.h"
diff --git a/libnm-glib/nm-device-team.c b/libnm-glib/nm-device-team.c
index e9ff548c35..d9a5fce088 100644
--- a/libnm-glib/nm-device-team.c
+++ b/libnm-glib/nm-device-team.c
@@ -18,7 +18,8 @@
* Copyright 2013 Jiri Pirko <jiri@resnulli.us>
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-device-vlan.c b/libnm-glib/nm-device-vlan.c
index 93bf12763b..26c234bdd5 100644
--- a/libnm-glib/nm-device-vlan.c
+++ b/libnm-glib/nm-device-vlan.c
@@ -18,7 +18,8 @@
* Copyright 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
@@ -41,6 +42,7 @@ typedef struct {
char *hw_address;
gboolean carrier;
+ NMDevice *parent;
guint vlan_id;
} NMDeviceVlanPrivate;
@@ -48,6 +50,7 @@ enum {
PROP_0,
PROP_HW_ADDRESS,
PROP_CARRIER,
+ PROP_PARENT,
PROP_VLAN_ID,
LAST_PROP
@@ -131,6 +134,23 @@ nm_device_vlan_get_carrier (NMDeviceVlan *device)
}
/**
+ * nm_device_vlan_get_parent:
+ * @device: a #NMDeviceVlan
+ *
+ * Returns: (transfer none): the device's parent device
+ *
+ * Since: 1.0
+ **/
+NMDevice *
+nm_device_vlan_get_parent (NMDeviceVlan *device)
+{
+ g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE);
+
+ _nm_object_ensure_inited (NM_OBJECT (device));
+ return NM_DEVICE_VLAN_GET_PRIVATE (device)->parent;
+}
+
+/**
* nm_device_vlan_get_vlan_id:
* @device: a #NMDeviceVlan
*
@@ -230,6 +250,7 @@ register_properties (NMDeviceVlan *device)
const NMPropertiesInfo property_info[] = {
{ NM_DEVICE_VLAN_HW_ADDRESS, &priv->hw_address },
{ NM_DEVICE_VLAN_CARRIER, &priv->carrier },
+ { NM_DEVICE_VLAN_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE },
{ NM_DEVICE_VLAN_VLAN_ID, &priv->vlan_id },
{ NULL },
};
@@ -255,6 +276,7 @@ dispose (GObject *object)
{
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
+ g_clear_object (&priv->parent);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_vlan_parent_class)->dispose (object);
@@ -287,6 +309,9 @@ get_property (GObject *object,
case PROP_CARRIER:
g_value_set_boolean (value, nm_device_vlan_get_carrier (device));
break;
+ case PROP_PARENT:
+ g_value_set_object (value, nm_device_vlan_get_parent (device));
+ break;
case PROP_VLAN_ID:
g_value_set_uint (value, nm_device_vlan_get_vlan_id (device));
break;
@@ -340,6 +365,20 @@ nm_device_vlan_class_init (NMDeviceVlanClass *vlan_class)
G_PARAM_STATIC_STRINGS));
/**
+ * NMDeviceVlan:parent:
+ *
+ * The devices's parent device.
+ *
+ * Since: 1.0
+ **/
+ g_object_class_install_property
+ (object_class, PROP_PARENT,
+ g_param_spec_object (NM_DEVICE_VLAN_PARENT, "", "",
+ NM_TYPE_DEVICE,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
* NMDeviceVlan:vlan-id:
*
* The device's VLAN ID.
diff --git a/libnm-glib/nm-device-vlan.h b/libnm-glib/nm-device-vlan.h
index 511d02215b..107cfea88f 100644
--- a/libnm-glib/nm-device-vlan.h
+++ b/libnm-glib/nm-device-vlan.h
@@ -15,7 +15,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2012 Red Hat, Inc.
+ * Copyright 2012 - 2014 Red Hat, Inc.
*/
#ifndef NM_DEVICE_VLAN_H
@@ -55,6 +55,7 @@ GQuark nm_device_vlan_error_quark (void);
#define NM_DEVICE_VLAN_HW_ADDRESS "hw-address"
#define NM_DEVICE_VLAN_CARRIER "carrier"
+#define NM_DEVICE_VLAN_PARENT "parent"
#define NM_DEVICE_VLAN_VLAN_ID "vlan-id"
typedef struct {
@@ -79,6 +80,8 @@ GObject *nm_device_vlan_new (DBusGConnection *connection, const char *path);
const char * nm_device_vlan_get_hw_address (NMDeviceVlan *device);
gboolean nm_device_vlan_get_carrier (NMDeviceVlan *device);
+NM_AVAILABLE_IN_1_0
+NMDevice * nm_device_vlan_get_parent (NMDeviceVlan *device);
guint nm_device_vlan_get_vlan_id (NMDeviceVlan *device);
G_END_DECLS
diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c
index a4c108fb08..28609c79df 100644
--- a/libnm-glib/nm-device-wifi.c
+++ b/libnm-glib/nm-device-wifi.c
@@ -19,7 +19,8 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-device-wimax.c b/libnm-glib/nm-device-wimax.c
index 8fac2a5ac7..f0187fdc17 100644
--- a/libnm-glib/nm-device-wimax.c
+++ b/libnm-glib/nm-device-wimax.c
@@ -19,7 +19,8 @@
* Copyright 2009 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index 64b5dd1861..bd5d16374e 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -19,9 +19,11 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gudev/gudev.h>
#include "NetworkManager.h"
@@ -1757,8 +1759,7 @@ get_short_vendor (NMDevice *device)
* nm_device_get_description:
* @device: an #NMDevice
*
- * Gets a description of @device, incorporating the results of
- * nm_device_get_short_vendor() and nm_device_get_short_product().
+ * Gets a description of @device, based on its vendor and product names.
*
* Returns: a description of @device. If either the vendor or the
* product name is unknown, this returns the interface name.
diff --git a/libnm-glib/nm-dhcp4-config.c b/libnm-glib/nm-dhcp4-config.c
index 4fccee9034..5847937426 100644
--- a/libnm-glib/nm-dhcp4-config.c
+++ b/libnm-glib/nm-dhcp4-config.c
@@ -19,6 +19,8 @@
* Copyright 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "nm-dhcp4-config.h"
diff --git a/libnm-glib/nm-dhcp6-config.c b/libnm-glib/nm-dhcp6-config.c
index 32cc3b4755..e55c14166e 100644
--- a/libnm-glib/nm-dhcp6-config.c
+++ b/libnm-glib/nm-dhcp6-config.c
@@ -19,6 +19,8 @@
* Copyright 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "nm-dhcp6-config.h"
diff --git a/libnm-glib/nm-ip4-config.c b/libnm-glib/nm-ip4-config.c
index 3ac75254cf..ffaef74163 100644
--- a/libnm-glib/nm-ip4-config.c
+++ b/libnm-glib/nm-ip4-config.c
@@ -19,6 +19,8 @@
* Copyright 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <nm-setting-ip4-config.h>
diff --git a/libnm-glib/nm-ip6-config.c b/libnm-glib/nm-ip6-config.c
index 21156090bd..d44056a1cf 100644
--- a/libnm-glib/nm-ip6-config.c
+++ b/libnm-glib/nm-ip6-config.c
@@ -19,6 +19,8 @@
* Copyright 2008 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <nm-setting-ip6-config.h>
diff --git a/libnm-glib/nm-object-cache.c b/libnm-glib/nm-object-cache.c
index fe388803e7..752c606a93 100644
--- a/libnm-glib/nm-object-cache.c
+++ b/libnm-glib/nm-object-cache.c
@@ -18,6 +18,8 @@
* Copyright 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
#include "nm-object-cache.h"
diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c
index 3550677df6..fb25c1ac40 100644
--- a/libnm-glib/nm-object.c
+++ b/libnm-glib/nm-object.c
@@ -19,6 +19,8 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gio/gio.h>
#include <stdlib.h>
diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c
index e3050b0169..3a70e81ed4 100644
--- a/libnm-glib/nm-remote-connection.c
+++ b/libnm-glib/nm-remote-connection.c
@@ -19,9 +19,11 @@
* Copyright 2007 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gio/gio.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <NetworkManager.h>
#include <nm-utils.h>
diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c
index d9c65d773f..d5f4ca67f0 100644
--- a/libnm-glib/nm-remote-settings.c
+++ b/libnm-glib/nm-remote-settings.c
@@ -19,6 +19,8 @@
* Copyright 2009 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <NetworkManager.h>
#include <nm-connection.h>
@@ -509,6 +511,8 @@ connection_inited (GObject *source, GAsyncResult *result, gpointer user_data)
priv->init_left--;
if (priv->init_left == 0)
g_signal_emit (self, signals[CONNECTIONS_READ], 0);
+
+ g_object_unref (self);
}
static NMRemoteConnection *
@@ -531,7 +535,7 @@ new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data)
if (connection) {
g_async_initable_init_async (G_ASYNC_INITABLE (connection),
G_PRIORITY_DEFAULT, NULL,
- connection_inited, self);
+ connection_inited, g_object_ref (self));
/* Add the connection to the pending table to wait for it to retrieve
* it's settings asynchronously over D-Bus. The connection isn't
diff --git a/libnm-glib/nm-secret-agent.c b/libnm-glib/nm-secret-agent.c
index 9627d7311d..04f8dd8b1f 100644
--- a/libnm-glib/nm-secret-agent.c
+++ b/libnm-glib/nm-secret-agent.c
@@ -18,7 +18,8 @@
* Copyright 2010 - 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <dbus/dbus-glib-lowlevel.h>
diff --git a/libnm-glib/nm-secret-agent.h b/libnm-glib/nm-secret-agent.h
index f593b3e648..b7df874531 100644
--- a/libnm-glib/nm-secret-agent.h
+++ b/libnm-glib/nm-secret-agent.h
@@ -59,7 +59,7 @@ typedef enum {
* NMSecretAgentCapabilities:
* @NM_SECRET_AGENT_CAPABILITY_NONE: the agent supports no special capabilities
* @NM_SECRET_AGENT_CAPABILITY_VPN_HINTS: the agent supports sending hints given
- * by the NMSecretAgentClass::get_secrets() class method to VPN plugin
+ * by the <literal>get_secrets</literal> class method to VPN plugin
* authentication dialogs.
* @NM_SECRET_AGENT_CAPABILITY_LAST: bounds checking value; should not be used.
*
diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c
index cb0ff8ba6c..5b434aa97b 100644
--- a/libnm-glib/nm-types.c
+++ b/libnm-glib/nm-types.c
@@ -18,6 +18,8 @@
* Copyright 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <dbus/dbus-glib.h>
#include <string.h>
diff --git a/libnm-glib/nm-vpn-connection.c b/libnm-glib/nm-vpn-connection.c
index 689f58fd8d..16e8db5e94 100644
--- a/libnm-glib/nm-vpn-connection.c
+++ b/libnm-glib/nm-vpn-connection.c
@@ -19,6 +19,8 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "nm-vpn-connection.h"
#include "NetworkManager.h"
diff --git a/libnm-glib/nm-vpn-plugin-ui-interface.c b/libnm-glib/nm-vpn-plugin-ui-interface.c
index a4a10836e8..b94084e2b6 100644
--- a/libnm-glib/nm-vpn-plugin-ui-interface.c
+++ b/libnm-glib/nm-vpn-plugin-ui-interface.c
@@ -19,6 +19,8 @@
* Copyright 2008 Novell, Inc.
*/
+#include "config.h"
+
#include "nm-vpn-plugin-ui-interface.h"
static void
diff --git a/libnm-glib/nm-vpn-plugin-utils.c b/libnm-glib/nm-vpn-plugin-utils.c
index 0e800e9c16..9aafb19f07 100644
--- a/libnm-glib/nm-vpn-plugin-utils.c
+++ b/libnm-glib/nm-vpn-plugin-utils.c
@@ -18,6 +18,8 @@
* Copyright 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/libnm-glib/nm-vpn-plugin.c b/libnm-glib/nm-vpn-plugin.c
index 08fb647ada..7848c131c4 100644
--- a/libnm-glib/nm-vpn-plugin.c
+++ b/libnm-glib/nm-vpn-plugin.c
@@ -19,6 +19,8 @@
* Copyright 2007 - 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <signal.h>
#include "nm-glib-compat.h"
#include "nm-vpn-plugin.h"
diff --git a/libnm-glib/nm-wimax-nsp.c b/libnm-glib/nm-wimax-nsp.c
index 1cbd3eefd0..1735ab3eec 100644
--- a/libnm-glib/nm-wimax-nsp.c
+++ b/libnm-glib/nm-wimax-nsp.c
@@ -18,7 +18,8 @@
* Copyright 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include "nm-glib-compat.h"
diff --git a/libnm-glib/nm-wimax-nsp.h b/libnm-glib/nm-wimax-nsp.h
index e0cfe1e895..74008d18e0 100644
--- a/libnm-glib/nm-wimax-nsp.h
+++ b/libnm-glib/nm-wimax-nsp.h
@@ -40,6 +40,15 @@ G_BEGIN_DECLS
#define NM_WIMAX_NSP_SIGNAL_QUALITY "signal-quality"
#define NM_WIMAX_NSP_NETWORK_TYPE "network-type"
+/**
+ * NMWimaxNspNetworkType:
+ * @NM_WIMAX_NSP_NETWORK_TYPE_UNKNOWN: unknown network type
+ * @NM_WIMAX_NSP_NETWORK_TYPE_HOME: home network
+ * @NM_WIMAX_NSP_NETWORK_TYPE_PARTNER: partner network
+ * @NM_WIMAX_NSP_NETWORK_TYPE_ROAMING_PARTNER: roaming partner network
+ *
+ * WiMAX network type.
+ */
typedef enum {
NM_WIMAX_NSP_NETWORK_TYPE_UNKNOWN = 0,
NM_WIMAX_NSP_NETWORK_TYPE_HOME = 1,
diff --git a/libnm-glib/tests/Makefile.am b/libnm-glib/tests/Makefile.am
index 7b8f3627e2..cea3b79a74 100644
--- a/libnm-glib/tests/Makefile.am
+++ b/libnm-glib/tests/Makefile.am
@@ -12,6 +12,11 @@ AM_CPPFLAGS = \
noinst_PROGRAMS = $(TESTS)
+if WITH_VALGRIND
+@VALGRIND_RULES@ --launch-dbus
+else
+TESTS_ENVIRONMENT = $(srcdir)/libnm-glib-test-launch.sh
+endif
TESTS = test-nm-client test-remote-settings-client
####### NMClient and non-settings tests #######
@@ -42,8 +47,6 @@ test_remote_settings_client_LDADD = \
###########################################
-TESTS_ENVIRONMENT = $(srcdir)/libnm-glib-test-launch.sh
-
endif
EXTRA_DIST = libnm-glib-test-launch.sh
diff --git a/libnm-glib/tests/common.c b/libnm-glib/tests/common.c
index 0dbdac54c2..540d43afa6 100644
--- a/libnm-glib/tests/common.c
+++ b/libnm-glib/tests/common.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <dbus/dbus.h>
#include <glib.h>
#include <string.h>
diff --git a/libnm-glib/tests/test-nm-client.c b/libnm-glib/tests/test-nm-client.c
index eebf8358c7..af3722eba4 100644
--- a/libnm-glib/tests/test-nm-client.c
+++ b/libnm-glib/tests/test-nm-client.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
@@ -46,6 +48,7 @@ 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);
@@ -58,8 +61,9 @@ test_client_new (void)
dbus_g_connection_unref (bus);
- g_initable_init (G_INITABLE (client), NULL, &error);
+ success = g_initable_init (G_INITABLE (client), NULL, &error);
g_assert_no_error (error);
+ g_assert (success == TRUE);
return client;
}
diff --git a/libnm-glib/tests/test-remote-settings-client.c b/libnm-glib/tests/test-remote-settings-client.c
index 987845c1bb..a109f8df4a 100644
--- a/libnm-glib/tests/test-remote-settings-client.c
+++ b/libnm-glib/tests/test-remote-settings-client.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
@@ -34,6 +36,7 @@
#include "nm-remote-settings.h"
#include "common.h"
+#include "gsystem-local-alloc.h"
static NMTestServiceInfo *sinfo;
static NMRemoteSettings *settings = NULL;
@@ -61,7 +64,7 @@ add_cb (NMRemoteSettings *s,
static void
test_add_connection (void)
{
- NMConnection *connection;
+ gs_unref_object NMConnection *connection = NULL;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
char *uuid;
@@ -254,6 +257,7 @@ test_make_visible (void)
break;
}
}
+ g_slist_free (list);
g_assert (found == TRUE);
g_free (path);
@@ -296,6 +300,7 @@ test_remove_connection (void)
g_assert_cmpint (g_slist_length (list), >, 0);
connection = NM_REMOTE_CONNECTION (list->data);
+ g_slist_free (list);
g_assert (connection);
g_assert (remote == connection);
path = g_strdup (nm_connection_get_path (NM_CONNECTION (connection)));
@@ -327,6 +332,7 @@ test_remove_connection (void)
g_assert ((gpointer) connection != (gpointer) candidate);
g_assert_cmpstr (path, ==, nm_connection_get_path (candidate));
}
+ g_slist_free (list);
g_free (path);
g_object_unref (proxy);
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 88915bf0c7..3fdc79e507 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
-I${top_srcdir} \
-I${top_srcdir}/include \
-DG_LOG_DOMAIN=\""libnm-util"\" \
+ -DLOCALEDIR=\"$(datadir)/locale\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
@@ -114,7 +115,7 @@ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS)
SYMBOL_VIS_FILE=$(srcdir)/libnm-util.ver
libnm_util_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \
- -version-info "8:0:6"
+ -version-info "9:0:7"
if WITH_GNUTLS
libnm_util_la_SOURCES += crypto_gnutls.c
@@ -186,28 +187,6 @@ CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
-if BUILD_SETTING_DOCS
-
-noinst_DATA = nm-setting-docs.xml nm-keyfile-docs.xml nm-ifcfg-rh-docs.xml
-
-nm-setting-docs.xml: generate-setting-docs.py NetworkManager-1.0.gir NetworkManager-1.0.typelib libnm-util.la
- export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \
- export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \
- $(srcdir)/generate-setting-docs.py \
- --gir $(builddir)/NetworkManager-1.0.gir \
- --output $@
-
-nm-keyfile-docs.xml: generate-plugin-docs.pl $(libnm_util_la_csources)
- $(srcdir)/generate-plugin-docs.pl keyfile $(srcdir) $@
-nm-ifcfg-rh-docs.xml: generate-plugin-docs.pl $(libnm_util_la_csources)
- $(srcdir)/generate-plugin-docs.pl ifcfg-rh $(srcdir) $@
-
-endif
-
-DISTCLEANFILES += nm-setting-docs.xml nm-keyfile-docs.xml nm-ifcfg-rh-docs.xml
-
-EXTRA_DIST += generate-setting-docs.py generate-plugin-docs.pl
-
if ENABLE_TESTS
check-local:
diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c
index d5f7608d6e..8a10af9453 100644
--- a/libnm-util/crypto.c
+++ b/libnm-util/crypto.c
@@ -28,7 +28,7 @@
#include <strings.h>
#include <unistd.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "crypto.h"
diff --git a/libnm-util/crypto.h b/libnm-util/crypto.h
index edb79007f1..315d8fec83 100644
--- a/libnm-util/crypto.h
+++ b/libnm-util/crypto.h
@@ -70,8 +70,6 @@ GQuark _nm_crypto_error_quark (void);
gboolean crypto_init (GError **error);
-void crypto_deinit (void);
-
GByteArray *crypto_decrypt_private_key_data (const GByteArray *contents,
const char *password,
NMCryptoKeyType *out_key_type,
diff --git a/libnm-util/crypto_gnutls.c b/libnm-util/crypto_gnutls.c
index be16d135af..3bec24ad67 100644
--- a/libnm-util/crypto_gnutls.c
+++ b/libnm-util/crypto_gnutls.c
@@ -22,8 +22,9 @@
*/
#include "config.h"
+
#include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gcrypt.h>
#include <gnutls/gnutls.h>
@@ -55,11 +56,6 @@ crypto_init (GError **error)
return TRUE;
}
-void
-crypto_deinit (void)
-{
-}
-
gboolean
crypto_md5_hash (const char *salt,
const gsize salt_len,
diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c
index 1e589ea709..edd19b54fe 100644
--- a/libnm-util/crypto_nss.c
+++ b/libnm-util/crypto_nss.c
@@ -24,7 +24,7 @@
#include "config.h"
#include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <prinit.h>
#include <nss.h>
@@ -71,11 +71,6 @@ crypto_init (GError **error)
return TRUE;
}
-void
-crypto_deinit (void)
-{
-}
-
gboolean
crypto_md5_hash (const char *salt,
const gsize salt_len,
diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver
index c6fc0d7f69..ae34142073 100644
--- a/libnm-util/libnm-util.ver
+++ b/libnm-util/libnm-util.ver
@@ -367,6 +367,7 @@ global:
nm_setting_ip4_config_get_num_dns_searches;
nm_setting_ip4_config_get_num_routes;
nm_setting_ip4_config_get_route;
+ nm_setting_ip4_config_get_route_metric;
nm_setting_ip4_config_get_type;
nm_setting_ip4_config_new;
nm_setting_ip4_config_remove_address;
@@ -402,6 +403,7 @@ global:
nm_setting_ip6_config_get_num_dns_searches;
nm_setting_ip6_config_get_num_routes;
nm_setting_ip6_config_get_route;
+ nm_setting_ip6_config_get_route_metric;
nm_setting_ip6_config_get_type;
nm_setting_ip6_config_new;
nm_setting_ip6_config_privacy_get_type;
@@ -560,6 +562,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;
@@ -610,6 +613,7 @@ global:
nm_utils_deinit;
nm_utils_escape_ssid;
nm_utils_file_is_pkcs12;
+ nm_utils_file_search_in_paths;
nm_utils_get_private;
nm_utils_gvalue_hash_dup;
nm_utils_hex2byte;
diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c
index e59f8f50a6..3a929b045f 100644
--- a/libnm-util/nm-connection.c
+++ b/libnm-util/nm-connection.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <glib-object.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <dbus/dbus-glib.h>
#include <string.h>
#include "nm-connection.h"
@@ -1239,7 +1241,7 @@ nm_connection_to_hash (NMConnection *connection, NMSettingHashFlags flags)
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
ret = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, (GDestroyNotify) g_hash_table_destroy);
+ g_free, (GDestroyNotify) g_hash_table_unref);
priv = NM_CONNECTION_GET_PRIVATE (connection);
diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c
index 2b4ca230a0..acb8aec335 100644
--- a/libnm-util/nm-param-spec-specialized.c
+++ b/libnm-util/nm-param-spec-specialized.c
@@ -20,6 +20,8 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include "nm-param-spec-specialized.h"
#include "nm-glib-compat.h"
diff --git a/libnm-util/nm-setting-8021x.c b/libnm-util/nm-setting-8021x.c
index 0f7f6bd56b..1dc768c210 100644
--- a/libnm-util/nm-setting-8021x.c
+++ b/libnm-util/nm-setting-8021x.c
@@ -20,9 +20,11 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-8021x.h"
#include "nm-param-spec-specialized.h"
@@ -31,6 +33,7 @@
#include "crypto.h"
#include "nm-utils-private.h"
#include "nm-setting-private.h"
+#include "nm-utils-internal.h"
/**
* SECTION:nm-setting-8021x
@@ -428,13 +431,52 @@ get_cert_scheme (GByteArray *array)
if (!array || !array->len)
return NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
- if ( (array->len > strlen (SCHEME_PATH))
- && !memcmp (array->data, SCHEME_PATH, strlen (SCHEME_PATH)))
- return NM_SETTING_802_1X_CK_SCHEME_PATH;
+ /* interpret the blob as PATH if it starts with "file://". */
+ if ( array->len >= STRLEN (SCHEME_PATH)
+ && !memcmp (array->data, SCHEME_PATH, STRLEN (SCHEME_PATH))) {
+ /* But it must also be NUL terminated, contain at least
+ * one non-NUL character, and contain only one trailing NUL
+ * chracter.
+ * And ensure it's UTF-8 valid too so we can pass it through
+ * D-Bus and stuff like that. */
+ if ( array->len > STRLEN (SCHEME_PATH) + 1
+ && array->data[array->len - 1] == '\0'
+ && g_utf8_validate ((const char *) &array->data[STRLEN (SCHEME_PATH)], array->len - (STRLEN (SCHEME_PATH) + 1), NULL))
+ return NM_SETTING_802_1X_CK_SCHEME_PATH;
+ return NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
+ }
return NM_SETTING_802_1X_CK_SCHEME_BLOB;
}
+static GByteArray *
+load_and_verify_certificate (const char *cert_path,
+ NMSetting8021xCKScheme scheme,
+ NMCryptoFileFormat *out_file_format,
+ GError **error)
+{
+ NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ GByteArray *array;
+
+ array = crypto_load_and_verify_certificate (cert_path, &format, error);
+
+ if (!array || !array->len || format == NM_CRYPTO_FILE_FORMAT_UNKNOWN)
+ format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ else if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) {
+ /* If we load the file as blob, we must ensure that the binary data does not
+ * start with file://. NMSetting8021x cannot represent blobs that start with
+ * file://.
+ * If that's the case, coerce the format to UNKNOWN. The callers will take care
+ * of that and not set the blob. */
+ if (get_cert_scheme (array) != NM_SETTING_802_1X_CK_SCHEME_BLOB)
+ format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
+ }
+
+ if (out_file_format)
+ *out_file_format = format;
+ return array;
+}
+
/**
* nm_setting_802_1x_get_ca_cert_scheme:
* @setting: the #NMSetting8021x
@@ -509,14 +551,16 @@ static GByteArray *
path_to_scheme_value (const char *path)
{
GByteArray *array;
+ gsize len;
+
+ g_return_val_if_fail (path != NULL && path[0], NULL);
- g_return_val_if_fail (path != NULL, NULL);
+ len = strlen (path);
- /* Add the path scheme tag to the front, then the fielname */
- array = g_byte_array_sized_new (strlen (path) + strlen (SCHEME_PATH) + 1);
- g_assert (array);
+ /* Add the path scheme tag to the front, then the filename */
+ array = g_byte_array_sized_new (len + strlen (SCHEME_PATH) + 1);
g_byte_array_append (array, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH));
- g_byte_array_append (array, (const guint8 *) path, strlen (path));
+ g_byte_array_append (array, (const guint8 *) path, len);
g_byte_array_append (array, (const guint8 *) "\0", 1);
return array;
}
@@ -576,7 +620,7 @@ nm_setting_802_1x_set_ca_cert (NMSetting8021x *setting,
return TRUE;
}
- data = crypto_load_and_verify_certificate (cert_path, &format, error);
+ data = load_and_verify_certificate (cert_path, scheme, &format, error);
if (data) {
/* wpa_supplicant can only use raw x509 CA certs */
if (format == NM_CRYPTO_FILE_FORMAT_X509) {
@@ -838,7 +882,7 @@ nm_setting_802_1x_get_client_cert_path (NMSetting8021x *setting)
* @setting: the #NMSetting8021x
* @cert_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH
* or %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the client
- * certificate file (PEM, DER, or PKCS#12 format). The path must be UTF-8
+ * certificate file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8
* encoded; use g_filename_to_utf8() to convert if needed. Passing %NULL with
* any @scheme clears the client certificate.
* @scheme: desired storage scheme for the certificate
@@ -892,7 +936,7 @@ nm_setting_802_1x_set_client_cert (NMSetting8021x *setting,
return TRUE;
}
- data = crypto_load_and_verify_certificate (cert_path, &format, error);
+ data = load_and_verify_certificate (cert_path, scheme, &format, error);
if (data) {
gboolean valid = FALSE;
@@ -1157,7 +1201,7 @@ nm_setting_802_1x_set_phase2_ca_cert (NMSetting8021x *setting,
return TRUE;
}
- data = crypto_load_and_verify_certificate (cert_path, &format, error);
+ data = load_and_verify_certificate (cert_path, scheme, &format, error);
if (data) {
/* wpa_supplicant can only use raw x509 CA certs */
if (format == NM_CRYPTO_FILE_FORMAT_X509) {
@@ -1423,7 +1467,7 @@ nm_setting_802_1x_get_phase2_client_cert_path (NMSetting8021x *setting)
* @setting: the #NMSetting8021x
* @cert_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH
* or %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the "phase2" client
- * certificate file (PEM, DER, or PKCS#12 format). The path must be UTF-8
+ * certificate file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8
* encoded; use g_filename_to_utf8() to convert if needed. Passing %NULL with
* any @scheme clears the "phase2" client certificate.
* @scheme: desired storage scheme for the certificate
@@ -1477,7 +1521,7 @@ nm_setting_802_1x_set_phase2_client_cert (NMSetting8021x *setting,
return TRUE;
}
- data = crypto_load_and_verify_certificate (cert_path, &format, error);
+ data = load_and_verify_certificate (cert_path, scheme, &format, error);
if (data) {
gboolean valid = FALSE;
@@ -1698,7 +1742,7 @@ file_to_byte_array (const char *filename)
* @setting: the #NMSetting8021x
* @key_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH or
* %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the private key file
- * (PEM, DER, or PKCS#12 format). The path must be UTF-8 encoded; use
+ * (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8 encoded; use
* g_filename_to_utf8() to convert if needed. Passing %NULL with any @scheme
* clears the private key.
* @password: password used to decrypt the private key, or %NULL if the password
@@ -2009,7 +2053,7 @@ nm_setting_802_1x_get_phase2_private_key_path (NMSetting8021x *setting)
* @setting: the #NMSetting8021x
* @key_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH or
* %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the "phase2" private
- * key file (PEM, DER, or PKCS#12 format). The path must be UTF-8 encoded;
+ * key file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8 encoded;
* use g_filename_to_utf8() to convert if needed. Passing %NULL with any
* @scheme clears the private key.
* @password: password used to decrypt the private key, or %NULL if the password
@@ -2602,26 +2646,10 @@ need_secrets (NMSetting *setting)
static gboolean
verify_cert (GByteArray *array, const char *prop_name, GError **error)
{
- if (!array)
+ if ( !array
+ || get_cert_scheme (array) != NM_SETTING_802_1X_CK_SCHEME_UNKNOWN)
return TRUE;
- switch (get_cert_scheme (array)) {
- case NM_SETTING_802_1X_CK_SCHEME_BLOB:
- return TRUE;
- case NM_SETTING_802_1X_CK_SCHEME_PATH:
- /* For path-based schemes, verify that the path is zero-terminated */
- if (array->data[array->len - 1] == '\0') {
- /* And ensure it's UTF-8 valid too so we can pass it through
- * D-Bus and stuff like that.
- */
- if (g_utf8_validate ((const char *) (array->data + strlen (SCHEME_PATH)), -1, NULL))
- return TRUE;
- }
- break;
- default:
- break;
- }
-
g_set_error_literal (error,
NM_SETTING_802_1X_ERROR,
NM_SETTING_802_1X_ERROR_INVALID_PROPERTY,
@@ -3143,15 +3171,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* properties of this setting; refer to wpa_supplicant documentation for the
* allowed combinations.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: eap
- * variable: IEEE_8021X_EAP_METHODS(+)
- * values: "LEAP", "PWD", "TLS", "PEAP", "TTLS", "FAST"
- * description: EAP method for 802.1X authentication.
- * example: IEEE_8021X_EAP_METHODS=PEAP
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_EAP,
_nm_param_spec_specialized (NM_SETTING_802_1X_EAP, "", "",
@@ -3165,14 +3184,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Identity string for EAP authentication methods. Often the user's user or
* login name.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: identity
- * variable: IEEE_8021X_IDENTITY(+)
- * description: Identity for EAP authentication methods.
- * example: IEEE_8021X_IDENTITY=itsme
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_IDENTITY,
g_param_spec_string (NM_SETTING_802_1X_IDENTITY, "", "",
@@ -3187,13 +3198,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* unencrypted identity with EAP types that support different tunneled
* identity like EAP-TTLS.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: anonymous-identity
- * variable: IEEE_8021X_ANON_IDENTITY(+)
- * description: Anonymous identity for EAP authentication methods.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ANONYMOUS_IDENTITY,
g_param_spec_string (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, "", "",
@@ -3206,14 +3210,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* UTF-8 encoded file path containing PAC for EAP-FAST.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: pac-file
- * variable: IEEE_8021X_PAC_FILE(+)
- * description: File with PAC (Protected Access Credential) for EAP-FAST.
- * example: IEEE_8021X_PAC_FILE=/home/joe/my-fast.pac
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PAC_FILE,
g_param_spec_string (NM_SETTING_802_1X_PAC_FILE, "", "",
@@ -3239,14 +3235,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_ca_cert() function instead.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ca-cert
- * variable: IEEE_8021X_CA_CERT(+)
- * description: CA certificate for EAP.
- * example: IEEE_8021X_CA_CERT=/home/joe/cacert.crt
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_CA_CERT,
_nm_param_spec_specialized (NM_SETTING_802_1X_CA_CERT, "", "",
@@ -3261,13 +3249,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* certificates to be added to the verification chain in addition to the
* certificate specified in the #NMSetting8021x:ca-cert property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ca-path
- * variable: (none)
- * description: The property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_CA_PATH,
g_param_spec_string (NM_SETTING_802_1X_CA_PATH, "", "",
@@ -3282,14 +3263,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* by the authentication server. When unset, no verification of the
* authentication server certificate's subject is performed.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: subject-match
- * variable: IEEE_8021X_SUBJECT_MATCH(+)
- * description: Substring to match subject of server certificate against.
- * example: IEEE_8021X_SUBJECT_MATCH="Red Hat"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SUBJECT_MATCH,
g_param_spec_string (NM_SETTING_802_1X_SUBJECT_MATCH, "", "",
@@ -3304,14 +3277,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* certificate presented by the authentication server. If the list is empty,
* no verification of the server certificate's altSubjectName is performed.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: altubject-matches
- * variable: IEEE_8021X_AlTSUBJECT_MATCHES(+)
- * description: List of strings to be matched against the altSubjectName.
- * example: IEEE_8021X_ALTSUBJECT_MATCHES="s1.domain.cc"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ALTSUBJECT_MATCHES,
_nm_param_spec_specialized (NM_SETTING_802_1X_ALTSUBJECT_MATCHES, "", "",
@@ -3335,14 +3300,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_client_cert() function instead.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: client-cert
- * variable: IEEE_8021X_CLIENT_CERT(+)
- * description: Client certificate for EAP.
- * example: IEEE_8021X_CLIENT_CERT=/home/joe/mycert.crt
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_CLIENT_CERT,
_nm_param_spec_specialized (NM_SETTING_802_1X_CLIENT_CERT, "", "",
@@ -3360,14 +3317,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* so, this property may be set to "0" or "1" to force that specific PEAP
* version.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase1-peapver
- * variable: IEEE_8021X_PEAP_VERSION(+)
- * values: 0, 1
- * description: Use to force a specific PEAP version.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE1_PEAPVER,
g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPVER, "", "",
@@ -3383,15 +3332,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* PEAPv1. Set to "1" to force use of the new PEAP label. See the
* wpa_supplicant documentation for more details.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase1-peaplabel
- * variable: IEEE_8021X_PEAP_FORCE_NEW_LABEL(+)
- * values: yes, no
- * default: no
- * description: Use to force the new PEAP label during key derivation.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE1_PEAPLABEL,
g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPLABEL, "", "",
@@ -3409,15 +3349,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* both authenticated and unauthenticated provisioning). See the
* wpa_supplicant documentation for more details.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase1-fast-provisioning
- * variable: IEEE_8021X_FAST_PROVISIONING(+)
- * values: space-separated list of these values [allow-auth, allow-unauth]
- * description: Enable in-line provisioning of EAP-FAST credentials.
- * example: IEEE_8021X_FAST_PROVISIONING="allow-auth allow-unauth"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE1_FAST_PROVISIONING,
g_param_spec_string (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, "", "",
@@ -3435,16 +3366,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Each "phase 2" inner method requires specific parameters for successful
* authentication; see the wpa_supplicant documentation for more details.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase2-auth
- * variable: IEEE_8021X_INNER_AUTH_METHODS(+)
- * values: "PAP", "CHAP", "MSCHAP", "MSCHAPV2", "GTC", "OTP", "MD5" and "TLS"
- * description: Inner non-EAP authentication methods. IEEE_8021X_INNER_AUTH_METHODS
- * can contain values both for 'phase2-auth' and 'phase2-autheap' properties.
- * example: IEEE_8021X_INNER_AUTH_METHODS=PAP
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE2_AUTH,
g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTH, "", "",
@@ -3462,16 +3383,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* requires specific parameters for successful authentication; see the
* wpa_supplicant documentation for more details.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase2-autheap
- * variable: IEEE_8021X_INNER_AUTH_METHODS(+)
- * values: "EAP-MD5", "EAP-MSCHAPV2", "EAP-GTC", "EAP-OTP" and "EAP-TLS"
- * description: Inner EAP-based authentication methods. Note that
- * IEEE_8021X_INNER_AUTH_METHODS is also used for 'phase2-auth' values.
- * example: IEEE_8021X_INNER_AUTH_METHODS="MSCHAPV2 EAP-TLS"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE2_AUTHEAP,
g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTHEAP, "", "",
@@ -3527,14 +3438,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* authentication. When unset, no verification of the authentication server
* certificate's subject is performed.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase2-subject-match
- * variable: IEEE_8021X_PHASE2_SUBJECT_MATCH(+)
- * description: Substring to match subject of server certificate against.
- * example: IEEE_8021X_PHASE2_SUBJECT_MATCH="Red Hat"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE2_SUBJECT_MATCH,
g_param_spec_string (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH, "", "",
@@ -3550,12 +3453,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* "phase 2" authentication. If the list is empty, no verification of the
* server certificate's altSubjectName is performed.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase2-altsubject-matches
- * variable: IEEE_8021X_PHASE2_ALTSUBJECT_MATCHES(+)
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE2_ALTSUBJECT_MATCHES,
_nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, "", "",
@@ -3582,14 +3479,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_phase2_client_cert() function instead.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase2-client-cert
- * variable: IEEE_8021X_INNER_CLIENT_CERT(+)
- * description: Client certificate for inner EAP method.
- * example: IEEE_8021X_INNER_CLIENT_CERT=/home/joe/mycert.crt
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE2_CLIENT_CERT,
_nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, "", "",
@@ -3604,14 +3493,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* #NMSetting8021x:password property and the #NMSetting8021x:password-raw
* property are specified, #NMSetting8021x:password is preferred.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: password
- * variable: IEEE_8021X_PASSWORD(+)
- * description: UTF-8 encoded password used for EAP. It can also go to "key-"
- * lookaside file, or it can be owned by a secret agent.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PASSWORD,
g_param_spec_string (NM_SETTING_802_1X_PASSWORD, "", "",
@@ -3625,13 +3506,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* Flags indicating how to handle the #NMSetting8021x:password property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: password-flags
- * variable: IEEE_8021X_PASSWORD_FLAGS(+)
- * description: Password flags for IEEE_8021X_PASSWORD password.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PASSWORD_FLAGS,
g_param_spec_uint (NM_SETTING_802_1X_PASSWORD_FLAGS, "", "",
@@ -3649,13 +3523,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* #NMSetting8021x:password property and the #NMSetting8021x:password-raw
* property are specified, #NMSetting8021x:password is preferred.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: password-raw
- * variable: (none)
- * description: The property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PASSWORD_RAW,
_nm_param_spec_specialized (NM_SETTING_802_1X_PASSWORD_RAW, "", "",
@@ -3669,13 +3536,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* Flags indicating how to handle the #NMSetting8021x:password-raw property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: password-raw-flags
- * variable: (none)
- * description: The property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PASSWORD_RAW_FLAGS,
g_param_spec_uint (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS, "", "",
@@ -3696,15 +3556,15 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* should be set to the key's encrypted PEM encoded data. When using private
* keys with the path scheme, this property should be set to the full UTF-8
* encoded path of the key, prefixed with the string "file://" and ending
- * with a terminating NUL byte. When using PKCS#12 format private keys and
- * the blob scheme, this property should be set to the PKCS#12 data and the
+ * with a terminating NUL byte. When using PKCS#<!-- -->12 format private keys and
+ * the blob scheme, this property should be set to the PKCS#<!-- -->12 data and the
* #NMSetting8021x:private-key-password property must be set to password
- * used to decrypt the PKCS#12 certificate and key. When using PKCS#12 files
+ * used to decrypt the PKCS#<!-- -->12 certificate and key. When using PKCS#<!-- -->12 files
* and the path scheme, this property should be set to the full UTF-8
* encoded path of the key, prefixed with the string "file://" and and
* ending with a terminating NUL byte, and as with the blob scheme the
* "private-key-password" property must be set to the password used to
- * decode the PKCS#12 private key and certificate.
+ * decode the PKCS#<!-- -->12 private key and certificate.
*
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_private_key() function instead.
@@ -3715,14 +3575,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* private key password to prevent unauthorized access to unencrypted
* private key data.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: private-key
- * variable: IEEE_8021X_PRIVATE_KEY(+)
- * description: Private key for EAP-TLS.
- * example: IEEE_8021X_PRIVATE_KEY=/home/joe/mykey.p12
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIVATE_KEY,
_nm_param_spec_specialized (NM_SETTING_802_1X_PRIVATE_KEY, "", "",
@@ -3735,19 +3587,11 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* The password used to decrypt the private key specified in the
* #NMSetting8021x:private-key property when the private key either uses the
- * path scheme, or if the private key is a PKCS#12 format key. Setting this
+ * path scheme, or if the private key is a PKCS#<!-- -->12 format key. Setting this
* property directly is not generally necessary except when returning
* secrets to NetworkManager; it is generally set automatically when setting
* the private key by the nm_setting_802_1x_set_private_key() function.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: private-key-password
- * variable: IEEE_8021X_PRIVATE_KEY_PASSWORD(+)
- * description: Password for IEEE_8021X_PRIVATE_KEY. It can also go to "key-"
- * lookaside file, or it can be owned by a secret agent.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIVATE_KEY_PASSWORD,
g_param_spec_string (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, "", "",
@@ -3762,13 +3606,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Flags indicating how to handle the #NMSetting8021x:private-key-password
* property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: private-key-password-flags
- * variable: IEEE_8021X_PRIVATE_KEY_PASSWORD_FLAGS(+)
- * description: Password flags for IEEE_8021X_PRIVATE_KEY_PASSWORD password.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIVATE_KEY_PASSWORD_FLAGS,
g_param_spec_uint (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS, "", "",
@@ -3790,26 +3627,19 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* should be set to the key's encrypted PEM encoded data. When using private
* keys with the path scheme, this property should be set to the full UTF-8
* encoded path of the key, prefixed with the string "file://" and ending
- * with a terminating NUL byte. When using PKCS#12 format private keys and
- * the blob scheme, this property should be set to the PKCS#12 data and the
+ * with a terminating NUL byte. When using PKCS#<!-- -->12 format private keys and
+ * the blob scheme, this property should be set to the PKCS#<!-- -->12 data and the
* #NMSetting8021x:phase2-private-key-password property must be set to
- * password used to decrypt the PKCS#12 certificate and key. When using
- * PKCS#12 files and the path scheme, this property should be set to the
+ * password used to decrypt the PKCS#<!-- -->12 certificate and key. When using
+ * PKCS#<!-- -->12 files and the path scheme, this property should be set to the
* full UTF-8 encoded path of the key, prefixed with the string "file://"
* and and ending with a terminating NUL byte, and as with the blob scheme
* the #NMSetting8021x:phase2-private-key-password property must be set to
- * the password used to decode the PKCS#12 private key and certificate.
+ * the password used to decode the PKCS#<!-- -->12 private key and certificate.
*
* Setting this property directly is discouraged; use the
* nm_setting_802_1x_set_phase2_private_key() function instead.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase2-private-key
- * variable: IEEE_8021X_INNER_PRIVATE_KEY(+)
- * description: Private key for inner authentication method for EAP-TLS.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE2_PRIVATE_KEY,
_nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, "", "",
@@ -3822,19 +3652,11 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* The password used to decrypt the "phase 2" private key specified in the
* #NMSetting8021x:phase2-private-key property when the private key either
- * uses the path scheme, or is a PKCS#12 format key. Setting this property
+ * uses the path scheme, or is a PKCS#<!-- -->12 format key. Setting this property
* directly is not generally necessary except when returning secrets to
* NetworkManager; it is generally set automatically when setting the
* private key by the nm_setting_802_1x_set_phase2_private_key() function.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase2-private-key-password
- * variable: IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD(+)
- * description: Password for IEEE_8021X_INNER_PRIVATE_KEY. It can also go to "key-"
- * lookaside file, or it can be owned by a secret agent.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE2_PRIVATE_KEY_PASSWORD,
g_param_spec_string (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, "", "",
@@ -3849,13 +3671,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* Flags indicating how to handle the
* #NMSetting8021x:phase2-private-key-password property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: phase2-private-key-password-flags
- * variable: IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD_FLAGS(+)
- * description: Password flags for IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD password.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS,
g_param_spec_uint (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS, "", "",
@@ -3870,13 +3685,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* PIN used for EAP authentication methods.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: pin
- * variable: (none)
- * description: The property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PIN,
g_param_spec_string (NM_SETTING_802_1X_PIN, "", "",
@@ -3890,13 +3698,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
*
* Flags indicating how to handle the #NMSetting8021x:pin property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: pin-flags
- * variable: (none)
- * description: The property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PIN_FLAGS,
g_param_spec_uint (NM_SETTING_802_1X_PIN_FLAGS, "", "",
@@ -3916,13 +3717,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class)
* addition to any certificates specified by the #NMSetting8021x:ca-cert and
* #NMSetting8021x:phase2-ca-cert properties.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: system-ca-certs
- * variable: (none)
- * description: The property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SYSTEM_CA_CERTS,
g_param_spec_boolean (NM_SETTING_802_1X_SYSTEM_CA_CERTS, "", "",
diff --git a/libnm-util/nm-setting-8021x.h b/libnm-util/nm-setting-8021x.h
index 2121f63b62..62b4390502 100644
--- a/libnm-util/nm-setting-8021x.h
+++ b/libnm-util/nm-setting-8021x.h
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
* @NM_SETTING_802_1X_CK_FORMAT_X509: file contains an X.509 format certificate
* @NM_SETTING_802_1X_CK_FORMAT_RAW_KEY: file contains an old-style OpenSSL PEM
* or DER private key
- * @NM_SETTING_802_1X_CK_FORMAT_PKCS12: file contains a PKCS#12 certificate
+ * @NM_SETTING_802_1X_CK_FORMAT_PKCS12: file contains a PKCS#<!-- -->12 certificate
* and private key
*
* #NMSetting8021xCKFormat values indicate the general type of a certificate
diff --git a/libnm-util/nm-setting-adsl.c b/libnm-util/nm-setting-adsl.c
index 76fa63b910..5355011cd1 100644
--- a/libnm-util/nm-setting-adsl.c
+++ b/libnm-util/nm-setting-adsl.c
@@ -19,8 +19,10 @@
* Copyright 2011 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-adsl.h"
#include "nm-setting-ppp.h"
@@ -217,15 +219,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_SETTING_ADSL_ERROR,
- NM_SETTING_ADSL_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_ADSL_SETTING_NAME, NM_SETTING_ADSL_PASSWORD);
- return FALSE;
- }
-
if ( !priv->protocol
|| ( strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)
@@ -260,7 +253,7 @@ need_secrets (NMSetting *setting)
NMSettingAdslPrivate *priv = NM_SETTING_ADSL_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (!(priv->password_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED)) {
diff --git a/libnm-util/nm-setting-bluetooth.c b/libnm-util/nm-setting-bluetooth.c
index 506ecbddee..2867d73bae 100644
--- a/libnm-util/nm-setting-bluetooth.c
+++ b/libnm-util/nm-setting-bluetooth.c
@@ -20,9 +20,11 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-param-spec-specialized.h"
#include "nm-dbus-glib-types.h"
@@ -101,7 +103,8 @@ NMSetting *nm_setting_bluetooth_new (void)
* Returns the connection method for communicating with the remote device (i.e.
* either DUN to a DUN-capable device or PANU to a NAP-capable device).
*
- * Returns: the type, either %NM_SETTING_BLUETOOTH_PANU or %NM_SETTING_BLUETOOTH_DUN
+ * Returns: the type, either %NM_SETTING_BLUETOOTH_TYPE_PANU or
+ * %NM_SETTING_BLUETOOTH_TYPE_DUN
**/
const char *
nm_setting_bluetooth_get_connection_type (NMSettingBluetooth *setting)
diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c
index 7d82d31d23..fa12cf0ea1 100644
--- a/libnm-util/nm-setting-bond.c
+++ b/libnm-util/nm-setting-bond.c
@@ -19,13 +19,15 @@
* Copyright 2011 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bond.h"
#include "nm-param-spec-specialized.h"
@@ -795,13 +797,6 @@ nm_setting_bond_class_init (NMSettingBondClass *setting_class)
*
* The name of the virtual in-kernel bonding network interface
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: interface-name
- * variable: DEVICE
- * description: Bonding interface name.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_BOND_INTERFACE_NAME, "", "",
@@ -817,14 +812,6 @@ nm_setting_bond_class_init (NMSettingBondClass *setting_class)
* must be strings. Option names must contain only alphanumeric characters
* (ie, [a-zA-Z0-9]).
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: options
- * variable: BONDING_OPTS
- * description: Bonding options.
- * example: BONDING_OPTS="miimon=100 mode=broadcast"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_OPTIONS,
_nm_param_spec_specialized (NM_SETTING_BOND_OPTIONS, "", "",
diff --git a/libnm-util/nm-setting-bridge-port.c b/libnm-util/nm-setting-bridge-port.c
index aaa172d4ae..b3afa50050 100644
--- a/libnm-util/nm-setting-bridge-port.c
+++ b/libnm-util/nm-setting-bridge-port.c
@@ -19,11 +19,13 @@
* Copyright 2012 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bridge-port.h"
#include "nm-utils.h"
@@ -260,15 +262,6 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority
- * variable: BRIDGING_OPTS: priority=
- * values: 0 - 63
- * default: 32
- * description: STP priority.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIORITY,
g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PRIORITY, "", "",
@@ -286,15 +279,6 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: path-cost
- * variable: BRIDGING_OPTS: path_cost=
- * values: 1 - 65535
- * default: 100
- * description: STP cost.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PATH_COST,
g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PATH_COST, "", "",
@@ -312,14 +296,6 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: hairpin-mode
- * variable: BRIDGING_OPTS: hairpin_mode=
- * default: yes
- * description: Hairpin mode of the bridge port.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_HAIRPIN_MODE,
g_param_spec_boolean (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, "", "",
diff --git a/libnm-util/nm-setting-bridge.c b/libnm-util/nm-setting-bridge.c
index 50f6cdbcb2..bdaa75f977 100644
--- a/libnm-util/nm-setting-bridge.c
+++ b/libnm-util/nm-setting-bridge.c
@@ -19,11 +19,13 @@
* Copyright 2011 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <linux/if_ether.h>
#include "nm-setting-bridge.h"
@@ -451,13 +453,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: interface-name
- * variable: DEVICE
- * description: Bridge interface name.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_BRIDGE_INTERFACE_NAME, "", "",
@@ -475,23 +470,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---keyfile---
- * property: mac-address
- * format: ususal hex-digits-and-colons notation
- * description: MAC address in traditional hex-digits-and-colons notation,
- * or semicolon separated list of 6 decimal bytes (obsolete)
- * example: mac-address=00:22:68:12:79:A2
- * mac-address=0;34;104;18;121;162;
- * ---end---
- * ---ifcfg-rh---
- * property: mac-address
- * variable: MACADDR(+)
- * description: MAC address of the bridge. Note that this requires a recent
- * kernel support, originally introduced in 3.15 upstream kernel)
- * MACADDR for bridges is an NM extension.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
_nm_param_spec_specialized (NM_SETTING_BRIDGE_MAC_ADDRESS, "", "",
@@ -507,14 +485,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: stp
- * variable: STP
- * default: no
- * description: Span tree protocol participation.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_STP,
g_param_spec_boolean (NM_SETTING_BRIDGE_STP, "", "",
@@ -533,15 +503,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority
- * variable: BRIDGING_OPTS: priority=
- * values: 0 - 32768
- * default: 32768
- * description: STP priority.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIORITY,
g_param_spec_uint (NM_SETTING_BRIDGE_PRIORITY, "", "",
@@ -558,15 +519,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: forward-delay
- * variable: DELAY
- * values: 2 - 30
- * default: 15
- * description: STP forwarding delay.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_FORWARD_DELAY,
g_param_spec_uint (NM_SETTING_BRIDGE_FORWARD_DELAY, "", "",
@@ -583,15 +535,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: hello-time
- * variable: BRIDGING_OPTS: hello_time=
- * values: 1 - 10
- * default: 2
- * description: STP hello time.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_HELLO_TIME,
g_param_spec_uint (NM_SETTING_BRIDGE_HELLO_TIME, "", "",
@@ -608,15 +551,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: max-age
- * variable: BRIDGING_OPTS: max_age=
- * values: 6 - 40
- * default: 20
- * description: STP maximum message age.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAX_AGE,
g_param_spec_uint (NM_SETTING_BRIDGE_MAX_AGE, "", "",
@@ -633,15 +567,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ageing-time
- * variable: BRIDGING_OPTS: ageing_time=
- * values: 0 - 1000000
- * default: 300
- * description: Ethernet MAC ageing time.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_AGEING_TIME,
g_param_spec_uint (NM_SETTING_BRIDGE_AGEING_TIME, "", "",
diff --git a/libnm-util/nm-setting-cdma.c b/libnm-util/nm-setting-cdma.c
index 976a59680a..53f886ece3 100644
--- a/libnm-util/nm-setting-cdma.c
+++ b/libnm-util/nm-setting-cdma.c
@@ -19,8 +19,10 @@
* Copyright 2007 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-cdma.h"
#include "nm-utils.h"
@@ -179,15 +181,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_SETTING_CDMA_ERROR,
- NM_SETTING_CDMA_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_CDMA_SETTING_NAME, NM_SETTING_CDMA_PASSWORD);
- return FALSE;
- }
-
return TRUE;
}
@@ -197,7 +190,7 @@ need_secrets (NMSetting *setting)
NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (priv->username) {
diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c
index f54b47ed5f..bda89d6323 100644
--- a/libnm-util/nm-setting-connection.c
+++ b/libnm-util/nm-setting-connection.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-utils.h"
#include "nm-dbus-glib-types.h"
@@ -880,19 +882,21 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
if (is_slave) {
if (!priv->master) {
- g_set_error_literal (error,
- NM_SETTING_CONNECTION_ERROR,
- NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY,
- _("Slave connections need a valid '" NM_SETTING_CONNECTION_MASTER "' property"));
+ g_set_error (error,
+ NM_SETTING_CONNECTION_ERROR,
+ NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY,
+ _("Slave connections need a valid '%s' property"),
+ NM_SETTING_CONNECTION_MASTER);
g_prefix_error (error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_MASTER);
return NM_SETTING_VERIFY_ERROR;
}
} else {
if (priv->master) {
- g_set_error_literal (error,
- NM_SETTING_CONNECTION_ERROR,
- NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY,
- _("Cannot set '" NM_SETTING_CONNECTION_MASTER "' without '" NM_SETTING_CONNECTION_SLAVE_TYPE "'"));
+ g_set_error (error,
+ NM_SETTING_CONNECTION_ERROR,
+ NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY,
+ _("Cannot set '%s' without '%s'"),
+ NM_SETTING_CONNECTION_MASTER, NM_SETTING_CONNECTION_SLAVE_TYPE);
g_prefix_error (error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_SLAVE_TYPE);
return NM_SETTING_VERIFY_ERROR;
}
@@ -1102,13 +1106,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* A human readable unique identifier for the connection, like "Work Wi-Fi"
* or "T-Mobile 3G".
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: id
- * variable: NAME(+)
- * description: User friendly name for the connection profile.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ID,
g_param_spec_string (NM_SETTING_CONNECTION_ID, "", "",
@@ -1133,14 +1130,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* be generated by nm_utils_uuid_generate() or
* nm_utils_uuid_generate_from_string().
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: uuid
- * variable: UUID(+)
- * description: UUID for the connetcion profile. When missing NetworkManager
- * creates the UUID itself (by hashing the file).
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_UUID,
g_param_spec_string (NM_SETTING_CONNECTION_UUID, "", "",
@@ -1166,15 +1155,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: interface-name
- * variable: DEVICE
- * description: Interface 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.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_CONNECTION_INTERFACE_NAME, "", "",
@@ -1192,16 +1172,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* non-hardware dependent connections like VPN or otherwise, should contain
* the setting name of that setting type (ie, "vpn" or "bridge", etc).
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: type
- * variable: TYPE (DEVICETYPE, DEVICE)
- * values: Ethernet, Wireless, InfiniBand, Bridge, Bond, Vlan, Team, TeamPort
- * description: Base type of the connection. DEVICETYPE is used for teaming
- * connections.
- * example: TYPE=Ethernet; TYPE=Bond; TYPE=Bridge; DEVICETYPE=TeamPort
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_TYPE,
g_param_spec_string (NM_SETTING_CONNECTION_TYPE, "", "",
@@ -1225,15 +1195,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* [reserved] information present must be ignored and is reserved for future
* use. All of [type], [id], and [reserved] must be valid UTF-8.
*/
- /* plugins docs
- * ---ifcfg-rh---
- * property: permissions
- * variable: USERS(+)
- * description: USERS restrict the access for this conenction to certain
- * users only.
- * example: USERS="joe bob"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PERMISSIONS,
_nm_param_spec_specialized (NM_SETTING_CONNECTION_PERMISSIONS, "", "",
@@ -1249,14 +1210,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* %TRUE to automatically activate the connection, %FALSE to require manual
* intervention to activate the connection.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: autoconnect
- * variable: ONBOOT
- * default: yes
- * description: Whether the connection should be autoconnected (not only while booting).
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_AUTOCONNECT,
g_param_spec_boolean (NM_SETTING_CONNECTION_AUTOCONNECT, "", "",
@@ -1310,15 +1263,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* the connection will be placed in the default zone as defined by the
* firewall.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: zone
- * variable: ZONE(+)
- * description: Trust level of this connection. The string is usually used
- * for a firewall.
- * example: ZONE=Work
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ZONE,
g_param_spec_string (NM_SETTING_CONNECTION_ZONE, "", "",
@@ -1333,14 +1277,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
*
* Interface name of the master device or UUID of the master connection.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: master
- * variable: MASTER, TEAM_MASTER, BRIDGE
- * description: Reference to master connection. The variable used depends on
- * the connection type.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MASTER,
g_param_spec_string (NM_SETTING_CONNECTION_MASTER, "", "",
@@ -1357,15 +1293,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* %NM_SETTING_BOND_SETTING_NAME), or %NULL if this connection is not a
* slave.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: slave-type
- * variable: MASTER, TEAM_MASTER, DEVICETYPE, BRIDGE
- * description: Slave type doesn't map directly to a variable, but it is
- * recognized using different variables. MASTER for bonding,
- * TEAM_MASTER and DEVICETYPE for teaming, BRIDGE for bridging.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SLAVE_TYPE,
g_param_spec_string (NM_SETTING_CONNECTION_SLAVE_TYPE, "", "",
@@ -1384,14 +1311,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: secondaries
- * variable: SECONDARY_UUIDS(+)
- * description: UUID of VPN connections that should be activated
- * together with this connection.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SECONDARIES,
_nm_param_spec_specialized (NM_SETTING_CONNECTION_SECONDARIES, "", "",
@@ -1408,16 +1327,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: gateway-ping-timeout
- * variable: GATEWAY_PING_TIMEOUT(+)
- * default: 0
- * description: If greater than zero, the IP connectivity will be checked by
- * pinging the gateway and waiting for the specified timeout (in seconds).
- * example: GATEWAY_PING_TIMEOUT=5
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_GATEWAY_PING_TIMEOUT,
g_param_spec_uint (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, "", "",
diff --git a/libnm-util/nm-setting-dcb.c b/libnm-util/nm-setting-dcb.c
index 6d2d7ee634..89ee387852 100644
--- a/libnm-util/nm-setting-dcb.c
+++ b/libnm-util/nm-setting-dcb.c
@@ -19,9 +19,11 @@
* Copyright 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-dcb.h"
#include "nm-param-spec-specialized.h"
@@ -76,7 +78,7 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_DCB)
typedef struct {
NMSettingDcbFlags app_fcoe_flags;
gint app_fcoe_priority;
- const char * app_fcoe_mode;
+ char * app_fcoe_mode;
NMSettingDcbFlags app_iscsi_flags;
gint app_iscsi_priority;
@@ -831,6 +833,7 @@ set_property (GObject *object, guint prop_id,
priv->app_fcoe_priority = g_value_get_int (value);
break;
case PROP_APP_FCOE_MODE:
+ g_free (priv->app_fcoe_mode);
priv->app_fcoe_mode = g_value_dup_string (value);
break;
case PROP_APP_ISCSI_FLAGS:
@@ -943,6 +946,16 @@ get_property (GObject *object, guint prop_id,
}
static void
+finalize (GObject *object)
+{
+ NMSettingDcbPrivate *priv = NM_SETTING_DCB_GET_PRIVATE (object);
+
+ g_free (priv->app_fcoe_mode);
+
+ G_OBJECT_CLASS (nm_setting_dcb_parent_class)->finalize (object);
+}
+
+static void
nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
@@ -953,6 +966,7 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
/* virtual methods */
object_class->set_property = set_property;
object_class->get_property = get_property;
+ object_class->finalize = finalize;
parent_class->verify = verify;
/* Properties */
@@ -965,15 +979,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: app-fcoe-flags
- * variable: DCB_APP_FCOE_ENABLE, DCB_APP_FCOE_ADVERTISE, DCB_APP_FCOE_WILLING
- * description: FCOE flags.
- * default: no
- * example: DCB_APP_FCOE_ENABLE=yes DCB_APP_FCOE_ADVERTISE=yes
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_APP_FCOE_FLAGS,
g_param_spec_uint (NM_SETTING_DCB_APP_FCOE_FLAGS, "", "",
@@ -990,14 +995,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: app-fcoe-priority
- * variable: DCB_APP_FCOE_PRIORITY
- * values: 0 - 7
- * description: Priority of FCoE frames.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_APP_FCOE_PRIORITY,
g_param_spec_int (NM_SETTING_DCB_APP_FCOE_PRIORITY, "", "",
@@ -1014,15 +1011,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: app-fcoe-mode
- * variable: DCB_APP_FCOE_MODE
- * values: fabric, vn2vn
- * default: fabric
- * description: FCoE controller mode.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_APP_FCOE_MODE,
g_param_spec_string (NM_SETTING_DCB_APP_FCOE_MODE, "", "",
@@ -1040,14 +1028,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: app-iscsi-flags
- * variable: DCB_APP_ISCSI_ENABLE, DCB_APP_ISCSI_ADVERTISE, DCB_APP_ISCSI_WILLING
- * default: no
- * description: iSCSI flags.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_APP_ISCSI_FLAGS,
g_param_spec_uint (NM_SETTING_DCB_APP_ISCSI_FLAGS, "", "",
@@ -1064,14 +1044,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: app-iscsi-priority
- * variable: DCB_APP_ISCSI_PRIORITY
- * values: 0 - 7
- * description: Priority of iSCSI frames.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_APP_ISCSI_PRIORITY,
g_param_spec_int (NM_SETTING_DCB_APP_ISCSI_PRIORITY, "", "",
@@ -1089,14 +1061,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: app-fip-flags
- * variable: DCB_APP_FIP_ENABLE, DCB_APP_FIP_ADVERTISE, DCB_APP_FIP_WILLING
- * default: no
- * description: FIP flags.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_APP_FIP_FLAGS,
g_param_spec_uint (NM_SETTING_DCB_APP_FIP_FLAGS, "", "",
@@ -1113,14 +1077,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: app-fip-priority
- * variable: DCB_APP_FIP_PRIORITY
- * values: 0 - 7
- * description: Priority of FIP frames.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_APP_FIP_PRIORITY,
g_param_spec_int (NM_SETTING_DCB_APP_FIP_PRIORITY, "", "",
@@ -1138,14 +1094,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority-flow-control-flags
- * variable: DCB_PFC_ENABLE, DCB_PFC_ADVERTISE, DCB_PFC_WILLING
- * default: no
- * description: Priority flow control flags.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PFC_FLAGS,
g_param_spec_uint (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS, "", "",
@@ -1163,15 +1111,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority-flow-control
- * variable: DCB_PFC_UP
- * description: Priority flow control values. String of 8 "0" and "1", where "0".
- * means "do not transmit priority pause", "1" means "transmit pause".
- * example: DCB_PFC_UP=01101110
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PFC,
_nm_param_spec_specialized (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL, "", "",
@@ -1188,14 +1127,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority-group-flags
- * variable: DCB_PG_ENABLE, DCB_PG_ADVERTISE, DCB_PG_WILLING
- * default: no
- * description: Priority groups flags.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIORITY_GROUP_FLAGS,
g_param_spec_uint (NM_SETTING_DCB_PRIORITY_GROUP_FLAGS, "", "",
@@ -1212,15 +1143,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority-group-id
- * variable: DCB_PG_ID
- * description: Priority groups values. String of eight priorities (0 - 7) or "f"
- * (unrestricted).
- * example: DCB_PG_ID=1205f173
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIORITY_GROUP_ID,
_nm_param_spec_specialized (NM_SETTING_DCB_PRIORITY_GROUP_ID, "", "",
@@ -1238,14 +1160,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority-group-bandwidth
- * variable: DCB_PG_PCT
- * description: Priority groups values. Eight bandwidths (in percent), separated with commas.
- * example: DCB_PG_PCT=10,5,10,15,10,10,10,30
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIORITY_GROUP_BANDWIDTH,
_nm_param_spec_specialized (NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH, "", "",
@@ -1264,15 +1178,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority-bandwidth
- * variable: DCB_PG_UPPCT
- * description: Priority values. Eight bandwidths (in percent), separated with commas.
- * The sum of the numbers must be 100.
- * example: DCB_PG_UPPCT=7,13,10,10,15,15,10,20
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIORITY_BANDWIDTH,
_nm_param_spec_specialized (NM_SETTING_DCB_PRIORITY_BANDWIDTH, "", "",
@@ -1291,15 +1196,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority-strict-bandwidth
- * variable: DCB_PG_STRICT
- * description: Priority values. String of eight "0" or "1", where "0" means
- * "may not utilize all bandwidth", "1" means "may utilize all bandwidth".
- * example: DCB_PG_STRICT=01101110
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIORITY_STRICT,
_nm_param_spec_specialized (NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH, "", "",
@@ -1316,14 +1212,6 @@ nm_setting_dcb_class_init (NMSettingDcbClass *setting_class)
*
* Since: 0.9.10
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: priority-traffic-class
- * variable: DCB_PG_UP2TC
- * description: Priority values. String of eight trafic class values (0 - 7).
- * example: DCB_PG_UP2TC=01623701
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PRIORITY_TRAFFIC_CLASS,
_nm_param_spec_specialized (NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS, "", "",
diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c
index 51ad390249..e422c92e61 100644
--- a/libnm-util/nm-setting-gsm.c
+++ b/libnm-util/nm-setting-gsm.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-gsm.h"
#include "nm-utils.h"
@@ -340,15 +342,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_SETTING_GSM_ERROR,
- NM_SETTING_GSM_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_USERNAME);
- return FALSE;
- }
-
if (priv->network_id) {
guint32 nid_len = strlen (priv->network_id);
guint32 i;
@@ -386,7 +379,7 @@ need_secrets (NMSetting *setting)
NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (priv->username) {
diff --git a/libnm-util/nm-setting-infiniband.c b/libnm-util/nm-setting-infiniband.c
index d51973adfa..1036702fec 100644
--- a/libnm-util/nm-setting-infiniband.c
+++ b/libnm-util/nm-setting-infiniband.c
@@ -19,10 +19,12 @@
* Copyright 2011 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <dbus/dbus-glib.h>
#include <linux/if_infiniband.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-infiniband.h"
#include "nm-param-spec-specialized.h"
@@ -398,22 +400,6 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* permanent MAC address matches. This property does not change the MAC
* address of the device (i.e. MAC spoofing).
**/
- /* plugins docs
- * ---keyfile---
- * property: mac-address
- * format: ususal hex-digits-and-colons notation
- * description: MAC address in traditional hex-digits-and-colons notation, or
- * or semicolon separated list of 20 decimal bytes (obsolete)
- * example: mac-address= 80:00:00:6d:fe:80:00:00:00:00:00:00:00:02:55:00:70:33:cf:01
- * ---end---
- * ---ifcfg-rh---
- * property: mac-address
- * variable: HWADDR
- * description: IBoIP 20-byte hardware address of the device (in traditional
- * hex-digits-and-colons notation).
- * example: HWADDR=01:02:03:04:05:06:07:08:09:0A:01:02:03:04:05:06:07:08:09:11
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
_nm_param_spec_specialized (NM_SETTING_INFINIBAND_MAC_ADDRESS, "", "",
@@ -428,13 +414,6 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* If non-zero, only transmit packets of the specified size or smaller,
* breaking larger packets up into multiple frames.
**/
- /* = plugins docs =
- * ---ifcfg-rh---
- * property: mtu
- * variable: MTU
- * description: MTU of the interface.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MTU,
g_param_spec_uint (NM_SETTING_INFINIBAND_MTU, "", "",
@@ -450,15 +429,6 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* The IP-over-InfiniBand transport mode. Either "datagram" or
* "connected".
**/
- /* = plugins docs =
- * ---ifcfg-rh---
- * property: transport-mode
- * variable: CONNECTED_MODE
- * default: CONNECTED_MODE=no
- * description: CONNECTED_MODE=yes for "connected" mode, CONNECTED_MODE=no for
- * "datagram" mode
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_TRANSPORT_MODE,
g_param_spec_string (NM_SETTING_INFINIBAND_TRANSPORT_MODE, "", "",
@@ -476,17 +446,6 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* unsigned integer, whose high bit is set if it is a "full membership"
* P_Key.
**/
- /* = plugins docs =
- * ---ifcfg-rh---
- * property: p-key
- * variable: PKEY_ID (and PKEY=yes)
- * default: PKEY=no
- * description: InfiniBand P_Key. The value can be a hex number prefixed with "0x"
- * or a decimal number.
- * When PKEY_ID is specified, PHYSDEV and DEVICE also must be specified.
- * example: PKEY=yes PKEY_ID=2 PHYSDEV=mlx4_ib0 DEVICE=mlx4_ib0.8002
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_P_KEY,
g_param_spec_int (NM_SETTING_INFINIBAND_P_KEY, "", "",
@@ -504,15 +463,6 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
* specify the base device by setting either this property or
* #NMSettingInfiniband:mac-address.
**/
- /* = plugins docs =
- * ---ifcfg-rh---
- * property: parent
- * variable: PHYSDEV (PKEY=yes)
- * default: PKEY=no
- * description: InfiniBand parent device.
- * example: PHYSDEV=ib0
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PARENT,
g_param_spec_string (NM_SETTING_INFINIBAND_PARENT, "", "",
diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c
index f7f709ec54..532231ab4a 100644
--- a/libnm-util/nm-setting-ip4-config.c
+++ b/libnm-util/nm-setting-ip4-config.c
@@ -20,9 +20,11 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip4-config.h"
#include "nm-param-spec-specialized.h"
@@ -76,6 +78,7 @@ typedef struct {
GSList *dns_search; /* list of strings */
GSList *addresses; /* array of NMIP4Address */
GSList *routes; /* array of NMIP4Route */
+ gint64 route_metric;
gboolean ignore_auto_routes;
gboolean ignore_auto_dns;
char *dhcp_client_id;
@@ -92,6 +95,7 @@ enum {
PROP_DNS_SEARCH,
PROP_ADDRESSES,
PROP_ROUTES,
+ PROP_ROUTE_METRIC,
PROP_IGNORE_AUTO_ROUTES,
PROP_IGNORE_AUTO_DNS,
PROP_DHCP_CLIENT_ID,
@@ -689,6 +693,26 @@ nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting)
}
/**
+ * nm_setting_ip4_config_get_route_metric:
+ * @setting: the #NMSettingIP4Config
+ *
+ * Returns the value contained in the #NMSettingIP4Config:route-metric
+ * property.
+ *
+ * Returns: the route metric that is used for IPv4 routes that don't explicitly
+ * specify a metric. See #NMSettingIP4Config:route-metric for more details.
+ *
+ * Since: 1.0
+ **/
+gint64
+nm_setting_ip4_config_get_route_metric (NMSettingIP4Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), -1);
+
+ return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->route_metric;
+}
+
+/**
* nm_setting_ip4_config_get_ignore_auto_routes:
* @setting: the #NMSettingIP4Config
*
@@ -1018,6 +1042,9 @@ set_property (GObject *object, guint prop_id,
g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref);
priv->routes = nm_utils_ip4_routes_from_gvalue (value);
break;
+ case PROP_ROUTE_METRIC:
+ priv->route_metric = g_value_get_int64 (value);
+ break;
case PROP_IGNORE_AUTO_ROUTES:
priv->ignore_auto_routes = g_value_get_boolean (value);
break;
@@ -1070,6 +1097,9 @@ get_property (GObject *object, guint prop_id,
case PROP_ROUTES:
nm_utils_ip4_routes_to_gvalue (priv->routes, value);
break;
+ case PROP_ROUTE_METRIC:
+ g_value_set_int64 (value, priv->route_metric);
+ break;
case PROP_IGNORE_AUTO_ROUTES:
g_value_set_boolean (value, nm_setting_ip4_config_get_ignore_auto_routes (setting));
break;
@@ -1128,16 +1158,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* connection. "disabled" means IPv4 will not be used on this connection.
* This property must be set.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: method
- * variable: BOOTPROTO
- * format: string
- * values: none, dhcp (bootp), static, ibft, autoip, shared
- * default: none
- * description: Method used for IPv4 protocol configuration.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_METHOD,
g_param_spec_string (NM_SETTING_IP4_CONFIG_METHOD, "", "",
@@ -1156,22 +1176,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* all other methods, these DNS servers are used as the only DNS servers for
* this connection.
**/
- /* plugins docs
- * ---keyfile---
- * property: dns
- * format: list of DNS IP addresses
- * description: List of DNS servers.
- * example: dns=1.2.3.4;8.8.8.8;8.8.4.4;
- * ---end---
- * ---ifcfg-rh---
- * property: dns
- * variable: DNS1, DNS2, ...
- * format: string
- * description: List of DNS servers. Even if NetworkManager supports many DNS
- * servers, initscripts and resolver only care about the first three, usually.
- * example: DNS1=1.2.3.4 DNS2=10.0.0.254 DNS3=8.8.8.8
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DNS,
_nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS, "", "",
@@ -1188,14 +1192,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* there is no upstream network. In all other methods, these search domains
* are used as the only search domains for this connection.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: dns-search
- * variable: DOMAIN
- * format: string (space-separated domains)
- * description: List of DNS search domains.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DNS_SEARCH,
_nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS_SEARCH, "", "",
@@ -1215,22 +1211,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* with the "shared", "link-local", or "disabled" methods as addressing is
* either automatic or disabled with these methods.
**/
- /* plugins docs
- * ---keyfile---
- * property: addresses
- * variable: address1, address2, ...
- * format: address/plen[,gateway]
- * description: List of static IP addresses.
- * example: address1=192.168.100.100/24,192.168.100.1
- * address2=10.1.1.5/24
- * ---end---
- * ---ifcfg-rh---
- * property: addresses
- * variable: IPADDR, PREFIX, GATEWAY, IPADDR1, PREFIX1, GATEWAY1, ...
- * description: List of static IP addresses.
- * example: IPADDR 10.5.5.23 PREFIX=24 GATEWAY=10.5.5.1
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ADDRESSES,
_nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ADDRESSES, "", "",
@@ -1251,22 +1231,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* Routes cannot be used with the "shared", "link-local", or "disabled"
* methods because there is no upstream network.
**/
- /* plugins docs
- * ---keyfile---
- * property: routes
- * variable: route1, route2, ...
- * format: route/plen[,gateway,metric]
- * description: List of IP routes.
- * example: route1=8.8.8.0/24,10.1.1.1,77
- * route2=7.7.0.0/16
- * ---end---
- * ---ifcfg-rh---
- * property: routes
- * variable: ADDRESS1, NETMASK1, GATEWAY1, METRIC1, ...
- * description: List of static routes. They are not stored in ifcfg-* file,
- * but in route-* file instead.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ROUTES,
_nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ROUTES, "", "",
@@ -1276,20 +1240,34 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
G_PARAM_STATIC_STRINGS));
/**
+ * NMSettingIP4Config:route-metric:
+ *
+ * The 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.
+ * As the linux kernel accepts zero (0) as a valid metric, zero is
+ * a valid value.
+ *
+ * Since: 1.0
+ **/
+ g_object_class_install_property
+ (object_class, PROP_ROUTE_METRIC,
+ g_param_spec_int64 (NM_SETTING_IP4_CONFIG_ROUTE_METRIC, "", "",
+ -1, G_MAXUINT32, -1,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
* NMSettingIP4Config:ignore-auto-routes:
*
* When the method is set to "auto" and this property to %TRUE,
* automatically configured routes are ignored and only routes specified in
* the #NMSettingIP4Config:routes property, if any, are used.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ignore-auto-routes
- * variable: PEERROUTES(+)
- * default: yes
- * description: PEERROUTES has the opposite meaning as 'ignore-auto-routes' property.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_IGNORE_AUTO_ROUTES,
g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, "", "",
@@ -1307,14 +1285,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* #NMSettingIP4Config:dns and #NMSettingIP4Config:dns-search properties, if
* any, are used.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ignore-auto-dns
- * variable: PEERDNS
- * default: yes
- * description: PEERDNS has the opposite meaning as 'ignore-auto-dns' property.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_IGNORE_AUTO_DNS,
g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, "", "",
@@ -1329,14 +1299,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* 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.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: dhcp-client-id
- * variable: DHCP_CLIENT_ID(+)
- * description: A string sent to the DHCP server to identify the local machine.
- * example: DHCP_CLIENT_ID=ax-srv-1
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DHCP_CLIENT_ID,
g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, "", "",
@@ -1353,14 +1315,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* #NMSettingIP4Config:dhcp-hostname property is empty and this property is
* %TRUE, the current persistent hostname of the computer is sent.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: dhcp-send-hostname
- * variable: DHCP_SEND_HOSTNAME(+)
- * default: yes
- * description: Whether DHCP_HOSTNAME should be sent to the DHCP server.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DHCP_SEND_HOSTNAME,
g_param_spec_boolean (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, "", "",
@@ -1375,13 +1329,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* If the #NMSettingIP4Config:dhcp-send-hostname property is %TRUE, then the
* specified name will be sent to the DHCP server when acquiring a lease.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: dhcp-hostname
- * variable: DHCP_HOSTNAME
- * description: Hostname to send to the DHCP server.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DHCP_HOSTNAME,
g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, "", "",
@@ -1396,16 +1343,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* If %TRUE, this connection will never be the default IPv4 connection,
* meaning it will never be assigned the default route by NetworkManager.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: never-default
- * variable: DEFROUTE (GATEWAYDEV in /etc/sysconfig/network)
- * default: yes
- * description: DEFROUTE=no tells NetworkManager that this connection
- * should not be assigned the default route. DEFROUTE has the opposite
- * meaning as 'never-default' property.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_NEVER_DEFAULT,
g_param_spec_boolean (NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, "", "",
@@ -1424,14 +1361,6 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
* network configuration to succeed if IPv4 configuration fails but IPv6
* configuration completes successfully.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: may-fail
- * variable: IPV4_FAILURE_FATAL(+)
- * default: no
- * description: IPV4_FAILURE_FATAL has the opposite meaning as 'may-fail' property.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAY_FAIL,
g_param_spec_boolean (NM_SETTING_IP4_CONFIG_MAY_FAIL, "", "",
diff --git a/libnm-util/nm-setting-ip4-config.h b/libnm-util/nm-setting-ip4-config.h
index 1b7c23072d..6e9a9a227a 100644
--- a/libnm-util/nm-setting-ip4-config.h
+++ b/libnm-util/nm-setting-ip4-config.h
@@ -60,6 +60,7 @@ GQuark nm_setting_ip4_config_error_quark (void);
#define NM_SETTING_IP4_CONFIG_DNS_SEARCH "dns-search"
#define NM_SETTING_IP4_CONFIG_ADDRESSES "addresses"
#define NM_SETTING_IP4_CONFIG_ROUTES "routes"
+#define NM_SETTING_IP4_CONFIG_ROUTE_METRIC "route-metric"
#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
#define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id"
@@ -214,6 +215,9 @@ NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip4_config_remove_route_by_value (NMSettingIP4Config *setting, NMIP4Route *route);
void nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting);
+NM_AVAILABLE_IN_1_0
+gint64 nm_setting_ip4_config_get_route_metric (NMSettingIP4Config *setting);
+
gboolean nm_setting_ip4_config_get_ignore_auto_routes (NMSettingIP4Config *setting);
gboolean nm_setting_ip4_config_get_ignore_auto_dns (NMSettingIP4Config *setting);
const char * nm_setting_ip4_config_get_dhcp_client_id (NMSettingIP4Config *setting);
diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c
index ec90fd2bd7..654f04962a 100644
--- a/libnm-util/nm-setting-ip6-config.c
+++ b/libnm-util/nm-setting-ip6-config.c
@@ -19,9 +19,11 @@
* Copyright 2007 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip6-config.h"
#include "nm-param-spec-specialized.h"
@@ -75,6 +77,7 @@ typedef struct {
GSList *dns_search; /* list of strings */
GSList *addresses; /* array of NMIP6Address */
GSList *routes; /* array of NMIP6Route */
+ gint64 route_metric;
gboolean ignore_auto_routes;
gboolean ignore_auto_dns;
gboolean never_default;
@@ -91,6 +94,7 @@ enum {
PROP_DNS_SEARCH,
PROP_ADDRESSES,
PROP_ROUTES,
+ PROP_ROUTE_METRIC,
PROP_IGNORE_AUTO_ROUTES,
PROP_IGNORE_AUTO_DNS,
PROP_NEVER_DEFAULT,
@@ -709,6 +713,26 @@ nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting)
}
/**
+ * nm_setting_ip6_config_get_route_metric:
+ * @setting: the #NMSettingIP6Config
+ *
+ * Returns the value contained in the #NMSettingIP6Config:route-metric
+ * property.
+ *
+ * Returns: the route metric that is used for IPv6 routes that don't explicitly
+ * specify a metric. See #NMSettingIP6Config:route-metric for more details.
+ *
+ * Since: 1.0
+ **/
+gint64
+nm_setting_ip6_config_get_route_metric (NMSettingIP6Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), -1);
+
+ return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->route_metric;
+}
+
+/**
* nm_setting_ip6_config_get_ignore_auto_routes:
* @setting: the #NMSettingIP6Config
*
@@ -927,6 +951,9 @@ set_property (GObject *object, guint prop_id,
g_slist_free_full (priv->routes, g_free);
priv->routes = nm_utils_ip6_routes_from_gvalue (value);
break;
+ case PROP_ROUTE_METRIC:
+ priv->route_metric = g_value_get_int64 (value);
+ break;
case PROP_IGNORE_AUTO_ROUTES:
priv->ignore_auto_routes = g_value_get_boolean (value);
break;
@@ -974,6 +1001,9 @@ get_property (GObject *object, guint prop_id,
case PROP_ROUTES:
nm_utils_ip6_routes_to_gvalue (priv->routes, value);
break;
+ case PROP_ROUTE_METRIC:
+ g_value_set_int64 (value, priv->route_metric);
+ break;
case PROP_IGNORE_AUTO_ROUTES:
g_value_set_boolean (value, priv->ignore_auto_routes);
break;
@@ -1027,15 +1057,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* not done. This property must be set. Note: the "shared" method is not
* yet supported.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: method
- * variable: IPV6INIT, IPV6FORWARDING, IPV6_AUTOCONF, DHCPV6C
- * default: IPV6INIT=yes; IPV6FORWARDING=no; IPV6_AUTOCONF=!IPV6FORWARDING, DHCPV6=no
- * description: Method used for IPv4 protocol configuration.
- * ignore ~ IPV6INIT=no; auto ~ IPV6_AUTOCONF=yes; dhcp ~ IPV6_AUTOCONF=no and DHCPV6C=yes
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_METHOD,
g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD, "", "",
@@ -1052,13 +1073,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
*
* Since: 0.9.8
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: dhcp-hostname
- * variable: DHCP_HOSTNAME
- * description: Hostname to send the DHCP server.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DHCP_HOSTNAME,
g_param_spec_string (NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME, "", "",
@@ -1077,21 +1091,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* other methods, these DNS servers are used as the only DNS servers for
* this connection.
**/
- /* plugins docs
- * ---keyfile---
- * property: dns
- * format: list of DNS IP addresses
- * description: List of DNS servers.
- * example: dns=2001:4860:4860::8888;2001:4860:4860::8844;
- * ---end---
- * ---ifcfg-rh---
- * property: dns
- * variable: DNS1, DNS2, ...
- * format: string
- * description: List of DNS servers. NetworkManager uses the variables both
- * for IPv4 and IPv6.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DNS,
_nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_DNS, "", "",
@@ -1129,20 +1128,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* "shared" or "link-local" methods as the interface is automatically
* assigned an address with these methods.
**/
- /* plugins docs
- * ---keyfile---
- * property: addresses
- * variable: address1, address2, ...
- * format: address/plen[,gateway]
- * description: List of static IP addresses.
- * example: address1=abbe::cafe/96,abbe::1
- * ---end---
- * ---ifcfg-rh---
- * property: addresses
- * variable: IPV6ADDR, IPV6_DEFAULTGW, IPV6ADDR_SECONDARIES
- * description: List of static IP addresses.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ADDRESSES,
_nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ADDRESSES, "", "",
@@ -1163,21 +1148,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* automatic configuration. Routes cannot be used with the "shared" or
* "link-local" methods because there is no upstream network.
**/
- /* plugins docs
- * ---keyfile---
- * property: routes
- * variable: route1, route2, ...
- * format: route/plen[,gateway,metric]
- * description: List of IP routes.
- * example: route1=2001:4860:4860::/64,2620:52:0:2219:222:68ff:fe11:5403
- * ---end---
- * ---ifcfg-rh---
- * property: routes
- * variable: (none)
- * description: List of static routes. They are not stored in ifcfg-* file,
- * but in route6-* file instead in the form of command line for 'ip route add'.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ROUTES,
_nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ROUTES, "", "",
@@ -1187,20 +1157,34 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
G_PARAM_STATIC_STRINGS));
/**
+ * NMSettingIP6Config:route-metric:
+ *
+ * The 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.
+ * As the linux kernel replaces zero (0) by 1024 (user-default), setting
+ * this property to 0 means effectively setting it to 1024.
+ *
+ * Since: 1.0
+ **/
+ g_object_class_install_property
+ (object_class, PROP_ROUTE_METRIC,
+ g_param_spec_int64 (NM_SETTING_IP6_CONFIG_ROUTE_METRIC, "", "",
+ -1, G_MAXUINT32, -1,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
* NMSettingIP6Config:ignore-auto-routes:
*
* When the method is set to "auto" or "dhcp" and this property is set to
* %TRUE, automatically configured routes are ignored and only routes
* specified in the #NMSettingIP6Config:routes property, if any, are used.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ignore-auto-routes
- * variable: IPV6_PEERROUTES(+)
- * default: yes
- * description: IPV6_PEERROUTES has the opposite meaning as 'ignore-auto-routes' property.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_IGNORE_AUTO_ROUTES,
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, "", "",
@@ -1218,14 +1202,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search properties, if
* any, are used.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ignore-auto-dns
- * variable: IPV6_PEERDNS(+)
- * default: yes
- * description: IPV6_PEERDNS has the opposite meaning as 'ignore-auto-dns' property.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_IGNORE_AUTO_DNS,
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, "", "",
@@ -1241,16 +1217,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* meaning it will never be assigned the default IPv6 route by
* NetworkManager.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: never-default
- * variable: IPV6_DEFROUTE(+), (and IPV6_DEFAULTGW, IPV6_DEFAULTDEV in /etc/sysconfig/network)
- * default: IPV6_DEFROUTE=yes (when no variable specified)
- * description: IPV6_DEFROUTE=no tells NetworkManager that this connection
- * should not be assigned the default IPv6 route. IPV6_DEFROUTE has the opposite
- * meaning as 'never-default' property.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_NEVER_DEFAULT,
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, "", "",
@@ -1269,14 +1235,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* network configuration to succeed if IPv6 configuration fails but IPv4
* configuration completes successfully.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: may-fail
- * variable: IPV6_FAILURE_FATAL(+)
- * default: no
- * description: IPV6_FAILURE_FATAL has the opposite meaning as 'may-fail' property.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAY_FAIL,
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_MAY_FAIL, "", "",
@@ -1296,13 +1254,6 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
* 1: enabled (prefer public address), 2: enabled (prefer temporary
* addresses).
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ip6-privacy
- * variable: IPV6_PRIVACY, IPV6_PRIVACY_PREFER_PUBLIC_IP(+)
- * description: Configure IPv6 Privacy Extensions for SLAAC (RFC4941).
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_IP6_PRIVACY,
g_param_spec_int (NM_SETTING_IP6_CONFIG_IP6_PRIVACY, "", "",
diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h
index 4486a40e26..0a2f00ddcc 100644
--- a/libnm-util/nm-setting-ip6-config.h
+++ b/libnm-util/nm-setting-ip6-config.h
@@ -61,6 +61,7 @@ GQuark nm_setting_ip6_config_error_quark (void);
#define NM_SETTING_IP6_CONFIG_DNS_SEARCH "dns-search"
#define NM_SETTING_IP6_CONFIG_ADDRESSES "addresses"
#define NM_SETTING_IP6_CONFIG_ROUTES "routes"
+#define NM_SETTING_IP6_CONFIG_ROUTE_METRIC "route-metric"
#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
#define NM_SETTING_IP6_CONFIG_NEVER_DEFAULT "never-default"
@@ -245,6 +246,9 @@ gboolean nm_setting_ip6_config_remove_route_by_value (NMSettingIP
void nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting);
gboolean nm_setting_ip6_config_get_ignore_auto_routes (NMSettingIP6Config *setting);
+NM_AVAILABLE_IN_1_0
+gint64 nm_setting_ip6_config_get_route_metric (NMSettingIP6Config *setting);
+
gboolean nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting);
const char * nm_setting_ip6_config_get_dhcp_hostname (NMSettingIP6Config *setting);
gboolean nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting);
diff --git a/libnm-util/nm-setting-olpc-mesh.c b/libnm-util/nm-setting-olpc-mesh.c
index 408f6833f5..e4b6dae5b6 100644
--- a/libnm-util/nm-setting-olpc-mesh.c
+++ b/libnm-util/nm-setting-olpc-mesh.c
@@ -20,10 +20,12 @@
* Copyright 2009 One Laptop per Child
*/
+#include "config.h"
+
#include <string.h>
#include <netinet/ether.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#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 0e7c598b90..a01d3e106f 100644
--- a/libnm-util/nm-setting-ppp.c
+++ b/libnm-util/nm-setting-ppp.c
@@ -20,7 +20,9 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
-#include <glib/gi18n.h>
+#include "config.h"
+
+#include <glib/gi18n-lib.h>
#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 a3923336c1..deaeb2e883 100644
--- a/libnm-util/nm-setting-pppoe.c
+++ b/libnm-util/nm-setting-pppoe.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-pppoe.h"
#include "nm-setting-ppp.h"
diff --git a/libnm-util/nm-setting-serial.c b/libnm-util/nm-setting-serial.c
index 0f03e29ffe..24f2c89807 100644
--- a/libnm-util/nm-setting-serial.c
+++ b/libnm-util/nm-setting-serial.c
@@ -20,6 +20,8 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "nm-setting-serial.h"
@@ -283,16 +285,6 @@ nm_setting_serial_class_init (NMSettingSerialClass *setting_class)
* Parity setting of the serial port. Either 'E' for even parity, 'o' for
* odd parity, or 'n' for no parity.
**/
- /* plugins docs
- * ---keyfile---
- * property: parity
- * format: 'e', 'o', or 'n'
- * description: 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.
- * example: parity=n
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PARITY,
g_param_spec_char (NM_SETTING_SERIAL_PARITY, "", "",
diff --git a/libnm-util/nm-setting-team-port.c b/libnm-util/nm-setting-team-port.c
index 73cdf5c142..9992f58a28 100644
--- a/libnm-util/nm-setting-team-port.c
+++ b/libnm-util/nm-setting-team-port.c
@@ -18,11 +18,13 @@
* Copyright 2013 Jiri Pirko <jiri@resnulli.us>
*/
+#include "config.h"
+
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-team-port.h"
#include "nm-utils.h"
@@ -128,6 +130,7 @@ set_property (GObject *object, guint prop_id,
switch (prop_id) {
case PROP_CONFIG:
+ g_free (priv->config);
priv->config = g_value_dup_string (value);
break;
default:
@@ -153,6 +156,16 @@ get_property (GObject *object, guint prop_id,
}
static void
+finalize (GObject *object)
+{
+ NMSettingTeamPortPrivate *priv = NM_SETTING_TEAM_PORT_GET_PRIVATE (object);
+
+ g_free (priv->config);
+
+ G_OBJECT_CLASS (nm_setting_team_port_parent_class)->finalize (object);
+}
+
+static void
nm_setting_team_port_class_init (NMSettingTeamPortClass *setting_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
@@ -163,6 +176,7 @@ nm_setting_team_port_class_init (NMSettingTeamPortClass *setting_class)
/* virtual methods */
object_class->set_property = set_property;
object_class->get_property = get_property;
+ object_class->finalize = finalize;
parent_class->verify = verify;
/* Properties */
@@ -174,13 +188,6 @@ nm_setting_team_port_class_init (NMSettingTeamPortClass *setting_class)
* directly to teamd. If not specified, the default configuration is
* used. See man teamd.conf for the format details.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: config
- * variable: TEAM_PORT_CONFIG
- * description: Team port configuration in JSON. See man teamd.conf for details.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_CONFIG,
g_param_spec_string (NM_SETTING_TEAM_PORT_CONFIG, "", "",
diff --git a/libnm-util/nm-setting-team.c b/libnm-util/nm-setting-team.c
index 3edeeefc17..19bc959652 100644
--- a/libnm-util/nm-setting-team.c
+++ b/libnm-util/nm-setting-team.c
@@ -18,10 +18,12 @@
* Copyright 2013 Jiri Pirko <jiri@resnulli.us>
*/
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-team.h"
#include "nm-param-spec-specialized.h"
@@ -228,13 +230,6 @@ nm_setting_team_class_init (NMSettingTeamClass *setting_class)
*
* The name of the virtual in-kernel team network interface
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: interface-name
- * variable: DEVICE
- * description: Teaming interface name.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_TEAM_INTERFACE_NAME, "", "",
@@ -251,13 +246,6 @@ nm_setting_team_class_init (NMSettingTeamClass *setting_class)
* the value is passed directly to teamd. If not specified, the default
* configuration is used. See man teamd.conf for the format details.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: config
- * variable: TEAM_CONFIG
- * description: Team configuration in JSON. See man teamd.conf for details.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_CONFIG,
g_param_spec_string (NM_SETTING_TEAM_CONFIG, "", "",
diff --git a/libnm-util/nm-setting-template.c b/libnm-util/nm-setting-template.c
index 7944fd9b8f..3c90a49eca 100644
--- a/libnm-util/nm-setting-template.c
+++ b/libnm-util/nm-setting-template.c
@@ -27,6 +27,8 @@
remove this comment, and you're almost done.
*/
+#include "config.h"
+
#include "nm-setting-template.h"
G_DEFINE_TYPE (NMSettingTemplate, nm_setting_template, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-vlan.c b/libnm-util/nm-setting-vlan.c
index b7a35fa3d8..43b6a91c13 100644
--- a/libnm-util/nm-setting-vlan.c
+++ b/libnm-util/nm-setting-vlan.c
@@ -19,10 +19,12 @@
* Copyright 2011 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-vlan.h"
#include "nm-param-spec-specialized.h"
@@ -258,7 +260,8 @@ nm_setting_vlan_add_priority_str (NMSettingVlan *setting,
list = get_map (setting, map);
item = priority_map_new_from_str (map, str);
- g_return_val_if_fail (item != NULL, FALSE);
+ if (!item)
+ g_return_val_if_reached (FALSE);
/* Duplicates get replaced */
for (iter = list; iter; iter = g_slist_next (iter)) {
@@ -750,16 +753,6 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* parent interface may be given by the #NMSettingVlan:parent property or by
* the #NMSettingWired:mac-address property of an #NMSettingWired setting.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: interface-name
- * variable: PHYSDEV and VLAN_ID, or DEVICE
- * description: VLAN 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
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_VLAN_INTERFACE_NAME, "", "",
@@ -777,13 +770,6 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* not specified, the connection must contain an #NMSettingWired setting
* with a #NMSettingWired:mac-address property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: parent
- * variable: DEVICE or PHYSDEV
- * description: Parent interface of the VLAN.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PARENT,
g_param_spec_string (NM_SETTING_VLAN_PARENT, "", "",
@@ -799,13 +785,6 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* The VLAN identifier that the interface created by this connection should
* be assigned.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: id
- * variable: VLAN_ID or DEVICE
- * description: VLAN identifier.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_ID,
g_param_spec_uint (NM_SETTING_VLAN_ID, "", "",
@@ -824,14 +803,6 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* and %NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its
* master device's operating state).
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: flags
- * variable: VLAN_FLAGS, REORDER_HDR
- * values: "GVRP", "LOOSE_BINDING" for VLAN_FLAGS; 0 or 1 for REORDER_HDR
- * description: Parent interface of the VLAN.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_FLAGS,
g_param_spec_uint (NM_SETTING_VLAN_FLAGS, "", "",
@@ -848,14 +819,6 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* SKB priorities. The mapping is given in the format "from:to" where both
* "from" and "to" are unsigned integers, ie "7:3".
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: ingress-property-map
- * variable: VLAN_INGRESS_PRIORITY_MAP
- * description: Ingress priority mapping.
- * example: VLAN_INGRESS_PRIORITY_MAP=4:2,3:5
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_INGRESS_PRIORITY_MAP,
_nm_param_spec_specialized (NM_SETTING_VLAN_INGRESS_PRIORITY_MAP, "", "",
@@ -871,14 +834,6 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
* 802.1p priorities. The mapping is given in the format "from:to" where
* both "from" and "to" are unsigned integers, ie "7:3".
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: egress-property-map
- * variable: VLAN_EGRESS_PRIORITY_MAP
- * description: Egress priority mapping.
- * example: VLAN_EGRESS_PRIORITY_MAP=5:4,4:1,3:7
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_EGRESS_PRIORITY_MAP,
_nm_param_spec_specialized (NM_SETTING_VLAN_EGRESS_PRIORITY_MAP, "", "",
diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c
index 77c64ce48f..1feeb588a0 100644
--- a/libnm-util/nm-setting-vpn.c
+++ b/libnm-util/nm-setting-vpn.c
@@ -19,11 +19,13 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-vpn.h"
#include "nm-param-spec-specialized.h"
@@ -889,15 +891,6 @@ nm_setting_vpn_class_init (NMSettingVPNClass *setting_class)
* Dictionary of key/value pairs of VPN plugin specific data. Both keys and
* values must be strings.
**/
- /* plugins docs
- * ---keyfile---
- * property: data
- * variable: separate variables named after keys of the dictionary
- * description: The keys of the data dictionary are used as variable names directly
- * under [vpn] section.
- * example: remote=ovpn.corp.com cipher=AES-256-CBC username=joe
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DATA,
_nm_param_spec_specialized (NM_SETTING_VPN_DATA, "", "",
@@ -911,15 +904,6 @@ nm_setting_vpn_class_init (NMSettingVPNClass *setting_class)
* Dictionary of key/value pairs of VPN plugin specific secrets like
* passwords or private keys. Both keys and values must be strings.
**/
- /* plugins docs
- * ---keyfile---
- * property: secrets
- * variable: separate variables named after keys of the dictionary
- * description: The keys of the secrets dictionary are used as variable names directly
- * under [vpn-secrets] section.
- * example: password=Popocatepetl
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SECRETS,
_nm_param_spec_specialized (NM_SETTING_VPN_SECRETS, "", "",
diff --git a/libnm-util/nm-setting-wimax.c b/libnm-util/nm-setting-wimax.c
index 1a4a6ec384..acb00f5e9d 100644
--- a/libnm-util/nm-setting-wimax.c
+++ b/libnm-util/nm-setting-wimax.c
@@ -20,10 +20,12 @@
* Copyright 2009 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wimax.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c
index 02cf7fbf32..aba5fb9831 100644
--- a/libnm-util/nm-setting-wired.c
+++ b/libnm-util/nm-setting-wired.c
@@ -20,11 +20,13 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
#include <netinet/ether.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wired.h"
#include "nm-param-spec-specialized.h"
@@ -472,27 +474,24 @@ nm_setting_wired_get_s390_option (NMSettingWired *setting,
const char **out_key,
const char **out_value)
{
- NMSettingWiredPrivate *priv;
- guint32 num_keys;
- GList *keys;
- const char *_key = NULL, *_value = NULL;
+ const char *_key, *_value;
+ GHashTableIter iter;
+ guint i = 0;
g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE);
- priv = NM_SETTING_WIRED_GET_PRIVATE (setting);
-
- num_keys = nm_setting_wired_get_num_s390_options (setting);
- g_return_val_if_fail (idx < num_keys, FALSE);
-
- keys = g_hash_table_get_keys (priv->s390_options);
- _key = g_list_nth_data (keys, idx);
- _value = g_hash_table_lookup (priv->s390_options, _key);
-
- if (out_key)
- *out_key = _key;
- if (out_value)
- *out_value = _value;
- return TRUE;
+ g_hash_table_iter_init (&iter, NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options);
+ while (g_hash_table_iter_next (&iter, (gpointer) &_key, (gpointer) &_value)) {
+ if (i == idx) {
+ if (out_key)
+ *out_key = _key;
+ if (out_value)
+ *out_value = _value;
+ return TRUE;
+ }
+ i++;
+ }
+ g_return_val_if_reached (FALSE);
}
/**
@@ -872,13 +871,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* Interface), "bnc" (Thin Ethernet) or "mii" (Media Independent Interface.
* If the device supports only one port type, this setting is ignored.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: port
- * variable: (none)
- * description: The property is not saved by the plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PORT,
g_param_spec_string (NM_SETTING_WIRED_PORT, "", "",
@@ -892,13 +884,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* If non-zero, request that the device use only the specified speed. In
* Mbit/s, ie 100 == 100Mbit/s.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: speed
- * variable: (none)
- * description: The property is not saved by the plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SPEED,
g_param_spec_uint (NM_SETTING_WIRED_SPEED, "", "",
@@ -913,13 +898,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* If specified, request that the device only use the specified duplex mode.
* Either "half" or "full".
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: duplex
- * variable: (none)
- * description: The property is not saved by the plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_DUPLEX,
g_param_spec_string (NM_SETTING_WIRED_DUPLEX, "", "",
@@ -934,13 +912,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* %FALSE, do not allow auto-negotiation, in which case the "speed" and
* "duplex" properties should be set.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: auto-negotiate
- * variable: (none)
- * description: The property is not saved by the plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_AUTO_NEGOTIATE,
g_param_spec_boolean (NM_SETTING_WIRED_AUTO_NEGOTIATE, "", "",
@@ -956,21 +927,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* whose permanent MAC address matches. This property does not change the
* MAC address of the device (i.e. MAC spoofing).
**/
- /* plugins docs
- * ---keyfile---
- * property: mac-address
- * format: ususal hex-digits-and-colons notation
- * description: MAC 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)
- * ---end---
- * ---ifcfg-rh---
- * property: mac-address
- * variable: HWADDR
- * description: Hardware address of the device in traditional hex-digits-and-colons
- * notation (e.g. 00:22:68:14:5A:05).
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
_nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS, "", "",
@@ -985,21 +941,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* If specified, request that the device use this MAC address instead of its
* permanent MAC address. This is known as MAC cloning or spoofing.
**/
- /* plugins docs
- * ---keyfile---
- * property: cloned-mac-address
- * format: ususal hex-digits-and-colons notation
- * description: Cloned 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).
- * ---end---
- * ---ifcfg-rh---
- * property: cloned-mac-address
- * variable: MACADDR
- * description: Cloned (spoofed) MAC address in traditional hex-digits-and-colons
- * notation (e.g. 00:22:68:14:5A:99).
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_CLONED_MAC_ADDRESS,
_nm_param_spec_specialized (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, "", "",
@@ -1016,21 +957,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* address is in the standard hex-digits-and-colons notation
* (00:11:22:33:44:55).
**/
- /* plugins docs
- * ---keyfile---
- * property: mac-address-blacklist
- * format: list of MACs (separated with semicolons)
- * description: MAC address blacklist.
- * example: mac-address-blacklist= 00:22:68:12:79:A6;00:22:68:12:79:78
- * ---end---
- * ---ifcfg-rh---
- * property: mac-address-blacklist
- * variable: HWADDR_BLACKLIST(+)
- * description: 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"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS_BLACKLIST,
_nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, "", "",
@@ -1045,13 +971,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* If non-zero, only transmit packets of the specified size or smaller,
* breaking larger packets up into multiple Ethernet frames.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: mtu
- * variable: MTU
- * description: MTU of the interface.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MTU,
g_param_spec_uint (NM_SETTING_WIRED_MTU, "", "",
@@ -1072,14 +991,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* and each string may only be composed of hexadecimal characters and the
* period (.) character.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: s390-subchannels
- * variable: SUBCHANNELS
- * description: Subchannels for IBM S390 hosts.
- * example: SUBCHANNELS=0.0.b00a,0.0.b00b,0.0.b00c
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_S390_SUBCHANNELS,
_nm_param_spec_specialized (NM_SETTING_WIRED_S390_SUBCHANNELS, "", "",
@@ -1094,15 +1005,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* s390 network device type; one of "qeth", "lcs", or "ctc", representing
* the different types of virtual network devices available on s390 systems.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: s390-nettype
- * variable: NETTYPE
- * values: "qeth", "lcs" or "ctc"
- * description: Network type of the S390 host.
- * example: NETTYPE=qeth
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_S390_NETTYPE,
g_param_spec_string (NM_SETTING_WIRED_S390_NETTYPE, "", "",
@@ -1119,14 +1021,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* "portname", "protocol", among others. Key names must contain only
* alphanumeric characters (ie, [a-zA-Z0-9]).
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: s390-options
- * variable: OPTIONS and PORTNAME, CTCPROTO,
- * description: S390 device options. All options go to OPTIONS, except for
- * "portname" and "ctcprot" that have their own variables.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_S390_OPTIONS,
_nm_param_spec_specialized (NM_SETTING_WIRED_S390_OPTIONS, "", "",
diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c
index 70217e021c..574ff3bd52 100644
--- a/libnm-util/nm-setting-wireless-security.c
+++ b/libnm-util/nm-setting-wireless-security.c
@@ -20,10 +20,11 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wireless-security.h"
#include "nm-setting-8021x.h"
@@ -851,7 +852,7 @@ need_secrets (NMSetting *setting)
if ( priv->auth_alg
&& !strcmp (priv->auth_alg, "leap")
&& !strcmp (priv->key_mgmt, "ieee8021x")) {
- if (!priv->leap_password || !strlen (priv->leap_password)) {
+ if (!priv->leap_password || !*priv->leap_password) {
g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
return secrets;
}
@@ -922,14 +923,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME);
return FALSE;
}
- if (priv->leap_password && !strlen (priv->leap_password)) {
- g_set_error_literal (error,
- NM_SETTING_WIRELESS_SECURITY_ERROR,
- NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
- return FALSE;
- }
} else {
if ( (strcmp (priv->key_mgmt, "ieee8021x") == 0)
|| (strcmp (priv->key_mgmt, "wpa-eap") == 0)) {
@@ -974,39 +967,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
- if (priv->wep_key0 && !nm_utils_wep_key_valid (priv->wep_key0, priv->wep_key_type)) {
- g_set_error_literal (error,
- NM_SETTING_WIRELESS_SECURITY_ERROR,
- NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
- _("property is invalid"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0);
- return FALSE;
- }
- if (priv->wep_key1 && !nm_utils_wep_key_valid (priv->wep_key1, priv->wep_key_type)) {
- g_set_error_literal (error,
- NM_SETTING_WIRELESS_SECURITY_ERROR,
- NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
- _("property is invalid"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY1);
- return FALSE;
- }
- if (priv->wep_key2 && !nm_utils_wep_key_valid (priv->wep_key2, priv->wep_key_type)) {
- g_set_error_literal (error,
- NM_SETTING_WIRELESS_SECURITY_ERROR,
- NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
- _("property is invalid"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY2);
- return FALSE;
- }
- if (priv->wep_key3 && !nm_utils_wep_key_valid (priv->wep_key3, priv->wep_key_type)) {
- g_set_error_literal (error,
- NM_SETTING_WIRELESS_SECURITY_ERROR,
- NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
- _("property is invalid"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3);
- return FALSE;
- }
-
if (priv->auth_alg && !_nm_utils_string_in_list (priv->auth_alg, valid_auth_algs)) {
g_set_error_literal (error,
NM_SETTING_WIRELESS_SECURITY_ERROR,
@@ -1016,15 +976,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
- if (priv->psk && !nm_utils_wpa_psk_valid (priv->psk)) {
- g_set_error_literal (error,
- NM_SETTING_WIRELESS_SECURITY_ERROR,
- NM_SETTING_WIRELESS_SECURITY_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;
- }
-
if (priv->proto && !_nm_utils_string_slist_validate (priv->proto, valid_protos)) {
g_set_error_literal (error,
NM_SETTING_WIRELESS_SECURITY_ERROR,
@@ -1350,14 +1301,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* WPA-PSK), or "wpa-eap" (WPA-Enterprise). This property must be set for
* any Wi-Fi connection that uses security.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: key-mgmt
- * variable: KEY_MGMT(+)
- * values: IEEE8021X, WPA-PSK, WPA-EAP
- * description: Key management menthod.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_KEY_MGMT,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "", "",
@@ -1374,15 +1317,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* (default key) through 3. Note that some consumer access points (like the
* Linksys WRT54G) number the keys 1 - 4.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: wep-tx-keyidx
- * variable: DEFAULTKEY
- * values: 1, 2, 3, 4
- * default: 1
- * description: Index of active WEP key.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_WEP_TX_KEYIDX,
g_param_spec_uint (NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, "", "",
@@ -1400,14 +1334,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* using Cisco LEAP (ie, key-mgmt = "ieee8021x" and auth-alg = "leap") the
* "leap-username" and "leap-password" properties must be specified.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: auth-alg
- * variable: SECURITYMODE(+)
- * values: restricted, open, leap
- * description: Authentication algorithm for WEP.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_AUTH_ALG,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "", "",
@@ -1422,15 +1348,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Each element may be one "wpa" (allow WPA) or "rsn" (allow WPA2/RSN). If
* not specified, both WPA and RSN connections are allowed.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: proto
- * variable: WPA_ALLOW_WPA(+), WPA_ALLOW_WPA2(+)
- * values: yes, no
- * default: no
- * description: Allowed WPA protocols, WPA and WPA2 (RSN).
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PROTO,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_SECURITY_PROTO, "", "",
@@ -1446,15 +1363,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* For maximum compatibility leave this property empty. Each list element
* may be one of "tkip" or "ccmp".
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: pairwise
- * variable: CIPHER_PAIRWISE(+)
- * values: CCMP, TKIP
- * description: Restrict pairwise encryption algorithms, specified as a space
- * separated list.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PAIRWISE,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_SECURITY_PAIRWISE, "", "",
@@ -1470,15 +1378,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* in the list. For maximum compatibility leave this property empty. Each
* list element may be one of "wep40", "wep104", "tkip", or "ccmp".
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: group
- * variable: CIPHER_GROUP(+)
- * values: CCMP, TKIP, WEP40, WEP104
- * description: Restrict group/broadcast encryption algorithms, specified as a space
- * separated list.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_GROUP,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_SECURITY_GROUP, "", "",
@@ -1492,13 +1391,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* The login username for legacy LEAP connections (ie, key-mgmt =
* "ieee8021x" and auth-alg = "leap").
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: leap-username
- * variable: IEEE_8021X_IDENTITY(+)
- * description: Login name for LEAP.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_LEAP_USERNAME,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, "", "",
@@ -1512,13 +1404,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Index 0 WEP key. This is the WEP key used in most networks. See the
* "wep-key-type" property for a description of how this key is interpreted.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: wep-key0
- * variable: KEY1, KEY_PASSPHRASE1(+)
- * description: The first WEP key (used in most networks). See also DEFAULTKEY for key index.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_WEP_KEY0,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, "", "",
@@ -1533,13 +1418,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Index 1 WEP key. This WEP index is not used by most networks. See the
* "wep-key-type" property for a description of how this key is interpreted.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: wep-key1
- * variable: KEY2, KEY_PASSPHRASE2(+)
- * description: WEP key with index 1. See also DEFAULTKEY for key index.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_WEP_KEY1,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, "", "",
@@ -1554,13 +1432,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Index 2 WEP key. This WEP index is not used by most networks. See the
* "wep-key-type" property for a description of how this key is interpreted.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: wep-key2
- * variable: KEY3, KEY_PASSPHRASE3(+)
- * description: WEP key with index 2. See also DEFAULTKEY for key index.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_WEP_KEY2,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, "", "",
@@ -1575,13 +1446,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Index 3 WEP key. This WEP index is not used by most networks. See the
* "wep-key-type" property for a description of how this key is interpreted.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: wep-key3
- * variable: KEY4, KEY_PASSPHRASE4(+)
- * description: WEP key with index 3. See also DEFAULTKEY for key index.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_WEP_KEY3,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, "", "",
@@ -1597,13 +1461,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* #NMSettingWirelessSecurity:wep-key1, #NMSettingWirelessSecurity:wep-key2,
* and #NMSettingWirelessSecurity:wep-key3 properties.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: wep-key-flags
- * variable: WEP_KEY_FLAGS(+)
- * description: Password flags for KEY<i>, KEY_PASSPHRASE<i> password.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_WEP_KEY_FLAGS,
g_param_spec_uint (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_FLAGS, "", "",
@@ -1623,13 +1480,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* WPA passphrase, and is hashed to derive the actual WPA-PSK used when
* connecting to the Wi-Fi network.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: psk
- * variable: WPA_PSK
- * description: Pre-Shared-Key for WPA networks.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PSK,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_PSK, "", "",
@@ -1644,14 +1494,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Flags indicating how to handle the #NMSettingWirelessSecurity:psk
* property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: psk-flags
- * variable: WPA_PSK_FLAGS(+)
- * description: Password flags for WPA_PSK_FLAGS.
- * example: WPA_PSK_FLAGS=user
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_PSK_FLAGS,
g_param_spec_uint (NM_SETTING_WIRELESS_SECURITY_PSK_FLAGS, "", "",
@@ -1667,14 +1509,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* The login password for legacy LEAP connections (ie, key-mgmt =
* "ieee8021x" and auth-alg = "leap").
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: leap-password
- * variable: IEEE_8021X_PASSWORD(+)
- * description: Password for LEAP. It can also go to "key-"
- * lookaside file, or it can be owned by a secret agent.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_LEAP_PASSWORD,
g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, "", "",
@@ -1689,13 +1523,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* Flags indicating how to handle the
* #NMSettingWirelessSecurity:leap-password property.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: leap-password-flags
- * variable: IEEE_8021X_PASSWORD_FLAGS(+)
- * description: Password flags for IEEE_8021X_PASSWORD_FLAGS.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_LEAP_PASSWORD_FLAGS,
g_param_spec_uint (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD_FLAGS, "", "",
@@ -1715,16 +1542,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting
* as a string and will be hashed using the de-facto MD5 method to derive
* the actual WEP key.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: wep-key-type
- * variable: KEY<i> or KEY_PASSPHRASE<i>(+)
- * description: KEY is used for "key" type (10 or 26 hexadecimal characters,
- * or 5 or 13 character string prefixed with "s:"). KEY_PASSPHRASE is used
- * for WEP passphrases.
- * example: KEY1=s:ahoj, KEY1=0a1c45bc02, KEY_PASSPHRASE1=mysupersecretkey
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_WEP_KEY_TYPE,
g_param_spec_uint (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, "", "",
diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c
index bbb0c66449..84f1c77c72 100644
--- a/libnm-util/nm-setting-wireless.c
+++ b/libnm-util/nm-setting-wireless.c
@@ -20,11 +20,13 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
#include <netinet/ether.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "NetworkManager.h"
#include "nm-setting-wireless.h"
@@ -85,6 +87,7 @@ typedef struct {
GSList *seen_bssids;
char *security;
gboolean hidden;
+ guint32 powersave;
} NMSettingWirelessPrivate;
enum {
@@ -103,6 +106,7 @@ enum {
PROP_SEEN_BSSIDS,
PROP_SEC,
PROP_HIDDEN,
+ PROP_POWERSAVE,
LAST_PROP
};
@@ -660,6 +664,22 @@ nm_setting_wireless_get_hidden (NMSettingWireless *setting)
}
/**
+ * 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
* @bssid: the new BSSID to add to the list
@@ -951,6 +971,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;
@@ -1006,6 +1029,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;
@@ -1032,20 +1058,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
*
* SSID of the Wi-Fi network. Must be specified.
**/
- /* plugins docs
- * ---keyfile---
- * property: ssid
- * format: string (or decimal-byte list - obsolete)
- * description: SSID of Wi-Fi network.
- * example: ssid=Quick Net
- * ---end---
- * ---ifcfg-rh---
- * property: ssid
- * variable: ESSID
- * description: SSID of Wi-Fi network.
- * example: ESSID="Quick Net"
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SSID,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_SSID, "", "",
@@ -1059,14 +1071,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* Wi-Fi network mode; one of "infrastructure", "adhoc" or "ap". If blank,
* infrastructure is assumed.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: mode
- * variable: MODE
- * values: Ad-Hoc, Managed (Auto) [case insensitive]
- * description: Wi-Fi network mode.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MODE,
g_param_spec_string (NM_SETTING_WIRELESS_MODE, "", "",
@@ -1084,14 +1088,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* settings are compatible. This setting depends on specific driver
* capability and may not work with all drivers.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: band
- * variable: CHANNEL
- * description: Channels greater than 14 mean "a" band, otherwise the band is "bg".
- * example: CHANNEL=6
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_BAND,
g_param_spec_string (NM_SETTING_WIRELESS_BAND, "", "",
@@ -1107,14 +1103,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* channel. Because channel numbers overlap between bands, this property
* also requires the "band" property to be set.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: channel
- * variable: CHANNEL
- * description: Channel used for the Wi-Fi communication.
- * example: CHANNEL=6
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_CHANNEL,
g_param_spec_uint (NM_SETTING_WIRELESS_CHANNEL, "", "",
@@ -1131,14 +1119,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* all devices. Note: this property does not control the BSSID used when
* creating an Ad-Hoc network and is unlikely to in the future.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: bssid
- * variable: BSSID(+)
- * description: Restricts association only to a single AP.
- * example: BSSID=00:1E:BD:64:83:21
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_BSSID,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_BSSID, "", "",
@@ -1154,13 +1134,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* Mbit/s. This property is highly driver dependent and not all devices
* support setting a static bitrate.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: rate
- * variable: (none)
- * description: This property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_RATE,
g_param_spec_uint (NM_SETTING_WIRELESS_RATE, "", "",
@@ -1177,13 +1150,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* Units are dBm. This property is highly driver dependent and not all
* devices support setting a static transmit power.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: tx-power
- * variable: (none)
- * description: This property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_TX_POWER,
g_param_spec_uint (NM_SETTING_WIRELESS_TX_POWER, "", "",
@@ -1200,21 +1166,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* permanent MAC address matches. This property does not change the MAC
* address of the device (i.e. MAC spoofing).
**/
- /* plugins docs
- * ---keyfile---
- * property: mac-address
- * format: ususal hex-digits-and-colons notation
- * description: MAC 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).
- * ---end---
- * ---ifcfg-rh---
- * property: mac-address
- * variable: HWADDR
- * description: Hardware address of the device in traditional hex-digits-and-colons
- * notation (e.g. 00:22:68:14:5A:05).
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_MAC_ADDRESS, "", "",
@@ -1228,21 +1179,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* If specified, request that the Wi-Fi device use this MAC address instead
* of its permanent MAC address. This is known as MAC cloning or spoofing.
**/
- /* plugins docs
- * ---keyfile---
- * property: cloned-mac-address
- * format: ususal hex-digits-and-colons notation
- * description: Cloned 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).
- * ---end---
- * ---ifcfg-rh---
- * property: cloned-mac-address
- * variable: MACADDR
- * description: Cloned (spoofed) MAC address in traditional hex-digits-and-colons
- * notation (e.g. 00:22:68:14:5A:99).
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_CLONED_MAC_ADDRESS,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, "", "",
@@ -1257,20 +1193,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* 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").
**/
- /* plugins docs
- * ---keyfile---
- * property: mac-address-blacklist
- * format: list of MACs (separated with semicolons)
- * description: MAC address blacklist.
- * example: mac-address-blacklist= 00:22:68:12:79:A6;00:22:68:12:79:78
- * ---end---
- * ---ifcfg-rh---
- * property: mac-address-blacklist
- * variable: HWADDR_BLACKLIST(+)
- * description: It denies usage of the connection for any device whose address
- * is listed.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS_BLACKLIST,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST, "", "",
@@ -1289,13 +1211,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* NetworkManager. The changes you make to this property will not be
* preserved.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: seen-bssids
- * variable: (none)
- * description: This property is not handled by ifcfg-rh plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SEEN_BSSIDS,
_nm_param_spec_specialized (NM_SETTING_WIRELESS_SEEN_BSSIDS, "", "",
@@ -1310,13 +1225,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* If non-zero, only transmit packets of the specified size or smaller,
* breaking larger packets up into multiple Ethernet frames.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: mtu
- * variable: MTU
- * description: MTU of the wireless interface.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_MTU,
g_param_spec_uint (NM_SETTING_WIRELESS_MTU, "", "",
@@ -1338,13 +1246,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* by the presence of a #NMSettingWirelessSecurity setting in the
* connection.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: security
- * variable: (none)
- * description: This property is deprecated and not handled by ifcfg-rh-plugin.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_SEC,
g_param_spec_string (NM_SETTING_WIRELESS_SEC, "", "",
@@ -1361,17 +1262,27 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
* these workarounds expose inherent insecurities with hidden SSID networks,
* and thus hidden SSID networks should be used with caution.
**/
- /* plugins docs
- * ---ifcfg-rh---
- * property: hidden
- * variable: SSID_HIDDEN(+)
- * description: Whether the network hides the SSID.
- * ---end---
- */
g_object_class_install_property
(object_class, PROP_HIDDEN,
g_param_spec_boolean (NM_SETTING_WIRELESS_HIDDEN, "", "",
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 18f78cff66..77eff73e30 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 5c3dc1e105..105981bc34 100644
--- a/libnm-util/nm-setting.c
+++ b/libnm-util/nm-setting.c
@@ -20,8 +20,10 @@
* Copyright 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting.h"
#include "nm-setting-private.h"
@@ -347,12 +349,6 @@ nm_setting_to_hash (NMSetting *setting, NMSettingHashFlags flags)
}
g_free (property_specs);
- /* Don't return empty hashes, except for base types */
- if (g_hash_table_size (hash) < 1 && !_nm_setting_is_base_type (setting)) {
- g_hash_table_destroy (hash);
- hash = NULL;
- }
-
return hash;
}
diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c
index a5113538dd..022fa70f0e 100644
--- a/libnm-util/nm-utils.c
+++ b/libnm-util/nm-utils.c
@@ -26,7 +26,10 @@
#include <netinet/ether.h>
#include <linux/if_infiniband.h>
#include <uuid/uuid.h>
+#include <libintl.h>
#include <gmodule.h>
+#include <gio/gio.h>
+#include <glib/gi18n-lib.h>
#include "nm-utils.h"
#include "nm-utils-private.h"
@@ -34,6 +37,10 @@
#include "nm-dbus-glib-types.h"
#include "nm-setting-private.h"
#include "crypto.h"
+#include "nm-utils-internal.h"
+
+/* Embed the commit id in the build binary */
+static const char *const __nm_git_sha = STRLEN (NM_GIT_SHA) > 0 ? "NM_GIT_SHA:"NM_GIT_SHA : "";
/**
* SECTION:nm-utils
@@ -221,19 +228,22 @@ static gboolean initialized = FALSE;
* nm_utils_init:
* @error: location to store error, or %NULL
*
- * Initializes libnm-util; should be called when starting and program that
- * uses libnm-util. Sets up an atexit() handler to ensure de-initialization
- * is performed, but calling nm_utils_deinit() to explicitly deinitialize
- * libnm-util can also be done. This function can be called more than once.
+ * Initializes libnm-util; should be called when starting any program that
+ * uses libnm-util. This function can be called more than once.
*
* Returns: %TRUE if the initialization was successful, %FALSE on failure.
**/
gboolean
nm_utils_init (GError **error)
{
+ (void) __nm_git_sha;
+
if (!initialized) {
initialized = TRUE;
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
if (!crypto_init (error))
return FALSE;
@@ -245,18 +255,12 @@ nm_utils_init (GError **error)
/**
* nm_utils_deinit:
*
- * Frees all resources used internally by libnm-util. This function is called
- * from an atexit() handler, set up by nm_utils_init(), but is safe to be called
- * more than once. Subsequent calls have no effect until nm_utils_init() is
- * called again.
+ * No-op. Although this function still exists for ABI compatibility reasons, it
+ * does not have any effect, and does not ever need to be called.
**/
void
nm_utils_deinit (void)
{
- if (initialized) {
- crypto_deinit ();
- initialized = FALSE;
- }
}
/* ssid helpers */
@@ -1491,9 +1495,11 @@ char *
nm_utils_uuid_generate_from_string (const char *s)
{
GError *error = NULL;
- uuid_t *uuid;
+ uuid_t uuid;
char *buf = NULL;
+ g_return_val_if_fail (s && *s, NULL);
+
if (!nm_utils_init (&error)) {
g_warning ("error initializing crypto: (%d) %s",
error ? error->code : 0,
@@ -1503,21 +1509,18 @@ nm_utils_uuid_generate_from_string (const char *s)
return NULL;
}
- uuid = g_malloc0 (sizeof (*uuid));
- if (!crypto_md5_hash (NULL, 0, s, strlen (s), (char *) uuid, sizeof (*uuid), &error)) {
+ if (!crypto_md5_hash (NULL, 0, s, strlen (s), (char *) uuid, sizeof (uuid), &error)) {
g_warning ("error generating UUID: (%d) %s",
error ? error->code : 0,
error ? error->message : "unknown");
if (error)
g_error_free (error);
- goto out;
+ return NULL;
}
buf = g_malloc0 (37);
- uuid_unparse_lower (*uuid, &buf[0]);
+ uuid_unparse_lower (uuid, &buf[0]);
-out:
- g_free (uuid);
return buf;
}
@@ -1727,9 +1730,9 @@ nm_utils_rsa_key_encrypt_aes (const GByteArray *data,
* nm_utils_file_is_pkcs12:
* @filename: name of the file to test
*
- * Utility function to find out if the @filename is in PKCS#12 format.
+ * Utility function to find out if the @filename is in PKCS#<!-- -->12 format.
*
- * Returns: %TRUE if the file is PKCS#12, %FALSE if it is not
+ * Returns: %TRUE if the file is PKCS#<!-- -->12, %FALSE if it is not
**/
gboolean
nm_utils_file_is_pkcs12 (const char *filename)
@@ -1737,6 +1740,82 @@ nm_utils_file_is_pkcs12 (const char *filename)
return crypto_is_pkcs12_file (filename, NULL);
}
+/**********************************************************************************************/
+
+/**
+ * nm_utils_file_search_in_paths:
+ * @progname: the helper program name, like "iptables"
+ * Must be a non-empty string, without path separator (/).
+ * @try_first: (allow-none): a custom path to try first before searching.
+ * It is silently ignored if it is empty or not an absolute path.
+ * @paths: (allow-none): a %NULL terminated list of search paths.
+ * Can be empty or %NULL, in which case only @try_first is checked.
+ * @file_test_flags: the flags passed to g_file_test() when searching
+ * for @progname. Set it to 0 to skip the g_file_test().
+ * @predicate: (scope call): if given, pass the file name to this function
+ * for additional checks. This check is performed after the check for
+ * @file_test_flags. You cannot omit both @file_test_flags and @predicate.
+ * @user_data: (closure): (allow-none): user data for @predicate function.
+ * @error: (allow-none): on failure, set a "not found" error %G_IO_ERROR %G_IO_ERROR_NOT_FOUND.
+ *
+ * Searches for a @progname file in a list of search @paths.
+ *
+ * Returns: (transfer none): 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.
+ */
+const char *
+nm_utils_file_search_in_paths (const char *progname,
+ const char *try_first,
+ const char *const *paths,
+ GFileTest file_test_flags,
+ NMUtilsFileSearchInPathsPredicate predicate,
+ gpointer user_data,
+ GError **error)
+{
+ GString *tmp;
+ const char *ret;
+
+ g_return_val_if_fail (!error || !*error, NULL);
+ g_return_val_if_fail (progname && progname[0] && !strchr (progname, '/'), NULL);
+ g_return_val_if_fail (file_test_flags || predicate, NULL);
+
+ /* Only consider @try_first if it is a valid, absolute path. This makes
+ * it simpler to pass in a path from configure checks. */
+ if ( try_first
+ && try_first[0] == '/'
+ && (file_test_flags == 0 || g_file_test (try_first, file_test_flags))
+ && (!predicate || predicate (try_first, user_data)))
+ return g_intern_string (try_first);
+
+ if (!paths || !*paths)
+ goto NOT_FOUND;
+
+ tmp = g_string_sized_new (50);
+ for (; *paths; paths++) {
+ if (!*paths)
+ continue;
+ g_string_append (tmp, *paths);
+ if (tmp->str[tmp->len - 1] != '/')
+ g_string_append_c (tmp, '/');
+ g_string_append (tmp, progname);
+ if ( (file_test_flags == 0 || g_file_test (tmp->str, file_test_flags))
+ && (!predicate || predicate (tmp->str, user_data))) {
+ ret = g_intern_string (tmp->str);
+ g_string_free (tmp, TRUE);
+ return ret;
+ }
+ g_string_set_size (tmp, 0);
+ }
+ g_string_free (tmp, TRUE);
+
+NOT_FOUND:
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, _("Could not find \"%s\" binary"), progname);
+ return NULL;
+}
+
+/**********************************************************************************************/
+
/* Band, channel/frequency stuff for wireless */
struct cf_pair {
guint32 chan;
@@ -1948,7 +2027,8 @@ nm_utils_wifi_is_channel_valid (guint32 channel, const char *band)
/**
* nm_utils_hwaddr_len:
- * @type: the type of address; either %ARPHRD_ETHER or %ARPHRD_INFINIBAND
+ * @type: the type of address; either <literal>ARPHRD_ETHER</literal> or
+ * <literal>ARPHRD_INFINIBAND</literal>
*
* Returns the length in octets of a hardware address of type @type.
*
@@ -1969,11 +2049,12 @@ nm_utils_hwaddr_len (int type)
* nm_utils_hwaddr_type:
* @len: the length of hardware address in bytes
*
- * Returns the type (either %ARPHRD_ETHER or %ARPHRD_INFINIBAND) of
- * the raw address given its length.
+ * Returns the type (either <literal>ARPHRD_ETHER</literal> or
+ * <literal>ARPHRD_INFINIBAND</literal>) of the raw address given its length.
*
- * Return value: the type, either %ARPHRD_ETHER or %ARPHRD_INFINIBAND.
- * If the length is unexpected, return -1 (unsupported type/length).
+ * Return value: the type, either <literal>ARPHRD_ETHER</literal> or
+ * <literal>ARPHRD_INFINIBAND</literal>. If the length is unexpected, return -1
+ * (unsupported type/length).
*
* Deprecated: This could not be extended to cover other types, since
* there is not a one-to-one mapping between types and lengths. This
@@ -1998,7 +2079,8 @@ nm_utils_hwaddr_type (int len)
/**
* nm_utils_hwaddr_aton:
* @asc: the ASCII representation of a hardware address
- * @type: the type of address; either %ARPHRD_ETHER or %ARPHRD_INFINIBAND
+ * @type: the type of address; either <literal>ARPHRD_ETHER</literal> or
+ * <literal>ARPHRD_INFINIBAND</literal>
* @buffer: buffer to store the result into
*
* Parses @asc and converts it to binary form in @buffer. See
@@ -2025,7 +2107,8 @@ nm_utils_hwaddr_aton (const char *asc, int type, gpointer buffer)
/**
* nm_utils_hwaddr_atoba:
* @asc: the ASCII representation of a hardware address
- * @type: the type of address; either %ARPHRD_ETHER or %ARPHRD_INFINIBAND
+ * @type: the type of address; either <literal>ARPHRD_ETHER</literal> or
+ * <literal>ARPHRD_INFINIBAND</literal>
*
* Parses @asc and converts it to binary form in a #GByteArray. See
* nm_utils_hwaddr_aton() if you don't want a #GByteArray.
@@ -2057,7 +2140,8 @@ nm_utils_hwaddr_atoba (const char *asc, int type)
/**
* nm_utils_hwaddr_ntoa:
* @addr: a binary hardware address
- * @type: the type of address; either %ARPHRD_ETHER or %ARPHRD_INFINIBAND
+ * @type: the type of address; either <literal>ARPHRD_ETHER</literal> or
+ * <literal>ARPHRD_INFINIBAND</literal>
*
* Converts @addr to textual form.
*
@@ -2390,13 +2474,14 @@ static char _nm_utils_inet_ntop_buffer[NM_UTILS_INET_ADDRSTRLEN];
/**
* nm_utils_inet4_ntop: (skip)
* @inaddr: the address that should be converted to string.
- * @dst: the destination buffer, it must contain at least %INET_ADDRSTRLEN
- * or %NM_UTILS_INET_ADDRSTRLEN characters. If set to %NULL, it will return
- * a pointer to an internal, static buffer (shared with nm_utils_inet6_ntop()).
- * Beware, that the internal buffer will be overwritten with ever new call
- * of nm_utils_inet4_ntop() or nm_utils_inet6_ntop() that does not provied it's
- * own @dst buffer. Also, using the internal buffer is not thread safe. When
- * in doubt, pass your own @dst buffer to avoid these issues.
+ * @dst: the destination buffer, it must contain at least
+ * <literal>INET_ADDRSTRLEN</literal> or %NM_UTILS_INET_ADDRSTRLEN
+ * characters. If set to %NULL, it will return a pointer to an internal, static
+ * buffer (shared with nm_utils_inet6_ntop()). Beware, that the internal
+ * buffer will be overwritten with ever new call of nm_utils_inet4_ntop() or
+ * nm_utils_inet6_ntop() that does not provied it's own @dst buffer. Also,
+ * using the internal buffer is not thread safe. When in doubt, pass your own
+ * @dst buffer to avoid these issues.
*
* Wrapper for inet_ntop.
*
@@ -2415,13 +2500,14 @@ nm_utils_inet4_ntop (in_addr_t inaddr, char *dst)
/**
* nm_utils_inet6_ntop: (skip)
* @in6addr: the address that should be converted to string.
- * @dst: the destination buffer, it must contain at least %INET6_ADDRSTRLEN
- * or %NM_UTILS_INET_ADDRSTRLEN characters. If set to %NULL, it will return
- * a pointer to an internal, static buffer (shared with nm_utils_inet4_ntop()).
- * Beware, that the internal buffer will be overwritten with ever new call
- * of nm_utils_inet4_ntop() or nm_utils_inet6_ntop() that does not provied it's
- * own @dst buffer. Also, using the internal buffer is not thread safe. When
- * in doubt, pass your own @dst buffer to avoid these issues.
+ * @dst: the destination buffer, it must contain at least
+ * <literal>INET6_ADDRSTRLEN</literal> or %NM_UTILS_INET_ADDRSTRLEN
+ * characters. If set to %NULL, it will return a pointer to an internal, static
+ * buffer (shared with nm_utils_inet4_ntop()). Beware, that the internal
+ * buffer will be overwritten with ever new call of nm_utils_inet4_ntop() or
+ * nm_utils_inet6_ntop() that does not provied it's own @dst buffer. Also,
+ * using the internal buffer is not thread safe. When in doubt, pass your own
+ * @dst buffer to avoid these issues.
*
* Wrapper for inet_ntop.
*
diff --git a/libnm-util/nm-utils.h b/libnm-util/nm-utils.h
index 896b3e92a8..530fe8332f 100644
--- a/libnm-util/nm-utils.h
+++ b/libnm-util/nm-utils.h
@@ -121,6 +121,16 @@ GByteArray *nm_utils_rsa_key_encrypt_aes (const GByteArray *data,
GError **error);
gboolean nm_utils_file_is_pkcs12 (const char *filename);
+typedef gboolean (*NMUtilsFileSearchInPathsPredicate) (const char *filename, gpointer user_data);
+
+const char *nm_utils_file_search_in_paths (const char *progname,
+ const char *try_first,
+ const char *const *paths,
+ GFileTest file_test_flags,
+ NMUtilsFileSearchInPathsPredicate predicate,
+ gpointer user_data,
+ GError **error);
+
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);
diff --git a/libnm-util/nm-version.h.in b/libnm-util/nm-version.h.in
index 0a33ac295e..3ba7cfd832 100644
--- a/libnm-util/nm-version.h.in
+++ b/libnm-util/nm-version.h.in
@@ -67,9 +67,10 @@
#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_2 (NM_ENCODE_VERSION (1, 2, 0))
-#define NM_VERSION_CUR_STABLE NM_VERSION_0_9_10
-#define NM_VERSION_NEXT_STABLE NM_VERSION_1_0
+#define NM_VERSION_CUR_STABLE NM_VERSION_1_0
+#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2
#if !defined (NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0)
# undef NM_VERSION_MIN_REQUIRED
@@ -100,6 +101,12 @@
# define NM_DEPRECATED_IN_0_9_10_FOR(f)
#endif
+#if NM_VERSION_MAX_ALLOWED < NM_VERSION_0_9_10
+# define NM_AVAILABLE_IN_0_9_10 G_UNAVAILABLE(0.9,10)
+#else
+# define NM_AVAILABLE_IN_0_9_10
+#endif
+
#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_0
# define NM_DEPRECATED_IN_1_0 G_DEPRECATED
# define NM_DEPRECATED_IN_1_0_FOR(f) G_DEPRECATED_FOR(f)
@@ -108,16 +115,24 @@
# define NM_DEPRECATED_IN_1_0_FOR(f)
#endif
-#if NM_VERSION_MAX_ALLOWED < NM_VERSION_0_9_10
-# define NM_AVAILABLE_IN_0_9_10 G_UNAVAILABLE(0.9,10)
-#else
-# define NM_AVAILABLE_IN_0_9_10
-#endif
-
#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0
# define NM_AVAILABLE_IN_1_0 G_UNAVAILABLE(1,0)
#else
# define NM_AVAILABLE_IN_1_0
#endif
+#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_DEPRECATED_IN_1_2
+# define NM_DEPRECATED_IN_1_2_FOR(f)
+#endif
+
+#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_2
+#endif
+
#endif /* NM_VERSION_H */
diff --git a/libnm-util/tests/Makefile.am b/libnm-util/tests/Makefile.am
index 6d11d0dd16..16a7f8f3fc 100644
--- a/libnm-util/tests/Makefile.am
+++ b/libnm-util/tests/Makefile.am
@@ -1,7 +1,5 @@
if ENABLE_TESTS
-SUBDIRS=certs
-
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
@@ -10,8 +8,9 @@ AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
-DBUILD_DIR=\"$(abs_builddir)\" \
- -DTEST_CERT_DIR=\"$(top_srcdir)/libnm-util/tests/certs/\"
+ -DTEST_CERT_DIR=\"$(top_srcdir)/libnm-core/tests/certs/\"
+@VALGRIND_RULES@
TESTS = \
test-settings-defaults \
test-crypto \
diff --git a/libnm-util/tests/certs/Makefile.am b/libnm-util/tests/certs/Makefile.am
deleted file mode 100644
index 309925174c..0000000000
--- a/libnm-util/tests/certs/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# test-cert.p12 created with:
-#
-# openssl pkcs12 -export \
-# -in test_key_and_cert.pem \
-# -inkey test_key_and_cert.pem \
-# -certfile test_ca_cert.pem \
-# -name "test-pkcs12" \
-# -out test-cert.p12
-
-EXTRA_DIST = \
- test_ca_cert.pem \
- test_ca_cert.der \
- test_key_and_cert.pem \
- test-cert.p12 \
- test2_ca_cert.pem \
- test2_key_and_cert.pem \
- test2-cert.p12 \
- ca-no-ending-newline.pem \
- test-key-only.pem \
- test-key-only-decrypted.der \
- pkcs8-enc-key.pem \
- pkcs8-noenc-key.pem \
- pkcs8-decrypted.der \
- test-aes-key.pem
-
diff --git a/libnm-util/tests/test-crypto.c b/libnm-util/tests/test-crypto.c
index 677f116209..8055facf0e 100644
--- a/libnm-util/tests/test-crypto.c
+++ b/libnm-util/tests/test-crypto.c
@@ -21,6 +21,8 @@
* Copyright 2007 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <unistd.h>
#include <stdlib.h>
@@ -94,7 +96,7 @@ out:
static void
test_cert (gconstpointer test_data)
{
- char *path;
+ gs_free char *path = NULL;
GByteArray *array;
NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
GError *error = NULL;
@@ -151,6 +153,7 @@ test_load_private_key (const char *path,
"unexpected failure determining private key file '%s' "
"type with invalid password (expected %d, got %d)",
path, NM_CRYPTO_KEY_TYPE_UNKNOWN, key_type);
+ g_clear_error (&error);
return;
}
@@ -181,6 +184,7 @@ test_load_private_key (const char *path,
g_byte_array_free (decrypted, TRUE);
}
+ g_clear_error (&error);
g_byte_array_free (array, TRUE);
}
@@ -205,6 +209,7 @@ test_load_pkcs12 (const char *path,
"%d): %d %s",
path, NM_CRYPTO_FILE_FORMAT_PKCS12, format, error->code, error->message);
}
+ g_clear_error (&error);
}
static void
@@ -410,7 +415,6 @@ int
main (int argc, char **argv)
{
GError *error = NULL;
- int ret;
nmtst_init (&argc, &argv, TRUE);
@@ -460,10 +464,6 @@ main (int argc, char **argv)
"pkcs8-enc-key.pem, 1234567890",
test_pkcs8);
- ret = g_test_run ();
-
- crypto_deinit ();
-
- return ret;
+ return g_test_run ();
}
diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c
index bdec7e1354..d8f9dcc4ae 100644
--- a/libnm-util/tests/test-general.c
+++ b/libnm-util/tests/test-general.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <dbus/dbus-glib.h>
#include <string.h>
@@ -28,6 +30,7 @@
#include <sys/resource.h>
#include <nm-utils.h>
+#include "gsystem-local-alloc.h"
#include "nm-setting-private.h"
#include "nm-setting-connection.h"
@@ -308,6 +311,13 @@ test_setting_vpn_modify_during_foreach (void)
g_object_unref (s_vpn);
}
+static void
+_g_value_array_free (void *ptr)
+{
+ if (ptr)
+ g_value_array_free ((GValueArray *) ptr);
+}
+
#define OLD_DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID))
#define OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", OLD_DBUS_TYPE_G_IP6_ADDRESS))
@@ -336,7 +346,7 @@ test_setting_ip6_config_old_address_array (void)
g_value_init (&written_value, OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS);
- addresses = g_ptr_array_new ();
+ addresses = g_ptr_array_new_full (0, _g_value_array_free);
array = g_value_array_new (3);
/* IP address */
@@ -396,6 +406,7 @@ test_setting_ip6_config_old_address_array (void)
ASSERT (memcmp (ba->data, &gw[0], sizeof (gw)) == 0,
"ip6-old-addr", "unexpected failure comparing gateways");
+ g_ptr_array_unref (addresses);
g_value_unset (&written_value);
g_value_unset (&read_value);
g_object_unref (s_ip6);
@@ -404,7 +415,7 @@ test_setting_ip6_config_old_address_array (void)
static void
test_setting_gsm_apn_spaces (void)
{
- NMSettingGsm *s_gsm;
+ gs_unref_object NMSettingGsm *s_gsm = NULL;
const char *tmp;
s_gsm = (NMSettingGsm *) nm_setting_gsm_new ();
@@ -432,7 +443,7 @@ test_setting_gsm_apn_spaces (void)
static void
test_setting_gsm_apn_bad_chars (void)
{
- NMSettingGsm *s_gsm;
+ gs_unref_object NMSettingGsm *s_gsm = NULL;
s_gsm = (NMSettingGsm *) nm_setting_gsm_new ();
ASSERT (s_gsm != NULL,
@@ -470,7 +481,7 @@ test_setting_gsm_apn_bad_chars (void)
static void
test_setting_gsm_apn_underscore (void)
{
- NMSettingGsm *s_gsm;
+ gs_unref_object NMSettingGsm *s_gsm = NULL;
GError *error = NULL;
gboolean success;
@@ -489,7 +500,7 @@ test_setting_gsm_apn_underscore (void)
static void
test_setting_gsm_without_number (void)
{
- NMSettingGsm *s_gsm;
+ gs_unref_object NMSettingGsm *s_gsm = NULL;
GError *error = NULL;
gboolean success;
@@ -1268,6 +1279,7 @@ test_connection_diff_a_only (void)
{ NM_SETTING_IP4_CONFIG_DNS_SEARCH, NM_SETTING_DIFF_RESULT_IN_A },
{ NM_SETTING_IP4_CONFIG_ADDRESSES, NM_SETTING_DIFF_RESULT_IN_A },
{ NM_SETTING_IP4_CONFIG_ROUTES, NM_SETTING_DIFF_RESULT_IN_A },
+ { NM_SETTING_IP4_CONFIG_ROUTE_METRIC, NM_SETTING_DIFF_RESULT_IN_A },
{ 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 },
@@ -1570,6 +1582,7 @@ test_connection_good_base_types (void)
NM_SETTING_GSM_APN, "metered.billing.sucks",
NULL);
nm_connection_add_setting (connection, setting);
+ g_clear_object (&connection);
/* CDMA connection */
connection = nm_connection_new ();
@@ -1668,7 +1681,7 @@ test_connection_bad_base_types (void)
static void
test_setting_compare_id (void)
{
- NMSetting *old, *new;
+ gs_unref_object NMSetting *old = NULL, *new = NULL;
gboolean success;
old = nm_setting_connection_new ();
@@ -1694,7 +1707,7 @@ test_setting_compare_secrets (NMSettingSecretFlags secret_flags,
NMSettingCompareFlags comp_flags,
gboolean remove_secret)
{
- NMSetting *old, *new;
+ gs_unref_object NMSetting *old = NULL, *new = NULL;
gboolean success;
/* Make sure that a connection with transient/unsaved secrets compares
@@ -1726,7 +1739,7 @@ test_setting_compare_vpn_secrets (NMSettingSecretFlags secret_flags,
NMSettingCompareFlags comp_flags,
gboolean remove_secret)
{
- NMSetting *old, *new;
+ gs_unref_object NMSetting *old = NULL, *new = NULL;
gboolean success;
/* Make sure that a connection with transient/unsaved secrets compares
@@ -1905,7 +1918,7 @@ test_setting_connection_changed_signal (void)
NMConnection *connection;
gboolean changed = FALSE;
NMSettingConnection *s_con;
- char *uuid;
+ gs_free char *uuid = NULL;
connection = nm_connection_new ();
g_signal_connect (connection,
@@ -2315,7 +2328,7 @@ static void
test_setting_old_uuid (void)
{
GError *error = NULL;
- NMSetting *setting;
+ gs_unref_object NMSetting *setting = NULL;
gboolean success;
/* NetworkManager-0.9.4.0 generated 40-character UUIDs with no dashes,
@@ -2487,6 +2500,48 @@ test_libnm_linking (void)
g_free (err);
}
+/******************************************************************************/
+
+static void
+_test_uuid (const char *expected_uuid, const char *str)
+{
+ gs_free char *uuid_test = NULL;
+
+ g_assert (str);
+
+ uuid_test = nm_utils_uuid_generate_from_string (str);
+
+ g_assert (uuid_test);
+ g_assert (nm_utils_is_uuid (uuid_test));
+
+ if (strcmp (uuid_test, expected_uuid)) {
+ g_error ("UUID test failed: text=%s, uuid=%s, expected=%s",
+ str, uuid_test, expected_uuid);
+ }
+}
+
+static void
+test_nm_utils_uuid_generate_from_string (void)
+{
+ gs_free char *uuid_test = NULL;
+
+ _test_uuid ("0cc175b9-c0f1-b6a8-31c3-99e269772661", "a");
+ _test_uuid ("098f6bcd-4621-d373-cade-4e832627b4f6", "test");
+ _test_uuid ("59c0547b-7fe2-1c15-2cce-e328e8bf6742", "/etc/NetworkManager/system-connections/em1");
+
+ g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, "*nm_utils_uuid_generate_from_string*: *s && *s*");
+ uuid_test = nm_utils_uuid_generate_from_string ("");
+ g_assert (uuid_test == NULL);
+ g_test_assert_expected_messages ();
+
+ g_test_expect_message ("libnm-util", G_LOG_LEVEL_CRITICAL, "*nm_utils_uuid_generate_from_string*: *s && *s*");
+ uuid_test = nm_utils_uuid_generate_from_string (NULL);
+ g_assert (uuid_test == NULL);
+ g_test_assert_expected_messages ();
+}
+
+/******************************************************************************/
+
NMTST_DEFINE ();
int main (int argc, char **argv)
@@ -2564,6 +2619,8 @@ int main (int argc, char **argv)
test_libnm_linking ();
+ test_nm_utils_uuid_generate_from_string ();
+
base = g_path_get_basename (argv[0]);
fprintf (stdout, "%s: SUCCESS\n", base);
g_free (base);
diff --git a/libnm-util/tests/test-libnm-linking.c b/libnm-util/tests/test-libnm-linking.c
index 68c90e9f0f..9738d44d7f 100644
--- a/libnm-util/tests/test-libnm-linking.c
+++ b/libnm-util/tests/test-libnm-linking.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <nm-utils.h>
diff --git a/libnm-util/tests/test-secrets.c b/libnm-util/tests/test-secrets.c
index b829d12eed..a22edb0fb7 100644
--- a/libnm-util/tests/test-secrets.c
+++ b/libnm-util/tests/test-secrets.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
@@ -174,6 +176,7 @@ test_need_tls_secrets_path (void)
"need-tls-secrets-path-key-password",
"expected to require private key password, but it wasn't");
+ g_ptr_array_free (hints, TRUE);
g_object_unref (connection);
}
@@ -217,6 +220,7 @@ test_need_tls_secrets_blob (void)
"need-tls-secrets-blob-key-password",
"expected to require private key password, but it wasn't");
+ g_ptr_array_free (hints, TRUE);
g_object_unref (connection);
}
@@ -343,6 +347,7 @@ test_need_tls_phase2_secrets_path (void)
"need-tls-phase2-secrets-path-key-password",
"expected to require private key password, but it wasn't");
+ g_ptr_array_free (hints, TRUE);
g_object_unref (connection);
}
@@ -387,6 +392,7 @@ test_need_tls_phase2_secrets_blob (void)
"need-tls-phase2-secrets-blob-key-password",
"expected to require private key password, but it wasn't");
+ g_ptr_array_free (hints, TRUE);
g_object_unref (connection);
}
@@ -505,6 +511,7 @@ test_update_secrets_wifi_single_setting (void)
tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0);
g_assert_cmpstr (tmp, ==, wepkey);
+ g_hash_table_unref (secrets);
g_object_unref (connection);
}
@@ -545,6 +552,7 @@ test_update_secrets_wifi_full_hash (void)
tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0);
g_assert_cmpstr (tmp, ==, wepkey);
+ g_hash_table_unref (all);
g_object_unref (connection);
}
@@ -575,6 +583,8 @@ test_update_secrets_wifi_bad_setting_name (void)
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND);
g_assert (success == FALSE);
+ g_clear_error (&error);
+ g_hash_table_unref (secrets);
g_object_unref (connection);
}
@@ -598,7 +608,7 @@ test_update_secrets_whole_connection (void)
secrets = nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ALL);
wsec_hash = g_hash_table_lookup (secrets, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME);
g_assert (wsec_hash);
- g_hash_table_insert (wsec_hash, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, string_to_gvalue (wepkey));
+ g_hash_table_insert (wsec_hash, g_strdup (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0), string_to_gvalue (wepkey));
success = nm_connection_update_secrets (connection, NULL, secrets, &error);
g_assert_no_error (error);
@@ -608,6 +618,7 @@ test_update_secrets_whole_connection (void)
g_assert (s_wsec);
g_assert_cmpstr (nm_setting_wireless_security_get_wep_key (s_wsec, 0), ==, wepkey);
+ g_hash_table_unref (secrets);
g_object_unref (connection);
}
@@ -627,6 +638,7 @@ test_update_secrets_whole_connection_empty_hash (void)
g_assert_no_error (error);
g_assert (success == TRUE);
g_object_unref (connection);
+ g_hash_table_unref (secrets);
}
static void
@@ -648,20 +660,23 @@ test_update_secrets_whole_connection_bad_setting (void)
secrets = nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ALL);
wsec_hash = g_hash_table_lookup (secrets, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME);
g_assert (wsec_hash);
- g_hash_table_insert (wsec_hash, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, string_to_gvalue (wepkey));
+ g_hash_table_insert (wsec_hash, g_strdup (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0), string_to_gvalue (wepkey));
/* Steal the wsec setting hash so it's not deallocated, and stuff it back
* in with a different name so we ensure libnm-util is returning the right
* error when it finds an entry in the connection hash that doesn't match
* any setting in the connection.
*/
- g_hash_table_steal (secrets, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME);
- g_hash_table_insert (secrets, "asdfasdfasdfasdf", wsec_hash);
+ g_hash_table_ref (wsec_hash);
+ g_hash_table_remove (secrets, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME);
+ g_hash_table_insert (secrets, g_strdup ("asdfasdfasdfasdf"), wsec_hash);
success = nm_connection_update_secrets (connection, NULL, secrets, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND);
g_assert (success == FALSE);
+ g_clear_error (&error);
+ g_hash_table_destroy (secrets);
g_object_unref (connection);
}
@@ -679,7 +694,7 @@ test_update_secrets_whole_connection_empty_base_setting (void)
connection = wifi_connection_new ();
secrets = nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ONLY_SECRETS);
- g_assert_cmpint (g_hash_table_size (secrets), ==, 1);
+ g_assert_cmpint (g_hash_table_size (secrets), ==, 3);
g_assert (g_hash_table_lookup (secrets, NM_SETTING_WIRELESS_SETTING_NAME));
success = nm_connection_update_secrets (connection,
@@ -714,6 +729,7 @@ test_update_secrets_null_setting_name_with_setting_hash (void)
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND);
g_assert (!success);
+ g_clear_error (&error);
g_hash_table_destroy (secrets);
g_object_unref (connection);
}
diff --git a/libnm-util/tests/test-setting-8021x.c b/libnm-util/tests/test-setting-8021x.c
index ddd76f018c..dfc07a8055 100644
--- a/libnm-util/tests/test-setting-8021x.c
+++ b/libnm-util/tests/test-setting-8021x.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
@@ -186,6 +188,7 @@ test_phase2_private_key_import (const char *path,
g_object_get (s_8021x, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, &tmp_key, NULL);
ASSERT (tmp_key != NULL, "phase2-private-key-import", "missing private key value");
check_scheme_path (tmp_key, path);
+ g_byte_array_free (tmp_key, TRUE);
} else
g_assert_not_reached ();
@@ -247,6 +250,7 @@ test_wrong_password_keeps_data (const char *path, const char *password)
"wrong-password-keeps-data", "unexpected missing error");
ASSERT (format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN,
"wrong-password-keeps-data", "unexpected success reading private key format");
+ g_clear_error (&error);
/* Make sure the password hasn't changed */
pw = nm_setting_802_1x_get_private_key_password (s_8021x);
@@ -344,6 +348,7 @@ test_wrong_phase2_password_keeps_data (const char *path, const char *password)
"wrong-phase2-password-keeps-data", "unexpected missing error");
ASSERT (format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN,
"wrong-phase2-password-keeps-data", "unexpected success reading private key format");
+ g_clear_error (&error);
/* Make sure the password hasn't changed */
pw = nm_setting_802_1x_get_phase2_private_key_password (s_8021x);
diff --git a/libnm-util/tests/test-setting-dcb.c b/libnm-util/tests/test-setting-dcb.c
index 4b114ada35..36192cd33a 100644
--- a/libnm-util/tests/test-setting-dcb.c
+++ b/libnm-util/tests/test-setting-dcb.c
@@ -19,11 +19,14 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <nm-utils.h>
#include <nm-glib-compat.h>
#include "nm-setting-dcb.h"
+#include "gsystem-local-alloc.h"
#define DCB_FLAGS_ALL (NM_SETTING_DCB_FLAG_ENABLE | \
NM_SETTING_DCB_FLAG_ADVERTISE | \
@@ -32,7 +35,7 @@
static void
test_dcb_flags_valid (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
guint i;
@@ -85,7 +88,7 @@ test_dcb_flags_valid (void)
static void
test_dcb_flags_invalid (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
@@ -144,7 +147,7 @@ test_dcb_flags_invalid (void)
static void
test_dcb_app_priorities (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
@@ -206,7 +209,7 @@ test_dcb_app_priorities (void)
static void
test_dcb_priorities_valid (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
guint i;
@@ -265,7 +268,7 @@ test_dcb_priorities_valid (void)
static void
test_dcb_bandwidth_sums (void)
{
- NMSettingDcb *s_dcb;
+ gs_unref_object NMSettingDcb *s_dcb = NULL;
GError *error = NULL;
gboolean success;
diff --git a/libnm-util/tests/test-settings-defaults.c b/libnm-util/tests/test-settings-defaults.c
index 9104b4bc6c..7441e1ff5f 100644
--- a/libnm-util/tests/test-settings-defaults.c
+++ b/libnm-util/tests/test-settings-defaults.c
@@ -19,6 +19,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
diff --git a/libnm/Makefile.am b/libnm/Makefile.am
index e14dc83a3f..2c9d94ef54 100644
--- a/libnm/Makefile.am
+++ b/libnm/Makefile.am
@@ -43,20 +43,18 @@ libnminclude_hfiles = \
nm-device-wifi.h \
nm-device-wimax.h \
nm-device.h \
- nm-dhcp4-config.h \
- nm-dhcp6-config.h \
+ nm-dhcp-config.h \
nm-enum-types.h \
- nm-ip4-config.h \
- nm-ip6-config.h \
+ nm-ip-config.h \
nm-object.h \
nm-remote-connection.h \
- nm-secret-agent.h \
nm-types.h \
nm-vpn-connection.h \
- nm-vpn-plugin-ui-interface.h \
+ nm-vpn-editor-plugin.h \
nm-wimax-nsp.h
libnminclude_nointrospect_hfiles = \
+ nm-secret-agent-old.h \
nm-vpn-plugin-old.h
libnminclude_HEADERS = \
@@ -66,6 +64,10 @@ libnminclude_HEADERS = \
libnm_la_private_headers = \
nm-dbus-helpers.h \
nm-device-private.h \
+ nm-dhcp4-config.h \
+ nm-dhcp6-config.h \
+ nm-ip4-config.h \
+ nm-ip6-config.h \
nm-manager.h \
nm-object-cache.h \
nm-object-private.h \
@@ -91,9 +93,11 @@ libnm_la_csources = \
nm-device-wifi.c \
nm-device-wimax.c \
nm-device.c \
+ nm-dhcp-config.c \
nm-dhcp4-config.c \
nm-dhcp6-config.c \
nm-enum-types.c \
+ nm-ip-config.c \
nm-ip4-config.c \
nm-ip6-config.c \
nm-manager.c \
@@ -101,10 +105,10 @@ libnm_la_csources = \
nm-object.c \
nm-remote-connection.c \
nm-remote-settings.c \
- nm-secret-agent.c \
+ nm-secret-agent-old.c \
nm-vpn-connection.c \
nm-vpn-plugin-old.c \
- nm-vpn-plugin-ui-interface.c \
+ nm-vpn-editor-plugin.c \
nm-wimax-nsp.c
libnm_la_SOURCES = \
@@ -126,7 +130,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"
###
@@ -177,3 +181,44 @@ endif
check-local:
$(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm.so $(SYMBOL_VIS_FILE)
+
+if BUILD_SETTING_DOCS
+
+noinst_DATA = \
+ nm-property-docs.xml \
+ nm-setting-docs-overrides.xml \
+ nm-setting-docs.xml \
+ nm-keyfile-docs.xml \
+ nm-ifcfg-rh-docs.xml
+
+docs_sources = $(filter-out %/nm-core-enum-types.c,$(libnm_core_sources))
+
+nm-setting-docs-overrides.xml: generate-plugin-docs.pl $(docs_sources)
+ $(srcdir)/generate-plugin-docs.pl dbus $(top_srcdir)/libnm-core $@
+
+nm-property-docs.xml: generate-setting-docs.py $(docs_sources) | NM-1.0.gir NM-1.0.typelib libnm.la
+ export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \
+ export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \
+ $(srcdir)/generate-setting-docs.py \
+ --gir $(builddir)/NM-1.0.gir \
+ --output $@
+
+nm-setting-docs.xml: generate-setting-docs.py $(docs_sources) nm-setting-docs-overrides.xml | NM-1.0.gir NM-1.0.typelib libnm.la
+ export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \
+ export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \
+ $(srcdir)/generate-setting-docs.py \
+ --gir $(builddir)/NM-1.0.gir \
+ --overrides $(builddir)/nm-setting-docs-overrides.xml \
+ --output $@
+
+nm-keyfile-docs.xml: generate-plugin-docs.pl $(docs_sources)
+ $(srcdir)/generate-plugin-docs.pl keyfile $(top_srcdir)/libnm-core $@
+nm-ifcfg-rh-docs.xml: generate-plugin-docs.pl $(docs_sources)
+ $(srcdir)/generate-plugin-docs.pl ifcfg-rh $(top_srcdir)/libnm-core $@
+
+CLEANFILES += $(noinst_DATA)
+EXTRA_DIST += $(noinst_DATA)
+
+endif
+
+EXTRA_DIST += generate-setting-docs.py generate-plugin-docs.pl
diff --git a/libnm/NetworkManager.h b/libnm/NetworkManager.h
index ce7bec74c2..251a042216 100644
--- a/libnm/NetworkManager.h
+++ b/libnm/NetworkManager.h
@@ -43,14 +43,11 @@
#include <nm-device-wifi.h>
#include <nm-device-wimax.h>
#include <nm-device.h>
-#include <nm-dhcp4-config.h>
-#include <nm-dhcp6-config.h>
+#include <nm-dhcp-config.h>
#include <nm-enum-types.h>
-#include <nm-ip4-config.h>
-#include <nm-ip6-config.h>
+#include <nm-ip-config.h>
#include <nm-object.h>
#include <nm-remote-connection.h>
-#include <nm-secret-agent.h>
#include <nm-setting-8021x.h>
#include <nm-setting-adsl.h>
#include <nm-setting-bluetooth.h>
@@ -63,6 +60,7 @@
#include <nm-setting-generic.h>
#include <nm-setting-gsm.h>
#include <nm-setting-infiniband.h>
+#include <nm-setting-ip-config.h>
#include <nm-setting-ip4-config.h>
#include <nm-setting-ip6-config.h>
#include <nm-setting-olpc-mesh.h>
@@ -83,6 +81,7 @@
#include <nm-version.h>
#include <nm-vpn-connection.h>
#include <nm-vpn-dbus-interface.h>
+#include <nm-vpn-editor-plugin.h>
#include <nm-wimax-nsp.h>
#undef __NETWORKMANAGER_H_INSIDE__
diff --git a/libnm-util/generate-plugin-docs.pl b/libnm/generate-plugin-docs.pl
index 0ded9f6204..35cfdfc6ac 100755
--- a/libnm-util/generate-plugin-docs.pl
+++ b/libnm/generate-plugin-docs.pl
@@ -55,17 +55,16 @@ my @data;
my $fo;
(scalar @ARGV == 3) or die "Usage: $0 <plugin> <srcdir> <output-xml-file>\n";
-($ARGV[0] eq "keyfile" || $ARGV[0] eq "ifcfg-rh") or die "Allowed <plugin> values: keyfile, ifcfg-rh\n";
my ($plugin, $srcdir, $output) = @ARGV;
my $start_tag = "---$plugin---\\s*\$";
my $end_tag = '---end---';
# get source files to scan for documentation comments (nm-setting-<something>.c)
-my $file = "$srcdir/Makefile.am";
+my $file = "$srcdir/Makefile.libnm-core";
open my $fh, '<', $file or die "Can't open $file: $!";
while (my $line = <$fh>) {
chomp $line;
- my @strings = $line =~ /(?:^|\s)(nm-setting-[^.]*\.c)(?:\s|$)/g;
+ my @strings = $line =~ /\/(nm-setting-[^.]*\.c)(?:\s|$)/g;
push @source_files, @strings
}
close $fh;
@@ -146,7 +145,7 @@ sub process_data {
my $str = join ("", @data);
my $yaml_data = Load($str);
- # now write ia line into the XML
+ # now write a line into the XML
my $name = $yaml_data->{property} // "";
my $var = $yaml_data->{variable} // $name; # fallback to "property: "
my $format = $yaml_data->{format} // "";
@@ -155,6 +154,7 @@ sub process_data {
my $exam = $yaml_data->{example} // "";
my $desc = $yaml_data->{description} // "";
+ chomp($name, $var, $format, $values, $def, $exam, $desc);
escape_xml_chars($name, $var, $format, $values, $def, $exam, $desc);
my $foo = sprintf("<property name=\"%s\" variable=\"%s\" format=\"%s\" values=\"%s\" ".
"default=\"%s\" example=\"%s\" description=\"%s\"/>",
diff --git a/libnm-util/generate-setting-docs.py b/libnm/generate-setting-docs.py
index 69b115a7e1..e1e35a86d9 100755
--- a/libnm-util/generate-setting-docs.py
+++ b/libnm/generate-setting-docs.py
@@ -18,25 +18,27 @@
from __future__ import print_function
-from gi.repository import NetworkManager, GObject
+from gi.repository import NM, GObject
import argparse, datetime, re, sys
import xml.etree.ElementTree as ET
-type_name_map = {
- 'gchararray': 'string',
- 'GSList_gchararray_': 'array of string',
- 'GArray_guchar_': 'byte array',
- 'gboolean': 'boolean',
- 'guint64': 'uint64',
- 'gint': 'int32',
- 'guint': 'uint32',
- 'GArray_guint_': 'array of uint32',
- 'GPtrArray_GArray_guint__': 'array of array of uint32',
- 'GPtrArray_GArray_guchar__': 'array of byte array',
- 'GPtrArray_gchararray_': 'array of string',
- 'GHashTable_gchararray+gchararray_': 'dict of (string::string)',
- 'GPtrArray_GValueArray_GArray_guchar_+guint+GArray_guchar___': 'array of (byte array, uint32, byte array)',
- 'GPtrArray_GValueArray_GArray_guchar_+guint+GArray_guchar_+guint__': 'array of (byte array, uint32, byte array, uint32)'
+dbus_type_name_map = {
+ 'b': 'boolean',
+ 's': 'string',
+ 'i': 'int32',
+ 'u': 'uint32',
+ 't': 'uint64',
+ 'x': 'int64',
+ 'y': 'byte',
+ 'as': 'array of string',
+ 'au': 'array of uint32',
+ 'ay': 'byte array',
+ 'a{ss}': 'dict of string to string',
+ 'a{sv}': 'vardict',
+ 'aau': 'array of array of uint32',
+ 'aay': 'array of byte array',
+ 'a(ayuay)': 'array of legacy IPv6 address struct',
+ 'a(ayuayu)': 'array of legacy IPv6 route struct',
}
ns_map = {
@@ -48,10 +50,14 @@ identifier_key = '{%s}identifier' % ns_map['c']
nick_key = '{%s}nick' % ns_map['glib']
symbol_prefix_key = '{%s}symbol-prefix' % ns_map['c']
-constants = { 'TRUE': 'TRUE', 'FALSE': 'FALSE', 'NULL': 'NULL' }
+constants = {
+ 'TRUE': 'TRUE',
+ 'FALSE': 'FALSE',
+ 'G_MAXUINT32': 'G_MAXUINT32',
+ 'NULL': 'NULL' }
setting_names = {}
-def init_constants(girxml):
+def init_constants(girxml, settings):
for const in girxml.findall('./gi:namespace/gi:constant', ns_map):
cname = const.attrib['{%s}type' % ns_map['c']]
cvalue = const.attrib['value']
@@ -60,28 +66,31 @@ def init_constants(girxml):
constants[cname] = cvalue
for enum in girxml.findall('./gi:namespace/gi:enumeration', ns_map):
- flag = enum.attrib['name'].endswith('Flags')
for enumval in enum.findall('./gi:member', ns_map):
cname = enumval.attrib[identifier_key]
- cvalue = enumval.attrib['value']
- if flag:
- cvalue = '%s (0x%x)' % (cname, int(cvalue))
- else:
- cvalue = '%s (%s)' % (cname, cvalue)
+ cvalue = '%s (%s)' % (cname, enumval.attrib['value'])
constants[cname] = cvalue
- for setting in girxml.findall('./gi:namespace/gi:class[@parent="Setting"]', ns_map):
+ for enum in girxml.findall('./gi:namespace/gi:bitfield', ns_map):
+ for enumval in enum.findall('./gi:member', ns_map):
+ cname = enumval.attrib[identifier_key]
+ cvalue = '%s (0x%x)' % (cname, int(enumval.attrib['value']))
+ constants[cname] = cvalue
+
+ for setting in settings:
setting_type_name = 'NM' + setting.attrib['name'];
- symbol_prefix = setting.attrib[symbol_prefix_key]
- setting_name = constants['NM_' + symbol_prefix.upper() + '_SETTING_NAME']
- setting_names[setting_type_name] = setting_name
+ setting_name_symbol = 'NM_' + setting.attrib[symbol_prefix_key].upper() + '_SETTING_NAME'
+ if constants.has_key(setting_name_symbol):
+ setting_name = constants[setting_name_symbol]
+ setting_names[setting_type_name] = setting_name
def get_prop_type(setting, pspec, propxml):
- prop_type = pspec.value_type.name
- if prop_type in type_name_map:
- prop_type = type_name_map[prop_type]
- if prop_type is None:
- prop_type = ''
+ dbus_type = setting.get_dbus_property_type(pspec.name).dup_string()
+ prop_type = dbus_type_name_map[dbus_type]
+
+ if GObject.type_is_a(pspec.value_type, GObject.TYPE_ENUM) or GObject.type_is_a(pspec.value_type, GObject.TYPE_FLAGS):
+ prop_type = "%s (%s)" % (pspec.value_type.name, prop_type)
+
return prop_type
def get_docs(setting, pspec, propxml):
@@ -106,6 +115,8 @@ def get_docs(setting, pspec, propxml):
# remaining gtk-doc cleanup
doc = doc.replace('%%', '%')
+ doc = doc.replace('<!-- -->', '')
+ doc = re.sub(r' Element-.ype:.*', '', doc)
doc = re.sub(r'#([A-Z]\w*)', r'\1', doc)
# Remove sentences that refer to functions
@@ -140,24 +151,29 @@ def usage():
exit()
parser = argparse.ArgumentParser()
-parser.add_argument('-g', '--gir', metavar='FILE', help='NetworkManager-1.0.gir file')
+parser.add_argument('-g', '--gir', metavar='FILE', help='NM-1.0.gir file')
+parser.add_argument('-x', '--overrides', metavar='FILE', help='documentation overrides file')
parser.add_argument('-o', '--output', metavar='FILE', help='output file')
args = parser.parse_args()
if args.gir is None or args.output is None:
usage()
-NetworkManager.utils_init()
-
girxml = ET.parse(args.gir).getroot()
outfile = open(args.output, mode='w')
-init_constants(girxml)
-
basexml = girxml.find('./gi:namespace/gi:class[@name="Setting"]', ns_map)
settings = girxml.findall('./gi:namespace/gi:class[@parent="Setting"]', ns_map)
+# Hack. Need a better way to do this
+ipxml = girxml.find('./gi:namespace/gi:class[@name="SettingIPConfig"]', ns_map)
+settings.extend(girxml.findall('./gi:namespace/gi:class[@parent="SettingIPConfig"]', ns_map))
settings = sorted(settings, key=lambda setting: setting.attrib['{%s}symbol-prefix' % ns_map['c']])
+init_constants(girxml, settings)
+
+if args.overrides is not None:
+ overrides = ET.parse(args.overrides).getroot()
+
outfile.write("""<?xml version=\"1.0\"?>
<!DOCTYPE nm-setting-docs [
<!ENTITY quot "&#34;">
@@ -166,27 +182,52 @@ outfile.write("""<?xml version=\"1.0\"?>
""")
for settingxml in settings:
- new_func = NetworkManager.__getattr__(settingxml.attrib['name'])
+ if settingxml.attrib.has_key('abstract'):
+ continue
+
+ new_func = NM.__getattr__(settingxml.attrib['name'])
setting = new_func()
outfile.write(" <setting name=\"%s\">\n" % setting.props.name)
- properties = sorted(GObject.list_properties(setting), key=lambda prop: prop.name)
- for pspec in properties:
- propxml = settingxml.find('./gi:property[@name="%s"]' % pspec.name, ns_map)
- if propxml is None:
- propxml = basexml.find('./gi:property[@name="%s"]' % pspec.name, ns_map)
+ setting_properties = { prop.name: prop for prop in GObject.list_properties(setting) }
+ if args.overrides is None:
+ setting_overrides = {}
+ else:
+ setting_overrides = { override.attrib['name']: override for override in overrides.findall('./setting[@name="%s"]/property' % setting.props.name) }
+
+ properties = sorted(set.union(set(setting_properties.keys()), set(setting_overrides.keys())))
+
+ for prop in properties:
+ value_type = None
+ value_desc = None
+ default_value = None
- value_type = get_prop_type(setting, pspec, propxml)
- value_desc = get_docs(setting, pspec, propxml)
- default_value = get_default_value(setting, pspec, propxml)
+ if prop in setting_properties:
+ pspec = setting_properties[prop]
+ propxml = settingxml.find('./gi:property[@name="%s"]' % pspec.name, ns_map)
+ if propxml is None:
+ propxml = basexml.find('./gi:property[@name="%s"]' % pspec.name, ns_map)
+ if propxml is None:
+ propxml = ipxml.find('./gi:property[@name="%s"]' % pspec.name, ns_map)
+
+ value_type = get_prop_type(setting, pspec, propxml)
+ value_desc = get_docs(setting, pspec, propxml)
+ default_value = get_default_value(setting, pspec, propxml)
+
+ if prop in setting_overrides:
+ override = setting_overrides[prop]
+ if override.attrib['format'] != '':
+ value_type = override.attrib['format']
+ if override.attrib['description'] != '':
+ value_desc = override.attrib['description']
if default_value is not None:
outfile.write(" <property name=\"%s\" type=\"%s\" default=\"%s\" description=\"%s\" />\n" %
- (pspec.name, value_type, escape(default_value), escape(value_desc)))
+ (prop, value_type, escape(default_value), escape(value_desc)))
else:
outfile.write(" <property name=\"%s\" type=\"%s\" description=\"%s\" />\n" %
- (pspec.name, value_type, escape(value_desc)))
+ (prop, value_type, escape(value_desc)))
outfile.write(" </setting>\n")
diff --git a/libnm/libnm.pc.in b/libnm/libnm.pc.in
index 6392799a7b..5fe26b6a02 100644
--- a/libnm/libnm.pc.in
+++ b/libnm/libnm.pc.in
@@ -6,7 +6,7 @@ includedir=@includedir@
Name: libnm
Description: Convenience library for clients of NetworkManager
Version: @VERSION@
-Requires: gio-2.0 dbus-glib-1
+Requires: gio-2.0
Cflags: -I${includedir}/libnm
Libs: -L${libdir} -lnm
diff --git a/libnm/libnm.ver b/libnm/libnm.ver
index d735a30e38..44b83f6ecb 100644
--- a/libnm/libnm.ver
+++ b/libnm/libnm.ver
@@ -1,4 +1,4 @@
-{
+libnm_1_0_0 {
global:
nm_802_11_ap_flags_get_type;
nm_802_11_ap_security_flags_get_type;
@@ -237,6 +237,7 @@ global:
nm_device_type_get_type;
nm_device_vlan_get_carrier;
nm_device_vlan_get_hw_address;
+ nm_device_vlan_get_parent;
nm_device_vlan_get_type;
nm_device_vlan_get_vlan_id;
nm_device_wifi_capabilities_get_type;
@@ -262,79 +263,57 @@ global:
nm_device_wimax_get_rssi;
nm_device_wimax_get_tx_power;
nm_device_wimax_get_type;
- nm_dhcp4_config_get_one_option;
- nm_dhcp4_config_get_options;
- nm_dhcp4_config_get_type;
- nm_dhcp6_config_get_one_option;
- nm_dhcp6_config_get_options;
- nm_dhcp6_config_get_type;
- nm_ip4_address_compare;
- nm_ip4_address_dup;
- nm_ip4_address_get_address;
- nm_ip4_address_get_gateway;
- nm_ip4_address_get_prefix;
- nm_ip4_address_get_type;
- nm_ip4_address_new;
- nm_ip4_address_ref;
- nm_ip4_address_set_address;
- nm_ip4_address_set_gateway;
- nm_ip4_address_set_prefix;
- nm_ip4_address_unref;
- nm_ip4_config_get_addresses;
- nm_ip4_config_get_domains;
- nm_ip4_config_get_gateway;
- nm_ip4_config_get_nameservers;
- nm_ip4_config_get_routes;
- nm_ip4_config_get_searches;
- nm_ip4_config_get_type;
- nm_ip4_config_get_wins_servers;
- nm_ip4_route_compare;
- nm_ip4_route_dup;
- nm_ip4_route_get_dest;
- nm_ip4_route_get_metric;
- nm_ip4_route_get_next_hop;
- nm_ip4_route_get_prefix;
- nm_ip4_route_get_type;
- nm_ip4_route_new;
- nm_ip4_route_ref;
- nm_ip4_route_set_dest;
- nm_ip4_route_set_metric;
- nm_ip4_route_set_next_hop;
- nm_ip4_route_set_prefix;
- nm_ip4_route_unref;
- nm_ip6_address_compare;
- nm_ip6_address_dup;
- nm_ip6_address_get_address;
- nm_ip6_address_get_gateway;
- nm_ip6_address_get_prefix;
- nm_ip6_address_get_type;
- nm_ip6_address_new;
- nm_ip6_address_ref;
- nm_ip6_address_set_address;
- nm_ip6_address_set_gateway;
- nm_ip6_address_set_prefix;
- nm_ip6_address_unref;
- nm_ip6_config_get_addresses;
- nm_ip6_config_get_domains;
- nm_ip6_config_get_gateway;
- nm_ip6_config_get_nameservers;
- nm_ip6_config_get_routes;
- nm_ip6_config_get_searches;
- nm_ip6_config_get_type;
- nm_ip6_route_compare;
- nm_ip6_route_dup;
- nm_ip6_route_get_dest;
- nm_ip6_route_get_metric;
- nm_ip6_route_get_next_hop;
- nm_ip6_route_get_prefix;
- nm_ip6_route_get_type;
- nm_ip6_route_new;
- nm_ip6_route_ref;
- nm_ip6_route_set_dest;
- nm_ip6_route_set_metric;
- nm_ip6_route_set_next_hop;
- nm_ip6_route_set_prefix;
- nm_ip6_route_unref;
+ nm_dhcp_config_get_family;
+ nm_dhcp_config_get_one_option;
+ nm_dhcp_config_get_options;
+ nm_dhcp_config_get_type;
+ nm_ip_address_equal;
+ nm_ip_address_get_address;
+ nm_ip_address_get_address_binary;
+ nm_ip_address_get_attribute;
+ nm_ip_address_get_attribute_names;
+ nm_ip_address_get_family;
+ nm_ip_address_get_prefix;
+ nm_ip_address_get_type;
+ nm_ip_address_new;
+ nm_ip_address_new_binary;
+ nm_ip_address_ref;
+ nm_ip_address_set_address;
+ nm_ip_address_set_address_binary;
+ nm_ip_address_set_attribute;
+ nm_ip_address_set_prefix;
+ nm_ip_address_unref;
+ nm_ip_config_get_addresses;
+ nm_ip_config_get_domains;
+ nm_ip_config_get_family;
+ nm_ip_config_get_gateway;
+ nm_ip_config_get_nameservers;
+ nm_ip_config_get_routes;
+ nm_ip_config_get_searches;
+ nm_ip_config_get_type;
+ nm_ip_config_get_wins_servers;
+ nm_ip_route_equal;
+ nm_ip_route_get_attribute;
+ nm_ip_route_get_attribute_names;
+ nm_ip_route_get_dest;
+ nm_ip_route_get_dest_binary;
+ nm_ip_route_get_family;
+ nm_ip_route_get_metric;
+ nm_ip_route_get_next_hop;
+ nm_ip_route_get_next_hop_binary;
+ nm_ip_route_get_prefix;
+ nm_ip_route_get_type;
+ nm_ip_route_new;
+ nm_ip_route_new_binary;
+ nm_ip_route_ref;
+ nm_ip_route_set_attribute;
+ nm_ip_route_set_dest;
+ nm_ip_route_set_dest_binary;
+ nm_ip_route_set_metric;
+ nm_ip_route_set_next_hop;
+ nm_ip_route_set_next_hop_binary;
+ nm_ip_route_set_prefix;
+ nm_ip_route_unref;
nm_manager_error_get_type;
nm_manager_error_quark;
nm_object_get_path;
@@ -355,20 +334,20 @@ global:
nm_remote_connection_save_async;
nm_remote_connection_save_finish;
nm_secret_agent_capabilities_get_type;
- nm_secret_agent_delete_secrets;
nm_secret_agent_error_get_type;
nm_secret_agent_error_quark;
- nm_secret_agent_get_registered;
- nm_secret_agent_get_secrets;
nm_secret_agent_get_secrets_flags_get_type;
- nm_secret_agent_get_type;
- nm_secret_agent_register;
- nm_secret_agent_register_async;
- nm_secret_agent_register_finish;
- nm_secret_agent_save_secrets;
- nm_secret_agent_unregister;
- nm_secret_agent_unregister_async;
- nm_secret_agent_unregister_finish;
+ nm_secret_agent_old_delete_secrets;
+ nm_secret_agent_old_get_registered;
+ nm_secret_agent_old_get_secrets;
+ nm_secret_agent_old_get_type;
+ nm_secret_agent_old_register;
+ nm_secret_agent_old_register_async;
+ nm_secret_agent_old_register_finish;
+ nm_secret_agent_old_save_secrets;
+ nm_secret_agent_old_unregister;
+ nm_secret_agent_old_unregister_async;
+ nm_secret_agent_old_unregister_finish;
nm_setting_802_1x_add_altsubject_match;
nm_setting_802_1x_add_eap_method;
nm_setting_802_1x_add_phase2_altsubject_match;
@@ -541,6 +520,7 @@ global:
nm_setting_enumerate_values;
nm_setting_generic_get_type;
nm_setting_generic_new;
+ nm_setting_get_dbus_property_type;
nm_setting_get_name;
nm_setting_get_secret_flags;
nm_setting_get_type;
@@ -563,74 +543,47 @@ global:
nm_setting_infiniband_get_type;
nm_setting_infiniband_get_virtual_interface_name;
nm_setting_infiniband_new;
- nm_setting_ip4_config_add_address;
- nm_setting_ip4_config_add_dns;
- nm_setting_ip4_config_add_dns_search;
- nm_setting_ip4_config_add_route;
- nm_setting_ip4_config_clear_addresses;
- nm_setting_ip4_config_clear_dns;
- nm_setting_ip4_config_clear_dns_searches;
- nm_setting_ip4_config_clear_routes;
- nm_setting_ip4_config_get_address;
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_dns;
- nm_setting_ip4_config_get_dns_search;
- nm_setting_ip4_config_get_ignore_auto_dns;
- nm_setting_ip4_config_get_ignore_auto_routes;
- nm_setting_ip4_config_get_may_fail;
- nm_setting_ip4_config_get_method;
- nm_setting_ip4_config_get_never_default;
- nm_setting_ip4_config_get_num_addresses;
- nm_setting_ip4_config_get_num_dns;
- nm_setting_ip4_config_get_num_dns_searches;
- nm_setting_ip4_config_get_num_routes;
- nm_setting_ip4_config_get_route;
nm_setting_ip4_config_get_type;
nm_setting_ip4_config_new;
- nm_setting_ip4_config_remove_address;
- nm_setting_ip4_config_remove_address_by_value;
- nm_setting_ip4_config_remove_dns;
- nm_setting_ip4_config_remove_dns_by_value;
- nm_setting_ip4_config_remove_dns_search;
- nm_setting_ip4_config_remove_dns_search_by_value;
- nm_setting_ip4_config_remove_route;
- nm_setting_ip4_config_remove_route_by_value;
- nm_setting_ip6_config_add_address;
- nm_setting_ip6_config_add_dns;
- nm_setting_ip6_config_add_dns_search;
- nm_setting_ip6_config_add_route;
- nm_setting_ip6_config_clear_addresses;
- nm_setting_ip6_config_clear_dns;
- nm_setting_ip6_config_clear_dns_searches;
- nm_setting_ip6_config_clear_routes;
- nm_setting_ip6_config_get_address;
- nm_setting_ip6_config_get_dhcp_hostname;
- nm_setting_ip6_config_get_dns;
- nm_setting_ip6_config_get_dns_search;
- nm_setting_ip6_config_get_ignore_auto_dns;
- nm_setting_ip6_config_get_ignore_auto_routes;
nm_setting_ip6_config_get_ip6_privacy;
- nm_setting_ip6_config_get_may_fail;
- nm_setting_ip6_config_get_method;
- nm_setting_ip6_config_get_never_default;
- nm_setting_ip6_config_get_num_addresses;
- nm_setting_ip6_config_get_num_dns;
- nm_setting_ip6_config_get_num_dns_searches;
- nm_setting_ip6_config_get_num_routes;
- nm_setting_ip6_config_get_route;
nm_setting_ip6_config_get_type;
nm_setting_ip6_config_new;
nm_setting_ip6_config_privacy_get_type;
- nm_setting_ip6_config_remove_address;
- nm_setting_ip6_config_remove_address_by_value;
- nm_setting_ip6_config_remove_dns;
- nm_setting_ip6_config_remove_dns_by_value;
- nm_setting_ip6_config_remove_dns_search;
- nm_setting_ip6_config_remove_dns_search_by_value;
- nm_setting_ip6_config_remove_route;
- nm_setting_ip6_config_remove_route_by_value;
+ nm_setting_ip_config_add_address;
+ nm_setting_ip_config_add_dns;
+ nm_setting_ip_config_add_dns_search;
+ nm_setting_ip_config_add_route;
+ nm_setting_ip_config_clear_addresses;
+ nm_setting_ip_config_clear_dns;
+ nm_setting_ip_config_clear_dns_searches;
+ nm_setting_ip_config_clear_routes;
+ nm_setting_ip_config_get_address;
+ nm_setting_ip_config_get_dhcp_hostname;
+ nm_setting_ip_config_get_dhcp_send_hostname;
+ nm_setting_ip_config_get_dns;
+ nm_setting_ip_config_get_dns_search;
+ nm_setting_ip_config_get_gateway;
+ nm_setting_ip_config_get_ignore_auto_dns;
+ nm_setting_ip_config_get_ignore_auto_routes;
+ nm_setting_ip_config_get_may_fail;
+ nm_setting_ip_config_get_method;
+ nm_setting_ip_config_get_never_default;
+ nm_setting_ip_config_get_num_addresses;
+ nm_setting_ip_config_get_num_dns;
+ nm_setting_ip_config_get_num_dns_searches;
+ nm_setting_ip_config_get_num_routes;
+ nm_setting_ip_config_get_route;
+ nm_setting_ip_config_get_route_metric;
+ nm_setting_ip_config_get_type;
+ nm_setting_ip_config_remove_address;
+ nm_setting_ip_config_remove_address_by_value;
+ nm_setting_ip_config_remove_dns;
+ nm_setting_ip_config_remove_dns_by_value;
+ nm_setting_ip_config_remove_dns_search;
+ nm_setting_ip_config_remove_dns_search_by_value;
+ nm_setting_ip_config_remove_route;
+ nm_setting_ip_config_remove_route_by_value;
nm_setting_lookup_type;
nm_setting_olpc_mesh_get_channel;
nm_setting_olpc_mesh_get_dhcp_anycast_address;
@@ -802,10 +755,11 @@ global:
nm_utils_ap_mode_security_valid;
nm_utils_bin2hexstr;
nm_utils_check_virtual_device_compatibility;
- nm_utils_deinit;
nm_utils_escape_ssid;
+ nm_utils_file_is_certificate;
nm_utils_file_is_pkcs12;
- nm_utils_hex2byte;
+ nm_utils_file_is_private_key;
+ nm_utils_file_search_in_paths;
nm_utils_hexstr2bin;
nm_utils_hwaddr_atoba;
nm_utils_hwaddr_aton;
@@ -817,7 +771,6 @@ global:
nm_utils_iface_valid_name;
nm_utils_inet4_ntop;
nm_utils_inet6_ntop;
- nm_utils_init;
nm_utils_ip4_addresses_from_variant;
nm_utils_ip4_addresses_to_variant;
nm_utils_ip4_dns_from_variant;
@@ -833,16 +786,14 @@ global:
nm_utils_ip6_dns_to_variant;
nm_utils_ip6_routes_from_variant;
nm_utils_ip6_routes_to_variant;
+ nm_utils_ipaddr_valid;
nm_utils_is_empty_ssid;
nm_utils_is_uuid;
- nm_utils_rsa_key_encrypt;
- nm_utils_rsa_key_encrypt_aes;
nm_utils_same_ssid;
nm_utils_security_type_get_type;
nm_utils_security_valid;
nm_utils_ssid_to_utf8;
nm_utils_uuid_generate;
- nm_utils_uuid_generate_from_string;
nm_utils_wep_key_valid;
nm_utils_wifi_channel_to_freq;
nm_utils_wifi_find_next_channel;
@@ -857,6 +808,16 @@ global:
nm_vpn_connection_get_vpn_state;
nm_vpn_connection_state_get_type;
nm_vpn_connection_state_reason_get_type;
+ nm_vpn_editor_get_type;
+ nm_vpn_editor_get_widget;
+ nm_vpn_editor_plugin_capability_get_type;
+ nm_vpn_editor_plugin_export;
+ nm_vpn_editor_plugin_get_capabilities;
+ nm_vpn_editor_plugin_get_editor;
+ nm_vpn_editor_plugin_get_suggested_filename;
+ nm_vpn_editor_plugin_get_type;
+ nm_vpn_editor_plugin_import;
+ nm_vpn_editor_update_connection;
nm_vpn_plugin_error_get_type;
nm_vpn_plugin_error_quark;
nm_vpn_plugin_failure_get_type;
@@ -871,17 +832,6 @@ global:
nm_vpn_plugin_old_set_ip4_config;
nm_vpn_plugin_old_set_login_banner;
nm_vpn_plugin_old_set_state;
- nm_vpn_plugin_ui_capability_get_type;
- nm_vpn_plugin_ui_interface_export;
- nm_vpn_plugin_ui_interface_get_capabilities;
- nm_vpn_plugin_ui_interface_get_suggested_name;
- nm_vpn_plugin_ui_interface_get_type;
- nm_vpn_plugin_ui_interface_import;
- nm_vpn_plugin_ui_interface_prop_get_type;
- nm_vpn_plugin_ui_interface_ui_factory;
- nm_vpn_plugin_ui_widget_interface_get_type;
- nm_vpn_plugin_ui_widget_interface_get_widget;
- nm_vpn_plugin_ui_widget_interface_update_connection;
nm_vpn_service_state_get_type;
nm_wep_key_type_get_type;
nm_wimax_nsp_connection_valid;
@@ -894,3 +844,12 @@ global:
local:
*;
};
+
+libnm_1_2_0 {
+global:
+ nm_setting_802_1x_check_cert_scheme;
+ nm_setting_bridge_get_multicast_snooping;
+ nm_setting_wireless_get_powersave;
+ nm_utils_bond_mode_int_to_string;
+ nm_utils_bond_mode_string_to_int;
+} libnm_1_0_0;
diff --git a/libnm/nm-access-point.c b/libnm/nm-access-point.c
index dfc7240192..e20cd9971e 100644
--- a/libnm/nm-access-point.c
+++ b/libnm/nm-access-point.c
@@ -19,7 +19,8 @@
* Copyright 2007 - 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include "nm-glib-compat.h"
@@ -121,7 +122,8 @@ nm_access_point_get_rsn_flags (NMAccessPoint *ap)
*
* Gets the SSID of the access point.
*
- * Returns: the #GBytes containing the SSID, or %NULL if the SSID is unknown.
+ * Returns: (transfer none): the #GBytes containing the SSID, or %NULL if the
+ * SSID is unknown.
**/
GBytes *
nm_access_point_get_ssid (NMAccessPoint *ap)
diff --git a/libnm/nm-active-connection.c b/libnm/nm-active-connection.c
index 742b270cc6..31f513280d 100644
--- a/libnm/nm-active-connection.c
+++ b/libnm/nm-active-connection.c
@@ -19,6 +19,8 @@
* Copyright 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "nm-dbus-interface.h"
@@ -57,11 +59,11 @@ typedef struct {
GPtrArray *devices;
NMActiveConnectionState state;
gboolean is_default;
- NMIP4Config *ip4_config;
- NMDhcp4Config *dhcp4_config;
+ NMIPConfig *ip4_config;
+ NMDhcpConfig *dhcp4_config;
gboolean is_default6;
- NMIP6Config *ip6_config;
- NMDhcp6Config *dhcp6_config;
+ NMIPConfig *ip6_config;
+ NMDhcpConfig *dhcp6_config;
gboolean is_vpn;
NMDevice *master;
} NMActiveConnectionPrivate;
@@ -242,13 +244,12 @@ nm_active_connection_get_default (NMActiveConnection *connection)
* nm_active_connection_get_ip4_config:
* @connection: an #NMActiveConnection
*
- * Gets the current #NMIP4Config associated with the #NMActiveConnection.
+ * Gets the current IPv4 #NMIPConfig associated with the #NMActiveConnection.
*
- * Returns: (transfer none): the #NMIP4Config, or %NULL if the
- * connection is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
- * state.
+ * Returns: (transfer none): the IPv4 #NMIPConfig, or %NULL if the connection is
+ * not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
**/
-NMIP4Config *
+NMIPConfig *
nm_active_connection_get_ip4_config (NMActiveConnection *connection)
{
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
@@ -260,14 +261,14 @@ nm_active_connection_get_ip4_config (NMActiveConnection *connection)
* nm_active_connection_get_dhcp4_config:
* @connection: an #NMActiveConnection
*
- * Gets the current #NMDhcp4Config (if any) associated with the
+ * Gets the current IPv4 #NMDhcpConfig (if any) associated with the
* #NMActiveConnection.
*
- * Returns: (transfer none): the #NMDhcp4Config, or %NULL if the
- * connection does not use DHCP, or is not in the
- * %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
+ * Returns: (transfer none): the IPv4 #NMDhcpConfig, or %NULL if the connection
+ * does not use DHCP, or is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
+ * state.
**/
-NMDhcp4Config *
+NMDhcpConfig *
nm_active_connection_get_dhcp4_config (NMActiveConnection *connection)
{
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
@@ -296,13 +297,12 @@ nm_active_connection_get_default6 (NMActiveConnection *connection)
* nm_active_connection_get_ip6_config:
* @connection: an #NMActiveConnection
*
- * Gets the current #NMIP6Config associated with the #NMActiveConnection.
+ * Gets the current IPv6 #NMIPConfig associated with the #NMActiveConnection.
*
- * Returns: (transfer none): the #NMIP6Config, or %NULL if the
- * connection is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
- * state.
+ * Returns: (transfer none): the IPv6 #NMIPConfig, or %NULL if the connection is
+ * not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
**/
-NMIP6Config *
+NMIPConfig *
nm_active_connection_get_ip6_config (NMActiveConnection *connection)
{
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
@@ -314,14 +314,14 @@ nm_active_connection_get_ip6_config (NMActiveConnection *connection)
* nm_active_connection_get_dhcp6_config:
* @connection: an #NMActiveConnection
*
- * Gets the current #NMDhcp6Config (if any) associated with the
+ * Gets the current IPv6 #NMDhcpConfig (if any) associated with the
* #NMActiveConnection.
*
- * Returns: (transfer none): the #NMDhcp6Config, or %NULL if the
- * connection does not use DHCPv6, or is not in the
- * %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
+ * Returns: (transfer none): the IPv6 #NMDhcpConfig, or %NULL if the connection
+ * does not use DHCPv6, or is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
+ * state.
**/
-NMDhcp6Config *
+NMDhcpConfig *
nm_active_connection_get_dhcp6_config (NMActiveConnection *connection)
{
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
@@ -631,24 +631,24 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
/**
* NMActiveConnection:ip4-config:
*
- * The #NMIP4Config of the connection.
+ * The IPv4 #NMIPConfig of the connection.
**/
g_object_class_install_property
(object_class, PROP_IP4_CONFIG,
g_param_spec_object (NM_ACTIVE_CONNECTION_IP4_CONFIG, "", "",
- NM_TYPE_IP4_CONFIG,
+ NM_TYPE_IP_CONFIG,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMActiveConnection:dhcp4-config:
*
- * The #NMDhcp4Config of the connection.
+ * The IPv4 #NMDhcpConfig of the connection.
**/
g_object_class_install_property
(object_class, PROP_DHCP4_CONFIG,
g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, "", "",
- NM_TYPE_DHCP4_CONFIG,
+ NM_TYPE_DHCP_CONFIG,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
@@ -667,24 +667,24 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
/**
* NMActiveConnection:ip6-config:
*
- * The #NMIP6Config of the connection.
+ * The IPv6 #NMIPConfig of the connection.
**/
g_object_class_install_property
(object_class, PROP_IP6_CONFIG,
g_param_spec_object (NM_ACTIVE_CONNECTION_IP6_CONFIG, "", "",
- NM_TYPE_IP6_CONFIG,
+ NM_TYPE_IP_CONFIG,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMActiveConnection:dhcp6-config:
*
- * The #NMDhcp6Config of the connection.
+ * The IPv6 #NMDhcpConfig of the connection.
**/
g_object_class_install_property
(object_class, PROP_DHCP6_CONFIG,
g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, "", "",
- NM_TYPE_DHCP6_CONFIG,
+ NM_TYPE_DHCP_CONFIG,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
diff --git a/libnm/nm-active-connection.h b/libnm/nm-active-connection.h
index ef8dd1980b..4bc8414828 100644
--- a/libnm/nm-active-connection.h
+++ b/libnm/nm-active-connection.h
@@ -75,11 +75,11 @@ const GPtrArray *nm_active_connection_get_devices (NMActive
NMActiveConnectionState nm_active_connection_get_state (NMActiveConnection *connection);
NMDevice *nm_active_connection_get_master (NMActiveConnection *connection);
gboolean nm_active_connection_get_default (NMActiveConnection *connection);
-NMIP4Config *nm_active_connection_get_ip4_config (NMActiveConnection *connection);
-NMDhcp4Config *nm_active_connection_get_dhcp4_config (NMActiveConnection *connection);
+NMIPConfig *nm_active_connection_get_ip4_config (NMActiveConnection *connection);
+NMDhcpConfig *nm_active_connection_get_dhcp4_config (NMActiveConnection *connection);
gboolean nm_active_connection_get_default6 (NMActiveConnection *connection);
-NMIP6Config *nm_active_connection_get_ip6_config (NMActiveConnection *connection);
-NMDhcp6Config *nm_active_connection_get_dhcp6_config (NMActiveConnection *connection);
+NMIPConfig *nm_active_connection_get_ip6_config (NMActiveConnection *connection);
+NMDhcpConfig *nm_active_connection_get_dhcp6_config (NMActiveConnection *connection);
gboolean nm_active_connection_get_vpn (NMActiveConnection *connection);
G_END_DECLS
diff --git a/libnm/nm-client.c b/libnm/nm-client.c
index f6a2256709..e0a2a7b4f4 100644
--- a/libnm/nm-client.c
+++ b/libnm/nm-client.c
@@ -19,6 +19,8 @@
* Copyright 2007 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <nm-utils.h>
@@ -469,7 +471,7 @@ nm_client_get_permission_result (NMClient *client, NMClientPermission permission
NMConnectivityState
nm_client_get_connectivity (NMClient *client)
{
- g_return_val_if_fail (NM_IS_CLIENT (client), NM_STATE_UNKNOWN);
+ g_return_val_if_fail (NM_IS_CLIENT (client), NM_CONNECTIVITY_UNKNOWN);
return nm_manager_get_connectivity (NM_CLIENT_GET_PRIVATE (client)->manager);
}
@@ -700,9 +702,9 @@ nm_client_save_hostname_finish (NMClient *client,
* @client: a #NMClient
*
* Gets all the known network devices. Use nm_device_get_type() or the
- * NM_IS_DEVICE_XXXX() functions to determine what kind of device member of the
- * returned array is, and then you may use device-specific methods such as
- * nm_device_ethernet_get_hw_address().
+ * <literal>NM_IS_DEVICE_XXXX</literal> functions to determine what kind of
+ * device member of the returned array is, and then you may use device-specific
+ * methods such as nm_device_ethernet_get_hw_address().
*
* Returns: (transfer none) (element-type NMDevice): a #GPtrArray
* containing all the #NMDevices. The returned array is owned by the
@@ -1786,13 +1788,6 @@ init_async (GAsyncInitable *initable, int io_priority,
{
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (initable);
NMClientInitData *init_data;
- GError *error = NULL;
-
- if (!nm_utils_init (&error)) {
- g_simple_async_report_take_gerror_in_idle (G_OBJECT (initable),
- callback, user_data, error);
- return;
- }
init_data = g_slice_new0 (NMClientInitData);
init_data->client = NM_CLIENT (initable);
@@ -1825,8 +1820,14 @@ dispose (GObject *object)
{
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object);
- g_clear_object (&priv->manager);
- g_clear_object (&priv->settings);
+ if (priv->manager) {
+ g_signal_handlers_disconnect_by_data (priv->manager, object);
+ g_clear_object (&priv->manager);
+ }
+ if (priv->settings) {
+ g_signal_handlers_disconnect_by_data (priv->settings, object);
+ g_clear_object (&priv->settings);
+ }
G_OBJECT_CLASS (nm_client_parent_class)->dispose (object);
}
diff --git a/libnm/nm-dbus-helpers.c b/libnm/nm-dbus-helpers.c
index 5b24b2a366..6bfd4bbd83 100644
--- a/libnm/nm-dbus-helpers.c
+++ b/libnm/nm-dbus-helpers.c
@@ -18,8 +18,9 @@
* Copyright 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <config.h>
#include <gio/gio.h>
#include "nm-dbus-helpers.h"
#include "nm-dbus-interface.h"
@@ -348,6 +349,7 @@ _nm_dbus_bind_properties (gpointer object, gpointer skeleton)
skeleton, properties[i]->name,
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
}
+ g_free (properties);
}
static char *
diff --git a/libnm/nm-device-adsl.c b/libnm/nm-device-adsl.c
index af0afa52d1..99771548f8 100644
--- a/libnm/nm-device-adsl.c
+++ b/libnm/nm-device-adsl.c
@@ -19,6 +19,8 @@
* Copyright 2009 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include "nm-device-adsl.h"
#include "nm-device-private.h"
#include "nm-object-private.h"
@@ -27,7 +29,7 @@
#include "nm-setting-connection.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
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 7f2ada911d..6bb673233d 100644
--- a/libnm/nm-device-bond.c
+++ b/libnm/nm-device-bond.c
@@ -18,9 +18,10 @@
* Copyright 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-bridge.c b/libnm/nm-device-bridge.c
index 5a3782e742..ce28f2c2f4 100644
--- a/libnm/nm-device-bridge.c
+++ b/libnm/nm-device-bridge.c
@@ -18,9 +18,10 @@
* Copyright 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c
index 5673792cfb..7752646457 100644
--- a/libnm/nm-device-bt.c
+++ b/libnm/nm-device-bt.c
@@ -19,9 +19,10 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c
index c240aa9681..be2cb4dc40 100644
--- a/libnm/nm-device-ethernet.c
+++ b/libnm/nm-device-ethernet.c
@@ -19,9 +19,10 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-generic.c b/libnm/nm-device-generic.c
index a2a4935361..3ed0fa7e63 100644
--- a/libnm/nm-device-generic.c
+++ b/libnm/nm-device-generic.c
@@ -18,10 +18,10 @@
* Copyright 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#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 1409e0b298..bce8a87aa2 100644
--- a/libnm/nm-device-infiniband.c
+++ b/libnm/nm-device-infiniband.c
@@ -18,9 +18,10 @@
* Copyright 2011 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-modem.c b/libnm/nm-device-modem.c
index 25c63f753e..dcbb447a2f 100644
--- a/libnm/nm-device-modem.c
+++ b/libnm/nm-device-modem.c
@@ -19,9 +19,10 @@
* Copyright 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-olpc-mesh.c b/libnm/nm-device-olpc-mesh.c
index 6b5df27ca8..108e533982 100644
--- a/libnm/nm-device-olpc-mesh.c
+++ b/libnm/nm-device-olpc-mesh.c
@@ -18,9 +18,10 @@
* Copyright 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c
index d76baf22a6..cff1d71849 100644
--- a/libnm/nm-device-team.c
+++ b/libnm/nm-device-team.c
@@ -18,9 +18,10 @@
* Copyright 2013 Jiri Pirko <jiri@resnulli.us>
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-vlan.c b/libnm/nm-device-vlan.c
index 51bf901364..fb6e3bd7b2 100644
--- a/libnm/nm-device-vlan.c
+++ b/libnm/nm-device-vlan.c
@@ -18,9 +18,10 @@
* Copyright 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
@@ -40,6 +41,7 @@ G_DEFINE_TYPE (NMDeviceVlan, nm_device_vlan, NM_TYPE_DEVICE)
typedef struct {
char *hw_address;
gboolean carrier;
+ NMDevice *parent;
guint vlan_id;
} NMDeviceVlanPrivate;
@@ -47,6 +49,7 @@ enum {
PROP_0,
PROP_HW_ADDRESS,
PROP_CARRIER,
+ PROP_PARENT,
PROP_VLAN_ID,
LAST_PROP
@@ -86,6 +89,20 @@ nm_device_vlan_get_carrier (NMDeviceVlan *device)
}
/**
+ * nm_device_vlan_get_parent:
+ * @device: a #NMDeviceVlan
+ *
+ * Returns: (transfer none): the device's parent device
+ **/
+NMDevice *
+nm_device_vlan_get_parent (NMDeviceVlan *device)
+{
+ g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE);
+
+ return NM_DEVICE_VLAN_GET_PRIVATE (device)->parent;
+}
+
+/**
* nm_device_vlan_get_vlan_id:
* @device: a #NMDeviceVlan
*
@@ -165,6 +182,7 @@ init_dbus (NMObject *object)
const NMPropertiesInfo property_info[] = {
{ NM_DEVICE_VLAN_HW_ADDRESS, &priv->hw_address },
{ NM_DEVICE_VLAN_CARRIER, &priv->carrier },
+ { NM_DEVICE_VLAN_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE },
{ NM_DEVICE_VLAN_VLAN_ID, &priv->vlan_id },
{ NULL },
};
@@ -182,6 +200,7 @@ finalize (GObject *object)
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
g_free (priv->hw_address);
+ g_clear_object (&priv->parent);
G_OBJECT_CLASS (nm_device_vlan_parent_class)->finalize (object);
}
@@ -201,6 +220,9 @@ get_property (GObject *object,
case PROP_CARRIER:
g_value_set_boolean (value, nm_device_vlan_get_carrier (device));
break;
+ case PROP_PARENT:
+ g_value_set_object (value, nm_device_vlan_get_parent (device));
+ break;
case PROP_VLAN_ID:
g_value_set_uint (value, nm_device_vlan_get_vlan_id (device));
break;
@@ -258,6 +280,18 @@ nm_device_vlan_class_init (NMDeviceVlanClass *vlan_class)
G_PARAM_STATIC_STRINGS));
/**
+ * NMDeviceVlan:parent:
+ *
+ * The devices's parent device.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_PARENT,
+ g_param_spec_object (NM_DEVICE_VLAN_PARENT, "", "",
+ NM_TYPE_DEVICE,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
* NMDeviceVlan:vlan-id:
*
* The device's VLAN ID.
diff --git a/libnm/nm-device-vlan.h b/libnm/nm-device-vlan.h
index 824944f743..6ab2420220 100644
--- a/libnm/nm-device-vlan.h
+++ b/libnm/nm-device-vlan.h
@@ -15,7 +15,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2012 Red Hat, Inc.
+ * Copyright 2012 - 2014 Red Hat, Inc.
*/
#ifndef __NM_DEVICE_VLAN_H__
@@ -38,6 +38,7 @@ G_BEGIN_DECLS
#define NM_DEVICE_VLAN_HW_ADDRESS "hw-address"
#define NM_DEVICE_VLAN_CARRIER "carrier"
+#define NM_DEVICE_VLAN_PARENT "parent"
#define NM_DEVICE_VLAN_VLAN_ID "vlan-id"
struct _NMDeviceVlan {
@@ -55,6 +56,7 @@ GType nm_device_vlan_get_type (void);
const char * nm_device_vlan_get_hw_address (NMDeviceVlan *device);
gboolean nm_device_vlan_get_carrier (NMDeviceVlan *device);
+NMDevice * nm_device_vlan_get_parent (NMDeviceVlan *device);
guint nm_device_vlan_get_vlan_id (NMDeviceVlan *device);
G_END_DECLS
diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c
index c57c19c3f9..4a19f2e5a5 100644
--- a/libnm/nm-device-wifi.c
+++ b/libnm/nm-device-wifi.c
@@ -19,9 +19,10 @@
* Copyright 2007 - 2014 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-wimax.c b/libnm/nm-device-wimax.c
index 13097198c3..f199b669fa 100644
--- a/libnm/nm-device-wimax.c
+++ b/libnm/nm-device-wimax.c
@@ -19,9 +19,10 @@
* Copyright 2009 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device.c b/libnm/nm-device.c
index 5a1caf6d9f..96322e6392 100644
--- a/libnm/nm-device.c
+++ b/libnm/nm-device.c
@@ -19,9 +19,11 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gudev/gudev.h>
#include "nm-dbus-interface.h"
@@ -83,10 +85,10 @@ typedef struct {
gboolean managed;
gboolean firmware_missing;
gboolean autoconnect;
- NMIP4Config *ip4_config;
- NMDhcp4Config *dhcp4_config;
- NMIP6Config *ip6_config;
- NMDhcp6Config *dhcp6_config;
+ NMIPConfig *ip4_config;
+ NMDhcpConfig *dhcp4_config;
+ NMIPConfig *ip6_config;
+ NMDhcpConfig *dhcp6_config;
NMDeviceState state;
NMDeviceState last_seen_state;
NMDeviceStateReason reason;
@@ -651,43 +653,43 @@ nm_device_class_init (NMDeviceClass *device_class)
g_object_class_install_property
(object_class, PROP_IP4_CONFIG,
g_param_spec_object (NM_DEVICE_IP4_CONFIG, "", "",
- NM_TYPE_IP4_CONFIG,
+ NM_TYPE_IP_CONFIG,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMDevice:dhcp4-config:
*
- * The #NMDhcp4Config of the device.
+ * The IPv4 #NMDhcpConfig of the device.
**/
g_object_class_install_property
(object_class, PROP_DHCP4_CONFIG,
g_param_spec_object (NM_DEVICE_DHCP4_CONFIG, "", "",
- NM_TYPE_DHCP4_CONFIG,
+ NM_TYPE_DHCP_CONFIG,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMDevice:ip6-config:
*
- * The #NMIP6Config of the device.
+ * The IPv6 #NMIPConfig of the device.
**/
g_object_class_install_property
(object_class, PROP_IP6_CONFIG,
g_param_spec_object (NM_DEVICE_IP6_CONFIG, "", "",
- NM_TYPE_IP6_CONFIG,
+ NM_TYPE_IP_CONFIG,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMDevice:dhcp6-config:
*
- * The #NMDhcp6Config of the device.
+ * The IPv6 #NMDhcpConfig of the device.
**/
g_object_class_install_property
(object_class, PROP_DHCP6_CONFIG,
g_param_spec_object (NM_DEVICE_DHCP6_CONFIG, "", "",
- NM_TYPE_DHCP6_CONFIG,
+ NM_TYPE_DHCP_CONFIG,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
@@ -1106,15 +1108,15 @@ nm_device_get_firmware_missing (NMDevice *device)
* nm_device_get_ip4_config:
* @device: a #NMDevice
*
- * Gets the current #NMIP4Config associated with the #NMDevice.
+ * Gets the current IPv4 #NMIPConfig associated with the #NMDevice.
*
- * Note that as of NetworkManager 0.9.10, you can alternatively use
- * nm_active_connection_get_ip4_config(), which also works with VPN
- * connections.
+ * You can alternatively use nm_active_connection_get_ip4_config(), which also
+ * works with VPN connections.
*
- * Returns: (transfer none): the #NMIP4Config or %NULL if the device is not activated.
+ * Returns: (transfer none): the IPv4 #NMIPConfig, or %NULL if the device is not
+ * activated.
**/
-NMIP4Config *
+NMIPConfig *
nm_device_get_ip4_config (NMDevice *device)
{
g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
@@ -1126,16 +1128,15 @@ nm_device_get_ip4_config (NMDevice *device)
* nm_device_get_dhcp4_config:
* @device: a #NMDevice
*
- * Gets the current #NMDhcp4Config associated with the #NMDevice.
+ * Gets the current IPv4 #NMDhcpConfig associated with the #NMDevice.
*
- * Note that as of NetworkManager 0.9.10, you can alternatively use
- * nm_active_connection_get_dhcp4_config(), which also works with VPN
- * connections.
+ * You can alternatively use nm_active_connection_get_dhcp4_config(), which also
+ * works with VPN connections.
*
- * Returns: (transfer none): the #NMDhcp4Config or %NULL if the device is not activated or not
- * using DHCP.
+ * Returns: (transfer none): the IPv4 #NMDhcpConfig, or %NULL if the device is
+ * not activated or not using DHCP.
**/
-NMDhcp4Config *
+NMDhcpConfig *
nm_device_get_dhcp4_config (NMDevice *device)
{
g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
@@ -1147,15 +1148,14 @@ nm_device_get_dhcp4_config (NMDevice *device)
* nm_device_get_ip6_config:
* @device: a #NMDevice
*
- * Gets the current #NMIP6Config associated with the #NMDevice.
+ * Gets the current IPv6 #NMIPConfig associated with the #NMDevice.
*
- * Note that as of NetworkManager 0.9.10, you can alternatively use
- * nm_active_connection_get_ip6_config(), which also works with VPN
- * connections.
+ * You can alternatively use nm_active_connection_get_ip6_config(), which also
+ * works with VPN connections.
*
- * Returns: (transfer none): the #NMIP6Config or %NULL if the device is not activated.
+ * Returns: (transfer none): the IPv6 #NMIPConfig or %NULL if the device is not activated.
**/
-NMIP6Config *
+NMIPConfig *
nm_device_get_ip6_config (NMDevice *device)
{
g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
@@ -1167,16 +1167,15 @@ nm_device_get_ip6_config (NMDevice *device)
* nm_device_get_dhcp6_config:
* @device: a #NMDevice
*
- * Gets the current #NMDhcp6Config associated with the #NMDevice.
+ * Gets the current IPv6 #NMDhcpConfig associated with the #NMDevice.
*
- * Note that as of NetworkManager 0.9.10, you can alternatively use
- * nm_active_connection_get_dhcp6_config(), which also works with VPN
- * connections.
+ * You can alternatively use nm_active_connection_get_dhcp6_config(), which also
+ * works with VPN connections.
*
- * Returns: (transfer none): the #NMDhcp6Config or %NULL if the device is not activated or not
- * using DHCP.
+ * Returns: (transfer none): the IPv6 #NMDhcpConfig, or %NULL if the device is
+ * not activated or not using DHCPv6.
**/
-NMDhcp6Config *
+NMDhcpConfig *
nm_device_get_dhcp6_config (NMDevice *device)
{
g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
@@ -1252,6 +1251,19 @@ nm_device_get_available_connections (NMDevice *device)
return NM_DEVICE_GET_PRIVATE (device)->available_connections;
}
+static inline guint8
+hex2byte (const char *hex)
+{
+ int a, b;
+ a = g_ascii_xdigit_value (*hex++);
+ if (a < 0)
+ return -1;
+ b = g_ascii_xdigit_value (*hex++);
+ if (b < 0)
+ return -1;
+ return (a << 4) | b;
+}
+
static char *
get_decoded_property (GUdevDevice *device, const char *property)
{
@@ -1267,7 +1279,7 @@ get_decoded_property (GUdevDevice *device, const char *property)
n = unescaped = g_malloc0 (len + 1);
while (*p) {
if ((len >= 4) && (*p == '\\') && (*(p+1) == 'x')) {
- *n++ = (char) nm_utils_hex2byte (p + 2);
+ *n++ = (char) hex2byte (p + 2);
p += 4;
len -= 4;
} else {
@@ -1571,8 +1583,7 @@ get_short_vendor (NMDevice *device)
* nm_device_get_description:
* @device: an #NMDevice
*
- * Gets a description of @device, incorporating the results of
- * nm_device_get_short_vendor() and nm_device_get_short_product().
+ * Gets a description of @device, based on its vendor and product names.
*
* Returns: a description of @device. If either the vendor or the
* product name is unknown, this returns the interface name.
@@ -1802,6 +1813,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.
*/
diff --git a/libnm/nm-device.h b/libnm/nm-device.h
index 412dff3f96..5cc3735695 100644
--- a/libnm/nm-device.h
+++ b/libnm/nm-device.h
@@ -104,10 +104,10 @@ gboolean nm_device_get_managed (NMDevice *device);
gboolean nm_device_get_autoconnect (NMDevice *device);
void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect);
gboolean nm_device_get_firmware_missing (NMDevice *device);
-NMIP4Config * nm_device_get_ip4_config (NMDevice *device);
-NMDhcp4Config * nm_device_get_dhcp4_config (NMDevice *device);
-NMIP6Config * nm_device_get_ip6_config (NMDevice *device);
-NMDhcp6Config * nm_device_get_dhcp6_config (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);
+NMDhcpConfig * nm_device_get_dhcp6_config (NMDevice *device);
NMDeviceState nm_device_get_state (NMDevice *device);
NMDeviceStateReason nm_device_get_state_reason (NMDevice *device);
NMActiveConnection * nm_device_get_active_connection(NMDevice *device);
diff --git a/libnm/nm-dhcp-config.c b/libnm/nm-dhcp-config.c
new file mode 100644
index 0000000000..7227abac33
--- /dev/null
+++ b/libnm/nm-dhcp-config.c
@@ -0,0 +1,222 @@
+/* -*- 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.
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include "nm-dhcp-config.h"
+#include "nm-dhcp4-config.h"
+#include "nm-dhcp6-config.h"
+#include "nm-dbus-interface.h"
+#include "nm-object-private.h"
+#include "nm-utils.h"
+
+G_DEFINE_ABSTRACT_TYPE (NMDhcpConfig, nm_dhcp_config, NM_TYPE_OBJECT)
+
+#define NM_DHCP_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_CONFIG, NMDhcpConfigPrivate))
+
+typedef struct {
+ GHashTable *options;
+} NMDhcpConfigPrivate;
+
+enum {
+ PROP_0,
+ PROP_FAMILY,
+ PROP_OPTIONS,
+
+ LAST_PROP
+};
+
+static void
+nm_dhcp_config_init (NMDhcpConfig *config)
+{
+ NMDhcpConfigPrivate *priv = NM_DHCP_CONFIG_GET_PRIVATE (config);
+
+ priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+}
+
+static gboolean
+demarshal_dhcp_options (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
+{
+ NMDhcpConfigPrivate *priv = NM_DHCP_CONFIG_GET_PRIVATE (object);
+ GVariantIter iter;
+ const char *key;
+ GVariant *opt;
+
+ g_hash_table_remove_all (priv->options);
+
+ g_variant_iter_init (&iter, value);
+ while (g_variant_iter_next (&iter, "{&sv}", &key, &opt)) {
+ g_hash_table_insert (priv->options, g_strdup (key), g_variant_dup_string (opt, NULL));
+ g_variant_unref (opt);
+ }
+
+ _nm_object_queue_notify (object, NM_DHCP_CONFIG_OPTIONS);
+ return TRUE;
+}
+
+static void
+init_dbus (NMObject *object)
+{
+ NMDhcpConfigPrivate *priv = NM_DHCP_CONFIG_GET_PRIVATE (object);
+ const NMPropertiesInfo property_info[] = {
+ { NM_DHCP_CONFIG_OPTIONS, &priv->options, demarshal_dhcp_options },
+ { NULL },
+ };
+
+ NM_OBJECT_CLASS (nm_dhcp_config_parent_class)->init_dbus (object);
+
+ _nm_object_register_properties (object,
+ (NM_IS_DHCP4_CONFIG (object) ?
+ NM_DBUS_INTERFACE_DHCP4_CONFIG :
+ NM_DBUS_INTERFACE_DHCP6_CONFIG),
+ property_info);
+}
+
+static void
+finalize (GObject *object)
+{
+ NMDhcpConfigPrivate *priv = NM_DHCP_CONFIG_GET_PRIVATE (object);
+
+ if (priv->options)
+ g_hash_table_destroy (priv->options);
+
+ G_OBJECT_CLASS (nm_dhcp_config_parent_class)->finalize (object);
+}
+
+static void
+get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ NMDhcpConfig *self = NM_DHCP_CONFIG (object);
+
+ switch (prop_id) {
+ case PROP_FAMILY:
+ g_value_set_int (value, nm_dhcp_config_get_family (self));
+ break;
+ case PROP_OPTIONS:
+ g_value_set_boxed (value, nm_dhcp_config_get_options (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+nm_dhcp_config_class_init (NMDhcpConfigClass *config_class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (config_class);
+ NMObjectClass *nm_object_class = NM_OBJECT_CLASS (config_class);
+
+ g_type_class_add_private (config_class, sizeof (NMDhcpConfigPrivate));
+
+ /* virtual methods */
+ object_class->get_property = get_property;
+ object_class->finalize = finalize;
+
+ nm_object_class->init_dbus = init_dbus;
+
+ /* properties */
+
+ /**
+ * NMDhcpConfig:family:
+ *
+ * The IP address family of the configuration; either
+ * <literal>AF_INET</literal> or <literal>AF_INET6</literal>.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_FAMILY,
+ g_param_spec_int (NM_DHCP_CONFIG_FAMILY, "", "",
+ 0, 255, AF_UNSPEC,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMDhcpConfig:options:
+ *
+ * The #GHashTable containing options of the configuration.
+ *
+ * Type: GLib.HashTable(utf8,utf8)
+ **/
+ g_object_class_install_property
+ (object_class, PROP_OPTIONS,
+ g_param_spec_boxed (NM_DHCP_CONFIG_OPTIONS, "", "",
+ G_TYPE_HASH_TABLE,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * nm_dhcp_config_get_family:
+ * @config: a #NMDhcpConfig
+ *
+ * Gets the IP address family of the configuration
+ *
+ * Returns: the IP address family; either <literal>AF_INET</literal> or
+ * <literal>AF_INET6</literal>
+ **/
+int
+nm_dhcp_config_get_family (NMDhcpConfig *config)
+{
+ g_return_val_if_fail (NM_IS_DHCP_CONFIG (config), AF_UNSPEC);
+
+ return NM_IS_DHCP4_CONFIG (config) ? AF_INET : AF_INET6;
+}
+
+/**
+ * nm_dhcp_config_get_options:
+ * @config: a #NMDhcpConfig
+ *
+ * Gets all the options contained in the configuration.
+ *
+ * Returns: (transfer none) (element-type utf8 utf8): the #GHashTable containing
+ * strings for keys and values. This is the internal copy used by the
+ * configuration, and must not be modified.
+ **/
+GHashTable *
+nm_dhcp_config_get_options (NMDhcpConfig *config)
+{
+ g_return_val_if_fail (NM_IS_DHCP_CONFIG (config), NULL);
+
+ return NM_DHCP_CONFIG_GET_PRIVATE (config)->options;
+}
+
+/**
+ * nm_dhcp_config_get_one_option:
+ * @config: a #NMDhcpConfig
+ * @option: the option to retrieve
+ *
+ * Gets one option by option name.
+ *
+ * Returns: the configuration option's value. This is the internal string used by the
+ * configuration, and must not be modified.
+ **/
+const char *
+nm_dhcp_config_get_one_option (NMDhcpConfig *config, const char *option)
+{
+ g_return_val_if_fail (NM_IS_DHCP_CONFIG (config), NULL);
+
+ return g_hash_table_lookup (nm_dhcp_config_get_options (config), option);
+}
diff --git a/libnm/nm-dhcp-config.h b/libnm/nm-dhcp-config.h
new file mode 100644
index 0000000000..85aa3bd2c1
--- /dev/null
+++ b/libnm/nm-dhcp-config.h
@@ -0,0 +1,62 @@
+/* -*- 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 Red Hat, Inc.
+ * Copyright 2008 Novell, Inc.
+ */
+
+#ifndef __NM_DHCP_CONFIG_H__
+#define __NM_DHCP_CONFIG_H__
+
+#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
+#error "Only <NetworkManager.h> can be included directly."
+#endif
+
+#include <nm-object.h>
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_DHCP_CONFIG (nm_dhcp_config_get_type ())
+#define NM_DHCP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_CONFIG, NMDhcpConfig))
+#define NM_DHCP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_CONFIG, NMDhcpConfigClass))
+#define NM_IS_DHCP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_CONFIG))
+#define NM_IS_DHCP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP_CONFIG))
+
+struct _NMDhcpConfig {
+ NMObject parent;
+};
+
+typedef struct {
+ NMObjectClass parent;
+
+ /*< private >*/
+ gpointer padding[8];
+} NMDhcpConfigClass;
+
+#define NM_DHCP_CONFIG_FAMILY "family"
+#define NM_DHCP_CONFIG_OPTIONS "options"
+
+GType nm_dhcp_config_get_type (void);
+
+int nm_dhcp_config_get_family (NMDhcpConfig *config);
+
+GHashTable *nm_dhcp_config_get_options (NMDhcpConfig *config);
+const char *nm_dhcp_config_get_one_option (NMDhcpConfig *config, const char *option);
+
+G_END_DECLS
+
+#endif /* __NM_DHCP_CONFIG_H__ */
diff --git a/libnm/nm-dhcp4-config.c b/libnm/nm-dhcp4-config.c
index 2bf84fa408..808edaa647 100644
--- a/libnm/nm-dhcp4-config.c
+++ b/libnm/nm-dhcp4-config.c
@@ -15,169 +15,25 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2008 - 2011 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
+ * Copyright 2014 Red Hat, Inc.
*/
-#include <string.h>
+#include "config.h"
#include "nm-dhcp4-config.h"
-#include "nm-dbus-interface.h"
#include "nm-object-private.h"
-#include "nm-utils.h"
-G_DEFINE_TYPE (NMDhcp4Config, nm_dhcp4_config, NM_TYPE_OBJECT)
-
-#define NM_DHCP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP4_CONFIG, NMDhcp4ConfigPrivate))
-
-typedef struct {
- GHashTable *options;
-} NMDhcp4ConfigPrivate;
-
-enum {
- PROP_0,
- PROP_OPTIONS,
-
- LAST_PROP
-};
+G_DEFINE_TYPE (NMDhcp4Config, nm_dhcp4_config, NM_TYPE_DHCP_CONFIG)
static void
nm_dhcp4_config_init (NMDhcp4Config *config)
{
- NMDhcp4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (config);
-
- priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-}
-
-static gboolean
-demarshal_dhcp4_options (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
-{
- NMDhcp4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object);
- GVariantIter iter;
- const char *key;
- GVariant *opt;
-
- g_hash_table_remove_all (priv->options);
-
- g_variant_iter_init (&iter, value);
- while (g_variant_iter_next (&iter, "{&sv}", &key, &opt)) {
- g_hash_table_insert (priv->options, g_strdup (key), g_variant_dup_string (opt, NULL));
- g_variant_unref (opt);
- }
-
- _nm_object_queue_notify (object, NM_DHCP4_CONFIG_OPTIONS);
- return TRUE;
-}
-
-static void
-init_dbus (NMObject *object)
-{
- NMDhcp4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object);
- const NMPropertiesInfo property_info[] = {
- { NM_DHCP4_CONFIG_OPTIONS, &priv->options, demarshal_dhcp4_options },
- { NULL },
- };
-
- NM_OBJECT_CLASS (nm_dhcp4_config_parent_class)->init_dbus (object);
-
- _nm_object_register_properties (object,
- NM_DBUS_INTERFACE_DHCP4_CONFIG,
- property_info);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDhcp4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object);
-
- if (priv->options)
- g_hash_table_destroy (priv->options);
-
- G_OBJECT_CLASS (nm_dhcp4_config_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDhcp4Config *self = NM_DHCP4_CONFIG (object);
-
- switch (prop_id) {
- case PROP_OPTIONS:
- g_value_set_boxed (value, nm_dhcp4_config_get_options (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
}
static void
nm_dhcp4_config_class_init (NMDhcp4ConfigClass *config_class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (config_class);
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (config_class);
- g_type_class_add_private (config_class, sizeof (NMDhcp4ConfigPrivate));
-
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DHCP4_CONFIG);
-
- /* virtual methods */
- object_class->get_property = get_property;
- object_class->finalize = finalize;
-
- nm_object_class->init_dbus = init_dbus;
-
- /* properties */
-
- /**
- * NMDhcp4Config:options:
- *
- * The #GHashTable containing options of the configuration.
- *
- * Type: GLib.HashTable(utf8,utf8)
- **/
- g_object_class_install_property
- (object_class, PROP_OPTIONS,
- g_param_spec_boxed (NM_DHCP4_CONFIG_OPTIONS, "", "",
- G_TYPE_HASH_TABLE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
-
-/**
- * nm_dhcp4_config_get_options:
- * @config: a #NMDhcp4Config
- *
- * Gets all the options contained in the configuration.
- *
- * Returns: (transfer none) (element-type utf8 GObject.Value): the #GHashTable containing strings for keys and values.
- * This is the internal copy used by the configuration, and must not be modified.
- **/
-GHashTable *
-nm_dhcp4_config_get_options (NMDhcp4Config *config)
-{
- g_return_val_if_fail (NM_IS_DHCP4_CONFIG (config), NULL);
-
- return NM_DHCP4_CONFIG_GET_PRIVATE (config)->options;
-}
-
-/**
- * nm_dhcp4_config_get_one_option:
- * @config: a #NMDhcp4Config
- * @option: the option to retrieve
- *
- * Gets one option by option name.
- *
- * Returns: the configuration option's value. This is the internal string used by the
- * configuration, and must not be modified.
- **/
-const char *
-nm_dhcp4_config_get_one_option (NMDhcp4Config *config, const char *option)
-{
- g_return_val_if_fail (NM_IS_DHCP4_CONFIG (config), NULL);
-
- return g_hash_table_lookup (nm_dhcp4_config_get_options (config), option);
}
diff --git a/libnm/nm-dhcp4-config.h b/libnm/nm-dhcp4-config.h
index 90152c8f63..3423740db8 100644
--- a/libnm/nm-dhcp4-config.h
+++ b/libnm/nm-dhcp4-config.h
@@ -15,18 +15,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2008 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
+ * Copyright 2014 Red Hat, Inc.
*/
#ifndef __NM_DHCP4_CONFIG_H__
#define __NM_DHCP4_CONFIG_H__
-#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
-#error "Only <NetworkManager.h> can be included directly."
-#endif
-
-#include <nm-object.h>
+#include <nm-dhcp-config.h>
G_BEGIN_DECLS
@@ -36,25 +31,19 @@ G_BEGIN_DECLS
#define NM_IS_DHCP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP4_CONFIG))
#define NM_IS_DHCP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP4_CONFIG))
-struct _NMDhcp4Config {
- NMObject parent;
-};
+typedef struct {
+ NMDhcpConfig parent;
+} NMDhcp4Config;
typedef struct {
- NMObjectClass parent;
+ NMDhcpConfigClass parent;
/*< private >*/
gpointer padding[4];
} NMDhcp4ConfigClass;
-#define NM_DHCP4_CONFIG_OPTIONS "options"
-
GType nm_dhcp4_config_get_type (void);
-GHashTable * nm_dhcp4_config_get_options (NMDhcp4Config *config);
-
-const char * nm_dhcp4_config_get_one_option (NMDhcp4Config *config, const char *option);
-
G_END_DECLS
#endif /* __NM_DHCP4_CONFIG_H__ */
diff --git a/libnm/nm-dhcp6-config.c b/libnm/nm-dhcp6-config.c
index 498f1d3b4c..3b2e81f84c 100644
--- a/libnm/nm-dhcp6-config.c
+++ b/libnm/nm-dhcp6-config.c
@@ -15,169 +15,25 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2008 - 2011 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
+ * Copyright 2014 Red Hat, Inc.
*/
-#include <string.h>
+#include "config.h"
#include "nm-dhcp6-config.h"
-#include "nm-dbus-interface.h"
#include "nm-object-private.h"
-#include "nm-utils.h"
-G_DEFINE_TYPE (NMDhcp6Config, nm_dhcp6_config, NM_TYPE_OBJECT)
-
-#define NM_DHCP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP6_CONFIG, NMDhcp6ConfigPrivate))
-
-typedef struct {
- GHashTable *options;
-} NMDhcp6ConfigPrivate;
-
-enum {
- PROP_0,
- PROP_OPTIONS,
-
- LAST_PROP
-};
+G_DEFINE_TYPE (NMDhcp6Config, nm_dhcp6_config, NM_TYPE_DHCP_CONFIG)
static void
nm_dhcp6_config_init (NMDhcp6Config *config)
{
- NMDhcp6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (config);
-
- priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-}
-
-static gboolean
-demarshal_dhcp6_options (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
-{
- NMDhcp6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object);
- GVariantIter iter;
- const char *key;
- GVariant *opt;
-
- g_hash_table_remove_all (priv->options);
-
- g_variant_iter_init (&iter, value);
- while (g_variant_iter_next (&iter, "{&sv}", &key, &opt)) {
- g_hash_table_insert (priv->options, g_strdup (key), g_variant_dup_string (opt, NULL));
- g_variant_unref (opt);
- }
-
- _nm_object_queue_notify (object, NM_DHCP6_CONFIG_OPTIONS);
- return TRUE;
-}
-
-static void
-init_dbus (NMObject *object)
-{
- NMDhcp6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object);
- const NMPropertiesInfo property_info[] = {
- { NM_DHCP6_CONFIG_OPTIONS, &priv->options, demarshal_dhcp6_options },
- { NULL },
- };
-
- NM_OBJECT_CLASS (nm_dhcp6_config_parent_class)->init_dbus (object);
-
- _nm_object_register_properties (object,
- NM_DBUS_INTERFACE_DHCP6_CONFIG,
- property_info);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDhcp6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object);
-
- if (priv->options)
- g_hash_table_destroy (priv->options);
-
- G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDhcp6Config *self = NM_DHCP6_CONFIG (object);
-
- switch (prop_id) {
- case PROP_OPTIONS:
- g_value_set_boxed (value, nm_dhcp6_config_get_options (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
}
static void
nm_dhcp6_config_class_init (NMDhcp6ConfigClass *config_class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (config_class);
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (config_class);
- g_type_class_add_private (config_class, sizeof (NMDhcp6ConfigPrivate));
-
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DHCP6_CONFIG);
-
- /* virtual methods */
- object_class->get_property = get_property;
- object_class->finalize = finalize;
-
- nm_object_class->init_dbus = init_dbus;
-
- /* properties */
-
- /**
- * NMDhcp6Config:options:
- *
- * The #GHashTable containing options of the configuration.
- *
- * Type: GLib.HashTable(utf8,utf8)
- **/
- g_object_class_install_property
- (object_class, PROP_OPTIONS,
- g_param_spec_boxed (NM_DHCP6_CONFIG_OPTIONS, "", "",
- G_TYPE_HASH_TABLE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
-
-/**
- * nm_dhcp6_config_get_options:
- * @config: a #NMDhcp6Config
- *
- * Gets all the options contained in the configuration.
- *
- * Returns: (transfer none) (element-type utf8 GObject.Value): the #GHashTable containing strings for keys and values.
- * This is the internal copy used by the configuration, and must not be modified.
- **/
-GHashTable *
-nm_dhcp6_config_get_options (NMDhcp6Config *config)
-{
- g_return_val_if_fail (NM_IS_DHCP6_CONFIG (config), NULL);
-
- return NM_DHCP6_CONFIG_GET_PRIVATE (config)->options;
-}
-
-/**
- * nm_dhcp6_config_get_one_option:
- * @config: a #NMDhcp6Config
- * @option: the option to retrieve
- *
- * Gets one option by option name.
- *
- * Returns: the configuration option's value. This is the internal string used by the
- * configuration, and must not be modified.
- **/
-const char *
-nm_dhcp6_config_get_one_option (NMDhcp6Config *config, const char *option)
-{
- g_return_val_if_fail (NM_IS_DHCP6_CONFIG (config), NULL);
-
- return g_hash_table_lookup (nm_dhcp6_config_get_options (config), option);
}
diff --git a/libnm/nm-dhcp6-config.h b/libnm/nm-dhcp6-config.h
index 53bd45eeb7..abb24adfd6 100644
--- a/libnm/nm-dhcp6-config.h
+++ b/libnm/nm-dhcp6-config.h
@@ -15,18 +15,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2008 - 2010 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
+ * Copyright 2014 Red Hat, Inc.
*/
#ifndef __NM_DHCP6_CONFIG_H__
#define __NM_DHCP6_CONFIG_H__
-#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
-#error "Only <NetworkManager.h> can be included directly."
-#endif
-
-#include <nm-object.h>
+#include <nm-dhcp-config.h>
G_BEGIN_DECLS
@@ -36,25 +31,19 @@ G_BEGIN_DECLS
#define NM_IS_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP6_CONFIG))
#define NM_IS_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP6_CONFIG))
-struct _NMDhcp6Config {
- NMObject parent;
-};
+typedef struct {
+ NMDhcpConfig parent;
+} NMDhcp6Config;
typedef struct {
- NMObjectClass parent;
+ NMDhcpConfigClass parent;
/*< private >*/
gpointer padding[4];
} NMDhcp6ConfigClass;
-#define NM_DHCP6_CONFIG_OPTIONS "options"
-
GType nm_dhcp6_config_get_type (void);
-GHashTable * nm_dhcp6_config_get_options (NMDhcp6Config *config);
-
-const char * nm_dhcp6_config_get_one_option (NMDhcp6Config *config, const char *option);
-
G_END_DECLS
#endif /* __NM_DHCP6_CONFIG_H__ */
diff --git a/libnm/nm-ip-config.c b/libnm/nm-ip-config.c
new file mode 100644
index 0000000000..d057903e27
--- /dev/null
+++ b/libnm/nm-ip-config.c
@@ -0,0 +1,502 @@
+/* -*- 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 - 2011 Novell, Inc.
+ * Copyright 2008 - 2014 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include "nm-ip-config.h"
+#include "nm-ip4-config.h"
+#include "nm-ip6-config.h"
+#include "nm-setting-ip-config.h"
+#include "nm-dbus-interface.h"
+#include "nm-object-private.h"
+#include "nm-utils.h"
+#include "nm-core-internal.h"
+
+G_DEFINE_ABSTRACT_TYPE (NMIPConfig, nm_ip_config, NM_TYPE_OBJECT)
+
+#define NM_IP_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP_CONFIG, NMIPConfigPrivate))
+
+typedef struct {
+ char *gateway;
+ GPtrArray *addresses;
+ GPtrArray *routes;
+ char **nameservers;
+ char **domains;
+ char **searches;
+ char **wins;
+
+ gboolean new_style_data;
+} NMIPConfigPrivate;
+
+enum {
+ PROP_0,
+ PROP_FAMILY,
+ PROP_GATEWAY,
+ PROP_ADDRESSES,
+ PROP_ROUTES,
+ PROP_NAMESERVERS,
+ PROP_DOMAINS,
+ PROP_SEARCHES,
+ PROP_WINS_SERVERS,
+
+ LAST_PROP
+};
+
+static void
+nm_ip_config_init (NMIPConfig *config)
+{
+ NMIPConfigPrivate *priv = NM_IP_CONFIG_GET_PRIVATE (config);
+
+ priv->addresses = g_ptr_array_new ();
+ priv->routes = g_ptr_array_new ();
+ priv->nameservers = g_new0 (char *, 1);
+ priv->domains = g_new0 (char *, 1);
+ priv->searches = g_new0 (char *, 1);
+ priv->wins = g_new0 (char *, 1);
+}
+
+static gboolean
+demarshal_ip_addresses (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
+{
+ NMIPConfigPrivate *priv = NM_IP_CONFIG_GET_PRIVATE (object);
+
+ if (priv->new_style_data)
+ return TRUE;
+
+ g_ptr_array_unref (priv->addresses);
+ if (NM_IS_IP4_CONFIG (object))
+ priv->addresses = nm_utils_ip4_addresses_from_variant (value, NULL);
+ else
+ priv->addresses = nm_utils_ip6_addresses_from_variant (value, NULL);
+ _nm_object_queue_notify (object, NM_IP_CONFIG_ADDRESSES);
+
+ return TRUE;
+}
+
+static gboolean
+demarshal_ip_address_data (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
+{
+ NMIPConfigPrivate *priv = NM_IP_CONFIG_GET_PRIVATE (object);
+
+ priv->new_style_data = TRUE;
+
+ g_ptr_array_unref (priv->addresses);
+ if (NM_IS_IP4_CONFIG (object))
+ priv->addresses = nm_utils_ip_addresses_from_variant (value, AF_INET);
+ else
+ priv->addresses = nm_utils_ip_addresses_from_variant (value, AF_INET6);
+ _nm_object_queue_notify (object, NM_IP_CONFIG_ADDRESSES);
+
+ return TRUE;
+}
+
+static gboolean
+demarshal_ip_array (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
+{
+ char ***obj_field;
+
+ obj_field = field;
+ if (*obj_field)
+ g_strfreev (*obj_field);
+
+ if (NM_IS_IP4_CONFIG (object))
+ *obj_field = nm_utils_ip4_dns_from_variant (value);
+ else
+ *obj_field = nm_utils_ip6_dns_from_variant (value);
+
+ _nm_object_queue_notify (object, pspec->name);
+ return TRUE;
+}
+
+static gboolean
+demarshal_ip_routes (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
+{
+ NMIPConfigPrivate *priv = NM_IP_CONFIG_GET_PRIVATE (object);
+
+ if (priv->new_style_data)
+ return TRUE;
+
+ g_ptr_array_unref (priv->routes);
+ if (NM_IS_IP4_CONFIG (object))
+ priv->routes = nm_utils_ip4_routes_from_variant (value);
+ else
+ priv->routes = nm_utils_ip6_routes_from_variant (value);
+ _nm_object_queue_notify (object, NM_IP_CONFIG_ROUTES);
+
+ return TRUE;
+}
+
+static gboolean
+demarshal_ip_route_data (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
+{
+ NMIPConfigPrivate *priv = NM_IP_CONFIG_GET_PRIVATE (object);
+
+ priv->new_style_data = TRUE;
+
+ g_ptr_array_unref (priv->routes);
+ if (NM_IS_IP4_CONFIG (object))
+ priv->routes = nm_utils_ip_routes_from_variant (value, AF_INET);
+ else
+ priv->routes = nm_utils_ip_routes_from_variant (value, AF_INET6);
+ _nm_object_queue_notify (object, NM_IP_CONFIG_ROUTES);
+
+ return TRUE;
+}
+
+static void
+init_dbus (NMObject *object)
+{
+ NMIPConfigPrivate *priv = NM_IP_CONFIG_GET_PRIVATE (object);
+ const NMPropertiesInfo property_info[] = {
+ { NM_IP_CONFIG_GATEWAY, &priv->gateway, },
+ { NM_IP_CONFIG_ADDRESSES, &priv->addresses, demarshal_ip_addresses },
+ { "address-data", &priv->addresses, demarshal_ip_address_data },
+ { NM_IP_CONFIG_ROUTES, &priv->routes, demarshal_ip_routes },
+ { "route-data", &priv->routes, demarshal_ip_route_data },
+ { NM_IP_CONFIG_NAMESERVERS, &priv->nameservers, demarshal_ip_array },
+ { NM_IP_CONFIG_DOMAINS, &priv->domains, },
+ { NM_IP_CONFIG_SEARCHES, &priv->searches, },
+ { NM_IP_CONFIG_WINS_SERVERS, &priv->wins, demarshal_ip_array },
+ { NULL },
+ };
+
+ NM_OBJECT_CLASS (nm_ip_config_parent_class)->init_dbus (object);
+
+ _nm_object_register_properties (object,
+ (NM_IS_IP4_CONFIG (object) ?
+ NM_DBUS_INTERFACE_IP4_CONFIG :
+ NM_DBUS_INTERFACE_IP6_CONFIG),
+ property_info);
+}
+
+static void
+finalize (GObject *object)
+{
+ NMIPConfigPrivate *priv = NM_IP_CONFIG_GET_PRIVATE (object);
+
+ g_free (priv->gateway);
+
+ g_ptr_array_unref (priv->addresses);
+ g_ptr_array_unref (priv->routes);
+
+ g_strfreev (priv->nameservers);
+ g_strfreev (priv->domains);
+ g_strfreev (priv->searches);
+ g_strfreev (priv->wins);
+
+ G_OBJECT_CLASS (nm_ip_config_parent_class)->finalize (object);
+}
+
+static void
+get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ NMIPConfig *self = NM_IP_CONFIG (object);
+
+ switch (prop_id) {
+ case PROP_FAMILY:
+ g_value_set_int (value, nm_ip_config_get_family (self));
+ break;
+ case PROP_GATEWAY:
+ g_value_set_string (value, nm_ip_config_get_gateway (self));
+ break;
+ case PROP_ADDRESSES:
+ g_value_take_boxed (value, _nm_utils_copy_array (nm_ip_config_get_addresses (self),
+ (NMUtilsCopyFunc) nm_ip_address_dup,
+ (GDestroyNotify) nm_ip_address_unref));
+ break;
+ case PROP_ROUTES:
+ g_value_take_boxed (value, _nm_utils_copy_array (nm_ip_config_get_routes (self),
+ (NMUtilsCopyFunc) nm_ip_route_dup,
+ (GDestroyNotify) nm_ip_route_unref));
+ break;
+ case PROP_NAMESERVERS:
+ g_value_set_boxed (value, (char **) nm_ip_config_get_nameservers (self));
+ break;
+ case PROP_DOMAINS:
+ g_value_set_boxed (value, (char **) nm_ip_config_get_domains (self));
+ break;
+ case PROP_SEARCHES:
+ g_value_set_boxed (value, (char **) nm_ip_config_get_searches (self));
+ break;
+ case PROP_WINS_SERVERS:
+ g_value_set_boxed (value, (char **) nm_ip_config_get_wins_servers (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+nm_ip_config_class_init (NMIPConfigClass *config_class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (config_class);
+ NMObjectClass *nm_object_class = NM_OBJECT_CLASS (config_class);
+
+ g_type_class_add_private (config_class, sizeof (NMIPConfigPrivate));
+
+ /* virtual methods */
+ object_class->get_property = get_property;
+ object_class->finalize = finalize;
+
+ nm_object_class->init_dbus = init_dbus;
+
+ /* properties */
+
+ /**
+ * NMIPConfig:family:
+ *
+ * The IP address family of the configuration; either
+ * <literal>AF_INET</literal> or <literal>AF_INET6</literal>.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_FAMILY,
+ g_param_spec_int (NM_IP_CONFIG_FAMILY, "", "",
+ 0, 255, AF_UNSPEC,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMIPConfig:gateway:
+ *
+ * The IP gateway address of the configuration as string.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_GATEWAY,
+ g_param_spec_string (NM_IP_CONFIG_GATEWAY, "", "",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMIPConfig:addresses:
+ *
+ * A #GPtrArray containing the addresses (#NMIPAddress) of the configuration.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_ADDRESSES,
+ g_param_spec_boxed (NM_IP_CONFIG_ADDRESSES, "", "",
+ G_TYPE_PTR_ARRAY,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMIPConfig:routes:
+ *
+ * A #GPtrArray containing the routes (#NMIPRoute) of the configuration.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_ROUTES,
+ g_param_spec_boxed (NM_IP_CONFIG_ROUTES, "", "",
+ G_TYPE_PTR_ARRAY,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMIPConfig:nameservers:
+ *
+ * The array containing name server IP addresses of the configuration.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_NAMESERVERS,
+ g_param_spec_boxed (NM_IP_CONFIG_NAMESERVERS, "", "",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMIPConfig:domains:
+ *
+ * The array containing domain strings of the configuration.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_DOMAINS,
+ g_param_spec_boxed (NM_IP_CONFIG_DOMAINS, "", "",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMIPConfig:searches:
+ *
+ * The array containing DNS search strings of the configuration.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_SEARCHES,
+ g_param_spec_boxed (NM_IP_CONFIG_SEARCHES, "", "",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMIPConfig:wins-servers:
+ *
+ * The array containing WINS server IP addresses of the configuration.
+ * (This will always be empty for IPv6 configurations.)
+ **/
+ g_object_class_install_property
+ (object_class, PROP_WINS_SERVERS,
+ g_param_spec_boxed (NM_IP_CONFIG_WINS_SERVERS, "", "",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * nm_ip_config_get_family:
+ * @config: a #NMIPConfig
+ *
+ * Gets the IP address family
+ *
+ * Returns: the IP address family; either <literal>AF_INET</literal> or
+ * <literal>AF_INET6</literal>
+ **/
+int
+nm_ip_config_get_family (NMIPConfig *config)
+{
+ g_return_val_if_fail (NM_IS_IP_CONFIG (config), AF_UNSPEC);
+
+ return NM_IS_IP4_CONFIG (config) ? AF_INET : AF_INET6;
+}
+
+/**
+ * nm_ip_config_get_gateway:
+ * @config: a #NMIPConfig
+ *
+ * Gets the IP gateway address.
+ *
+ * Returns: (transfer none): the IP address of the gateway.
+ **/
+const char *
+nm_ip_config_get_gateway (NMIPConfig *config)
+{
+ g_return_val_if_fail (NM_IS_IP_CONFIG (config), NULL);
+
+ return NM_IP_CONFIG_GET_PRIVATE (config)->gateway;
+}
+
+/**
+ * nm_ip_config_get_addresses:
+ * @config: a #NMIPConfig
+ *
+ * Gets the IP addresses (containing the address, prefix, and gateway).
+ *
+ * Returns: (element-type NMIPAddress) (transfer none): the #GPtrArray
+ * containing #NMIPAddress<!-- -->es. This is the internal copy used by the
+ * configuration and must not be modified.
+ **/
+GPtrArray *
+nm_ip_config_get_addresses (NMIPConfig *config)
+{
+ g_return_val_if_fail (NM_IS_IP_CONFIG (config), NULL);
+
+ return NM_IP_CONFIG_GET_PRIVATE (config)->addresses;
+}
+
+/**
+ * nm_ip_config_get_nameservers:
+ * @config: a #NMIPConfig
+ *
+ * Gets the domain name servers (DNS).
+ *
+ * Returns: (transfer none): the array of nameserver IP addresses
+ **/
+const char * const *
+nm_ip_config_get_nameservers (NMIPConfig *config)
+{
+ g_return_val_if_fail (NM_IS_IP_CONFIG (config), NULL);
+
+ return (const char * const *) NM_IP_CONFIG_GET_PRIVATE (config)->nameservers;
+}
+
+/**
+ * nm_ip_config_get_domains:
+ * @config: a #NMIPConfig
+ *
+ * Gets the domain names.
+ *
+ * Returns: (transfer none): the array of domains.
+ * (This is never %NULL, though it may be 0-length).
+ **/
+const char * const *
+nm_ip_config_get_domains (NMIPConfig *config)
+{
+ g_return_val_if_fail (NM_IS_IP_CONFIG (config), NULL);
+
+ return (const char * const *) NM_IP_CONFIG_GET_PRIVATE (config)->domains;
+}
+
+/**
+ * nm_ip_config_get_searches:
+ * @config: a #NMIPConfig
+ *
+ * Gets the DNS searches.
+ *
+ * Returns: (transfer none): the array of DNS search strings.
+ * (This is never %NULL, though it may be 0-length).
+ **/
+const char * const *
+nm_ip_config_get_searches (NMIPConfig *config)
+{
+ g_return_val_if_fail (NM_IS_IP_CONFIG (config), NULL);
+
+ return (const char * const *) NM_IP_CONFIG_GET_PRIVATE (config)->searches;
+}
+
+/**
+ * nm_ip_config_get_wins_servers:
+ * @config: a #NMIPConfig
+ *
+ * Gets the Windows Internet Name Service servers (WINS).
+ *
+ * Returns: (transfer none): the arry of WINS server IP address strings.
+ * (This is never %NULL, though it may be 0-length.)
+ **/
+const char * const *
+nm_ip_config_get_wins_servers (NMIPConfig *config)
+{
+ g_return_val_if_fail (NM_IS_IP_CONFIG (config), NULL);
+
+ return (const char * const *) NM_IP_CONFIG_GET_PRIVATE (config)->wins;
+}
+
+/**
+ * nm_ip_config_get_routes:
+ * @config: a #NMIPConfig
+ *
+ * Gets the routes.
+ *
+ * Returns: (element-type NMIPRoute) (transfer none): the #GPtrArray containing
+ * #NMIPRoutes. This is the internal copy used by the configuration, and must
+ * not be modified.
+ **/
+GPtrArray *
+nm_ip_config_get_routes (NMIPConfig *config)
+{
+ g_return_val_if_fail (NM_IS_IP_CONFIG (config), NULL);
+
+ return NM_IP_CONFIG_GET_PRIVATE (config)->routes;
+}
diff --git a/libnm/nm-ip-config.h b/libnm/nm-ip-config.h
new file mode 100644
index 0000000000..815135a055
--- /dev/null
+++ b/libnm/nm-ip-config.h
@@ -0,0 +1,73 @@
+/* -*- 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 2008 - 2014 Red Hat, Inc.
+ */
+
+#ifndef __NM_IP_CONFIG_H__
+#define __NM_IP_CONFIG_H__
+
+#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
+#error "Only <NetworkManager.h> can be included directly."
+#endif
+
+#include <nm-object.h>
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_IP_CONFIG (nm_ip_config_get_type ())
+#define NM_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP_CONFIG, NMIPConfig))
+#define NM_IP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IP_CONFIG, NMIPConfigClass))
+#define NM_IS_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IP_CONFIG))
+#define NM_IS_IP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_IP_CONFIG))
+#define NM_IP_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP_CONFIG, NMIPConfigClass))
+
+struct _NMIPConfig {
+ NMObject parent;
+};
+
+typedef struct {
+ NMObjectClass parent;
+
+ /*< private >*/
+ gpointer padding[8];
+} NMIPConfigClass;
+
+#define NM_IP_CONFIG_FAMILY "family"
+#define NM_IP_CONFIG_GATEWAY "gateway"
+#define NM_IP_CONFIG_ADDRESSES "addresses"
+#define NM_IP_CONFIG_ROUTES "routes"
+#define NM_IP_CONFIG_NAMESERVERS "nameservers"
+#define NM_IP_CONFIG_DOMAINS "domains"
+#define NM_IP_CONFIG_SEARCHES "searches"
+#define NM_IP_CONFIG_WINS_SERVERS "wins-servers"
+
+GType nm_ip_config_get_type (void);
+
+int nm_ip_config_get_family (NMIPConfig *config);
+const char * nm_ip_config_get_gateway (NMIPConfig *config);
+GPtrArray * nm_ip_config_get_addresses (NMIPConfig *config);
+GPtrArray * nm_ip_config_get_routes (NMIPConfig *config);
+const char * const *nm_ip_config_get_nameservers (NMIPConfig *config);
+const char * const *nm_ip_config_get_domains (NMIPConfig *config);
+const char * const *nm_ip_config_get_searches (NMIPConfig *config);
+const char * const *nm_ip_config_get_wins_servers (NMIPConfig *config);
+
+G_END_DECLS
+
+#endif /* __NM_IP_CONFIG_H__ */
diff --git a/libnm/nm-ip4-config.c b/libnm/nm-ip4-config.c
index ac3e5b36e9..26797dd7ca 100644
--- a/libnm/nm-ip4-config.c
+++ b/libnm/nm-ip4-config.c
@@ -15,397 +15,25 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2007 - 2011 Novell, Inc.
- * Copyright 2008 Red Hat, Inc.
+ * Copyright 2014 Red Hat, Inc.
*/
-#include <string.h>
+#include "config.h"
-#include <nm-setting-ip4-config.h>
#include "nm-ip4-config.h"
-#include "nm-dbus-interface.h"
#include "nm-object-private.h"
-#include "nm-utils.h"
-#include "nm-core-internal.h"
-G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, NM_TYPE_OBJECT)
-
-#define NM_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP4_CONFIG, NMIP4ConfigPrivate))
-
-typedef struct {
- char *gateway;
- GPtrArray *addresses;
- GPtrArray *routes;
- char **nameservers;
- char **domains;
- char **searches;
- char **wins;
-} NMIP4ConfigPrivate;
-
-enum {
- PROP_0,
- PROP_GATEWAY,
- PROP_ADDRESSES,
- PROP_ROUTES,
- PROP_NAMESERVERS,
- PROP_DOMAINS,
- PROP_SEARCHES,
- PROP_WINS_SERVERS,
-
- LAST_PROP
-};
+G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, NM_TYPE_IP_CONFIG)
static void
nm_ip4_config_init (NMIP4Config *config)
{
- NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
-
- priv->addresses = g_ptr_array_new ();
- priv->routes = g_ptr_array_new ();
- priv->nameservers = g_new0 (char *, 1);
- priv->domains = g_new0 (char *, 1);
- priv->searches = g_new0 (char *, 1);
- priv->wins = g_new0 (char *, 1);
-}
-
-static gboolean
-demarshal_ip4_address_array (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
-{
- NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
-
- g_ptr_array_unref (priv->addresses);
- priv->addresses = nm_utils_ip4_addresses_from_variant (value);
- _nm_object_queue_notify (object, NM_IP4_CONFIG_ADDRESSES);
-
- return TRUE;
-}
-
-static gboolean
-demarshal_ip4_array (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
-{
- char ***obj_field;
-
- obj_field = field;
- if (*obj_field)
- g_strfreev (*obj_field);
-
- *obj_field = nm_utils_ip4_dns_from_variant (value);
-
- _nm_object_queue_notify (object, pspec->name);
- return TRUE;
-}
-
-static gboolean
-demarshal_ip4_routes_array (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
-{
- NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
-
- g_ptr_array_unref (priv->routes);
- priv->routes = nm_utils_ip4_routes_from_variant (value);
- _nm_object_queue_notify (object, NM_IP4_CONFIG_ROUTES);
-
- return TRUE;
-}
-
-static void
-init_dbus (NMObject *object)
-{
- NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
- const NMPropertiesInfo property_info[] = {
- { NM_IP4_CONFIG_GATEWAY, &priv->gateway, },
- { NM_IP4_CONFIG_ADDRESSES, &priv->addresses, demarshal_ip4_address_array },
- { NM_IP4_CONFIG_ROUTES, &priv->routes, demarshal_ip4_routes_array },
- { NM_IP4_CONFIG_NAMESERVERS, &priv->nameservers, demarshal_ip4_array },
- { NM_IP4_CONFIG_DOMAINS, &priv->domains, },
- { NM_IP4_CONFIG_SEARCHES, &priv->searches, },
- { NM_IP4_CONFIG_WINS_SERVERS, &priv->wins, demarshal_ip4_array },
- { NULL },
- };
-
- NM_OBJECT_CLASS (nm_ip4_config_parent_class)->init_dbus (object);
-
- _nm_object_register_properties (object,
- NM_DBUS_INTERFACE_IP4_CONFIG,
- property_info);
-}
-
-static void
-finalize (GObject *object)
-{
- NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
-
- g_free (priv->gateway);
-
- g_ptr_array_unref (priv->addresses);
- g_ptr_array_unref (priv->routes);
-
- g_strfreev (priv->nameservers);
- g_strfreev (priv->domains);
- g_strfreev (priv->searches);
- g_strfreev (priv->wins);
-
- G_OBJECT_CLASS (nm_ip4_config_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMIP4Config *self = NM_IP4_CONFIG (object);
-
- switch (prop_id) {
- case PROP_GATEWAY:
- g_value_set_string (value, nm_ip4_config_get_gateway (self));
- break;
- case PROP_ADDRESSES:
- g_value_take_boxed (value, _nm_utils_copy_array (nm_ip4_config_get_addresses (self),
- (NMUtilsCopyFunc) nm_ip4_address_dup,
- (GDestroyNotify) nm_ip4_address_unref));
- break;
- case PROP_ROUTES:
- g_value_take_boxed (value, _nm_utils_copy_array (nm_ip4_config_get_routes (self),
- (NMUtilsCopyFunc) nm_ip4_route_dup,
- (GDestroyNotify) nm_ip4_route_unref));
- break;
- case PROP_NAMESERVERS:
- g_value_set_boxed (value, (char **) nm_ip4_config_get_nameservers (self));
- break;
- case PROP_DOMAINS:
- g_value_set_boxed (value, (char **) nm_ip4_config_get_domains (self));
- break;
- case PROP_SEARCHES:
- g_value_set_boxed (value, (char **) nm_ip4_config_get_searches (self));
- break;
- case PROP_WINS_SERVERS:
- g_value_set_boxed (value, (char **) nm_ip4_config_get_wins_servers (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
}
static void
nm_ip4_config_class_init (NMIP4ConfigClass *config_class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (config_class);
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (config_class);
- g_type_class_add_private (config_class, sizeof (NMIP4ConfigPrivate));
-
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_IP4_CONFIG);
-
- /* virtual methods */
- object_class->get_property = get_property;
- object_class->finalize = finalize;
-
- nm_object_class->init_dbus = init_dbus;
-
- /* properties */
-
- /**
- * NMIP4Config:gateway:
- *
- * The IP4 gateway address of the configuration as string.
- **/
- g_object_class_install_property
- (object_class, PROP_GATEWAY,
- g_param_spec_string (NM_IP4_CONFIG_GATEWAY, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP4Config:addresses:
- *
- * A #GPtrArray containing the addresses (#NMIP4Address) of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_ADDRESSES,
- g_param_spec_boxed (NM_IP4_CONFIG_ADDRESSES, "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP4Config:routes:
- *
- * A #GPtrArray containing the routes (#NMIP4Route) of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_ROUTES,
- g_param_spec_boxed (NM_IP4_CONFIG_ROUTES, "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP4Config:nameservers:
- *
- * The array containing name server IP addresses of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_NAMESERVERS,
- g_param_spec_boxed (NM_IP4_CONFIG_NAMESERVERS, "", "",
- G_TYPE_STRV,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP4Config:domains:
- *
- * The array containing domain strings of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_DOMAINS,
- g_param_spec_boxed (NM_IP4_CONFIG_DOMAINS, "", "",
- G_TYPE_STRV,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP4Config:searches:
- *
- * The array containing DNS search strings of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_SEARCHES,
- g_param_spec_boxed (NM_IP4_CONFIG_SEARCHES, "", "",
- G_TYPE_STRV,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP4Config:wins-servers:
- *
- * The array containing WINS server IP addresses of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_WINS_SERVERS,
- g_param_spec_boxed (NM_IP4_CONFIG_WINS_SERVERS, "", "",
- G_TYPE_STRV,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
-
-/**
- * nm_ip4_config_get_gateway:
- * @config: a #NMIP4Config
- *
- * Gets the IP4 gateway address.
- *
- * Returns: (transfer none): the IP4 address of the gateway.
- **/
-const char *
-nm_ip4_config_get_gateway (NMIP4Config *config)
-{
- g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
- return NM_IP4_CONFIG_GET_PRIVATE (config)->gateway;
-}
-
-/**
- * nm_ip4_config_get_addresses:
- * @config: a #NMIP4Config
- *
- * Gets the IP4 addresses (containing the address, prefix, and gateway).
- *
- * Returns: (element-type NMIP4Address) (transfer none): the #GPtrArray
- * containing #NMIP4Address<!-- -->es. This is the internal copy used by the
- * configuration and must not be modified.
- **/
-GPtrArray *
-nm_ip4_config_get_addresses (NMIP4Config *config)
-{
- g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
- return NM_IP4_CONFIG_GET_PRIVATE (config)->addresses;
-}
-
-/**
- * nm_ip4_config_get_nameservers:
- * @config: a #NMIP4Config
- *
- * Gets the domain name servers (DNS).
- *
- * Returns: (transfer none): the array of nameserver IP addresses
- **/
-const char * const *
-nm_ip4_config_get_nameservers (NMIP4Config *config)
-{
- g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
- return (const char * const *) NM_IP4_CONFIG_GET_PRIVATE (config)->nameservers;
-}
-
-/**
- * nm_ip4_config_get_domains:
- * @config: a #NMIP4Config
- *
- * Gets the domain names.
- *
- * Returns: (transfer none): the array of domains.
- * (This is never %NULL, though it may be 0-length).
- **/
-const char * const *
-nm_ip4_config_get_domains (NMIP4Config *config)
-{
- g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
- return (const char * const *) NM_IP4_CONFIG_GET_PRIVATE (config)->domains;
-}
-
-/**
- * nm_ip4_config_get_searches:
- * @config: a #NMIP4Config
- *
- * Gets the DNS searches.
- *
- * Returns: (transfer none): the array of DNS search strings.
- * (This is never %NULL, though it may be 0-length).
- **/
-const char * const *
-nm_ip4_config_get_searches (NMIP4Config *config)
-{
- g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
- return (const char * const *) NM_IP4_CONFIG_GET_PRIVATE (config)->searches;
-}
-
-/**
- * nm_ip4_config_get_wins_servers:
- * @config: a #NMIP4Config
- *
- * Gets the Windows Internet Name Service servers (WINS).
- *
- * Returns: (element-type guint32) (transfer none): the #GArray containing #guint32s.
- * This is the internal copy used by the configuration and must not be
- * modified.
- **/
-const char * const *
-nm_ip4_config_get_wins_servers (NMIP4Config *config)
-{
- g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
- return (const char * const *) NM_IP4_CONFIG_GET_PRIVATE (config)->wins;
-}
-
-/**
- * nm_ip4_config_get_routes:
- * @config: a #NMIP4Config
- *
- * Gets the routes.
- *
- * Returns: (element-type NMIP4Route) (transfer none): the #GPtrArray containing
- * #NMIP4Routes. This is the internal copy used by the configuration, and must
- * not be modified.
- **/
-GPtrArray *
-nm_ip4_config_get_routes (NMIP4Config *config)
-{
- g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
- return NM_IP4_CONFIG_GET_PRIVATE (config)->routes;
}
diff --git a/libnm/nm-ip4-config.h b/libnm/nm-ip4-config.h
index a933a5e277..e2a18e0f31 100644
--- a/libnm/nm-ip4-config.h
+++ b/libnm/nm-ip4-config.h
@@ -22,11 +22,7 @@
#ifndef __NM_IP4_CONFIG_H__
#define __NM_IP4_CONFIG_H__
-#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
-#error "Only <NetworkManager.h> can be included directly."
-#endif
-
-#include <nm-object.h>
+#include <nm-ip-config.h>
G_BEGIN_DECLS
@@ -37,35 +33,19 @@ G_BEGIN_DECLS
#define NM_IS_IP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_IP4_CONFIG))
#define NM_IP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP4_CONFIG, NMIP4ConfigClass))
-struct _NMIP4Config {
- NMObject parent;
-};
+typedef struct {
+ NMIPConfig parent;
+} NMIP4Config;
typedef struct {
- NMObjectClass parent;
+ NMIPConfigClass parent;
/*< private >*/
gpointer padding[4];
} NMIP4ConfigClass;
-#define NM_IP4_CONFIG_GATEWAY "gateway"
-#define NM_IP4_CONFIG_ADDRESSES "addresses"
-#define NM_IP4_CONFIG_ROUTES "routes"
-#define NM_IP4_CONFIG_NAMESERVERS "nameservers"
-#define NM_IP4_CONFIG_DOMAINS "domains"
-#define NM_IP4_CONFIG_SEARCHES "searches"
-#define NM_IP4_CONFIG_WINS_SERVERS "wins-servers"
-
GType nm_ip4_config_get_type (void);
-const char * nm_ip4_config_get_gateway (NMIP4Config *config);
-GPtrArray * nm_ip4_config_get_addresses (NMIP4Config *config);
-GPtrArray * nm_ip4_config_get_routes (NMIP4Config *config);
-const char * const *nm_ip4_config_get_nameservers (NMIP4Config *config);
-const char * const *nm_ip4_config_get_domains (NMIP4Config *config);
-const char * const *nm_ip4_config_get_searches (NMIP4Config *config);
-const char * const *nm_ip4_config_get_wins_servers (NMIP4Config *config);
-
G_END_DECLS
#endif /* __NM_IP4_CONFIG_H__ */
diff --git a/libnm/nm-ip6-config.c b/libnm/nm-ip6-config.c
index 8b48c15992..8a6c966c39 100644
--- a/libnm/nm-ip6-config.c
+++ b/libnm/nm-ip6-config.c
@@ -15,361 +15,25 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2008 - 2014 Red Hat, Inc.
+ * Copyright 2014 Red Hat, Inc.
*/
-#include <string.h>
+#include "config.h"
-#include <nm-setting-ip6-config.h>
#include "nm-ip6-config.h"
-#include "nm-dbus-interface.h"
#include "nm-object-private.h"
-#include "nm-utils.h"
-#include "nm-core-internal.h"
-G_DEFINE_TYPE (NMIP6Config, nm_ip6_config, NM_TYPE_OBJECT)
-
-#define NM_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP6_CONFIG, NMIP6ConfigPrivate))
-
-typedef struct {
- char *gateway;
- GPtrArray *addresses;
- GPtrArray *routes;
- char **nameservers;
- char **domains;
- char **searches;
-} NMIP6ConfigPrivate;
-
-enum {
- PROP_0,
- PROP_GATEWAY,
- PROP_ADDRESSES,
- PROP_ROUTES,
- PROP_NAMESERVERS,
- PROP_DOMAINS,
- PROP_SEARCHES,
-
- LAST_PROP
-};
-
-static gboolean
-demarshal_ip6_address_array (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
-{
- NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object);
-
- g_ptr_array_unref (priv->addresses);
- priv->addresses = nm_utils_ip6_addresses_from_variant (value);
- _nm_object_queue_notify (object, NM_IP6_CONFIG_ADDRESSES);
-
- return TRUE;
-}
-
-static gboolean
-demarshal_ip6_nameserver_array (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
-{
- char ***obj_field;
-
- obj_field = field;
- if (*obj_field)
- g_strfreev (*obj_field);
-
- *obj_field = nm_utils_ip6_dns_from_variant (value);
-
- _nm_object_queue_notify (object, pspec->name);
- return TRUE;
-}
-
-static gboolean
-demarshal_ip6_routes_array (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
-{
- NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object);
-
- g_ptr_array_unref (priv->routes);
- priv->routes = nm_utils_ip6_routes_from_variant (value);
- _nm_object_queue_notify (object, NM_IP6_CONFIG_ROUTES);
-
- return TRUE;
-}
-
-static void
-init_dbus (NMObject *object)
-{
- NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object);
- const NMPropertiesInfo property_info[] = {
- { NM_IP6_CONFIG_GATEWAY, &priv->gateway, },
- { NM_IP6_CONFIG_ADDRESSES, &priv->addresses, demarshal_ip6_address_array },
- { NM_IP6_CONFIG_ROUTES, &priv->routes, demarshal_ip6_routes_array },
- { NM_IP6_CONFIG_NAMESERVERS, &priv->nameservers, demarshal_ip6_nameserver_array },
- { NM_IP6_CONFIG_DOMAINS, &priv->domains, },
- { NM_IP6_CONFIG_SEARCHES, &priv->searches, },
- { NULL },
- };
-
- NM_OBJECT_CLASS (nm_ip6_config_parent_class)->init_dbus (object);
-
- _nm_object_register_properties (object,
- NM_DBUS_INTERFACE_IP6_CONFIG,
- property_info);
-}
-
-/**
- * nm_ip6_config_get_gateway:
- * @config: a #NMIP6Config
- *
- * Gets the IP6 gateway.
- *
- * Returns: (transfer none): the IPv6 gateway of the configuration.
- **/
-const char *
-nm_ip6_config_get_gateway (NMIP6Config *config)
-{
- g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL);
-
- return NM_IP6_CONFIG_GET_PRIVATE (config)->gateway;
-}
-
-/**
- * nm_ip6_config_get_addresses:
- * @config: a #NMIP6Config
- *
- * Gets the IP6 addresses (containing the address, prefix, and gateway).
- *
- * Returns: (element-type NMIP6Address) (transfer none): the #GPtrArray
- * containing #NMIP6Address<!-- -->es. This is the internal copy used by the
- * configuration and must not be modified.
- **/
-GPtrArray *
-nm_ip6_config_get_addresses (NMIP6Config *config)
-{
- g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL);
-
- return NM_IP6_CONFIG_GET_PRIVATE (config)->addresses;
-}
-
-/**
- * nm_ip6_config_get_nameservers:
- * @config: a #NMIP6Config
- *
- * Gets the domain name servers (DNS).
- *
- * Returns: (transfer none): the array of nameserver IP addresses
- **/
-const char * const *
-nm_ip6_config_get_nameservers (NMIP6Config *config)
-{
- g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL);
-
- return (const char * const *) NM_IP6_CONFIG_GET_PRIVATE (config)->nameservers;
-}
-
-/**
- * nm_ip6_config_get_domains:
- * @config: a #NMIP6Config
- *
- * Gets the domain names.
- *
- * Returns: (transfer none): the array of domains.
- * (This is never %NULL, though it may be 0-length).
- **/
-const char * const *
-nm_ip6_config_get_domains (NMIP6Config *config)
-{
- g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL);
-
- return (const char * const *) NM_IP6_CONFIG_GET_PRIVATE (config)->domains;
-}
-
-/**
- * nm_ip6_config_get_searches:
- * @config: a #NMIP6Config
- *
- * Gets the DNS search strings.
- *
- * Returns: (transfer none): the array of DNS search strings.
- * (This is never %NULL, though it may be 0-length).
- **/
-const char * const *
-nm_ip6_config_get_searches (NMIP6Config *config)
-{
- g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL);
-
- return (const char * const *) NM_IP6_CONFIG_GET_PRIVATE (config)->searches;
-}
-
-/**
- * nm_ip6_config_get_routes:
- * @config: a #NMIP6Config
- *
- * Gets the routes.
- *
- * Returns: (element-type NMIP6Route) (transfer none): the #GPtrArray containing
- * #NMIP6Routes. This is the internal copy used by the configuration, and must
- * not be modified.
- **/
-GPtrArray *
-nm_ip6_config_get_routes (NMIP6Config *config)
-{
- g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL);
-
- return NM_IP6_CONFIG_GET_PRIVATE (config)->routes;
-}
-
-static void
-finalize (GObject *object)
-{
- NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object);
-
- g_free (priv->gateway);
-
- g_ptr_array_unref (priv->addresses);
- g_ptr_array_unref (priv->routes);
-
- g_strfreev (priv->nameservers);
- g_strfreev (priv->domains);
- g_strfreev (priv->searches);
-
- G_OBJECT_CLASS (nm_ip6_config_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMIP6Config *self = NM_IP6_CONFIG (object);
-
- switch (prop_id) {
- case PROP_GATEWAY:
- g_value_set_string (value, nm_ip6_config_get_gateway (self));
- break;
- case PROP_ADDRESSES:
- g_value_take_boxed (value, _nm_utils_copy_array (nm_ip6_config_get_addresses (self),
- (NMUtilsCopyFunc) nm_ip6_address_dup,
- (GDestroyNotify) nm_ip6_address_unref));
- break;
- case PROP_ROUTES:
- g_value_take_boxed (value, _nm_utils_copy_array (nm_ip6_config_get_routes (self),
- (NMUtilsCopyFunc) nm_ip6_route_dup,
- (GDestroyNotify) nm_ip6_route_unref));
- break;
- case PROP_NAMESERVERS:
- g_value_set_boxed (value, (char **) nm_ip6_config_get_nameservers (self));
- break;
- case PROP_DOMAINS:
- g_value_set_boxed (value, (char **) nm_ip6_config_get_domains (self));
- break;
- case PROP_SEARCHES:
- g_value_set_boxed (value, (char **) nm_ip6_config_get_searches (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
+G_DEFINE_TYPE (NMIP6Config, nm_ip6_config, NM_TYPE_IP_CONFIG)
static void
nm_ip6_config_init (NMIP6Config *config)
{
- NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config);
-
- priv->addresses = g_ptr_array_new ();
- priv->routes = g_ptr_array_new ();
- priv->nameservers = g_new0 (char *, 1);
- priv->domains = g_new0 (char *, 1);
- priv->searches = g_new0 (char *, 1);
}
static void
nm_ip6_config_class_init (NMIP6ConfigClass *config_class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (config_class);
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (config_class);
- g_type_class_add_private (config_class, sizeof (NMIP6ConfigPrivate));
-
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_IP6_CONFIG);
-
- /* virtual methods */
- object_class->get_property = get_property;
- object_class->finalize = finalize;
-
- nm_object_class->init_dbus = init_dbus;
-
- /* properties */
-
- /**
- * NMIP6Config:gateway:
- *
- * The IPv6 gateway as string
- **/
- g_object_class_install_property
- (object_class, PROP_GATEWAY,
- g_param_spec_string (NM_IP6_CONFIG_GATEWAY, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP6Config:addresses:
- *
- * The #GPtrArray containing the IPv6 addresses (#NMIP6Address).
- **/
- g_object_class_install_property
- (object_class, PROP_ADDRESSES,
- g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP6Config:routes:
- *
- * The #GPtrArray containing the IPv6 routes (#NMIP6Route).
- **/
- g_object_class_install_property
- (object_class, PROP_ROUTES,
- g_param_spec_boxed (NM_IP6_CONFIG_ROUTES, "", "",
- G_TYPE_PTR_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP6Config:nameservers:
- *
- * The #GPtrArray containing elements of type 'struct ip6_addr' which
- * contain the addresses of nameservers of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_NAMESERVERS,
- g_param_spec_boxed (NM_IP6_CONFIG_NAMESERVERS, "", "",
- G_TYPE_STRV,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP6Config:domains:
- *
- * The #GPtrArray containing domain strings of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_DOMAINS,
- g_param_spec_boxed (NM_IP6_CONFIG_DOMAINS, "", "",
- G_TYPE_STRV,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMIP6Config:searches:
- *
- * The #GPtrArray containing dns search strings of the configuration.
- **/
- g_object_class_install_property
- (object_class, PROP_SEARCHES,
- g_param_spec_boxed (NM_IP6_CONFIG_SEARCHES, "", "",
- G_TYPE_STRV,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
}
diff --git a/libnm/nm-ip6-config.h b/libnm/nm-ip6-config.h
index 2c98633411..1953476d00 100644
--- a/libnm/nm-ip6-config.h
+++ b/libnm/nm-ip6-config.h
@@ -22,11 +22,7 @@
#ifndef __NM_IP6_CONFIG_H__
#define __NM_IP6_CONFIG_H__
-#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
-#error "Only <NetworkManager.h> can be included directly."
-#endif
-
-#include <nm-object.h>
+#include <nm-ip-config.h>
G_BEGIN_DECLS
@@ -37,33 +33,19 @@ G_BEGIN_DECLS
#define NM_IS_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_IP6_CONFIG))
#define NM_IP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP6_CONFIG, NMIP6ConfigClass))
-struct _NMIP6Config {
- NMObject parent;
-};
+typedef struct {
+ NMIPConfig parent;
+} NMIP6Config;
typedef struct {
- NMObjectClass parent;
+ NMIPConfigClass parent;
/*< private >*/
gpointer padding[4];
} NMIP6ConfigClass;
-#define NM_IP6_CONFIG_GATEWAY "gateway"
-#define NM_IP6_CONFIG_ADDRESSES "addresses"
-#define NM_IP6_CONFIG_ROUTES "routes"
-#define NM_IP6_CONFIG_NAMESERVERS "nameservers"
-#define NM_IP6_CONFIG_DOMAINS "domains"
-#define NM_IP6_CONFIG_SEARCHES "searches"
-
GType nm_ip6_config_get_type (void);
-const char * nm_ip6_config_get_gateway (NMIP6Config *config);
-GPtrArray * nm_ip6_config_get_addresses (NMIP6Config *config);
-GPtrArray * nm_ip6_config_get_routes (NMIP6Config *config);
-const char * const * nm_ip6_config_get_nameservers (NMIP6Config *config);
-const char * const * nm_ip6_config_get_domains (NMIP6Config *config);
-const char * const * nm_ip6_config_get_searches (NMIP6Config *config);
-
G_END_DECLS
#endif /* __NM_IP6_CONFIG_H__ */
diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c
index d60845edc9..003d6b8755 100644
--- a/libnm/nm-manager.c
+++ b/libnm/nm-manager.c
@@ -19,8 +19,10 @@
* Copyright 2007 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nm-manager.h"
@@ -566,7 +568,7 @@ nm_manager_get_permission_result (NMManager *manager, NMClientPermission permiss
NMConnectivityState
nm_manager_get_connectivity (NMManager *manager)
{
- g_return_val_if_fail (NM_IS_MANAGER (manager), NM_STATE_UNKNOWN);
+ g_return_val_if_fail (NM_IS_MANAGER (manager), NM_CONNECTIVITY_UNKNOWN);
return NM_MANAGER_GET_PRIVATE (manager)->connectivity;
}
@@ -743,6 +745,8 @@ typedef struct {
char *new_connection_path;
} ActivateInfo;
+static void active_removed (NMObject *object, NMActiveConnection *active, gpointer user_data);
+
static void
activate_info_complete (ActivateInfo *info,
NMActiveConnection *active,
@@ -750,6 +754,7 @@ activate_info_complete (ActivateInfo *info,
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (info->manager);
+ g_signal_handlers_disconnect_by_func (info->manager, G_CALLBACK (active_removed), info);
if (active)
g_simple_async_result_set_op_res_gpointer (info->simple, g_object_ref (active), g_object_unref);
else
@@ -813,9 +818,12 @@ recheck_pending_activations (NMManager *self)
devices = nm_active_connection_get_devices (candidate);
if (devices->len == 0)
continue;
- device = devices->pdata[0];
- if (nm_device_get_active_connection (device) != candidate)
- continue;
+
+ if (!NM_IS_VPN_CONNECTION (candidate)) {
+ device = devices->pdata[0];
+ if (nm_device_get_active_connection (device) != candidate)
+ continue;
+ }
activate_info_complete (info, candidate, NULL);
break;
@@ -837,6 +845,22 @@ activation_cancelled (GCancellable *cancellable,
}
static void
+active_removed (NMObject *object, NMActiveConnection *active, gpointer user_data)
+{
+ ActivateInfo *info = user_data;
+ GError *error = NULL;
+
+ if (strcmp (info->active_path, nm_object_get_path (NM_OBJECT (active))))
+ return;
+
+ error = g_error_new_literal (NM_CLIENT_ERROR,
+ NM_CLIENT_ERROR_FAILED,
+ _("Active connection could not be attached to the device"));
+ activate_info_complete (info, NULL, error);
+ g_clear_error (&error);
+}
+
+static void
activate_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
@@ -852,6 +876,9 @@ activate_cb (GObject *object,
G_CALLBACK (activation_cancelled), info);
}
+ g_signal_connect (info->manager, "active-connection-removed",
+ G_CALLBACK (active_removed), info);
+
recheck_pending_activations (info->manager);
} else {
g_dbus_error_strip_remote_error (error);
@@ -928,6 +955,9 @@ add_activate_cb (GObject *object,
G_CALLBACK (activation_cancelled), info);
}
+ g_signal_connect (info->manager, "active-connection-removed",
+ G_CALLBACK (active_removed), info);
+
recheck_pending_activations (info->manager);
} else {
g_dbus_error_strip_remote_error (error);
@@ -1043,8 +1073,6 @@ object_creation_failed (NMObject *object, const char *failed_path)
GError *error;
GSList *iter;
- g_return_if_fail (find_active_connection_by_path (self, failed_path) == NULL);
-
/* A newly activated connection failed due to some immediate error
* and disappeared from active connection list. Make sure the
* callback gets called.
@@ -1278,9 +1306,6 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
{
NMManager *manager = NM_MANAGER (initable);
- if (!nm_utils_init (error))
- return FALSE;
-
if (!nm_manager_parent_initable_iface->init (initable, cancellable, error))
return FALSE;
@@ -1352,13 +1377,6 @@ init_async (GAsyncInitable *initable, int io_priority,
gpointer user_data)
{
NMManagerInitData *init_data;
- GError *error = NULL;
-
- if (!nm_utils_init (&error)) {
- g_simple_async_report_take_gerror_in_idle (G_OBJECT (initable),
- callback, user_data, error);
- return;
- }
init_data = g_slice_new0 (NMManagerInitData);
init_data->manager = NM_MANAGER (initable);
diff --git a/libnm/nm-object-cache.c b/libnm/nm-object-cache.c
index fe388803e7..752c606a93 100644
--- a/libnm/nm-object-cache.c
+++ b/libnm/nm-object-cache.c
@@ -18,6 +18,8 @@
* Copyright 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
#include "nm-object-cache.h"
diff --git a/libnm/nm-object.c b/libnm/nm-object.c
index 2023a74fa0..5504efbe53 100644
--- a/libnm/nm-object.c
+++ b/libnm/nm-object.c
@@ -19,9 +19,11 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gio/gio.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <stdio.h>
#include <nm-utils.h>
@@ -209,15 +211,9 @@ deferred_notify_cb (gpointer data)
g_object_ref (object);
- /* Emit property change notifications first */
- for (iter = props; iter; iter = g_slist_next (iter)) {
- NotifyItem *item = iter->data;
-
- if (item->property)
- g_object_notify (G_OBJECT (object), item->property);
- }
-
- /* And added/removed signals second */
+ /* Emit added/removed signals first since some of our internal objects
+ * use the added/removed signals for new object processing.
+ */
for (iter = props; iter; iter = g_slist_next (iter)) {
NotifyItem *item = iter->data;
char buf[50];
@@ -243,6 +239,15 @@ deferred_notify_cb (gpointer data)
g_signal_emit_by_name (object, buf, item->changed);
}
}
+
+ /* Emit property change notifications second */
+ for (iter = props; iter; iter = g_slist_next (iter)) {
+ NotifyItem *item = iter->data;
+
+ if (item->property)
+ g_object_notify (G_OBJECT (object), item->property);
+ }
+
g_object_unref (object);
g_slist_free_full (props, (GDestroyNotify) notify_item_free);
@@ -620,7 +625,7 @@ typedef struct {
GObject **objects;
int length, remaining;
- gboolean array;
+ GPtrArray *array;
const char *property_name;
} ObjectCreatedData;
@@ -666,7 +671,8 @@ object_property_complete (ObjectCreatedData *odata)
gboolean different = TRUE;
if (odata->array) {
- GPtrArray *old = *((GPtrArray **) pi->field);
+ GPtrArray *pi_old = *((GPtrArray **) pi->field);
+ GPtrArray *old = odata->array;
GPtrArray *new;
int i;
@@ -675,22 +681,17 @@ 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);
- if (old) {
- /* Find objects in 'old' that do not exist in 'new' */
- array_diff (old, new, removed);
+ /* Find objects in 'old' that do not exist in 'new' */
+ array_diff (old, new, removed);
- /* Find objects in 'new' that do not exist in old */
- array_diff (new, old, added);
- } else {
- for (i = 0; i < new->len; i++)
- g_ptr_array_add (added, g_ptr_array_index (new, i));
- }
-
- *((GPtrArray **) pi->field) = new;
+ /* Find objects in 'new' that do not exist in old */
+ array_diff (new, old, added);
/* Emit added & removed */
for (i = 0; i < removed->len; i++) {
@@ -714,15 +715,14 @@ 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;
}
/* Free old array last since it will release references, thus freeing
* any objects in the 'removed' array.
*/
- if (old)
- g_ptr_array_unref (old);
+ if (pi_old)
+ g_ptr_array_unref (pi_old);
} else {
GObject **obj_p = pi->field;
@@ -740,6 +740,8 @@ object_property_complete (ObjectCreatedData *odata)
g_object_unref (self);
g_free (odata->objects);
+ if (odata->array)
+ g_ptr_array_unref (odata->array);
g_slice_free (ObjectCreatedData, odata);
}
@@ -776,7 +778,7 @@ handle_object_property (NMObject *self, const char *property_name, GVariant *val
odata->pi = pi;
odata->objects = g_new (GObject *, 1);
odata->length = odata->remaining = 1;
- odata->array = FALSE;
+ odata->array = NULL;
odata->property_name = property_name;
priv->reload_remaining++;
@@ -815,6 +817,7 @@ handle_object_array_property (NMObject *self, const char *property_name, GVarian
GPtrArray **array = pi->field;
const char *path;
ObjectCreatedData *odata;
+ guint i, len = *array ? (*array)->len : 0;
npaths = g_variant_n_children (value);
@@ -823,9 +826,13 @@ handle_object_array_property (NMObject *self, const char *property_name, GVarian
odata->pi = pi;
odata->objects = g_new0 (GObject *, npaths);
odata->length = odata->remaining = npaths;
- odata->array = TRUE;
odata->property_name = property_name;
+ /* Objects known at this point. */
+ odata->array = g_ptr_array_new_full (len, g_object_unref);
+ for (i = 0; i < len; i++)
+ g_ptr_array_add (odata->array, g_object_ref (g_ptr_array_index (*array, i)));
+
priv->reload_remaining++;
if (npaths == 0) {
@@ -914,7 +921,7 @@ handle_property_changed (NMObject *self, const char *dbus_name,
g_free (s);
}
- if (pi->object_type) {
+ if (pspec && pi->object_type) {
if (g_variant_is_of_type (value, G_VARIANT_TYPE_OBJECT_PATH))
success = handle_object_property (self, pspec->name, value, pi, synchronously);
else if (g_variant_is_of_type (value, G_VARIANT_TYPE ("ao")))
diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c
index a8592231cd..3afe7f8eb9 100644
--- a/libnm/nm-remote-connection.c
+++ b/libnm/nm-remote-connection.c
@@ -19,9 +19,11 @@
* Copyright 2007 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gio/gio.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <nm-dbus-interface.h>
#include <nm-utils.h>
diff --git a/libnm/nm-remote-settings.c b/libnm/nm-remote-settings.c
index 754fbe1303..d37e366617 100644
--- a/libnm/nm-remote-settings.c
+++ b/libnm/nm-remote-settings.c
@@ -19,8 +19,10 @@
* Copyright 2009 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <nm-dbus-interface.h>
#include <nm-connection.h>
diff --git a/libnm/nm-secret-agent.c b/libnm/nm-secret-agent-old.c
index 2dfde7a093..606c40999d 100644
--- a/libnm/nm-secret-agent.c
+++ b/libnm/nm-secret-agent-old.c
@@ -18,12 +18,13 @@
* Copyright 2010 - 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include "nm-glib-compat.h"
#include "nm-dbus-interface.h"
-#include "nm-secret-agent.h"
+#include "nm-secret-agent-old.h"
#include "nm-enum-types.h"
#include "nm-dbus-helpers.h"
#include "nm-simple-connection.h"
@@ -31,14 +32,14 @@
#include "nmdbus-secret-agent.h"
#include "nmdbus-agent-manager.h"
-static void nm_secret_agent_initable_iface_init (GInitableIface *iface);
-static void nm_secret_agent_async_initable_iface_init (GAsyncInitableIface *iface);
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (NMSecretAgent, nm_secret_agent, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, nm_secret_agent_initable_iface_init);
- G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, nm_secret_agent_async_initable_iface_init);
+static void nm_secret_agent_old_initable_iface_init (GInitableIface *iface);
+static void nm_secret_agent_old_async_initable_iface_init (GAsyncInitableIface *iface);
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (NMSecretAgentOld, nm_secret_agent_old, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, nm_secret_agent_old_initable_iface_init);
+ G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, nm_secret_agent_old_async_initable_iface_init);
)
-#define NM_SECRET_AGENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SECRET_AGENT, NMSecretAgentPrivate))
+#define NM_SECRET_AGENT_OLD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SECRET_AGENT_OLD, NMSecretAgentOldPrivate))
typedef struct {
gboolean registered;
@@ -57,7 +58,7 @@ typedef struct {
char *identifier;
gboolean auto_register;
gboolean suppress_auto;
-} NMSecretAgentPrivate;
+} NMSecretAgentOldPrivate;
enum {
PROP_0,
@@ -72,15 +73,15 @@ enum {
/*************************************************************/
static void
-_internal_unregister (NMSecretAgent *self)
+_internal_unregister (NMSecretAgentOld *self)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
if (priv->registered) {
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (priv->dbus_secret_agent));
priv->registered = FALSE;
priv->registering = FALSE;
- g_object_notify (G_OBJECT (self), NM_SECRET_AGENT_REGISTERED);
+ g_object_notify (G_OBJECT (self), NM_SECRET_AGENT_OLD_REGISTERED);
}
}
@@ -91,9 +92,9 @@ typedef struct {
} GetSecretsInfo;
static void
-get_secrets_info_finalize (NMSecretAgent *self, GetSecretsInfo *info)
+get_secrets_info_finalize (NMSecretAgentOld *self, GetSecretsInfo *info)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
g_return_if_fail (info != NULL);
@@ -106,9 +107,9 @@ get_secrets_info_finalize (NMSecretAgent *self, GetSecretsInfo *info)
}
static inline gboolean
-should_auto_register (NMSecretAgent *self)
+should_auto_register (NMSecretAgentOld *self)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
return ( priv->auto_register
&& !priv->suppress_auto
@@ -121,22 +122,22 @@ name_owner_changed (GObject *proxy,
GParamSpec *pspec,
gpointer user_data)
{
- NMSecretAgent *self = NM_SECRET_AGENT (user_data);
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOld *self = NM_SECRET_AGENT_OLD (user_data);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
GSList *iter;
char *owner;
owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (proxy));
if (owner != NULL) {
if (should_auto_register (self))
- nm_secret_agent_register_async (self, NULL, NULL, NULL);
+ nm_secret_agent_old_register_async (self, NULL, NULL, NULL);
g_free (owner);
} else {
/* Cancel any pending secrets requests */
for (iter = priv->pending_gets; iter; iter = g_slist_next (iter)) {
GetSecretsInfo *info = iter->data;
- NM_SECRET_AGENT_GET_CLASS (self)->cancel_get_secrets (self,
+ NM_SECRET_AGENT_OLD_GET_CLASS (self)->cancel_get_secrets (self,
info->path,
info->setting_name);
}
@@ -148,11 +149,11 @@ name_owner_changed (GObject *proxy,
}
static gboolean
-verify_sender (NMSecretAgent *self,
+verify_sender (NMSecretAgentOld *self,
GDBusMethodInvocation *context,
GError **error)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
char *nm_owner;
const char *sender;
guint32 sender_uid;
@@ -245,7 +246,7 @@ verify_sender (NMSecretAgent *self,
}
static gboolean
-verify_request (NMSecretAgent *self,
+verify_request (NMSecretAgentOld *self,
GDBusMethodInvocation *context,
GVariant *connection_dict,
const char *connection_path,
@@ -289,7 +290,7 @@ verify_request (NMSecretAgent *self,
}
static void
-get_secrets_cb (NMSecretAgent *self,
+get_secrets_cb (NMSecretAgentOld *self,
NMConnection *connection,
GVariant *secrets,
GError *error,
@@ -309,16 +310,16 @@ get_secrets_cb (NMSecretAgent *self,
}
static void
-impl_secret_agent_get_secrets (NMSecretAgent *self,
- GDBusMethodInvocation *context,
- GVariant *connection_dict,
- const char *connection_path,
- const char *setting_name,
- const char * const *hints,
- guint flags,
- gpointer user_data)
+impl_secret_agent_old_get_secrets (NMSecretAgentOld *self,
+ GDBusMethodInvocation *context,
+ GVariant *connection_dict,
+ const char *connection_path,
+ const char *setting_name,
+ const char * const *hints,
+ guint flags,
+ gpointer user_data)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
GError *error = NULL;
NMConnection *connection = NULL;
GetSecretsInfo *info;
@@ -335,7 +336,7 @@ impl_secret_agent_get_secrets (NMSecretAgent *self,
info->context = context;
priv->pending_gets = g_slist_append (priv->pending_gets, info);
- NM_SECRET_AGENT_GET_CLASS (self)->get_secrets (self,
+ NM_SECRET_AGENT_OLD_GET_CLASS (self)->get_secrets (self,
connection,
connection_path,
setting_name,
@@ -362,13 +363,13 @@ find_get_secrets_info (GSList *list, const char *path, const char *setting_name)
}
static void
-impl_secret_agent_cancel_get_secrets (NMSecretAgent *self,
- GDBusMethodInvocation *context,
- const char *connection_path,
- const char *setting_name,
- gpointer user_data)
+impl_secret_agent_old_cancel_get_secrets (NMSecretAgentOld *self,
+ GDBusMethodInvocation *context,
+ const char *connection_path,
+ const char *setting_name,
+ gpointer user_data)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
GError *error = NULL;
GetSecretsInfo *info;
@@ -388,14 +389,14 @@ impl_secret_agent_cancel_get_secrets (NMSecretAgent *self,
}
/* Send the cancel request up to the subclass and finalize it */
- NM_SECRET_AGENT_GET_CLASS (self)->cancel_get_secrets (self,
+ NM_SECRET_AGENT_OLD_GET_CLASS (self)->cancel_get_secrets (self,
info->path,
info->setting_name);
g_dbus_method_invocation_return_value (context, NULL);
}
static void
-save_secrets_cb (NMSecretAgent *self,
+save_secrets_cb (NMSecretAgentOld *self,
NMConnection *connection,
GError *error,
gpointer user_data)
@@ -409,11 +410,11 @@ save_secrets_cb (NMSecretAgent *self,
}
static void
-impl_secret_agent_save_secrets (NMSecretAgent *self,
- GDBusMethodInvocation *context,
- GVariant *connection_dict,
- const char *connection_path,
- gpointer user_data)
+impl_secret_agent_old_save_secrets (NMSecretAgentOld *self,
+ GDBusMethodInvocation *context,
+ GVariant *connection_dict,
+ const char *connection_path,
+ gpointer user_data)
{
GError *error = NULL;
NMConnection *connection = NULL;
@@ -424,7 +425,7 @@ impl_secret_agent_save_secrets (NMSecretAgent *self,
return;
}
- NM_SECRET_AGENT_GET_CLASS (self)->save_secrets (self,
+ NM_SECRET_AGENT_OLD_GET_CLASS (self)->save_secrets (self,
connection,
connection_path,
save_secrets_cb,
@@ -433,7 +434,7 @@ impl_secret_agent_save_secrets (NMSecretAgent *self,
}
static void
-delete_secrets_cb (NMSecretAgent *self,
+delete_secrets_cb (NMSecretAgentOld *self,
NMConnection *connection,
GError *error,
gpointer user_data)
@@ -447,11 +448,11 @@ delete_secrets_cb (NMSecretAgent *self,
}
static void
-impl_secret_agent_delete_secrets (NMSecretAgent *self,
- GDBusMethodInvocation *context,
- GVariant *connection_dict,
- const char *connection_path,
- gpointer user_data)
+impl_secret_agent_old_delete_secrets (NMSecretAgentOld *self,
+ GDBusMethodInvocation *context,
+ GVariant *connection_dict,
+ const char *connection_path,
+ gpointer user_data)
{
GError *error = NULL;
NMConnection *connection = NULL;
@@ -462,7 +463,7 @@ impl_secret_agent_delete_secrets (NMSecretAgent *self,
return;
}
- NM_SECRET_AGENT_GET_CLASS (self)->delete_secrets (self,
+ NM_SECRET_AGENT_OLD_GET_CLASS (self)->delete_secrets (self,
connection,
connection_path,
delete_secrets_cb,
@@ -473,9 +474,9 @@ impl_secret_agent_delete_secrets (NMSecretAgent *self,
/**************************************************************/
static gboolean
-check_nm_running (NMSecretAgent *self, GError **error)
+check_nm_running (NMSecretAgentOld *self, GError **error)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
char *owner;
if (priv->private_bus)
@@ -494,12 +495,12 @@ check_nm_running (NMSecretAgent *self, GError **error)
/**************************************************************/
/**
- * nm_secret_agent_register:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_register:
+ * @self: a #NMSecretAgentOld
* @cancellable: a #GCancellable, or %NULL
* @error: return location for a #GError, or %NULL
*
- * Registers the #NMSecretAgent with the NetworkManager secret manager,
+ * Registers the #NMSecretAgentOld with the NetworkManager secret manager,
* indicating to NetworkManager that the agent is able to provide and save
* secrets for connections on behalf of its user.
*
@@ -509,16 +510,16 @@ check_nm_running (NMSecretAgent *self, GError **error)
* Returns: %TRUE if registration was successful, %FALSE on error.
**/
gboolean
-nm_secret_agent_register (NMSecretAgent *self,
- GCancellable *cancellable,
- GError **error)
+nm_secret_agent_old_register (NMSecretAgentOld *self,
+ GCancellable *cancellable,
+ GError **error)
{
- NMSecretAgentPrivate *priv;
- NMSecretAgentClass *class;
+ NMSecretAgentOldPrivate *priv;
+ NMSecretAgentOldClass *class;
- g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE);
+ g_return_val_if_fail (NM_IS_SECRET_AGENT_OLD (self), FALSE);
- priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
g_return_val_if_fail (priv->registered == FALSE, FALSE);
g_return_val_if_fail (priv->registering == FALSE, FALSE);
@@ -526,7 +527,7 @@ nm_secret_agent_register (NMSecretAgent *self,
g_return_val_if_fail (priv->manager_proxy != NULL, FALSE);
/* Also make sure the subclass can actually respond to secrets requests */
- class = NM_SECRET_AGENT_GET_CLASS (self);
+ class = NM_SECRET_AGENT_OLD_GET_CLASS (self);
g_return_val_if_fail (class->get_secrets != NULL, FALSE);
g_return_val_if_fail (class->save_secrets != NULL, FALSE);
g_return_val_if_fail (class->delete_secrets != NULL, FALSE);
@@ -566,14 +567,14 @@ nm_secret_agent_register (NMSecretAgent *self,
success:
priv->registering = FALSE;
priv->registered = TRUE;
- g_object_notify (G_OBJECT (self), NM_SECRET_AGENT_REGISTERED);
+ g_object_notify (G_OBJECT (self), NM_SECRET_AGENT_OLD_REGISTERED);
return TRUE;
}
static void
-reg_result (NMSecretAgent *self, GSimpleAsyncResult *simple, GError *error)
+reg_result (NMSecretAgentOld *self, GSimpleAsyncResult *simple, GError *error)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
priv->registering = FALSE;
@@ -585,7 +586,7 @@ reg_result (NMSecretAgent *self, GSimpleAsyncResult *simple, GError *error)
_internal_unregister (self);
} else {
priv->registered = TRUE;
- g_object_notify (G_OBJECT (self), NM_SECRET_AGENT_REGISTERED);
+ g_object_notify (G_OBJECT (self), NM_SECRET_AGENT_OLD_REGISTERED);
g_simple_async_result_set_op_res_gboolean (simple, TRUE);
g_simple_async_result_complete (simple);
@@ -600,13 +601,13 @@ reg_request_cb (GObject *proxy,
gpointer user_data)
{
GSimpleAsyncResult *simple = user_data;
- NMSecretAgent *self;
- NMSecretAgentPrivate *priv;
+ NMSecretAgentOld *self;
+ NMSecretAgentOldPrivate *priv;
GError *error = NULL;
- self = NM_SECRET_AGENT (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
+ self = NM_SECRET_AGENT_OLD (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
g_object_unref (self); /* drop extra ref added by get_source_object() */
- priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
if (!nmdbus_agent_manager_call_register_finish (NMDBUS_AGENT_MANAGER (proxy), result, &error))
g_dbus_error_strip_remote_error (error);
@@ -620,12 +621,12 @@ reg_with_caps_cb (GObject *proxy,
gpointer user_data)
{
GSimpleAsyncResult *simple = user_data;
- NMSecretAgent *self;
- NMSecretAgentPrivate *priv;
+ NMSecretAgentOld *self;
+ NMSecretAgentOldPrivate *priv;
- self = NM_SECRET_AGENT (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
+ self = NM_SECRET_AGENT_OLD (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
g_object_unref (self); /* drop extra ref added by get_source_object() */
- priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
if (nmdbus_agent_manager_call_register_with_capabilities_finish (NMDBUS_AGENT_MANAGER (proxy), result, NULL)) {
reg_result (self, simple, NULL);
@@ -641,13 +642,13 @@ reg_with_caps_cb (GObject *proxy,
}
/**
- * nm_secret_agent_register_async:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_register_async:
+ * @self: a #NMSecretAgentOld
* @cancellable: a #GCancellable, or %NULL
* @callback: callback to call when the agent is registered
* @user_data: data for @callback
*
- * Asynchronously registers the #NMSecretAgent with the NetworkManager secret
+ * Asynchronously registers the #NMSecretAgentOld with the NetworkManager secret
* manager, indicating to NetworkManager that the agent is able to provide and
* save secrets for connections on behalf of its user.
*
@@ -655,19 +656,19 @@ reg_with_caps_cb (GObject *proxy,
* registered, or in the process of registering.
**/
void
-nm_secret_agent_register_async (NMSecretAgent *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+nm_secret_agent_old_register_async (NMSecretAgentOld *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
- NMSecretAgentPrivate *priv;
- NMSecretAgentClass *class;
+ NMSecretAgentOldPrivate *priv;
+ NMSecretAgentOldClass *class;
GSimpleAsyncResult *simple;
GError *error = NULL;
- g_return_if_fail (NM_IS_SECRET_AGENT (self));
+ g_return_if_fail (NM_IS_SECRET_AGENT_OLD (self));
- priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
g_return_if_fail (priv->registered == FALSE);
g_return_if_fail (priv->registering == FALSE);
@@ -675,13 +676,13 @@ nm_secret_agent_register_async (NMSecretAgent *self,
g_return_if_fail (priv->manager_proxy != NULL);
/* Also make sure the subclass can actually respond to secrets requests */
- class = NM_SECRET_AGENT_GET_CLASS (self);
+ class = NM_SECRET_AGENT_OLD_GET_CLASS (self);
g_return_if_fail (class->get_secrets != NULL);
g_return_if_fail (class->save_secrets != NULL);
g_return_if_fail (class->delete_secrets != NULL);
simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
- nm_secret_agent_register_async);
+ nm_secret_agent_old_register_async);
if (!check_nm_running (self, &error)) {
g_simple_async_result_take_error (simple, error);
@@ -712,21 +713,21 @@ nm_secret_agent_register_async (NMSecretAgent *self,
}
/**
- * nm_secret_agent_register_finish:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_register_finish:
+ * @self: a #NMSecretAgentOld
* @result: the result passed to the #GAsyncReadyCallback
* @error: return location for a #GError, or %NULL
*
- * Gets the result of a call to nm_secret_agent_register_async().
+ * Gets the result of a call to nm_secret_agent_old_register_async().
*
* Returns: %TRUE if registration was successful, %FALSE on error.
**/
gboolean
-nm_secret_agent_register_finish (NMSecretAgent *self,
- GAsyncResult *result,
- GError **error)
+nm_secret_agent_old_register_finish (NMSecretAgentOld *self,
+ GAsyncResult *result,
+ GError **error)
{
- g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), nm_secret_agent_register_async), FALSE);
+ g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), nm_secret_agent_old_register_async), FALSE);
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
return FALSE;
@@ -735,12 +736,12 @@ nm_secret_agent_register_finish (NMSecretAgent *self,
}
/**
- * nm_secret_agent_unregister:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_unregister:
+ * @self: a #NMSecretAgentOld
* @cancellable: a #GCancellable, or %NULL
* @error: return location for a #GError, or %NULL
*
- * Unregisters the #NMSecretAgent with the NetworkManager secret manager,
+ * Unregisters the #NMSecretAgentOld with the NetworkManager secret manager,
* indicating to NetworkManager that the agent will no longer provide or
* store secrets on behalf of this user.
*
@@ -750,16 +751,16 @@ nm_secret_agent_register_finish (NMSecretAgent *self,
* Returns: %TRUE if unregistration was successful, %FALSE on error
**/
gboolean
-nm_secret_agent_unregister (NMSecretAgent *self,
- GCancellable *cancellable,
- GError **error)
+nm_secret_agent_old_unregister (NMSecretAgentOld *self,
+ GCancellable *cancellable,
+ GError **error)
{
- NMSecretAgentPrivate *priv;
+ NMSecretAgentOldPrivate *priv;
gboolean success;
- g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE);
+ g_return_val_if_fail (NM_IS_SECRET_AGENT_OLD (self), FALSE);
- priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
g_return_val_if_fail (priv->registered == TRUE, FALSE);
g_return_val_if_fail (priv->bus != NULL, FALSE);
@@ -779,10 +780,10 @@ static void
unregister_cb (GObject *proxy, GAsyncResult *result, gpointer user_data)
{
GSimpleAsyncResult *simple = user_data;
- NMSecretAgent *self;
+ NMSecretAgentOld *self;
GError *error = NULL;
- self = NM_SECRET_AGENT (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
+ self = NM_SECRET_AGENT_OLD (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
g_object_unref (self); /* drop extra ref added by get_source_object() */
_internal_unregister (self);
@@ -800,13 +801,13 @@ unregister_cb (GObject *proxy, GAsyncResult *result, gpointer user_data)
}
/**
- * nm_secret_agent_unregister_async:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_unregister_async:
+ * @self: a #NMSecretAgentOld
* @cancellable: a #GCancellable, or %NULL
* @callback: callback to call when the agent is unregistered
* @user_data: data for @callback
*
- * Asynchronously unregisters the #NMSecretAgent with the NetworkManager secret
+ * Asynchronously unregisters the #NMSecretAgentOld with the NetworkManager secret
* manager, indicating to NetworkManager that the agent will no longer provide
* or store secrets on behalf of this user.
*
@@ -814,25 +815,25 @@ unregister_cb (GObject *proxy, GAsyncResult *result, gpointer user_data)
* registered.
**/
void
-nm_secret_agent_unregister_async (NMSecretAgent *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+nm_secret_agent_old_unregister_async (NMSecretAgentOld *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
- NMSecretAgentPrivate *priv;
+ NMSecretAgentOldPrivate *priv;
GSimpleAsyncResult *simple;
GError *error = NULL;
- g_return_if_fail (NM_IS_SECRET_AGENT (self));
+ g_return_if_fail (NM_IS_SECRET_AGENT_OLD (self));
- priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
g_return_if_fail (priv->registered == TRUE);
g_return_if_fail (priv->bus != NULL);
g_return_if_fail (priv->manager_proxy != NULL);
simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
- nm_secret_agent_unregister_async);
+ nm_secret_agent_old_unregister_async);
if (!check_nm_running (self, &error)) {
g_simple_async_result_take_error (simple, error);
@@ -848,21 +849,21 @@ nm_secret_agent_unregister_async (NMSecretAgent *self,
}
/**
- * nm_secret_agent_unregister_finish:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_unregister_finish:
+ * @self: a #NMSecretAgentOld
* @result: the result passed to the #GAsyncReadyCallback
* @error: return location for a #GError, or %NULL
*
- * Gets the result of a call to nm_secret_agent_unregister_async().
+ * Gets the result of a call to nm_secret_agent_old_unregister_async().
*
* Returns: %TRUE if unregistration was successful, %FALSE on error.
**/
gboolean
-nm_secret_agent_unregister_finish (NMSecretAgent *self,
- GAsyncResult *result,
- GError **error)
+nm_secret_agent_old_unregister_finish (NMSecretAgentOld *self,
+ GAsyncResult *result,
+ GError **error)
{
- g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), nm_secret_agent_unregister_async), FALSE);
+ g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), nm_secret_agent_old_unregister_async), FALSE);
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
return FALSE;
@@ -871,24 +872,24 @@ nm_secret_agent_unregister_finish (NMSecretAgent *self,
}
/**
- * nm_secret_agent_get_registered:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_get_registered:
+ * @self: a #NMSecretAgentOld
*
* Returns: a %TRUE if the agent is registered, %FALSE if it is not.
**/
gboolean
-nm_secret_agent_get_registered (NMSecretAgent *self)
+nm_secret_agent_old_get_registered (NMSecretAgentOld *self)
{
- g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE);
+ g_return_val_if_fail (NM_IS_SECRET_AGENT_OLD (self), FALSE);
- return NM_SECRET_AGENT_GET_PRIVATE (self)->registered;
+ return NM_SECRET_AGENT_OLD_GET_PRIVATE (self)->registered;
}
/**************************************************************/
/**
- * nm_secret_agent_get_secrets:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_get_secrets:
+ * @self: a #NMSecretAgentOld
* @connection: the #NMConnection for which we're asked secrets
* @setting_name: the name of the secret setting
* @hints: (array zero-terminated=1): hints to the agent
@@ -905,23 +906,24 @@ nm_secret_agent_get_registered (NMSecretAgent *self)
* Virtual: get_secrets
*/
void
-nm_secret_agent_get_secrets (NMSecretAgent *self,
- NMConnection *connection,
- const char *setting_name,
- const char **hints,
- NMSecretAgentGetSecretsFlags flags,
- NMSecretAgentGetSecretsFunc callback,
- gpointer user_data)
+nm_secret_agent_old_get_secrets (NMSecretAgentOld *self,
+ NMConnection *connection,
+ const char *setting_name,
+ const char **hints,
+ NMSecretAgentGetSecretsFlags flags,
+ NMSecretAgentOldGetSecretsFunc callback,
+ gpointer user_data)
{
- g_return_if_fail (NM_IS_SECRET_AGENT (self));
+ g_return_if_fail (NM_IS_SECRET_AGENT_OLD (self));
g_return_if_fail (NM_IS_CONNECTION (connection));
g_return_if_fail (nm_connection_get_path (connection));
g_return_if_fail (setting_name != NULL);
g_return_if_fail (strlen (setting_name) > 0);
g_return_if_fail (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM));
+ g_return_if_fail (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS));
g_return_if_fail (callback != NULL);
- NM_SECRET_AGENT_GET_CLASS (self)->get_secrets (self,
+ NM_SECRET_AGENT_OLD_GET_CLASS (self)->get_secrets (self,
connection,
nm_connection_get_path (connection),
setting_name,
@@ -932,8 +934,8 @@ nm_secret_agent_get_secrets (NMSecretAgent *self,
}
/**
- * nm_secret_agent_save_secrets:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_save_secrets:
+ * @self: a #NMSecretAgentOld
* @connection: a #NMConnection
* @callback: (scope async): a callback, to be invoked when the operation is done
* @user_data: (closure): caller-specific data to be passed to @callback
@@ -944,16 +946,16 @@ nm_secret_agent_get_secrets (NMSecretAgent *self,
* Virtual: save_secrets
*/
void
-nm_secret_agent_save_secrets (NMSecretAgent *self,
- NMConnection *connection,
- NMSecretAgentSaveSecretsFunc callback,
- gpointer user_data)
+nm_secret_agent_old_save_secrets (NMSecretAgentOld *self,
+ NMConnection *connection,
+ NMSecretAgentOldSaveSecretsFunc callback,
+ gpointer user_data)
{
- g_return_if_fail (NM_IS_SECRET_AGENT (self));
+ g_return_if_fail (NM_IS_SECRET_AGENT_OLD (self));
g_return_if_fail (NM_IS_CONNECTION (connection));
g_return_if_fail (nm_connection_get_path (connection));
- NM_SECRET_AGENT_GET_CLASS (self)->save_secrets (self,
+ NM_SECRET_AGENT_OLD_GET_CLASS (self)->save_secrets (self,
connection,
nm_connection_get_path (connection),
callback,
@@ -961,8 +963,8 @@ nm_secret_agent_save_secrets (NMSecretAgent *self,
}
/**
- * nm_secret_agent_delete_secrets:
- * @self: a #NMSecretAgent
+ * nm_secret_agent_old_delete_secrets:
+ * @self: a #NMSecretAgentOld
* @connection: a #NMConnection
* @callback: (scope async): a callback, to be invoked when the operation is done
* @user_data: (closure): caller-specific data to be passed to @callback
@@ -973,16 +975,16 @@ nm_secret_agent_save_secrets (NMSecretAgent *self,
* Virtual: delete_secrets
*/
void
-nm_secret_agent_delete_secrets (NMSecretAgent *self,
- NMConnection *connection,
- NMSecretAgentDeleteSecretsFunc callback,
- gpointer user_data)
+nm_secret_agent_old_delete_secrets (NMSecretAgentOld *self,
+ NMConnection *connection,
+ NMSecretAgentOldDeleteSecretsFunc callback,
+ gpointer user_data)
{
- g_return_if_fail (NM_IS_SECRET_AGENT (self));
+ g_return_if_fail (NM_IS_SECRET_AGENT_OLD (self));
g_return_if_fail (NM_IS_CONNECTION (connection));
g_return_if_fail (nm_connection_get_path (connection));
- NM_SECRET_AGENT_GET_CLASS (self)->delete_secrets (self,
+ NM_SECRET_AGENT_OLD_GET_CLASS (self)->delete_secrets (self,
connection,
nm_connection_get_path (connection),
callback,
@@ -1018,24 +1020,24 @@ validate_identifier (const char *identifier)
}
static void
-nm_secret_agent_init (NMSecretAgent *self)
+nm_secret_agent_old_init (NMSecretAgentOld *self)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
priv->dbus_secret_agent = nmdbus_secret_agent_skeleton_new ();
_nm_dbus_bind_properties (self, priv->dbus_secret_agent);
_nm_dbus_bind_methods (self, priv->dbus_secret_agent,
- "GetSecrets", impl_secret_agent_get_secrets,
- "CancelGetSecrets", impl_secret_agent_cancel_get_secrets,
- "DeleteSecrets", impl_secret_agent_delete_secrets,
- "SaveSecrets", impl_secret_agent_save_secrets,
+ "GetSecrets", impl_secret_agent_old_get_secrets,
+ "CancelGetSecrets", impl_secret_agent_old_cancel_get_secrets,
+ "DeleteSecrets", impl_secret_agent_old_delete_secrets,
+ "SaveSecrets", impl_secret_agent_old_save_secrets,
NULL);
}
static void
-init_common (NMSecretAgent *self)
+init_common (NMSecretAgentOld *self)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
priv->private_bus = _nm_dbus_is_connection_private (priv->bus);
@@ -1050,8 +1052,8 @@ init_common (NMSecretAgent *self)
static gboolean
init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
{
- NMSecretAgent *self = NM_SECRET_AGENT (initable);
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOld *self = NM_SECRET_AGENT_OLD (initable);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
GDBusProxy *proxy;
priv->bus = _nm_dbus_new_connection (cancellable, error);
@@ -1069,19 +1071,19 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
init_common (self);
if (priv->auto_register)
- return nm_secret_agent_register (self, cancellable, error);
+ return nm_secret_agent_old_register (self, cancellable, error);
else
return TRUE;
}
typedef struct {
- NMSecretAgent *self;
+ NMSecretAgentOld *self;
GCancellable *cancellable;
GSimpleAsyncResult *simple;
-} NMSecretAgentInitData;
+} NMSecretAgentOldInitData;
static void
-init_async_complete (NMSecretAgentInitData *init_data, GError *error)
+init_async_complete (NMSecretAgentOldInitData *init_data, GError *error)
{
if (!error)
g_simple_async_result_set_op_res_gboolean (init_data->simple, TRUE);
@@ -1092,25 +1094,25 @@ init_async_complete (NMSecretAgentInitData *init_data, GError *error)
g_object_unref (init_data->simple);
g_clear_object (&init_data->cancellable);
- g_slice_free (NMSecretAgentInitData, init_data);
+ g_slice_free (NMSecretAgentOldInitData, init_data);
}
static void
init_async_registered (GObject *object, GAsyncResult *result, gpointer user_data)
{
- NMSecretAgent *self = NM_SECRET_AGENT (object);
- NMSecretAgentInitData *init_data = user_data;
+ NMSecretAgentOld *self = NM_SECRET_AGENT_OLD (object);
+ NMSecretAgentOldInitData *init_data = user_data;
GError *error = NULL;
- nm_secret_agent_register_finish (self, result, &error);
+ nm_secret_agent_old_register_finish (self, result, &error);
init_async_complete (init_data, error);
}
static void
init_async_got_proxy (GObject *object, GAsyncResult *result, gpointer user_data)
{
- NMSecretAgentInitData *init_data = user_data;
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (init_data->self);
+ NMSecretAgentOldInitData *init_data = user_data;
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (init_data->self);
GDBusProxy *proxy;
GError *error = NULL;
@@ -1124,7 +1126,7 @@ init_async_got_proxy (GObject *object, GAsyncResult *result, gpointer user_data)
init_common (init_data->self);
if (priv->auto_register) {
- nm_secret_agent_register_async (init_data->self, init_data->cancellable,
+ nm_secret_agent_old_register_async (init_data->self, init_data->cancellable,
init_async_registered, init_data);
} else
init_async_complete (init_data, NULL);
@@ -1133,8 +1135,8 @@ init_async_got_proxy (GObject *object, GAsyncResult *result, gpointer user_data)
static void
init_async_got_bus (GObject *initable, GAsyncResult *result, gpointer user_data)
{
- NMSecretAgentInitData *init_data = user_data;
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (init_data->self);
+ NMSecretAgentOldInitData *init_data = user_data;
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (init_data->self);
GError *error = NULL;
priv->bus = _nm_dbus_new_connection_finish (result, &error);
@@ -1155,10 +1157,10 @@ init_async (GAsyncInitable *initable, int io_priority,
GCancellable *cancellable, GAsyncReadyCallback callback,
gpointer user_data)
{
- NMSecretAgent *self = NM_SECRET_AGENT (initable);
- NMSecretAgentInitData *init_data;
+ NMSecretAgentOld *self = NM_SECRET_AGENT_OLD (initable);
+ NMSecretAgentOldInitData *init_data;
- init_data = g_slice_new (NMSecretAgentInitData);
+ init_data = g_slice_new (NMSecretAgentOldInitData);
init_data->self = self;
init_data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
@@ -1185,7 +1187,7 @@ get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (object);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (object);
switch (prop_id) {
case PROP_IDENTIFIER:
@@ -1212,7 +1214,7 @@ set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (object);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (object);
const char *identifier;
switch (prop_id) {
@@ -1239,11 +1241,11 @@ set_property (GObject *object,
static void
dispose (GObject *object)
{
- NMSecretAgent *self = NM_SECRET_AGENT (object);
- NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self);
+ NMSecretAgentOld *self = NM_SECRET_AGENT_OLD (object);
+ NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
if (priv->registered)
- nm_secret_agent_unregister_async (self, NULL, NULL, NULL);
+ nm_secret_agent_old_unregister_async (self, NULL, NULL, NULL);
g_clear_pointer (&priv->identifier, g_free);
@@ -1257,15 +1259,15 @@ dispose (GObject *object)
g_clear_object (&priv->manager_proxy);
g_clear_object (&priv->bus);
- G_OBJECT_CLASS (nm_secret_agent_parent_class)->dispose (object);
+ G_OBJECT_CLASS (nm_secret_agent_old_parent_class)->dispose (object);
}
static void
-nm_secret_agent_class_init (NMSecretAgentClass *class)
+nm_secret_agent_old_class_init (NMSecretAgentOldClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- g_type_class_add_private (class, sizeof (NMSecretAgentPrivate));
+ g_type_class_add_private (class, sizeof (NMSecretAgentOldPrivate));
/* Virtual methods */
object_class->dispose = dispose;
@@ -1273,7 +1275,7 @@ nm_secret_agent_class_init (NMSecretAgentClass *class)
object_class->set_property = set_property;
/**
- * NMSecretAgent:identifier:
+ * NMSecretAgentOld:identifier:
*
* Identifies this agent; only one agent in each user session may use the
* same identifier. Identifier formatting follows the same rules as
@@ -1285,14 +1287,14 @@ nm_secret_agent_class_init (NMSecretAgentClass *class)
**/
g_object_class_install_property
(object_class, PROP_IDENTIFIER,
- g_param_spec_string (NM_SECRET_AGENT_IDENTIFIER, "", "",
+ g_param_spec_string (NM_SECRET_AGENT_OLD_IDENTIFIER, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
/**
- * NMSecretAgent:auto-register:
+ * NMSecretAgentOld:auto-register:
*
* If %TRUE (the default), the agent will always be registered when
* NetworkManager is running; if NetworkManager exits and restarts, the
@@ -1304,42 +1306,42 @@ nm_secret_agent_class_init (NMSecretAgentClass *class)
* if the agent is unable to register itself.
*
* If the property is %FALSE, the agent will not automatically register with
- * NetworkManager, and nm_secret_agent_register() or
- * nm_secret_agent_register_async() must be called to register it.
+ * NetworkManager, and nm_secret_agent_old_register() or
+ * nm_secret_agent_old_register_async() must be called to register it.
*
- * Calling nm_secret_agent_unregister() will suppress auto-registration
- * until nm_secret_agent_register() is called, which re-enables
+ * Calling nm_secret_agent_old_unregister() will suppress auto-registration
+ * until nm_secret_agent_old_register() is called, which re-enables
* auto-registration. This ensures that the agent remains un-registered when
* you expect it to be unregistered.
**/
g_object_class_install_property
(object_class, PROP_AUTO_REGISTER,
- g_param_spec_boolean (NM_SECRET_AGENT_AUTO_REGISTER, "", "",
+ g_param_spec_boolean (NM_SECRET_AGENT_OLD_AUTO_REGISTER, "", "",
TRUE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
/**
- * NMSecretAgent:registered:
+ * NMSecretAgentOld:registered:
*
* %TRUE if the agent is registered with NetworkManager, %FALSE if not.
**/
g_object_class_install_property
(object_class, PROP_REGISTERED,
- g_param_spec_boolean (NM_SECRET_AGENT_REGISTERED, "", "",
+ g_param_spec_boolean (NM_SECRET_AGENT_OLD_REGISTERED, "", "",
FALSE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
/**
- * NMSecretAgent:capabilities:
+ * NMSecretAgentOld:capabilities:
*
* A bitfield of %NMSecretAgentCapabilities.
**/
g_object_class_install_property
(object_class, PROP_CAPABILITIES,
- g_param_spec_flags (NM_SECRET_AGENT_CAPABILITIES, "", "",
+ g_param_spec_flags (NM_SECRET_AGENT_OLD_CAPABILITIES, "", "",
NM_TYPE_SECRET_AGENT_CAPABILITIES,
NM_SECRET_AGENT_CAPABILITY_NONE,
G_PARAM_READWRITE |
@@ -1351,13 +1353,13 @@ nm_secret_agent_class_init (NMSecretAgentClass *class)
}
static void
-nm_secret_agent_initable_iface_init (GInitableIface *iface)
+nm_secret_agent_old_initable_iface_init (GInitableIface *iface)
{
iface->init = init_sync;
}
static void
-nm_secret_agent_async_initable_iface_init (GAsyncInitableIface *iface)
+nm_secret_agent_old_async_initable_iface_init (GAsyncInitableIface *iface)
{
iface->init_async = init_async;
iface->init_finish = init_finish;
diff --git a/libnm/nm-secret-agent.h b/libnm/nm-secret-agent-old.h
index 41b8b742a2..6198e2c040 100644
--- a/libnm/nm-secret-agent.h
+++ b/libnm/nm-secret-agent-old.h
@@ -18,35 +18,31 @@
* Copyright 2010 - 2011 Red Hat, Inc.
*/
-#ifndef __NM_SECRET_AGENT_H__
-#define __NM_SECRET_AGENT_H__
-
-#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
-#error "Only <NetworkManager.h> can be included directly."
-#endif
+#ifndef __NM_SECRET_AGENT_OLD_H__
+#define __NM_SECRET_AGENT_OLD_H__
#include <nm-types.h>
G_BEGIN_DECLS
-#define NM_TYPE_SECRET_AGENT (nm_secret_agent_get_type ())
-#define NM_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SECRET_AGENT, NMSecretAgent))
-#define NM_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SECRET_AGENT, NMSecretAgentClass))
-#define NM_IS_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SECRET_AGENT))
-#define NM_IS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SECRET_AGENT))
-#define NM_SECRET_AGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SECRET_AGENT, NMSecretAgentClass))
+#define NM_TYPE_SECRET_AGENT_OLD (nm_secret_agent_old_get_type ())
+#define NM_SECRET_AGENT_OLD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SECRET_AGENT_OLD, NMSecretAgentOld))
+#define NM_SECRET_AGENT_OLD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SECRET_AGENT_OLD, NMSecretAgentOldClass))
+#define NM_IS_SECRET_AGENT_OLD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SECRET_AGENT_OLD))
+#define NM_IS_SECRET_AGENT_OLD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SECRET_AGENT_OLD))
+#define NM_SECRET_AGENT_OLD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SECRET_AGENT_OLD, NMSecretAgentOldClass))
-#define NM_SECRET_AGENT_IDENTIFIER "identifier"
-#define NM_SECRET_AGENT_AUTO_REGISTER "auto-register"
-#define NM_SECRET_AGENT_REGISTERED "registered"
-#define NM_SECRET_AGENT_CAPABILITIES "capabilities"
+#define NM_SECRET_AGENT_OLD_IDENTIFIER "identifier"
+#define NM_SECRET_AGENT_OLD_AUTO_REGISTER "auto-register"
+#define NM_SECRET_AGENT_OLD_REGISTERED "registered"
+#define NM_SECRET_AGENT_OLD_CAPABILITIES "capabilities"
-struct _NMSecretAgent {
+typedef struct {
GObject parent;
-};
+} NMSecretAgentOld;
/**
- * NMSecretAgentGetSecretsFunc:
+ * NMSecretAgentOldGetSecretsFunc:
* @agent: the secret agent object
* @connection: (transfer none): the connection for which secrets were requested,
* note that this object will be unrefed after the callback has returned, use
@@ -62,7 +58,7 @@ struct _NMSecretAgent {
* @user_data: caller-specific data to be passed to the function
*
* Called as a result of a request by NM to retrieve secrets. When the
- * #NMSecretAgent subclass has finished retrieving secrets and is ready to
+ * #NMSecretAgentOld subclass has finished retrieving secrets and is ready to
* return them, or to return an error, this function should be called with
* those secrets or the error.
*
@@ -75,7 +71,7 @@ struct _NMSecretAgent {
* NMSettingWirelessSecurity *s_wsec;
* GVariant *secrets_dict;
*
- * secrets = nm_connection_new ();
+ * secrets = nm_simple_connection_new ();
* s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
* g_object_set (G_OBJECT (s_wsec),
* NM_SETTING_WIRELESS_SECURITY_PSK, "my really cool PSK",
@@ -83,21 +79,21 @@ struct _NMSecretAgent {
* nm_connection_add_setting (secrets, NM_SETTING (s_wsec));
* secrets_dict = nm_connection_to_dbus (secrets, NM_CONNECTION_SERIALIZE_ALL);
*
- * (call the NMSecretAgentGetSecretsFunc with secrets_dict)
+ * (call the NMSecretAgentOldGetSecretsFunc with secrets_dict)
*
* g_object_unref (secrets);
* g_variant_unref (secrets_dict);
* </programlisting>
* </example>
*/
-typedef void (*NMSecretAgentGetSecretsFunc) (NMSecretAgent *agent,
- NMConnection *connection,
- GVariant *secrets,
- GError *error,
- gpointer user_data);
+typedef void (*NMSecretAgentOldGetSecretsFunc) (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ GVariant *secrets,
+ GError *error,
+ gpointer user_data);
/**
- * NMSecretAgentSaveSecretsFunc:
+ * NMSecretAgentOldSaveSecretsFunc:
* @agent: the secret agent object
* @connection: (transfer none): the connection for which secrets were to be saved,
* note that this object will be unrefed after the callback has returned, use
@@ -107,16 +103,16 @@ typedef void (*NMSecretAgentGetSecretsFunc) (NMSecretAgent *agent,
* @user_data: caller-specific data to be passed to the function
*
* Called as a result of a request by NM to save secrets. When the
- * #NMSecretAgent subclass has finished saving the secrets, this function
+ * #NMSecretAgentOld subclass has finished saving the secrets, this function
* should be called.
*/
-typedef void (*NMSecretAgentSaveSecretsFunc) (NMSecretAgent *agent,
- NMConnection *connection,
- GError *error,
- gpointer user_data);
+typedef void (*NMSecretAgentOldSaveSecretsFunc) (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ GError *error,
+ gpointer user_data);
/**
- * NMSecretAgentDeleteSecretsFunc:
+ * NMSecretAgentOldDeleteSecretsFunc:
* @agent: the secret agent object
* @connection: (transfer none): the connection for which secrets were to be deleted,
* note that this object will be unrefed after the callback has returned, use
@@ -126,13 +122,13 @@ typedef void (*NMSecretAgentSaveSecretsFunc) (NMSecretAgent *agent,
* @user_data: caller-specific data to be passed to the function
*
* Called as a result of a request by NM to delete secrets. When the
- * #NMSecretAgent subclass has finished deleting the secrets, this function
+ * #NMSecretAgentOld subclass has finished deleting the secrets, this function
* should be called.
*/
-typedef void (*NMSecretAgentDeleteSecretsFunc) (NMSecretAgent *agent,
- NMConnection *connection,
- GError *error,
- gpointer user_data);
+typedef void (*NMSecretAgentOldDeleteSecretsFunc) (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ GError *error,
+ gpointer user_data);
typedef struct {
GObjectClass parent;
@@ -143,25 +139,25 @@ typedef struct {
* must copy or reference any arguments it may require after returning from
* this method, as the arguments will freed (except for 'self', 'callback',
* and 'user_data' of course). If the request is canceled, the callback
- * should still be called, but with the NM_SECRET_AGENT_ERROR_AGENT_CANCELED
- * error.
+ * should still be called, but with the
+ * NM_SECRET_AGENT_OLD_ERROR_AGENT_CANCELED error.
*/
- void (*get_secrets) (NMSecretAgent *self,
+ void (*get_secrets) (NMSecretAgentOld *self,
NMConnection *connection,
const char *connection_path,
const char *setting_name,
const char **hints,
NMSecretAgentGetSecretsFlags flags,
- NMSecretAgentGetSecretsFunc callback,
+ NMSecretAgentOldGetSecretsFunc callback,
gpointer user_data);
/* Called when the subclass should cancel an outstanding request to
* get secrets for a given connection. Canceling the request MUST
* call the callback that was passed along with the initial get_secrets
- * call, sending the NM_SECRET_AGENT_ERROR/NM_SECRET_AGENT_ERROR_AGENT_CANCELED
- * error to that callback.
+ * call, sending the NM_SECRET_AGENT_OLD_ERROR/
+ * NM_SECRET_AGENT_OLD_ERROR_AGENT_CANCELED error to that callback.
*/
- void (*cancel_get_secrets) (NMSecretAgent *self,
+ void (*cancel_get_secrets) (NMSecretAgentOld *self,
const char *connection_path,
const char *setting_name);
@@ -171,10 +167,10 @@ typedef struct {
* arguments will freed (except for 'self', 'callback', and 'user_data'
* of course).
*/
- void (*save_secrets) (NMSecretAgent *self,
+ void (*save_secrets) (NMSecretAgentOld *self,
NMConnection *connection,
const char *connection_path,
- NMSecretAgentSaveSecretsFunc callback,
+ NMSecretAgentOldSaveSecretsFunc callback,
gpointer user_data);
/* Called when the subclass should delete the secrets contained in the
@@ -183,60 +179,60 @@ typedef struct {
* arguments will freed (except for 'self', 'callback', and 'user_data'
* of course).
*/
- void (*delete_secrets) (NMSecretAgent *self,
+ void (*delete_secrets) (NMSecretAgentOld *self,
NMConnection *connection,
const char *connection_path,
- NMSecretAgentDeleteSecretsFunc callback,
+ NMSecretAgentOldDeleteSecretsFunc callback,
gpointer user_data);
/*< private >*/
gpointer padding[8];
-} NMSecretAgentClass;
-
-GType nm_secret_agent_get_type (void);
-
-gboolean nm_secret_agent_register (NMSecretAgent *self,
- GCancellable *cancellable,
- GError **error);
-void nm_secret_agent_register_async (NMSecretAgent *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-gboolean nm_secret_agent_register_finish (NMSecretAgent *self,
- GAsyncResult *result,
- GError **error);
-
-gboolean nm_secret_agent_unregister (NMSecretAgent *self,
- GCancellable *cancellable,
- GError **error);
-void nm_secret_agent_unregister_async (NMSecretAgent *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-gboolean nm_secret_agent_unregister_finish (NMSecretAgent *self,
- GAsyncResult *result,
- GError **error);
-
-gboolean nm_secret_agent_get_registered (NMSecretAgent *self);
-
-void nm_secret_agent_get_secrets (NMSecretAgent *self,
- NMConnection *connection,
- const char *setting_name,
- const char **hints,
- NMSecretAgentGetSecretsFlags flags,
- NMSecretAgentGetSecretsFunc callback,
- gpointer user_data);
-
-void nm_secret_agent_save_secrets (NMSecretAgent *self,
- NMConnection *connection,
- NMSecretAgentSaveSecretsFunc callback,
- gpointer user_data);
-
-void nm_secret_agent_delete_secrets (NMSecretAgent *self,
- NMConnection *connection,
- NMSecretAgentDeleteSecretsFunc callback,
- gpointer user_data);
+} NMSecretAgentOldClass;
+
+GType nm_secret_agent_old_get_type (void);
+
+gboolean nm_secret_agent_old_register (NMSecretAgentOld *self,
+ GCancellable *cancellable,
+ GError **error);
+void nm_secret_agent_old_register_async (NMSecretAgentOld *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean nm_secret_agent_old_register_finish (NMSecretAgentOld *self,
+ GAsyncResult *result,
+ GError **error);
+
+gboolean nm_secret_agent_old_unregister (NMSecretAgentOld *self,
+ GCancellable *cancellable,
+ GError **error);
+void nm_secret_agent_old_unregister_async (NMSecretAgentOld *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean nm_secret_agent_old_unregister_finish (NMSecretAgentOld *self,
+ GAsyncResult *result,
+ GError **error);
+
+gboolean nm_secret_agent_old_get_registered (NMSecretAgentOld *self);
+
+void nm_secret_agent_old_get_secrets (NMSecretAgentOld *self,
+ NMConnection *connection,
+ const char *setting_name,
+ const char **hints,
+ NMSecretAgentGetSecretsFlags flags,
+ NMSecretAgentOldGetSecretsFunc callback,
+ gpointer user_data);
+
+void nm_secret_agent_old_save_secrets (NMSecretAgentOld *self,
+ NMConnection *connection,
+ NMSecretAgentOldSaveSecretsFunc callback,
+ gpointer user_data);
+
+void nm_secret_agent_old_delete_secrets (NMSecretAgentOld *self,
+ NMConnection *connection,
+ NMSecretAgentOldDeleteSecretsFunc callback,
+ gpointer user_data);
G_END_DECLS
-#endif /* __NM_SECRET_AGENT_H__ */
+#endif /* __NM_SECRET_AGENT_OLD_H__ */
diff --git a/libnm/nm-types.h b/libnm/nm-types.h
index 940a329454..ee1ed643eb 100644
--- a/libnm/nm-types.h
+++ b/libnm/nm-types.h
@@ -43,13 +43,10 @@ typedef struct _NMDeviceTeam NMDeviceTeam;
typedef struct _NMDeviceVlan NMDeviceVlan;
typedef struct _NMDeviceWifi NMDeviceWifi;
typedef struct _NMDeviceWimax NMDeviceWimax;
-typedef struct _NMDhcp4Config NMDhcp4Config;
-typedef struct _NMDhcp6Config NMDhcp6Config;
-typedef struct _NMIP4Config NMIP4Config;
-typedef struct _NMIP6Config NMIP6Config;
+typedef struct _NMDhcpConfig NMDhcpConfig;
+typedef struct _NMIPConfig NMIPConfig;
typedef struct _NMObject NMObject;
typedef struct _NMRemoteConnection NMRemoteConnection;
-typedef struct _NMSecretAgent NMSecretAgent;
typedef struct _NMVpnConnection NMVpnConnection;
typedef struct _NMWimaxNsp NMWimaxNsp;
diff --git a/libnm/nm-vpn-connection.c b/libnm/nm-vpn-connection.c
index 8e7605aef3..f46dc0ca08 100644
--- a/libnm/nm-vpn-connection.c
+++ b/libnm/nm-vpn-connection.c
@@ -19,6 +19,8 @@
* Copyright 2007 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "nm-vpn-connection.h"
#include "nm-dbus-interface.h"
diff --git a/libnm/nm-vpn-editor-plugin.c b/libnm/nm-vpn-editor-plugin.c
new file mode 100644
index 0000000000..904a6be483
--- /dev/null
+++ b/libnm/nm-vpn-editor-plugin.c
@@ -0,0 +1,181 @@
+/* -*- 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
new file mode 100644
index 0000000000..5910aa3653
--- /dev/null
+++ b/libnm/nm-vpn-editor-plugin.h
@@ -0,0 +1,189 @@
+/* -*- 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 <NetworkManager.h> can be included directly."
+#endif
+
+#include <glib.h>
+#include <glib-object.h>
+#include <nm-types.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);
+
+/**************************************************/
+/* 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-plugin-old.c b/libnm/nm-vpn-plugin-old.c
index e43dbacb1f..e6843f7e18 100644
--- a/libnm/nm-vpn-plugin-old.c
+++ b/libnm/nm-vpn-plugin-old.c
@@ -23,11 +23,13 @@
* will be a new "NMVpnPlugin" class to replace it.
*/
+#include "config.h"
+
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-vpn-plugin-ui-interface.c b/libnm/nm-vpn-plugin-ui-interface.c
deleted file mode 100644
index af00cfd1da..0000000000
--- a/libnm/nm-vpn-plugin-ui-interface.c
+++ /dev/null
@@ -1,244 +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 "nm-vpn-plugin-ui-interface.h"
-
-static void
-interface_init (gpointer g_iface)
-{
- static gboolean initialized = FALSE;
-
- if (initialized)
- return;
-
- /* Properties */
-
- /**
- * NMVpnPluginUiInterface:name:
- *
- * Short display name of the VPN plugin.
- */
- g_object_interface_install_property (g_iface,
- g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_NAME, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMVpnPluginUiInterface:desc:
- *
- * Longer description of the VPN plugin.
- */
- g_object_interface_install_property (g_iface,
- g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_DESC, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMVpnPluginUiInterface:service:
- *
- * D-Bus service name of the plugin's VPN service.
- */
- g_object_interface_install_property (g_iface,
- g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_SERVICE, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- initialized = TRUE;
-}
-
-
-GType
-nm_vpn_plugin_ui_interface_get_type (void)
-{
- static GType vpn_plugin_ui_interface_type = 0;
-
- if (!vpn_plugin_ui_interface_type) {
- const GTypeInfo vpn_plugin_ui_interface_info = {
- sizeof (NMVpnPluginUiInterface), /* class_size */
- interface_init, /* base_init */
- NULL, /* base_finalize */
- NULL,
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL
- };
-
- vpn_plugin_ui_interface_type = g_type_register_static (G_TYPE_INTERFACE,
- "NMVpnPluginUiInterface",
- &vpn_plugin_ui_interface_info,
- 0);
-
- g_type_interface_add_prerequisite (vpn_plugin_ui_interface_type, G_TYPE_OBJECT);
- }
-
- return vpn_plugin_ui_interface_type;
-}
-
-
-/**
- * nm_vpn_plugin_ui_interface_ui_factory:
- *
- * Returns: (transfer full):
- */
-NMVpnPluginUiWidgetInterface *
-nm_vpn_plugin_ui_interface_ui_factory (NMVpnPluginUiInterface *iface,
- NMConnection *connection,
- GError **error)
-{
- g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_INTERFACE (iface), NULL);
-
- return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->ui_factory (iface, connection, error);
-}
-
-guint32
-nm_vpn_plugin_ui_interface_get_capabilities (NMVpnPluginUiInterface *iface)
-{
- g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_INTERFACE (iface), 0);
-
- return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->get_capabilities (iface);
-}
-
-/**
- * nm_vpn_plugin_ui_interface_import:
- *
- * Returns: (transfer full):
- */
-NMConnection *
-nm_vpn_plugin_ui_interface_import (NMVpnPluginUiInterface *iface,
- const char *path,
- GError **error)
-{
- g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_INTERFACE (iface), NULL);
-
- if (nm_vpn_plugin_ui_interface_get_capabilities (iface) & NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT) {
- g_return_val_if_fail (NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->import_from_file != NULL, NULL);
- return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->import_from_file (iface, path, error);
- }
- return NULL;
-}
-
-gboolean
-nm_vpn_plugin_ui_interface_export (NMVpnPluginUiInterface *iface,
- const char *path,
- NMConnection *connection,
- GError **error)
-{
- g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_INTERFACE (iface), FALSE);
-
- if (nm_vpn_plugin_ui_interface_get_capabilities (iface) & NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT) {
- g_return_val_if_fail (NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->export_to_file != NULL, FALSE);
- return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->export_to_file (iface, path, connection, error);
- }
- return FALSE;
-}
-
-char *
-nm_vpn_plugin_ui_interface_get_suggested_name (NMVpnPluginUiInterface *iface,
- NMConnection *connection)
-{
- g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_INTERFACE (iface), NULL);
-
- if (NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->get_suggested_name)
- return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->get_suggested_name (iface, connection);
- return NULL;
-}
-
-
-static void
-widget_interface_init (gpointer g_iface)
-{
- GType iface_type = G_TYPE_FROM_INTERFACE (g_iface);
- static gboolean initialized = FALSE;
-
- if (initialized)
- return;
-
- /* Signals */
- g_signal_new ("changed",
- iface_type,
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMVpnPluginUiWidgetInterface, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- initialized = TRUE;
-}
-
-GType
-nm_vpn_plugin_ui_widget_interface_get_type (void)
-{
- static GType vpn_plugin_ui_widget_interface_type = 0;
-
- if (!vpn_plugin_ui_widget_interface_type) {
- const GTypeInfo vpn_plugin_ui_widget_interface_info = {
- sizeof (NMVpnPluginUiWidgetInterface), /* class_size */
- widget_interface_init, /* base_init */
- NULL, /* base_finalize */
- NULL,
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL
- };
-
- vpn_plugin_ui_widget_interface_type = g_type_register_static (G_TYPE_INTERFACE,
- "NMVpnPluginUiWidgetInterface",
- &vpn_plugin_ui_widget_interface_info,
- 0);
-
- g_type_interface_add_prerequisite (vpn_plugin_ui_widget_interface_type, G_TYPE_OBJECT);
- }
-
- return vpn_plugin_ui_widget_interface_type;
-}
-
-/**
- * nm_vpn_plugin_ui_widget_interface_get_widget:
- *
- * Returns: (transfer none):
- */
-GObject *
-nm_vpn_plugin_ui_widget_interface_get_widget (NMVpnPluginUiWidgetInterface *iface)
-{
- g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_WIDGET_INTERFACE (iface), NULL);
-
- return NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE (iface)->get_widget (iface);
-}
-
-gboolean
-nm_vpn_plugin_ui_widget_interface_update_connection (NMVpnPluginUiWidgetInterface *iface,
- NMConnection *connection,
- GError **error)
-{
- g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_WIDGET_INTERFACE (iface), FALSE);
-
- if (error)
- g_return_val_if_fail (*error == NULL, FALSE);
-
- return NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE (iface)->update_connection (iface, connection, error);
-}
diff --git a/libnm/nm-vpn-plugin-ui-interface.h b/libnm/nm-vpn-plugin-ui-interface.h
deleted file mode 100644
index 4aab74482e..0000000000
--- a/libnm/nm-vpn-plugin-ui-interface.h
+++ /dev/null
@@ -1,206 +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.
- */
-
-#ifndef __NM_VPN_PLUGIN_UI_INTERFACE_H__
-#define __NM_VPN_PLUGIN_UI_INTERFACE_H__
-
-#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
-#error "Only <NetworkManager.h> can be included directly."
-#endif
-
-#include <glib.h>
-#include <glib-object.h>
-#include <nm-connection.h>
-
-G_BEGIN_DECLS
-
-typedef struct _NMVpnPluginUiInterface NMVpnPluginUiInterface;
-typedef struct _NMVpnPluginUiWidgetInterface NMVpnPluginUiWidgetInterface;
-
-/* Plugin's factory function that returns a GObject that implements
- * NMVpnPluginUiInterface.
- */
-#ifndef __GI_SCANNER__
-typedef NMVpnPluginUiInterface * (*NMVpnPluginUiFactory) (GError **error);
-NMVpnPluginUiInterface *nm_vpn_plugin_ui_factory (GError **error);
-#endif
-
-
-/**************************************************/
-/* Plugin interface */
-/**************************************************/
-
-#define NM_TYPE_VPN_PLUGIN_UI_INTERFACE (nm_vpn_plugin_ui_interface_get_type ())
-#define NM_VPN_PLUGIN_UI_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_PLUGIN_UI_INTERFACE, NMVpnPluginUiInterface))
-#define NM_IS_VPN_PLUGIN_UI_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_PLUGIN_UI_INTERFACE))
-#define NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_VPN_PLUGIN_UI_INTERFACE, NMVpnPluginUiInterface))
-
-/**
- * NMVpnPluginUiCapability:
- * @NM_VPN_PLUGIN_UI_CAPABILITY_NONE: unknown or no capability
- * @NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT: the plugin can import new connections
- * @NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT: the plugin can export connections
- * @NM_VPN_PLUGIN_UI_CAPABILITY_IPV6: the plugin supports IPv6 addressing
- *
- * Flags that indicate to UI programs certain capabilities of the plugin.
- **/
-typedef enum /*< flags >*/ {
- NM_VPN_PLUGIN_UI_CAPABILITY_NONE = 0x00,
- NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT = 0x01,
- NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT = 0x02,
- NM_VPN_PLUGIN_UI_CAPABILITY_IPV6 = 0x04
-} NMVpnPluginUiCapability;
-
-/* Short display name of the VPN plugin */
-#define NM_VPN_PLUGIN_UI_INTERFACE_NAME "name"
-
-/* Longer description of the VPN plugin */
-#define NM_VPN_PLUGIN_UI_INTERFACE_DESC "desc"
-
-/* D-Bus service name of the plugin's VPN service */
-#define NM_VPN_PLUGIN_UI_INTERFACE_SERVICE "service"
-
-/**
- * NMVpnPluginUiInterfaceProp:
- * @NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME: the VPN plugin's name
- * @NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC: description of the VPN plugin and what
- * VPN services it supports
- * @NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE: the D-Bus service name used by the
- * plugin's VPN service daemon
- *
- * #GObject property numbers that plugins should override to provide certain
- * information to UI programs.
- **/
-typedef enum {
- /* private */
- NM_VPN_PLUGIN_UI_INTERFACE_PROP_FIRST = 0x1000,
-
- /* public */
- NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME = NM_VPN_PLUGIN_UI_INTERFACE_PROP_FIRST,
- NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC,
- NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE
-} NMVpnPluginUiInterfaceProp;
-
-
-struct _NMVpnPluginUiInterface {
- GTypeInterface g_iface;
-
- /* Plugin's factory function that returns a GObject that implements
- * NMVpnPluginUiWidgetInterface, pre-filled with values from 'connection'
- * if non-NULL.
- */
- NMVpnPluginUiWidgetInterface * (*ui_factory) (NMVpnPluginUiInterface *iface,
- NMConnection *connection,
- GError **error);
-
- /* Plugin's capabiltity function that returns a bitmask of capabilities
- * described by NM_VPN_PLUGIN_UI_CAPABILITY_* defines.
- */
- guint32 (*get_capabilities) (NMVpnPluginUiInterface *iface);
-
- /* 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.
- */
- NMConnection * (*import_from_file) (NMVpnPluginUiInterface *iface,
- const char *path,
- GError **error);
-
- /* 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.
- */
- gboolean (*export_to_file) (NMVpnPluginUiInterface *iface,
- const char *path,
- NMConnection *connection,
- GError **error);
-
- /* For a given connection, return a suggested file name. Returned value should
- * be NULL or a suggested file name allocated via g_malloc/g_new/etc to be freed
- * by the caller.
- */
- char * (*get_suggested_name) (NMVpnPluginUiInterface *iface, NMConnection *connection);
-};
-
-GType nm_vpn_plugin_ui_interface_get_type (void);
-
-NMVpnPluginUiWidgetInterface *nm_vpn_plugin_ui_interface_ui_factory (NMVpnPluginUiInterface *iface,
- NMConnection *connection,
- GError **error);
-
-guint32 nm_vpn_plugin_ui_interface_get_capabilities (NMVpnPluginUiInterface *iface);
-
-NMConnection *nm_vpn_plugin_ui_interface_import (NMVpnPluginUiInterface *iface,
- const char *path,
- GError **error);
-
-gboolean nm_vpn_plugin_ui_interface_export (NMVpnPluginUiInterface *iface,
- const char *path,
- NMConnection *connection,
- GError **error);
-
-char *nm_vpn_plugin_ui_interface_get_suggested_name (NMVpnPluginUiInterface *iface,
- NMConnection *connection);
-
-/**************************************************/
-/* UI widget interface */
-/**************************************************/
-
-#define NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE (nm_vpn_plugin_ui_widget_interface_get_type ())
-#define NM_VPN_PLUGIN_UI_WIDGET_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE, NMVpnPluginUiWidgetInterface))
-#define NM_IS_VPN_PLUGIN_UI_WIDGET_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE))
-#define NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE, NMVpnPluginUiWidgetInterface))
-
-struct _NMVpnPluginUiWidgetInterface {
- GTypeInterface g_iface;
-
- /* Return the GtkWidget for the VPN's UI */
- GObject * (*get_widget) (NMVpnPluginUiWidgetInterface *iface);
-
- /* 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.
- */
- gboolean (*update_connection) (NMVpnPluginUiWidgetInterface *iface,
- NMConnection *connection,
- GError **error);
-
- /* Emitted when the value of a UI widget changes. May trigger a validity
- * check via update_connection() to write values to the connection */
- void (*changed) (NMVpnPluginUiWidgetInterface *iface);
-};
-
-GType nm_vpn_plugin_ui_widget_interface_get_type (void);
-
-GObject * nm_vpn_plugin_ui_widget_interface_get_widget (NMVpnPluginUiWidgetInterface *iface);
-
-gboolean nm_vpn_plugin_ui_widget_interface_update_connection (NMVpnPluginUiWidgetInterface *iface,
- NMConnection *connection,
- GError **error);
-
-G_END_DECLS
-
-#endif /* NM_VPN_PLUGIN_UI_INTERFACE_H */
diff --git a/libnm/nm-wimax-nsp.c b/libnm/nm-wimax-nsp.c
index 9532b17627..0fed1c6e4c 100644
--- a/libnm/nm-wimax-nsp.c
+++ b/libnm/nm-wimax-nsp.c
@@ -18,7 +18,8 @@
* Copyright 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-wimax-nsp.h b/libnm/nm-wimax-nsp.h
index a8f9105268..cdc7b23665 100644
--- a/libnm/nm-wimax-nsp.h
+++ b/libnm/nm-wimax-nsp.h
@@ -41,6 +41,15 @@ G_BEGIN_DECLS
#define NM_WIMAX_NSP_SIGNAL_QUALITY "signal-quality"
#define NM_WIMAX_NSP_NETWORK_TYPE "network-type"
+/**
+ * NMWimaxNspNetworkType:
+ * @NM_WIMAX_NSP_NETWORK_TYPE_UNKNOWN: unknown network type
+ * @NM_WIMAX_NSP_NETWORK_TYPE_HOME: home network
+ * @NM_WIMAX_NSP_NETWORK_TYPE_PARTNER: partner network
+ * @NM_WIMAX_NSP_NETWORK_TYPE_ROAMING_PARTNER: roaming partner network
+ *
+ * WiMAX network type.
+ */
typedef enum {
NM_WIMAX_NSP_NETWORK_TYPE_UNKNOWN = 0,
NM_WIMAX_NSP_NETWORK_TYPE_HOME = 1,
diff --git a/libnm/tests/Makefile.am b/libnm/tests/Makefile.am
index 38449fad07..56dd17d5f8 100644
--- a/libnm/tests/Makefile.am
+++ b/libnm/tests/Makefile.am
@@ -17,6 +17,11 @@ LDADD = \
noinst_PROGRAMS = $(TESTS)
+if WITH_VALGRIND
+@VALGRIND_RULES@ --launch-dbus
+else
+TESTS_ENVIRONMENT = $(srcdir)/libnm-test-launch.sh
+endif
TESTS = test-nm-client test-remote-settings-client test-secret-agent
test_nm_client_SOURCES = \
@@ -33,9 +38,6 @@ test_secret_agent_SOURCES = \
common.c \
common.h \
test-secret-agent.c
-
-TESTS_ENVIRONMENT = $(srcdir)/libnm-test-launch.sh
-
endif
EXTRA_DIST = libnm-test-launch.sh
diff --git a/libnm/tests/common.c b/libnm/tests/common.c
index 79308329a0..a28e5112b3 100644
--- a/libnm/tests/common.c
+++ b/libnm/tests/common.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
diff --git a/libnm/tests/test-nm-client.c b/libnm/tests/test-nm-client.c
index 867a27933b..3541c741e1 100644
--- a/libnm/tests/test-nm-client.c
+++ b/libnm/tests/test-nm-client.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <sys/types.h>
@@ -88,6 +90,7 @@ test_device_added (void)
/* Tell the test service to add a new device */
nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth0");
+ /* coverity[loop_condition] */
while (!notified)
g_main_context_iteration (NULL, TRUE);
@@ -186,14 +189,15 @@ test_device_added_signal_after_init (void)
/* Ensure the 'device-added' signal doesn't show up before
* the 'Devices' property change notification */
+ /* coverity[loop_condition] */
while (!(result & SIGNAL_MASK) && !(result & NOTIFY_MASK))
g_main_context_iteration (NULL, TRUE);
g_signal_handlers_disconnect_by_func (client, device_sai_added_cb, &result);
g_signal_handlers_disconnect_by_func (client, devices_sai_notify_cb, &result);
- g_assert ((result & NOTIFY_MASK) == NOTIFY_FIRST);
- g_assert ((result & SIGNAL_MASK) == SIGNAL_SECOND);
+ g_assert ((result & SIGNAL_MASK) == SIGNAL_FIRST);
+ g_assert ((result & NOTIFY_MASK) == NOTIFY_SECOND);
devices = nm_client_get_devices (client);
g_assert (devices);
@@ -1007,7 +1011,7 @@ client_devices_changed_cb (GObject *client,
info->remaining--;
else {
g_signal_connect (device, "notify::" NM_DEVICE_ACTIVE_CONNECTION,
- G_CALLBACK (device_ac_changed_cb), &info);
+ G_CALLBACK (device_ac_changed_cb), info);
}
info->remaining--;
diff --git a/libnm/tests/test-remote-settings-client.c b/libnm/tests/test-remote-settings-client.c
index d3af020526..15590fac1a 100644
--- a/libnm/tests/test-remote-settings-client.c
+++ b/libnm/tests/test-remote-settings-client.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <sys/types.h>
@@ -368,7 +370,7 @@ add_remove_cb (GObject *s,
{
NMRemoteConnection *connection;
gboolean *done = user_data;
- GError *error = NULL;
+ gs_free_error GError *error = NULL;
connection = nm_client_add_connection_finish (client, result, &error);
g_assert_error (error, NM_CLIENT_ERROR, NM_CLIENT_ERROR_OBJECT_CREATION_FAILED);
@@ -424,7 +426,7 @@ add_bad_cb (GObject *s,
gpointer user_data)
{
gboolean *done = user_data;
- GError *error = NULL;
+ gs_free_error GError *error = NULL;
remote = nm_client_add_connection_finish (client, result, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
@@ -467,7 +469,7 @@ save_hostname_cb (GObject *s,
gpointer user_data)
{
gboolean *done = user_data;
- GError *error = NULL;
+ gs_free_error GError *error = NULL;
nm_client_save_hostname_finish (client, result, &error);
g_assert_no_error (error);
diff --git a/libnm/tests/test-secret-agent.c b/libnm/tests/test-secret-agent.c
index 76f8a02e20..037b5a8135 100644
--- a/libnm/tests/test-secret-agent.c
+++ b/libnm/tests/test-secret-agent.c
@@ -18,12 +18,15 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <sys/types.h>
#include <signal.h>
#include <NetworkManager.h>
+#include <nm-secret-agent-old.h>
#include "nm-glib-compat.h"
#include "nm-test-utils.h"
@@ -39,11 +42,11 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
-typedef NMSecretAgent TestSecretAgent;
-typedef NMSecretAgentClass TestSecretAgentClass;
+typedef NMSecretAgentOld TestSecretAgent;
+typedef NMSecretAgentOldClass TestSecretAgentClass;
GType test_secret_agent_get_type (void);
-G_DEFINE_TYPE (TestSecretAgent, test_secret_agent, NM_TYPE_SECRET_AGENT)
+G_DEFINE_TYPE (TestSecretAgent, test_secret_agent, NM_TYPE_SECRET_AGENT_OLD)
static void
test_secret_agent_init (TestSecretAgent *agent)
@@ -51,14 +54,14 @@ test_secret_agent_init (TestSecretAgent *agent)
}
static void
-test_secret_agent_get_secrets (NMSecretAgent *agent,
- NMConnection *connection,
- const char *connection_path,
- const char *setting_name,
- const char **hints,
- NMSecretAgentGetSecretsFlags flags,
- NMSecretAgentGetSecretsFunc callback,
- gpointer callback_data)
+test_secret_agent_get_secrets (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ const char *connection_path,
+ const char *setting_name,
+ const char **hints,
+ NMSecretAgentGetSecretsFlags flags,
+ NMSecretAgentOldGetSecretsFunc callback,
+ gpointer callback_data)
{
NMSettingWirelessSecurity *s_wsec;
GVariant *secrets = NULL;
@@ -111,29 +114,29 @@ done:
}
static void
-test_secret_agent_cancel_get_secrets (NMSecretAgent *agent,
- const gchar *connection_path,
- const gchar *setting_name)
+test_secret_agent_cancel_get_secrets (NMSecretAgentOld *agent,
+ const gchar *connection_path,
+ const gchar *setting_name)
{
g_assert_not_reached ();
}
static void
-test_secret_agent_save_secrets (NMSecretAgent *agent,
- NMConnection *connection,
- const gchar *connection_path,
- NMSecretAgentSaveSecretsFunc callback,
- gpointer callback_data)
+test_secret_agent_save_secrets (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ const gchar *connection_path,
+ NMSecretAgentOldSaveSecretsFunc callback,
+ gpointer callback_data)
{
g_assert_not_reached ();
}
static void
-test_secret_agent_delete_secrets (NMSecretAgent *agent,
- NMConnection *connection,
- const gchar *connection_path,
- NMSecretAgentDeleteSecretsFunc callback,
- gpointer callback_data)
+test_secret_agent_delete_secrets (NMSecretAgentOld *agent,
+ NMConnection *connection,
+ const gchar *connection_path,
+ NMSecretAgentOldDeleteSecretsFunc callback,
+ gpointer callback_data)
{
g_assert_not_reached ();
}
@@ -142,7 +145,7 @@ static void
test_secret_agent_class_init (TestSecretAgentClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- NMSecretAgentClass *agent_class = NM_SECRET_AGENT_CLASS (klass);
+ NMSecretAgentOldClass *agent_class = NM_SECRET_AGENT_OLD_CLASS (klass);
agent_class->get_secrets = test_secret_agent_get_secrets;
agent_class->cancel_get_secrets = test_secret_agent_cancel_get_secrets;
@@ -162,15 +165,15 @@ test_secret_agent_class_init (TestSecretAgentClass *klass)
}
-static NMSecretAgent *
+static NMSecretAgentOld *
test_secret_agent_new (void)
{
- NMSecretAgent *agent;
+ NMSecretAgentOld *agent;
GError *error = NULL;
agent = g_initable_new (test_secret_agent_get_type (), NULL, &error,
- NM_SECRET_AGENT_IDENTIFIER, "test-secret-agent",
- NM_SECRET_AGENT_AUTO_REGISTER, FALSE,
+ NM_SECRET_AGENT_OLD_IDENTIFIER, "test-secret-agent",
+ NM_SECRET_AGENT_OLD_AUTO_REGISTER, FALSE,
NULL);
g_assert_no_error (error);
@@ -183,7 +186,7 @@ typedef struct {
NMTestServiceInfo *sinfo;
NMClient *client;
- NMSecretAgent *agent;
+ NMSecretAgentOld *agent;
NMDevice *device;
NMConnection *connection;
@@ -226,9 +229,9 @@ register_cb (GObject *object, GAsyncResult *result, gpointer user_data)
TestSecretAgentData *sadata = user_data;
GError *error = NULL;
- nm_secret_agent_register_finish (sadata->agent, result, &error);
+ nm_secret_agent_old_register_finish (sadata->agent, result, &error);
g_assert_no_error (error);
- g_assert (nm_secret_agent_get_registered (sadata->agent));
+ g_assert (nm_secret_agent_old_get_registered (sadata->agent));
g_main_loop_quit (sadata->loop);
}
@@ -295,11 +298,11 @@ test_setup (TestSecretAgentData *sadata, gconstpointer test_data)
sadata->agent = test_secret_agent_new ();
if (!strcmp (agent_notes, "sync")) {
- nm_secret_agent_register (sadata->agent, NULL, &error);
+ nm_secret_agent_old_register (sadata->agent, NULL, &error);
g_assert_no_error (error);
- g_assert (nm_secret_agent_get_registered (sadata->agent));
+ g_assert (nm_secret_agent_old_get_registered (sadata->agent));
} else {
- nm_secret_agent_register_async (sadata->agent, NULL,
+ nm_secret_agent_old_register_async (sadata->agent, NULL,
register_cb, sadata);
g_main_loop_run (sadata->loop);
}
@@ -313,8 +316,8 @@ test_cleanup (TestSecretAgentData *sadata, gconstpointer test_data)
GError *error = NULL;
if (sadata->agent) {
- if (nm_secret_agent_get_registered (sadata->agent)) {
- nm_secret_agent_unregister (sadata->agent, NULL, &error);
+ if (nm_secret_agent_old_get_registered (sadata->agent)) {
+ nm_secret_agent_old_unregister (sadata->agent, NULL, &error);
g_assert_no_error (error);
}
g_object_unref (sadata->agent);
@@ -351,7 +354,7 @@ connection_activated_none_cb (GObject *c,
{
TestSecretAgentData *sadata = user_data;
NMActiveConnection *ac;
- GError *error = NULL;
+ gs_free_error GError *error = NULL;
ac = nm_client_activate_connection_finish (sadata->client, result, &error);
g_assert_error (error, NM_AGENT_MANAGER_ERROR, NM_AGENT_MANAGER_ERROR_NO_SECRETS);
@@ -396,8 +399,8 @@ connection_activated_no_secrets_cb (GObject *c,
gpointer user_data)
{
TestSecretAgentData *sadata = user_data;
- NMActiveConnection *ac;
- GError *error = NULL;
+ gs_unref_object NMActiveConnection *ac = NULL;
+ gs_free_error GError *error = NULL;
ac = nm_client_activate_connection_finish (sadata->client, result, &error);
g_assert_error (error, NM_AGENT_MANAGER_ERROR, NM_AGENT_MANAGER_ERROR_NO_SECRETS);
@@ -431,8 +434,8 @@ connection_activated_cancel_cb (GObject *c,
gpointer user_data)
{
TestSecretAgentData *sadata = user_data;
- NMActiveConnection *ac;
- GError *error = NULL;
+ gs_unref_object NMActiveConnection *ac = NULL;
+ gs_free_error GError *error = NULL;
ac = nm_client_activate_connection_finish (sadata->client, result, &error);
g_assert_error (error, NM_AGENT_MANAGER_ERROR, NM_AGENT_MANAGER_ERROR_USER_CANCELED);
@@ -547,12 +550,12 @@ async_init_cb (GObject *object, GAsyncResult *result, gpointer user_data)
static void
test_secret_agent_nm_not_running (void)
{
- NMSecretAgent *agent;
+ NMSecretAgentOld *agent;
GMainLoop *loop;
GError *error = NULL;
agent = g_initable_new (test_secret_agent_get_type (), NULL, &error,
- NM_SECRET_AGENT_IDENTIFIER, "test-secret-agent",
+ NM_SECRET_AGENT_OLD_IDENTIFIER, "test-secret-agent",
NULL);
g_assert_error (error, NM_SECRET_AGENT_ERROR, NM_SECRET_AGENT_ERROR_FAILED);
g_assert (agent == NULL);
@@ -562,7 +565,7 @@ test_secret_agent_nm_not_running (void)
g_async_initable_new_async (test_secret_agent_get_type (),
G_PRIORITY_DEFAULT,
NULL, async_init_cb, loop,
- NM_SECRET_AGENT_IDENTIFIER, "test-secret-agent",
+ NM_SECRET_AGENT_OLD_IDENTIFIER, "test-secret-agent",
NULL);
g_main_loop_run (loop);
g_main_loop_unref (loop);
@@ -581,7 +584,7 @@ static void
test_secret_agent_auto_register (void)
{
NMTestServiceInfo *sinfo;
- NMSecretAgent *agent;
+ NMSecretAgentOld *agent;
GMainLoop *loop;
GError *error = NULL;
@@ -590,30 +593,30 @@ test_secret_agent_auto_register (void)
agent = test_secret_agent_new ();
g_object_set (agent,
- NM_SECRET_AGENT_AUTO_REGISTER, TRUE,
+ NM_SECRET_AGENT_OLD_AUTO_REGISTER, TRUE,
NULL);
- g_signal_connect (agent, "notify::" NM_SECRET_AGENT_REGISTERED,
+ g_signal_connect (agent, "notify::" NM_SECRET_AGENT_OLD_REGISTERED,
G_CALLBACK (registered_changed), loop);
- g_assert (!nm_secret_agent_get_registered (agent));
- nm_secret_agent_register (agent, NULL, &error);
+ g_assert (!nm_secret_agent_old_get_registered (agent));
+ nm_secret_agent_old_register (agent, NULL, &error);
g_assert_no_error (error);
- g_assert (nm_secret_agent_get_registered (agent));
+ g_assert (nm_secret_agent_old_get_registered (agent));
/* Shut down test service */
nm_test_service_cleanup (sinfo);
g_main_loop_run (loop);
- g_assert (!nm_secret_agent_get_registered (agent));
+ g_assert (!nm_secret_agent_old_get_registered (agent));
/* Restart test service */
sinfo = nm_test_service_init ();
g_main_loop_run (loop);
- g_assert (nm_secret_agent_get_registered (agent));
+ g_assert (nm_secret_agent_old_get_registered (agent));
/* Shut down test service again */
nm_test_service_cleanup (sinfo);
g_main_loop_run (loop);
- g_assert (!nm_secret_agent_get_registered (agent));
+ g_assert (!nm_secret_agent_old_get_registered (agent));
g_object_unref (agent);
g_main_loop_unref (loop);
diff --git a/m4/ax_lib_readline.m4 b/m4/ax_lib_readline.m4
index 8a05574f25..fe56c5bfc5 100644
--- a/m4/ax_lib_readline.m4
+++ b/m4/ax_lib_readline.m4
@@ -90,6 +90,7 @@ AC_DEFUN([AX_LIB_READLINE], [
AC_MSG_ERROR([readline library with terminfo support is required (one of ncurses, curses, or termcap)])
fi
+ ORIG_LIBS="$LIBS"
LIBS="$LIBS $ax_cv_lib_readline"
AC_CHECK_HEADERS(readline.h readline/readline.h)
@@ -114,6 +115,7 @@ AC_DEFUN([AX_LIB_READLINE], [
AC_MSG_ERROR(rl_echo_signal_char() is required (install readline6?))
fi
+ LIBS="$ORIG_LIBS"
READLINE_LIBS="$ax_cv_lib_readline"
AC_SUBST(READLINE_LIBS)
])dnl
diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4
index 3fde795504..5c8d207770 100644
--- a/m4/compiler_warnings.m4
+++ b/m4/compiler_warnings.m4
@@ -1,3 +1,24 @@
+dnl Check whether a particular compiler flag works with code provided,
+dnl disable it in CFLAGS if the check fails.
+AC_DEFUN([NM_COMPILER_WARNING], [
+ CFLAGS_SAVED="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror -W$1"
+ AC_MSG_CHECKING(whether -W$1 works)
+
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], [
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$2]])], [
+ AC_MSG_RESULT(yes)
+ CFLAGS="$CFLAGS_SAVED -W$1"
+ ],[
+ AC_MSG_RESULT(no)
+ CFLAGS="$CFLAGS_SAVED -Wno-$1"
+ ])
+ ],[
+ AC_MSG_RESULT(not supported)
+ CFLAGS="$CFLAGS_SAVED"
+ ])
+])
+
AC_DEFUN([NM_COMPILER_WARNINGS],
[AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]),
@@ -5,22 +26,26 @@ AC_DEFUN([NM_COMPILER_WARNINGS],
AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
+
+ dnl This is enabled in clang by default, makes little sense,
+ dnl and causes the build to abort with -Werror.
CFLAGS_SAVED="$CFLAGS"
- CFLAGS_MORE_WARNINGS="-Wall -std=gnu89"
+ CFLAGS="$CFLAGS -Qunused-arguments"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], [], CFLAGS="$CFLAGS_SAVED")
+ unset CFLAGS_SAVED
dnl clang only warns about unknown warnings, unless
dnl called with "-Werror=unknown-warning-option"
dnl Test if the compiler supports that, and if it does
dnl attach it to the CFLAGS.
- CFLAGS_EXTRA="-Werror=unknown-warning-option"
- CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS_EXTRA $CFLAGS_SAVED"
- AC_TRY_COMPILE([], [],
- has_option=yes,
- has_option=no,)
- if test $has_option = no; then
- CFLAGS_EXTRA=
+ NM_COMPILER_WARNING([unknown-warning-option], [])
+
+ CFLAGS_SAVED="$CFLAGS"
+ CFLAGS_MORE_WARNINGS="-Wall -std=gnu89"
+
+ if test "x$set_more_warnings" = xerror; then
+ CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror"
fi
- unset has_option
for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
-Wdeclaration-after-statement -Wformat-security \
@@ -29,9 +54,10 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-fno-strict-aliasing -Wno-unused-but-set-variable \
-Wundef -Wimplicit-function-declaration \
-Wpointer-arith -Winit-self \
- -Wmissing-include-dirs -Waggregate-return; do
- CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS_EXTRA $option $CFLAGS_SAVED"
- AC_MSG_CHECKING([whether gcc understands $option])
+ -Wmissing-include-dirs -Wno-pragmas; do
+ dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
+ CFLAGS="$CFLAGS_MORE_WARNINGS $(printf '%s' "$option" | sed 's/^-Wno-/-W/') $CFLAGS_SAVED"
+ AC_MSG_CHECKING([whether compiler understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
@@ -42,12 +68,38 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
unset has_option
done
unset option
- unset CFLAGS_EXTRA
- if test "x$set_more_warnings" = xerror; then
- CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror"
- fi
- CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS_SAVED"
+
+ CFLAGS="$CFLAGS_SAVED"
unset CFLAGS_SAVED
+
+ dnl Disable warnings triggered by known compiler problems
+
+ dnl https://bugzilla.gnome.org/show_bug.cgi?id=745821
+ NM_COMPILER_WARNING([unknown-attributes], [#include <glib.h>])
+
+ dnl https://bugzilla.gnome.org/show_bug.cgi?id=744473
+ NM_COMPILER_WARNING([typedef-redefinition], [#include <gio/gio.h>])
+
+ dnl https://llvm.org/bugs/show_bug.cgi?id=21614
+ NM_COMPILER_WARNING([array-bounds],
+ [#include <string.h>]
+ [void f () { strcmp ("something", "0"); }]
+ )
+
+ dnl https://llvm.org/bugs/show_bug.cgi?id=22949
+ NM_COMPILER_WARNING([parentheses-equality],
+ [#include <sys/wait.h>]
+ [void f () { if (WIFCONTINUED(0)) return; }]
+ )
+
+ dnl systemd-dhcp's log_internal macro and our handle_warn are sometimes
+ dnl used in void context,u sometimes in int. Makes clang unhappy.
+ NM_COMPILER_WARNING([unused-value],
+ [#define yolo ({ (666 + 666); })]
+ [int f () { int i = yolo; yolo; return i; }]
+ )
+
+ CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS"
else
AC_MSG_RESULT(no)
fi
diff --git a/man/Makefile.am b/man/Makefile.am
index 376a8b42ac..e7262e717b 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -27,31 +27,37 @@ endif
if BUILD_SETTING_DOCS
-nm-settings.xml: nm-settings.xsl $(top_builddir)/libnm-util/nm-setting-docs.xml
+nm-settings.xml: nm-settings.xsl $(top_builddir)/libnm/nm-setting-docs.xml
$(AM_V_GEN) xsltproc \
--output $@ \
--stringparam version $(NM_VERSION) \
--stringparam date "`date +'%d %B %Y'`" \
$^
-nm-settings-keyfile.xml: nm-settings-keyfile.xsl $(top_builddir)/libnm-util/nm-keyfile-docs.xml
+nm-settings-keyfile.xml: nm-settings-keyfile.xsl $(top_builddir)/libnm/nm-keyfile-docs.xml
$(AM_V_GEN) xsltproc \
--output $@ \
--stringparam version $(NM_VERSION) \
--stringparam date "`date +'%d %B %Y'`" \
$^
-nm-settings-ifcfg-rh.xml: nm-settings-ifcfg-rh.xsl $(top_builddir)/libnm-util/nm-ifcfg-rh-docs.xml
+nm-settings-ifcfg-rh.xml: nm-settings-ifcfg-rh.xsl $(top_builddir)/libnm/nm-ifcfg-rh-docs.xml
$(AM_V_GEN) xsltproc \
--output $@ \
--stringparam version $(NM_VERSION) \
--stringparam date "`date +'%d %B %Y'`" \
$^
+CLEANFILES += \
+ nm-settings.xml \
+ nm-settings-keyfile.xml \
+ nm-settings-ifcfg-rh.xml
+
endif
configure_generated_man_pages = \
nmcli.1 \
+ nmtui.1 \
nm-online.1 \
nm-system-settings.conf.5
@@ -65,27 +71,34 @@ 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)
-DISTCLEANFILES = \
- nm-settings.xml \
- nm-settings-keyfile.xml \
- nm-settings-ifcfg-rh.xml
-
man_MANS += $(configure_generated_man_pages)
+links = nmtui-edit nmtui-connect nmtui-hostname
+
+install-data-hook:
+ for link in $(links); do \
+ ln -f $(DESTDIR)$(mandir)/man1/nmtui.1 $(DESTDIR)$(mandir)/man1/$$link.1; \
+ done
+
+uninstall-hook:
+ for link in $(links); do \
+ rm -f $(DESTDIR)$(mandir)/man1/$$link.1; \
+ done
+
if ENABLE_GTK_DOC
man_MANS += $(docbook_generated_man_pages)
CLEANFILES += $(docbook_generated_man_pages)
-if BUILD_SETTING_DOCS
+if SETTING_DOCS_AVAILABLE
man_MANS += $(docbook_autogenerated_man_pages)
CLEANFILES += $(docbook_autogenerated_man_pages)
endif
diff --git a/man/NetworkManager.conf.xml.in b/man/NetworkManager.conf.xml.in
index 67919cfb4f..0fbf9d2e94 100644
--- a/man/NetworkManager.conf.xml.in
+++ b/man/NetworkManager.conf.xml.in
@@ -3,7 +3,7 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
-Copyright (C) 2010 - 2013 Red Hat, Inc.
+Copyright 2010 - 2014 Red Hat, Inc.
-->
<refentry id="NetworkManager.conf">
@@ -17,7 +17,7 @@ Copyright (C) 2010 - 2013 Red Hat, Inc.
<manvolnum>5</manvolnum>
<refmiscinfo class="source">NetworkManager</refmiscinfo>
<refmiscinfo class="manual">Configuration</refmiscinfo>
- <refmiscinfo class="version">0.9.10</refmiscinfo>
+ <refmiscinfo class="version">1.0</refmiscinfo>
</refmeta>
<refnamediv>
@@ -133,16 +133,22 @@ Copyright (C) 2010 - 2013 Red Hat, Inc.
<varlistentry>
<term><varname>dhcp</varname></term>
<listitem><para>This key sets up what DHCP client
- NetworkManager will use. Presently
- <literal>dhclient</literal> and <literal>dhcpcd</literal>
- are supported. The client configured here should be
- available on your system too. If this key is missing,
- available DHCP clients are looked for in this order:
- dhclient, dhcpcd.</para></listitem>
+ NetworkManager will use. Allowed values are
+ <literal>dhclient</literal>, <literal>dhcpcd</literal>, and
+ <literal>internal</literal>. The <literal>dhclient</literal>
+ and <literal>dhcpcd</literal> options require the indicated
+ clients to be installed. The <literal>internal</literal>
+ 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).</para>
+ <para>If this key is missing, available DHCP clients are
+ looked for in this order: <literal>dhclient</literal>,
+ <literal>dhcpcd</literal>,
+ <literal>internal</literal>.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>no-auto-default</varname></term>
- <listitem><para>Comma-separated list of devices for which
+ <listitem><para>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
@@ -156,11 +162,15 @@ Copyright (C) 2010 - 2013 Red Hat, Inc.
<filename>/var/run/NetworkManager/no-auto-default.state</filename>
to prevent creating the default connection for that device
again.</para>
+ <para>See <xref linkend="device-spec"/> for the syntax how to
+ specify a device.
+ </para>
<para>
+ Example:
<programlisting>
- no-auto-default=00:22:68:5c:5d:c4,00:1e:65:ff:aa:ee
- no-auto-default=eth0,eth1
- no-auto-default=*
+no-auto-default=00:22:68:5c:5d:c4,00:1e:65:ff:aa:ee
+no-auto-default=eth0,eth1
+no-auto-default=*
</programlisting>
</para>
</listitem>
@@ -170,8 +180,8 @@ Copyright (C) 2010 - 2013 Red Hat, Inc.
<term><varname>ignore-carrier</varname></term>
<listitem>
<para>
- Comma-separated list of devices for which NetworkManager
- will (partially) ignore the carrier state. Normally, for
+ 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
@@ -188,14 +198,37 @@ Copyright (C) 2010 - 2013 Red Hat, Inc.
the device when carrier is lost.
</para>
<para>
- May have the special value <literal>*</literal> to apply
- to all devices.
- </para>
- <para>
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.
</para>
+ <para>See <xref linkend="device-spec"/> for the syntax how to
+ specify a device.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>configure-and-quit</varname></term>
+ <listitem>
+ <para>
+ When set to '<literal>true</literal>', 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 <literal>true</literal>,
+ 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 '<literal>dhcp</literal>' option
+ must be set to '<literal>internal</literal>'. The default value of
+ the '<literal>configure-and-quit</literal>' option is
+ '<literal>false</literal>', meaning that NetworkManager will continue
+ running after initial network configuration and continue responding
+ to system and hardware events, D-Bus requests, and user commands.
+ </para>
</listitem>
</varlistentry>
@@ -251,17 +284,11 @@ Copyright (C) 2010 - 2013 Red Hat, Inc.
<varlistentry>
<term><varname>unmanaged-devices</varname></term>
<listitem><para>Set devices that should be ignored by
- NetworkManager when using the <literal>keyfile</literal>
- plugin. Devices are specified in the following
- format:</para>
- <para><literal>mac:&lt;hwaddr&gt;</literal> or
- <literal>interface-name:&lt;ifname&gt;</literal>. Here
- <literal>hwaddr</literal> is the MAC address of the device
- to be ignored, in hex-digits-and-colons notation.
- <literal>ifname</literal> is the interface name of the
- ignored device.</para>
- <para>Multiple entries are separated with semicolons. No
- spaces are allowed in the value.</para>
+ NetworkManager.
+ </para>
+ <para>See <xref linkend="device-spec"/> for the syntax how to
+ specify a device.
+ </para>
<para>
Example:
<programlisting>
@@ -518,6 +545,77 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth
</refsect1>
<refsect1>
+ <title>Appendix</title>
+ <refsect2 id="device-spec">
+ <title>Device List Format</title>
+ <para>
+ The configuration options <literal>main.no-auto-default</literal>, <literal>main.ignore-carrier</literal>,
+ and <literal>keyfile.unmanaged-devices</literal> select devices based on a list of matchings.
+ Devices can be specified using the following format:
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term>*</term>
+ <listitem><para>Matches every device.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>IFNAME</term>
+ <listitem><para>Case sensitive match of interface name of the device. Globbing is not supported.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>HWADDR</term>
+ <listitem><para>Match the MAC address of the device. Globbing is not supported</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>interface-name:IFNAME</term>
+ <term>interface-name:~IFNAME</term>
+ <listitem><para>Case sensitive match of interface name of the device. Simple globbing is supported with
+ <literal>*</literal> and <literal>?</literal>. Ranges and escaping is not supported.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>interface-name:=IFNAME</term>
+ <listitem><para>Case sensitive match of interface name of the device. Globbing is disabled and <literal>IFNAME</literal>
+ is taken literally.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mac:HWADDR</term>
+ <listitem><para>Match the MAC address of the device. Globbing is not supported</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>s390-subchannels:HWADDR</term>
+ <listitem><para>Match the device based on the subchannel address. Globbing is not supported</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>except:SPEC</term>
+ <listitem><para>Negative match of a device. <literal>SPEC</literal> must be explicitly qualified with
+ a prefix such as <literal>interface-name:</literal>. A negative match has higher priority then the positive
+ matches above.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>SPEC[,;]SPEC</term>
+ <listitem><para>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.</para>
+ <para>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.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ Example:
+ <programlisting>
+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
+ </programlisting>
+ </para>
+ </refsect2>
+ </refsect1>
+
+ <refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
diff --git a/man/NetworkManager.xml b/man/NetworkManager.xml
index 229c390cdc..ceb810e3b4 100644
--- a/man/NetworkManager.xml
+++ b/man/NetworkManager.xml
@@ -4,9 +4,9 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
- Copyright (C) 2005 - 2014 Red Hat, Inc.
- Copyright (C) 2005 - 2009 Novell, Inc.
- Copyright (C) 2005 Robert Love
+ Copyright 2005 - 2014 Red Hat, Inc.
+ Copyright 2005 - 2009 Novell, Inc.
+ Copyright 2005 Robert Love
-->
<refentry id="NetworkManager">
@@ -19,7 +19,7 @@
<manvolnum>8</manvolnum>
<refmiscinfo class="source">NetworkManager</refmiscinfo>
<refmiscinfo class="manual">Network management daemons</refmiscinfo>
- <refmiscinfo class="version">0.9.10</refmiscinfo>
+ <refmiscinfo class="version">1.0</refmiscinfo>
</refmeta>
<refnamediv>
@@ -167,6 +167,25 @@
</para></listitem>
</varlistentry>
<varlistentry>
+ <term><varname>CONNECTION_DBUS_PATH</varname></term>
+ <listitem><para>
+ The NetworkManager D-Bus path of the connection.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><varname>CONNECTION_FILENAME</varname></term>
+ <listitem><para>
+ The backing file name of the connection profile (if any).
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><varname>CONNECTION_EXTERNAL</varname></term>
+ <listitem><para>
+ If "1", this indicates that the connection describes a
+ network configuration created outside of NetworkManager.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
<term><varname>DEVICE_IFACE</varname></term>
<listitem><para>
The interface name of the device.
@@ -182,7 +201,8 @@
<term><varname>IP4_ADDRESS_N</varname></term>
<listitem><para>
The IPv4 address in the format "address/prefix gateway", where N is a number
- from 0 to (# IPv4 address \- 1).
+ from 0 to (# IPv4 addresses - 1). gateway item in this variable is deprecated,
+ use IP4_GATEWAY instead.
</para></listitem>
</varlistentry>
<varlistentry>
@@ -192,10 +212,16 @@
</para></listitem>
</varlistentry>
<varlistentry>
+ <term><varname>IP4_GATEWAY</varname></term>
+ <listitem><para>
+ The gateway IPv4 address in traditional numbers-and-dots notation.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
<term><varname>IP4_ROUTE_N</varname></term>
<listitem><para>
The IPv4 route in the format "address/prefix next-hop metric", where N is a number
- from 0 to (# IPv4 routes \- 1).
+ from 0 to (# IPv4 routes - 1).
</para></listitem>
</varlistentry>
<varlistentry>
@@ -294,7 +320,7 @@
<listitem><para> 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
+ a fallback to the older 'nm-system-settings.conf' if located
in the same directory. See
<citerefentry><refentrytitle>NetworkManager.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for more information on configuration file.
@@ -333,6 +359,33 @@
</refsect1>
<refsect1>
+ <title>UDEV PROPERTIES</title>
+
+ <para>
+ <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>
+ device manager is used for the network device discovery. The following
+ property influences how NetworkManager manages the devices:
+ </para>
+
+ <variablelist>
+ <varlistentry>
+ <term><varname>NM_UNMANAGED</varname></term>
+ <listitem><para>
+ 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.
+ </para><para>
+ Create an udev rule that sets this property to prevent NetworkManager
+ from interfering with virtual Ethernet device interfaces that are
+ managed by virtualization tools.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
<title>DEBUGGING</title>
<para>
The following environment variables are supported to help
@@ -360,6 +413,7 @@
<citerefentry><refentrytitle>nm-settings</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>nm-applet</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>nm-connection-editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>
diff --git a/man/nm-settings-ifcfg-rh.xsl b/man/nm-settings-ifcfg-rh.xsl
index f069828ce0..e0e3eb9a09 100644
--- a/man/nm-settings-ifcfg-rh.xsl
+++ b/man/nm-settings-ifcfg-rh.xsl
@@ -51,7 +51,7 @@
for static IPv4 routes and <filename>route6-*</filename> for static IPv6 routes.
The plugin currently supports reading and writing Ethernet, Wi-Fi, InfiniBand,
VLAN, Bond, Bridge, and Team connections. Unsupported connection types (such as
- (WWAN, PPPoE, VPN, or ADSL) are handled by <emphasis>keyfile</emphasis> plugin
+ WWAN, PPPoE, VPN, or ADSL are handled by <emphasis>keyfile</emphasis> plugin
(<citerefentry><refentrytitle>nm-settings-keyfile</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
The main reason for using <emphasis>ifcfg-rh</emphasis> plugin is the compatibility
with legacy configurations for <emphasis>ifup</emphasis> and <emphasis>ifdown</emphasis>
@@ -243,11 +243,21 @@ DEVICETYPE=TeamPort
nameservers to resolv.conf".</para>
</listitem>
<listitem>
- <para><literal>ONBOOT</literal> -
+ <para><literal>ONBOOT</literal> -
initscripts use ONBOOT=yes to mark the devices that are to be activated
during boot. NetworkManager extents this to also mean that this profile
can be used for auto-connecting at any time.</para>
</listitem>
+ <listitem>
+ <para><literal>BOOTPROTO</literal> -
+ NetworkManager supports traditional values <emphasis>none</emphasis> (static),
+ <emphasis>dhcp</emphasis>. But it also allows additional values to
+ enable new addressing methods. They are <emphasis>autoip</emphasis> for IPv4
+ link-local addressing using Avahi daemon and <emphasis>shared</emphasis> for
+ connection sharing. When <emphasis>shared</emphasis> is used, NetworkManager
+ assigns the interface 10.42.0.1, or it uses the first static address,
+ if configured.</para>
+ </listitem>
</itemizedlist>
</para></listitem>
</varlistentry>
@@ -273,8 +283,8 @@ DEVICETYPE=TeamPort
Each secret property in a NetworkManager setting has an associated
<emphasis>flags</emphasis> property that describes how to handle that secret.
In the <emphasis>fcfg-rh</emphasis> plugin variables for secret flags have a
- <emphasis>-FLAGS</emphasis> suffix. The variables contain one or more of the
- folowing values (space separated). Missing (or empty) -FLAGS variable means
+ <emphasis>_FLAGS</emphasis> 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.
</para>
<itemizedlist>
@@ -368,7 +378,7 @@ DEVICETYPE=TeamPort
</entry>
<entry align="left"><xsl:value-of select="@default"/></entry>
<entry align="left">
- <xsl:value-of select="@description"/><xsl:if test="contains(@name,'-flags') and $setting_name != 'dcb'"> (see <xref linkend="secrets-flags"/> for _FLAGS values)</xsl:if>
+ <xsl:value-of select="@description"/><xsl:if test="@format = 'NMSettingSecretFlags'"> (see <xref linkend="secrets-flags"/> for _FLAGS values)</xsl:if>
<xsl:if test="string-length(@example)">
<emphasis role="bold">
diff --git a/man/nm-settings.xsl b/man/nm-settings.xsl
index ae8e416af4..24e4153599 100644
--- a/man/nm-settings.xsl
+++ b/man/nm-settings.xsl
@@ -155,7 +155,7 @@
<entry align="left"><xsl:value-of select="@name"/></entry>
<entry align="left"><xsl:value-of select="@type"/></entry>
<entry align="left"><xsl:value-of select="@default"/></entry>
- <entry><xsl:value-of select="@description"/><xsl:if test="contains(@name,'-flags') and $setting_name != 'dcb'"> (see <xref linkend="secrets-flags"/> for flag values)</xsl:if></entry>
+ <entry><xsl:value-of select="@description"/><xsl:if test="@type = 'NMSettingSecretFlags (uint32)'"> (see <xref linkend="secrets-flags"/> for flag values)</xsl:if></entry>
</row>
</xsl:template>
diff --git a/man/nmcli-examples.xml b/man/nmcli-examples.xml
index 71bc1950a9..23ef231864 100644
--- a/man/nmcli-examples.xml
+++ b/man/nmcli-examples.xml
@@ -3,13 +3,13 @@
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<!--
-Copyright (C) 2013 - 2014 Red Hat, Inc.
+Copyright 2013 - 2014 Red Hat, Inc.
-->
<refentry id="nmcli-examples">
<refentryinfo>
<title>nmcli-examples</title>
- <date>16 June 2014</date>
+ <date>19 November 2014</date>
<author>NetworkManager developers</author>
</refentryinfo>
@@ -18,7 +18,7 @@ Copyright (C) 2013 - 2014 Red Hat, Inc.
<manvolnum>5</manvolnum>
<refmiscinfo class="source">NetworkManager</refmiscinfo>
<refmiscinfo class="manual">Examples</refmiscinfo>
- <refmiscinfo class="version">0.9.10</refmiscinfo>
+ <refmiscinfo class="version">1.0</refmiscinfo>
</refmeta>
<refnamediv>
@@ -96,6 +96,7 @@ 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
@@ -242,6 +243,7 @@ $ nmcli con modify TowerBridge bridge.stp no
<emphasis role="bold">
$ 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
</emphasis>
@@ -252,11 +254,10 @@ $ nmcli -p con show my-con-em1
that is bound to interface name <emphasis>em1</emphasis>. 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 for the first IP address will become the default route if this profile
- is activated on em1 interface (and there is no connection with higher priority).
- The second two addresses don't specify a prefix, so a default prefix will be used, i.e.
- 32 for IPv4 and 128 for IPv6.
- The second and third commands modify DNS parameters of the new connection profile.
+ 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 <emphasis>con show</emphasis> command displays the profile so that all
parameters can be reviewed.
</para>
@@ -339,6 +340,7 @@ 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:
@@ -364,7 +366,9 @@ 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: --
@@ -377,7 +381,9 @@ 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
@@ -394,22 +400,23 @@ nmcli ipv4.addresses> desc
=== [addresses] ===
[NM property description]
-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. For the 'auto' method, given IP addresses are appended to those returned by automatic configuration. Addresses cannot be used with the 'shared', 'link-local', or 'disabled' methods as addressing is either automatic or disabled with these methods.
+Array of IP addresses.
[nmcli specific description]
Enter a list of IPv4 addresses formatted as:
- ip[/prefix] [gateway], ip[/prefix] [gateway],...
+ ip[/prefix], ip[/prefix],...
Missing prefix is regarded as prefix of 32.
-Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24
+Example: 192.168.1.5/24, 10.0.0.11/24
-nmcli ipv4.addresses> set 192.168.1.100/24 192.168.1.1
+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: { ip = 192.168.1.100/24, gw = 192.168.1.1 }
+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
@@ -421,6 +428,7 @@ 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:
@@ -445,8 +453,10 @@ connection.gateway-ping-timeout: 0
ipv4.method: manual
ipv4.dns:
ipv4.dns-search:
-ipv4.addresses: { ip = 192.168.1.100/24, gw = 192.168.1.1 }
+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: --
@@ -460,6 +470,7 @@ 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
@@ -477,6 +488,7 @@ 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:
@@ -499,10 +511,12 @@ connection.gateway-ping-timeout: 0
802-3-ethernet.s390-options:
-------------------------------------------------------------------------------
ipv4.method: manual
-ipv4.dns: 8.8.8.8, 8.8.4.4
+ipv4.dns: 8.8.8.8,8.8.4.4
ipv4.dns-search:
-ipv4.addresses: { ip = 192.168.1.100/24, gw = 192.168.1.1 }
+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: --
@@ -515,7 +529,9 @@ 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
@@ -532,7 +548,7 @@ nmcli> quit
</example>
<para>
Example session in the nmcli interactive connection editor.
- The scenario creates an Ethernet connection (configuration) with static addressing (IPs and DNS).
+ The scenario creates an Ethernet connection profile with static addressing (IPs and DNS).
</para>
</refsect1>
diff --git a/man/nmcli.1.in b/man/nmcli.1.in
index 109317f768..47bb1267f7 100644
--- a/man/nmcli.1.in
+++ b/man/nmcli.1.in
@@ -19,9 +19,9 @@
.\" 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" "11 September 2014"
+.TH NMCLI "1" "19 February 2015"
.SH NAME
nmcli \- command\(hyline tool for controlling NetworkManager
@@ -33,7 +33,7 @@ nmcli \- command\(hyline tool for controlling NetworkManager
.sp
.IR OBJECT " := { "
-.BR general " | " networking " | " radio " | " connection " | " device
+.BR general " | " networking " | " radio " | " connection " | " device " | " agent
.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] <field1,field2,...> | all | common
.br
\fB\-e\fR[\fIscape\fR] yes | no
@@ -106,6 +108,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 <field1,field2,...> | 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
@@ -131,10 +138,12 @@ incompatible versions may produce incorrect results.
.B \-a, \-\-ask
When using this option \fInmcli\fP will stop and ask for any missing required
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 \-w, \-\-wait <seconds>
This option sets a timeout period for which \fInmcli\fP will wait for \fINetworkManager\fP
-to finsh operations. It is especially useful for commands that may take a longer time to
+to finish operations. It is especially useful for commands that may take a longer time to
complete, e.g. connection activation.
Specifying a value of \fB0\fP instructs \fInmcli\fP not to wait but to exit immediately
with a status of success. The default value depends on the executed command.
@@ -287,12 +296,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 ] <ID> ...
+.B show [--active] [--order <order spec>] [--show-secrets] [ id | uuid | path | apath ] <ID> ...
.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.
+.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
+<order spec> := category:category:...
+.br
+categogy := [+-]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<ID>\fP is ambiguous.
.RS
@@ -327,10 +355,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 ] <ID> [ifname <ifname>] [ap <BSSID>] [nsp <name>]
+.B up [ id | uuid | path ] <ID> [ifname <ifname>] [ap <BSSID>] [nsp <name>] [passwd <file with passwords>]
.RE
.RS
-.B up ifname <ifname> [ap <BSSID>] [nsp <name>]
+.B up ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd <file with passwords>]
.RS
.br
Activate a connection. The connection is identified by its name, UUID or D-Bus
@@ -355,18 +383,38 @@ Available options are:
\(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.
+Each line of the file should contain one password in the form of
+.br
+\fBsetting_name.property_name:the password\fP
+.br
+For example, for WPA Wi-Fi with PSK, the line would be
+.br
+\fI802-11-wireless-security.psk:secret12345\fP
+.br
+For 802.1X password, the line would be
+.br
+\fI802-1x.password:my 1X password\fP
+.br
+nmcli also accepts "wifi-sec" and "wifi" strings instead of "802-11-wireless-security".
+When NetworkManager requires a password and it is not given, nmcli will ask for it
+when run with --ask. If --ask was not passed, NetworkManager can ask another secret
+agent that may be running (typically a GUI secret agent, such as nm-applet or
+gnome-shell).
.RE
.RE
.TP
-.B down [ id | uuid | path | apath ] <ID>
+.B down [ id | uuid | path | apath ] <ID> ...
.br
Deactivate a connection from a device without preventing the device from
-further auto-activation.
+further auto-activation. Multiple connections can be passed to the command.
.sp
-Be aware that this command deactivates the specified active connection. The device
+Be aware that this command deactivates the specified active connection, but the device
on which the connection was active, is still ready to connect and will perform
auto-activation by looking for a suitable connection that has the 'autoconnect'
-flag set. This includes the just deactivated connection, so if the connection is set
+flag set. This includes the just deactivated connection. So if the connection is set
to auto-connect, it will be automatically started on the disconnected device again.
.br
In most cases you may want to use \fIdevice disconnect\fP command instead.
@@ -376,6 +424,8 @@ If <ID> is ambiguous, a keyword \fIid\fP, \fIuuid\fP, \fIpath\fP or
\fIapath\fP can be used.
.br
See \fBconnection show\fP above for the description of the <ID>-specifying keywords.
+.br
+If '--wait' option is not specified, the default timeout will be 10 seconds.
.TP
.B add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS
.br
@@ -557,6 +607,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 <MAC address>]\fP" 42
\(en MAC address of the bridge (note: this requires a recent kernel feature,
originally introduced in 3.15 upstream kernel)
@@ -664,6 +716,8 @@ its name, UUID or D-Bus path. If <ID> 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 <ID>-specifying keywords.
+.br
+If '--wait' option is not specified, the default timeout will be 10 seconds.
.TP
.B reload
.br
@@ -708,14 +762,15 @@ 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 disconnect <ifname>
+.B disconnect <ifname> ...
.br
Disconnect a device and prevent the device from automatically activating further
-connections without user/manual intervention.
+connections without user/manual intervention. Note that disconnecting software
+devices may mean that the devices will disappear.
.br
If '--wait' option is not specified, the default timeout will be 10 seconds.
.TP
-.B delete <ifname>
+.B delete <ifname> ...
.br
Delete a device. The command removes the interface from the system. Note that
this only works for software devices like bonds, bridges, teams, etc.
@@ -771,6 +826,39 @@ This command does not show the APs, use 'nmcli device wifi list' for that.
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.
+.RE
+
+.TP
+.B agent \- run nmcli as a NetworkManager secret agent, or polkit agent
+.br
+.TP
+.SS \fICOMMAND\fP := { secret | polkit | all }
+.sp
+.RS
+.TP
+.B secret
+.br
+Register nmcli as a NetworkManager secret agent and listen for secret requests.
+You do usually not need this command, because nmcli can handle secrets when
+connecting to networks. However, you may find the command useful when you use
+another tool for activating connections and you do not have a secret agent
+available (like nm-applet).
+.TP
+.B polkit
+.br
+Register nmcli as a polkit agent for the user session and listen for
+authorization requests. You do not usually need this command, because nmcli can
+handle polkit actions related to NetworkManager operations (when run with
+--ask). However, you may find the command useful when you want to run a simple
+text based polkit agent and you do not have an agent of a desktop environment.
+Note that running this command makes nmcli handle all polkit requests, not only
+NetworkManager related ones, because only one polkit agent can run for the
+session.
+.TP
+.B all
+.br
+Runs nmcli as both NetworkManager secret and a polkit agent.
+.RE
.SH ENVIRONMENT VARIABLES
\fInmcli\fP's behavior is affected by the following environment variables.
diff --git a/man/nmtui.1.in b/man/nmtui.1.in
new file mode 100644
index 0000000000..32b76954e1
--- /dev/null
+++ b/man/nmtui.1.in
@@ -0,0 +1,66 @@
+.\" nmtui (1) manual page
+.\"
+.\" This is free documentation; 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.
+.\"
+.\" The GNU General Public License's references to "object code"
+.\" and "executables" are to be interpreted as the output of any
+.\" document formatting or typesetting system, including
+.\" intermediate and printed output.
+.\"
+.\" This manual 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 Licence along
+.\" with this manual; if not, write to the Free Software Foundation, Inc.,
+.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+.\"
+.\" Copyright 2014 Red Hat, Inc.
+.\"
+.TH NMTUI "1" "6 November 2014"
+
+.SH NAME
+nmtui \- Text User Interface for controlling NetworkManager
+.SH SYNOPSIS
+.B nmtui
+.RI " [ " edit " | " connect " | " hostname " ] [ ... ] "
+.P
+.B nmtui\-edit
+.RI " [ " connection-id " | " connection-name " ] "
+.P
+.B nmtui\-connect
+.RI " [ " connection-name " | " connection-uuid " | " device-name " | " Wi-Fi-SSID " ] "
+.P
+.B nmtui\-hostname
+
+.SH DESCRIPTION
+.B nmtui
+is a curses\(hybased TUI application for interacting with \fINetworkManager\fP.
+.P
+When starting \fInmtui\fP, the user is prompted to choose the activity to perform
+unless it was specified as the first argument.
+.P
+The supported activities are:
+.IP \(em 4
+\fIedit\fP: show a connection editor that supports adding, modifying, viewing and deleting
+connections. It provides similar functionality as \fInm\-connection\-editor\fP.
+.IP \(em 4
+\fIconnect\fP: show a list of available connections, with the option to activate or deactivate
+them. It provides similar functionality as \fInm\-applet\fP.
+.IP \(em 4
+\fIhostname\fP: set the system hostname.
+
+.P
+Corresponding to above activities, \fInmtui\fP also comes with binaries named
+\fInmtui\-edit\fP, \fInmtui\-connect\fP, and \fInmtui-hostname\fP to skip the selection
+of the activities.
+
+.SH SEE ALSO
+.BR NetworkManager(8),
+.BR nmcli(1).
+.BR nm\-applet(1).
+.BR nm\-connection\-editor(1).
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0acabd9173..6c09b21ff0 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,19 +1,24 @@
[encoding: UTF-8]
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
+clients/cli/agent.c
clients/cli/common.c
clients/cli/connections.c
clients/cli/devices.c
clients/cli/general.c
clients/cli/nmcli.c
+clients/cli/polkit-agent.c
clients/cli/settings.c
clients/cli/utils.c
+clients/common/nm-polkit-listener.c
+clients/common/nm-secret-agent-simple.c
clients/nm-online.c
clients/tui/newt/nmt-newt-utils.c
clients/tui/nm-editor-utils.c
clients/tui/nmt-connect-connection-list.c
clients/tui/nmt-device-entry.c
clients/tui/nmt-edit-connection-list.c
+clients/tui/nmt-editor-section.c
clients/tui/nmt-editor.c
clients/tui/nmt-mtu-entry.c
clients/tui/nmt-page-bond.c
@@ -24,7 +29,6 @@ clients/tui/nmt-page-ethernet.c
clients/tui/nmt-page-infiniband.c
clients/tui/nmt-page-ip4.c
clients/tui/nmt-page-ip6.c
-clients/tui/nmt-page-main.c
clients/tui/nmt-page-ppp.c
clients/tui/nmt-page-team-port.c
clients/tui/nmt-page-team.c
@@ -34,7 +38,6 @@ clients/tui/nmt-password-dialog.c
clients/tui/nmt-password-fields.c
clients/tui/nmt-route-editor.c
clients/tui/nmt-route-table.c
-clients/tui/nmt-secret-agent.c
clients/tui/nmt-slave-list.c
clients/tui/nmt-widget-list.c
clients/tui/nmtui-connect.c
@@ -45,6 +48,8 @@ libnm-core/crypto.c
libnm-core/crypto_gnutls.c
libnm-core/crypto_nss.c
libnm-core/nm-connection.c
+libnm-core/nm-keyfile-reader.c
+libnm-core/nm-keyfile-writer.c
libnm-core/nm-setting-8021x.c
libnm-core/nm-setting-adsl.c
libnm-core/nm-setting-bluetooth.c
@@ -56,6 +61,7 @@ libnm-core/nm-setting-connection.c
libnm-core/nm-setting-dcb.c
libnm-core/nm-setting-gsm.c
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-olpc-mesh.c
@@ -69,6 +75,7 @@ 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-glib/nm-device.c
libnm-glib/nm-remote-connection.c
libnm-util/crypto.c
@@ -122,6 +129,7 @@ libnm/nm-vpn-plugin-old.c
policy/org.freedesktop.NetworkManager.policy.in.in
src/NetworkManagerUtils.c
src/main.c
+src/main-utils.c
src/dhcp-manager/nm-dhcp-dhclient.c
src/dhcp-manager/nm-dhcp-dhclient-utils.c
src/dhcp-manager/nm-dhcp-manager.c
@@ -142,6 +150,7 @@ 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
src/nm-logging.c
src/nm-manager.c
src/nm-sleep-monitor-systemd.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 2a7f3518a1..f611e4ce29 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -5,3 +5,4 @@ policy/org.freedesktop.NetworkManager.policy.in
vpn-daemons/openvpn
vpn-daemons/pptp
vpn-daemons/vpnc
+contrib/fedora/rpm/
diff --git a/po/de.po b/po/de.po
index 06f8a369fd..eed36080ca 100644
--- a/po/de.po
+++ b/po/de.po
@@ -14,22 +14,22 @@
# Wolfgang Stöggl <c72578@yahoo.de>, 2012, 2013.
# Christian Kirbach <christian.kirbach@gmail.com>, 2009-2014.
# Benjamin Steinwender <b@stbe.at>, 2014.
-# Hedda Peters <hpeters@redhat.com>, 2014.
+# Hedda Peters <hpeters@redhat.com>, 2014, 2015.
msgid ""
msgstr ""
"Project-Id-Version: NetworkManager HEAD\n"
-"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
-"product=NetworkManager&keywords=I18N+L10N&component=Translations\n"
+"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug."
+"cgi?product=NetworkManager&keywords=I18N+L10N&component=Translations\n"
"POT-Creation-Date: 2014-08-01 22:08+0000\n"
-"PO-Revision-Date: 2014-07-27 17:44+0100\n"
-"Last-Translator: Benjamin Steinwender <b@stbe.at>\n"
-"Language-Team: Deutsch <gnome-de@gnome.org>\n"
+"PO-Revision-Date: 2015-02-03 16:15+0000\n"
+"Last-Translator: \n"
+"Language-Team: American English <kde-i18n-doc@kde.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 1.6.7\n"
+"X-Generator: Lokalize 1.0\n"
#: ../clients/cli/common.c:38 ../clients/cli/common.c:50
#: ../clients/cli/common.c:58 ../clients/cli/common.c:69
@@ -2935,12 +2935,6 @@ msgstr "Datei »%s« konnte nicht geladen werden\n"
msgid "Error: '%s' is not valid 'connection' command."
msgstr "Fehler: »%s« ist kein aktiver Verbindungsbefehl."
-#: ../clients/cli/connections.c:8658 ../clients/cli/network-manager.c:613
-#, fuzzy, c-format
-#| msgid "Error: Could not get system settings."
-msgid "Error: Could not get system settings: %s."
-msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden."
-
#: ../clients/cli/connections.c:8669
#, c-format
msgid "Error: Can't obtain connections: settings service is not running."
@@ -3021,7 +3015,7 @@ msgstr "IP-IFACE"
#. 2
#: ../clients/cli/devices.c:70 ../clients/cli/devices.c:98
msgid "IS-SOFTWARE"
-msgstr ""
+msgstr "IS-SOFTWARE"
#. 14
#: ../clients/cli/devices.c:71
@@ -4446,10 +4440,9 @@ msgid "Failed to create signal handling thread: %d\n"
msgstr "Erstellen des Threads für die Signalbehandlung schlug fehl: %d\n"
#: ../clients/cli/nmcli.c:399 ../clients/nm-online.c:197
-#, fuzzy, c-format
-#| msgid "Error: Could not create NMClient object."
+#, c-format
msgid "Error: Could not create NMClient object: %s."
-msgstr "Fehler: NMClient-Objekt konnte nicht erstellt werden."
+msgstr "Fehler: NMClient-Objekt konnte nicht erstellt werden: %s."
#: ../clients/cli/nmcli.c:416
msgid "Success"
@@ -4735,14 +4728,15 @@ msgid "the property doesn't contain EAP method '%s'"
msgstr "Die Eigenschaft enthält nicht die EAP-Methode »%s«"
#: ../clients/cli/settings.c:2585
-#, fuzzy, c-format
+#, c-format
msgid "the property doesn't contain alternative subject match '%s'"
-msgstr "die Eigenschaft enthält kein alternative Themen passend zu »%s«"
+msgstr "die Eigenschaft enthält keine alternativen Themen passend zu »%s«"
#: ../clients/cli/settings.c:2614
-#, fuzzy, c-format
+#, c-format
msgid "the property doesn't contain \"phase2\" alternative subject match '%s'"
-msgstr "die Eigenschaft enthält nicht die Berechtigung »%s«"
+msgstr ""
+"die Eigenschaft enthält nicht »phase2«, alternative Themen passend zu »%s«"
#: ../clients/cli/settings.c:2640
msgid ""
@@ -6109,10 +6103,10 @@ msgid "Could not parse arguments"
msgstr "Parameter konnten nicht verarbeitet werden"
#: ../clients/tui/nmtui.c:248 ../clients/tui/nmtui.c:259
-#, fuzzy, c-format
+#, c-format
#| msgid "Could not activate connection: %s"
msgid "Could not contact NetworkManager: %s.\n"
-msgstr "Verbindungen konnte nicht aktiviert werden: %s"
+msgstr "NetworkManager konnte nicht erreicht werden: %s.\n"
#: ../clients/tui/nmtui.c:253
msgid "NetworkManager is not running."
@@ -6717,16 +6711,14 @@ msgstr "Unbekannter Sklaventyp »%s«"
#: ../libnm-core/nm-setting-connection.c:869
#: ../libnm-util/nm-setting-connection.c:886
-#, fuzzy
#| msgid "Shared connection service failed"
msgid "Slave connections need a valid '"
-msgstr "Es muss ein gültiger Server-Pfad eingegeben werden"
+msgstr "Slave-Verbindungen benötigen eine gültige '"
#: ../libnm-core/nm-setting-connection.c:878
#: ../libnm-util/nm-setting-connection.c:895
-#, fuzzy
msgid "Cannot set '"
-msgstr " ' kann nicht gesetzt werden"
+msgstr "' kann nicht gesetzt werden"
#: ../libnm-core/nm-setting-dcb.c:544 ../libnm-util/nm-setting-dcb.c:593
msgid "flags invalid"
@@ -7012,13 +7004,12 @@ msgstr "Durch D-Bus getrennt"
#: ../libnm/nm-object.c:149
msgid "Caller did not specify D-Bus path for object"
-msgstr ""
+msgstr "Aufrufer gab keinen D-Bus-Pfad für Objekt an"
#: ../libnm/nm-vpn-plugin.c:751
-#, fuzzy
#| msgid "Error: No interface specified."
msgid "No service name specified"
-msgstr "Fehler: Es muss eine Schnittstelle angegeben werden."
+msgstr "Kein Dienstname angegeben"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:1
msgid "Enable or disable system networking"
diff --git a/po/gu.po b/po/gu.po
index efa234d316..87b0ff26ad 100644
--- a/po/gu.po
+++ b/po/gu.po
@@ -5,21 +5,21 @@
# Ankit Patel <ankit@redhat.com>, 2004.
# Sweta Kothari <swkothar@redhat.com>, 2009, 2010, 2012, 2013.
# swkothar <swkothar@redhat.com>, 2013.
-# Ankit Patel <ankit@redhat.com>, 2014.
+# Ankit Patel <ankit@redhat.com>, 2014, 2015.
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
-"product=NetworkManager&keywords=I18N+L10N&component=general\n"
+"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug."
+"cgi?product=NetworkManager&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2014-02-02 23:50+0000\n"
-"PO-Revision-Date: 2014-02-03 17:21+0630\n"
-"Last-Translator: Ankit Patel <ankit644@yahoo.com>\n"
+"PO-Revision-Date: 2015-02-03 11:51+0530\n"
+"Last-Translator: \n"
"Language-Team: American English <kde-i18n-doc@kde.org>\n"
"Language: gu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Lokalize 1.5\n"
+"X-Generator: Lokalize 1.0\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: ../cli/src/common.c:34 ../cli/src/common.c:46 ../cli/src/common.c:54
@@ -707,6 +707,27 @@ msgid ""
"When --active option is specified, only the active profiles are taken into\n"
"account.\n"
msgstr ""
+"વપરાશ: nmcli connection show { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [--active]\n"
+"\n"
+"મેમરીમાં અથવા ડિસà«àª• જોડાણ રૂપરેખા પર, જેમાંથી અમà«àª• સકà«àª°àª¿àª¯ હોઇ\n"
+"શકે છે જો ઉપકરણ ઠતે જોડાણ રૂપરેખાને વાપરી રહà«àª¯à« હોય. પરિમાણ વગર, "
+"બધી\n"
+"રૂપરેખા યાદી થયેલ છે. જà«àª¯àª¾àª°à«‡ --active વિકલà«àªª સà«àªªàª·à«àªŸ થયેલ છે, ફકà«àª¤ સકà«àª°àª¿àª¯\n"
+"રૂપરેખા બતાવેલ છે.\n"
+"\n"
+"ARGUMENTS := [--active] [id | uuid | path | apath] <ID> ...\n"
+"\n"
+"ખાસ જોડાણો માટે વિગતોને બતાવો. મૂળભૂત રીતે, બંને સà«àª¥àª¿àª° "
+"રૂપરેખાંકન\n"
+"અને સકà«àª°àª¿àª¯ જોડાણ માહિતીને દરà«àª¶àª¾àªµà«‡àª² છે. તે વૈશà«àª°à«àªµàª¿àª• '--fields' વિકલà«àªªàª¨à«€ મદદથી "
+"આઉટપà«àªŸàª¨à«‡ ફિલà«àªŸàª° "
+"કરવાનà«àª‚\n"
+"શકà«àª¯ છે. વધારે જાણકારી માટે પà«àª¸à«àª¤àª¿àª•àª¾ "
+"પાનાંનો સંદરà«àª­ લો.\n"
+"જà«àª¯àª¾àª°à«‡ --active વિકલà«àªª સà«àªªàª·à«àªŸ થયેલ હોય તો, ફકà«àª¤ સકà«àª°àª¿àª¯ રૂપરેખા ઠખાતામાં\n"
+"લાવેલ છે.\n"
#: ../cli/src/connections.c:305
#, c-format
@@ -1512,8 +1533,7 @@ msgstr "સેવા [કંઇ નહિ]: "
#. Ask for optional 'gsm' or 'cdma' arguments.
#: ../cli/src/connections.c:2989
#, c-format
-msgid ""
-"There are 2 optional arguments for 'mobile broadband' connection type.\n"
+msgid "There are 2 optional arguments for 'mobile broadband' connection type.\n"
msgstr "તà«àª¯àª¾àª‚ 'મોબાઇલ બà«àª°à«‹àª¡àª¬à«‡àª¨à«àª¡' જોડાણ પà«àª°àª•àª¾àª° માટે 2 વૈકલà«àªªàª¿àª• દલીલો છે.\n"
#: ../cli/src/connections.c:2997 ../cli/src/connections.c:3442
@@ -2149,6 +2169,19 @@ msgid ""
"connection\n"
"profile must be deleted.\n"
msgstr ""
+"સંગà«àª°àª¹à«‹ [persistent|temporary] :: જોડાણને સંગà«àª°àª¹à«‹\n"
+"\n"
+"NetworkManager માં જોડાણ રૂપરેખાને મોકલે છે કે જે કà«àª¯àª¾àª‚તો કાયમ માટે તેને\n"
+"સંગà«àª°àª¹àª¶à«‡, અથવા મેમરીમાં તેને ફકà«àª¤ રાખશે. દલીલ વગર 'સંગà«àª°àª¹'\n"
+"તેનો મતલબ ઠછે કે 'કાયમ માટે સંગà«àª°àª¹à«‹'.\n"
+"નોંધો કે àªàª•àªµàª¾àª° તમે કાયમ માટે રૂપરેખાને સંગà«àª°àª¹à«‹ પેલા સà«àª¯à«‹àªœàª¨à«‹ રિબà«àªŸ અથવા "
+"પà«àª¨:શરૂ કરીને\n"
+"સંગà«àª°àª¹à«‡ છે.વારાફરથી ફેરફારો ઠપણ કાયમી અથવા\n"
+"વારંવાર હોઇ શકે છે, પરંતૠકોઇફણ કામચલાઉ ફેરફારો ઠરિબà«àªŸ અથવા પà«àª¨:શરૂ કરવા તરફ "
+"કાયમી હશે\n"
+"નહિં. જો તમે કાયમ માટે જોડાણને સંપૂરà«àª£àªªàª£à«‡ દૂર કરવા માંગો તો, જોડાણ "
+"રૂપરેખા\n"
+"ને કાઢી નાંખવી જ જોઇàª.\n"
#: ../cli/src/connections.c:6039
#, c-format
@@ -5878,8 +5911,7 @@ msgstr ""
#: ../src/main.c:412
#, c-format
msgid "%s. Please use --help to see a list of valid options.\n"
-msgstr ""
-"%s. મહેરબાની કરીને યોગà«àª¯ વિકલà«àªªà«‹àª¨à«€ યાદીને જોવા માટે --help ને વાપરો.\n"
+msgstr "%s. મહેરબાની કરીને યોગà«àª¯ વિકલà«àªªà«‹àª¨à«€ યાદીને જોવા માટે --help ને વાપરો.\n"
#: ../src/main.c:417
#, c-format
@@ -6102,8 +6134,7 @@ msgstr "નેટલિંકને સંભાળવાનો શà«àª°à«‡àª¯à
#: ../src/nm-netlink-monitor.c:320 ../src/nm-netlink-monitor.c:382
#, c-format
msgid "unable to allocate netlink handle for monitoring link status: %s"
-msgstr ""
-"કડી સà«àª¥àª¿àª¤àª¿àª¨à«‡ મોનિટર કરવા માટે નેટલિંકને સંભાળવાનà«àª‚ ફાળવવામાં અસમરà«àª¥: %s"
+msgstr "કડી સà«àª¥àª¿àª¤àª¿àª¨à«‡ મોનિટર કરવા માટે નેટલિંકને સંભાળવાનà«àª‚ ફાળવવામાં અસમરà«àª¥: %s"
#: ../src/nm-netlink-monitor.c:470
#, c-format
@@ -6711,8 +6742,7 @@ msgstr "વાયરલેસ નેટવરà«àª• માટે સતà«àª¤àª¾
msgid ""
"Passwords or encryption keys are required to access the wireless network "
"'%s'."
-msgstr ""
-"વાયરલેસ નેટવરà«àª• '%s' વાપરવા માટે પાસવરà«àª¡à«‹ અથવા àªàª¨àª•à«àª°àª¿àªªà«àª¶àª¨ કીઓ જરૂરી છે."
+msgstr "વાયરલેસ નેટવરà«àª• '%s' વાપરવા માટે પાસવરà«àª¡à«‹ અથવા àªàª¨àª•à«àª°àª¿àªªà«àª¶àª¨ કીઓ જરૂરી છે."
#: ../tui/nmt-secret-agent.c:349
msgid "Wired 802.1X authentication"
diff --git a/po/pl.po b/po/pl.po
index b4fbd2f94a..c0be7c5755 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -7,15 +7,15 @@
# Wadim Dziedzic <wdziedzic@aviary.pl>, 2007-2008.
# Artur Flinta <aflinta@at.kernel.pl>, 2007.
# Tomasz Dominikowski <dominikowski@gmail.com>, 2008-2010.
-# Piotr DrÄ…g <piotrdrag@gmail.com>, 2009-2014.
-# Aviary.pl <gnomepl@aviary.pl>, 2007-2014.
+# Piotr DrÄ…g <piotrdrag@gmail.com>, 2009-2015.
+# Aviary.pl <gnomepl@aviary.pl>, 2007-2015.
+#: ../src/nm-iface-helper.c:307
msgid ""
msgstr ""
"Project-Id-Version: NetworkManager\n"
-"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
-"product=NetworkManager&keywords=I18N+L10N&component=Translations\n"
-"POT-Creation-Date: 2014-08-25 22:10+0000\n"
-"PO-Revision-Date: 2014-08-26 20:01+0200\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-01-25 20:28+0100\n"
+"PO-Revision-Date: 2015-01-25 20:29+0100\n"
"Last-Translator: Piotr DrÄ…g <piotrdrag@gmail.com>\n"
"Language-Team: Polish <gnomepl@aviary.pl>\n"
"Language: pl\n"
@@ -27,85 +27,158 @@ msgstr ""
"X-Poedit-Language: Polish\n"
"X-Poedit-Country: Poland\n"
-#: ../cli/src/common.c:38 ../cli/src/common.c:50 ../cli/src/common.c:58
-#: ../cli/src/common.c:69 ../cli/src/connections.c:190
-#: ../cli/src/connections.c:212
+#: ../clients/cli/agent.c:42
+#, c-format
+msgid ""
+"Usage: nmcli agent { COMMAND | help }\n"
+"\n"
+"COMMAND := { secret | polkit | all }\n"
+"\n"
+msgstr ""
+"Użycie: nmcli agent { POLECENIE | help }\n"
+"\n"
+"POLECENIE := { secret | polkit | all }\n"
+"\n"
+
+#: ../clients/cli/agent.c:50
+#, c-format
+msgid ""
+"Usage: nmcli agent secret { help }\n"
+"\n"
+"Runs nmcli as NetworkManager secret agent. When NetworkManager requires\n"
+"a password it asks registered agents for it. This command keeps nmcli "
+"running\n"
+"and if a password is required asks the user for it.\n"
+"\n"
+msgstr ""
+"Użycie: nmcli agent secret { help }\n"
+"\n"
+"Uruchamia program nmcli jako agenta haseł usługi NetworkManager. Kiedy\n"
+"usługa NetworkManager wymaga hasła, pytani są zarejestrowani agenci.\n"
+"To polecenie utrzymuje działanie programu nmcli i pyta użytkownika\n"
+"o hasło, jeśli jest wymagane.\n"
+"\n"
+
+#: ../clients/cli/agent.c:60
+#, c-format
+msgid ""
+"Usage: nmcli agent polkit { help }\n"
+"\n"
+"Registers nmcli as a polkit action for the user session.\n"
+"When a polkit daemon requires an authorization, nmcli asks the user and "
+"gives\n"
+"the response back to polkit.\n"
+"\n"
+msgstr ""
+"Użycie: nmcli agent polkit { help }\n"
+"\n"
+"Rejestruje program nmcli jako działanie polkit dla sesji użytkownika.\n"
+"Kiedy usługa polkit wymaga upoważnienia, program nmcli pyta użytkownika\n"
+"i przekazuje odpowiedź do z powrotem do polkit.\n"
+"\n"
+
+#: ../clients/cli/agent.c:70
+#, c-format
+msgid ""
+"Usage: nmcli agent all { help }\n"
+"\n"
+"Runs nmcli as both NetworkManager secret and a polkit agent.\n"
+"\n"
+msgstr ""
+"Użycie: nmcli agent all { help }\n"
+"\n"
+"Uruchamia program nmcli jako agenta haseł i polkit usługi NetworkManager.\n"
+"\n"
+
+#: ../clients/cli/agent.c:152
+#, c-format
+msgid "nmcli successfully registered as a NetworkManager's secret agent.\n"
+msgstr ""
+"Pomyślnie zarejestrowano program nmcli jako agenta haseł usługi "
+"NetworkManager.\n"
+
+#: ../clients/cli/agent.c:154
+#, c-format
+msgid "Error: secret agent initialization failed"
+msgstr "Błąd: zainicjowanie agenta haseł się nie powiodło"
+
+#: ../clients/cli/agent.c:169
+#, c-format
+msgid "Error: polkit agent initialization failed: %s"
+msgstr "Błąd: zainicjowanie agenta polkit się nie powiodło: %s"
+
+#: ../clients/cli/agent.c:177
+#, c-format
+msgid "nmcli successfully registered as a polkit agent.\n"
+msgstr "Pomyślnie zarejestrowano program nmcli jako agenta polkit.\n"
+
+#: ../clients/cli/agent.c:209 ../clients/cli/connections.c:8779
+#: ../clients/cli/connections.c:8805 ../clients/cli/connections.c:8943
+#: ../clients/cli/devices.c:2832 ../clients/cli/general.c:325
+#: ../clients/cli/general.c:463
+#, c-format
+msgid "Error: NetworkManager is not running."
+msgstr "Błąd: usługa NetworkManager nie jest uruchomiona."
+
+#: ../clients/cli/agent.c:245
+#, c-format
+msgid "Error: 'agent' command '%s' is not valid."
+msgstr "Błąd: polecenie \"agent\" \"%s\" jest nieprawidłowe."
+
+#: ../clients/cli/common.c:40 ../clients/cli/common.c:53
+#: ../clients/cli/common.c:61 ../clients/cli/common.c:73
+#: ../clients/cli/connections.c:172 ../clients/cli/connections.c:194
msgid "GROUP"
msgstr "GRUPA"
#. 0
-#: ../cli/src/common.c:39 ../cli/src/common.c:59
+#: ../clients/cli/common.c:41 ../clients/cli/common.c:62
msgid "ADDRESS"
msgstr "ADRES"
#. 1
-#: ../cli/src/common.c:40 ../cli/src/common.c:60
+#. 2
+#: ../clients/cli/common.c:42 ../clients/cli/common.c:63
+#: ../clients/cli/connections.c:197
+msgid "GATEWAY"
+msgstr "BRAMA"
+
+#. 2
+#: ../clients/cli/common.c:43 ../clients/cli/common.c:64
msgid "ROUTE"
msgstr "TRASA"
-#. 2
-#: ../cli/src/common.c:41 ../cli/src/common.c:61
+#. 3
+#: ../clients/cli/common.c:44 ../clients/cli/common.c:65
msgid "DNS"
msgstr "DNS"
-#. 3
-#: ../cli/src/common.c:42 ../cli/src/common.c:62
+#. 4
+#: ../clients/cli/common.c:45 ../clients/cli/common.c:66
msgid "DOMAIN"
msgstr "DOMENA"
-#. 4
-#: ../cli/src/common.c:43
+#. 5
+#: ../clients/cli/common.c:46
msgid "WINS"
msgstr "WINS"
#. 0
-#: ../cli/src/common.c:51 ../cli/src/common.c:70
+#: ../clients/cli/common.c:54 ../clients/cli/common.c:74
msgid "OPTION"
msgstr "OPCJA"
-#: ../cli/src/common.c:408 ../cli/src/settings.c:3020
-#: ../cli/src/settings.c:3039
-#, c-format
-msgid "invalid IPv4 address '%s'"
-msgstr "nieprawidłowy adres IPv4 \"%s\""
-
-#: ../cli/src/common.c:416
-#, c-format
-msgid "invalid prefix '%s'; <1-32> allowed"
-msgstr "nieprawidłowy przedrostek \"%s\"; dozwolone <1-32>"
-
-#: ../cli/src/common.c:423 ../cli/src/common.c:476
-#, c-format
-msgid "invalid gateway '%s'"
-msgstr "nieprawidłowa brama \"%s\""
-
-#: ../cli/src/common.c:461 ../cli/src/settings.c:3365
-#: ../cli/src/settings.c:3384
-#, c-format
-msgid "invalid IPv6 address '%s'"
-msgstr "nieprawidłowy adres IPv6 \"%s\""
-
-#: ../cli/src/common.c:469
-#, c-format
-msgid "invalid prefix '%s'; <1-128> allowed"
-msgstr "nieprawidłowy przedrostek \"%s\"; dozwolone <1-128>"
-
-#: ../cli/src/common.c:552
-#, c-format
-msgid "invalid route destination address '%s'"
-msgstr "nieprawidłowy adres celu trasy \"%s\""
-
-#: ../cli/src/common.c:559
+#: ../clients/cli/common.c:378 ../clients/cli/common.c:438
#, c-format
msgid "invalid prefix '%s'; <1-%d> allowed"
msgstr "nieprawidłowy przedrostek \"%s\"; dozwolone <1-%d>"
-#: ../cli/src/common.c:569
+#: ../clients/cli/common.c:386
#, c-format
-msgid "invalid next hop address '%s'"
-msgstr "nieprawidłowy adres next-hop \"%s\""
+msgid "invalid IP address: %s"
+msgstr "nieprawidłowy adres IP: %s"
-#: ../cli/src/common.c:574
+#: ../clients/cli/common.c:450
#, c-format
msgid ""
"the second component of route ('%s') is neither a next hop address nor a "
@@ -113,393 +186,406 @@ msgid ""
msgstr ""
"drugi składnik trasy (\"%s\") nie jest adresem next-hop ani parametrami"
-#: ../cli/src/common.c:584
+#: ../clients/cli/common.c:459
#, c-format
msgid "invalid metric '%s'"
msgstr "nieprawidłowe parametry \"%s\""
-#: ../cli/src/common.c:593
+#: ../clients/cli/common.c:467
+#, c-format
+msgid "invalid route: %s"
+msgstr "nieprawidłowa trasa: %s"
+
+#: ../clients/cli/common.c:479
msgid "default route cannot be added (NetworkManager handles it by itself)"
msgstr ""
"nie można dodać domyślnej trasy (usługa NetworkManager sama ją obsługuje)"
-#: ../cli/src/common.c:681
+#: ../clients/cli/common.c:496
msgid "unmanaged"
msgstr "niezarzÄ…dzane"
-#: ../cli/src/common.c:683
+#: ../clients/cli/common.c:498
msgid "unavailable"
msgstr "niedostępne"
-#: ../cli/src/common.c:685 ../cli/src/network-manager.c:276
+#: ../clients/cli/common.c:500 ../clients/cli/general.c:260
msgid "disconnected"
msgstr "rozłączono"
-#: ../cli/src/common.c:687
+#: ../clients/cli/common.c:502
msgid "connecting (prepare)"
msgstr "Å‚Ä…czenie (przygotowanie)"
-#: ../cli/src/common.c:689
+#: ../clients/cli/common.c:504
msgid "connecting (configuring)"
msgstr "Å‚Ä…czenie (konfigurowanie)"
-#: ../cli/src/common.c:691
+#: ../clients/cli/common.c:506
msgid "connecting (need authentication)"
msgstr "Å‚Ä…czenie (wymaga uwierzytelnienia)"
-#: ../cli/src/common.c:693
+#: ../clients/cli/common.c:508
msgid "connecting (getting IP configuration)"
msgstr "Å‚Ä…czenie (pobieranie konfiguracji adresu IP)"
-#: ../cli/src/common.c:695
+#: ../clients/cli/common.c:510
msgid "connecting (checking IP connectivity)"
msgstr "łączenie (sprawdzanie łączności IP)"
-#: ../cli/src/common.c:697
+#: ../clients/cli/common.c:512
msgid "connecting (starting secondary connections)"
msgstr "łączenie (uruchamianie drugorzędnych połączeń)"
-#: ../cli/src/common.c:699 ../cli/src/network-manager.c:272
+#: ../clients/cli/common.c:514 ../clients/cli/general.c:256
msgid "connected"
msgstr "połączono"
-#: ../cli/src/common.c:701 ../cli/src/connections.c:557
+#: ../clients/cli/common.c:516 ../clients/cli/connections.c:538
msgid "deactivating"
msgstr "deaktywowanie"
-#: ../cli/src/common.c:703
+#: ../clients/cli/common.c:518
msgid "connection failed"
msgstr "połączenie się nie powiodło"
-#: ../cli/src/common.c:705 ../cli/src/connections.c:562
-#: ../cli/src/connections.c:585 ../cli/src/connections.c:1653
-#: ../cli/src/devices.c:832 ../cli/src/devices.c:2270
-#: ../cli/src/network-manager.c:279 ../cli/src/network-manager.c:297
-#: ../cli/src/network-manager.c:360 ../cli/src/network-manager.c:363
-#: ../cli/src/network-manager.c:373 ../cli/src/network-manager.c:375
-#: ../cli/src/network-manager.c:432 ../cli/src/network-manager.c:448
-#: ../cli/src/settings.c:735 ../cli/src/settings.c:763
-#: ../cli/src/settings.c:825 ../cli/src/settings.c:1141
-#: ../cli/src/utils.c:1122 ../src/main.c:503 ../src/main.c:531
+#: ../clients/cli/common.c:520 ../clients/cli/connections.c:543
+#: ../clients/cli/connections.c:566 ../clients/cli/connections.c:1705
+#: ../clients/cli/devices.c:878 ../clients/cli/general.c:263
+#: ../clients/cli/general.c:281 ../clients/cli/general.c:411
+#: ../clients/cli/general.c:427 ../clients/cli/settings.c:717
+#: ../clients/cli/settings.c:779 ../clients/cli/settings.c:1072
+#: ../clients/cli/utils.c:1145 ../src/main.c:309 ../src/main.c:337
msgid "unknown"
msgstr "nieznane"
-#: ../cli/src/common.c:714
+#: ../clients/cli/common.c:529
msgid "No reason given"
msgstr "Nie podano przyczyny"
-#: ../cli/src/common.c:717 ../cli/src/connections.c:2452
+#: ../clients/cli/common.c:532 ../clients/cli/connections.c:2705
#, c-format
msgid "Unknown error"
msgstr "Nieznany błąd"
-#: ../cli/src/common.c:720
+#: ../clients/cli/common.c:535
msgid "Device is now managed"
msgstr "UrzÄ…dzenie jest teraz zarzÄ…dzane"
-#: ../cli/src/common.c:723
+#: ../clients/cli/common.c:538
msgid "Device is now unmanaged"
msgstr "UrzÄ…dzenie nie jest teraz zarzÄ…dzane"
-#: ../cli/src/common.c:726
+#: ../clients/cli/common.c:541
msgid "The device could not be readied for configuration"
msgstr "Urządzenie nie może zostać odczytane do konfiguracji"
-#: ../cli/src/common.c:729
+#: ../clients/cli/common.c:544
msgid ""
"IP configuration could not be reserved (no available address, timeout, etc.)"
msgstr ""
"Konfiguracja IP nie mogła zostać zastrzeżona (brak dostępnego adresu, czasu "
"oczekiwania itp.)"
-#: ../cli/src/common.c:732
+#: ../clients/cli/common.c:547
msgid "The IP configuration is no longer valid"
msgstr "Konfiguracja IP nie jest już prawidłowa"
-#: ../cli/src/common.c:735
+#: ../clients/cli/common.c:550
msgid "Secrets were required, but not provided"
msgstr "Hasła są wymagane, ale nie zostały podane"
-#: ../cli/src/common.c:738
+#: ../clients/cli/common.c:553
msgid "802.1X supplicant disconnected"
msgstr "Suplikant 802.1X został rozłączony"
-#: ../cli/src/common.c:741
+#: ../clients/cli/common.c:556
msgid "802.1X supplicant configuration failed"
msgstr "Konfiguracja suplikanta 802.1X się nie powiodła"
-#: ../cli/src/common.c:744
+#: ../clients/cli/common.c:559
msgid "802.1X supplicant failed"
msgstr "Suplikant 802.1X się nie powiódł"
-#: ../cli/src/common.c:747
+#: ../clients/cli/common.c:562
msgid "802.1X supplicant took too long to authenticate"
msgstr "Suplikant 802.1X za długo się uwierzytelniał"
-#: ../cli/src/common.c:750
+#: ../clients/cli/common.c:565
msgid "PPP service failed to start"
msgstr "Uruchomienie usługi PPP się nie powiodło"
-#: ../cli/src/common.c:753
+#: ../clients/cli/common.c:568
msgid "PPP service disconnected"
msgstr "Rozłączono z usługą PPP"
-#: ../cli/src/common.c:756
+#: ../clients/cli/common.c:571
msgid "PPP failed"
msgstr "Usługa PPP się nie powiodła"
-#: ../cli/src/common.c:759
+#: ../clients/cli/common.c:574
msgid "DHCP client failed to start"
msgstr "Uruchomienie klienta DHCP się nie powiodło"
-#: ../cli/src/common.c:762
+#: ../clients/cli/common.c:577
msgid "DHCP client error"
msgstr "BÅ‚Ä…d klienta DHCP"
-#: ../cli/src/common.c:765
+#: ../clients/cli/common.c:580
msgid "DHCP client failed"
msgstr "Klient DHCP się nie powiódł"
-#: ../cli/src/common.c:768
+#: ../clients/cli/common.c:583
msgid "Shared connection service failed to start"
msgstr "Uruchomienie usługi współdzielenia połączenia się nie powiodło"
-#: ../cli/src/common.c:771
+#: ../clients/cli/common.c:586
msgid "Shared connection service failed"
msgstr "Usługa współdzielenia połączenia się nie powiodła"
-#: ../cli/src/common.c:774
+#: ../clients/cli/common.c:589
msgid "AutoIP service failed to start"
msgstr "Uruchomienie usługi AutoIP się nie powiodło"
-#: ../cli/src/common.c:777
+#: ../clients/cli/common.c:592
msgid "AutoIP service error"
msgstr "Błąd usługi AutoIP"
-#: ../cli/src/common.c:780
+#: ../clients/cli/common.c:595
msgid "AutoIP service failed"
msgstr "Usługa AutoIP się nie powiodła"
-#: ../cli/src/common.c:783
+#: ../clients/cli/common.c:598
msgid "The line is busy"
msgstr "Linia jest zajęta"
-#: ../cli/src/common.c:786
+#: ../clients/cli/common.c:601
msgid "No dial tone"
msgstr "Brak sygnału telefonicznego"
-#: ../cli/src/common.c:789
+#: ../clients/cli/common.c:604
msgid "No carrier could be established"
msgstr "Nie można ustanowić operatora"
-#: ../cli/src/common.c:792
+#: ../clients/cli/common.c:607
msgid "The dialing request timed out"
msgstr "Żądanie zadzwonienia przekroczyło czas oczekiwania"
-#: ../cli/src/common.c:795
+#: ../clients/cli/common.c:610
msgid "The dialing attempt failed"
msgstr "Próba zadzwonienia się nie powiodła"
-#: ../cli/src/common.c:798
+#: ../clients/cli/common.c:613
msgid "Modem initialization failed"
msgstr "Zainicjowanie modemu się nie powiodło"
-#: ../cli/src/common.c:801
+#: ../clients/cli/common.c:616
msgid "Failed to select the specified APN"
msgstr "Wybranie podanego APN się nie powiodło"
-#: ../cli/src/common.c:804
+#: ../clients/cli/common.c:619
msgid "Not searching for networks"
msgstr "Sieci nie sÄ… wyszukiwane"
-#: ../cli/src/common.c:807
+#: ../clients/cli/common.c:622
msgid "Network registration denied"
msgstr "Odmówiono rejestracji sieci"
-#: ../cli/src/common.c:810
+#: ../clients/cli/common.c:625
msgid "Network registration timed out"
msgstr "Przekroczono czas oczekiwania rejestracji sieci"
-#: ../cli/src/common.c:813
+#: ../clients/cli/common.c:628
msgid "Failed to register with the requested network"
msgstr "Zarejestrowanie w żądanej sieci się nie powiodło"
-#: ../cli/src/common.c:816
+#: ../clients/cli/common.c:631
msgid "PIN check failed"
msgstr "Sprawdzenie kodu PIN się nie powiodło"
-#: ../cli/src/common.c:819
+#: ../clients/cli/common.c:634
msgid "Necessary firmware for the device may be missing"
msgstr "Brak wymaganego oprogramowania sprzętowego dla urządzenia"
-#: ../cli/src/common.c:822
+#: ../clients/cli/common.c:637
msgid "The device was removed"
msgstr "Urządzenie zostało usunięte"
-#: ../cli/src/common.c:825
+#: ../clients/cli/common.c:640
msgid "NetworkManager went to sleep"
msgstr "Usługa NetworkManager została uśpiona"
-#: ../cli/src/common.c:828
+#: ../clients/cli/common.c:643
msgid "The device's active connection disappeared"
msgstr "Aktywne połączenie urządzenia zniknęło"
-#: ../cli/src/common.c:831
+#: ../clients/cli/common.c:646
msgid "Device disconnected by user or client"
msgstr "Urządzenie zostało rozłączone przez użytkownika lub klienta"
-#: ../cli/src/common.c:834
+#: ../clients/cli/common.c:649
msgid "Carrier/link changed"
msgstr "Zmieniono operatora/Å‚Ä…cze"
-#: ../cli/src/common.c:837
+#: ../clients/cli/common.c:652
msgid "The device's existing connection was assumed"
msgstr "Przyjęto istniejące połączenie urządzenia"
-#: ../cli/src/common.c:840
+#: ../clients/cli/common.c:655
msgid "The supplicant is now available"
msgstr "Suplikant jest teraz dostępny"
-#: ../cli/src/common.c:843
+#: ../clients/cli/common.c:658
msgid "The modem could not be found"
msgstr "Nie można odnaleźć modemu"
-#: ../cli/src/common.c:846
+#: ../clients/cli/common.c:661
msgid "The Bluetooth connection failed or timed out"
msgstr ""
"Połączenie Bluetooth się nie powiodło lub przekroczyło czas oczekiwania"
-#: ../cli/src/common.c:849
+#: ../clients/cli/common.c:664
msgid "GSM Modem's SIM card not inserted"
msgstr "Karta SIM modemu GSM nie została włożona"
-#: ../cli/src/common.c:852
+#: ../clients/cli/common.c:667
msgid "GSM Modem's SIM PIN required"
msgstr "Wymagany jest kod PIN karty SIM modemu GSM"
-#: ../cli/src/common.c:855
+#: ../clients/cli/common.c:670
msgid "GSM Modem's SIM PUK required"
msgstr "Wymagany jest kod PUK karty SIM modemu GSM"
-#: ../cli/src/common.c:858
+#: ../clients/cli/common.c:673
msgid "GSM Modem's SIM wrong"
msgstr "Karta SIM modemu GSM jest błędna"
-#: ../cli/src/common.c:861
+#: ../clients/cli/common.c:676
msgid "InfiniBand device does not support connected mode"
msgstr "Urządzenie InfiniBand nie obsługuje trybu połączonego"
-#: ../cli/src/common.c:864
+#: ../clients/cli/common.c:679
msgid "A dependency of the connection failed"
msgstr "Zależność połączenia się nie powiodła"
-#: ../cli/src/common.c:867
+#: ../clients/cli/common.c:682
msgid "A problem with the RFC 2684 Ethernet over ADSL bridge"
msgstr "Problem z mostkiem ethernetowym RFC 2684 na ADSL"
-#: ../cli/src/common.c:870
+#: ../clients/cli/common.c:685
msgid "ModemManager is unavailable"
msgstr "Usługa ModemManager jest niedostępna"
-#: ../cli/src/common.c:873
+#: ../clients/cli/common.c:688
msgid "The Wi-Fi network could not be found"
msgstr "Nie można odnaleźć sieci Wi-Fi"
-#: ../cli/src/common.c:876
+#: ../clients/cli/common.c:691
msgid "A secondary connection of the base connection failed"
msgstr "Drugorzędne połączenie połączenia podstawowego się nie powiodło"
-#: ../cli/src/common.c:879
+#: ../clients/cli/common.c:694
msgid "DCB or FCoE setup failed"
msgstr "Ustawienie DCB lub FCoE się nie powiodło"
-#: ../cli/src/common.c:882
+#: ../clients/cli/common.c:697
msgid "teamd control failed"
msgstr "kontrola teamd się nie powiodła"
-#: ../cli/src/common.c:885
+#: ../clients/cli/common.c:700
msgid "Modem failed or no longer available"
msgstr "Modem się nie powiódł lub nie jest już dostępny"
-#: ../cli/src/common.c:888
+#: ../clients/cli/common.c:703
msgid "Modem now ready and available"
msgstr "Modem jest teraz gotowy i dostępny"
-#: ../cli/src/common.c:891
+#: ../clients/cli/common.c:706
msgid "SIM PIN was incorrect"
msgstr "Kod PIN karty SIM był niepoprawny"
#. TRANSLATORS: Unknown reason for a device state change (NMDeviceStateReason)
-#: ../cli/src/common.c:895 ../cli/src/devices.c:639
-#: ../libnm-glib/nm-device.c:1837
+#: ../clients/cli/common.c:710 ../clients/cli/devices.c:619
+#: ../libnm-glib/nm-device.c:1813 ../libnm/nm-device.c:1635
msgid "Unknown"
msgstr "Nieznane"
-#: ../cli/src/common.c:937
+#: ../clients/cli/common.c:752
#, c-format
msgid "invalid priority map '%s'"
msgstr "nieprawidłowa mapa priorytetów \"%s\""
-#: ../cli/src/common.c:944 ../cli/src/common.c:950
+#: ../clients/cli/common.c:759 ../clients/cli/common.c:765
#, c-format
msgid "priority '%s' is not valid (<0-%ld>)"
msgstr "priorytet \"%s\" jest nieprawidłowy (<0-%ld>)"
-#: ../cli/src/common.c:1017
+#: ../clients/cli/common.c:832
#, c-format
msgid "'%s' is not a valid team configuration or file name."
msgstr "\"%s\" nie jest prawidłową konfiguracją zespołu lub nazwą pliku."
+#: ../clients/cli/common.c:933
+#, c-format
+msgid ""
+"Warning: password for '%s' not given in 'passwd-file' and nmcli cannot ask "
+"without '--ask' option.\n"
+msgstr ""
+"Ostrzeżenie: w \"passwd-file\" nie podano hasła dla \"%s\", a program nmcli "
+"nie może zapytać bez opcji \"--ask\".\n"
+
#. define some prompts for connection editor
-#: ../cli/src/connections.c:61
+#: ../clients/cli/connections.c:42
msgid "Setting name? "
msgstr "Nazwa ustawienia? "
-#: ../cli/src/connections.c:62
+#: ../clients/cli/connections.c:43
msgid "Property name? "
msgstr "Nazwa właściwości? "
-#: ../cli/src/connections.c:63
+#: ../clients/cli/connections.c:44
msgid "Enter connection type: "
msgstr "Proszę podać typ połączenia: "
#. define some other prompts
-#: ../cli/src/connections.c:66
+#: ../clients/cli/connections.c:47
msgid "Connection type: "
msgstr "Typ połączenia: "
-#: ../cli/src/connections.c:67
+#: ../clients/cli/connections.c:48
msgid "VPN type: "
msgstr "Typ VPN: "
-#: ../cli/src/connections.c:68
+#: ../clients/cli/connections.c:49
msgid "Bond master: "
msgstr "\"Master\" wiÄ…zania: "
-#: ../cli/src/connections.c:69
+#: ../clients/cli/connections.c:50
msgid "Team master: "
msgstr "\"Master\" zespołu: "
-#: ../cli/src/connections.c:70
+#: ../clients/cli/connections.c:51
msgid "Bridge master: "
msgstr "\"Master\" mostku: "
-#: ../cli/src/connections.c:71
+#: ../clients/cli/connections.c:52
msgid "Connection (name, UUID, or path): "
msgstr "Połączenie (nazwa, UUID lub ścieżka): "
#. 0
-#: ../cli/src/connections.c:79 ../cli/src/connections.c:191
-#: ../cli/src/devices.c:89 ../cli/src/devices.c:117 ../cli/src/devices.c:127
-#: ../cli/src/devices.c:137 ../cli/src/devices.c:146 ../cli/src/devices.c:161
-#: ../cli/src/devices.c:174 ../cli/src/devices.c:200 ../cli/src/devices.c:215
-#: ../cli/src/devices.c:224
+#: ../clients/cli/connections.c:60 ../clients/cli/connections.c:173
+#: ../clients/cli/devices.c:57 ../clients/cli/devices.c:86
+#: ../clients/cli/devices.c:96 ../clients/cli/devices.c:107
+#: ../clients/cli/devices.c:116 ../clients/cli/devices.c:131
+#: ../clients/cli/devices.c:144 ../clients/cli/devices.c:170
+#: ../clients/cli/devices.c:185 ../clients/cli/devices.c:194
+#: ../clients/cli/devices.c:204
msgid "NAME"
msgstr "NAZWA"
#. 0
#. 1
-#: ../cli/src/connections.c:80 ../cli/src/connections.c:192
+#: ../clients/cli/connections.c:61 ../clients/cli/connections.c:174
msgid "UUID"
msgstr "UUID"
@@ -507,176 +593,179 @@ msgstr "UUID"
#. 0
#. 1
#. 2
-#: ../cli/src/connections.c:81 ../cli/src/connections.c:213
-#: ../cli/src/devices.c:75 ../cli/src/devices.c:91 ../cli/src/devices.c:203
+#: ../clients/cli/connections.c:62 ../clients/cli/connections.c:195
+#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:59
+#: ../clients/cli/devices.c:173
msgid "TYPE"
msgstr "TYP"
#. 2
-#: ../cli/src/connections.c:82
+#: ../clients/cli/connections.c:63
msgid "TIMESTAMP"
msgstr "OKRES-CZASU"
#. 3
-#: ../cli/src/connections.c:83
+#: ../clients/cli/connections.c:64
msgid "TIMESTAMP-REAL"
msgstr "RZECZYWISTY-OKRES-CZASU"
#. 4
-#. 14
-#: ../cli/src/connections.c:84 ../cli/src/devices.c:104
+#. 15
+#: ../clients/cli/connections.c:65 ../clients/cli/devices.c:73
msgid "AUTOCONNECT"
msgstr "ÅÄ„CZENIE-AUTOMATYCZNE"
#. 5
-#: ../cli/src/connections.c:85
+#: ../clients/cli/connections.c:66
+msgid "AUTOCONNECT-PRIORITY"
+msgstr "PRIORYTET-AUTOMATYCZNEGO-ÅÄ„CZENIA"
+
+#. 6
+#: ../clients/cli/connections.c:67
msgid "READONLY"
msgstr "TYLKO-DO-ODCZYTU"
-#. 6
+#. 7
#. 8
#. 2
#. 15
#. 5
-#: ../cli/src/connections.c:86 ../cli/src/connections.c:199
-#: ../cli/src/devices.c:77 ../cli/src/devices.c:190 ../cli/src/devices.c:206
+#: ../clients/cli/connections.c:68 ../clients/cli/connections.c:181
+#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:160
+#: ../clients/cli/devices.c:176
msgid "DBUS-PATH"
msgstr "ŚCIEŻKA-DBUS"
-#. 7
+#. 8
#. 13
#. 4
-#: ../cli/src/connections.c:87 ../cli/src/devices.c:188
-#: ../cli/src/devices.c:205
+#: ../clients/cli/connections.c:69 ../clients/cli/devices.c:158
+#: ../clients/cli/devices.c:175
msgid "ACTIVE"
msgstr "AKTYWNOŚĆ"
-#. 8
+#. 9
#. 0
#. 12
#. 3
-#: ../cli/src/connections.c:88 ../cli/src/devices.c:74 ../cli/src/devices.c:90
-#: ../cli/src/devices.c:187 ../cli/src/devices.c:204
+#: ../clients/cli/connections.c:70 ../clients/cli/devices.c:42
+#: ../clients/cli/devices.c:58 ../clients/cli/devices.c:157
+#: ../clients/cli/devices.c:174
msgid "DEVICE"
msgstr "URZÄ„DZENIE"
-#. 9
+#. 10
#. 3
#. 1
#. 9
#. 1
-#: ../cli/src/connections.c:89 ../cli/src/connections.c:194
-#: ../cli/src/devices.c:76 ../cli/src/devices.c:99
-#: ../cli/src/network-manager.c:39
+#: ../clients/cli/connections.c:71 ../clients/cli/connections.c:176
+#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:67
+#: ../clients/cli/general.c:37
msgid "STATE"
msgstr "STAN"
-#. 10
-#: ../cli/src/connections.c:90
+#. 11
+#: ../clients/cli/connections.c:72
msgid "ACTIVE-PATH"
msgstr "AKTYWNA-ŚCIEŻKA"
#. 2
-#: ../cli/src/connections.c:193
+#: ../clients/cli/connections.c:175
msgid "DEVICES"
msgstr "URZÄ„DZENIA"
#. 4
-#: ../cli/src/connections.c:195
+#: ../clients/cli/connections.c:177
msgid "DEFAULT"
msgstr "DOMYÅšLNE"
#. 5
-#: ../cli/src/connections.c:196
+#: ../clients/cli/connections.c:178
msgid "DEFAULT6"
msgstr "DOMYÅšLNE6"
#. 6
-#: ../cli/src/connections.c:197
+#: ../clients/cli/connections.c:179
msgid "SPEC-OBJECT"
msgstr "KONKRETNY-OBIEKT"
#. 7
#. 4
#. Ask for optional 'vpn' arguments.
-#: ../cli/src/connections.c:198 ../cli/src/connections.c:236
-#: ../cli/src/connections.c:3508 ../tui/nm-editor-utils.c:243
-#: ../tui/nmt-connect-connection-list.c:405
+#: ../clients/cli/connections.c:180 ../clients/cli/connections.c:218
+#: ../clients/cli/connections.c:3816 ../clients/tui/nm-editor-utils.c:234
+#: ../clients/tui/nmt-connect-connection-list.c:406
msgid "VPN"
msgstr "VPN"
#. 9
#. 5
-#. 18
-#: ../cli/src/connections.c:200 ../cli/src/devices.c:80
-#: ../cli/src/devices.c:108
+#. 19
+#: ../clients/cli/connections.c:182 ../clients/cli/devices.c:48
+#: ../clients/cli/devices.c:77
msgid "CON-PATH"
msgstr "ÅšCIEÅ»KA-POÅÄ„CZENIA"
#. 10
-#: ../cli/src/connections.c:201
+#: ../clients/cli/connections.c:183
msgid "ZONE"
msgstr "STREFA"
#. 11
-#: ../cli/src/connections.c:202
+#: ../clients/cli/connections.c:184
msgid "MASTER-PATH"
msgstr "GÅÓWNA-ÅšCIEÅ»KA"
#. 1
-#: ../cli/src/connections.c:214
+#: ../clients/cli/connections.c:196
msgid "USERNAME"
msgstr "NAZWA-UŻYTKOWNIKA"
-#. 2
-#: ../cli/src/connections.c:215
-msgid "GATEWAY"
-msgstr "BRAMA"
-
#. 3
-#: ../cli/src/connections.c:216
+#: ../clients/cli/connections.c:198
msgid "BANNER"
msgstr "BANER"
#. 4
-#: ../cli/src/connections.c:217
+#: ../clients/cli/connections.c:199
msgid "VPN-STATE"
msgstr "STAN-VPN"
#. 5
-#: ../cli/src/connections.c:218
+#: ../clients/cli/connections.c:200
msgid "CFG"
msgstr "KONFIGURACJA"
-#: ../cli/src/connections.c:231 ../cli/src/devices.c:239
+#: ../clients/cli/connections.c:213 ../clients/cli/devices.c:219
msgid "GENERAL"
msgstr "OGÓLNE"
#. 0
#. 6
-#: ../cli/src/connections.c:232 ../cli/src/devices.c:246
+#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:226
msgid "IP4"
msgstr "IP4"
#. 1
#. 7
-#: ../cli/src/connections.c:233 ../cli/src/devices.c:247
+#: ../clients/cli/connections.c:215 ../clients/cli/devices.c:227
msgid "DHCP4"
msgstr "DHCP4"
#. 2
#. 8
-#: ../cli/src/connections.c:234 ../cli/src/devices.c:248
+#: ../clients/cli/connections.c:216 ../clients/cli/devices.c:228
msgid "IP6"
msgstr "IP6"
#. 3
#. 9
-#: ../cli/src/connections.c:235 ../cli/src/devices.c:249
+#: ../clients/cli/connections.c:217 ../clients/cli/devices.c:229
msgid "DHCP6"
msgstr "DHCP6"
-#: ../cli/src/connections.c:277
+#: ../clients/cli/connections.c:251
#, c-format
msgid ""
"Usage: nmcli connection { COMMAND | help }\n"
@@ -684,13 +773,15 @@ msgid ""
"COMMAND := { show | up | down | add | modify | edit | delete | reload | "
"load }\n"
"\n"
-" show [--active] [[id | uuid | path | apath] <ID>] ...\n"
+" show [--active] [[--show-secrets] [id | uuid | path | apath] <ID>] ...\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] "
+"[passwd-file <file with passwords>]\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file "
+"<file with passwords>]\n"
"\n"
-" down [id | uuid | path | apath] <ID>\n"
+" down [id | uuid | path | apath] <ID> ...\n"
"\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
"\n"
@@ -711,13 +802,14 @@ msgstr ""
" POLECENIE := { show | up | down | add | modify | edit | delete | reload | "
"load }\n"
"\n"
-" show [--active] [[id | uuid | path | apath] <identyfikator>] ...\n"
+" show [--active] [[--show-secrets] [[id | uuid | path | apath] "
+"<identyfikator>] ...\n"
"\n"
" up [id | uuid | path] <identyfikator> [ifname <nazwa-interfejsu>] [ap "
-"<BSSID>] [nsp <name>]\n"
+"<BSSID>] [nsp <name>] [passwd-file <plik z hasłami>]\n"
"\n"
" up [id | uuid | path] <identyfikator> [ifname <nazwa-interfejsu>] [ap "
-"<BSSID>]\n"
+"<BSSID>] [passwd-file <plik z hasłami>]\n"
"\n"
" down [id | uuid | path | apath] <identyfikator>\n"
"\n"
@@ -736,7 +828,7 @@ msgstr ""
" load <nazwa_pliku> [ <nazwa_pliku>... ]\n"
"\n"
-#: ../cli/src/connections.c:299
+#: ../clients/cli/connections.c:272
#, c-format
msgid ""
"Usage: nmcli connection show { ARGUMENTS | help }\n"
@@ -749,7 +841,8 @@ msgid ""
"profiles are listed. When --active option is specified, only the active\n"
"profiles are shown.\n"
"\n"
-"ARGUMENTS := [--active] [id | uuid | path | apath] <ID> ...\n"
+"ARGUMENTS := [--active] [--show-secrets] [id | uuid | path | apath] "
+"<ID> ...\n"
"\n"
"Show details for specified connections. By default, both static "
"configuration\n"
@@ -758,7 +851,7 @@ 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.\n"
+"account. --show-secrets option will reveal associated secrets as well.\n"
msgstr ""
"Użycie: nmcli connection show { PARAMETRY | help }\n"
"\n"
@@ -769,60 +862,65 @@ msgstr ""
"parametru wszystkie profile zostaną wyświetlone. Podanie opcji --active\n"
"spowoduje wyświetlenie tylko aktywnych profili.\n"
"\n"
-"PARAMETRY := [--active] [id | uuid | path | apath] <identyfikator>...\n"
+"PARAMETRY := [--active] [--show-secrets] [id | uuid | path | apath] "
+"<identyfikator>...\n"
"\n"
"Wyświetla szczegóły podanych połączeń. Domyślnie wyświetlane są dane\n"
"statycznej konfiguracji i aktywnego połączenia. Można filtrować wyjście\n"
"używając globalnej opcji \"--fields\". Na stronie podręcznika znajduje się\n"
"więcej informacji. Podanie opcji --active spowoduje uwzględnienie tylko\n"
-"aktywnych profili.\n"
+"aktywnych profili. Opcja --show-secrets ujawni także powiązane hasła.\n"
-#: ../cli/src/connections.c:321
+#: ../clients/cli/connections.c:293
#, c-format
msgid ""
"Usage: nmcli connection up { ARGUMENTS | help }\n"
"\n"
"ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
-"<name>]\n"
+"<name>] [passwd-file <file with passwords>]\n"
"\n"
"Activate a connection on a device. The profile to activate is identified by "
"its\n"
"name, UUID or D-Bus path.\n"
"\n"
-"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd-file <file "
+"with passwords>]\n"
"\n"
"Activate a device with a connection. The connection profile is selected\n"
"automatically by NetworkManager.\n"
"\n"
-"ifname - specifies the device to active the connection on\n"
-"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
-"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"ifname - specifies the device to active the connection on\n"
+"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"passwd-file - file with password(s) required to activate the connection\n"
"\n"
msgstr ""
"Użycie: nmcli connection up { PARAMETRY | help }\n"
"\n"
"PARAMETRY := [id | uuid | path] <identyfikator> [ifname <nazwa-interfejsu>] "
-"[ap <BSSID>] [nsp <nazwa>]\n"
+"[ap <BSSID>] [nsp <nazwa>] [passwd-file <plik z hasłami>]\n"
"\n"
"Aktywuje połączenie na urządzeniu. Profil do aktywowania jest\n"
"identyfikowany po swojej nazwie, UUID lub ścieżce D-Bus.\n"
"\n"
-"PARAMETRY := ifname <nazwa-interfejsu> [ap <BSSID>] [nsp <nazwa>]\n"
+"PARAMETRY := ifname <nazwa-interfejsu> [ap <BSSID>] [nsp <nazwa>] [passwd-"
+"file <plik z hasłami>]\n"
"\n"
"Aktywuje urządzenie z połączeniem. Profil połączenia jest wybierany\n"
"automatycznie przez usługę NetworkManager.\n"
"\n"
-"ifname - podaje urządzenie, na którym aktywować połączenie\n"
-"ap - podaje AP, z którym połączyć (prawidłowe tylko dla Wi-Fi)\n"
-"nsp - podaje NSP, z którym połączyć (prawidłowe tylko dla WiMAX)\n"
+"ifname - podaje urządzenie, na którym aktywować połączenie\n"
+"ap - podaje AP, z którym połączyć (prawidłowe tylko dla Wi-Fi)\n"
+"nsp - podaje NSP, z którym połączyć (prawidłowe tylko dla WiMAX)\n"
+"passwd-file - plik z hasłami wymaganymi do aktywowania połączenia\n"
"\n"
-#: ../cli/src/connections.c:342
+#: ../clients/cli/connections.c:314
#, c-format
msgid ""
"Usage: nmcli connection down { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+"ARGUMENTS := [id | uuid | path | apath] <ID> ...\n"
"\n"
"Deactivate a connection from a device (without preventing the device from\n"
"further auto-activation). The profile to deactivate is identified by its "
@@ -832,14 +930,14 @@ msgid ""
msgstr ""
"Użycie: nmcli connection down { PARAMETRY | help }\n"
"\n"
-"PARAMETRY := [id | uuid | path | apath] <identyfikator>\n"
+"PARAMETRY := [id | uuid | path | apath] <identyfikator> ...\n"
"\n"
"Deaktywuje połączenie z urządzenia (bez uniemożliwienia urządzeniu ponownej\n"
-" automatycznej aktywacji). Profil do deaktywowania jest identyfikowany po\n"
+"automatycznej aktywacji). Profil do deaktywowania jest identyfikowany po\n"
"swojej nazwie, UUID lub ścieżce D-Bus.\n"
"\n"
-#: ../cli/src/connections.c:355
+#: ../clients/cli/connections.c:326
#, c-format
msgid ""
"Usage: nmcli connection add { ARGUMENTS | help }\n"
@@ -863,6 +961,7 @@ msgid ""
" [mac <MAC address>]\n"
" [cloned-mac <cloned MAC address>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <MAC address>]\n"
" [nsp <NSP>]\n"
@@ -906,6 +1005,7 @@ msgid ""
" [updelay <num>]\n"
" [arp-interval <num>]\n"
" [arp-ip-target <num>]\n"
+" [lacp-rate slow (0) | fast (1)]\n"
"\n"
" bond-slave: master <master (ifname, or connection UUID or name)>\n"
"\n"
@@ -960,6 +1060,7 @@ msgstr ""
" [mac <adres MAC>]\n"
" [cloned-mac <sklonowany adres MAC>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <adres MAC>]\n"
" [nsp <NSP>]\n"
@@ -1004,6 +1105,7 @@ msgstr ""
" [updelay <numer>]\n"
" [arp-interval <numer>]\n"
" [arp-ip-target <numer>]\n"
+" [lacp-rate slow (0) | fast (1)]\n"
"\n"
" bond-slave: master <master (nazwa interfejsu, UUID połączenia lub "
"naza)>\n"
@@ -1039,7 +1141,7 @@ msgstr ""
" [ip4 <adres IPv4>] [gw4 <brama IPv4>]\n"
" [ip6 <adres IPv6>] [gw6 <brama IPv6>]\n"
-#: ../cli/src/connections.c:434
+#: ../clients/cli/connections.c:406
#, c-format
msgid ""
"Usage: nmcli connection modify { ARGUMENTS | help }\n"
@@ -1086,7 +1188,7 @@ msgstr ""
"nmcli con mod bond0 -bond.options downdelay\n"
"\n"
-#: ../cli/src/connections.c:458
+#: ../clients/cli/connections.c:429
#, c-format
msgid ""
"Usage: nmcli connection edit { ARGUMENTS | help }\n"
@@ -1114,7 +1216,7 @@ msgstr ""
"Dodaje nowy profil połączenia w interaktywnym edytorze.\n"
"\n"
-#: ../cli/src/connections.c:474
+#: ../clients/cli/connections.c:444
#, c-format
msgid ""
"Usage: nmcli connection delete { ARGUMENTS | help }\n"
@@ -1133,7 +1235,7 @@ msgstr ""
"Profil jest identyfikowany po swojej nazwie, UUID lub ścieżce D-Bus.\n"
"\n"
-#: ../cli/src/connections.c:486
+#: ../clients/cli/connections.c:455
#, c-format
msgid ""
"Usage: nmcli connection reload { help }\n"
@@ -1146,7 +1248,7 @@ msgstr ""
"Wczytuje ponownie wszystkie pliki połączeń z dysku.\n"
"\n"
-#: ../cli/src/connections.c:495
+#: ../clients/cli/connections.c:463
#, c-format
msgid ""
"Usage: nmcli connection load { ARGUMENTS | help }\n"
@@ -1168,232 +1270,225 @@ msgstr ""
"usługa NetworkManager zna jego najnowszy stan.\n"
"\n"
-#: ../cli/src/connections.c:553
+#: ../clients/cli/connections.c:534
msgid "activating"
msgstr "aktywowanie"
-#: ../cli/src/connections.c:555
+#: ../clients/cli/connections.c:536
msgid "activated"
msgstr "aktywowano"
-#: ../cli/src/connections.c:559
+#: ../clients/cli/connections.c:540
msgid "deactivated"
msgstr "deaktywowano"
-#: ../cli/src/connections.c:571
+#: ../clients/cli/connections.c:552
msgid "VPN connecting (prepare)"
msgstr "ÅÄ…czenie z VPN (przygotowanie)"
-#: ../cli/src/connections.c:573
+#: ../clients/cli/connections.c:554
msgid "VPN connecting (need authentication)"
msgstr "ÅÄ…czenie z VPN (wymaga uwierzytelnienia)"
-#: ../cli/src/connections.c:575
+#: ../clients/cli/connections.c:556
msgid "VPN connecting"
msgstr "ÅÄ…czenie z VPN"
-#: ../cli/src/connections.c:577
+#: ../clients/cli/connections.c:558
msgid "VPN connecting (getting IP configuration)"
msgstr "ÅÄ…czenie z VPN (pobieranie konfiguracji adresu IP)"
-#: ../cli/src/connections.c:579
+#: ../clients/cli/connections.c:560
msgid "VPN connected"
msgstr "Połączono z VPN"
-#: ../cli/src/connections.c:581
+#: ../clients/cli/connections.c:562
msgid "VPN connection failed"
msgstr "Połączenie z VPN się nie powiodło"
-#: ../cli/src/connections.c:583
+#: ../clients/cli/connections.c:564
msgid "VPN disconnected"
msgstr "Rozłączono z VPN"
-#: ../cli/src/connections.c:666
+#: ../clients/cli/connections.c:634
+#, c-format
+msgid "Error updating secrets for %s: %s\n"
+msgstr "Błąd podczas aktualizowania haseł dla %s: %s\n"
+
+#: ../clients/cli/connections.c:654
msgid "Connection profile details"
msgstr "Szczegóły profilu połączenia"
-#: ../cli/src/connections.c:678 ../cli/src/connections.c:1030
+#: ../clients/cli/connections.c:666 ../clients/cli/connections.c:1075
#, c-format
msgid "Error: 'connection show': %s"
msgstr "BÅ‚Ä…d: \"connection show\": %s"
-#: ../cli/src/connections.c:822
+#: ../clients/cli/connections.c:812
msgid "never"
msgstr "nigdy"
#. "CAPABILITIES"
-#: ../cli/src/connections.c:823 ../cli/src/connections.c:824
-#: ../cli/src/connections.c:826 ../cli/src/connections.c:885
-#: ../cli/src/connections.c:886 ../cli/src/connections.c:888
-#: ../cli/src/connections.c:2844 ../cli/src/connections.c:6575
-#: ../cli/src/connections.c:6576 ../cli/src/devices.c:609
-#: ../cli/src/devices.c:659 ../cli/src/devices.c:801 ../cli/src/devices.c:802
-#: ../cli/src/devices.c:803 ../cli/src/devices.c:836 ../cli/src/devices.c:865
-#: ../cli/src/devices.c:866 ../cli/src/devices.c:867 ../cli/src/devices.c:868
-#: ../cli/src/devices.c:869 ../cli/src/devices.c:870 ../cli/src/devices.c:871
-#: ../cli/src/network-manager.c:442
+#: ../clients/cli/connections.c:813 ../clients/cli/connections.c:815
+#: ../clients/cli/connections.c:817 ../clients/cli/connections.c:849
+#: ../clients/cli/connections.c:916 ../clients/cli/connections.c:917
+#: ../clients/cli/connections.c:919 ../clients/cli/connections.c:3111
+#: ../clients/cli/connections.c:6949 ../clients/cli/connections.c:6950
+#: ../clients/cli/devices.c:589 ../clients/cli/devices.c:639
+#: ../clients/cli/devices.c:846 ../clients/cli/devices.c:847
+#: ../clients/cli/devices.c:848 ../clients/cli/devices.c:849
+#: ../clients/cli/devices.c:882 ../clients/cli/devices.c:884
+#: ../clients/cli/devices.c:912 ../clients/cli/devices.c:913
+#: ../clients/cli/devices.c:914 ../clients/cli/devices.c:915
+#: ../clients/cli/devices.c:916 ../clients/cli/devices.c:917
+#: ../clients/cli/devices.c:918 ../clients/cli/general.c:421
msgid "yes"
msgstr "tak"
-#: ../cli/src/connections.c:823 ../cli/src/connections.c:824
-#: ../cli/src/connections.c:826 ../cli/src/connections.c:885
-#: ../cli/src/connections.c:886 ../cli/src/connections.c:888
-#: ../cli/src/connections.c:2845 ../cli/src/connections.c:6575
-#: ../cli/src/connections.c:6576 ../cli/src/devices.c:609
-#: ../cli/src/devices.c:659 ../cli/src/devices.c:801 ../cli/src/devices.c:802
-#: ../cli/src/devices.c:803 ../cli/src/devices.c:836 ../cli/src/devices.c:865
-#: ../cli/src/devices.c:866 ../cli/src/devices.c:867 ../cli/src/devices.c:868
-#: ../cli/src/devices.c:869 ../cli/src/devices.c:870 ../cli/src/devices.c:871
-#: ../cli/src/network-manager.c:444
+#: ../clients/cli/connections.c:813 ../clients/cli/connections.c:815
+#: ../clients/cli/connections.c:817 ../clients/cli/connections.c:916
+#: ../clients/cli/connections.c:917 ../clients/cli/connections.c:919
+#: ../clients/cli/connections.c:3112 ../clients/cli/connections.c:6949
+#: ../clients/cli/connections.c:6950 ../clients/cli/devices.c:589
+#: ../clients/cli/devices.c:639 ../clients/cli/devices.c:846
+#: ../clients/cli/devices.c:847 ../clients/cli/devices.c:848
+#: ../clients/cli/devices.c:849 ../clients/cli/devices.c:882
+#: ../clients/cli/devices.c:884 ../clients/cli/devices.c:912
+#: ../clients/cli/devices.c:913 ../clients/cli/devices.c:914
+#: ../clients/cli/devices.c:915 ../clients/cli/devices.c:916
+#: ../clients/cli/devices.c:917 ../clients/cli/devices.c:918
+#: ../clients/cli/general.c:423
msgid "no"
msgstr "nie"
-#: ../cli/src/connections.c:881 ../cli/src/connections.c:891
-#: ../cli/src/devices.c:599
-msgid "N/A"
-msgstr "Nie dotyczy"
-
-#: ../cli/src/connections.c:1018
+#: ../clients/cli/connections.c:1063
msgid "Activate connection details"
msgstr "Szczegóły aktywowania połączenia"
-#: ../cli/src/connections.c:1251
+#: ../clients/cli/connections.c:1299
#, c-format
msgid "invalid field '%s'; allowed fields: %s and %s, or %s,%s"
msgstr "nieprawidłowe pole \"%s\"; dozwolone pola: %s i %s, albo %s,%s"
-#: ../cli/src/connections.c:1266 ../cli/src/connections.c:1274
+#: ../clients/cli/connections.c:1314 ../clients/cli/connections.c:1322
#, c-format
msgid "'%s' has to be alone"
msgstr "\"%s\" musi być same"
-#: ../cli/src/connections.c:1305 ../cli/src/connections.c:2043
-#: ../cli/src/connections.c:2103 ../cli/src/connections.c:8075
-#: ../cli/src/connections.c:8283 ../cli/src/connections.c:8376
-#: ../cli/src/connections.c:8404 ../cli/src/devices.c:1202
-#: ../cli/src/devices.c:1250 ../cli/src/devices.c:1413
-#: ../cli/src/devices.c:1547 ../cli/src/devices.c:1684
-#: ../cli/src/devices.c:2128 ../cli/src/devices.c:2427
-#: ../cli/src/network-manager.c:484
-#, c-format
-msgid "Error: NetworkManager is not running."
-msgstr "Błąd: usługa NetworkManager nie jest uruchomiona."
-
#. Add headers
-#: ../cli/src/connections.c:1335
+#: ../clients/cli/connections.c:1377
msgid "NetworkManager active profiles"
msgstr "Aktywne profile usługi NetworkManager"
-#: ../cli/src/connections.c:1336
+#: ../clients/cli/connections.c:1378
msgid "NetworkManager connection profiles"
msgstr "Profile połączeń usługi NetworkManager"
-#: ../cli/src/connections.c:1373 ../cli/src/connections.c:1988
-#: ../cli/src/connections.c:2004 ../cli/src/connections.c:2013
-#: ../cli/src/connections.c:2023 ../cli/src/connections.c:2120
-#: ../cli/src/connections.c:8091 ../cli/src/connections.c:8314
-#: ../cli/src/devices.c:1642 ../cli/src/devices.c:1650
-#: ../cli/src/devices.c:2041 ../cli/src/devices.c:2048
-#: ../cli/src/devices.c:2062 ../cli/src/devices.c:2069
-#: ../cli/src/devices.c:2086 ../cli/src/devices.c:2094
-#: ../cli/src/devices.c:2290 ../cli/src/devices.c:2386
-#: ../cli/src/devices.c:2393
+#: ../clients/cli/connections.c:1418 ../clients/cli/connections.c:2145
+#: ../clients/cli/connections.c:2167 ../clients/cli/connections.c:2176
+#: ../clients/cli/connections.c:2186 ../clients/cli/connections.c:2196
+#: ../clients/cli/connections.c:2346 ../clients/cli/connections.c:8499
+#: ../clients/cli/connections.c:8716 ../clients/cli/devices.c:1909
+#: ../clients/cli/devices.c:1917 ../clients/cli/devices.c:2233
+#: ../clients/cli/devices.c:2240 ../clients/cli/devices.c:2254
+#: ../clients/cli/devices.c:2261 ../clients/cli/devices.c:2278
+#: ../clients/cli/devices.c:2286 ../clients/cli/devices.c:2474
+#: ../clients/cli/devices.c:2570 ../clients/cli/devices.c:2577
#, c-format
msgid "Error: %s argument is missing."
msgstr "BÅ‚Ä…d: brak parametru %s."
-#: ../cli/src/connections.c:1424
+#: ../clients/cli/connections.c:1433
#, c-format
msgid "Error: %s - no such connection profile."
msgstr "Błąd: %s - nie ma takiego profilu połączenia."
-#: ../cli/src/connections.c:1440 ../cli/src/connections.c:2056
-#: ../cli/src/connections.c:8382 ../cli/src/connections.c:8423
-#: ../cli/src/connections.c:8628 ../cli/src/devices.c:2269
-#: ../cli/src/devices.c:2714 ../cli/src/network-manager.c:539
-#: ../cli/src/network-manager.c:582 ../cli/src/network-manager.c:599
-#: ../cli/src/network-manager.c:645 ../cli/src/network-manager.c:659
-#: ../cli/src/network-manager.c:776 ../cli/src/network-manager.c:820
-#: ../cli/src/network-manager.c:840
+#: ../clients/cli/connections.c:1492 ../clients/cli/connections.c:2219
+#: ../clients/cli/connections.c:9016 ../clients/cli/devices.c:2453
+#: ../clients/cli/devices.c:2921 ../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
#, c-format
msgid "Error: %s."
msgstr "BÅ‚Ä…d: %s."
-#: ../cli/src/connections.c:1535
+#: ../clients/cli/connections.c:1587
#, c-format
msgid "no active connection on device '%s'"
msgstr "brak aktywnych połączeń na urządzeniu \"%s\""
-#: ../cli/src/connections.c:1543
+#: ../clients/cli/connections.c:1595
msgid "no active connection or device"
msgstr "brak aktywnych połączeń na urządzeń"
-#: ../cli/src/connections.c:1614
+#: ../clients/cli/connections.c:1666
#, c-format
msgid "device '%s' not compatible with connection '%s'"
msgstr "urządzenie \"%s\" nie jest zgodne z połączeniem \"%s\""
-#: ../cli/src/connections.c:1617
+#: ../clients/cli/connections.c:1669
#, c-format
msgid "no device found for connection '%s'"
msgstr "nie odnaleziono urządzenia dla połączenia \"%s\""
-#: ../cli/src/connections.c:1629
+#: ../clients/cli/connections.c:1681
msgid "unknown reason"
msgstr "nieznany powód"
-#: ../cli/src/connections.c:1631 ../cli/src/network-manager.c:288
+#: ../clients/cli/connections.c:1683 ../clients/cli/general.c:272
msgid "none"
msgstr "brak"
-#: ../cli/src/connections.c:1633
+#: ../clients/cli/connections.c:1685
msgid "the user was disconnected"
msgstr "użytkownik został rozłączony"
-#: ../cli/src/connections.c:1635
+#: ../clients/cli/connections.c:1687
msgid "the base network connection was interrupted"
msgstr "podstawowe połączenie sieciowe zostało przerwane"
-#: ../cli/src/connections.c:1637
+#: ../clients/cli/connections.c:1689
msgid "the VPN service stopped unexpectedly"
msgstr "usługa VPN została nieoczekiwanie zatrzymana"
-#: ../cli/src/connections.c:1639
+#: ../clients/cli/connections.c:1691
msgid "the VPN service returned invalid configuration"
msgstr "usługa VPN zwróciła nieprawidłową konfigurację"
-#: ../cli/src/connections.c:1641
+#: ../clients/cli/connections.c:1693
msgid "the connection attempt timed out"
msgstr "próba połączenia przekroczyła czas oczekiwania"
-#: ../cli/src/connections.c:1643
+#: ../clients/cli/connections.c:1695
msgid "the VPN service did not start in time"
msgstr "usługa VPN nie została uruchomiona w czasie"
-#: ../cli/src/connections.c:1645
+#: ../clients/cli/connections.c:1697
msgid "the VPN service failed to start"
msgstr "uruchomienie usługi VPN się nie powiodło"
-#: ../cli/src/connections.c:1647
+#: ../clients/cli/connections.c:1699
msgid "no valid VPN secrets"
msgstr "brak prawidłowych haseł VPN"
-#: ../cli/src/connections.c:1649
+#: ../clients/cli/connections.c:1701
msgid "invalid VPN secrets"
msgstr "nieprawidłowe hasła VPN"
-#: ../cli/src/connections.c:1651
+#: ../clients/cli/connections.c:1703
msgid "the connection was removed"
msgstr "połączenie zostało usunięte"
-#: ../cli/src/connections.c:1673 ../cli/src/connections.c:1701
-#: ../cli/src/connections.c:1846 ../cli/src/connections.c:6471
+#: ../clients/cli/connections.c:1725 ../clients/cli/connections.c:1753
+#: ../clients/cli/connections.c:1914 ../clients/cli/connections.c:6840
#, c-format
msgid "Connection successfully activated (D-Bus active path: %s)\n"
msgstr ""
"Połączenie zostało pomyślnie aktywowane (ścieżka aktywacji D-Bus: %s)\n"
-#: ../cli/src/connections.c:1680
+#: ../clients/cli/connections.c:1732
#, c-format
msgid ""
"Connection successfully activated (master waiting for slaves) (D-Bus active "
@@ -1402,129 +1497,176 @@ msgstr ""
"Połączenie zostało pomyślnie aktywowane (główne oczekujące na podrzędne) "
"(ścieżka aktywacji D-Bus: %s)\n"
-#: ../cli/src/connections.c:1684 ../cli/src/connections.c:1706
+#: ../clients/cli/connections.c:1736 ../clients/cli/connections.c:1758
#, c-format
msgid "Error: Connection activation failed."
msgstr "Błąd: aktywacja połączenia się nie powiodła."
-#: ../cli/src/connections.c:1749
+#: ../clients/cli/connections.c:1809
#, c-format
msgid "VPN connection successfully activated (D-Bus active path: %s)\n"
msgstr ""
"Połączenie VPN zostało pomyślnie aktywowane (ścieżka aktywacji D-Bus: %s)\n"
-#: ../cli/src/connections.c:1756
+#: ../clients/cli/connections.c:1817
#, c-format
msgid "Error: Connection activation failed: %s."
msgstr "Błąd: aktywacja połączenia się nie powiodła: %s."
-#: ../cli/src/connections.c:1774 ../cli/src/devices.c:1299
+#: ../clients/cli/connections.c:1836 ../clients/cli/devices.c:1322
#, c-format
msgid "Error: Timeout %d sec expired."
msgstr "BÅ‚Ä…d: przekroczono czas oczekiwania o %d sekund."
-#: ../cli/src/connections.c:1830
+#: ../clients/cli/connections.c:1896
#, c-format
msgid "Error: Connection activation failed: %s"
msgstr "Błąd: aktywacja połączenia się nie powiodła: %s"
-#: ../cli/src/connections.c:1927 ../cli/src/connections.c:2057
+#: ../clients/cli/connections.c:1981
+#, c-format
+msgid "failed to read passwd-file '%s': %s"
+msgstr "odczytanie passwd-file \"%s\" się nie powiodło: %s"
+
+#: ../clients/cli/connections.c:1993
+#, c-format
+msgid "missing colon in 'password' entry '%s'"
+msgstr "brak dwukropka we wpisie \"password\" \"%s\""
+
+#: ../clients/cli/connections.c:2001
+#, c-format
+msgid "missing dot in 'password' entry '%s'"
+msgstr "brak kropki we wpisie \"password\" \"%s\""
+
+#: ../clients/cli/connections.c:2014
+#, c-format
+msgid "invalid setting name in 'password' entry '%s'"
+msgstr "nieprawidłowa nazwa ustawienia we wpisie \"password\" \"%s\""
+
+#: ../clients/cli/connections.c:2061 ../clients/cli/connections.c:2220
msgid "unknown error"
msgstr "nieznany błąd"
-#: ../cli/src/connections.c:1935
+#: ../clients/cli/connections.c:2070
#, c-format
msgid "unknown device '%s'."
msgstr "nieznane urzÄ…dzenie \"%s\"."
-#: ../cli/src/connections.c:1940
+#: ../clients/cli/connections.c:2075
msgid "neither a valid connection nor device given"
msgstr "nie podano prawidłowego połączenia ani urządzenia"
-#: ../cli/src/connections.c:2032 ../cli/src/devices.c:1176
-#: ../cli/src/devices.c:1656 ../cli/src/devices.c:2105
-#: ../cli/src/devices.c:2399
+#: ../clients/cli/connections.c:2158
+#, c-format
+msgid "Error: Connection '%s' does not exist."
+msgstr "Błąd: połączenie \"%s\" nie istnieje."
+
+#: ../clients/cli/connections.c:2204 ../clients/cli/devices.c:1221
+#: ../clients/cli/devices.c:1923 ../clients/cli/devices.c:2297
+#: ../clients/cli/devices.c:2583
#, c-format
msgid "Unknown parameter: %s\n"
msgstr "Nieznany parametr: %s\n"
-#: ../cli/src/connections.c:2065
+#: ../clients/cli/connections.c:2228
msgid "preparing"
msgstr "przygotowywanie"
-#: ../cli/src/connections.c:2093 ../cli/src/connections.c:8295
-#: ../cli/src/connections.c:8410
+#: ../clients/cli/connections.c:2267
+#, c-format
+msgid "Connection '%s' successfully deactivated (D-Bus active path: %s)\n"
+msgstr ""
+"Połączenie \"%s\" zostało pomyślnie deaktywowane (ścieżka aktywacji D-Bus: "
+"%s)\n"
+
+#: ../clients/cli/connections.c:2325 ../clients/cli/connections.c:8697
+#: ../clients/cli/connections.c:8811
#, c-format
msgid "Error: No connection specified."
msgstr "Błąd: nie podano połączenia."
-#: ../cli/src/connections.c:2130
+#: ../clients/cli/connections.c:2356
+#, c-format
+msgid "Error: '%s' is not an active connection.\n"
+msgstr "Błąd: \"%s\" nie jest aktywnym połączeniem.\n"
+
+#: ../clients/cli/connections.c:2357
#, c-format
-msgid "Error: '%s' is not an active connection."
-msgstr "Błąd: \"%s\" nie jest aktywnym połączeniem."
+msgid "Error: not all active connections found."
+msgstr "Błąd: nie odnaleziono wszystkich aktywnych połączeń."
-#: ../cli/src/connections.c:2431 ../cli/src/utils.c:515
+#: ../clients/cli/connections.c:2366
+#, c-format
+msgid "Error: no active connection provided."
+msgstr "Błąd: nie podano aktywnego połączenia."
+
+#: ../clients/cli/connections.c:2684 ../clients/cli/utils.c:516
#, c-format
msgid "'%s' not among [%s]"
msgstr "\"%s\" nie jest w [%s]"
-#: ../cli/src/connections.c:2513
+#: ../clients/cli/connections.c:2763
#, c-format
msgid "Error: '%s': '%s' is not a valid %s MAC address."
msgstr "Błąd: \"%s\": \"%s\" nie jest prawidłowym adresem MAC %s."
#. Ask for optional arguments
-#: ../cli/src/connections.c:2514 ../cli/src/connections.c:2960
-#: ../libnm-glib/nm-device.c:1825 ../tui/nm-editor-utils.c:173
+#: ../clients/cli/connections.c:2764 ../clients/cli/connections.c:3226
+#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1573
+#: ../libnm-glib/nm-device.c:1801 ../libnm/nm-device.c:1623
msgid "InfiniBand"
msgstr "InfiniBand"
-#: ../cli/src/connections.c:2514 ../libnm-glib/nm-device.c:1813
-#: ../tui/nm-editor-utils.c:156
+#: ../clients/cli/connections.c:2764 ../clients/tui/nm-editor-utils.c:147
+#: ../libnm-glib/nm-device.c:1789 ../libnm/nm-device.c:1611
msgid "Ethernet"
msgstr "Ethernet"
-#: ../cli/src/connections.c:2540
+#: ../clients/cli/connections.c:2784
#, c-format
msgid "Error: 'mtu': '%s' is not a valid MTU."
msgstr "Błąd: \"mtu\": \"%s\" nie jest prawidłowym MTU."
-#: ../cli/src/connections.c:2556
+#: ../clients/cli/connections.c:2800
#, c-format
msgid "Error: 'parent': '%s' is not a valid interface name."
msgstr "Błąd: \"parent\": \"%s\" nie jest prawidłową nazwą interfejsu."
-#: ../cli/src/connections.c:2577
+#: ../clients/cli/connections.c:2821
#, c-format
msgid "Error: 'p-key': '%s' is not a valid InfiniBand P_KEY."
msgstr "Błąd: \"p-key\": \"%s\" nie jest prawidłowym P_KEY InfiniBand."
-#: ../cli/src/connections.c:2606
+#: ../clients/cli/connections.c:2866
#, c-format
-msgid ""
-"Error: 'mode': '%s' is not a valid InfiniBand transport mode [datagram, "
-"connected]."
-msgstr ""
-"Błąd: \"mode\": \"%s\" nie jest prawidłowym trybem transportu InfiniBand "
-"[datagram, connected]."
+msgid "Error: '%s': '%s' is not a valid %s %s."
+msgstr "Błąd: \"%s\": \"%s\" nie jest prawidłowym %s %s."
+
+#: ../clients/cli/connections.c:2879
+msgid "Wi-Fi mode"
+msgstr "Tryb Wi-Fi"
-#: ../cli/src/connections.c:2620
+#: ../clients/cli/connections.c:2888
+msgid "InfiniBand transport mode"
+msgstr "Tryb przesyłania InfiniBand"
+
+#: ../clients/cli/connections.c:2901
#, c-format
msgid "Error: 'flags': '%s' is not valid; use <0-7>."
msgstr "Błąd: \"flags\": \"%s\" jest nieprawidłowe; należy użyć <0-7>."
-#: ../cli/src/connections.c:2642
+#: ../clients/cli/connections.c:2923
#, c-format
msgid "Error: '%s': '%s' is not valid; %s "
msgstr "Błąd: \"%s\": \"%s\" jest nieprawidłowe; %s "
-#: ../cli/src/connections.c:2835
+#: ../clients/cli/connections.c:3102
#, c-format
msgid "Error: '%s': '%s' is not valid; use <%u-%u>."
msgstr "Błąd: \"%s\": \"%s\" jest nieprawidłowe; należy użyć <%u-%u>."
#. Ask for optional arguments.
-#: ../cli/src/connections.c:2891
+#: ../clients/cli/connections.c:3158
#, 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"
@@ -1532,7 +1674,7 @@ msgstr[0] "Istnieje %d opcjonalny parametr dla typu połączenia \"%s\".\n"
msgstr[1] "Istnieją %d opcjonalne parametry dla typu połączenia \"%s\".\n"
msgstr[2] "Istnieje %d opcjonalnych parametrów dla typu połączenia \"%s\".\n"
-#: ../cli/src/connections.c:2894
+#: ../clients/cli/connections.c:3161
#, c-format
msgid "Do you want to provide it? %s"
msgid_plural "Do you want to provide them? %s"
@@ -1540,436 +1682,469 @@ msgstr[0] "Podać go? %s"
msgstr[1] "Podać je? %s"
msgstr[2] "Podać je? %s"
-#: ../cli/src/connections.c:2909
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3178
msgid "ethernet"
msgstr "ethernet"
-#: ../cli/src/connections.c:2909 ../libnm-glib/nm-device.c:1815
-#: ../tui/nm-editor-utils.c:164
-msgid "Wi-Fi"
-msgstr "Wi-Fi"
-
-#: ../cli/src/connections.c:2917 ../cli/src/connections.c:2965
-#: ../cli/src/connections.c:3074 ../cli/src/connections.c:3153
+#: ../clients/cli/connections.c:3183 ../clients/cli/connections.c:3231
+#: ../clients/cli/connections.c:3365 ../clients/cli/connections.c:3444
msgid "MTU [auto]: "
msgstr "MTU [auto]: "
-#: ../cli/src/connections.c:2928 ../cli/src/connections.c:2976
-#: ../cli/src/connections.c:3046 ../cli/src/connections.c:3085
-#: ../cli/src/connections.c:3440
+#: ../clients/cli/connections.c:3194 ../clients/cli/connections.c:3242
+#: ../clients/cli/connections.c:3337 ../clients/cli/connections.c:3376
+#: ../clients/cli/connections.c:3748
msgid "MAC [none]: "
msgstr "MAC [none]: "
-#: ../cli/src/connections.c:2939
+#: ../clients/cli/connections.c:3205
msgid "Cloned MAC [none]: "
msgstr "Sklonowany MAC [none]: "
-#: ../cli/src/connections.c:2987
+#: ../clients/cli/connections.c:3253
#, c-format
msgid "Transport mode %s"
msgstr "Tryb przesyłania %s"
-#: ../cli/src/connections.c:3000
+#: ../clients/cli/connections.c:3266
msgid "Parent interface [none]: "
msgstr "Interfejs nadrzędny [none]: "
-#: ../cli/src/connections.c:3011
+#: ../clients/cli/connections.c:3277
msgid "P_KEY [none]: "
msgstr "P_KEY [none]: "
-#: ../cli/src/connections.c:3021
+#: ../clients/cli/connections.c:3287
#, c-format
msgid "Error: 'p-key' is mandatory when 'parent' is specified.\n"
msgstr "BÅ‚Ä…d: \"p-key\" jest wymagane, kiedy podano \"parent\".\n"
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3304 ../clients/tui/nm-editor-utils.c:155
+#: ../libnm-glib/nm-device.c:1791 ../libnm/nm-device.c:1613
+msgid "Wi-Fi"
+msgstr "Wi-Fi"
+
+#: ../clients/cli/connections.c:3312
+#, c-format
+msgid "Mode %s"
+msgstr "Tryb %s"
+
#. Ask for optional 'wimax' arguments.
-#: ../cli/src/connections.c:3041 ../libnm-glib/nm-device.c:1821
+#: ../clients/cli/connections.c:3332 ../libnm-glib/nm-device.c:1797
+#: ../libnm/nm-device.c:1619
msgid "WiMAX"
msgstr "WiMAX"
#. Ask for optional 'pppoe' arguments.
-#: ../cli/src/connections.c:3064
+#: ../clients/cli/connections.c:3355
msgid "PPPoE"
msgstr "PPPoE"
-#: ../cli/src/connections.c:3068 ../cli/src/connections.c:3106
+#: ../clients/cli/connections.c:3359 ../clients/cli/connections.c:3397
msgid "Password [none]: "
msgstr "Hasło [none]: "
-#: ../cli/src/connections.c:3070
+#: ../clients/cli/connections.c:3361
msgid "Service [none]: "
msgstr "Usługa [none]: "
#. Ask for optional 'gsm' or 'cdma' arguments.
-#: ../cli/src/connections.c:3100
+#: ../clients/cli/connections.c:3391
msgid "mobile broadband"
msgstr "komórkowe"
-#: ../cli/src/connections.c:3104 ../cli/src/connections.c:3512
+#: ../clients/cli/connections.c:3395 ../clients/cli/connections.c:3820
msgid "Username [none]: "
msgstr "Nazwa użytkownika [none]: "
#. Ask for optional 'bluetooth' arguments.
-#: ../cli/src/connections.c:3119
+#: ../clients/cli/connections.c:3410
msgid "bluetooth"
msgstr "bluetooth"
-#: ../cli/src/connections.c:3126
+#: ../clients/cli/connections.c:3417
#, c-format
msgid "Bluetooth type %s"
msgstr "Typ Bluetooth %s"
-#: ../cli/src/connections.c:3132
+#: ../clients/cli/connections.c:3423
#, c-format
msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n"
msgstr "Błąd: \"bt-type\": \"%s\" nie jest prawidłowym typem Bluetooth.\n"
#. Ask for optional 'vlan' arguments.
-#. 11
-#: ../cli/src/connections.c:3148 ../cli/src/devices.c:251
-#: ../libnm-glib/nm-device.c:1833 ../libnm-util/nm-connection.c:1303
-#: ../tui/nm-editor-utils.c:227 ../tui/nmt-page-vlan.c:53
+#. 13
+#: ../clients/cli/connections.c:3439 ../clients/cli/devices.c:233
+#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:97
+#: ../libnm-core/nm-connection.c:1571 ../libnm-glib/nm-device.c:1809
+#: ../libnm-util/nm-connection.c:1614 ../libnm/nm-device.c:1631
msgid "VLAN"
msgstr "VLAN"
-#: ../cli/src/connections.c:3164
+#: ../clients/cli/connections.c:3455
msgid "VLAN flags (<0-7>) [none]: "
msgstr "Flagi VLAN= (<0-7>) [none]: "
-#: ../cli/src/connections.c:3175
+#: ../clients/cli/connections.c:3466
msgid "Ingress priority maps [none]: "
msgstr "Wejściowe mapy priorytetów [none]: "
-#: ../cli/src/connections.c:3186
+#: ../clients/cli/connections.c:3477
msgid "Egress priority maps [none]: "
msgstr "Wyjściowe mapy priorytetów [none]: "
-#: ../cli/src/connections.c:3197
+#: ../clients/cli/connections.c:3488
msgid "Bonding mode [balance-rr]: "
msgstr "Tryb wiÄ…zania [balance-rr]: "
#. Ask for optional 'bond' arguments.
-#: ../cli/src/connections.c:3212
+#: ../clients/cli/connections.c:3504
msgid "bond"
msgstr "wiÄ…zanie"
-#: ../cli/src/connections.c:3234
+#: ../clients/cli/connections.c:3526
msgid "Bonding primary interface [none]: "
msgstr "Interfejs nadrzędny wiązania [none]: "
-#: ../cli/src/connections.c:3237
+#: ../clients/cli/connections.c:3529
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name.\n"
msgstr "Błąd: \"primary\": \"%s\" nie jest prawidłową nazwą interfejsu.\n"
-#: ../cli/src/connections.c:3245
+#: ../clients/cli/connections.c:3537
#, c-format
msgid "Bonding monitoring mode %s"
msgstr "Tryb monitorowania wiÄ…zania %s"
-#: ../cli/src/connections.c:3251
+#: ../clients/cli/connections.c:3543
#, c-format
msgid "Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n"
msgstr ""
"Błąd: \"%s\" nie jest prawidłowym trybem monitorowania; należy użyć \"%s\" "
"lub \"%s\".\n"
-#: ../cli/src/connections.c:3260
+#: ../clients/cli/connections.c:3552
msgid "Bonding miimon [100]: "
msgstr "miimon wiÄ…zania [100]: "
-#: ../cli/src/connections.c:3263
+#: ../clients/cli/connections.c:3555
#, c-format
msgid "Error: 'miimon': '%s' is not a valid number <0-%u>.\n"
msgstr "Błąd: \"miimon\": \"%s\" nie jest prawidłową liczbą <0-%u>.\n"
-#: ../cli/src/connections.c:3271
+#: ../clients/cli/connections.c:3563
msgid "Bonding downdelay [0]: "
msgstr "downdelay wiÄ…zania [0]: "
-#: ../cli/src/connections.c:3274
+#: ../clients/cli/connections.c:3566
#, c-format
msgid "Error: 'downdelay': '%s' is not a valid number <0-%u>.\n"
msgstr "Błąd: \"downdelay\": \"%s\" nie jest prawidłową liczbą <0-%u>.\n"
-#: ../cli/src/connections.c:3282
+#: ../clients/cli/connections.c:3574
msgid "Bonding updelay [0]: "
msgstr "updelay wiÄ…zania [0]: "
-#: ../cli/src/connections.c:3285
+#: ../clients/cli/connections.c:3577
#, c-format
msgid "Error: 'updelay': '%s' is not a valid number <0-%u>.\n"
msgstr "Błąd: \"updelay\": \"%s\" nie jest prawidłową liczbą <0-%u>.\n"
-#: ../cli/src/connections.c:3294
+#: ../clients/cli/connections.c:3586
msgid "Bonding arp-interval [0]: "
msgstr "arp-interval wiÄ…zania [0]: "
-#: ../cli/src/connections.c:3297
+#: ../clients/cli/connections.c:3589
#, c-format
msgid "Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n"
msgstr "Błąd: \"arp-interval\": \"%s\" nie jest prawidłową liczbą <0-%u>.\n"
#. FIXME: verify the string
-#: ../cli/src/connections.c:3305
+#: ../clients/cli/connections.c:3597
msgid "Bonding arp-ip-target [none]: "
msgstr "arp-ip-target wiÄ…zania [none]: "
-#: ../cli/src/connections.c:3325
+#: ../clients/cli/connections.c:3604
+msgid "LACP rate ('slow' or 'fast') [slow]: "
+msgstr "Prędkość LACP (\"slow\" lub \"fast\") [slow]: "
+
+#: ../clients/cli/connections.c:3610
+#, c-format
+msgid "Error: 'lacp_rate': '%s' is invalid ('slow' or 'fast').\n"
+msgstr ""
+"Błąd: \"lacp_rate\": \"%s\" jest nieprawidłowe (\"slow\" lub \"fast\").\n"
+
+#: ../clients/cli/connections.c:3633
msgid "Team JSON configuration [none]: "
msgstr "Konfiguracja JSON zespołu [none]: "
-#: ../cli/src/connections.c:3342
+#: ../clients/cli/connections.c:3650
msgid "team"
msgstr "zespół"
-#: ../cli/src/connections.c:3348
+#: ../clients/cli/connections.c:3656
msgid "team-slave"
msgstr "podrzędny-zespołu"
#. Ask for optional 'bridge' arguments.
-#: ../cli/src/connections.c:3360
+#: ../clients/cli/connections.c:3668
msgid "bridge"
msgstr "mostek"
-#: ../cli/src/connections.c:3366
+#: ../clients/cli/connections.c:3674
#, c-format
msgid "Enable STP %s"
msgstr "WÅ‚Ä…czenie STP %s"
-#: ../cli/src/connections.c:3371
+#: ../clients/cli/connections.c:3679
#, c-format
msgid "Error: 'stp': %s.\n"
msgstr "BÅ‚Ä…d: \"stp\": %s.\n"
-#: ../cli/src/connections.c:3379
+#: ../clients/cli/connections.c:3687
msgid "STP priority [32768]: "
msgstr "Priorytet STP [32768]: "
-#: ../cli/src/connections.c:3383
+#: ../clients/cli/connections.c:3691
#, c-format
msgid "Error: 'priority': '%s' is not a valid number <0-%d>.\n"
msgstr "Błąd: \"priority\": \"%s\" nie jest prawidłową liczbą <0-%d>.\n"
-#: ../cli/src/connections.c:3391
+#: ../clients/cli/connections.c:3699
msgid "Forward delay [15]: "
msgstr "Forward-delay [15]: "
-#: ../cli/src/connections.c:3395
+#: ../clients/cli/connections.c:3703
#, c-format
msgid "Error: 'forward-delay': '%s' is not a valid number <2-30>.\n"
msgstr "Błąd: \"forward-delay\": \"%s\" nie jest prawidłową liczbą <2-30>.\n"
-#: ../cli/src/connections.c:3404
+#: ../clients/cli/connections.c:3712
msgid "Hello time [2]: "
msgstr "Hello-time [2]: "
-#: ../cli/src/connections.c:3408
+#: ../clients/cli/connections.c:3716
#, c-format
msgid "Error: 'hello-time': '%s' is not a valid number <1-10>.\n"
msgstr "Błąd: \"hello-time\": \"%s\" nie jest prawidłową liczbą <1-10>.\n"
-#: ../cli/src/connections.c:3416
+#: ../clients/cli/connections.c:3724
msgid "Max age [20]: "
msgstr "Max-age [20]: "
-#: ../cli/src/connections.c:3420
+#: ../clients/cli/connections.c:3728
#, c-format
msgid "Error: 'max-age': '%s' is not a valid number <6-40>.\n"
msgstr "Błąd: \"max-age\": \"%s\" nie jest prawidłową liczbą <6-40>.\n"
-#: ../cli/src/connections.c:3428
+#: ../clients/cli/connections.c:3736
msgid "MAC address ageing time [300]: "
msgstr "Czas starzenia adresu MAC [300]: "
-#: ../cli/src/connections.c:3432
+#: ../clients/cli/connections.c:3740
#, c-format
msgid "Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n"
msgstr ""
"Błąd: \"ageing-time\": \"%s\" nie jest prawidłową liczbą <0-1000000>.\n"
#. Ask for optional 'bridge-slave' arguments.
-#: ../cli/src/connections.c:3459
+#: ../clients/cli/connections.c:3767
msgid "bridge-slave"
msgstr "podrzędny-mostku"
-#: ../cli/src/connections.c:3464
+#: ../clients/cli/connections.c:3772
msgid "Bridge port priority [32]: "
msgstr "Priorytet portu mostku [32]: "
-#: ../cli/src/connections.c:3477
+#: ../clients/cli/connections.c:3785
msgid "Bridge port STP path cost [100]: "
msgstr "Koszt ścieżki STP portu mostku [100]: "
-#: ../cli/src/connections.c:3491
+#: ../clients/cli/connections.c:3799
#, c-format
msgid "Hairpin %s"
msgstr "Hairpin %s"
-#: ../cli/src/connections.c:3496
+#: ../clients/cli/connections.c:3804
#, c-format
msgid "Error: 'hairpin': %s.\n"
msgstr "BÅ‚Ä…d: \"hairpin\": %s.\n"
#. Ask for optional 'olpc' arguments.
-#: ../cli/src/connections.c:3523 ../libnm-glib/nm-device.c:1819
+#: ../clients/cli/connections.c:3831 ../libnm-glib/nm-device.c:1795
+#: ../libnm/nm-device.c:1617
msgid "OLPC Mesh"
msgstr "Kratowe OLPC"
-#: ../cli/src/connections.c:3528
+#: ../clients/cli/connections.c:3836
msgid "OLPC Mesh channel [1]: "
msgstr "Kanał sieci kratowej OLPC [1]: "
-#: ../cli/src/connections.c:3531
+#: ../clients/cli/connections.c:3839
#, c-format
msgid "Error: 'channel': '%s' is not a valid number <1-13>.\n"
msgstr "Błąd: \"channel\": \"%s\" nie jest prawidłową liczbą <1-13>.\n"
-#: ../cli/src/connections.c:3539
+#: ../clients/cli/connections.c:3847
msgid "DHCP anycast MAC address [none]: "
msgstr "Adres MAC \"anycast\" DHCP [none]: "
-#: ../cli/src/connections.c:3584
-msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
-msgstr "Adres IPv4 (IP[/plen] [gateway]) [none]: "
+#: ../clients/cli/connections.c:3889
+msgid "IPv4 address (IP[/plen]) [none]: "
+msgstr "Adres IPv4 (IP[/plen]) [none]: "
-#: ../cli/src/connections.c:3586
-msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
-msgstr "Adres IPv6 (IP[/plen] [gateway]) [none]: "
+#: ../clients/cli/connections.c:3891
+msgid "IPv6 address (IP[/plen]) [none]: "
+msgstr "Adres IPv6 (IP[/plen]) [none]: "
-#: ../cli/src/connections.c:3604
+#: ../clients/cli/connections.c:3905
#, c-format
-msgid " Address successfully added: %s %s\n"
-msgstr " Pomyślnie dodano adres: %s %s\n"
+msgid " Address successfully added: %s\n"
+msgstr " Pomyślnie dodano adres: %s\n"
-#: ../cli/src/connections.c:3606
+#: ../clients/cli/connections.c:3907
#, c-format
-msgid " Warning: address already present: %s %s\n"
-msgstr " Ostrzeżenie: adres jest już obecny: %s %s\n"
+msgid " Warning: address already present: %s\n"
+msgstr " Ostrzeżenie: adres jest już obecny: %s\n"
-#: ../cli/src/connections.c:3608
+#: ../clients/cli/connections.c:3909
#, c-format
msgid " Warning: ignoring garbage at the end: '%s'\n"
msgstr " Ostrzeżenie: ignorowanie śmieci na końcu: \"%s\"\n"
-#: ../cli/src/connections.c:3610 ../cli/src/connections.c:4467
-#: ../cli/src/connections.c:4530 ../cli/src/connections.c:4941
-#: ../cli/src/connections.c:4951
+#: ../clients/cli/connections.c:3911 ../clients/cli/connections.c:4791
+#: ../clients/cli/connections.c:4852 ../clients/cli/connections.c:5253
+#: ../clients/cli/connections.c:5286
msgid "Error: "
msgstr "BÅ‚Ä…d: "
+#: ../clients/cli/connections.c:3931
+msgid "IPv4 gateway [none]: "
+msgstr "Brama IPv4 [none]: "
+
+#: ../clients/cli/connections.c:3934
+msgid "IPv6 gateway [none]: "
+msgstr "Brama IPv6 [none]: "
+
+#: ../clients/cli/connections.c:3954
+#, c-format
+msgid "Error: invalid gateway address '%s'\n"
+msgstr "Błąd: nieprawidłowy adres bramy \"%s\"\n"
+
#. Ask for IP addresses
-#: ../cli/src/connections.c:3627
+#: ../clients/cli/connections.c:3967
#, c-format
msgid "Do you want to add IP addresses? %s"
msgstr "Dodać adresy IP? %s"
-#: ../cli/src/connections.c:3634
+#: ../clients/cli/connections.c:3975
#, c-format
msgid "Press <Enter> to finish adding addresses.\n"
msgstr "Naciśnięcie klawisza <Enter> zakończy dodawanie adresów.\n"
-#: ../cli/src/connections.c:3780
+#: ../clients/cli/connections.c:4113
#, c-format
msgid "Error: 'parent': not valid without 'p-key'."
msgstr "Błąd: \"parent\": nieprawidłowe bez \"p-key\"."
-#: ../cli/src/connections.c:3836 ../cli/src/connections.c:4857
+#: ../clients/cli/connections.c:4168 ../clients/cli/connections.c:5173
msgid "SSID: "
msgstr "SSID: "
-#: ../cli/src/connections.c:3839 ../cli/src/connections.c:4860
+#: ../clients/cli/connections.c:4171 ../clients/cli/connections.c:5176
msgid "Error: 'ssid' is required."
msgstr "BÅ‚Ä…d: \"ssid\" jest wymagane."
-#: ../cli/src/connections.c:3903
+#: ../clients/cli/connections.c:4235
msgid "WiMAX NSP name: "
msgstr "Nazwa NSP sieci WiMAX: "
-#: ../cli/src/connections.c:3906
+#: ../clients/cli/connections.c:4238
msgid "Error: 'nsp' is required."
msgstr "BÅ‚Ä…d: \"nsp\" jest wymagane."
-#: ../cli/src/connections.c:3961
+#: ../clients/cli/connections.c:4290
msgid "PPPoE username: "
msgstr "Nazwa użytkownika PPPoE: "
-#: ../cli/src/connections.c:3964
+#: ../clients/cli/connections.c:4293
msgid "Error: 'username' is required."
msgstr "BÅ‚Ä…d: \"username\" jest wymagane."
-#: ../cli/src/connections.c:4035
+#: ../clients/cli/connections.c:4362
msgid "APN: "
msgstr "APN: "
-#: ../cli/src/connections.c:4038
+#: ../clients/cli/connections.c:4365
msgid "Error: 'apn' is required."
msgstr "BÅ‚Ä…d: \"apn\" jest wymagane."
-#: ../cli/src/connections.c:4097
+#: ../clients/cli/connections.c:4423
msgid "Bluetooth device address: "
msgstr "Adres urzÄ…dzenia Bluetooth: "
-#: ../cli/src/connections.c:4100
+#: ../clients/cli/connections.c:4426
msgid "Error: 'addr' is required."
msgstr "BÅ‚Ä…d: \"addr\" jest wymagane."
-#: ../cli/src/connections.c:4143
+#: ../clients/cli/connections.c:4467
#, c-format
msgid "Error: 'bt-type': '%s' not valid; use [%s, %s (%s), %s]."
msgstr ""
"Błąd: \"bt-type\": \"%s\" jest nieprawidłowe; należy użyć [%s, %s (%s), %s]."
-#: ../cli/src/connections.c:4188
+#: ../clients/cli/connections.c:4511
msgid "VLAN parent device or connection UUID: "
msgstr "Urządzenie nadrzędne VLAN lub UUID połączenia: "
-#: ../cli/src/connections.c:4191
+#: ../clients/cli/connections.c:4514
msgid "Error: 'dev' is required."
msgstr "BÅ‚Ä…d: \"dev\" jest wymagane."
-#: ../cli/src/connections.c:4195
+#: ../clients/cli/connections.c:4518
msgid "VLAN ID <0-4095>: "
msgstr "Identyfikator VLAN <0-4095>: "
-#: ../cli/src/connections.c:4198
+#: ../clients/cli/connections.c:4521
msgid "Error: 'id' is required."
msgstr "BÅ‚Ä…d: \"id\" jest wymagane."
-#: ../cli/src/connections.c:4204
+#: ../clients/cli/connections.c:4527
#, c-format
msgid "Error: 'id': '%s' is not valid; use <0-4095>."
msgstr "Błąd: \"id\": \"%s\" jest nieprawidłowe; należy użyć <0-4095>."
-#: ../cli/src/connections.c:4214
+#: ../clients/cli/connections.c:4537
#, c-format
msgid "Error: 'dev': '%s' is neither UUID, interface name, nor MAC."
msgstr "BÅ‚Ä…d: \"dev\": \"%s\" nie jest UUID, nazwÄ… interfejsu ani MAC."
-#: ../cli/src/connections.c:4349
+#: ../clients/cli/connections.c:4671
#, c-format
msgid "Error: 'mode': %s."
msgstr "BÅ‚Ä…d: \"mode\": %s."
-#: ../cli/src/connections.c:4358
+#: ../clients/cli/connections.c:4680
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name."
msgstr "Błąd: \"primary\": \"%s\" nie jest prawidłową nazwą interfejsu."
-#: ../cli/src/connections.c:4408 ../cli/src/connections.c:4508
-#: ../cli/src/connections.c:4715
+#: ../clients/cli/connections.c:4732 ../clients/cli/connections.c:4830
+#: ../clients/cli/connections.c:5032
msgid "Error: 'master' is required."
msgstr "BÅ‚Ä…d: \"master\" jest wymagane."
-#: ../cli/src/connections.c:4414 ../cli/src/connections.c:4514
-#: ../cli/src/connections.c:4721
+#: ../clients/cli/connections.c:4738 ../clients/cli/connections.c:4836
+#: ../clients/cli/connections.c:5038
#, c-format
msgid "Warning: master='%s' doesn't refer to any existing profile.\n"
msgstr ""
"Ostrzeżenie: master=\"%s\" nie odnosi się do żadnego istniejącego profilu.\n"
-#: ../cli/src/connections.c:4417 ../cli/src/connections.c:4522
-#: ../cli/src/connections.c:4724
+#: ../clients/cli/connections.c:4741 ../clients/cli/connections.c:4844
+#: ../clients/cli/connections.c:5041
#, c-format
msgid ""
"Warning: 'type' is currently ignored. We only support ethernet slaves for "
@@ -1978,80 +2153,110 @@ msgstr ""
"Ostrzeżenie: \"type\" jest obecnie ignorowane. W tej chwili obsługiwane są "
"tylko podrzędne Ethernet.\n"
-#: ../cli/src/connections.c:4617
+#: ../clients/cli/connections.c:4938
#, c-format
msgid "Error: 'stp': %s."
msgstr "BÅ‚Ä…d: \"stp\": %s."
-#: ../cli/src/connections.c:4751
+#: ../clients/cli/connections.c:5068
#, c-format
msgid "Error: 'hairpin': %s."
msgstr "BÅ‚Ä…d: \"hairpin\": %s."
-#: ../cli/src/connections.c:4804
+#: ../clients/cli/connections.c:5121
msgid "Error: 'vpn-type' is required."
msgstr "BÅ‚Ä…d: \"vpn-type\" jest wymagane."
-#: ../cli/src/connections.c:4811
+#: ../clients/cli/connections.c:5128
#, c-format
msgid "Warning: 'vpn-type': %s not known.\n"
msgstr "BÅ‚Ä…d: \"vpn-type\": nieznane %s.\n"
-#: ../cli/src/connections.c:4873
+#: ../clients/cli/connections.c:5189
#, c-format
msgid "Error: 'channel': '%s' is not valid; use <1-13>."
msgstr "Błąd: \"channel\": \"%s\" jest nieprawidłowe; należy użyć <1-13>."
-#: ../cli/src/connections.c:4908
+#: ../clients/cli/connections.c:5221
#, c-format
msgid "Error: '%s' is not a valid connection type."
msgstr "Błąd: \"%s\" nie jest prawidłowym typem połączenia."
-#: ../cli/src/connections.c:5006
+#: ../clients/cli/connections.c:5265
+#, c-format
+msgid "Error: IPv4 gateway specified without IPv4 addresses"
+msgstr "Błąd: podano bramę IPv4 bez adresów IPv4"
+
+#: ../clients/cli/connections.c:5269
+#, c-format
+msgid "Error: multiple IPv4 gateways specified"
+msgstr "BÅ‚Ä…d: podano wiele bram IPv4"
+
+#: ../clients/cli/connections.c:5273
#, c-format
-msgid "Error: Failed to add '%s' connection: (%d) %s"
-msgstr "Błąd: dodanie połączenia \"%s\" się nie powiodło: (%d) %s"
+msgid "Error: Invalid IPv4 gateway '%s'"
+msgstr "Błąd: nieprawidłowa brama IPv4 \"%s\""
-#: ../cli/src/connections.c:5010
+#: ../clients/cli/connections.c:5298
+#, c-format
+msgid "Error: IPv6 gateway specified without IPv6 addresses"
+msgstr "Błąd: podano bramę IPv6 bez adresów IPv6"
+
+#: ../clients/cli/connections.c:5302
+#, c-format
+msgid "Error: multiple IPv6 gateways specified"
+msgstr "BÅ‚Ä…d: podano wiele bram IPv6"
+
+#: ../clients/cli/connections.c:5306
+#, c-format
+msgid "Error: Invalid IPv6 gateway '%s'"
+msgstr "Błąd: nieprawidłowa brama IPv6 \"%s\""
+
+#: ../clients/cli/connections.c:5366
+#, c-format
+msgid "Error: Failed to add '%s' connection: %s"
+msgstr "Błąd: dodanie połączenia \"%s\" się nie powiodło: %s"
+
+#: ../clients/cli/connections.c:5371
#, c-format
msgid "Connection '%s' (%s) successfully added.\n"
msgstr "Pomyślnie dodano połączenie \"%s\" (%s).\n"
-#: ../cli/src/connections.c:5224
+#: ../clients/cli/connections.c:5591
#, c-format
msgid "Error: 'type' argument is required."
msgstr "BÅ‚Ä…d: parametr \"type\" jest wymagany."
-#: ../cli/src/connections.c:5232
+#: ../clients/cli/connections.c:5599
#, c-format
msgid "Error: invalid connection type; %s."
msgstr "Błąd: nieznany typ połączenia; %s."
-#: ../cli/src/connections.c:5241
+#: ../clients/cli/connections.c:5608
#, c-format
msgid "Error: 'autoconnect': %s."
msgstr "BÅ‚Ä…d: \"autoconnect\": %s."
-#: ../cli/src/connections.c:5251
+#: ../clients/cli/connections.c:5618
#, c-format
msgid "Error: 'save': %s."
msgstr "BÅ‚Ä…d: \"save\": %s."
-#: ../cli/src/connections.c:5267
+#: ../clients/cli/connections.c:5634
msgid "Interface name [*]: "
msgstr "Nazwa interfejsu [*]: "
-#: ../cli/src/connections.c:5272
+#: ../clients/cli/connections.c:5639
#, c-format
msgid "Error: 'ifname' argument is required."
msgstr "BÅ‚Ä…d: parametr \"ifname\" jest wymagany."
-#: ../cli/src/connections.c:5279
+#: ../clients/cli/connections.c:5646
#, c-format
msgid "Error: 'ifname': '%s' is not a valid interface nor '*'."
msgstr "Błąd: \"ifname\": \"%s\" nie jest prawidłowym interfejsem ani \"*\"."
-#: ../cli/src/connections.c:6067
+#: ../clients/cli/connections.c:6422
#, c-format
msgid "['%s' setting values]\n"
msgstr "[wartości ustawienia \"%s\"]\n"
@@ -2059,7 +2264,7 @@ msgstr "[wartości ustawienia \"%s\"]\n"
#. TRANSLATORS: do not translate command names and keywords before ::
#. * However, you should translate terms enclosed in <>.
#.
-#: ../cli/src/connections.c:6149
+#: ../clients/cli/connections.c:6504
#, c-format
msgid ""
"---[ Main menu ]---\n"
@@ -2069,7 +2274,7 @@ msgid ""
"set [<setting>.<prop> <value>] :: set property value\n"
"describe [<setting>.<prop>] :: describe property\n"
"print [all | <setting>[.<prop>]] :: print the connection\n"
-"verify [all] :: verify the connection\n"
+"verify [all | fix] :: verify the connection\n"
"save [persistent|temporary] :: save the connection\n"
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
"back :: go one level up (back)\n"
@@ -2086,8 +2291,8 @@ msgstr ""
"set [<ustawienie>.<właściwość> <wartość>] :: ustawia wartość "
"właściwości\n"
"describe [<ustawienie>.<właściwość>] :: opisuje właściwość\n"
-"print [all] :: wyświetla połączenie\n"
-"verify [all] :: sprawdza połączenie\n"
+"print [all | <ustawienie>[.<właściwość>]] :: wyświetla połączenie\n"
+"verify [all | fix] :: sprawdza połączenie\n"
"save [persistent|temporary] :: zapisuje połączenie\n"
"activate [<nazwa-interfejsu>] [/<ap>|<nsp>] :: aktywuje połączenie\n"
"back :: przechodzi o poziom\n"
@@ -2096,7 +2301,7 @@ msgstr ""
"nmcli <opcja-konfiguracji> <wartość> :: konfiguracja nmcli\n"
"quit :: kończy działanie nmcli\n"
-#: ../cli/src/connections.c:6176
+#: ../clients/cli/connections.c:6531
#, c-format
msgid ""
"goto <setting>[.<prop>] | <prop> :: enter setting/property for editing\n"
@@ -2117,7 +2322,7 @@ msgstr ""
" nmcli connection> goto secondaries\n"
" nmcli> goto ipv4.addresses\n"
-#: ../cli/src/connections.c:6183
+#: ../clients/cli/connections.c:6538
#, c-format
msgid ""
"remove <setting>[.<prop>] :: remove setting or reset property value\n"
@@ -2138,7 +2343,7 @@ msgstr ""
"Przykłady: nmcli> remove wifi-sec\n"
" nmcli> remove eth.mtu\n"
-#: ../cli/src/connections.c:6190
+#: ../clients/cli/connections.c:6545
#, c-format
msgid ""
"set [<setting>.<prop> <value>] :: set property value\n"
@@ -2153,7 +2358,7 @@ msgstr ""
"\n"
"Przykład: nmcli> set con.id Moje połączenie\n"
-#: ../cli/src/connections.c:6195
+#: ../clients/cli/connections.c:6550
#, c-format
msgid ""
"describe [<setting>.<prop>] :: describe property\n"
@@ -2166,7 +2371,7 @@ msgstr ""
"Wyświetla opis właściwości. Wszystkie ustawienia i właściwości usługi NM\n"
"można znaleźć na stronie podręcznika nm-settings(5).\n"
-#: ../cli/src/connections.c:6200
+#: ../clients/cli/connections.c:6555
#, c-format
msgid ""
"print [all] :: print setting or connection values\n"
@@ -2181,26 +2386,32 @@ msgstr ""
"\n"
"Przykład: nmcli ipv4> print all\n"
-#: ../cli/src/connections.c:6205
+#: ../clients/cli/connections.c:6560
#, c-format
msgid ""
-"verify [all] :: verify setting or connection validity\n"
+"verify [all | fix] :: verify setting or connection validity\n"
"\n"
-"Verifies whether the setting or connection is valid and can be saved later. "
-"It indicates invalid values on error.\n"
+"Verifies whether the setting or connection is valid and can be saved later.\n"
+"It indicates invalid values on error. Some errors may be fixed "
+"automatically\n"
+"by 'fix' option.\n"
"\n"
"Examples: nmcli> verify\n"
+" nmcli> verify fix\n"
" nmcli bond> verify\n"
msgstr ""
-"verify [all] :: sprawdza ustawienie lub poprawność połączenia\n"
+"verify [all | fix] :: sprawdza ustawienie lub poprawność połączenia\n"
"\n"
"Sprawdza, czy ustawienie lub połączenie jest prawidłowe i może zostać\n"
"później zapisane. Wskazuje nieprawidłowe wartości po napotkaniu błędu.\n"
+"Niektóre błędy mogą zostać naprawione automatycznie za pomocą opcji \"fix"
+"\".\n"
"\n"
"Przykłady: nmcli> verify\n"
+" nmcli> verify fix\n"
" nmcli bond> verify\n"
-#: ../cli/src/connections.c:6212
+#: ../clients/cli/connections.c:6569
#, c-format
msgid ""
"save [persistent|temporary] :: save the connection\n"
@@ -2226,7 +2437,7 @@ msgstr ""
"między ponownymi uruchomieniami. Aby w pełni usunąć trwałe połączenie,\n"
"należy usunąć profil połączenia.\n"
-#: ../cli/src/connections.c:6223
+#: ../clients/cli/connections.c:6580
#, c-format
msgid ""
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
@@ -2247,7 +2458,7 @@ msgstr ""
"/<ap>|<nsp> - AP (Wi-Fi) lub NSP (WiMAX) (należy poprzedzić\n"
" znakiem /, kiedy nie podano <nazwy-interfejsu>)\n"
-#: ../cli/src/connections.c:6230 ../cli/src/connections.c:6387
+#: ../clients/cli/connections.c:6587 ../clients/cli/connections.c:6745
#, c-format
msgid ""
"back :: go to upper menu level\n"
@@ -2256,7 +2467,7 @@ msgstr ""
"back :: przechodzi do menu wyższego poziomu\n"
"\n"
-#: ../cli/src/connections.c:6233
+#: ../clients/cli/connections.c:6590
#, c-format
msgid ""
"help/? [<command>] :: help for the nmcli commands\n"
@@ -2265,7 +2476,7 @@ msgstr ""
"help/? [<polecenie>] :: pomoc dla poleceń nmcli\n"
"\n"
-#: ../cli/src/connections.c:6236
+#: ../clients/cli/connections.c:6593
#, c-format
msgid ""
"nmcli [<conf-option> <value>] :: nmcli configuration\n"
@@ -2273,6 +2484,7 @@ msgid ""
"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"
@@ -2294,6 +2506,7 @@ msgstr ""
"status-line yes | no [domyślnie: no]\n"
"save-confirmation yes | no [domyślnie: yes]\n"
"prompt-color <0-8> [domyślnie: 0]\n"
+"show-secrets yes | no [domyślnie: no]\n"
" 0 = zwykły\n"
" 1 = czarny\n"
" 2 = czerwony\n"
@@ -2308,7 +2521,7 @@ msgstr ""
" nmcli> nmcli save-confirmation no\n"
" nmcli> nmcli prompt-color 3\n"
-#: ../cli/src/connections.c:6256 ../cli/src/connections.c:6393
+#: ../clients/cli/connections.c:6614 ../clients/cli/connections.c:6751
#, c-format
msgid ""
"quit :: exit nmcli\n"
@@ -2321,8 +2534,8 @@ msgstr ""
"To polecenie kończy działanie nmcli. Jeśli modyfikowane połączenie nie jest "
"zapisane, użytkownik zostanie poproszony o potwierdzenie działania.\n"
-#: ../cli/src/connections.c:6261 ../cli/src/connections.c:6398
-#: ../cli/src/connections.c:6786 ../cli/src/connections.c:7679
+#: ../clients/cli/connections.c:6619 ../clients/cli/connections.c:6756
+#: ../clients/cli/connections.c:7167 ../clients/cli/connections.c:8083
#, c-format
msgid "Unknown command: '%s'\n"
msgstr "Nieznane polecenie: \"%s\"\n"
@@ -2330,7 +2543,7 @@ msgstr "Nieznane polecenie: \"%s\"\n"
#. TRANSLATORS: do not translate command names and keywords before ::
#. * However, you should translate terms enclosed in <>.
#.
-#: ../cli/src/connections.c:6327
+#: ../clients/cli/connections.c:6685
#, c-format
msgid ""
"---[ Property menu ]---\n"
@@ -2357,7 +2570,7 @@ msgstr ""
"help/? [<polecenie>] :: wyświetla tę pomoc lub opis polecenia\n"
"quit :: kończy działanie nmcli\n"
-#: ../cli/src/connections.c:6352
+#: ../clients/cli/connections.c:6710
#, c-format
msgid ""
"set [<value>] :: set new value\n"
@@ -2368,7 +2581,7 @@ msgstr ""
"\n"
"To polecenie ustawia podaną <wartość> tej właściwości\n"
-#: ../cli/src/connections.c:6356
+#: ../clients/cli/connections.c:6714
#, c-format
msgid ""
"add [<value>] :: append new value to the property\n"
@@ -2383,7 +2596,7 @@ msgstr ""
"jest typu kontener. W przypadku właściwości zawierających jedną wartość "
"zastępuje tę wartość (podobnie jak \"set\").\n"
-#: ../cli/src/connections.c:6362
+#: ../clients/cli/connections.c:6720
#, c-format
msgid ""
"change :: change current value\n"
@@ -2394,7 +2607,7 @@ msgstr ""
"\n"
"Wyświetla bieżącą wartość i umożliwia jej modyfikację.\n"
-#: ../cli/src/connections.c:6366
+#: ../clients/cli/connections.c:6724
#, c-format
msgid ""
"remove [<value>|<index>|<option name>] :: delete the value\n"
@@ -2427,7 +2640,7 @@ msgstr ""
" nmcli bond.options> remove downdelay\n"
"\n"
-#: ../cli/src/connections.c:6377
+#: ../clients/cli/connections.c:6735
#, c-format
msgid ""
"describe :: describe property\n"
@@ -2440,7 +2653,7 @@ msgstr ""
"Wyświetla opis właściwości. Wszystkie ustawienia i właściwości usługi NM "
"można znaleźć na stronie podręcznika nm-settings(5).\n"
-#: ../cli/src/connections.c:6382
+#: ../clients/cli/connections.c:6740
#, c-format
msgid ""
"print [property|setting|connection] :: print property (setting, connection) "
@@ -2455,7 +2668,7 @@ msgstr ""
"Wyświetla wartość właściwości. Podając parametr można także wyświetlić "
"wartości dla całego ustawienia lub połączenia.\n"
-#: ../cli/src/connections.c:6390
+#: ../clients/cli/connections.c:6748
#, c-format
msgid ""
"help/? [<command>] :: help for nmcli commands\n"
@@ -2464,28 +2677,28 @@ msgstr ""
"help/? [<polecenie>] :: pomoc dla poleceń nmcli\n"
"\n"
-#: ../cli/src/connections.c:6477
+#: ../clients/cli/connections.c:6846
#, c-format
msgid "Error: Connection activation failed.\n"
msgstr "Błąd: aktywacja połączenia się nie powiodła.\n"
-#: ../cli/src/connections.c:6555
+#: ../clients/cli/connections.c:6929
#, c-format
msgid "Error: setting '%s' is mandatory and cannot be removed.\n"
msgstr "Błąd: ustawienie \"%s\" jest wymagane i nie może być usuwane.\n"
#. TRANSLATORS: status line in nmcli connection editor
-#: ../cli/src/connections.c:6573
+#: ../clients/cli/connections.c:6947
#, c-format
msgid "[ Type: %s | Name: %s | UUID: %s | Dirty: %s | Temp: %s ]\n"
msgstr "[ Typ: %s | nazwa: %s | UUID: %s | dirty: %s | tymczasowe: %s ]\n"
-#: ../cli/src/connections.c:6608
+#: ../clients/cli/connections.c:6983
#, c-format
msgid "The connection is not saved. Do you really want to quit? %s"
msgstr "Połączenie nie jest zapisane. Na pewno zakończyć? %s"
-#: ../cli/src/connections.c:6653
+#: ../clients/cli/connections.c:7028
#, c-format
msgid ""
"The connection profile has been removed from another client. You may type "
@@ -2494,60 +2707,60 @@ msgstr ""
"Profil połączenia został usunięty z innego klienta. Można wpisać \"save\" w "
"głównym oknie, aby go przywrócić.\n"
-#: ../cli/src/connections.c:6675 ../cli/src/connections.c:7090
-#: ../cli/src/connections.c:7145
+#: ../clients/cli/connections.c:7050 ../clients/cli/connections.c:7471
+#: ../clients/cli/connections.c:7526
#, c-format
msgid "Enter '%s' value: "
msgstr "Proszę podać wartość \"%s\": "
-#: ../cli/src/connections.c:6690 ../cli/src/connections.c:6708
-#: ../cli/src/connections.c:7094 ../cli/src/connections.c:7150
+#: ../clients/cli/connections.c:7065 ../clients/cli/connections.c:7087
+#: ../clients/cli/connections.c:7475 ../clients/cli/connections.c:7531
#, c-format
msgid "Error: failed to set '%s' property: %s\n"
msgstr "Błąd: ustawienie właściwości \"%s\" się nie powiodło: %s\n"
-#: ../cli/src/connections.c:6702
+#: ../clients/cli/connections.c:7081
#, c-format
msgid "Edit '%s' value: "
msgstr "Modyfikacja wartości \"%s\": "
-#: ../cli/src/connections.c:6729
+#: ../clients/cli/connections.c:7110
#, c-format
msgid "Error: %s\n"
msgstr "BÅ‚Ä…d: %s\n"
-#: ../cli/src/connections.c:6735 ../cli/src/connections.c:7229
-#: ../cli/src/connections.c:7270
+#: ../clients/cli/connections.c:7116 ../clients/cli/connections.c:7610
+#: ../clients/cli/connections.c:7651
#, c-format
msgid "Error: failed to remove value of '%s': %s\n"
msgstr "Błąd: usunięcie wartości \"%s\" się nie powiodło: %s\n"
-#: ../cli/src/connections.c:6756
+#: ../clients/cli/connections.c:7137
#, c-format
msgid "Unknown command argument: '%s'\n"
msgstr "Nieznany parametr polecenia: \"%s\"\n"
-#: ../cli/src/connections.c:6882
+#: ../clients/cli/connections.c:7263
#, c-format
msgid "Available settings: %s\n"
msgstr "Dostępne ustawienia: %s\n"
-#: ../cli/src/connections.c:6891
+#: ../clients/cli/connections.c:7272
#, c-format
msgid "Error: invalid setting name; %s\n"
msgstr "Błąd: nieprawidłowa nazwa ustawienia; %s\n"
-#: ../cli/src/connections.c:6908
+#: ../clients/cli/connections.c:7289
#, c-format
msgid "Available properties: %s\n"
msgstr "Dostępne właściwości: %s\n"
-#: ../cli/src/connections.c:6916
+#: ../clients/cli/connections.c:7297
#, c-format
msgid "Error: property %s\n"
msgstr "Błąd: właściwość %s\n"
-#: ../cli/src/connections.c:6957
+#: ../clients/cli/connections.c:7338
#, c-format
msgid ""
"Saving the connection with 'autoconnect=yes'. That might result in an "
@@ -2558,12 +2771,12 @@ msgstr ""
"natychmiastową aktywację połączenia.\n"
"Na pewno zapisać? %s"
-#: ../cli/src/connections.c:7032
+#: ../clients/cli/connections.c:7413
#, c-format
msgid "You may edit the following settings: %s\n"
msgstr "Można modyfikować następujące ustawienia: %s\n"
-#: ../cli/src/connections.c:7059
+#: ../clients/cli/connections.c:7440
#, c-format
msgid ""
"The connection profile has been removed from another client. You may type "
@@ -2572,205 +2785,225 @@ msgstr ""
"Profil połączenia został usunięty z innego klienta. Można wpisać \"save\", "
"aby go przywrócić.\n"
-#: ../cli/src/connections.c:7088 ../cli/src/connections.c:7143
+#: ../clients/cli/connections.c:7469 ../clients/cli/connections.c:7524
#, c-format
msgid "Allowed values for '%s' property: %s\n"
msgstr "Dozwolone wartości dla właściwości \"%s\": %s\n"
-#: ../cli/src/connections.c:7098 ../cli/src/connections.c:7312
+#: ../clients/cli/connections.c:7479 ../clients/cli/connections.c:7693
#, c-format
msgid "Error: no setting selected; valid are [%s]\n"
msgstr "Błąd: nie wybrano ustawienia; prawidłowe to [%s]\n"
-#: ../cli/src/connections.c:7099
+#: ../clients/cli/connections.c:7480
#, c-format
msgid "use 'goto <setting>' first, or 'set <setting>.<property>'\n"
msgstr ""
"należy najpierw użyć \"goto <ustawienie>\" lub \"set <ustawienie>."
"<właściwość>\"\n"
-#: ../cli/src/connections.c:7113 ../cli/src/connections.c:7249
-#: ../cli/src/connections.c:7329
+#: ../clients/cli/connections.c:7494 ../clients/cli/connections.c:7630
+#: ../clients/cli/connections.c:7710
#, c-format
msgid "Error: invalid setting argument '%s'; valid are [%s]\n"
msgstr "Błąd: nieprawidłowy parametr ustawienia \"%s\"; prawidłowe to [%s]\n"
-#: ../cli/src/connections.c:7123
+#: ../clients/cli/connections.c:7504
#, c-format
msgid "Error: missing setting for '%s' property\n"
msgstr "Błąd: brak ustawienia dla właściwości \"%s\"\n"
-#: ../cli/src/connections.c:7130
+#: ../clients/cli/connections.c:7511
#, c-format
msgid "Error: invalid property: %s\n"
msgstr "Błąd: nieprawidłowa właściwość: %s\n"
-#: ../cli/src/connections.c:7177
+#: ../clients/cli/connections.c:7558
#, c-format
msgid "Error: unknown setting '%s'\n"
msgstr "BÅ‚Ä…d: nieznane ustawienie \"%s\"\n"
-#: ../cli/src/connections.c:7190
+#: ../clients/cli/connections.c:7571
#, c-format
msgid "You may edit the following properties: %s\n"
msgstr "Można modyfikować następujące właściwości: %s\n"
-#: ../cli/src/connections.c:7234
+#: ../clients/cli/connections.c:7615
#, c-format
msgid "Error: no argument given; valid are [%s]\n"
msgstr "Błąd: nie podano żadnego parametru; prawidłowe to [%s]\n"
-#: ../cli/src/connections.c:7247
+#: ../clients/cli/connections.c:7628
#, c-format
msgid "Setting '%s' is not present in the connection.\n"
msgstr "Ustawienie \"%s\" nie jest obecne w połączeniu.\n"
-#: ../cli/src/connections.c:7288
+#: ../clients/cli/connections.c:7669
#, c-format
msgid "Error: %s properties, nor it is a setting name.\n"
msgstr "Błąd: właściwości %s, ani nie jest nazwą ustawiania.\n"
-#: ../cli/src/connections.c:7313
+#: ../clients/cli/connections.c:7694
#, c-format
msgid "use 'goto <setting>' first, or 'describe <setting>.<property>'\n"
msgstr ""
"należy najpierw użyć \"goto <ustawienie>\" lub \"describe <ustawienie>."
"<właściwość>\"\n"
-#: ../cli/src/connections.c:7354
+#: ../clients/cli/connections.c:7735
#, c-format
msgid "Error: invalid property: %s, neither a valid setting name.\n"
msgstr "Błąd: nieprawidłowa właściwość: %s: ani prawidłową nazwą ustawienia.\n"
-#: ../cli/src/connections.c:7383
+#: ../clients/cli/connections.c:7764
#, c-format
msgid "Error: unknown setting: '%s'\n"
msgstr "BÅ‚Ä…d: nieznane ustawienie: \"%s\"\n"
-#: ../cli/src/connections.c:7388
+#: ../clients/cli/connections.c:7769
#, c-format
msgid "Error: '%s' setting not present in the connection\n"
msgstr "Błąd: ustawienie \"%s\" nie jest obecne w połączeniu\n"
-#: ../cli/src/connections.c:7413
+#: ../clients/cli/connections.c:7794
#, c-format
msgid "Error: invalid property: %s%s\n"
msgstr "Błąd: nieprawidłowa właściwość: %s%s\n"
-#: ../cli/src/connections.c:7415
+#: ../clients/cli/connections.c:7796
msgid ", neither a valid setting name"
msgstr ", ani prawidłową nazwą ustawienia"
-#: ../cli/src/connections.c:7435
+#: ../clients/cli/connections.c:7813
+#, c-format
+msgid "Invalid verify option: %s\n"
+msgstr "Nieprawidłowa opcja sprawdzania: %s\n"
+
+#: ../clients/cli/connections.c:7821
#, c-format
msgid "Verify setting '%s': %s\n"
msgstr "Sprawdzenie ustawienia \"%s\": %s\n"
-#: ../cli/src/connections.c:7442
+#: ../clients/cli/connections.c:7836
#, c-format
msgid "Verify connection: %s\n"
msgstr "Sprawdzenie połączenia: %s\n"
-#: ../cli/src/connections.c:7460
+#: ../clients/cli/connections.c:7839
+#, c-format
+msgid "The error cannot be fixed automatically.\n"
+msgstr "Nie można automatycznie naprawić błędu.\n"
+
+#: ../clients/cli/connections.c:7856
#, c-format
msgid "Error: invalid argument '%s'\n"
msgstr "Błąd: nieprawidłowy parametr \"%s\"\n"
-#: ../cli/src/connections.c:7494
+#: ../clients/cli/connections.c:7889
#, c-format
-msgid "Error: Failed to save '%s' (%s) connection: (%d) %s\n"
-msgstr "Błąd: zapisanie połączenia \"%s\" (%s) się nie powiodło: (%d) %s\n"
+msgid "Error: Failed to save '%s' (%s) connection: %s\n"
+msgstr "Błąd: zapisanie połączenia \"%s\" (%s) się nie powiodło: %s\n"
-#: ../cli/src/connections.c:7502
+#: ../clients/cli/connections.c:7896
#, c-format
msgid "Connection '%s' (%s) successfully saved.\n"
msgstr "Pomyślnie zapisano połączenie \"%s\" (%s).\n"
-#: ../cli/src/connections.c:7503
+#: ../clients/cli/connections.c:7897
#, c-format
msgid "Connection '%s' (%s) successfully updated.\n"
msgstr "Pomyślnie zaktualizowano połączenie \"%s\" (%s).\n"
-#: ../cli/src/connections.c:7537
+#: ../clients/cli/connections.c:7930
#, c-format
msgid "Error: connection verification failed: %s\n"
msgstr "Błąd: sprawdzenie połączenia się nie powiodło: %s\n"
-#: ../cli/src/connections.c:7538
+#: ../clients/cli/connections.c:7931
msgid "(unknown error)"
msgstr "(nieznany błąd)"
-#: ../cli/src/connections.c:7559
+#: ../clients/cli/connections.c:7932
+#, c-format
+msgid "You may try running 'verify fix' to fix errors.\n"
+msgstr "Można spróbować wykonać \"verify fix\", aby naprawić błędy.\n"
+
+#: ../clients/cli/connections.c:7954
#, c-format
msgid "Error: connection is not saved. Type 'save' first.\n"
msgstr "Błąd: połączenie nie jest zapisane. Należy najpierw wpisać \"save\".\n"
-#: ../cli/src/connections.c:7563
+#: ../clients/cli/connections.c:7958
#, c-format
msgid "Error: connection is not valid: %s\n"
msgstr "Błąd: połączenie jest nieprawidłowe: %s\n"
-#: ../cli/src/connections.c:7574
+#: ../clients/cli/connections.c:7968
#, c-format
msgid "Error: Cannot activate connection: %s.\n"
msgstr "Błąd: nie można aktywować połączenia: %s.\n"
-#: ../cli/src/connections.c:7584
+#: ../clients/cli/connections.c:7978
#, c-format
-msgid "Error: Failed to activate '%s' (%s) connection: (%d) %s\n"
-msgstr "Błąd: aktywowanie połączenia \"%s\" (%s) się nie powiodło: (%d) %s\n"
+msgid "Error: Failed to activate '%s' (%s) connection: %s\n"
+msgstr "Błąd: aktywowanie połączenia \"%s\" (%s) się nie powiodło: %s\n"
-#: ../cli/src/connections.c:7590
+#: ../clients/cli/connections.c:7984
#, c-format
msgid "Monitoring connection activation (press any key to continue)\n"
msgstr ""
"Aktywacja monitorowania połączenia (naciśnięcie dowolnego klawisza "
"kontynuuje)\n"
-#: ../cli/src/connections.c:7628
+#: ../clients/cli/connections.c:8022
#, c-format
msgid "Error: status-line: %s\n"
msgstr "BÅ‚Ä…d: status-line: %s\n"
-#: ../cli/src/connections.c:7636
+#: ../clients/cli/connections.c:8030
#, c-format
msgid "Error: save-confirmation: %s\n"
msgstr "BÅ‚Ä…d: save-confirmation: %s\n"
-#: ../cli/src/connections.c:7644
+#: ../clients/cli/connections.c:8038
+#, c-format
+msgid "Error: show-secrets: %s\n"
+msgstr "BÅ‚Ä…d: show-secrets: %s\n"
+
+#: ../clients/cli/connections.c:8046
#, c-format
msgid "Error: bad color number: '%s'; use <0-8>\n"
msgstr "Błąd: błędny numer koloru: \"%s\"; należy użyć <0-8>\n"
-#: ../cli/src/connections.c:7656
+#: ../clients/cli/connections.c:8058
#, c-format
msgid "Current nmcli configuration:\n"
msgstr "Obecna konfiguracja nmcli:\n"
-#: ../cli/src/connections.c:7664
+#: ../clients/cli/connections.c:8068
#, c-format
msgid "Invalid configuration option '%s'; allowed [%s]\n"
msgstr "Nieprawidłowa opcja konfiguracji \"%s\"; dozwolone [%s]\n"
-#: ../cli/src/connections.c:7907
+#: ../clients/cli/connections.c:8315
#, c-format
msgid "Error: only one of 'id', uuid, or 'path' can be provided."
msgstr "Błąd: tylko jedno z \"id\", UUID lub \"path\" może być podane."
-#: ../cli/src/connections.c:7919 ../cli/src/connections.c:8106
-#: ../cli/src/connections.c:8113
+#: ../clients/cli/connections.c:8327 ../clients/cli/connections.c:8514
+#: ../clients/cli/connections.c:8521
#, c-format
msgid "Error: Unknown connection '%s'."
msgstr "Błąd: nieznane połączenie \"%s\"."
-#: ../cli/src/connections.c:7934
+#: ../clients/cli/connections.c:8345
#, c-format
msgid "Warning: editing existing connection '%s'; 'type' argument is ignored\n"
msgstr ""
"Ostrzeżenie: modyfikowanie istniejącego połączenia \"%s\"; parametr \"type\" "
"jest ignorowany\n"
-#: ../cli/src/connections.c:7937
+#: ../clients/cli/connections.c:8348
#, c-format
msgid ""
"Warning: editing existing connection '%s'; 'con-name' argument is ignored\n"
@@ -2778,420 +3011,445 @@ msgstr ""
"Ostrzeżenie: modyfikowanie istniejącego połączenia \"%s\"; parametr \"con-"
"name\" jest ignorowany\n"
-#: ../cli/src/connections.c:7951
+#: ../clients/cli/connections.c:8362
#, c-format
msgid "Valid connection types: %s\n"
msgstr "Prawidłowe typy połączeń: %s\n"
-#: ../cli/src/connections.c:7953
+#: ../clients/cli/connections.c:8364
#, c-format
msgid "Error: invalid connection type; %s\n"
msgstr "Błąd: nieznany typ połączenia; %s\n"
-#: ../cli/src/connections.c:7989
+#: ../clients/cli/connections.c:8403
#, c-format
msgid "===| nmcli interactive connection editor |==="
msgstr "===| interaktywny edytor połączeń nmcli |==="
-#: ../cli/src/connections.c:7992
+#: ../clients/cli/connections.c:8406
#, c-format
msgid "Editing existing '%s' connection: '%s'"
msgstr "Modyfikowanie istniejącego połączenia \"%s\": \"%s\""
-#: ../cli/src/connections.c:7994
+#: ../clients/cli/connections.c:8408
#, c-format
msgid "Adding a new '%s' connection"
msgstr "Dodawanie nowego połączenia \"%s\""
-#: ../cli/src/connections.c:7996
+#: ../clients/cli/connections.c:8410
#, c-format
msgid "Type 'help' or '?' for available commands."
msgstr "Wpisanie \"help\" lub \"?\" wyświetla dostępne polecenia."
-#: ../cli/src/connections.c:7998
+#: ../clients/cli/connections.c:8412
#, c-format
msgid "Type 'describe [<setting>.<prop>]' for detailed property description."
msgstr ""
"Wpisanie \"describe [<ustawienie>.<właściwość>]\" wyświetla szczegółowy opis "
"właściwości."
-#: ../cli/src/connections.c:8034
+#: ../clients/cli/connections.c:8450
#, c-format
-msgid "Error: Failed to modify connection '%s': (%d) %s"
-msgstr "Błąd: zmodyfikowanie połączenia \"%s\" się nie powiodło: (%d) %s"
+msgid "Error: Failed to modify connection '%s': %s"
+msgstr "Błąd: zmodyfikowanie połączenia \"%s\" się nie powiodło: %s"
-#: ../cli/src/connections.c:8040
+#: ../clients/cli/connections.c:8457
#, c-format
msgid "Connection '%s' (%s) successfully modified.\n"
msgstr "Pomyślnie zmodyfikowano połączenie \"%s\" (%s).\n"
-#: ../cli/src/connections.c:8081
+#: ../clients/cli/connections.c:8489
#, c-format
msgid "Error: No arguments provided."
msgstr "Błąd: nie podano żadnych parametrów."
-#: ../cli/src/connections.c:8100
+#: ../clients/cli/connections.c:8508
#, c-format
msgid "Error: connection ID is missing."
msgstr "Błąd: brak identyfikatora połączenia."
-#: ../cli/src/connections.c:8122 ../cli/src/connections.c:8135
+#: ../clients/cli/connections.c:8530 ../clients/cli/connections.c:8543
#, c-format
msgid "Error: <setting>.<property> argument is missing."
msgstr "Błąd: brak parametru <ustawienie>.<właściwość>."
-#: ../cli/src/connections.c:8140
+#: ../clients/cli/connections.c:8548
#, c-format
msgid "Error: value for '%s' is missing."
msgstr "Błąd: brak wartości dla \"%s\"."
-#: ../cli/src/connections.c:8158
+#: ../clients/cli/connections.c:8566
#, c-format
msgid "Error: invalid <setting>.<property> '%s'."
msgstr "Błąd: nieprawidłowe <ustawienie>.<właściwość> \"%s\"."
-#: ../cli/src/connections.c:8166
+#: ../clients/cli/connections.c:8574
#, c-format
msgid "Error: invalid or not allowed setting '%s': %s."
msgstr "Błąd: nieprawidłowe lub niedozwolone ustawienie \"%s\": %s."
-#: ../cli/src/connections.c:8187
+#: ../clients/cli/connections.c:8595
#, c-format
msgid "Error: invalid property '%s': %s."
msgstr "Błąd: nieprawidłowa właściwość \"%s\": %s."
-#: ../cli/src/connections.c:8198
+#: ../clients/cli/connections.c:8606
#, c-format
msgid "Error: failed to modify %s.%s: %s."
msgstr "Błąd: zmodyfikowanie %s.%s się nie powiodło: %s."
-#: ../cli/src/connections.c:8216
+#: ../clients/cli/connections.c:8624
#, c-format
msgid "Error: failed to remove a value from %s.%s: %s."
msgstr "Błąd: usunięcie wartości z %s.%s się nie powiodło: %s."
-#: ../cli/src/connections.c:8252
+#: ../clients/cli/connections.c:8661
#, c-format
msgid "Error: Connection deletion failed: %s"
msgstr "Błąd: usunięcie połączenia się nie powiodło: %s"
-#: ../cli/src/connections.c:8323
+#: ../clients/cli/connections.c:8725
#, c-format
msgid "Error: unknown connection: %s\n"
msgstr "Błąd: nieznane połączenie: %s\n"
#. truncate trailing ", "
-#: ../cli/src/connections.c:8359
+#: ../clients/cli/connections.c:8762
#, c-format
msgid "Error: cannot delete unknown connection(s): %s."
msgstr "Błąd: nie można usunąć nieznanych połączeń: %s."
-#: ../cli/src/connections.c:8430
+#: ../clients/cli/connections.c:8785
#, c-format
-msgid "Could not load file '%s'\n"
-msgstr "Nie można wczytać pliku \"%s\"\n"
+msgid "Error: failed to reload connections: %s."
+msgstr "Błąd: ponowne wczytanie połączeń się nie powiodło: %s."
-#: ../cli/src/connections.c:8615
+#: ../clients/cli/connections.c:8824
#, c-format
-msgid "Error: '%s' is not valid 'connection' command."
-msgstr "Błąd: \"%s\" nie jest prawidłowym poleceniem \"connection\"."
+msgid "Error: failed to load connection: %s."
+msgstr "Błąd: wczytanie połączeń się nie powiodło: %s."
-#: ../cli/src/connections.c:8684 ../cli/src/network-manager.c:615
+#: ../clients/cli/connections.c:8832
#, c-format
-msgid "Error: Could not get system settings."
-msgstr "Błąd: nie można uzyskać ustawień systemu."
+msgid "Could not load file '%s'\n"
+msgstr "Nie można wczytać pliku \"%s\"\n"
-#: ../cli/src/connections.c:8694
+#: ../clients/cli/connections.c:9008
#, c-format
-msgid "Error: Can't obtain connections: settings service is not running."
-msgstr ""
-"Błąd: nie można uzyskać połączeń: usługa ustawień nie jest uruchomiona."
+msgid "Error: '%s' is not valid 'connection' command."
+msgstr "Błąd: \"%s\" nie jest prawidłowym poleceniem \"connection\"."
#. define some prompts
-#: ../cli/src/devices.c:70
+#: ../clients/cli/devices.c:38
msgid "Interface: "
msgstr "Interfejs: "
#. 3
-#. 16
-#: ../cli/src/devices.c:78 ../cli/src/devices.c:106
+#. 17
+#: ../clients/cli/devices.c:46 ../clients/cli/devices.c:75
msgid "CONNECTION"
msgstr "POÅÄ„CZENIE"
#. 4
-#. 17
-#: ../cli/src/devices.c:79 ../cli/src/devices.c:107
+#. 18
+#: ../clients/cli/devices.c:47 ../clients/cli/devices.c:76
msgid "CON-UUID"
msgstr "UUID-POÅÄ„CZENIA"
#. 2
-#: ../cli/src/devices.c:92
+#: ../clients/cli/devices.c:60
msgid "VENDOR"
msgstr "PRODUCENT"
#. 3
-#: ../cli/src/devices.c:93
+#: ../clients/cli/devices.c:61
msgid "PRODUCT"
msgstr "PRODUKT"
#. 4
-#: ../cli/src/devices.c:94
+#: ../clients/cli/devices.c:62
msgid "DRIVER"
msgstr "STEROWNIK"
#. 5
-#: ../cli/src/devices.c:95
+#: ../clients/cli/devices.c:63
msgid "DRIVER-VERSION"
msgstr "WERSJA-STEROWNIKA"
#. 6
-#: ../cli/src/devices.c:96
+#: ../clients/cli/devices.c:64
msgid "FIRMWARE-VERSION"
msgstr "WERSJA-OPROGRAMOWANIA-SPRZĘTOWEGO"
#. 7
-#: ../cli/src/devices.c:97
+#: ../clients/cli/devices.c:65
msgid "HWADDR"
msgstr "ADRES-SPRZĘTOWY"
#. 8
-#: ../cli/src/devices.c:98 ../tui/nmt-page-ethernet.c:86
-#: ../tui/nmt-page-infiniband.c:96 ../tui/nmt-page-vlan.c:138
-#: ../tui/nmt-page-wifi.c:364
+#: ../clients/cli/devices.c:66 ../clients/tui/nmt-page-ethernet.c:86
+#: ../clients/tui/nmt-page-infiniband.c:97 ../clients/tui/nmt-page-vlan.c:131
+#: ../clients/tui/nmt-page-wifi.c:373
msgid "MTU"
msgstr "MTU"
#. 10
-#: ../cli/src/devices.c:100
+#: ../clients/cli/devices.c:68
msgid "REASON"
msgstr "PRZYCZYNA"
#. 11
-#: ../cli/src/devices.c:101
+#: ../clients/cli/devices.c:69
msgid "UDI"
msgstr "UDI"
#. 12
-#: ../cli/src/devices.c:102
+#: ../clients/cli/devices.c:70
msgid "IP-IFACE"
msgstr "INTERFEJS-IP"
#. 13
-#: ../cli/src/devices.c:103
+#. 2
+#: ../clients/cli/devices.c:71 ../clients/cli/devices.c:99
+msgid "IS-SOFTWARE"
+msgstr "JEST-PROGRAMOWE"
+
+#. 14
+#: ../clients/cli/devices.c:72
msgid "NM-MANAGED"
msgstr "ZARZÄ„DZANE-PRZEZ-NM"
-#. 15
-#: ../cli/src/devices.c:105
+#. 16
+#: ../clients/cli/devices.c:74
msgid "FIRMWARE-MISSING"
msgstr "BRAK-OPROGRAMOWANIA-SPRZĘTOWEGO"
#. 0
-#: ../cli/src/devices.c:118
+#: ../clients/cli/devices.c:87
msgid "AVAILABLE-CONNECTION-PATHS"
msgstr "DOSTĘPNE-ÅšCIEÅ»KI-POÅÄ„CZEŃ"
#. 1
-#: ../cli/src/devices.c:119
+#: ../clients/cli/devices.c:88
msgid "AVAILABLE-CONNECTIONS"
msgstr "DOSTĘPNE-POÅÄ„CZENIA"
#. 0
-#: ../cli/src/devices.c:128
+#: ../clients/cli/devices.c:97
msgid "CARRIER-DETECT"
msgstr "WYKRYWANIE-OPERATORA"
#. 1
-#: ../cli/src/devices.c:129
+#: ../clients/cli/devices.c:98
msgid "SPEED"
msgstr "PRĘDKOŚĆ"
#. 0
-#: ../cli/src/devices.c:138
+#: ../clients/cli/devices.c:108
msgid "CARRIER"
msgstr "OPERATOR"
#. 0
-#: ../cli/src/devices.c:147 ../cli/src/devices.c:568
+#: ../clients/cli/devices.c:117 ../clients/cli/devices.c:548
msgid "WEP"
msgstr "WEP"
#. 1
-#: ../cli/src/devices.c:148
+#: ../clients/cli/devices.c:118
msgid "WPA"
msgstr "WPA"
#. 2
-#: ../cli/src/devices.c:149 ../cli/src/devices.c:576
+#: ../clients/cli/devices.c:119 ../clients/cli/devices.c:556
msgid "WPA2"
msgstr "WPA2"
#. 3
-#: ../cli/src/devices.c:150
+#: ../clients/cli/devices.c:120
msgid "TKIP"
msgstr "TKIP"
#. 4
-#: ../cli/src/devices.c:151
+#: ../clients/cli/devices.c:121
msgid "CCMP"
msgstr "CCMP"
#. 5
#. 2
-#: ../cli/src/devices.c:152 ../cli/src/devices.c:242
+#: ../clients/cli/devices.c:122 ../clients/cli/devices.c:222
msgid "AP"
msgstr "PUNKT-DOSTĘPOWY"
#. 6
-#: ../cli/src/devices.c:153
+#: ../clients/cli/devices.c:123
msgid "ADHOC"
msgstr "ADHOC"
#. 0
-#: ../cli/src/devices.c:162
+#: ../clients/cli/devices.c:132
msgid "CTR-FREQ"
msgstr "CZĘSTOTLIWOŚĆ-CTR"
#. 1
-#: ../cli/src/devices.c:163
+#: ../clients/cli/devices.c:133
msgid "RSSI"
msgstr "RSSI"
#. 2
-#: ../cli/src/devices.c:164
+#: ../clients/cli/devices.c:134
msgid "CINR"
msgstr "CINR"
#. 3
-#: ../cli/src/devices.c:165
+#: ../clients/cli/devices.c:135
msgid "TX-POW"
msgstr "TX-POW"
#. 4
-#: ../cli/src/devices.c:166
+#: ../clients/cli/devices.c:136
msgid "BSID"
msgstr "BSID"
#. 0
-#: ../cli/src/devices.c:175 ../tui/nmt-page-wifi.c:221
+#: ../clients/cli/devices.c:145 ../clients/tui/nmt-page-wifi.c:227
msgid "SSID"
msgstr "SSID"
#. 1
-#: ../cli/src/devices.c:176
+#: ../clients/cli/devices.c:146
msgid "SSID-HEX"
msgstr "SZESNASTKOWY-SSID"
#. 2
-#: ../cli/src/devices.c:177 ../tui/nmt-page-wifi.c:352
+#: ../clients/cli/devices.c:147 ../clients/tui/nmt-page-wifi.c:361
msgid "BSSID"
msgstr "BSSID"
#. 3
-#: ../cli/src/devices.c:178
+#: ../clients/cli/devices.c:148
msgid "MODE"
msgstr "TRYB"
#. 4
-#: ../cli/src/devices.c:179
+#: ../clients/cli/devices.c:149
msgid "CHAN"
msgstr "KANAÅ"
#. 5
-#: ../cli/src/devices.c:180
+#: ../clients/cli/devices.c:150
msgid "FREQ"
msgstr "CZĘSTOTLIWOŚĆ"
#. 6
-#: ../cli/src/devices.c:181
+#: ../clients/cli/devices.c:151
msgid "RATE"
msgstr "OCENA"
#. 7
#. 1
-#: ../cli/src/devices.c:182 ../cli/src/devices.c:202
+#: ../clients/cli/devices.c:152 ../clients/cli/devices.c:172
msgid "SIGNAL"
msgstr "SYGNAÅ"
#. 8
-#: ../cli/src/devices.c:183
+#: ../clients/cli/devices.c:153
msgid "BARS"
msgstr "PASKI"
#. 9
-#: ../cli/src/devices.c:184
+#: ../clients/cli/devices.c:154
msgid "SECURITY"
msgstr "ZABEZPIECZENIA"
#. 10
-#: ../cli/src/devices.c:185
+#: ../clients/cli/devices.c:155
msgid "WPA-FLAGS"
msgstr "FLAGI-WPA"
#. 11
-#: ../cli/src/devices.c:186
+#: ../clients/cli/devices.c:156
msgid "RSN-FLAGS"
msgstr "FLAGI-RSN"
#. 14
-#: ../cli/src/devices.c:189
+#: ../clients/cli/devices.c:159
msgid "*"
msgstr "*"
#. 0
#. 5
-#: ../cli/src/devices.c:201 ../cli/src/devices.c:245
+#: ../clients/cli/devices.c:171 ../clients/cli/devices.c:225
msgid "NSP"
msgstr "NSP"
#. 0
-#: ../cli/src/devices.c:216
+#: ../clients/cli/devices.c:186
msgid "SLAVES"
msgstr "PODRZĘDNE"
#. 0
-#: ../cli/src/devices.c:225
+#: ../clients/cli/devices.c:195
+msgid "PARENT"
+msgstr "NADRZĘDNE"
+
+#. 1
+#: ../clients/cli/devices.c:196
msgid "ID"
msgstr "ID"
#. 0
-#: ../cli/src/devices.c:240
+#: ../clients/cli/devices.c:205 ../clients/cli/devices.c:220
msgid "CAPABILITIES"
msgstr "MOŻLIWOŚCI"
#. 1
-#: ../cli/src/devices.c:241
+#: ../clients/cli/devices.c:221
msgid "WIFI-PROPERTIES"
msgstr "WÅAÅšCIWOÅšCI-WIFI"
#. 3
-#: ../cli/src/devices.c:243
+#: ../clients/cli/devices.c:223
msgid "WIRED-PROPERTIES"
msgstr "WÅAÅšCIWOÅšCI-POÅÄ„CZENIA-PRZEWODOWEGO"
#. 4
-#: ../cli/src/devices.c:244
+#: ../clients/cli/devices.c:224
msgid "WIMAX-PROPERTIES"
msgstr "WÅAÅšCIWOÅšCI-WIMAX"
#. 10
-#: ../cli/src/devices.c:250 ../tui/nmt-page-bond.c:73
+#: ../clients/cli/devices.c:230 ../clients/tui/nmt-page-bond.c:354
msgid "BOND"
msgstr "WIÄ„ZANE"
+#. 11
+#: ../clients/cli/devices.c:231 ../clients/tui/nmt-page-team.c:148
+msgid "TEAM"
+msgstr "ZESPÓÅ"
+
#. 12
-#: ../cli/src/devices.c:252
+#: ../clients/cli/devices.c:232 ../clients/tui/nmt-page-bridge.c:77
+msgid "BRIDGE"
+msgstr "MOSTEK"
+
+#. 14
+#: ../clients/cli/devices.c:234
+msgid "BLUETOOTH"
+msgstr "BLUETOOTH"
+
+#. 15
+#: ../clients/cli/devices.c:235
msgid "CONNECTIONS"
msgstr "POÅÄ„CZENIA"
-#: ../cli/src/devices.c:277
+#: ../clients/cli/devices.c:259
#, c-format
msgid ""
"Usage: nmcli device { COMMAND | help }\n"
"\n"
-"COMMAND := { status | show | connect | disconnect | wifi | wimax }\n"
+"COMMAND := { status | show | connect | disconnect | delete | wifi | wimax }\n"
"\n"
-"COMMAND := { status | show | connect | disconnect | wifi }\n"
+"COMMAND := { status | show | connect | disconnect | delete | wifi }\n"
"\n"
" status\n"
"\n"
@@ -3201,6 +3459,8 @@ msgid ""
"\n"
" disconnect <ifname>\n"
"\n"
+" delete <ifname>\n"
+"\n"
" wifi [list [ifname <ifname>] [bssid <BSSID>]]\n"
"\n"
" wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] "
@@ -3214,9 +3474,10 @@ msgid ""
msgstr ""
"Użycie: nmcli device { POLECENIE | help }\n"
"\n"
-"POLECENIE := { status | show | connect | disconnect | wifi | wimax }\n"
+"POLECENIE := { status | show | connect | disconnect | delete | wifi | "
+"wimax }\n"
"\n"
-"POLECENIE := { status | show | connect | disconnect | wifi }\n"
+"POLECENIE := { status | show | connect | disconnect | delete | wifi }\n"
"\n"
" status\n"
"\n"
@@ -3226,6 +3487,8 @@ msgstr ""
"\n"
" disconnect <nazwa-interfejsu>\n"
"\n"
+" delete <nazwa-interfejsu>\n"
+"\n"
" wifi [list [ifname <nazwa-interfejsu>] [bssid <BSSID>]]\n"
"\n"
" wifi connect <(B)SSID> [password <hasło>] [wep-key-type key|phrase] "
@@ -3238,7 +3501,7 @@ msgstr ""
" wimax [list [ifname <nazwa-interfejsu>] [nsp <nazwa>]]\n"
"\n"
-#: ../cli/src/devices.c:301
+#: ../clients/cli/devices.c:283
#, c-format
msgid ""
"Usage: nmcli device status { help }\n"
@@ -3268,7 +3531,7 @@ msgstr ""
"device\" wywołuje \"nmcli device status\".\n"
"\n"
-#: ../cli/src/devices.c:317
+#: ../clients/cli/devices.c:298
#, c-format
msgid ""
"Usage: nmcli device show { ARGUMENTS | help }\n"
@@ -3281,13 +3544,13 @@ msgid ""
msgstr ""
"Użycie: nmcli device show { PARAMETRY | help }\n"
"\n"
-"PARAMETRY := [<ifname>]\n"
+"PARAMETRY := [<nazwa-interfejsu>]\n"
"\n"
"Wyświetla szczegóły urządzeń.\n"
"Polecenie wyświetla szczegóły dla wszystkich urządzeń lub tylko podanego.\n"
"\n"
-#: ../cli/src/devices.c:329
+#: ../clients/cli/devices.c:309
#, c-format
msgid ""
"Usage: nmcli device connect { ARGUMENTS | help }\n"
@@ -3310,7 +3573,7 @@ msgstr ""
"automatyczne Å‚Ä…czenie.\n"
"\n"
-#: ../cli/src/devices.c:342
+#: ../clients/cli/devices.c:321
#, c-format
msgid ""
"Usage: nmcli device disconnect { ARGUMENTS | help }\n"
@@ -3331,7 +3594,30 @@ msgstr ""
"aktywowanie połączeń bez działania użytkownika.\n"
"\n"
-#: ../cli/src/devices.c:355
+#: ../clients/cli/devices.c:333
+#, c-format
+msgid ""
+"Usage: nmcli device delete { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := <ifname>\n"
+"\n"
+"Deletes the software device.\n"
+"The command removes the interface. It only works for software devices\n"
+"(like bonds, bridges, etc.). Hardware devices cannot be deleted by the\n"
+"command.\n"
+"\n"
+msgstr ""
+"Użycie: nmcli device delete { PARAMETRY | help }\n"
+"\n"
+"PARAMETRY := [<nazwa-interfejsu>]\n"
+"\n"
+"Usuwa urzÄ…dzenie programowe.\n"
+"Polecenie usuwa interfejs. Działa tylko dla urządzeń programowych (takich\n"
+"jak wiązanie, mostkowanie itp.). Urządzenia sprzętowe nie mogą być usuwane\n"
+"tym poleceniem.\n"
+"\n"
+
+#: ../clients/cli/devices.c:346
#, c-format
msgid ""
"Usage: nmcli device wifi { ARGUMENTS | help }\n"
@@ -3400,7 +3686,7 @@ msgstr ""
"należy użyć \"nmcli device wifi list\".\n"
"\n"
-#: ../cli/src/devices.c:389
+#: ../clients/cli/devices.c:379
#, c-format
msgid ""
"Usage: nmcli device wimax { ARGUMENTS | help }\n"
@@ -3424,200 +3710,217 @@ msgstr ""
"NSP.\n"
"\n"
-#: ../cli/src/devices.c:483
+#: ../clients/cli/devices.c:468 ../clients/cli/devices.c:659
msgid "(none)"
msgstr "(brak)"
-#: ../cli/src/devices.c:552
+#: ../clients/cli/devices.c:536
#, c-format
msgid "%u MHz"
msgstr "%u MHz"
-#: ../cli/src/devices.c:553
+#: ../clients/cli/devices.c:537
#, c-format
msgid "%u Mbit/s"
msgstr "%u Mbit/s"
-#: ../cli/src/devices.c:572
+#: ../clients/cli/devices.c:552
msgid "WPA1"
msgstr "WPA1"
-#: ../cli/src/devices.c:581
+#: ../clients/cli/devices.c:561
msgid "802.1X"
msgstr "802.1X"
-#: ../cli/src/devices.c:597
+#: ../clients/cli/devices.c:577
msgid "Ad-Hoc"
msgstr "Ad-hoc"
-#: ../cli/src/devices.c:598
+#: ../clients/cli/devices.c:578
msgid "Infra"
msgstr "Infrastruktura"
-#: ../cli/src/devices.c:630
+#: ../clients/cli/devices.c:579
+msgid "N/A"
+msgstr "Nie dotyczy"
+
+#: ../clients/cli/devices.c:610
msgid "Home"
msgstr "Dom"
-#: ../cli/src/devices.c:633
+#: ../clients/cli/devices.c:613
msgid "Partner"
msgstr "Partner"
-#: ../cli/src/devices.c:636
+#: ../clients/cli/devices.c:616
msgid "Roaming"
msgstr "Roaming"
-#: ../cli/src/devices.c:730
+#: ../clients/cli/devices.c:774
msgid "Device details"
msgstr "Informacje o urzÄ…dzeniu"
-#: ../cli/src/devices.c:742
+#: ../clients/cli/devices.c:786
#, c-format
msgid "Error: 'device show': %s"
msgstr "BÅ‚Ä…d: \"device show\": %s"
-#: ../cli/src/devices.c:792 ../cli/src/devices.c:795 ../cli/src/devices.c:1342
-#: ../cli/src/devices.c:1484
+#: ../clients/cli/devices.c:837 ../clients/cli/devices.c:840
msgid "(unknown)"
msgstr "(nieznane)"
-#: ../cli/src/devices.c:832
+#: ../clients/cli/devices.c:878
#, c-format
msgid "%u Mb/s"
msgstr "%u Mb/s"
-#: ../cli/src/devices.c:918
+#: ../clients/cli/devices.c:964
msgid "on"
msgstr "włączone"
-#: ../cli/src/devices.c:918
+#: ../clients/cli/devices.c:964
msgid "off"
msgstr "wyłączone"
-#: ../cli/src/devices.c:1193
+#: ../clients/cli/devices.c:1238
#, c-format
msgid "Error: 'device status': %s"
msgstr "BÅ‚Ä…d: \"device status\": %s"
#. Add headers
-#: ../cli/src/devices.c:1211
+#: ../clients/cli/devices.c:1245
msgid "Status of devices"
msgstr "Stan urzÄ…dzenia"
-#: ../cli/src/devices.c:1242
+#: ../clients/cli/devices.c:1276
#, c-format
msgid "Error: invalid extra argument '%s'."
msgstr "Błąd: nieprawidłowy dodatkowy parametr \"%s\"."
-#: ../cli/src/devices.c:1270 ../cli/src/devices.c:1432
-#: ../cli/src/devices.c:1566 ../cli/src/devices.c:1705
-#: ../cli/src/devices.c:2449
+#: ../clients/cli/devices.c:1293 ../clients/cli/devices.c:1591
+#: ../clients/cli/devices.c:1741 ../clients/cli/devices.c:1828
+#: ../clients/cli/devices.c:1961 ../clients/cli/devices.c:2622
#, c-format
msgid "Error: Device '%s' not found."
msgstr "BÅ‚Ä…d: nie odnaleziono urzÄ…dzenia \"%s\"."
-#: ../cli/src/devices.c:1325
+#: ../clients/cli/devices.c:1371
#, c-format
msgid "Device '%s' successfully activated with '%s'.\n"
msgstr "Pomyślnie aktywowano urządzenie \"%s\" za pomocą \"%s\".\n"
-#: ../cli/src/devices.c:1341
+#: ../clients/cli/devices.c:1377
+#, c-format
+msgid "Error: Connection activation failed: (%d) %s.\n"
+msgstr "Błąd: aktywacja połączenia się nie powiodła: (%d) %s.\n"
+
+#: ../clients/cli/devices.c:1411
+#, c-format
+msgid "Error: Failed to add/activate new connection: %s"
+msgstr "Błąd: dodanie/aktywacja nowego połączenia się nie powiodła: %s"
+
+#: ../clients/cli/devices.c:1420
+#, c-format
+msgid "Error: Failed to add/activate new connection: Unknown error"
+msgstr ""
+"Błąd: dodanie/aktywacja nowego połączenia się nie powiodła: nieznany błąd"
+
+#: ../clients/cli/devices.c:1431
+#, c-format
+msgid "Connection with UUID '%s' created and activated on device '%s'\n"
+msgstr "Utworzono i aktywowano połączenie o UUID \"%s\" na urządzeniu \"%s\"\n"
+
+#: ../clients/cli/devices.c:1495
#, c-format
msgid "Error: Device activation failed: %s"
msgstr "Błąd: aktywacja urządzenia się nie powiodła: %s"
-#: ../cli/src/devices.c:1349
+#: ../clients/cli/devices.c:1504
#, c-format
msgid "Error: Device activation failed: device was disconnected"
msgstr ""
"Błąd: aktywacja urządzenia się nie powiodła: urządzenie zostało rozłączone"
-#: ../cli/src/devices.c:1362
+#: ../clients/cli/devices.c:1519
#, c-format
msgid "Device '%s' has been connected.\n"
msgstr "Urządzenie \"%s\" zostało połączone.\n"
-#: ../cli/src/devices.c:1391 ../cli/src/devices.c:1400
-#: ../cli/src/devices.c:1525 ../cli/src/devices.c:1534
+#: ../clients/cli/devices.c:1560 ../clients/cli/devices.c:1569
+#: ../clients/cli/devices.c:1710 ../clients/cli/devices.c:1719
+#: ../clients/cli/devices.c:1798 ../clients/cli/devices.c:1806
#, c-format
msgid "Error: No interface specified."
msgstr "Błąd: nie podano żadnego interfejsu."
-#: ../cli/src/devices.c:1406 ../cli/src/devices.c:1540
+#: ../clients/cli/devices.c:1575 ../clients/cli/devices.c:1725
+#: ../clients/cli/devices.c:1812
#, c-format
msgid "Error: extra argument not allowed: '%s'."
msgstr "BÅ‚Ä…d: niedozwolony dodatkowy parametr: \"%s\"."
-#: ../cli/src/devices.c:1469
+#: ../clients/cli/devices.c:1639 ../clients/cli/devices.c:1650
#, c-format
-msgid "Success: Device '%s' successfully disconnected."
-msgstr "Powodzenie: urządzenie \"%s\" zostało rozłączone."
+msgid "Device '%s' successfully disconnected.\n"
+msgstr "Pomyślnie rozłączono urządzenie \"%s\".\n"
-#: ../cli/src/devices.c:1481
+#: ../clients/cli/devices.c:1664
#, c-format
msgid "Error: Device '%s' (%s) disconnecting failed: %s"
msgstr "Błąd: rozłączenie urządzenia \"%s\" (%s) się nie powiodło: %s"
-#: ../cli/src/devices.c:1495
+#: ../clients/cli/devices.c:1679
#, c-format
msgid "Device '%s' has been disconnected.\n"
msgstr "Urządzenie \"%s\" zostało rozłączone.\n"
-#: ../cli/src/devices.c:1637
+#: ../clients/cli/devices.c:1770
+#, c-format
+msgid "Error: Device '%s' (%s) deletion failed: %s"
+msgstr "Błąd: usunięcie urządzenia \"%s\" (%s) się nie powiodło: %s"
+
+#: ../clients/cli/devices.c:1834
+#, c-format
+msgid "Error: Device '%s' is a hardware device. It can't be deleted."
+msgstr ""
+"Błąd: urządzenie \"%s\" jest urządzeniem sprzętowym i nie może zostać "
+"usunięte."
+
+#: ../clients/cli/devices.c:1904
msgid "Wi-Fi scan list"
msgstr "Lista skanowania sieci Wi-Fi"
-#: ../cli/src/devices.c:1675
+#: ../clients/cli/devices.c:1942
#, c-format
msgid "Error: 'device wifi': %s"
msgstr "BÅ‚Ä…d: \"device wifi\": %s"
-#: ../cli/src/devices.c:1728 ../cli/src/devices.c:1797
+#: ../clients/cli/devices.c:1984 ../clients/cli/devices.c:2059
#, c-format
msgid "Error: Access point with bssid '%s' not found."
msgstr "Błąd: nie odnaleziono punktu dostępowego z BSSID \"%s\"."
-#: ../cli/src/devices.c:1752 ../cli/src/devices.c:2144
-#: ../cli/src/devices.c:2306
+#: ../clients/cli/devices.c:2008 ../clients/cli/devices.c:2325
+#: ../clients/cli/devices.c:2489
#, c-format
msgid "Error: Device '%s' is not a Wi-Fi device."
msgstr "BÅ‚Ä…d: urzÄ…dzenie \"%s\" nie jest urzÄ…dzeniem WiFi."
-#: ../cli/src/devices.c:1834 ../cli/src/devices.c:1881
-#, c-format
-msgid "Connection with UUID '%s' created and activated on device '%s'\n"
-msgstr "Utworzono i aktywowano połączenie o UUID \"%s\" na urządzeniu \"%s\"\n"
-
-#: ../cli/src/devices.c:1838
-#, c-format
-msgid "Error: Connection activation failed: (%d) %s."
-msgstr "Błąd: aktywacja połączenia się nie powiodła: (%d) %s."
-
-#: ../cli/src/devices.c:1863
-#, c-format
-msgid "Error: Failed to add/activate new connection: (%d) %s"
-msgstr "Błąd: dodanie/aktywacja nowego połączenia się nie powiodła: (%d) %s"
-
-#: ../cli/src/devices.c:1871
-#, c-format
-msgid "Error: Failed to add/activate new connection: Unknown error"
-msgstr ""
-"Błąd: dodanie/aktywacja nowego połączenia się nie powiodła: nieznany błąd"
-
-#: ../cli/src/devices.c:2026
+#: ../clients/cli/devices.c:2218
msgid "SSID or BSSID: "
msgstr "SSID lub BSSID: "
-#: ../cli/src/devices.c:2031
+#: ../clients/cli/devices.c:2223
#, c-format
msgid "Error: SSID or BSSID are missing."
msgstr "BÅ‚Ä…d: brak SSID lub BSSID."
-#: ../cli/src/devices.c:2055
+#: ../clients/cli/devices.c:2247
#, c-format
msgid "Error: bssid argument value '%s' is not a valid BSSID."
msgstr "Błąd: wartość parametru BSSID \"%s\" nie jest prawidłowym BSSID."
-#: ../cli/src/devices.c:2079
+#: ../clients/cli/devices.c:2271
#, c-format
msgid ""
"Error: wep-key-type argument value '%s' is invalid, use 'key' or 'phrase'."
@@ -3625,152 +3928,152 @@ msgstr ""
"Błąd: wartość \"%s\" parametru wep-key-type jest nieprawidłowa, należy użyć "
"\"key\" lub \"phrase\"."
-#: ../cli/src/devices.c:2099
+#: ../clients/cli/devices.c:2291
#, c-format
msgid "Error: %s: %s."
msgstr "BÅ‚Ä…d: %s: %s."
-#: ../cli/src/devices.c:2114
+#: ../clients/cli/devices.c:2306
#, c-format
msgid "Error: BSSID to connect to (%s) differs from bssid argument (%s)."
msgstr "Błąd: BSSID do połączenia (%s) różni się od parametru BSSID (%s)."
-#: ../cli/src/devices.c:2120
+#: ../clients/cli/devices.c:2312
#, c-format
msgid "Error: Parameter '%s' is neither SSID nor BSSID."
msgstr "BÅ‚Ä…d: parametr \"%s\" nie wynosi SSID ani BSSID."
-#: ../cli/src/devices.c:2146 ../cli/src/devices.c:2308
+#: ../clients/cli/devices.c:2327 ../clients/cli/devices.c:2491
#, c-format
msgid "Error: No Wi-Fi device found."
msgstr "BÅ‚Ä…d: nie odnaleziono urzÄ…dzenia WiFi."
-#: ../cli/src/devices.c:2164
+#: ../clients/cli/devices.c:2345
#, c-format
msgid "Error: No network with SSID '%s' found."
msgstr "BÅ‚Ä…d: nie odnaleziono sieci z SSID \"%s\"."
-#: ../cli/src/devices.c:2166
+#: ../clients/cli/devices.c:2347
#, c-format
msgid "Error: No access point with BSSID '%s' found."
msgstr "Błąd: nie odnaleziono punktu dostępowego z BSSID \"%s\"."
-#: ../cli/src/devices.c:2205
+#: ../clients/cli/devices.c:2386
msgid "Password: "
msgstr "Hasło: "
-#: ../cli/src/devices.c:2334
+#: ../clients/cli/devices.c:2518
#, c-format
msgid "Error: 'device wifi' command '%s' is not valid."
msgstr "Błąd: polecenie \"device wifi\" \"%s\" jest nieprawidłowe."
-#: ../cli/src/devices.c:2381
+#: ../clients/cli/devices.c:2565
msgid "WiMAX NSP list"
msgstr "Lista NSP sieci WiMAX"
-#: ../cli/src/devices.c:2418
+#: ../clients/cli/devices.c:2602
#, c-format
msgid "Error: 'device wimax': %s"
msgstr "BÅ‚Ä…d: \"device wimax\": %s"
-#: ../cli/src/devices.c:2472
+#: ../clients/cli/devices.c:2645
#, c-format
msgid "Error: NSP with name '%s' not found."
msgstr "BÅ‚Ä…d: nie odnaleziono NSP o nazwie \"%s\"."
-#: ../cli/src/devices.c:2485
+#: ../clients/cli/devices.c:2658
#, c-format
msgid "Error: Device '%s' is not a WiMAX device."
msgstr "BÅ‚Ä…d: urzÄ…dzenie \"%s\" nie jest urzÄ…dzeniem WiMAX."
-#: ../cli/src/devices.c:2523
+#: ../clients/cli/devices.c:2702
#, c-format
msgid "Error: Access point with nsp '%s' not found."
msgstr "Błąd: nie odnaleziono punktu dostępowego z NSP \"%s\"."
-#: ../cli/src/devices.c:2555
+#: ../clients/cli/devices.c:2739
#, c-format
msgid "Error: 'device wimax' command '%s' is not valid."
msgstr "Błąd: polecenie \"device wimax\" \"%s\" jest nieprawidłowe."
-#: ../cli/src/devices.c:2705
+#: ../clients/cli/devices.c:2912
#, c-format
msgid "Error: 'dev' command '%s' is not valid."
msgstr "Błąd: polecenie \"dev\" \"%s\" jest nieprawidłowe."
-#: ../cli/src/network-manager.c:37
+#: ../clients/cli/general.c:35
msgid "RUNNING"
msgstr "URUCHOMIONE"
#. 0
-#: ../cli/src/network-manager.c:38
+#: ../clients/cli/general.c:36
msgid "VERSION"
msgstr "WERSJA"
#. 2
-#: ../cli/src/network-manager.c:40
+#: ../clients/cli/general.c:38
msgid "STARTUP"
msgstr "URUCHAMIANIE"
#. 3
-#: ../cli/src/network-manager.c:41
+#: ../clients/cli/general.c:39
msgid "CONNECTIVITY"
msgstr "ÅÄ„CZNOŚĆ"
#. 4
-#: ../cli/src/network-manager.c:42
+#: ../clients/cli/general.c:40
msgid "NETWORKING"
msgstr "SIEĆ"
#. 5
-#: ../cli/src/network-manager.c:43
+#: ../clients/cli/general.c:41
msgid "WIFI-HW"
msgstr "SPRZĘT-WIFI"
#. 6
-#: ../cli/src/network-manager.c:44
+#: ../clients/cli/general.c:42
msgid "WIFI"
msgstr "WIFI"
#. 7
-#: ../cli/src/network-manager.c:45
+#: ../clients/cli/general.c:43
msgid "WWAN-HW"
msgstr "SPRZĘT-WWAN"
#. 8
-#: ../cli/src/network-manager.c:46
+#: ../clients/cli/general.c:44
msgid "WWAN"
msgstr "WWAN"
#. 9
-#: ../cli/src/network-manager.c:47
+#: ../clients/cli/general.c:45
msgid "WIMAX-HW"
msgstr "SPRZĘT-WIMAX"
#. 10
-#: ../cli/src/network-manager.c:48
+#: ../clients/cli/general.c:46
msgid "WIMAX"
msgstr "WIMAX"
-#: ../cli/src/network-manager.c:70
+#: ../clients/cli/general.c:68
msgid "PERMISSION"
msgstr "UPRAWNIENIE"
#. 0
-#: ../cli/src/network-manager.c:71
+#: ../clients/cli/general.c:69
msgid "VALUE"
msgstr "WARTOŚĆ"
-#: ../cli/src/network-manager.c:79
+#: ../clients/cli/general.c:77
msgid "LEVEL"
msgstr "POZIOM"
#. 0
-#: ../cli/src/network-manager.c:80
+#: ../clients/cli/general.c:78
msgid "DOMAINS"
msgstr "DOMENY"
-#: ../cli/src/network-manager.c:95
+#: ../clients/cli/general.c:92
#, c-format
msgid ""
"Usage: nmcli general { COMMAND | help }\n"
@@ -3799,7 +4102,7 @@ msgstr ""
" logging [level <poziom dziennika>] [domains <domeny dziennika>]\n"
"\n"
-#: ../cli/src/network-manager.c:107
+#: ../clients/cli/general.c:103
#, c-format
msgid ""
"Usage: nmcli general status { help }\n"
@@ -3816,7 +4119,7 @@ msgstr ""
"\"nmcli gen status\"\n"
"\n"
-#: ../cli/src/network-manager.c:117
+#: ../clients/cli/general.c:112
#, c-format
msgid ""
"Usage: nmcli general hostname { ARGUMENTS | help }\n"
@@ -3839,7 +4142,7 @@ msgstr ""
"ustawi ją jako nową trwałą systemową nazwę komputera.\n"
"\n"
-#: ../cli/src/network-manager.c:130
+#: ../clients/cli/general.c:124
#, c-format
msgid ""
"Usage: nmcli general permissions { help }\n"
@@ -3852,7 +4155,7 @@ msgstr ""
"Wyświetla uprawnienia dzwoniącego dla uwierzytelnionych działań.\n"
"\n"
-#: ../cli/src/network-manager.c:139
+#: ../clients/cli/general.c:132
#, c-format
msgid ""
"Usage: nmcli general logging { ARGUMENTS | help }\n"
@@ -3878,7 +4181,7 @@ msgstr ""
"podręcznika.\n"
"\n"
-#: ../cli/src/network-manager.c:153
+#: ../clients/cli/general.c:145
#, c-format
msgid ""
"Usage: nmcli networking { COMMAND | help }\n"
@@ -3903,7 +4206,7 @@ msgstr ""
" connectivity [check]\n"
"\n"
-#: ../cli/src/network-manager.c:164
+#: ../clients/cli/general.c:155
#, c-format
msgid ""
"Usage: nmcli networking on { help }\n"
@@ -3916,7 +4219,7 @@ msgstr ""
"Włącza sieć.\n"
"\n"
-#: ../cli/src/network-manager.c:173
+#: ../clients/cli/general.c:163
#, c-format
msgid ""
"Usage: nmcli networking off { help }\n"
@@ -3929,7 +4232,7 @@ msgstr ""
"Wyłącza sieć.\n"
"\n"
-#: ../cli/src/network-manager.c:182
+#: ../clients/cli/general.c:171
#, c-format
msgid ""
"Usage: nmcli networking connectivity { ARGUMENTS | help }\n"
@@ -3950,7 +4253,7 @@ msgstr ""
"sprawdzi łączność.\n"
"\n"
-#: ../cli/src/network-manager.c:195
+#: ../clients/cli/general.c:183
#, c-format
msgid ""
"Usage: nmcli radio { COMMAND | help }\n"
@@ -3975,7 +4278,7 @@ msgstr ""
" all | wifi | wwan [ on | off ]\n"
"\n"
-#: ../cli/src/network-manager.c:210
+#: ../clients/cli/general.c:197
#, c-format
msgid ""
"Usage: nmcli radio all { ARGUMENTS | help }\n"
@@ -3992,7 +4295,7 @@ msgstr ""
"Uzyskuje stan wszystkich przełączników radia lub włącza/wyłącza je.\n"
"\n"
-#: ../cli/src/network-manager.c:221
+#: ../clients/cli/general.c:207
#, c-format
msgid ""
"Usage: nmcli radio wifi { ARGUMENTS | help }\n"
@@ -4009,7 +4312,7 @@ msgstr ""
"Uzyskuje stan przełącznika radia Wi-Fi lub włącza/wyłącza go.\n"
"\n"
-#: ../cli/src/network-manager.c:232
+#: ../clients/cli/general.c:217
#, c-format
msgid ""
"Usage: nmcli radio wwan { ARGUMENTS | help }\n"
@@ -4026,7 +4329,7 @@ msgstr ""
"Uzyskuje stan przełącznika radia komórkowego lub włącza/wyłącza go.\n"
"\n"
-#: ../cli/src/network-manager.c:244
+#: ../clients/cli/general.c:228
#, c-format
msgid ""
"Usage: nmcli radio wimax { ARGUMENTS | help }\n"
@@ -4043,173 +4346,164 @@ msgstr ""
"Uzyskuje stan przełącznika radia WiMAX lub włącza/wyłącza go.\n"
"\n"
-#: ../cli/src/network-manager.c:264
+#: ../clients/cli/general.c:248
msgid "asleep"
msgstr "wstrzymane"
-#: ../cli/src/network-manager.c:266
+#: ../clients/cli/general.c:250
msgid "connecting"
msgstr "Å‚Ä…czenie"
-#: ../cli/src/network-manager.c:268
+#: ../clients/cli/general.c:252
msgid "connected (local only)"
msgstr "połączono (tylko lokalnie)"
-#: ../cli/src/network-manager.c:270
+#: ../clients/cli/general.c:254
msgid "connected (site only)"
msgstr "połączono (tylko witryny)"
-#: ../cli/src/network-manager.c:274
+#: ../clients/cli/general.c:258
msgid "disconnecting"
msgstr "rozłączanie"
-#: ../cli/src/network-manager.c:290
+#: ../clients/cli/general.c:274
msgid "portal"
msgstr "portal"
-#: ../cli/src/network-manager.c:292
+#: ../clients/cli/general.c:276
msgid "limited"
msgstr "ograniczone"
-#: ../cli/src/network-manager.c:294
+#: ../clients/cli/general.c:278
msgid "full"
msgstr "pełne"
-#: ../cli/src/network-manager.c:332
+#: ../clients/cli/general.c:316
#, c-format
msgid "Error: only these fields are allowed: %s"
msgstr "BÅ‚Ä…d: tylko te pola sÄ… dozwolone: %s"
-#: ../cli/src/network-manager.c:348 ../cli/src/network-manager.c:349
-#: ../cli/src/network-manager.c:350 ../cli/src/network-manager.c:351
-#: ../cli/src/network-manager.c:352 ../cli/src/network-manager.c:354
-#: ../cli/src/network-manager.c:355
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "enabled"
msgstr "włączone"
-#: ../cli/src/network-manager.c:348 ../cli/src/network-manager.c:349
-#: ../cli/src/network-manager.c:350 ../cli/src/network-manager.c:351
-#: ../cli/src/network-manager.c:352 ../cli/src/network-manager.c:354
-#: ../cli/src/network-manager.c:355
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "disabled"
msgstr "wyłączone"
-#: ../cli/src/network-manager.c:367
+#: ../clients/cli/general.c:346
msgid "NetworkManager status"
msgstr "Stan usługi NetworkManager"
-#: ../cli/src/network-manager.c:372
+#: ../clients/cli/general.c:351
msgid "running"
msgstr "uruchamiany"
-#: ../cli/src/network-manager.c:372
-msgid "not running"
-msgstr "nieuruchomiony"
-
-#: ../cli/src/network-manager.c:375
+#: ../clients/cli/general.c:354
msgid "starting"
msgstr "uruchamianie"
-#: ../cli/src/network-manager.c:375
+#: ../clients/cli/general.c:354
msgid "started"
msgstr "uruchomiono"
-#: ../cli/src/network-manager.c:446
+#: ../clients/cli/general.c:425
msgid "auth"
msgstr "uwierzytelnianie"
-#: ../cli/src/network-manager.c:475
+#: ../clients/cli/general.c:454
#, c-format
msgid "Error: 'general permissions': %s"
msgstr "BÅ‚Ä…d: \"general permissions\": %s"
-#: ../cli/src/network-manager.c:489
+#: ../clients/cli/general.c:468
msgid "NetworkManager permissions"
msgstr "Uprawnienia usługi NetworkManager"
-#: ../cli/src/network-manager.c:530
+#: ../clients/cli/general.c:509
#, c-format
msgid "Error: 'general logging': %s"
msgstr "BÅ‚Ä…d: \"general logging\": %s"
-#: ../cli/src/network-manager.c:545
+#: ../clients/cli/general.c:524
msgid "NetworkManager logging"
msgstr "Dziennik usługi NetworkManager"
-#: ../cli/src/network-manager.c:565
+#: ../clients/cli/general.c:546
#, c-format
-msgid "Error: failed to set hostname: (%d) %s"
-msgstr "Błąd: ustawienie nazwy komputera się nie powiodło: (%d) %s"
+msgid "Error: failed to set hostname: %s"
+msgstr "Błąd: ustawienie nazwy komputera się nie powiodło: %s"
-#: ../cli/src/network-manager.c:682
+#: ../clients/cli/general.c:659
#, c-format
-msgid "Error: access denied to set logging; %s"
-msgstr "Błąd: brak dostępu do ustawienia zapisywania w dzienniku; %s"
+msgid "Error: failed to set logging: %s"
+msgstr "Błąd: ustawienie zapisywania w dzienniku się nie powiodło: %s"
-#: ../cli/src/network-manager.c:684
-#, c-format
-msgid "Error: %s"
-msgstr "BÅ‚Ä…d: %s"
-
-#: ../cli/src/network-manager.c:692
+#: ../clients/cli/general.c:668
#, c-format
msgid "Error: 'general' command '%s' is not valid."
msgstr "Błąd: polecenie \"general\" \"%s\" jest nieprawidłowe."
-#: ../cli/src/network-manager.c:710
+#: ../clients/cli/general.c:686
#, c-format
msgid "Error: '--fields' value '%s' is not valid here (allowed field: %s)"
msgstr ""
"Błąd: wartość \"--fields\" \"%s\" jest nieprawidłowa (dozwolone pola: %s)"
-#: ../cli/src/network-manager.c:735
+#: ../clients/cli/general.c:711
#, c-format
msgid "Error: invalid '%s' argument: '%s' (use on/off)."
msgstr "Błąd: nieprawidłowy parametr \"%s\": \"%s\" (należy użyć on/off)."
-#: ../cli/src/network-manager.c:746
+#: ../clients/cli/general.c:722
msgid "Connectivity"
msgstr "ÅÄ…czność"
-#: ../cli/src/network-manager.c:758
+#: ../clients/cli/general.c:737
msgid "Networking"
msgstr "Sieć"
-#: ../cli/src/network-manager.c:783
+#: ../clients/cli/general.c:762
#, c-format
msgid "Error: 'networking connectivity' command '%s' is not valid."
msgstr "Błąd: polecenie \"networking connectivity\" \"%s\" jest nieprawidłowe."
-#: ../cli/src/network-manager.c:799
+#: ../clients/cli/general.c:778
#, c-format
msgid "Error: 'networking' command '%s' is not valid."
msgstr "Błąd: polecenie \"networking\" \"%s\" jest nieprawidłowe."
-#: ../cli/src/network-manager.c:825 ../cli/src/network-manager.c:845
+#: ../clients/cli/general.c:807 ../clients/cli/general.c:827
msgid "Radio switches"
msgstr "Przełączniki radiowe"
#. no argument, show current WiFi state
-#: ../cli/src/network-manager.c:863
+#: ../clients/cli/general.c:845
msgid "Wi-Fi radio switch"
msgstr "Przełącznik radiowy Wi-Fi"
#. no argument, show current WWAN (mobile broadband) state
-#: ../cli/src/network-manager.c:879
+#: ../clients/cli/general.c:861
msgid "WWAN radio switch"
msgstr "Przełącznik radiowy WWAN"
#. no argument, show current WiMAX state
-#: ../cli/src/network-manager.c:896
+#: ../clients/cli/general.c:878
msgid "WiMAX radio switch"
msgstr "Przełącznik radiowy WiMAX"
-#: ../cli/src/network-manager.c:908
+#: ../clients/cli/general.c:890
#, c-format
msgid "Error: 'radio' command '%s' is not valid."
msgstr "Błąd: polecenie \"radio\" \"%s\" jest nieprawidłowe."
-#: ../cli/src/nmcli.c:83
+#: ../clients/cli/nmcli.c:86
#, c-format
msgid ""
"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
@@ -4235,6 +4529,7 @@ msgid ""
" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+" a[gent] NetworkManager secret agent or polkit agent\n"
"\n"
msgstr ""
"Użycie: %s [OPCJE] OBIEKT { POLECENIE | help }\n"
@@ -4261,257 +4556,214 @@ msgstr ""
" nm stan usługi NetworkManager\n"
" c[onnection] połączenia usługi NetworkManager\n"
" d[evice] urządzenia zarządzane przez usługę NetworkManager\n"
+" a[gent] agent haseł lub agent polkit usługi NetworkManager\n"
"\n"
-#: ../cli/src/nmcli.c:137
+#: ../clients/cli/nmcli.c:142
#, c-format
msgid "Error: Object '%s' is unknown, try 'nmcli help'."
msgstr ""
"Błąd: obiekt \"%s\" jest nieznany, można spróbować polecenie \"nmcli help\"."
-#: ../cli/src/nmcli.c:167
+#: ../clients/cli/nmcli.c:172
#, c-format
msgid "Error: Option '--terse' is specified the second time."
msgstr "Błąd: opcja \"--terse\" został podana po raz drugi."
-#: ../cli/src/nmcli.c:172
+#: ../clients/cli/nmcli.c:177
#, c-format
msgid "Error: Option '--terse' is mutually exclusive with '--pretty'."
msgstr ""
"BÅ‚Ä…d: opcja \"--terse\" jest wzajemnie wykluczajÄ…ca z opcjÄ… \"--pretty\"."
-#: ../cli/src/nmcli.c:180
+#: ../clients/cli/nmcli.c:185
#, c-format
msgid "Error: Option '--pretty' is specified the second time."
msgstr "Błąd: opcja \"--pretty\" został podana po raz drugi."
-#: ../cli/src/nmcli.c:185
+#: ../clients/cli/nmcli.c:190
#, c-format
msgid "Error: Option '--pretty' is mutually exclusive with '--terse'."
msgstr ""
"BÅ‚Ä…d: opcja \"--pretty\" jest wzajemnie wykluczajÄ…ca z opcjÄ… \"--terse\"."
-#: ../cli/src/nmcli.c:195 ../cli/src/nmcli.c:211 ../cli/src/nmcli.c:240
+#: ../clients/cli/nmcli.c:200 ../clients/cli/nmcli.c:216
+#: ../clients/cli/nmcli.c:245
#, c-format
msgid "Error: missing argument for '%s' option."
msgstr "BÅ‚Ä…d: brak parametru dla opcji \"%s\"."
-#: ../cli/src/nmcli.c:204 ../cli/src/nmcli.c:220
+#: ../clients/cli/nmcli.c:209 ../clients/cli/nmcli.c:225
#, c-format
msgid "Error: '%s' is not valid argument for '%s' option."
msgstr "Błąd: \"%s\" nie jest prawidłowym parametrem dla opcji \"%s\"."
-#: ../cli/src/nmcli.c:227
+#: ../clients/cli/nmcli.c:232
#, c-format
msgid "Error: fields for '%s' options are missing."
msgstr "Błąd: brak pól dla opcji \"%s\"."
-#: ../cli/src/nmcli.c:245
+#: ../clients/cli/nmcli.c:250
#, c-format
msgid "Error: '%s' is not a valid timeout for '%s' option."
msgstr "Błąd: \"%s\" nie jest prawidłowym czasem oczekiwania dla opcji \"%s\"."
-#: ../cli/src/nmcli.c:252
+#: ../clients/cli/nmcli.c:257
#, c-format
msgid "nmcli tool, version %s\n"
msgstr "narzędzie nmcli, wersja %s\n"
-#: ../cli/src/nmcli.c:258
+#: ../clients/cli/nmcli.c:263
#, c-format
msgid "Error: Option '%s' is unknown, try 'nmcli -help'."
msgstr ""
"Błąd: opcja \"%s\" jest nieznana. Można spróbować polecenie \"nmcli help\"."
-#: ../cli/src/nmcli.c:293
+#: ../clients/cli/nmcli.c:346 ../clients/cli/nmcli.c:356
#, c-format
msgid ""
"\n"
-"Error: nmcli terminated by signal %d."
+"Error: nmcli terminated by signal %s (%d)\n"
msgstr ""
"\n"
-"Błąd: nmcli zostało zakończone sygnałem %d."
+"Błąd: nmcli zostało zakończone sygnałem %s (%d)\n"
-#: ../cli/src/nmcli.c:323 ../src/main.c:129
+#: ../clients/cli/nmcli.c:387
#, c-format
-msgid "Failed to set signal mask: %d"
-msgstr "Ustawienie maski sygnału nie powiodło: %d"
+msgid "Failed to set signal mask: %d\n"
+msgstr "Ustawienie maski sygnału nie powiodło: %d\n"
-#: ../cli/src/nmcli.c:330 ../src/main.c:138
+#: ../clients/cli/nmcli.c:394
#, c-format
-msgid "Failed to create signal handling thread: %d"
-msgstr "Utworzenie wątku obsługującego sygnały się nie powiodło: %d"
+msgid "Failed to create signal handling thread: %d\n"
+msgstr "Utworzenie wątku obsługującego sygnały się nie powiodło: %d\n"
-#: ../cli/src/nmcli.c:343 ../test/nm-online.c:168
+#: ../clients/cli/nmcli.c:491 ../clients/nm-online.c:197
#, c-format
-msgid "Error: Could not create NMClient object."
-msgstr "Błąd: nie można utworzyć obiektu NMClient."
+msgid "Error: Could not create NMClient object: %s."
+msgstr "Błąd: nie można utworzyć obiektu NMClient: %s."
-#: ../cli/src/nmcli.c:359
+#: ../clients/cli/nmcli.c:508
msgid "Success"
msgstr "Powodzenie"
-#: ../cli/src/settings.c:669
+#: ../clients/cli/polkit-agent.c:82
+#, c-format
+msgid "Authentication message: %s\n"
+msgstr "Komunikat uwierzytelnienia: %s\n"
+
+#: ../clients/cli/polkit-agent.c:88
+#, c-format
+msgid "Authentication error: %s\n"
+msgstr "BÅ‚Ä…d uwierzytelnienia: %s\n"
+
+#: ../clients/cli/polkit-agent.c:134
+#, c-format
+msgid "Warning: polkit agent initialization failed: %s\n"
+msgstr "Ostrzeżenie: zainicjowanie agenta polkit się nie powiodło: %s\n"
+
+#: ../clients/cli/settings.c:670
#, c-format
msgid "%d (key)"
msgstr "%d (klucz)"
-#: ../cli/src/settings.c:671
+#: ../clients/cli/settings.c:672
#, c-format
msgid "%d (passphrase)"
msgstr "%d (hasło)"
-#: ../cli/src/settings.c:674 ../cli/src/settings.c:802
+#: ../clients/cli/settings.c:675 ../clients/cli/settings.c:756
#, c-format
msgid "%d (unknown)"
msgstr "%d (nieznane)"
-#: ../cli/src/settings.c:700
-msgid "0 (unknown)"
-msgstr "0 (nieznane)"
-
-#: ../cli/src/settings.c:706
-msgid "any, "
-msgstr "dowolne, "
-
-#: ../cli/src/settings.c:708
-msgid "900 MHz, "
-msgstr "900 MHz, "
-
-#: ../cli/src/settings.c:710
-msgid "1800 MHz, "
-msgstr "1800 MHz, "
-
-#: ../cli/src/settings.c:712
-msgid "1900 MHz, "
-msgstr "1900 MHz, "
-
-#: ../cli/src/settings.c:714
-msgid "850 MHz, "
-msgstr "850 MHz, "
-
-#: ../cli/src/settings.c:716
-msgid "WCDMA 3GPP UMTS 2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 2100 MHz, "
-
-#: ../cli/src/settings.c:718
-msgid "WCDMA 3GPP UMTS 1800 MHz, "
-msgstr "WCDMA 3GPP UMTS 1800 MHz, "
-
-#: ../cli/src/settings.c:720
-msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, "
-
-#: ../cli/src/settings.c:722
-msgid "WCDMA 3GPP UMTS 800 MHz, "
-msgstr "WCDMA 3GPP UMTS 800 MHz, "
-
-#: ../cli/src/settings.c:724
-msgid "WCDMA 3GPP UMTS 850 MHz, "
-msgstr "WCDMA 3GPP UMTS 850 MHz, "
-
-#: ../cli/src/settings.c:726
-msgid "WCDMA 3GPP UMTS 900 MHz, "
-msgstr "WCDMA 3GPP UMTS 900 MHz, "
-
-#: ../cli/src/settings.c:728
-msgid "WCDMA 3GPP UMTS 1700 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700 MHz, "
-
-#: ../cli/src/settings.c:730
-msgid "WCDMA 3GPP UMTS 1900 MHz, "
-msgstr "WCDMA 3GPP UMTS 1900 MHz, "
-
-#: ../cli/src/settings.c:732
-msgid "WCDMA 3GPP UMTS 2600 MHz, "
-msgstr "WCDMA 3GPP UMTS 2600 MHz, "
-
-#: ../cli/src/settings.c:750
+#: ../clients/cli/settings.c:704
msgid "0 (NONE)"
msgstr "0 (BRAK)"
-#: ../cli/src/settings.c:756
+#: ../clients/cli/settings.c:710
msgid "REORDER_HEADERS, "
msgstr "ZMIANA_KOLEJNOÅšCI_NAGÅÓWKÓW, "
-#: ../cli/src/settings.c:758
+#: ../clients/cli/settings.c:712
msgid "GVRP, "
msgstr "GVRP, "
-#: ../cli/src/settings.c:760
+#: ../clients/cli/settings.c:714
msgid "LOOSE_BINDING, "
msgstr "LUŹNE_DOWIĄZANIE, "
-#: ../cli/src/settings.c:796
+#: ../clients/cli/settings.c:750
#, c-format
msgid "%d (disabled)"
msgstr "%d (wyłączone)"
-#: ../cli/src/settings.c:798
+#: ../clients/cli/settings.c:752
#, c-format
msgid "%d (enabled, prefer public IP)"
msgstr "%d (włączone, preferowanie publicznego adresu IP)"
-#: ../cli/src/settings.c:800
+#: ../clients/cli/settings.c:754
#, c-format
msgid "%d (enabled, prefer temporary IP)"
msgstr "%d (włączone, preferowanie tymczasowego adresu IP)"
-#: ../cli/src/settings.c:812
+#: ../clients/cli/settings.c:766
msgid "0 (none)"
msgstr "0 (brak)"
-#: ../cli/src/settings.c:818
+#: ../clients/cli/settings.c:772
msgid "agent-owned, "
msgstr "posiadane przez agenta, "
-#: ../cli/src/settings.c:820
+#: ../clients/cli/settings.c:774
msgid "not saved, "
msgstr "niezapisane, "
-#: ../cli/src/settings.c:822
+#: ../clients/cli/settings.c:776
msgid "not required, "
msgstr "niewymagane, "
-#: ../cli/src/settings.c:1128
+#: ../clients/cli/settings.c:1059
msgid "0 (disabled)"
msgstr "0 (wyłączone)"
-#: ../cli/src/settings.c:1134
+#: ../clients/cli/settings.c:1065
msgid "enabled, "
msgstr "włączone, "
-#: ../cli/src/settings.c:1136
+#: ../clients/cli/settings.c:1067
msgid "advertise, "
msgstr "rozgłaszanie, "
-#: ../cli/src/settings.c:1138
+#: ../clients/cli/settings.c:1069
msgid "willing, "
msgstr "chętne, "
-#: ../cli/src/settings.c:1166
+#: ../clients/cli/settings.c:1097
msgid "-1 (unset)"
msgstr "-1 (usunięcie ustawienia)"
-#: ../cli/src/settings.c:1274 ../cli/src/settings.c:1457
-#: ../cli/src/settings.c:1497
+#: ../clients/cli/settings.c:1194 ../clients/cli/settings.c:1481
+#: ../clients/cli/settings.c:1523
msgid "auto"
msgstr "automatyczne"
-#: ../cli/src/settings.c:1287
+#: ../clients/cli/settings.c:1207
msgid "default"
msgstr "domyślne"
-#: ../cli/src/settings.c:1625
+#: ../clients/cli/settings.c:1651
#, c-format
msgid "Do you also want to set '%s' to '%s'? [yes]: "
msgstr "Ustawić \"%s\" na \"%s\"? [yes]: "
-#: ../cli/src/settings.c:1627
+#: ../clients/cli/settings.c:1653
#, c-format
msgid "Do you also want to clear '%s'? [yes]: "
msgstr "Wyczyścić \"%s\"? [yes]: "
-#: ../cli/src/settings.c:1788
+#: ../clients/cli/settings.c:1814
#, c-format
msgid ""
"Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"
@@ -4519,94 +4771,117 @@ msgstr ""
"Ostrzeżenie: ustawiono %s.%s na \"%s\", ale może zostać zignorowane w trybie "
"infrastruktury\n"
-#: ../cli/src/settings.c:1870 ../cli/src/settings.c:2150
-#: ../cli/src/settings.c:4232
+#: ../clients/cli/settings.c:1833
+#, c-format
+msgid "Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"
+msgstr "Ostrzeżenie: ustawienie %s.%s wymaga usunięcia ustawień IPv4 i IPv6\n"
+
+#: ../clients/cli/settings.c:1835
+msgid "Do you want to remove them? [yes] "
+msgstr "Usunąć je? [yes] "
+
+#: ../clients/cli/settings.c:1931 ../clients/cli/settings.c:2253
+#: ../clients/cli/settings.c:4365
#, c-format
msgid "'%s' is not valid"
msgstr "\"%s\" jest nieprawidłowe"
-#: ../cli/src/settings.c:1893
+#: ../clients/cli/settings.c:1954
#, c-format
msgid "'%d' is not valid; use <%d-%d>"
msgstr "\"%d\" jest nieprawidłowe; należy użyć <%d-%d>"
-#: ../cli/src/settings.c:1915
+#: ../clients/cli/settings.c:1976
+#, c-format
+msgid "'%lld' is not valid; use <%lld-%lld>"
+msgstr "\"%lld\" jest nieprawidłowe; należy użyć <%lld-%lld>"
+
+#: ../clients/cli/settings.c:1998
#, c-format
-msgid "'%u' is not valid; use <%d-%d>"
-msgstr "\"%u\" jest nieprawidłowe; należy użyć <%d-%d>"
+msgid "'%u' is not valid; use <%u-%u>"
+msgstr "\"%u\" jest nieprawidłowe; należy użyć <%u-%u>"
-#: ../cli/src/settings.c:1981
+#: ../clients/cli/settings.c:2064
#, c-format
msgid "'%s' is not valid; use <option>=<value>"
msgstr "\"%s\" jest nieprawidłowe; należy użyć <opcja>=<wartość>"
-#: ../cli/src/settings.c:2015
+#: ../clients/cli/settings.c:2098
#, c-format
msgid "index '%s' is not valid"
msgstr "indeks \"%s\" jest nieprawidłowy"
-#: ../cli/src/settings.c:2020 ../cli/src/settings.c:2045
+#: ../clients/cli/settings.c:2103 ../clients/cli/settings.c:2128
msgid "no item to remove"
msgstr "brak elementu do usunięcia"
-#: ../cli/src/settings.c:2024 ../cli/src/settings.c:2049
+#: ../clients/cli/settings.c:2107 ../clients/cli/settings.c:2132
#, c-format
msgid "index '%d' is not in range <0-%d>"
msgstr "indeks \"%d\" jest poza zakresem <0-%d>"
-#: ../cli/src/settings.c:2064
+#: ../clients/cli/settings.c:2147
#, c-format
msgid "invalid option '%s'"
msgstr "nieprawidłowa opcja \"%s\""
-#: ../cli/src/settings.c:2066
+#: ../clients/cli/settings.c:2149
msgid "missing option"
msgstr "brak opcji"
-#: ../cli/src/settings.c:2096 ../cli/src/settings.c:2116
+#: ../clients/cli/settings.c:2179 ../clients/cli/settings.c:2199
+#: ../clients/cli/settings.c:2219
#, c-format
msgid "'%s' is not a valid number (or out of range)"
msgstr "\"%s\" nie jest prawidłową liczbą (lub jest poza zakresem)"
-#: ../cli/src/settings.c:2170
+#: ../clients/cli/settings.c:2269
#, c-format
msgid "'%s' is not a valid Ethernet MAC"
msgstr "\"%s\" nie jest prawidłowym adresem MAC Ethernetu"
-#: ../cli/src/settings.c:2196 ../libnm-util/nm-setting-bridge.c:296
-#: ../libnm-util/nm-setting-connection.c:830
-#: ../libnm-util/nm-setting-vlan.c:548
+#: ../clients/cli/settings.c:2294 ../libnm-core/nm-setting-connection.c:795
+#: ../libnm-core/nm-setting-infiniband.c:256
+#: ../libnm-util/nm-setting-connection.c:835
+#: ../libnm-util/nm-setting-infiniband.c:270
#, c-format
msgid "'%s' is not a valid interface name"
msgstr "\"%s\" nie jest prawidłową nazwą interfejsu"
-#: ../cli/src/settings.c:2214 ../cli/src/settings.c:3621
-#: ../libnm-util/nm-setting-gsm.c:375
+#: ../clients/cli/settings.c:2318
#, c-format
-msgid "'%s' is not a number"
-msgstr "\"%s\" nie jest liczbÄ…"
+msgid "'%s' is not a valid flag number; use <0-%d>"
+msgstr "\"%s\" nie jest prawidłowym numerem flagi; należy użyć <0-%d>"
+
+#: ../clients/cli/settings.c:2330
+#, c-format
+msgid "Warning: '%s' sum is higher than all flags => all flags set\n"
+msgstr ""
+"Ostrzeżenie: suma \"%s\" jest wyższa niż wszystkie flagi => wszystkie "
+"ustawione flagi\n"
-#: ../cli/src/settings.c:2266
+#: ../clients/cli/settings.c:2371
#, c-format
msgid "'%s' is not a valid hex character"
msgstr "\"%s\" nie jest prawidłowym znakiem szesnastkowym"
-#: ../cli/src/settings.c:2296
+#: ../clients/cli/settings.c:2401
#, c-format
msgid "'%s' is not a valid MAC"
msgstr "\"%s\" nie jest prawidłowym adresem MAC"
-#: ../cli/src/settings.c:2333 ../libnm-util/nm-setting-connection.c:793
+#: ../clients/cli/settings.c:2438 ../libnm-core/nm-setting-connection.c:784
+#: ../libnm-util/nm-setting-connection.c:792
#, c-format
msgid "'%s' is not a valid UUID"
msgstr "\"%s\" nie jest prawidłowym UUID"
-#: ../cli/src/settings.c:2400
+#: ../clients/cli/settings.c:2505
#, c-format
msgid "the property doesn't contain permission '%s'"
msgstr "właściwość nie zawiera uprawnienia \"%s\""
-#: ../cli/src/settings.c:2412
+#: ../clients/cli/settings.c:2517
msgid ""
"Enter a list of user permissions. This is a list of user names formatted "
"as:\n"
@@ -4623,40 +4898,40 @@ msgstr ""
"\n"
"Przykład: alice bob charlie\n"
-#: ../cli/src/settings.c:2431
+#: ../clients/cli/settings.c:2536
#, c-format
msgid "'%s' is not valid master; use ifname or connection UUID"
msgstr ""
"\"%s\" nie jest prawidłowym \"master\"; należy użyć nazwy interfejsu lub "
"UUID połączenia"
-#: ../cli/src/settings.c:2475
+#: ../clients/cli/settings.c:2580
#, c-format
msgid "Warning: %s is not an UUID of any existing connection profile\n"
msgstr ""
"Ostrzeżenie: %s nie jest UUID żadnego istniejącego profilu połączenia\n"
-#: ../cli/src/settings.c:2479 ../cli/src/settings.c:2495
+#: ../clients/cli/settings.c:2584 ../clients/cli/settings.c:2600
#, c-format
msgid "'%s' is not a VPN connection profile"
msgstr "\"%s\" nie jest profilem połączenia VPN"
-#: ../cli/src/settings.c:2488
+#: ../clients/cli/settings.c:2593
#, c-format
msgid "'%s' is not a name of any exiting profile"
msgstr "\"%s\" nie jest nazwą żadnego istniejącego profilu"
-#: ../cli/src/settings.c:2522
+#: ../clients/cli/settings.c:2627
#, c-format
msgid "the value '%s' is not a valid UUID"
msgstr "wartość \"%s\" nie jest prawidłowym UUID"
-#: ../cli/src/settings.c:2529
+#: ../clients/cli/settings.c:2634
#, c-format
msgid "the property doesn't contain UUID '%s'"
msgstr "właściwość nie zawiera UUID \"%s\""
-#: ../cli/src/settings.c:2541
+#: ../clients/cli/settings.c:2646
msgid ""
"Enter secondary connections that should be activated when this connection "
"is\n"
@@ -4677,38 +4952,101 @@ msgstr ""
"\n"
"Przykład: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"
-#: ../cli/src/settings.c:2618
+#: ../clients/cli/settings.c:2723
msgid "private key password not provided"
msgstr "nie podano hasła klucza prywatnego"
-#: ../cli/src/settings.c:2645
+#: ../clients/cli/settings.c:2750
#, c-format
msgid "the property doesn't contain EAP method '%s'"
msgstr "właściwość nie zawiera metody EAP \"%s\""
-#: ../cli/src/settings.c:2670
+#: ../clients/cli/settings.c:2765
+msgid ""
+"Enter file path to CA certificate (optionally prefixed with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/cacert.crt\n"
+msgstr ""
+"Proszę podać ścieżkę do pliku certyfikatu CA (z opcjonalnym przedrostkiem "
+"file://).\n"
+" [file://]<ścieżka do pliku>\n"
+"Proszę zauważyć, że nmcli nie obsługuje podawania certyfikatów jako surowych "
+"danych typu blob.\n"
+"Przykład: /home/cimrman/cacert.crt\n"
+
+#: ../clients/cli/settings.c:2784
#, c-format
msgid "the property doesn't contain alternative subject match '%s'"
msgstr "właściwość nie zawiera alternatywnego dopasowania tematu \"%s\""
-#: ../cli/src/settings.c:2699
+#: ../clients/cli/settings.c:2800
+msgid ""
+"Enter file path to client certificate (optionally prefixed with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/jara.crt\n"
+msgstr ""
+"Proszę podać ścieżkę do pliku certyfikatu klienta (z opcjonalnym "
+"przedrostkiem file://).\n"
+" [file://]<ścieżka do pliku>\n"
+"Proszę zauważyć, że nmcli nie obsługuje podawania certyfikatów jako surowych "
+"danych typu blob.\n"
+"Przykład: /home/cimrman/jara.crt\n"
+
+#: ../clients/cli/settings.c:2812
+msgid ""
+"Enter file path to CA certificate for inner authentication (optionally "
+"prefixed\n"
+"with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/ca-zweite-phase.crt\n"
+msgstr ""
+"Proszę podać ścieżkę do pliku certyfikatu CA do wewnętrznego\n"
+"uwierzytelnienia (z opcjonalnym przedrostkiem file://).\n"
+" [file://]<ścieżka do pliku>\n"
+"Proszę zauważyć, że nmcli nie obsługuje podawania certyfikatów jako surowych "
+"danych typu blob.\n"
+"Przykład: /home/cimrman/ca-zweite-phase.crt\n"
+
+#: ../clients/cli/settings.c:2832
#, c-format
msgid "the property doesn't contain \"phase2\" alternative subject match '%s'"
msgstr ""
"właściwość nie zawiera alternatywnego dopasowania tematu \"phase2\" \"%s\""
-#: ../cli/src/settings.c:2725
+#: ../clients/cli/settings.c:2848
+msgid ""
+"Enter file path to client certificate for inner authentication (optionally "
+"prefixed\n"
+"with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/jara-zweite-phase.crt\n"
+msgstr ""
+"Proszę podać ścieżkę do pliku certyfikatu klienta do wewnętrznego\n"
+"uwierzytelnienia (z opcjonalnym przedrostkiem file://).\n"
+" [file://]<ścieżka do pliku>\n"
+"Proszę zauważyć, że nmcli nie obsługuje podawania certyfikatów jako surowych "
+"danych typu blob.\n"
+"Przykład: /home/cimrman/jara-zweite-phase.crt\n"
+
+#: ../clients/cli/settings.c:2868
msgid ""
"Enter path to a private key and the key password (if not set yet):\n"
-" <file path> [<password>]\n"
+" [file://]<file path> [<password>]\n"
+"Note that nmcli does not support specifying private key as raw blob data.\n"
"Example: /home/cimrman/jara-priv-key Dardanely\n"
msgstr ""
"Proszę podać ścieżkę do klucza prywatnego i jego hasło (jeśli nie jest "
"jeszcze ustawione):\n"
-" <ścieżka do pliku> [<hasło>]\n"
+" [file://]<ścieżka do pliku> [<hasło>]\n"
+"Proszę zauważyć, że nmcli nie obsługuje podawania klucza prywatnego jako "
+"surowych danych typu blob.\n"
"Przykład: /home/cimrman/jara-priv-key Dardanely\n"
-#: ../cli/src/settings.c:2795
+#: ../clients/cli/settings.c:2939
msgid ""
"Enter bytes as a list of hexadecimal values.\n"
"Two formats are accepted:\n"
@@ -4729,7 +5067,7 @@ msgstr ""
"Przykłady: ab0455a6ea3a74C2\n"
" ab 4 55 0xa6 ea 3a 74 C2\n"
-#: ../cli/src/settings.c:2898
+#: ../clients/cli/settings.c:3042
#, c-format
msgid ""
"Enter a list of bonding options formatted as:\n"
@@ -4760,22 +5098,33 @@ msgstr ""
"\n"
"Przykład: mode=2,miimon=120\n"
-#: ../cli/src/settings.c:2939
+#: ../clients/cli/settings.c:3080
#, c-format
msgid "'%s' is not a valid InfiniBand MAC"
msgstr "\"%s\" nie jest prawidłowym adresem MAC InfiniBand"
-#: ../cli/src/settings.c:2977
+#: ../clients/cli/settings.c:3117
#, c-format
msgid "'%s' is not a valid IBoIP P_Key"
msgstr "\"%s\" nie jest prawidłowym P_Key IBoIP"
-#: ../cli/src/settings.c:3045 ../cli/src/settings.c:3390
+#: ../clients/cli/settings.c:3148
+#, c-format
+msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
+msgstr ""
+"\"%s\" jest nieprawidłowe (format: ip[/przedrostek] [next-hop] [parametry])"
+
+#: ../clients/cli/settings.c:3196 ../clients/cli/settings.c:3215
+#, c-format
+msgid "invalid IPv4 address '%s'"
+msgstr "nieprawidłowy adres IPv4 \"%s\""
+
+#: ../clients/cli/settings.c:3221 ../clients/cli/settings.c:3522
#, c-format
msgid "the property doesn't contain DNS server '%s'"
msgstr "właściwość nie zawiera serwera DNS \"%s\""
-#: ../cli/src/settings.c:3057
+#: ../clients/cli/settings.c:3233
msgid ""
"Enter a list of IPv4 addresses of DNS servers.\n"
"\n"
@@ -4785,68 +5134,69 @@ msgstr ""
"\n"
"Przykład: 8.8.8.8, 8.8.4.4\n"
-#: ../cli/src/settings.c:3093 ../cli/src/settings.c:3444
+#: ../clients/cli/settings.c:3269 ../clients/cli/settings.c:3576
#, c-format
msgid "the property doesn't contain DNS search domain '%s'"
msgstr "właściwość nie zawiera domeny wyszukiwania DNS \"%s\""
-#: ../cli/src/settings.c:3113 ../cli/src/settings.c:3464
-#, c-format
-msgid "'%s' is not valid (use ip[/prefix] [gateway])"
-msgstr "\"%s\" jest nieprawidłowe (należy użyć ip[/przedrostek] [brama])"
-
-#: ../cli/src/settings.c:3162 ../cli/src/settings.c:3512
+#: ../clients/cli/settings.c:3323 ../clients/cli/settings.c:3629
#, c-format
msgid "the property doesn't contain IP address '%s'"
msgstr "właściwość nie zawiera adresu IP \"%s\""
-#: ../cli/src/settings.c:3175
+#: ../clients/cli/settings.c:3336
msgid ""
"Enter a list of IPv4 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 32.\n"
"\n"
-"Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+"Example: 192.168.1.5/24, 10.0.0.11/24\n"
msgstr ""
"Proszę podać listę adresów IPv4 sformatowanych jako:\n"
-" ip[/przedrostek] [brama], ip[/przedrostek] [brama],...\n"
+" ip[/przedrostek], ip[/przedrostek],...\n"
"Brak przedrostka jest traktowany jako przedrostek 32.\n"
"\n"
-"Przykład: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+"Przykład: 192.168.1.5/24, 10.0.0.11/24\n"
-#: ../cli/src/settings.c:3228 ../cli/src/settings.c:3543
+#: ../clients/cli/settings.c:3352 ../clients/cli/settings.c:3658
#, c-format
-msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
-msgstr ""
-"\"%s\" jest nieprawidłowe (format: ip[/przedrostek] [next-hop] [parametry])"
+msgid "invalid gateway address '%s'"
+msgstr "nieprawidłowy adres bramy \"%s\""
-#: ../cli/src/settings.c:3276 ../cli/src/settings.c:3591
+#: ../clients/cli/settings.c:3407 ../clients/cli/settings.c:3713
#, c-format
msgid "the property doesn't contain route '%s'"
msgstr "właściwość nie zawiera trasy \"%s\""
-#: ../cli/src/settings.c:3289
+#: ../clients/cli/settings.c:3420
msgid ""
"Enter a list of IPv4 routes formatted as:\n"
" ip[/prefix] [next-hop] [metric],...\n"
"\n"
"Missing prefix is regarded as a prefix of 32.\n"
"Missing next-hop is regarded as 0.0.0.0.\n"
-"Missing metric or 0 means a default metric (NM/kernel will set a default "
-"value).\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
"Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
" 10.1.2.0/24\n"
msgstr ""
"Proszę podać listę tras IPv4 sformatowanych jako:\n"
" ip/[przedrostek] [next-hop] [parametry],...\n"
+"\n"
"Brak przedrostka jest traktowany jako przedrostek 32.\n"
-"Brak parametrów jest traktowany jako parametry 0.\n"
+"Brak next-hop jest traktowane jako 0.0.0.0.\n"
+"Brak parametrów oznacza domyślne parametry (NM/jądro ustawi domyślną "
+"wartość).\n"
"\n"
-"Przykład: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
-" 10.1.2.0/24\n"
+"Przykłady: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
+" 10.1.2.0/24\n"
-#: ../cli/src/settings.c:3402
+#: ../clients/cli/settings.c:3497 ../clients/cli/settings.c:3516
+#, c-format
+msgid "invalid IPv6 address '%s'"
+msgstr "nieprawidłowy adres IPv6 \"%s\""
+
+#: ../clients/cli/settings.c:3534
msgid ""
"Enter a list of IPv6 addresses of DNS servers. If the IPv6 configuration "
"method is 'auto' these DNS servers are appended to those (if any) returned "
@@ -4867,31 +5217,28 @@ msgstr ""
"\n"
"Przykład: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
-#: ../cli/src/settings.c:3525
+#: ../clients/cli/settings.c:3642
msgid ""
"Enter a list of IPv6 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 128.\n"
"\n"
-"Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
-"1050:0:0:0:5:600:300c:326b\n"
+"Example: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"
msgstr ""
"Proszę podać listę adresów IPv6 sformatowanych jako:\n"
-" ip[/przedrostek] [brama], ip[/przedrostek] [brama],...\n"
+" ip[/przedrostek], ip[/przedrostek],...\n"
"Brak przedrostka jest traktowany jako przedrostek 128.\n"
"\n"
-"Przykład: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
-"1050:0:0:0:5:600:300c:326b\n"
+"Przykład: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"
-#: ../cli/src/settings.c:3604
+#: ../clients/cli/settings.c:3726
msgid ""
"Enter a list of IPv6 routes formatted as:\n"
" ip[/prefix] [next-hop] [metric],...\n"
"\n"
"Missing prefix is regarded as a prefix of 128.\n"
"Missing next-hop is regarded as \"::\".\n"
-"Missing metric or 0 means a default metric (NM/kernel will set a default "
-"value).\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
"Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
"db8:beef::3 2\n"
@@ -4899,31 +5246,38 @@ msgid ""
msgstr ""
"Proszę podać listę tras IPv6 sformatowanych jako:\n"
" ip/[przedrostek] [next-hop] [parametry],...\n"
+"\n"
"Brak przedrostka jest traktowany jako przedrostek 128.\n"
"Brak next-hop jest traktowane jako \"::\".\n"
-"Brak parametrów lub 0 oznacza domyślne parametry (NM/jądro ustawi domyślną "
+"Brak parametrów oznacza domyślne parametry (NM/jądro ustawi domyślną "
"wartość).\n"
"\n"
"Przykłady: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
"db8:beef::3 2\n"
" abbe::/64 55\n"
-#: ../cli/src/settings.c:3628
+#: ../clients/cli/settings.c:3743 ../libnm-core/nm-setting-gsm.c:317
+#: ../libnm-util/nm-setting-gsm.c:374
+#, c-format
+msgid "'%s' is not a number"
+msgstr "\"%s\" nie jest liczbÄ…"
+
+#: ../clients/cli/settings.c:3750
#, c-format
msgid "'%s' is not valid; use 0, 1, or 2"
msgstr "\"%s\" jest nieprawidłowe; należy użyć 0, 1 lub 2"
-#: ../cli/src/settings.c:3645
+#: ../clients/cli/settings.c:3767
#, c-format
msgid "'%s' is not a valid channel; use <1-13>"
msgstr "\"%s\" nie jest prawidłowym kanałem; należy użyć <1-13>"
-#: ../cli/src/settings.c:3666
+#: ../clients/cli/settings.c:3804
#, c-format
msgid "'%s' is not valid; use [e, o, n]"
msgstr "\"%s\" jest nieprawidłowe; należy użyć [e, o, n]"
-#: ../cli/src/settings.c:3694
+#: ../clients/cli/settings.c:3832
msgid ""
"nmcli can accepts both direct JSON configuration data and a file name "
"containing the configuration. In the latter case the file is read and the "
@@ -4941,16 +5295,16 @@ msgstr ""
"\"roundrobin\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }\n"
" set team.config /etc/mój-zespół.conf\n"
-#: ../cli/src/settings.c:3734
+#: ../clients/cli/settings.c:3872
msgid "no priority to remove"
msgstr "brak priorytetu do usunięcia"
-#: ../cli/src/settings.c:3738
+#: ../clients/cli/settings.c:3876
#, c-format
msgid "index '%d' is not in the range of <0-%d>"
msgstr "indeks \"%d\" jest poza zakresem <0-%d>"
-#: ../cli/src/settings.c:3777
+#: ../clients/cli/settings.c:3915
#, c-format
msgid ""
"Warning: only one mapping at a time is supported; taking the first one (%s)\n"
@@ -4958,40 +5312,43 @@ msgstr ""
"Ostrzeżenie: obsługiwane jest tylko jedno mapowanie na raz; przyjmowanie "
"pierwszego (%s)\n"
-#: ../cli/src/settings.c:3784
+#: ../clients/cli/settings.c:3922
#, c-format
msgid "the property doesn't contain mapping '%s'"
msgstr "właściwość nie zawiera mapowania \"%s\""
-#: ../cli/src/settings.c:3893 ../cli/src/settings.c:4061
-#: ../libnm-util/nm-setting-wired.c:651
-#: ../libnm-util/nm-setting-wireless.c:843
-#: ../libnm-util/nm-setting-wireless.c:857
+#: ../clients/cli/settings.c:4031 ../clients/cli/settings.c:4194
+#: ../libnm-core/nm-setting-wired.c:607
+#: ../libnm-core/nm-setting-wireless.c:785
+#: ../libnm-core/nm-setting-wireless.c:797
+#: ../libnm-util/nm-setting-wired.c:650
+#: ../libnm-util/nm-setting-wireless.c:842
+#: ../libnm-util/nm-setting-wireless.c:856
#, c-format
msgid "'%s' is not a valid MAC address"
msgstr "\"%s\" nie jest prawidłowym adresem MAC"
-#: ../cli/src/settings.c:3899 ../cli/src/settings.c:4067
+#: ../clients/cli/settings.c:4037 ../clients/cli/settings.c:4200
#, c-format
msgid "the property doesn't contain MAC address '%s'"
msgstr "właściwość nie zawiera adresu MAC \"%s\""
-#: ../cli/src/settings.c:3918
+#: ../clients/cli/settings.c:4056
#, c-format
-msgid "'%s' is not valid; 3 strings should be provided"
-msgstr "\"%s\" jest nieprawidłowe; powinny zostać podane trzy ciągi"
+msgid "'%s' is not valid; 2 or 3 strings should be provided"
+msgstr "\"%s\" jest nieprawidłowe; powinny zostać podane dwa lub trzy ciągi"
-#: ../cli/src/settings.c:3937
+#: ../clients/cli/settings.c:4070
msgid ""
-"Enter a list of three channels (comma or space separated).\n"
+"Enter a list of subchannels (comma or space separated).\n"
"\n"
"Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
msgstr ""
-"Proszę podać listę trzech kanałów (oddzielonych przecinkami lub spacjami).\n"
+"Proszę podać listę podkanałów (oddzielonych przecinkami lub spacjami).\n"
"\n"
"Przykład: 0.0.0e20 0.0.0e21 0.0.0e22\n"
-#: ../cli/src/settings.c:3987
+#: ../clients/cli/settings.c:4120
#, c-format
msgid ""
"Enter a list of S/390 options formatted as:\n"
@@ -5002,23 +5359,23 @@ msgstr ""
" opcja = <wartość>, opcja = <wartość>,...\n"
"Prawidłowe opcje: %s\n"
-#: ../cli/src/settings.c:4033
+#: ../clients/cli/settings.c:4166
#, c-format
msgid "'%s' is not a valid channel"
msgstr "\"%s\" nie jest prawidłowym kanałem"
-#: ../cli/src/settings.c:4039
+#: ../clients/cli/settings.c:4172
#, c-format
msgid "'%ld' is not a valid channel"
msgstr "\"%ld\" nie jest prawidłowym kanałem"
-#: ../cli/src/settings.c:4126 ../cli/src/settings.c:4164
-#: ../cli/src/settings.c:4202
+#: ../clients/cli/settings.c:4259 ../clients/cli/settings.c:4297
+#: ../clients/cli/settings.c:4335
#, c-format
msgid "the property doesn't contain protocol '%s'"
msgstr "właściwość nie zawiera protokołu \"%s\""
-#: ../cli/src/settings.c:4241
+#: ../clients/cli/settings.c:4374
#, c-format
msgid ""
"'%s' not compatible with %s '%s', please change the key or set the right %s "
@@ -5027,23 +5384,23 @@ msgstr ""
"\"%s\" nie jest zgodne z %s \"%s\", proszę zmienić klucz lub ustawić "
"najpierw właściwe %s."
-#: ../cli/src/settings.c:4249
+#: ../clients/cli/settings.c:4382
#, c-format
msgid "WEP key is guessed to be of '%s'\n"
msgstr "Klucz WEP jest prawdopodobnie typu \"%s\"\n"
-#: ../cli/src/settings.c:4251
+#: ../clients/cli/settings.c:4384
#, c-format
msgid "WEP key index set to '%d'\n"
msgstr "Ustawiono indeks klucza WEP na \"%d\"\n"
-#: ../cli/src/settings.c:4274
+#: ../clients/cli/settings.c:4407
#, c-format
msgid "'%s' not among [0 (unknown), 1 (key), 2 (passphrase)]"
msgstr "\"%s\" nie jest jednym z [0 (unknown), 1 (key), 2 (passphrase)]"
-#: ../cli/src/settings.c:4290 ../cli/src/settings.c:4293
-#: ../cli/src/settings.c:4296 ../cli/src/settings.c:4299
+#: ../clients/cli/settings.c:4423 ../clients/cli/settings.c:4426
+#: ../clients/cli/settings.c:4429 ../clients/cli/settings.c:4432
#, c-format
msgid ""
"Warning: '%s' is not compatible with '%s' type, please change or delete the "
@@ -5052,7 +5409,7 @@ msgstr ""
"Ostrzeżenie: \"%s\" nie jest zgodne z typem \"%s\", proszę zmienić lub "
"usunąć klucz.\n"
-#: ../cli/src/settings.c:4312
+#: ../clients/cli/settings.c:4445
#, c-format
msgid ""
"Enter the type of WEP keys. The accepted values are: 0 or unknown, 1 or key, "
@@ -5061,36 +5418,36 @@ msgstr ""
"Proszę podać typ kluczy WEP. Możliwe wartości: 0 lub \"unknown\", 1 lub \"key"
"\" i 2 lub \"passphrase\".\n"
-#: ../cli/src/settings.c:4325
+#: ../clients/cli/settings.c:4458
#, c-format
msgid "'%s' is not a valid PSK"
msgstr "\"%s\" nie jest prawidłowym PSK"
-#: ../cli/src/settings.c:4369
+#: ../clients/cli/settings.c:4502
#, c-format
msgid "'%s' is not a valid DCB flag"
msgstr "\"%s\" nie jest prawidłową flagą DCB"
-#: ../cli/src/settings.c:4392
+#: ../clients/cli/settings.c:4525
#, c-format
msgid "'%s' is not a DCB app priority"
msgstr "\"%s\" nie jest prawidłowym priorytetem aplikacji DCB"
-#: ../cli/src/settings.c:4418
+#: ../clients/cli/settings.c:4551
msgid "must contain 8 comma-separated numbers"
msgstr "musi zawierać osiem liczb oddzielonych przecinkami"
-#: ../cli/src/settings.c:4435
+#: ../clients/cli/settings.c:4568
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive) or %u"
msgstr "\"%s\" nie jest liczbą między 0 a %u (włącznie) lub %u"
-#: ../cli/src/settings.c:4438
+#: ../clients/cli/settings.c:4571
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive)"
msgstr "\"%s\" nie jest liczbą między 0 a %u (włącznie)"
-#: ../cli/src/settings.c:4460
+#: ../clients/cli/settings.c:4593
#, c-format
msgid ""
"Warning: changes will have no effect until '%s' includes 1 (enabled)\n"
@@ -5100,93 +5457,102 @@ msgstr ""
"(włączone)\n"
"\n"
-#: ../cli/src/settings.c:4513
+#: ../clients/cli/settings.c:4646
#, c-format
msgid "bandwidth percentages must total 100%%"
msgstr "procenty szerokości pasma muszą razem wynosić 100%%"
-#: ../cli/src/settings.c:6198
+#: ../clients/cli/settings.c:6340
msgid "don't know how to get the property value"
msgstr "nie wiadomo, jak uzyskać wartość właściwości"
-#: ../cli/src/settings.c:6251 ../cli/src/settings.c:6291
+#: ../clients/cli/settings.c:6393 ../clients/cli/settings.c:6433
msgid "the property can't be changed"
msgstr "nie można zmieniać tej właściwości"
-#: ../cli/src/settings.c:6395
+#: ../clients/cli/settings.c:6516
+msgid "(not available)"
+msgstr "(niedostępne)"
+
+#: ../clients/cli/settings.c:6541
msgid "[NM property description]"
msgstr "[opis właściwości NM]"
-#: ../cli/src/settings.c:6401
+#: ../clients/cli/settings.c:6546
msgid "[nmcli specific description]"
msgstr "[konkretny opis nmcli]"
-#: ../cli/src/utils.c:128
+#. ----------------------------------------------------------------------------
+#: ../clients/cli/settings.c:6595
+msgid "<hidden>"
+msgstr "<ukryte>"
+
+#: ../clients/cli/utils.c:127
#, c-format
msgid "Error: value for '%s' argument is required."
msgstr "Błąd: wartość dla parametru \"%s\" jest wymagana."
-#: ../cli/src/utils.c:153
+#: ../clients/cli/utils.c:152
#, c-format
msgid "Error: Argument '%s' was expected, but '%s' provided."
msgstr "BÅ‚Ä…d: oczekiwano parametru \"%s\", ale podano \"%s\"."
-#: ../cli/src/utils.c:156
+#: ../clients/cli/utils.c:155
#, c-format
msgid "Error: Unexpected argument '%s'"
msgstr "BÅ‚Ä…d: nieoczekiwany parametr \"%s\""
-#: ../cli/src/utils.c:206
+#: ../clients/cli/utils.c:205
#, c-format
msgid "Error converting IP4 address '0x%X' to text form"
msgstr "BÅ‚Ä…d podczas konwertowania adresu IPv4 \"0x%X\" na formÄ™ tekstowÄ…"
-#: ../cli/src/utils.c:234
+#: ../clients/cli/utils.c:233
#, c-format
msgid "Error converting IP6 address '%s' to text form"
msgstr "BÅ‚Ä…d podczas konwertowania adresu IPv6 \"%s\" na formÄ™ tekstowÄ…"
-#: ../cli/src/utils.c:408
+#: ../clients/cli/utils.c:410
#, c-format
msgid "'%s' is ambiguous (on x off)"
msgstr "\"%s\" jest niejednoznaczne (on x off)"
-#: ../cli/src/utils.c:418
+#: ../clients/cli/utils.c:420
#, c-format
msgid "'%s' is not valid; use [%s] or [%s]"
msgstr "\"%s\" jest nieprawidłowy; należy użyć [%s] lub [%s]"
-#: ../cli/src/utils.c:500
+#: ../clients/cli/utils.c:502
#, c-format
msgid "'%s' is ambiguous (%s x %s)"
msgstr "\"%s\" jest niejednoznaczne (%s x %s)"
-#: ../cli/src/utils.c:512
+#: ../clients/cli/utils.c:514
#, c-format
msgid "missing name, try one of [%s]"
msgstr "brak nazwy, należy spróbować jednej z [%s]"
-#: ../cli/src/utils.c:729
+#: ../clients/cli/utils.c:753
#, c-format
msgid "field '%s' has to be alone"
msgstr "pole \"%s\" musi być same"
-#: ../cli/src/utils.c:732
+#: ../clients/cli/utils.c:756
#, c-format
msgid "invalid field '%s'; allowed fields: %s"
msgstr "nieprawidłowe pole \"%s\"; dozwolone pola: %s"
-#: ../cli/src/utils.c:789
+#: ../clients/cli/utils.c:813
msgid "Option '--terse' requires specifying '--fields'"
msgstr "Opcja \"--terse\" wymaga podania opcji \"--fields\""
-#: ../cli/src/utils.c:793
+#: ../clients/cli/utils.c:817
#, c-format
msgid "Option '--terse' requires specific '--fields' option values , not '%s'"
msgstr ""
"Opcja \"--terse\" wymaga konkretnej wartości opcji \"--fields\", nie \"%s\""
-#: ../cli/src/utils.c:1112
+#: ../clients/cli/utils.c:1135
#, c-format
msgid ""
"Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --"
@@ -5195,7 +5561,7 @@ msgstr ""
"Ostrzeżenie: wersje programu nmcli (%s) i usługi NetworkManager (%s) się nie "
"zgadzają. Użycie opcji --nocheck ukrywa ostrzeżenie.\n"
-#: ../cli/src/utils.c:1121
+#: ../clients/cli/utils.c:1144
#, c-format
msgid ""
"Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force "
@@ -5205,540 +5571,1506 @@ msgstr ""
"zgadzają. Wymuszono wykonanie używając opcji --nocheck, ale wynik może być "
"nieprzewidywalny."
-#: ../libnm-glib/nm-device.c:1817
-msgid "Bluetooth"
-msgstr "Bluetooth"
+#: ../clients/common/nm-polkit-listener.c:215
+msgid "An authentication session is already underway."
+msgstr "Sesja uwierzytelnienia jest już w drodze."
+
+#. TTLS and PEAP are actually much more complicated, but this complication
+#. * is not visible here since we only care about phase2 authentication
+#. * (and don't even care of which one)
+#.
+#: ../clients/common/nm-secret-agent-simple.c:209
+#: ../clients/common/nm-secret-agent-simple.c:300
+#: ../clients/tui/nmt-page-dsl.c:69 ../clients/tui/nmt-page-wifi.c:335
+msgid "Username"
+msgstr "Nazwa użytkownika"
+
+#: ../clients/common/nm-secret-agent-simple.c:214
+#: ../clients/common/nm-secret-agent-simple.c:251
+#: ../clients/common/nm-secret-agent-simple.c:277
+#: ../clients/common/nm-secret-agent-simple.c:310
+#: ../clients/common/nm-secret-agent-simple.c:379
+#: ../clients/common/nm-secret-agent-simple.c:392
+#: ../clients/common/nm-secret-agent-simple.c:408
+#: ../clients/tui/nmt-page-dsl.c:78 ../clients/tui/nmt-page-wifi.c:280
+#: ../clients/tui/nmt-page-wifi.c:311 ../clients/tui/nmt-page-wifi.c:344
+msgid "Password"
+msgstr "Hasło"
+
+#: ../clients/common/nm-secret-agent-simple.c:223
+msgid "Identity"
+msgstr "Tożsamość"
+
+#: ../clients/common/nm-secret-agent-simple.c:228
+msgid "Private key password"
+msgstr "Hasło klucza prywatnego"
+
+#: ../clients/common/nm-secret-agent-simple.c:265
+#: ../clients/tui/nmt-page-wifi.c:292
+msgid "Key"
+msgstr "Klucz"
+
+#: ../clients/common/nm-secret-agent-simple.c:305
+#: ../clients/tui/nmt-page-dsl.c:81
+msgid "Service"
+msgstr "Usługa"
+
+#: ../clients/common/nm-secret-agent-simple.c:339
+msgid "Authentication required by wireless network"
+msgstr "Sieć bezprzewodowa wymaga uwierzytelnienia"
+
+#: ../clients/common/nm-secret-agent-simple.c:340
+#, c-format
+msgid ""
+"Passwords or encryption keys are required to access the wireless network "
+"'%s'."
+msgstr ""
+"Wymagane są hasła lub klucze szyfrowania, aby uzyskać dostęp do sieci "
+"bezprzewodowej \"%s\"."
+
+#: ../clients/common/nm-secret-agent-simple.c:348
+msgid "Wired 802.1X authentication"
+msgstr "Przewodowe uwierzytelnianie 802.1X"
+
+#: ../clients/common/nm-secret-agent-simple.c:351
+msgid "Network name"
+msgstr "Nazwa sieci"
+
+#: ../clients/common/nm-secret-agent-simple.c:358
+msgid "DSL authentication"
+msgstr "Uwierzytelnianie DSL"
+
+#: ../clients/common/nm-secret-agent-simple.c:366
+msgid "PIN code required"
+msgstr "Wymagany jest kod PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:367
+msgid "PIN code is needed for the mobile broadband device"
+msgstr "Urządzenie komórkowe wymaga kodu PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:369
+msgid "PIN"
+msgstr "PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:375
+#: ../clients/common/nm-secret-agent-simple.c:388
+#: ../clients/common/nm-secret-agent-simple.c:404
+msgid "Mobile broadband network password"
+msgstr "Hasło sieci komórkowej"
+
+#: ../clients/common/nm-secret-agent-simple.c:376
+#: ../clients/common/nm-secret-agent-simple.c:389
+#: ../clients/common/nm-secret-agent-simple.c:405
+#, c-format
+msgid "A password is required to connect to '%s'."
+msgstr "Wymagane jest hasło, aby połączyć z \"%s\"."
+
+#: ../clients/nm-online.c:96
+#, c-format
+msgid "\rConnecting"
+msgstr "\rÅÄ…czenie"
+
+#: ../clients/nm-online.c:149
+msgid ""
+"Time to wait for a connection, in seconds (without the option, default value "
+"is 30)"
+msgstr ""
+"Czas oczekiwania na połączenie, w sekundach (bez opcji, domyślna wartość to "
+"30)"
+
+#: ../clients/nm-online.c:150
+msgid "Exit immediately if NetworkManager is not running or connecting"
+msgstr ""
+"Kończy działanie od razu, jeśli usługa NetworkManager nie jest uruchomiona "
+"lub nie Å‚Ä…czy"
+
+#: ../clients/nm-online.c:151
+msgid "Don't print anything"
+msgstr "Bez wyświetlania czegokolwiek"
+
+#: ../clients/nm-online.c:152
+msgid "Wait for NetworkManager startup instead of a connection"
+msgstr "Czeka na uruchomienie usługi NetworkManager zamiast połączenia"
+
+#: ../clients/nm-online.c:173
+msgid ""
+"Waits for NetworkManager to finish activating startup network connections."
+msgstr ""
+"Czeka, aż usługa NetworkManager ukończy aktywowanie połączeń sieciowych."
+
+#: ../clients/nm-online.c:180 ../clients/nm-online.c:186
+msgid "Invalid option. Please use --help to see a list of valid options."
+msgstr ""
+"Nieprawidłowa opcja. Parametr --help wyświetli listę prawidłowych opcji."
+
+#: ../clients/tui/newt/nmt-newt-utils.c:180 ../clients/tui/nmt-editor.c:417
+#: ../clients/tui/nmt-password-dialog.c:174
+#: ../clients/tui/nmt-route-editor.c:125 ../clients/tui/nmtui-hostname.c:71
+#: ../clients/tui/nmtui.c:117
+msgid "OK"
+msgstr "OK"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:328
+#: ../clients/tui/newt/nmt-newt-utils.c:360
+#, c-format
+msgid "Could not create temporary file: %s"
+msgstr "Nie można utworzyć pliku tymczasowego: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:368
+#, c-format
+msgid "Editor failed: %s"
+msgstr "Edytor się nie powiódł: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:376
+#, c-format
+msgid "Editor failed with status %d"
+msgstr "Edytor się nie powiódł ze stanem %d"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:378
+#, c-format
+msgid "Editor failed with signal %d"
+msgstr "Edytor się nie powiódł z sygnałem %d"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:382
+#, c-format
+msgid "Could not re-read file: %s"
+msgstr "Nie można ponownie odczytać pliku: %s"
+
+#: ../clients/tui/nm-editor-utils.c:151
+#, c-format
+msgid "Ethernet connection %d"
+msgstr "Połączenie ethernet %d"
+
+#: ../clients/tui/nm-editor-utils.c:159
+#, c-format
+msgid "Wi-Fi connection %d"
+msgstr "Połączenie Wi-Fi %d"
-#: ../libnm-glib/nm-device.c:1823 ../tui/nm-editor-utils.c:182
+#: ../clients/tui/nm-editor-utils.c:168
+#, c-format
+msgid "InfiniBand connection %d"
+msgstr "Połączenie InfiniBand %d"
+
+#: ../clients/tui/nm-editor-utils.c:173 ../libnm-glib/nm-device.c:1799
+#: ../libnm/nm-device.c:1621
msgid "Mobile Broadband"
msgstr "Komórkowe"
-#: ../libnm-glib/nm-device.c:1827 ../libnm-util/nm-connection.c:1297
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4290 ../tui/nm-editor-utils.c:200
+#: ../clients/tui/nm-editor-utils.c:176
+#, c-format
+msgid "Mobile broadband connection %d"
+msgstr "Połączenie komórkowe %d"
+
+#: ../clients/tui/nm-editor-utils.c:182 ../clients/tui/nmt-page-dsl.c:65
+msgid "DSL"
+msgstr "DSL"
+
+#: ../clients/tui/nm-editor-utils.c:186
+#, c-format
+msgid "DSL connection %d"
+msgstr "Połączenie DSL %d"
+
+#: ../clients/tui/nm-editor-utils.c:191 ../libnm-core/nm-connection.c:1565
+#: ../libnm-glib/nm-device.c:1803 ../libnm-util/nm-connection.c:1608
+#: ../libnm/nm-device.c:1625 ../src/settings/plugins/ifcfg-rh/reader.c:3931
msgid "Bond"
msgstr "WiÄ…zane"
-#: ../libnm-glib/nm-device.c:1829 ../libnm-util/nm-connection.c:1299
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4401 ../tui/nm-editor-utils.c:218
-msgid "Team"
-msgstr "Zespół"
+#: ../clients/tui/nm-editor-utils.c:195
+#, c-format
+msgid "Bond connection %d"
+msgstr "Połączenie wiązane %d"
-#: ../libnm-glib/nm-device.c:1831 ../libnm-util/nm-connection.c:1301
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4596 ../tui/nm-editor-utils.c:209
+#: ../clients/tui/nm-editor-utils.c:200 ../libnm-core/nm-connection.c:1569
+#: ../libnm-glib/nm-device.c:1807 ../libnm-util/nm-connection.c:1612
+#: ../libnm/nm-device.c:1629 ../src/settings/plugins/ifcfg-rh/reader.c:4222
msgid "Bridge"
msgstr "Mostek"
-#: ../libnm-glib/nm-device.c:1835
-msgid "ADSL"
-msgstr "ADSL"
+#: ../clients/tui/nm-editor-utils.c:205
+#, c-format
+msgid "Bridge connection %d"
+msgstr "Połączenie mostkowane %d"
-#: ../libnm-glib/nm-device.c:1863
-msgid "Wired"
-msgstr "Przewodowe"
+#: ../clients/tui/nm-editor-utils.c:209 ../libnm-core/nm-connection.c:1567
+#: ../libnm-glib/nm-device.c:1805 ../libnm-util/nm-connection.c:1610
+#: ../libnm/nm-device.c:1627 ../src/settings/plugins/ifcfg-rh/reader.c:4037
+msgid "Team"
+msgstr "Zespół"
-#: ../libnm-glib/nm-device.c:1894
-msgid "PCI"
-msgstr "PCI"
+#: ../clients/tui/nm-editor-utils.c:214
+#, c-format
+msgid "Team connection %d"
+msgstr "Połączenie zespołowe %d"
-#: ../libnm-glib/nm-device.c:1896
-msgid "USB"
-msgstr "USB"
+#: ../clients/tui/nm-editor-utils.c:222
+#, c-format
+msgid "VLAN connection %d"
+msgstr "Połączenie VLAN %d"
-#. Translators: the first %s is a bus name (eg, "USB") or
-#. * product name, the second is a device type (eg,
-#. * "Ethernet"). You can change this to something like
-#. * "%2$s (%1$s)" if there's no grammatical way to combine
-#. * the strings otherwise.
-#.
-#: ../libnm-glib/nm-device.c:1992 ../libnm-glib/nm-device.c:2011
+#: ../clients/tui/nm-editor-utils.c:237
#, c-format
-msgctxt "long device name"
-msgid "%s %s"
-msgstr "%2$s (%1$s)"
+msgid "VPN connection %d"
+msgstr "Połączenie VPN %d"
-#: ../libnm-glib/nm-remote-connection.c:151
-msgid "Disconnected by D-Bus"
-msgstr "Rozłączono przez D-Bus"
+#: ../clients/tui/nmt-device-entry.c:371
+msgid "Select..."
+msgstr "Wybierz..."
+
+#: ../clients/tui/nmt-edit-connection-list.c:112
+msgid "Add"
+msgstr "Dodaj"
+
+#: ../clients/tui/nmt-edit-connection-list.c:115
+#: ../clients/tui/nmt-page-ip4.c:172 ../clients/tui/nmt-page-ip6.c:170
+#: ../clients/tui/nmt-page-team-port.c:112 ../clients/tui/nmt-page-team.c:176
+msgid "Edit..."
+msgstr "Modyfikuj..."
+
+#: ../clients/tui/nmt-edit-connection-list.c:118
+#: ../clients/tui/nmtui-edit.c:527
+msgid "Delete"
+msgstr "Usuń"
+
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Hide"
+msgstr "Ukryj"
+
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Show"
+msgstr "Wyświetl"
+
+#: ../clients/tui/nmt-editor.c:99
+#, c-format
+msgid "Could not create editor for connection '%s' of type '%s'."
+msgstr "Nie można utworzyć edytora dla połączenia \"%s\" typu \"%s\"."
+
+#: ../clients/tui/nmt-editor.c:103
+#, c-format
+msgid "Could not create editor for invalid connection '%s'."
+msgstr "Nie można utworzyć edytora dla nieprawidłowego połączenia \"%s\"."
+
+#: ../clients/tui/nmt-editor.c:113
+msgid "Edit Connection"
+msgstr "Modyfikuj połączenie"
+
+#: ../clients/tui/nmt-editor.c:166
+#, c-format
+msgid "Unable to save connection: %s"
+msgstr "Nie można zapisać połączenia: %s"
+
+#: ../clients/tui/nmt-editor.c:180
+#, c-format
+msgid "Unable to add new connection: %s"
+msgstr "Nie można dodać nowego połączenia: %s"
+
+#: ../clients/tui/nmt-editor.c:322
+msgid "Profile name"
+msgstr "Nazwa profilu"
+
+#: ../clients/tui/nmt-editor.c:333
+msgid "Ethernet device"
+msgstr "UrzÄ…dzenie ethernetowe"
+
+#: ../clients/tui/nmt-editor.c:335
+msgid "Device"
+msgstr "UrzÄ…dzenie"
+
+#. And finally the bottom widgets
+#: ../clients/tui/nmt-editor.c:393
+msgid "Automatically connect"
+msgstr "ÅÄ…czenie automatyczne"
+
+#: ../clients/tui/nmt-editor.c:399
+msgid "Available to all users"
+msgstr "Dostępne dla wszystkich użytkowników"
+
+#: ../clients/tui/nmt-editor.c:414 ../clients/tui/nmt-password-dialog.c:171
+#: ../clients/tui/nmt-route-editor.c:118 ../clients/tui/nmtui-edit.c:218
+#: ../clients/tui/nmtui-edit.c:526 ../clients/tui/nmtui-hostname.c:69
+msgid "Cancel"
+msgstr "Anuluj"
+
+#: ../clients/tui/nmt-mtu-entry.c:86
+msgid "(default)"
+msgstr "(domyślne)"
+
+#: ../clients/tui/nmt-mtu-entry.c:88 ../clients/tui/nmt-mtu-entry.c:119
+msgid "bytes"
+msgstr "bajty"
+
+#: ../clients/tui/nmt-page-bond.c:87
+msgid "Round-robin"
+msgstr "Round-robin"
+
+#: ../clients/tui/nmt-page-bond.c:88
+msgid "Active Backup"
+msgstr "Aktywna kopia zapasowa"
+
+#: ../clients/tui/nmt-page-bond.c:89
+msgid "XOR"
+msgstr "XOR"
+
+#: ../clients/tui/nmt-page-bond.c:90
+msgid "Broadcast"
+msgstr "Rozgłaszanie"
+
+#: ../clients/tui/nmt-page-bond.c:91
+msgid "802.3ad"
+msgstr "802.3ad"
+
+#: ../clients/tui/nmt-page-bond.c:92
+msgid "Adaptive Transmit Load Balancing (tlb)"
+msgstr "Adaptacyjne równoważenie obciążenia przesyłania (TLB)"
+
+#: ../clients/tui/nmt-page-bond.c:93
+msgid "Adaptive Load Balancing (alb)"
+msgstr "Adaptacyjne równoważenie obciążenia (ALB)"
+
+#: ../clients/tui/nmt-page-bond.c:99
+msgid "MII (recommended)"
+msgstr "MII (zalecane)"
+
+#: ../clients/tui/nmt-page-bond.c:100
+msgid "ARP"
+msgstr "ARP"
+
+#: ../clients/tui/nmt-page-bond.c:358 ../clients/tui/nmt-page-bridge.c:81
+#: ../clients/tui/nmt-page-team.c:155
+msgid "Slaves"
+msgstr "Podrzędne"
+
+#: ../clients/tui/nmt-page-bond.c:370 ../clients/tui/nmt-page-wifi.c:233
+msgid "Mode"
+msgstr "Tryb"
+
+#: ../clients/tui/nmt-page-bond.c:376
+msgid "Primary"
+msgstr "Główne"
+
+#: ../clients/tui/nmt-page-bond.c:382
+msgid "Link monitoring"
+msgstr "Monitorowanie Å‚Ä…cza"
+
+#: ../clients/tui/nmt-page-bond.c:388 ../clients/tui/nmt-page-bond.c:395
+#: ../clients/tui/nmt-page-bond.c:402 ../clients/tui/nmt-page-bond.c:409
+msgctxt "milliseconds"
+msgid "ms"
+msgstr "ms"
+
+#: ../clients/tui/nmt-page-bond.c:389 ../clients/tui/nmt-page-bond.c:410
+msgid "Monitoring frequency"
+msgstr "Częstotliwość monitorowania"
+
+#: ../clients/tui/nmt-page-bond.c:396
+msgid "Link up delay"
+msgstr "Opóźnienie łącza wysyłania"
+
+#: ../clients/tui/nmt-page-bond.c:403
+msgid "Link down delay"
+msgstr "Opóźnienie łącza pobierania"
+
+#: ../clients/tui/nmt-page-bond.c:416
+msgid "ARP targets"
+msgstr "Cele ARP"
+
+#: ../clients/tui/nmt-page-bridge-port.c:63
+msgid "BRIDGE PORT"
+msgstr "PORT MOSTKA"
+
+#: ../clients/tui/nmt-page-bridge-port.c:70
+#: ../clients/tui/nmt-page-bridge.c:107
+msgid "Priority"
+msgstr "Priorytet"
+
+#: ../clients/tui/nmt-page-bridge-port.c:76
+msgid "Path cost"
+msgstr "Koszt ścieżki"
+
+#: ../clients/tui/nmt-page-bridge-port.c:78
+msgid "Hairpin mode"
+msgstr "Tryb hairpin"
+
+#: ../clients/tui/nmt-page-bridge.c:91 ../clients/tui/nmt-page-bridge.c:116
+#: ../clients/tui/nmt-page-bridge.c:126 ../clients/tui/nmt-page-bridge.c:136
+msgid "seconds"
+msgstr "s"
+
+#: ../clients/tui/nmt-page-bridge.c:92
+msgid "Aging time"
+msgstr "Czas starzenia"
+
+#: ../clients/tui/nmt-page-bridge.c:94
+msgid "Enable STP (Spanning Tree Protocol)"
+msgstr "WÅ‚Ä…czenie STP (Spanning Tree Protocol)"
+
+#: ../clients/tui/nmt-page-bridge.c:117
+msgid "Forward delay"
+msgstr "Opóźnienie przekazywania"
+
+#: ../clients/tui/nmt-page-bridge.c:127
+msgid "Hello time"
+msgstr "Czas powitania"
+
+#: ../clients/tui/nmt-page-bridge.c:137
+msgid "Max age"
+msgstr "Maksymalny wiek"
+
+#: ../clients/tui/nmt-page-ethernet.c:73
+msgid "ETHERNET"
+msgstr "ETHERNET"
+
+#: ../clients/tui/nmt-page-ethernet.c:80 ../clients/tui/nmt-page-vlan.c:125
+#: ../clients/tui/nmt-page-wifi.c:367
+msgid "Cloned MAC address"
+msgstr "Sklonowany adres MAC"
+
+#: ../clients/tui/nmt-page-infiniband.c:50
+msgid "Datagram"
+msgstr "Datagram"
+
+#: ../clients/tui/nmt-page-infiniband.c:51
+msgid "Connected"
+msgstr "Połączone"
+
+#: ../clients/tui/nmt-page-infiniband.c:84
+msgid "INFINIBAND"
+msgstr "INFINIBAND"
+
+#: ../clients/tui/nmt-page-infiniband.c:91
+msgid "Transport mode"
+msgstr "Tryb przesyłania"
+
+#: ../clients/tui/nmt-page-ip4.c:41
+msgid "Disabled"
+msgstr "Wyłączone"
+
+#: ../clients/tui/nmt-page-ip4.c:42 ../clients/tui/nmt-page-ip6.c:42
+msgid "Automatic"
+msgstr "Automatyczne"
+
+#: ../clients/tui/nmt-page-ip4.c:43 ../clients/tui/nmt-page-ip6.c:44
+msgid "Link-Local"
+msgstr "Link-Local"
+
+#: ../clients/tui/nmt-page-ip4.c:44 ../clients/tui/nmt-page-ip6.c:45
+msgid "Manual"
+msgstr "Ręczne"
+
+#: ../clients/tui/nmt-page-ip4.c:45
+msgid "Shared"
+msgstr "Współdzielone"
+
+#: ../clients/tui/nmt-page-ip4.c:85 ../clients/tui/nmt-page-ip6.c:85
+msgid "(No custom routes)"
+msgstr "(Brak reguł użytkownika)"
+
+#: ../clients/tui/nmt-page-ip4.c:88 ../clients/tui/nmt-page-ip6.c:88
+#, c-format
+msgid "One custom route"
+msgid_plural "%d custom routes"
+msgstr[0] "%d reguła użytkownika"
+msgstr[1] "%d reguły użytkownika"
+msgstr[2] "%d reguł użytkownika"
+
+#: ../clients/tui/nmt-page-ip4.c:131
+msgid "IPv4 CONFIGURATION"
+msgstr "KONFIGURACJA IPv4"
+
+#: ../clients/tui/nmt-page-ip4.c:139 ../clients/tui/nmt-page-ip6.c:139
+msgid "Addresses"
+msgstr "Adresy"
+
+#: ../clients/tui/nmt-page-ip4.c:146 ../clients/tui/nmt-page-ip6.c:146
+msgid "Gateway"
+msgstr "Brama"
+
+#: ../clients/tui/nmt-page-ip4.c:153 ../clients/tui/nmt-page-ip6.c:153
+msgid "DNS servers"
+msgstr "Serwery DNS"
+
+#: ../clients/tui/nmt-page-ip4.c:159 ../clients/tui/nmt-page-ip6.c:159
+msgid "Search domains"
+msgstr "Domeny wyszukiwania"
+
+#: ../clients/tui/nmt-page-ip4.c:174 ../clients/tui/nmt-page-ip6.c:172
+msgid "Routing"
+msgstr "Trasowanie"
+
+#: ../clients/tui/nmt-page-ip4.c:176 ../clients/tui/nmt-page-ip6.c:174
+msgid "Never use this network for default route"
+msgstr "Bez używania tej sieci jako domyślnej trasy"
+
+#: ../clients/tui/nmt-page-ip4.c:184
+msgid "Require IPv4 addressing for this connection"
+msgstr "Wymaganie adresowania IPv4 dla tego połączenia"
+
+#: ../clients/tui/nmt-page-ip6.c:41
+msgid "Ignore"
+msgstr "Ignorowanie"
+
+#: ../clients/tui/nmt-page-ip6.c:43
+msgid "Automatic (DHCP-only)"
+msgstr "Automatyczne (tylko DHCP)"
+
+#: ../clients/tui/nmt-page-ip6.c:131
+msgid "IPv6 CONFIGURATION"
+msgstr "KONFIGURACJA IPv6"
+
+#: ../clients/tui/nmt-page-ip6.c:182
+msgid "Require IPv6 addressing for this connection"
+msgstr "Wymaganie adresowania IPv6 dla tego połączenia"
+
+#: ../clients/tui/nmt-page-ppp.c:134
+msgid "PPP CONFIGURATION"
+msgstr "KONFIGURACJA PPP"
+
+#: ../clients/tui/nmt-page-ppp.c:143
+msgid "Allowed authentication methods:"
+msgstr "Dozwolone metody uwierzytelniania:"
+
+#: ../clients/tui/nmt-page-ppp.c:150
+msgid "EAP"
+msgstr "EAP"
+
+#: ../clients/tui/nmt-page-ppp.c:158
+msgid "PAP"
+msgstr "PAP"
+
+#: ../clients/tui/nmt-page-ppp.c:166
+msgid "CHAP"
+msgstr "CHAP"
+
+#: ../clients/tui/nmt-page-ppp.c:174
+msgid "MSCHAPv2"
+msgstr "MSCHAPv2"
+
+#: ../clients/tui/nmt-page-ppp.c:182
+msgid "MSCHAP"
+msgstr "MSCHAP"
+
+#: ../clients/tui/nmt-page-ppp.c:198
+msgid "Use point-to-point encryption (MPPE)"
+msgstr "Użycie szyfrowania punkt-do-punktu (MPPE)"
+
+#: ../clients/tui/nmt-page-ppp.c:210
+msgid "Require 128-bit encryption"
+msgstr "Wymaganie szyfrowania 128-bitowego"
+
+#: ../clients/tui/nmt-page-ppp.c:220
+msgid "Use stateful MPPE"
+msgstr "Użycie MPPE \"stateful\""
+
+#: ../clients/tui/nmt-page-ppp.c:232
+msgid "Allow BSD data compression"
+msgstr "Zezwolenie na kompresjÄ™ danych BSD"
+
+#: ../clients/tui/nmt-page-ppp.c:240
+msgid "Allow Deflate data compression"
+msgstr "Zezwolenie na kompresjÄ™ danych Deflate"
+
+#: ../clients/tui/nmt-page-ppp.c:248
+msgid "Use TCP header compression"
+msgstr "Użycie kompresji nagłówków TCP"
+
+#: ../clients/tui/nmt-page-ppp.c:258
+msgid "Send PPP echo packets"
+msgstr "Wysyłanie pakietów echo PPP"
+
+#: ../clients/tui/nmt-page-team-port.c:95
+msgid "TEAM PORT"
+msgstr "PORT ZESPOÅU"
+
+#: ../clients/tui/nmt-page-team-port.c:102 ../clients/tui/nmt-page-team.c:166
+msgid "JSON configuration"
+msgstr "Konfiguracja JSON"
+
+#: ../clients/tui/nmt-page-vlan.c:102
+msgid "Parent"
+msgstr "Nadrzędne"
+
+#: ../clients/tui/nmt-page-vlan.c:117
+msgid "VLAN id"
+msgstr "Identyfikator VLAN"
+
+#: ../clients/tui/nmt-page-wifi.c:67
+msgctxt "Wi-Fi"
+msgid "Client"
+msgstr "Klient"
+
+#: ../clients/tui/nmt-page-wifi.c:68
+msgid "Access Point"
+msgstr "Punkt dostępowy"
+
+#: ../clients/tui/nmt-page-wifi.c:69
+msgid "Ad-Hoc Network"
+msgstr "Sieć Ad-hoc"
+
+#: ../clients/tui/nmt-page-wifi.c:74
+msgctxt "Wi-Fi"
+msgid "Automatic"
+msgstr "Automatyczne"
+
+#. 802.11a Wi-Fi network
+#: ../clients/tui/nmt-page-wifi.c:76
+msgid "A (5 GHz)"
+msgstr "A (5 GHz)"
+
+#. 802.11b / 802.11g Wi-Fi network
+#: ../clients/tui/nmt-page-wifi.c:78
+msgid "B/G (2.4 GHz)"
+msgstr "B/G (2.4 GHz)"
+
+#: ../clients/tui/nmt-page-wifi.c:83
+msgctxt "Wi-Fi security"
+msgid "None"
+msgstr "Brak"
+
+#: ../clients/tui/nmt-page-wifi.c:84
+msgid "WPA & WPA2 Personal"
+msgstr "WPA i WPA2 Personal"
+
+#: ../clients/tui/nmt-page-wifi.c:85
+msgid "WPA & WPA2 Enterprise"
+msgstr "WPA i WPA2 Enterprise"
+
+#: ../clients/tui/nmt-page-wifi.c:86
+msgid "WEP 40/128-bit Key (Hex or ASCII)"
+msgstr "40/128-bitowy klucz WEP (szesnastkowy lub ASCII)"
+
+#: ../clients/tui/nmt-page-wifi.c:87
+msgid "WEP 128-bit Passphrase"
+msgstr "128-bitowe hasło WEP"
+
+#: ../clients/tui/nmt-page-wifi.c:88
+msgid "Dynamic WEP (802.1x)"
+msgstr "Dynamiczne WEP (802.1x)"
+
+#: ../clients/tui/nmt-page-wifi.c:89
+msgid "LEAP"
+msgstr "LEAP"
+
+#: ../clients/tui/nmt-page-wifi.c:94
+msgctxt "WEP key index"
+msgid "1 (Default)"
+msgstr "1 (domyślne)"
+
+#: ../clients/tui/nmt-page-wifi.c:95
+msgctxt "WEP key index"
+msgid "2"
+msgstr "2"
+
+#: ../clients/tui/nmt-page-wifi.c:96
+msgctxt "WEP key index"
+msgid "3"
+msgstr "3"
+
+#: ../clients/tui/nmt-page-wifi.c:97
+msgctxt "WEP key index"
+msgid "4"
+msgstr "4"
+
+#: ../clients/tui/nmt-page-wifi.c:102
+msgid "Open System"
+msgstr "System otwarty"
+
+#: ../clients/tui/nmt-page-wifi.c:103
+msgid "Shared Key"
+msgstr "Klucz współdzielony"
+
+#: ../clients/tui/nmt-page-wifi.c:217
+msgid "WI-FI"
+msgstr "WI-FI"
+
+#: ../clients/tui/nmt-page-wifi.c:259
+msgid "Channel"
+msgstr "Kanał"
+
+#: ../clients/tui/nmt-page-wifi.c:264
+msgid "Security"
+msgstr "Zabezpieczenia"
+
+#. "wpa-enterprise"
+#. FIXME
+#: ../clients/tui/nmt-page-wifi.c:285
+msgid "(No support for wpa-enterprise yet...)"
+msgstr "(WPA Enterprise nie jest jeszcze obsługiwane)"
+
+#: ../clients/tui/nmt-page-wifi.c:295 ../clients/tui/nmt-page-wifi.c:314
+msgid "WEP index"
+msgstr "Indeks WEP"
+
+#: ../clients/tui/nmt-page-wifi.c:303 ../clients/tui/nmt-page-wifi.c:322
+msgid "Authentication"
+msgstr "Uwierzytelnianie"
+
+#. "dynamic-wep"
+#. FIXME
+#: ../clients/tui/nmt-page-wifi.c:328
+msgid "(No support for dynamic-wep yet...)"
+msgstr "(Dynamiczne WEP nie jest jeszcze obsługiwane)"
+
+#: ../clients/tui/nmt-password-fields.c:130
+msgid "Ask for this password every time"
+msgstr "Pytanie o to hasło za każdym razem"
+
+#: ../clients/tui/nmt-password-fields.c:131
+msgid "Show password"
+msgstr "Wyświetlanie hasła"
+
+#: ../clients/tui/nmt-route-table.c:192
+msgid "Destination"
+msgstr "Cel"
+
+#: ../clients/tui/nmt-route-table.c:192
+msgid "Prefix"
+msgstr "Przedrostek"
+
+#: ../clients/tui/nmt-route-table.c:201
+msgid "Next Hop"
+msgstr "Następny krok"
+
+#: ../clients/tui/nmt-route-table.c:209
+msgid "Metric"
+msgstr "Parametry"
+
+#: ../clients/tui/nmt-route-table.c:229
+msgid "No custom routes are defined."
+msgstr "Nie określono żadnych tras użytkownika."
+
+#: ../clients/tui/nmt-slave-list.c:137
+msgid "Select the type of slave connection you wish to add."
+msgstr "Proszę wybrać typ połączenia podrzędnego do dodania."
+
+#: ../clients/tui/nmt-widget-list.c:141
+msgid "Add..."
+msgstr "Dodaj..."
+
+#: ../clients/tui/nmt-widget-list.c:204
+msgid "Remove"
+msgstr "Usuń"
+
+#: ../clients/tui/nmtui-connect.c:90
+msgid "Activation failed"
+msgstr "Aktywacja się nie powiodła"
+
+#: ../clients/tui/nmtui-connect.c:145
+msgid "Connecting..."
+msgstr "ÅÄ…czenie..."
+
+#: ../clients/tui/nmtui-connect.c:180 ../clients/tui/nmtui-connect.c:211
+#, c-format
+msgid "Could not activate connection: %s"
+msgstr "Nie można aktywować połączenia: %s"
+
+#: ../clients/tui/nmtui-connect.c:271 ../clients/tui/nmtui-connect.c:320
+msgid "Activate"
+msgstr "Aktywuj"
+
+#: ../clients/tui/nmtui-connect.c:273
+msgid "Deactivate"
+msgstr "Deaktywuj"
+
+#: ../clients/tui/nmtui-connect.c:325 ../clients/tui/nmtui-edit.c:121
+#: ../clients/tui/nmtui.c:111
+msgid "Quit"
+msgstr "Zakończ"
+
+#: ../clients/tui/nmtui-connect.c:348
+#, c-format
+msgid "No such connection '%s'"
+msgstr "Brak połączenia \"%s\""
+
+#: ../clients/tui/nmtui-connect.c:350
+msgid "Connection is already active"
+msgstr "Połączenie jest już aktywne"
+
+#: ../clients/tui/nmtui-edit.c:226
+msgid "Create"
+msgstr "Utwórz"
+
+#: ../clients/tui/nmtui-edit.c:368
+msgid "Select the type of connection you wish to create."
+msgstr "Proszę wybrać typ połączenia do utworzenia."
+
+#: ../clients/tui/nmtui-edit.c:376
+msgid ""
+"If you are creating a VPN, and the VPN connection you wish to create does "
+"not appear in the list, you may not have the correct VPN plugin installed."
+msgstr ""
+"Jeśli tworzone jest połączenie VPN, a tworzone połączenie VPN nie pojawia "
+"się na liście, to być może właściwa wtyczka VPN nie jest zainstalowana."
+
+#: ../clients/tui/nmtui-edit.c:412 ../clients/tui/nmtui-edit.c:428
+msgid "New Connection"
+msgstr "Nowe połączenie"
-#: ../libnm-util/crypto.c:133
+#: ../clients/tui/nmtui-edit.c:467
+#, c-format
+msgid "Unable to delete connection: %s"
+msgstr "Nie można usunąć połączenia: %s"
+
+#: ../clients/tui/nmtui-edit.c:506
+#, c-format
+msgid "Could not delete connection '%s': %s"
+msgstr "Nie można usunąć połączenia \"%s\": %s"
+
+#: ../clients/tui/nmtui-edit.c:528
+#, c-format
+msgid "Are you sure you want to delete the connection '%s'?"
+msgstr "Na pewno usunąć połączenie \"%s\"?"
+
+#: ../clients/tui/nmtui-hostname.c:47
+msgid "Set Hostname"
+msgstr "Ustaw nazwÄ™ komputera"
+
+#: ../clients/tui/nmtui-hostname.c:55
+msgid "Hostname"
+msgstr "Nazwa komputera"
+
+#. Translators: this indicates the result. ie, "I have set the hostname to ..."
+#: ../clients/tui/nmtui-hostname.c:118
+#, c-format
+msgid "Set hostname to '%s'"
+msgstr "Ustawiono nazwÄ™ komputera na \"%s\""
+
+#: ../clients/tui/nmtui-hostname.c:120
+#, c-format
+msgid "Unable to set hostname: %s"
+msgstr "Nie można ustawić nazwy komputera: %s"
+
+#: ../clients/tui/nmtui.c:56 ../clients/tui/nmtui.c:59
+msgid "connection"
+msgstr "połączenie"
+
+#: ../clients/tui/nmtui.c:57
+msgid "Edit a connection"
+msgstr "Modyfikuj połączanie"
+
+#: ../clients/tui/nmtui.c:60
+msgid "Activate a connection"
+msgstr "Aktywuj połączenie"
+
+#: ../clients/tui/nmtui.c:62
+msgid "new hostname"
+msgstr "nowa nazwa komputera"
+
+#: ../clients/tui/nmtui.c:63
+msgid "Set system hostname"
+msgstr "Ustaw systemowÄ… nazwÄ™ komputera"
+
+#: ../clients/tui/nmtui.c:86
+msgid "NetworkManager TUI"
+msgstr "Tekstowy interfejs usługi NetworkManager"
+
+#: ../clients/tui/nmtui.c:94
+msgid "Please select an option"
+msgstr "Proszę wybrać opcję"
+
+#: ../clients/tui/nmtui.c:146
+msgid "Usage"
+msgstr "Użycie"
+
+#: ../clients/tui/nmtui.c:227
+msgid "Could not parse arguments"
+msgstr "Nie można przetworzyć parametrów"
+
+#: ../clients/tui/nmtui.c:237
+#, c-format
+msgid "Could not contact NetworkManager: %s.\n"
+msgstr "Nie można skontaktować się z usługą NetworkManager: %s.\n"
+
+#: ../clients/tui/nmtui.c:242
+msgid "NetworkManager is not running."
+msgstr "Usługa NetworkManager nie jest uruchomiona."
+
+#: ../libnm-core/crypto.c:120 ../libnm-util/crypto.c:133
#, c-format
msgid "PEM key file had no end tag '%s'."
msgstr "Plik klucza PEM nie zawiera znacznika końcowego \"%s\"."
-#: ../libnm-util/crypto.c:146
+#: ../libnm-core/crypto.c:133 ../libnm-util/crypto.c:146
#, c-format
msgid "Doesn't look like a PEM private key file."
msgstr "Nie wyglÄ…da na plik klucza prywatnego PEM."
-#: ../libnm-util/crypto.c:163
+#: ../libnm-core/crypto.c:150 ../libnm-util/crypto.c:163
#, c-format
msgid "Malformed PEM file: Proc-Type was not first tag."
msgstr "Uszkodzony plik PEM: Proc-Type nie był pierwszym znacznikiem."
-#: ../libnm-util/crypto.c:171
+#: ../libnm-core/crypto.c:158 ../libnm-util/crypto.c:171
#, c-format
msgid "Malformed PEM file: unknown Proc-Type tag '%s'."
msgstr "Uszkodzony plik PEM: nieznany znacznik Proc-Type \"%s\"."
-#: ../libnm-util/crypto.c:181
+#: ../libnm-core/crypto.c:168 ../libnm-util/crypto.c:181
#, c-format
msgid "Malformed PEM file: DEK-Info was not the second tag."
msgstr "Uszkodzony plik PEM: DEK-Info nie był drugim znacznikiem."
-#: ../libnm-util/crypto.c:192
+#: ../libnm-core/crypto.c:179 ../libnm-util/crypto.c:192
#, c-format
msgid "Malformed PEM file: no IV found in DEK-Info tag."
msgstr "Uszkodzony plik PEM: brak IV w znaczniku DEK-Info."
-#: ../libnm-util/crypto.c:199
+#: ../libnm-core/crypto.c:186 ../libnm-util/crypto.c:199
#, c-format
msgid "Malformed PEM file: invalid format of IV in DEK-Info tag."
msgstr "Uszkodzony plik PEM: nieprawidłowy format IV w znaczniku DEK-Info."
-#: ../libnm-util/crypto.c:214
+#: ../libnm-core/crypto.c:201 ../libnm-util/crypto.c:214
#, c-format
msgid "Malformed PEM file: unknown private key cipher '%s'."
msgstr "Uszkodzony plik PEM: nieznany szyfr klucza prywatnego: \"%s\"."
-#: ../libnm-util/crypto.c:233
+#: ../libnm-core/crypto.c:220 ../libnm-util/crypto.c:233
#, c-format
msgid "Could not decode private key."
msgstr "Nie można zdekodować klucza prywatnego."
-#: ../libnm-util/crypto.c:285
+#: ../libnm-core/crypto.c:274 ../libnm-util/crypto.c:285
msgid "Failed to find expected PKCS#8 start tag."
msgstr ""
"Odnalezienie oczekiwanego znacznika początkowego PKCS#8 się nie powiodło."
-#: ../libnm-util/crypto.c:293
+#: ../libnm-core/crypto.c:282 ../libnm-util/crypto.c:293
#, c-format
msgid "Failed to find expected PKCS#8 end tag '%s'."
msgstr ""
"Odnalezienie oczekiwanego znacznika końcowego PKCS#8 \"%s\" się nie powiodło."
-#: ../libnm-util/crypto.c:312
+#: ../libnm-core/crypto.c:301 ../libnm-util/crypto.c:312
msgid "Failed to decode PKCS#8 private key."
msgstr "Odkodowanie klucza prywatnego PKCS#8 się nie powiodło."
-#: ../libnm-util/crypto.c:354
+#: ../libnm-core/crypto.c:343 ../libnm-util/crypto.c:354
#, c-format
msgid "IV must be an even number of bytes in length."
msgstr "Liczba bajtów w IV musi być liczbą parzystą."
-#: ../libnm-util/crypto.c:368
+#: ../libnm-core/crypto.c:357 ../libnm-util/crypto.c:368
#, c-format
msgid "IV contains non-hexadecimal digits."
msgstr "IV zawiera nieszesnastkowe cyfry."
-#: ../libnm-util/crypto.c:408 ../libnm-util/crypto_gnutls.c:150
-#: ../libnm-util/crypto_gnutls.c:267 ../libnm-util/crypto_nss.c:170
-#: ../libnm-util/crypto_nss.c:331
+#: ../libnm-core/crypto.c:397 ../libnm-core/crypto_gnutls.c:93
+#: ../libnm-core/crypto_gnutls.c:214 ../libnm-core/crypto_nss.c:115
+#: ../libnm-core/crypto_nss.c:280 ../libnm-util/crypto.c:408
+#: ../libnm-util/crypto_gnutls.c:146 ../libnm-util/crypto_gnutls.c:263
+#: ../libnm-util/crypto_nss.c:165 ../libnm-util/crypto_nss.c:326
#, c-format
msgid "Private key cipher '%s' was unknown."
msgstr "Nieznany szyfr klucza prywatnego \"%s\"."
-#: ../libnm-util/crypto.c:518
+#: ../libnm-core/crypto.c:496 ../libnm-util/crypto.c:518
#, c-format
msgid "Unable to determine private key type."
msgstr "Nie można określić typu klucza prywatnego."
-#: ../libnm-util/crypto.c:573
+#: ../libnm-core/crypto.c:504
+#, c-format
+msgid "Password provided, but key was not encrypted."
+msgstr "Podano hasło, ale klucz nie był zaszyfrowany."
+
+#: ../libnm-core/crypto.c:557 ../libnm-util/crypto.c:573
#, c-format
msgid "PEM certificate had no start tag '%s'."
msgstr "Certyfikat PEM nie zawiera poczÄ…tkowego znacznika \"%s\"."
-#: ../libnm-util/crypto.c:582
+#: ../libnm-core/crypto.c:566 ../libnm-util/crypto.c:582
#, c-format
msgid "PEM certificate had no end tag '%s'."
msgstr "Certyfikat PEM nie zawiera kończącego znacznika \"%s\"."
-#: ../libnm-util/crypto.c:600
+#: ../libnm-core/crypto.c:584 ../libnm-util/crypto.c:600
#, c-format
msgid "Failed to decode certificate."
msgstr "Zdekodowanie certyfikatu się nie powiodło."
-#: ../libnm-util/crypto_gnutls.c:50
+#: ../libnm-core/crypto_gnutls.c:51 ../libnm-util/crypto_gnutls.c:51
msgid "Failed to initialize the crypto engine."
msgstr "Zainicjowanie modułu szyfrowania się nie powiodło."
-#: ../libnm-util/crypto_gnutls.c:92
-#, c-format
-msgid "Failed to initialize the MD5 engine: %s / %s."
-msgstr "Zainicjowanie modułu MD5 się nie powiodło: %s / %s."
-
-#: ../libnm-util/crypto_gnutls.c:158
+#: ../libnm-core/crypto_gnutls.c:101 ../libnm-util/crypto_gnutls.c:154
#, c-format
msgid "Invalid IV length (must be at least %zd)."
msgstr "Nieprawidłowa długość IV (musi wynosić co najmniej %zd)."
-#: ../libnm-util/crypto_gnutls.c:169
+#: ../libnm-core/crypto_gnutls.c:112 ../libnm-util/crypto_gnutls.c:165
#, c-format
msgid "Failed to initialize the decryption cipher context: %s / %s."
msgstr ""
"Zainicjowanie kontekstu szyfru do odszyfrowania się nie powiodło: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:178
+#: ../libnm-core/crypto_gnutls.c:121 ../libnm-util/crypto_gnutls.c:174
#, c-format
msgid "Failed to set symmetric key for decryption: %s / %s."
msgstr ""
"Ustawienie klucza symetrycznego do odszyfrowania się nie powiodło: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:187
+#: ../libnm-core/crypto_gnutls.c:130 ../libnm-util/crypto_gnutls.c:183
#, c-format
msgid "Failed to set IV for decryption: %s / %s."
msgstr "Ustawienie IV do odszyfrowania się nie powiodło: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:196
+#: ../libnm-core/crypto_gnutls.c:139 ../libnm-util/crypto_gnutls.c:192
#, c-format
msgid "Failed to decrypt the private key: %s / %s."
msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:206 ../libnm-util/crypto_nss.c:260
+#: ../libnm-core/crypto_gnutls.c:149 ../libnm-core/crypto_nss.c:205
+#: ../libnm-util/crypto_gnutls.c:202 ../libnm-util/crypto_nss.c:255
#, c-format
msgid "Failed to decrypt the private key: unexpected padding length."
msgstr ""
"Odszyfrowanie klucza prywatnego się nie powiodło: nieoczekiwana długość "
"wypełnienia."
-#: ../libnm-util/crypto_gnutls.c:217 ../libnm-util/crypto_nss.c:271
+#: ../libnm-core/crypto_gnutls.c:160 ../libnm-core/crypto_nss.c:216
+#: ../libnm-util/crypto_gnutls.c:213 ../libnm-util/crypto_nss.c:266
#, c-format
msgid "Failed to decrypt the private key."
msgstr "Odszyfrowanie klucza prywatnego się nie powiodło."
-#: ../libnm-util/crypto_gnutls.c:289
+#: ../libnm-core/crypto_gnutls.c:236 ../libnm-util/crypto_gnutls.c:285
#, c-format
msgid "Failed to initialize the encryption cipher context: %s / %s."
msgstr ""
"Zainicjowanie kontekstu szyfru do szyfrowania się nie powiodło: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:298
+#: ../libnm-core/crypto_gnutls.c:245 ../libnm-util/crypto_gnutls.c:294
#, c-format
msgid "Failed to set symmetric key for encryption: %s / %s."
msgstr ""
"Ustawienie klucza symetrycznego do szyfrowania się nie powiodło: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:308
+#: ../libnm-core/crypto_gnutls.c:255 ../libnm-util/crypto_gnutls.c:304
#, c-format
msgid "Failed to set IV for encryption: %s / %s."
msgstr "Ustawienie IV do szyfrowania się nie powiodło: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:317
+#: ../libnm-core/crypto_gnutls.c:264 ../libnm-util/crypto_gnutls.c:313
#, c-format
msgid "Failed to encrypt the data: %s / %s."
msgstr "Zaszyfrowanie danych się nie powiodło: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:357
+#: ../libnm-core/crypto_gnutls.c:307 ../libnm-util/crypto_gnutls.c:353
#, c-format
msgid "Error initializing certificate data: %s"
msgstr "BÅ‚Ä…d podczas inicjowania danych certyfikatu: %s"
-#: ../libnm-util/crypto_gnutls.c:379
+#: ../libnm-core/crypto_gnutls.c:329 ../libnm-util/crypto_gnutls.c:375
#, c-format
msgid "Couldn't decode certificate: %s"
msgstr "Nie można zdekodować certyfikatu: %s"
-#: ../libnm-util/crypto_gnutls.c:403
+#: ../libnm-core/crypto_gnutls.c:357 ../libnm-util/crypto_gnutls.c:399
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %s"
msgstr "Nie można zainicjować dekodera PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:416
+#: ../libnm-core/crypto_gnutls.c:370 ../libnm-util/crypto_gnutls.c:412
#, c-format
msgid "Couldn't decode PKCS#12 file: %s"
msgstr "Nie można odszyfrować pliku PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:428
+#: ../libnm-core/crypto_gnutls.c:382 ../libnm-util/crypto_gnutls.c:424
#, c-format
msgid "Couldn't verify PKCS#12 file: %s"
msgstr "Nie można zweryfikować pliku PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:456
+#: ../libnm-core/crypto_gnutls.c:414 ../libnm-util/crypto_gnutls.c:452
#, c-format
msgid "Couldn't initialize PKCS#8 decoder: %s"
msgstr "Nie można zainicjować dekodera PKCS#8: %s"
-#: ../libnm-util/crypto_gnutls.c:479
+#: ../libnm-core/crypto_gnutls.c:437 ../libnm-util/crypto_gnutls.c:475
#, c-format
msgid "Couldn't decode PKCS#8 file: %s"
msgstr "Nie można dekodować pliku PKCS#8: %s"
-#: ../libnm-util/crypto_nss.c:56
+#: ../libnm-core/crypto_nss.c:57 ../libnm-util/crypto_nss.c:56
#, c-format
msgid "Failed to initialize the crypto engine: %d."
msgstr "Zainicjowanie modułu szyfrowania się nie powiodło: %d."
-#: ../libnm-util/crypto_nss.c:107
-#, c-format
-msgid "Failed to initialize the MD5 context: %d."
-msgstr "Zainicjowanie kontekstu MD5 się nie powiodło: %d."
-
-#: ../libnm-util/crypto_nss.c:178
+#: ../libnm-core/crypto_nss.c:123 ../libnm-util/crypto_nss.c:173
#, c-format
msgid "Invalid IV length (must be at least %d)."
msgstr "Nieprawidłowa długość IV (musi wynosić co najmniej %d)."
-#: ../libnm-util/crypto_nss.c:189
+#: ../libnm-core/crypto_nss.c:134 ../libnm-util/crypto_nss.c:184
#, c-format
msgid "Failed to initialize the decryption cipher slot."
msgstr "Zainicjowanie gniazda szyfru do odszyfrowania się nie powiodło."
-#: ../libnm-util/crypto_nss.c:199
+#: ../libnm-core/crypto_nss.c:144 ../libnm-util/crypto_nss.c:194
#, c-format
msgid "Failed to set symmetric key for decryption."
msgstr "Ustawienie klucza symetrycznego do odszyfrowania się nie powiodło."
-#: ../libnm-util/crypto_nss.c:209
+#: ../libnm-core/crypto_nss.c:154 ../libnm-util/crypto_nss.c:204
#, c-format
msgid "Failed to set IV for decryption."
msgstr "Ustawienie IV do odszyfrowania się nie powiodło."
-#: ../libnm-util/crypto_nss.c:217
+#: ../libnm-core/crypto_nss.c:162 ../libnm-util/crypto_nss.c:212
#, c-format
msgid "Failed to initialize the decryption context."
msgstr "Zainicjowanie kontekstu odszyfrowania się nie powiodło."
-#: ../libnm-util/crypto_nss.c:230
+#: ../libnm-core/crypto_nss.c:175 ../libnm-util/crypto_nss.c:225
#, c-format
msgid "Failed to decrypt the private key: %d."
msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: %d."
-#: ../libnm-util/crypto_nss.c:238
+#: ../libnm-core/crypto_nss.c:183 ../libnm-util/crypto_nss.c:233
#, c-format
msgid "Failed to decrypt the private key: decrypted data too large."
msgstr ""
"Odszyfrowanie klucza prywatnego się nie powiodło: odszyfrowane dane są za "
"duże."
-#: ../libnm-util/crypto_nss.c:249
+#: ../libnm-core/crypto_nss.c:194 ../libnm-util/crypto_nss.c:244
#, c-format
msgid "Failed to finalize decryption of the private key: %d."
msgstr "Zakończenie odszyfrowania klucza prywatnego się nie powiodło: %d."
-#: ../libnm-util/crypto_nss.c:353
+#: ../libnm-core/crypto_nss.c:302 ../libnm-util/crypto_nss.c:348
#, c-format
msgid "Failed to initialize the encryption cipher slot."
msgstr "Zainicjowanie gniazda szyfru do szyfrowania się nie powiodło."
-#: ../libnm-util/crypto_nss.c:361
+#: ../libnm-core/crypto_nss.c:310 ../libnm-util/crypto_nss.c:356
#, c-format
msgid "Failed to set symmetric key for encryption."
msgstr "Ustawienie klucza symetrycznego do szyfrowania się nie powiodło."
-#: ../libnm-util/crypto_nss.c:369
+#: ../libnm-core/crypto_nss.c:318 ../libnm-util/crypto_nss.c:364
#, c-format
msgid "Failed to set IV for encryption."
msgstr "Ustawienie IV do szyfrowania się nie powiodło."
-#: ../libnm-util/crypto_nss.c:377
+#: ../libnm-core/crypto_nss.c:326 ../libnm-util/crypto_nss.c:372
#, c-format
msgid "Failed to initialize the encryption context."
msgstr "Zainicjowanie kontekstu szyfrowania się nie powiodło."
-#: ../libnm-util/crypto_nss.c:385
+#: ../libnm-core/crypto_nss.c:334 ../libnm-util/crypto_nss.c:380
#, c-format
msgid "Failed to encrypt: %d."
msgstr "Zaszyfrowanie się nie powiodło: %d."
-#: ../libnm-util/crypto_nss.c:393
+#: ../libnm-core/crypto_nss.c:342 ../libnm-util/crypto_nss.c:388
#, c-format
msgid "Unexpected amount of data after encrypting."
msgstr "Nieoczekiwana ilość danych po zaszyfrowaniu."
-#: ../libnm-util/crypto_nss.c:433
+#: ../libnm-core/crypto_nss.c:385 ../libnm-util/crypto_nss.c:428
#, c-format
msgid "Couldn't decode certificate: %d"
msgstr "Nie można zdekodować certyfikatu: %d"
-#: ../libnm-util/crypto_nss.c:468
+#: ../libnm-core/crypto_nss.c:423
#, c-format
-msgid "Couldn't convert password to UCS2: %d"
-msgstr "Nie można przekonwertować hasła do UCS2: %d"
+msgid "Password must be UTF-8"
+msgstr "Hasło musi być UTF-8"
-#: ../libnm-util/crypto_nss.c:496
+#: ../libnm-core/crypto_nss.c:453 ../libnm-util/crypto_nss.c:491
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %d"
msgstr "Nie można zainicjować dekodera PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:505
+#: ../libnm-core/crypto_nss.c:462 ../libnm-util/crypto_nss.c:500
#, c-format
msgid "Couldn't decode PKCS#12 file: %d"
msgstr "Nie można odszyfrować pliku PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:514
+#: ../libnm-core/crypto_nss.c:471 ../libnm-util/crypto_nss.c:509
#, c-format
msgid "Couldn't verify PKCS#12 file: %d"
msgstr "Nie można zweryfikować pliku PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:558
+#: ../libnm-core/crypto_nss.c:522 ../libnm-util/crypto_nss.c:553
msgid "Could not generate random data."
msgstr "Nie można utworzyć losowych danych."
-#: ../libnm-util/nm-setting-8021x.c:599
+#: ../libnm-core/nm-connection.c:225
+msgid "wrong type; should be a list of strings."
+msgstr "błędny typ; powinien być listą ciągów."
+
+#: ../libnm-core/nm-connection.c:280
+msgid "unknown setting name"
+msgstr "nieznana nazwa ustawienia"
+
+#: ../libnm-core/nm-connection.c:802
+msgid "setting not found"
+msgstr "nie odnaleziono ustawienia"
+
+#: ../libnm-core/nm-connection.c:866
+msgid "setting not allowed in slave connection"
+msgstr "ustawienie nie jest dozwolone w połączeniu podrzędnym"
+
+#: ../libnm-core/nm-connection.c:877
+msgid "setting is required for non-slave connections"
+msgstr "wymagane jest ustawienie dla niepodrzędnych połączeń"
+
+#: ../libnm-core/nm-connection.c:943
+msgid "Unexpected failure to verify the connection"
+msgstr "Sprawdzenie połączenia niespodziewanie się nie powiodło"
+
+#: ../libnm-core/nm-connection.c:976
+msgid "Unexpected failure to normalize the connection"
+msgstr "Znormalizowanie połączenia niespodziewanie się nie powiodło"
+
+#: ../libnm-core/nm-connection.c:1440 ../libnm-core/nm-setting-8021x.c:2273
+#: ../libnm-core/nm-setting-8021x.c:2290 ../libnm-core/nm-setting-8021x.c:2321
+#: ../libnm-core/nm-setting-8021x.c:2338 ../libnm-core/nm-setting-8021x.c:2380
+#: ../libnm-core/nm-setting-8021x.c:2392 ../libnm-core/nm-setting-8021x.c:2410
+#: ../libnm-core/nm-setting-8021x.c:2422 ../libnm-core/nm-setting-8021x.c:2446
+#: ../libnm-core/nm-setting-8021x.c:2628 ../libnm-core/nm-setting-adsl.c:190
+#: ../libnm-core/nm-setting-bluetooth.c:121
+#: ../libnm-core/nm-setting-bluetooth.c:139
+#: ../libnm-core/nm-setting-cdma.c:142
+#: ../libnm-core/nm-setting-connection.c:768
+#: ../libnm-core/nm-setting-connection.c:807
+#: ../libnm-core/nm-setting-connection.c:908
+#: ../libnm-core/nm-setting-ip-config.c:1841
+#: ../libnm-core/nm-setting-olpc-mesh.c:113
+#: ../libnm-core/nm-setting-pppoe.c:143 ../libnm-core/nm-setting-vpn.c:400
+#: ../libnm-core/nm-setting-wimax.c:117
+#: ../libnm-core/nm-setting-wireless-security.c:862
+#: ../libnm-core/nm-setting-wireless.c:694 ../libnm-util/nm-setting.c:1366
+#: ../libnm-util/nm-setting.c:1385 ../libnm-util/nm-setting.c:1403
+#: ../libnm-util/nm-setting-8021x.c:2284 ../libnm-util/nm-setting-8021x.c:2301
+#: ../libnm-util/nm-setting-8021x.c:2342 ../libnm-util/nm-setting-8021x.c:2359
+#: ../libnm-util/nm-setting-8021x.c:2411 ../libnm-util/nm-setting-8021x.c:2423
+#: ../libnm-util/nm-setting-8021x.c:2441 ../libnm-util/nm-setting-8021x.c:2453
+#: ../libnm-util/nm-setting-8021x.c:2477 ../libnm-util/nm-setting-8021x.c:2655
+#: ../libnm-util/nm-setting-adsl.c:210
+#: ../libnm-util/nm-setting-bluetooth.c:143
+#: ../libnm-util/nm-setting-bluetooth.c:161
+#: ../libnm-util/nm-setting-cdma.c:163
+#: ../libnm-util/nm-setting-connection.c:769
+#: ../libnm-util/nm-setting-connection.c:785
+#: ../libnm-util/nm-setting-connection.c:846
+#: ../libnm-util/nm-setting-ip4-config.c:852
+#: ../libnm-util/nm-setting-ip6-config.c:833
+#: ../libnm-util/nm-setting-ip6-config.c:897
+#: ../libnm-util/nm-setting-olpc-mesh.c:124
+#: ../libnm-util/nm-setting-pppoe.c:164 ../libnm-util/nm-setting-vpn.c:424
+#: ../libnm-util/nm-setting-wimax.c:139
+#: ../libnm-util/nm-setting-wireless-security.c:892
+#: ../libnm-util/nm-setting-wireless.c:752
+msgid "property is missing"
+msgstr "brak właściwości"
+
+#: ../libnm-core/nm-setting-8021x.c:579 ../libnm-util/nm-setting-8021x.c:598
msgid "CA certificate must be in X.509 format"
msgstr "Certyfikat CA musi być w formacie X.509"
-#: ../libnm-util/nm-setting-8021x.c:917 ../libnm-util/nm-setting-8021x.c:1180
-#: ../libnm-util/nm-setting-8021x.c:1503
+#: ../libnm-core/nm-setting-8021x.c:894 ../libnm-core/nm-setting-8021x.c:1158
+#: ../libnm-core/nm-setting-8021x.c:1478 ../libnm-util/nm-setting-8021x.c:916
+#: ../libnm-util/nm-setting-8021x.c:1179 ../libnm-util/nm-setting-8021x.c:1502
msgid "invalid certificate format"
msgstr "nieprawidłowy format certyfikatu"
-#: ../libnm-util/nm-setting-8021x.c:1772
+#: ../libnm-core/nm-setting-8021x.c:1761 ../libnm-util/nm-setting-8021x.c:1771
msgid "invalid private key"
msgstr "nieprawidłowy klucz prywatny"
-#: ../libnm-util/nm-setting-8021x.c:2083
+#: ../libnm-core/nm-setting-8021x.c:2071 ../libnm-util/nm-setting-8021x.c:2082
msgid "invalid phase2 private key"
msgstr "nieprawidłowy klucz prywatny drugiego etapu"
-#: ../libnm-util/nm-setting-8021x.c:2285 ../libnm-util/nm-setting-8021x.c:2302
-#: ../libnm-util/nm-setting-8021x.c:2343 ../libnm-util/nm-setting-8021x.c:2360
-#: ../libnm-util/nm-setting-8021x.c:2412 ../libnm-util/nm-setting-8021x.c:2424
-#: ../libnm-util/nm-setting-8021x.c:2442 ../libnm-util/nm-setting-8021x.c:2454
-#: ../libnm-util/nm-setting-8021x.c:2478 ../libnm-util/nm-setting-8021x.c:2656
-#: ../libnm-util/nm-setting-adsl.c:212
-#: ../libnm-util/nm-setting-bluetooth.c:144
-#: ../libnm-util/nm-setting-bluetooth.c:162
-#: ../libnm-util/nm-setting-bond.c:498 ../libnm-util/nm-setting-bridge.c:287
-#: ../libnm-util/nm-setting-cdma.c:163
-#: ../libnm-util/nm-setting-connection.c:770
-#: ../libnm-util/nm-setting-connection.c:786
-#: ../libnm-util/nm-setting-connection.c:841
-#: ../libnm-util/nm-setting-ip4-config.c:887
-#: ../libnm-util/nm-setting-ip6-config.c:812
-#: ../libnm-util/nm-setting-ip6-config.c:876
-#: ../libnm-util/nm-setting-olpc-mesh.c:127
-#: ../libnm-util/nm-setting-pppoe.c:165 ../libnm-util/nm-setting-team.c:141
-#: ../libnm-util/nm-setting-vpn.c:405 ../libnm-util/nm-setting-wimax.c:137
-#: ../libnm-util/nm-setting-wireless-security.c:894
-#: ../libnm-util/nm-setting-wireless.c:753
-msgid "property is missing"
-msgstr "brak właściwości"
-
-#: ../libnm-util/nm-setting-8021x.c:2292 ../libnm-util/nm-setting-8021x.c:2309
-#: ../libnm-util/nm-setting-8021x.c:2350 ../libnm-util/nm-setting-8021x.c:2367
-#: ../libnm-util/nm-setting-8021x.c:2418 ../libnm-util/nm-setting-8021x.c:2430
-#: ../libnm-util/nm-setting-8021x.c:2448 ../libnm-util/nm-setting-8021x.c:2460
-#: ../libnm-util/nm-setting-8021x.c:2485 ../libnm-util/nm-setting-adsl.c:219
-#: ../libnm-util/nm-setting-adsl.c:228 ../libnm-util/nm-setting-cdma.c:179
+#: ../libnm-core/nm-setting-8021x.c:2280 ../libnm-core/nm-setting-8021x.c:2297
+#: ../libnm-core/nm-setting-8021x.c:2328 ../libnm-core/nm-setting-8021x.c:2345
+#: ../libnm-core/nm-setting-8021x.c:2386 ../libnm-core/nm-setting-8021x.c:2398
+#: ../libnm-core/nm-setting-8021x.c:2416 ../libnm-core/nm-setting-8021x.c:2428
+#: ../libnm-core/nm-setting-8021x.c:2453 ../libnm-core/nm-setting-adsl.c:197
+#: ../libnm-core/nm-setting-adsl.c:206 ../libnm-core/nm-setting-cdma.c:158
+#: ../libnm-core/nm-setting-cdma.c:167
+#: ../libnm-core/nm-setting-connection.c:775
+#: ../libnm-core/nm-setting-connection.c:818
+#: ../libnm-core/nm-setting-gsm.c:226 ../libnm-core/nm-setting-gsm.c:283
+#: ../libnm-core/nm-setting-gsm.c:292
+#: ../libnm-core/nm-setting-ip-config.c:1848
+#: ../libnm-core/nm-setting-ip4-config.c:178
+#: ../libnm-core/nm-setting-pppoe.c:150 ../libnm-core/nm-setting-pppoe.c:159
+#: ../libnm-core/nm-setting-vpn.c:409 ../libnm-core/nm-setting-vpn.c:419
+#: ../libnm-core/nm-setting-wimax.c:126
+#: ../libnm-core/nm-setting-wireless-security.c:892
+#: ../libnm-core/nm-setting-wireless-security.c:900
+#: ../libnm-core/nm-setting-wireless-security.c:924
+#: ../libnm-util/nm-setting-8021x.c:2291 ../libnm-util/nm-setting-8021x.c:2308
+#: ../libnm-util/nm-setting-8021x.c:2349 ../libnm-util/nm-setting-8021x.c:2366
+#: ../libnm-util/nm-setting-8021x.c:2417 ../libnm-util/nm-setting-8021x.c:2429
+#: ../libnm-util/nm-setting-8021x.c:2447 ../libnm-util/nm-setting-8021x.c:2459
+#: ../libnm-util/nm-setting-8021x.c:2484 ../libnm-util/nm-setting-adsl.c:217
+#: ../libnm-util/nm-setting-adsl.c:226 ../libnm-util/nm-setting-cdma.c:179
#: ../libnm-util/nm-setting-cdma.c:188
-#: ../libnm-util/nm-setting-connection.c:777
-#: ../libnm-util/nm-setting-connection.c:848
-#: ../libnm-util/nm-setting-gsm.c:284 ../libnm-util/nm-setting-gsm.c:341
-#: ../libnm-util/nm-setting-gsm.c:350
-#: ../libnm-util/nm-setting-ip4-config.c:952
-#: ../libnm-util/nm-setting-ip4-config.c:961
-#: ../libnm-util/nm-setting-pppoe.c:172 ../libnm-util/nm-setting-pppoe.c:181
-#: ../libnm-util/nm-setting-vpn.c:414 ../libnm-util/nm-setting-vpn.c:424
-#: ../libnm-util/nm-setting-wimax.c:146
-#: ../libnm-util/nm-setting-wireless-security.c:924
-#: ../libnm-util/nm-setting-wireless-security.c:932
-#: ../libnm-util/nm-setting-wireless-security.c:956
+#: ../libnm-util/nm-setting-connection.c:776
+#: ../libnm-util/nm-setting-connection.c:853
+#: ../libnm-util/nm-setting-gsm.c:283 ../libnm-util/nm-setting-gsm.c:340
+#: ../libnm-util/nm-setting-gsm.c:349
+#: ../libnm-util/nm-setting-ip4-config.c:917
+#: ../libnm-util/nm-setting-ip4-config.c:926
+#: ../libnm-util/nm-setting-pppoe.c:171 ../libnm-util/nm-setting-pppoe.c:180
+#: ../libnm-util/nm-setting-vpn.c:433 ../libnm-util/nm-setting-vpn.c:443
+#: ../libnm-util/nm-setting-wimax.c:148
+#: ../libnm-util/nm-setting-wireless-security.c:922
+#: ../libnm-util/nm-setting-wireless-security.c:930
+#: ../libnm-util/nm-setting-wireless-security.c:954
msgid "property is empty"
msgstr "właściwość jest pusta"
-#: ../libnm-util/nm-setting-8021x.c:2320 ../libnm-util/nm-setting-8021x.c:2332
-#: ../libnm-util/nm-setting-8021x.c:2378 ../libnm-util/nm-setting-8021x.c:2390
+#: ../libnm-core/nm-setting-8021x.c:2310 ../libnm-core/nm-setting-8021x.c:2358
+#: ../libnm-util/nm-setting-8021x.c:2319 ../libnm-util/nm-setting-8021x.c:2331
+#: ../libnm-util/nm-setting-8021x.c:2377 ../libnm-util/nm-setting-8021x.c:2389
#, c-format
msgid "has to match '%s' property for PKCS#12"
msgstr "musi pasować do właściwości \"%s\" dla PKCS#12"
-#: ../libnm-util/nm-setting-8021x.c:2631 ../libnm-util/nm-setting-8021x.c:2665
-#: ../libnm-util/nm-setting-bluetooth.c:153
-#: ../libnm-util/nm-setting-bond.c:507
-#: ../libnm-util/nm-setting-infiniband.c:203
-#: ../libnm-util/nm-setting-infiniband.c:218
-#: ../libnm-util/nm-setting-ip4-config.c:943
-#: ../libnm-util/nm-setting-ip6-config.c:867
-#: ../libnm-util/nm-setting-olpc-mesh.c:155
-#: ../libnm-util/nm-setting-team.c:150 ../libnm-util/nm-setting-wimax.c:155
-#: ../libnm-util/nm-setting-wired.c:663 ../libnm-util/nm-setting-wired.c:672
-#: ../libnm-util/nm-setting-wireless-security.c:975
-#: ../libnm-util/nm-setting-wireless-security.c:984
-#: ../libnm-util/nm-setting-wireless-security.c:992
-#: ../libnm-util/nm-setting-wireless-security.c:1000
-#: ../libnm-util/nm-setting-wireless-security.c:1008
-#: ../libnm-util/nm-setting-wireless-security.c:1017
-#: ../libnm-util/nm-setting-wireless-security.c:1026
-#: ../libnm-util/nm-setting-wireless-security.c:1035
-#: ../libnm-util/nm-setting-wireless-security.c:1071
-#: ../libnm-util/nm-setting-wireless-security.c:1081
-#: ../libnm-util/nm-setting-wireless.c:813
-#: ../libnm-util/nm-setting-wireless.c:822
-#: ../libnm-util/nm-setting-wireless.c:831
+#: ../libnm-core/nm-setting-8021x.c:2603 ../libnm-core/nm-setting-8021x.c:2637
+#: ../libnm-core/nm-setting-bluetooth.c:130
+#: ../libnm-core/nm-setting-infiniband.c:193
+#: ../libnm-core/nm-setting-infiniband.c:208
+#: ../libnm-core/nm-setting-ip4-config.c:169
+#: ../libnm-core/nm-setting-ip6-config.c:166
+#: ../libnm-core/nm-setting-olpc-mesh.c:142
+#: ../libnm-core/nm-setting-wimax.c:135 ../libnm-core/nm-setting-wired.c:621
+#: ../libnm-core/nm-setting-wired.c:631
+#: ../libnm-core/nm-setting-wireless-security.c:943
+#: ../libnm-core/nm-setting-wireless-security.c:952
+#: ../libnm-core/nm-setting-wireless-security.c:960
+#: ../libnm-core/nm-setting-wireless-security.c:968
+#: ../libnm-core/nm-setting-wireless-security.c:976
+#: ../libnm-core/nm-setting-wireless-security.c:985
+#: ../libnm-core/nm-setting-wireless-security.c:994
+#: ../libnm-core/nm-setting-wireless-security.c:1003
+#: ../libnm-core/nm-setting-wireless-security.c:1039
+#: ../libnm-core/nm-setting-wireless-security.c:1049
+#: ../libnm-core/nm-setting-wireless.c:755
+#: ../libnm-core/nm-setting-wireless.c:764
+#: ../libnm-core/nm-setting-wireless.c:773 ../libnm-util/nm-setting.c:1376
+#: ../libnm-util/nm-setting.c:1394 ../libnm-util/nm-setting.c:1413
+#: ../libnm-util/nm-setting-8021x.c:2630 ../libnm-util/nm-setting-8021x.c:2664
+#: ../libnm-util/nm-setting-bluetooth.c:152
+#: ../libnm-util/nm-setting-infiniband.c:206
+#: ../libnm-util/nm-setting-infiniband.c:222
+#: ../libnm-util/nm-setting-ip4-config.c:908
+#: ../libnm-util/nm-setting-ip6-config.c:888
+#: ../libnm-util/nm-setting-olpc-mesh.c:152
+#: ../libnm-util/nm-setting-wimax.c:157 ../libnm-util/nm-setting-wired.c:662
+#: ../libnm-util/nm-setting-wired.c:671
+#: ../libnm-util/nm-setting-wireless-security.c:973
+#: ../libnm-util/nm-setting-wireless-security.c:982
+#: ../libnm-util/nm-setting-wireless-security.c:990
+#: ../libnm-util/nm-setting-wireless-security.c:998
+#: ../libnm-util/nm-setting-wireless-security.c:1006
+#: ../libnm-util/nm-setting-wireless-security.c:1015
+#: ../libnm-util/nm-setting-wireless-security.c:1024
+#: ../libnm-util/nm-setting-wireless-security.c:1033
+#: ../libnm-util/nm-setting-wireless-security.c:1069
+#: ../libnm-util/nm-setting-wireless-security.c:1079
+#: ../libnm-util/nm-setting-wireless.c:812
+#: ../libnm-util/nm-setting-wireless.c:821
+#: ../libnm-util/nm-setting-wireless.c:830
msgid "property is invalid"
msgstr "właściwość jest nieprawidłowa"
-#: ../libnm-util/nm-setting-8021x.c:2690 ../libnm-util/nm-setting-8021x.c:2700
-#: ../libnm-util/nm-setting-8021x.c:2710 ../libnm-util/nm-setting-8021x.c:2720
-#: ../libnm-util/nm-setting-8021x.c:2730 ../libnm-util/nm-setting-adsl.c:239
+#: ../libnm-core/nm-setting-8021x.c:2662 ../libnm-core/nm-setting-8021x.c:2672
+#: ../libnm-core/nm-setting-8021x.c:2682 ../libnm-core/nm-setting-8021x.c:2692
+#: ../libnm-core/nm-setting-8021x.c:2702 ../libnm-core/nm-setting-adsl.c:218
+#: ../libnm-core/nm-setting-adsl.c:230
+#: ../libnm-core/nm-setting-bluetooth.c:147
+#: ../libnm-core/nm-setting-wireless-security.c:871
+#: ../libnm-util/nm-setting-8021x.c:2689 ../libnm-util/nm-setting-8021x.c:2699
+#: ../libnm-util/nm-setting-8021x.c:2709 ../libnm-util/nm-setting-8021x.c:2719
+#: ../libnm-util/nm-setting-8021x.c:2729 ../libnm-util/nm-setting-adsl.c:238
#: ../libnm-util/nm-setting-adsl.c:250
-#: ../libnm-util/nm-setting-bluetooth.c:170
-#: ../libnm-util/nm-setting-wireless-security.c:903
+#: ../libnm-util/nm-setting-bluetooth.c:169
+#: ../libnm-util/nm-setting-wireless-security.c:901
#, c-format
msgid "'%s' is not a valid value for the property"
msgstr "\"%s\" nie jest prawidłową wartością dla właściwości"
-#: ../libnm-util/nm-setting-bluetooth.c:188
+#: ../libnm-core/nm-setting-bluetooth.c:169
#, c-format
-msgid "requires '%s' or '%s' setting"
-msgstr "wymaga ustawienia \"%s\" lub \"%s\""
+msgid "'%s' connection requires '%s' or '%s' setting"
+msgstr "połączenie \"%s\" wymaga ustawienia \"%s\" lub \"%s\""
-#: ../libnm-util/nm-setting-bond.c:518
+#: ../libnm-core/nm-setting-bond.c:455 ../libnm-util/nm-setting-bond.c:503
#, c-format
msgid "invalid option '%s' or its value '%s'"
msgstr "nieprawidłowa opcja \"%s\" lub jej wartość \"%s\""
-#: ../libnm-util/nm-setting-bond.c:537
+#: ../libnm-core/nm-setting-bond.c:474 ../libnm-util/nm-setting-bond.c:522
#, c-format
msgid "only one of '%s' and '%s' can be set"
msgstr "tylko jedno z \"%s\" lub \"%s\" może być ustawione"
-#: ../libnm-util/nm-setting-bond.c:548
+#: ../libnm-core/nm-setting-bond.c:486 ../libnm-util/nm-setting-bond.c:533
#, c-format
msgid "mandatory option '%s' is missing"
msgstr "brak wymaganej opcji \"%s\""
-#: ../libnm-util/nm-setting-bond.c:557
+#: ../libnm-core/nm-setting-bond.c:496 ../libnm-util/nm-setting-bond.c:542
#, c-format
msgid "'%s' is not a valid value for '%s'"
msgstr "\"%s\" nie jest prawidłową wartością dla \"%s\""
-#: ../libnm-util/nm-setting-bond.c:570
+#: ../libnm-core/nm-setting-bond.c:510 ../libnm-util/nm-setting-bond.c:555
#, c-format
msgid "'%s=%s' is incompatible with '%s > 0'"
msgstr "\"%s=%s\" nie jest zgodne z \"%s > 0\""
-#: ../libnm-util/nm-setting-bond.c:583
+#: ../libnm-core/nm-setting-bond.c:523 ../libnm-util/nm-setting-bond.c:568
#, c-format
msgid "'%s' is not a valid interface name for '%s' option"
msgstr "\"%s\" nie jest prawidłową nazwą interfejsu dla opcji \"%s\""
-#: ../libnm-util/nm-setting-bond.c:593
+#: ../libnm-core/nm-setting-bond.c:533 ../libnm-util/nm-setting-bond.c:578
#, c-format
msgid "'%s' option is only valid for '%s=%s'"
msgstr "opcja \"%s\" jest prawidłowa tylko dla \"%s=%s\""
-#: ../libnm-util/nm-setting-bond.c:606
+#: ../libnm-core/nm-setting-bond.c:546 ../libnm-util/nm-setting-bond.c:591
#, c-format
msgid "'%s=%s' is not a valid configuration for '%s'"
msgstr "\"%s=%s\" nie jest prawidłową konfiguracją dla \"%s\""
-#: ../libnm-util/nm-setting-bond.c:619 ../libnm-util/nm-setting-bond.c:628
-#: ../libnm-util/nm-setting-bond.c:648 ../libnm-util/nm-setting-bond.c:684
+#: ../libnm-core/nm-setting-bond.c:559 ../libnm-core/nm-setting-bond.c:568
+#: ../libnm-core/nm-setting-bond.c:588 ../libnm-core/nm-setting-bond.c:624
+#: ../libnm-util/nm-setting-bond.c:604 ../libnm-util/nm-setting-bond.c:613
+#: ../libnm-util/nm-setting-bond.c:633 ../libnm-util/nm-setting-bond.c:669
#, c-format
msgid "'%s' option requires '%s' option to be set"
msgstr "opcja \"%s\" wymaga ustawienia opcji \"%s\""
-#: ../libnm-util/nm-setting-bond.c:659
+#: ../libnm-core/nm-setting-bond.c:599 ../libnm-util/nm-setting-bond.c:644
#, c-format
msgid "'%s' option is empty"
msgstr "opcja \"%s\" jest pusta"
-#: ../libnm-util/nm-setting-bond.c:671
+#: ../libnm-core/nm-setting-bond.c:611 ../libnm-util/nm-setting-bond.c:656
#, c-format
msgid "'%s' is not a valid IPv4 address for '%s' option"
msgstr "\"%s\" nie jest prawidłowym adresem IPv4 dla opcji \"%s\""
+#: ../libnm-core/nm-setting-bond.c:638 ../libnm-util/nm-setting-bond.c:683
+#, c-format
+msgid "'%s' option is only valid with mode '%s'"
+msgstr "opcja \"%s\" jest prawidłowa tylko z trybem \"%s\""
+
+#: ../libnm-core/nm-setting-bond.c:653
+#, c-format
+msgid "'%s' option should be string"
+msgstr "opcja \"%s\" powinna być ciągiem"
+
+#: ../libnm-core/nm-setting-bridge-port.c:125
+#: ../libnm-core/nm-setting-bridge-port.c:137
#: ../libnm-util/nm-setting-bridge-port.c:155
#: ../libnm-util/nm-setting-bridge-port.c:167
#, c-format
@@ -5746,239 +7078,643 @@ msgid "'%d' is not a valid value for the property (should be <= %d)"
msgstr ""
"\"%d\" nie jest prawidłową wartością dla właściwości (powinno wynosić <= %d)"
-#: ../libnm-util/nm-setting-bridge.c:270
+#: ../libnm-core/nm-setting-bridge-port.c:155
+#: ../libnm-core/nm-setting-team-port.c:98
+#, c-format
+msgid "missing setting"
+msgstr "brak ustawienia"
+
+#: ../libnm-core/nm-setting-bridge-port.c:166
+#: ../libnm-core/nm-setting-team-port.c:109
+#, c-format
+msgid ""
+"A connection with a '%s' setting must have the slave-type set to '%s'. "
+"Instead it is '%s'"
+msgstr ""
+"Połączenie z ustawieniem \"%s\" musi mieć slave-type ustawiony na \"%s\". "
+"Zamiast tego jest \"%s\""
+
+#: ../libnm-core/nm-setting-bridge.c:210 ../libnm-util/nm-setting-bridge.c:270
#, c-format
msgid "value '%d' is out of range <%d-%d>"
msgstr "wartość \"%d\" jest poza zakresem <%d-%d>"
-#: ../libnm-util/nm-setting-bridge.c:306 ../libnm-util/nm-setting-wired.c:638
-#: ../libnm-util/nm-setting-wired.c:696
+#: ../libnm-core/nm-setting-bridge.c:227 ../libnm-core/nm-setting-wired.c:595
+#: ../libnm-core/nm-setting-wired.c:655 ../libnm-util/nm-setting-bridge.c:287
+#: ../libnm-util/nm-setting-wired.c:637 ../libnm-util/nm-setting-wired.c:695
msgid "is not a valid MAC address"
msgstr "nie jest prawidłowym adresem MAC"
-#: ../libnm-util/nm-setting-cdma.c:170
+#: ../libnm-core/nm-setting-cdma.c:149 ../libnm-util/nm-setting-cdma.c:170
msgid "property is empty'"
msgstr "właściwość jest pusta\""
-#: ../libnm-util/nm-setting-connection.c:812
+#: ../libnm-core/nm-setting-connection.c:747
#, c-format
-msgid "'%s' doesn't match the virtual interface name '%s'"
-msgstr "\"%s\" nie pasuje do nazwy interfejsu wirtualnego \"%s\""
+msgid "setting required for connection of type '%s'"
+msgstr "wymagane jest ustawienie dla połączenia typu \"%s\"."
-#: ../libnm-util/nm-setting-connection.c:858
+#: ../libnm-core/nm-setting-connection.c:828
#, c-format
-msgid "requires presence of '%s' setting in the connection"
-msgstr "wymaga obecności ustawienia \"%s\" w połączeniu"
+msgid "connection type '%s' is not valid"
+msgstr "typ połączenia \"%s\" jest nieprawidłowy"
-#: ../libnm-util/nm-setting-connection.c:880
-msgid "IPv4 configuration is not allowed for slave"
-msgstr "konfiguracja IPv4 nie jest dozwolona dla podrzędnego"
+#: ../libnm-core/nm-setting-connection.c:863
+#: ../libnm-util/nm-setting-connection.c:878
+#, c-format
+msgid "Unknown slave type '%s'"
+msgstr "Nieznany typ podrzędny \"%s\""
-#: ../libnm-util/nm-setting-connection.c:893
-msgid "IPv6 configuration is not allowed for slave"
-msgstr "konfiguracja IPv6 nie jest dozwolona dla podrzędnego"
+#: ../libnm-core/nm-setting-connection.c:873
+#, c-format
+msgid "Slave connections need a valid '%s' property"
+msgstr "Połączenia podrzędne wymagają prawidłowej właściwości \"%s\""
-#: ../libnm-util/nm-setting-dcb.c:595
+#: ../libnm-core/nm-setting-connection.c:894
+#, c-format
+msgid "Cannot set '%s' without '%s'"
+msgstr "Nie można ustawić \"%s\" bez \"%s\""
+
+#: ../libnm-core/nm-setting-connection.c:917
+#, c-format
+msgid "property type should be set to '%s'"
+msgstr "typ właściwości powinien zostać ustawiony na \"%s\""
+
+#: ../libnm-core/nm-setting-connection.c:932
+#, c-format
+msgid "slave-type '%s' requires a '%s' setting in the connection"
+msgstr "slave-type \"%s\" wymaga ustawienia \"%s\" w połączeniu"
+
+#: ../libnm-core/nm-setting-connection.c:942
+#, c-format
+msgid ""
+"Detect a slave connection with '%s' set and a port type '%s'. '%s' should be "
+"set to '%s'"
+msgstr ""
+"Wykryto połączenie podrzędne z ustawionym \"%s\" i typem portu \"%s\". \"%s"
+"\" powinno zostać ustawione na \"%s\""
+
+#: ../libnm-core/nm-setting-dcb.c:523 ../libnm-util/nm-setting-dcb.c:595
msgid "flags invalid"
msgstr "flagi są nieprawidłowe"
-#: ../libnm-util/nm-setting-dcb.c:604
+#: ../libnm-core/nm-setting-dcb.c:532 ../libnm-util/nm-setting-dcb.c:604
msgid "flags invalid - disabled"
msgstr "flagi są nieprawidłowe - wyłączone"
+#: ../libnm-core/nm-setting-dcb.c:558 ../libnm-core/nm-setting-dcb.c:607
#: ../libnm-util/nm-setting-dcb.c:630 ../libnm-util/nm-setting-dcb.c:679
msgid "property invalid (not enabled)"
msgstr "właściwość jest nieprawidłowa (niewłączone)"
-#: ../libnm-util/nm-setting-dcb.c:639
+#: ../libnm-core/nm-setting-dcb.c:567 ../libnm-util/nm-setting-dcb.c:639
msgid "element invalid"
msgstr "element jest nieprawidłowy"
-#: ../libnm-util/nm-setting-dcb.c:654
+#: ../libnm-core/nm-setting-dcb.c:582 ../libnm-util/nm-setting-dcb.c:654
msgid "sum not 100%"
msgstr "suma nie wynosi 100%"
+#: ../libnm-core/nm-setting-dcb.c:616 ../libnm-core/nm-setting-dcb.c:648
#: ../libnm-util/nm-setting-dcb.c:688 ../libnm-util/nm-setting-dcb.c:720
msgid "property invalid"
msgstr "właściwość jest nieprawidłowa"
-#: ../libnm-util/nm-setting-dcb.c:710
+#: ../libnm-core/nm-setting-dcb.c:638 ../libnm-util/nm-setting-dcb.c:710
msgid "property missing"
msgstr "brak właściwości"
-#: ../libnm-util/nm-setting-gsm.c:297
+#: ../libnm-core/nm-setting-gsm.c:239 ../libnm-util/nm-setting-gsm.c:296
#, c-format
msgid "property value '%s' is empty or too long (>64)"
msgstr "wartość właściwości \"%s\" jest pusta lub za długa (>64)"
-#: ../libnm-util/nm-setting-gsm.c:329
+#: ../libnm-core/nm-setting-gsm.c:271 ../libnm-util/nm-setting-gsm.c:328
#, c-format
msgid "'%s' contains invalid char(s) (use [A-Za-z._-])"
msgstr "\"%s\" zawiera nieprawidłowe znaki (należy używać [A-Za-z._-])"
-#: ../libnm-util/nm-setting-gsm.c:364
+#: ../libnm-core/nm-setting-gsm.c:306 ../libnm-util/nm-setting-gsm.c:363
#, c-format
msgid "'%s' length is invalid (should be 5 or 6 digits)"
msgstr "długość \"%s\" jest nieprawidłowa (powinna mieć 5 lub 6 cyfr)"
-#: ../libnm-util/nm-setting-infiniband.c:228
+#: ../libnm-core/nm-setting-infiniband.c:218
+#: ../libnm-util/nm-setting-infiniband.c:232
msgid "not a valid interface name"
msgstr "nie jest prawidłową nazwą interfejsu"
-#: ../libnm-util/nm-setting-infiniband.c:236
+#: ../libnm-core/nm-setting-infiniband.c:226
+#: ../libnm-util/nm-setting-infiniband.c:240
msgid "Must specify a P_Key if specifying parent"
msgstr "Należy podać P_Key, jeśli podawane jest nadrzędne"
-#: ../libnm-util/nm-setting-infiniband.c:246
+#: ../libnm-core/nm-setting-infiniband.c:236
+#: ../libnm-util/nm-setting-infiniband.c:250
msgid "InfiniBand P_Key connection did not specify parent interface name"
msgstr "Połączenie P_Key InfiniBand nie podało nazwy interfejsu nadrzędnego"
-#: ../libnm-util/nm-setting-ip4-config.c:897
-#: ../libnm-util/nm-setting-ip6-config.c:822
+#: ../libnm-core/nm-setting-infiniband.c:272
+#: ../libnm-util/nm-setting-infiniband.c:286
#, c-format
-msgid "this property cannot be empty for '%s=%s'"
-msgstr "ta właściwość nie może być pusta dla \"%s=%s\""
+msgid ""
+"interface name of software infiniband device must be '%s' or unset (instead "
+"it is '%s')"
+msgstr ""
+"nazwa interfejsu programowego urządzenia InfiniBand musi być \"%s\" lub nie "
+"być ustawiona (zamiast tego jest \"%s\")"
-#: ../libnm-util/nm-setting-ip4-config.c:909
-#: ../libnm-util/nm-setting-ip4-config.c:919
-#: ../libnm-util/nm-setting-ip4-config.c:931
-#: ../libnm-util/nm-setting-ip6-config.c:835
-#: ../libnm-util/nm-setting-ip6-config.c:845
-#: ../libnm-util/nm-setting-ip6-config.c:855
+#: ../libnm-core/nm-setting-infiniband.c:287
#, c-format
-msgid "this property is not allowed for '%s=%s'"
-msgstr "ta właściwość nie jest dozwolona dla \"%s=%s\""
+msgid "mtu for transport mode '%s' can be at most %d but it is %d"
+msgstr ""
+"MTU dla trybu przesyłania \"%s\" może wynosić co najwyżej %d, ale wynosi %d"
-#: ../libnm-util/nm-setting-ip4-config.c:978
+#: ../libnm-core/nm-setting-ip-config.c:79
#, c-format
-msgid "%d. IPv4 address is invalid"
-msgstr "%d. adres IPv4 jest nieprawidłowy"
+msgid "Invalid IPv4 address '%s'"
+msgstr "Nieprawidłowy adres IPv4 \"%s\""
-#: ../libnm-util/nm-setting-ip4-config.c:988
+#: ../libnm-core/nm-setting-ip-config.c:79
#, c-format
-msgid "%d. IPv4 address has invalid prefix"
-msgstr "%d. adres IPv4 posiada nieprawidłowy przedrostek"
+msgid "Invalid IPv6 address '%s"
+msgstr "Nieprawidłowy adres IPv6 \"%s\""
+
+#: ../libnm-core/nm-setting-ip-config.c:93
+#, c-format
+msgid "Invalid IPv4 address prefix '%u'"
+msgstr "Nieprawidłowy przedrostek adresu IPv4 \"%u\""
-#: ../libnm-util/nm-setting-ip4-config.c:998
+#: ../libnm-core/nm-setting-ip-config.c:93
#, c-format
-msgid "%d. IPv4 address has invalid label '%s'"
-msgstr "%d. adres IPv4 posiada nieprawidłową etykietę \"%s\""
+msgid "Invalid IPv6 address prefix '%u"
+msgstr "Nieprawidłowy przedrostek adresu IPv6 \"%u\""
-#: ../libnm-util/nm-setting-ip4-config.c:1009
+#: ../libnm-core/nm-setting-ip-config.c:111
#, c-format
-msgid "IPv4 address / label count mismatch (%d vs %d)"
-msgstr "Liczba adresów IPv4/etykiet się nie zgadza (%d vs %d)"
+msgid "Invalid routing metric '%s'"
+msgstr "Nieprawidłowe parametry trasy \"%s\""
-#: ../libnm-util/nm-setting-ip4-config.c:1025
+#: ../libnm-core/nm-setting-ip-config.c:1861
+#, c-format
+msgid "%d. DNS server address is invalid"
+msgstr "%d. adres serwera DNS jest nieprawidłowy"
+
+#: ../libnm-core/nm-setting-ip-config.c:1877
+#, c-format
+msgid "%d. IP address is invalid"
+msgstr "%d. adres IP jest nieprawidłowy"
+
+#: ../libnm-core/nm-setting-ip-config.c:1889
+#, c-format
+msgid "%d. IP address has 'label' property with invalid type"
+msgstr "%d. adres IP posiada właściwość \"label\" z nieprawidłowym typem"
+
+#: ../libnm-core/nm-setting-ip-config.c:1898
+#, c-format
+msgid "%d. IP address has invalid label '%s'"
+msgstr "%d. adres IP posiada nieprawidłową etykietę \"%s\""
+
+#: ../libnm-core/nm-setting-ip-config.c:1912
+msgid "gateway cannot be set if there are no addresses configured"
+msgstr "brama nie może być ustawiona, jeśli nie skonfigurowano żadnych adresów"
+
+#: ../libnm-core/nm-setting-ip-config.c:1921
+msgid "gateway is invalid"
+msgstr "brama jest nieprawidłowa"
+
+#: ../libnm-core/nm-setting-ip-config.c:1935
+#: ../libnm-util/nm-setting-ip4-config.c:966
#, c-format
msgid "%d. route is invalid"
msgstr "%d. trasa jest nieprawidłowa"
-#: ../libnm-util/nm-setting-ip4-config.c:1035
+#: ../libnm-core/nm-setting-ip-config.c:1944
#, c-format
-msgid "%d. route has invalid prefix"
-msgstr "%d. trasa posiada nieprawidłowy przedrostek"
+msgid "%d. route cannot be a default route"
+msgstr "%d trasa nie może być domyślną trasą"
+
+#: ../libnm-core/nm-setting-ip4-config.c:123
+#: ../libnm-core/nm-setting-ip6-config.c:121
+#: ../libnm-util/nm-setting-ip4-config.c:862
+#: ../libnm-util/nm-setting-ip6-config.c:843
+#, c-format
+msgid "this property cannot be empty for '%s=%s'"
+msgstr "ta właściwość nie może być pusta dla \"%s=%s\""
-#: ../libnm-util/nm-setting-ip6-config.c:834
+#: ../libnm-core/nm-setting-ip4-config.c:135
+#: ../libnm-core/nm-setting-ip4-config.c:145
+#: ../libnm-core/nm-setting-ip4-config.c:157
+#: ../libnm-core/nm-setting-ip6-config.c:134
+#: ../libnm-core/nm-setting-ip6-config.c:144
+#: ../libnm-core/nm-setting-ip6-config.c:154
+#: ../libnm-util/nm-setting-ip4-config.c:874
+#: ../libnm-util/nm-setting-ip4-config.c:884
+#: ../libnm-util/nm-setting-ip4-config.c:896
+#: ../libnm-util/nm-setting-ip6-config.c:856
+#: ../libnm-util/nm-setting-ip6-config.c:866
+#: ../libnm-util/nm-setting-ip6-config.c:876
+#, c-format
+msgid "this property is not allowed for '%s=%s'"
+msgstr "ta właściwość nie jest dozwolona dla \"%s=%s\""
+
+#: ../libnm-core/nm-setting-ip6-config.c:133
+#: ../libnm-util/nm-setting-ip6-config.c:855
#, c-format
msgid "'%s' not allowed for %s=%s"
msgstr "\"%s\" nie jest dozwolone dla %s=%s"
-#: ../libnm-util/nm-setting-olpc-mesh.c:136
-#: ../libnm-util/nm-setting-wireless.c:762
+#: ../libnm-core/nm-setting-olpc-mesh.c:123
+#: ../libnm-core/nm-setting-wireless.c:704
+#: ../libnm-util/nm-setting-olpc-mesh.c:133
+#: ../libnm-util/nm-setting-wireless.c:761
msgid "SSID length is out of range <1-32> bytes"
msgstr "długość SSID jest poza zakresem <1-32> bajtów"
-#: ../libnm-util/nm-setting-olpc-mesh.c:145
-#: ../libnm-util/nm-setting-wireless.c:802
+#: ../libnm-core/nm-setting-olpc-mesh.c:132
+#: ../libnm-core/nm-setting-wireless.c:744
+#: ../libnm-util/nm-setting-olpc-mesh.c:142
+#: ../libnm-util/nm-setting-wireless.c:801
#, c-format
msgid "'%d' is not a valid channel"
msgstr "\"%d\" nie jest prawidłowym kanałem"
-#: ../libnm-util/nm-setting-ppp.c:390
+#: ../libnm-core/nm-setting-ppp.c:367 ../libnm-util/nm-setting-ppp.c:389
#, c-format
msgid "'%d' is out of valid range <128-16384>"
msgstr "\"%d\" jest poza prawidłowym zakresem <128-16384>"
-#: ../libnm-util/nm-setting-ppp.c:403
+#: ../libnm-core/nm-setting-ppp.c:380 ../libnm-util/nm-setting-ppp.c:402
#, c-format
msgid "setting this property requires non-zero '%s' property"
msgstr "ustawienie tej właściwości wymaga niezerowej właściwości \"%s\""
-#: ../libnm-util/nm-setting-vlan.c:570
+#: ../libnm-core/nm-setting-vlan.c:516 ../libnm-util/nm-setting-vlan.c:557
#, c-format
msgid "'%s' value doesn't match '%s=%s'"
msgstr "wartość \"%s\" nie pasuje do \"%s=%s\""
-#: ../libnm-util/nm-setting-vlan.c:581
+#: ../libnm-core/nm-setting-vlan.c:527 ../libnm-util/nm-setting-vlan.c:568
#, c-format
msgid "'%s' is neither an UUID nor an interface name"
msgstr "\"%s\" nie jest UUID ani nazwÄ… interfejsu"
-#: ../libnm-util/nm-setting-vlan.c:594
+#: ../libnm-core/nm-setting-vlan.c:541 ../libnm-util/nm-setting-vlan.c:581
#, c-format
msgid "property is not specified and neither is '%s:%s'"
msgstr "właściwość nie została podana, tak jak i \"%s:%s\""
-#: ../libnm-util/nm-setting-vlan.c:607
+#: ../libnm-core/nm-setting-vlan.c:554 ../libnm-util/nm-setting-vlan.c:594
msgid "flags are invalid"
msgstr "flagi są nieprawidłowe"
-#: ../libnm-util/nm-setting-wired.c:618
+#: ../libnm-core/nm-setting-vpn.c:441
+#, c-format
+msgid "secret was empty"
+msgstr "hasło jest puste"
+
+#: ../libnm-core/nm-setting-vpn.c:471
+msgid "setting contained a secret with an empty name"
+msgstr "ustawienie zawierało hasło o pustej nazwie"
+
+#: ../libnm-core/nm-setting-vpn.c:479
+#, c-format
+msgid "secret value was empty"
+msgstr "wartość hasła jest pusta"
+
+#: ../libnm-core/nm-setting-vpn.c:526 ../libnm-core/nm-setting.c:1606
+msgid "not a secret property"
+msgstr "nie jest właściwością hasła"
+
+#: ../libnm-core/nm-setting-vpn.c:532
+msgid "secret is not of correct type"
+msgstr "hasło nie jest poprawnego typu"
+
+#: ../libnm-core/nm-setting-vpn.c:567
+#, c-format
+msgid "failed to convert value '%s' to uint"
+msgstr "przekonwertowanie wartości \"%s\" na uint się nie powiodło"
+
+#: ../libnm-core/nm-setting-vpn.c:575
+msgid "secret flags property not found"
+msgstr "nie odnaleziono właściwości flag hasła"
+
+#: ../libnm-core/nm-setting-wired.c:575 ../libnm-util/nm-setting-wired.c:617
#, c-format
msgid "'%s' is not a valid Ethernet port value"
msgstr "\"%s\" nie jest prawidłową wartością portu Ethernet"
-#: ../libnm-util/nm-setting-wired.c:628
+#: ../libnm-core/nm-setting-wired.c:585 ../libnm-util/nm-setting-wired.c:627
#, c-format
msgid "'%s' is not a valid duplex value"
msgstr "\"%s\" nie jest prawidłową wartością dupleksu"
-#: ../libnm-util/nm-setting-wired.c:685
+#: ../libnm-core/nm-setting-wired.c:644 ../libnm-util/nm-setting-wired.c:684
#, c-format
msgid "invalid '%s' or its value '%s'"
msgstr "nieprawidłowe \"%s\" lub jego wartość \"%s\""
-#: ../libnm-util/nm-setting-wireless-security.c:915
+#: ../libnm-core/nm-setting-wireless-security.c:883
+#: ../libnm-util/nm-setting-wireless-security.c:913
#, c-format
msgid "'%s' security requires '%s=%s'"
msgstr "zabezpieczenie \"%s\" wymaga \"%s=%s\""
-#: ../libnm-util/nm-setting-wireless-security.c:944
+#: ../libnm-core/nm-setting-wireless-security.c:912
+#: ../libnm-util/nm-setting-wireless-security.c:942
#, c-format
msgid "'%s' security requires '%s' setting presence"
msgstr "zabezpieczenie \"%s\" wymaga obecności ustawienia \"%s\""
-#: ../libnm-util/nm-setting-wireless-security.c:965
+#: ../libnm-core/nm-setting-wireless-security.c:933
+#: ../libnm-util/nm-setting-wireless-security.c:963
#, c-format
msgid "'%d' value is out of range <0-3>"
msgstr "wartość \"%d\" jest poza zakresem <0-3>"
-#: ../libnm-util/nm-setting-wireless-security.c:1062
+#: ../libnm-core/nm-setting-wireless-security.c:1030
+#: ../libnm-util/nm-setting-wireless-security.c:1060
#, c-format
msgid "'%s' connections require '%s' in this property"
msgstr "połączenia \"%s\" wymagają \"%s\" w tej właściwości"
-#: ../libnm-util/nm-setting-wireless-security.c:1092
+#: ../libnm-core/nm-setting-wireless-security.c:1060
+#: ../libnm-util/nm-setting-wireless-security.c:1090
#, c-format
msgid "'%s' can only be used with '%s=%s' (WEP)"
msgstr "\"%s\" może być używane tylko z \"%s=%s\" (WEP)"
-#: ../libnm-util/nm-setting-wireless.c:771
+#: ../libnm-core/nm-setting-wireless.c:713
+#: ../libnm-util/nm-setting-wireless.c:770
#, c-format
msgid "'%s' is not a valid Wi-Fi mode"
msgstr "\"%s\" nie jest prawidłowym trybem Wi-Fi"
-#: ../libnm-util/nm-setting-wireless.c:781
+#: ../libnm-core/nm-setting-wireless.c:723
+#: ../libnm-util/nm-setting-wireless.c:780
#, c-format
msgid "'%s' is not a valid band"
msgstr "\"%s\" nie jest prawidłowym pasmem"
-#: ../libnm-util/nm-setting-wireless.c:791
+#: ../libnm-core/nm-setting-wireless.c:733
+#, c-format
+msgid "'%s' requires setting '%s' property"
+msgstr "\"%s\" wymaga ustawienia właściwości \"%s\""
+
+#: ../libnm-core/nm-setting.c:827
+#, c-format
+msgid "can't set property of type '%s' from value of type '%s'"
+msgstr "nie można ustawić właściwości typu \"%s\" z wartości typu \"%s\""
+
+#: ../libnm-core/nm-setting.c:1504
+msgid "secret not found"
+msgstr "nie odnaleziono hasła"
+
+#: ../libnm-core/nm-setting.c:1596
+msgid "secret is not set"
+msgstr "nie ustawiono hasła"
+
+#: ../libnm-core/nm-utils.c:2275 ../libnm-util/nm-utils.c:1813
+#, c-format
+msgid "Could not find \"%s\" binary"
+msgstr "Nie można odnaleźć pliku binarnego \"%s\""
+
+#: ../libnm-glib/nm-device.c:1793 ../libnm/nm-device.c:1615
+msgid "Bluetooth"
+msgstr "Bluetooth"
+
+#: ../libnm-glib/nm-device.c:1811 ../libnm/nm-device.c:1633
+msgid "ADSL"
+msgstr "ADSL"
+
+#: ../libnm-glib/nm-device.c:1839 ../libnm/nm-device.c:1661
+msgid "Wired"
+msgstr "Przewodowe"
+
+#: ../libnm-glib/nm-device.c:1870 ../libnm/nm-device.c:1692
+msgid "PCI"
+msgstr "PCI"
+
+#: ../libnm-glib/nm-device.c:1872 ../libnm/nm-device.c:1694
+msgid "USB"
+msgstr "USB"
+
+#. Translators: the first %s is a bus name (eg, "USB") or
+#. * product name, the second is a device type (eg,
+#. * "Ethernet"). You can change this to something like
+#. * "%2$s (%1$s)" if there's no grammatical way to combine
+#. * the strings otherwise.
+#.
+#: ../libnm-glib/nm-device.c:1968 ../libnm-glib/nm-device.c:1987
+#: ../libnm/nm-device.c:1788 ../libnm/nm-device.c:1807
+#, c-format
+msgctxt "long device name"
+msgid "%s %s"
+msgstr "%2$s (%1$s)"
+
+#: ../libnm-glib/nm-remote-connection.c:151
+msgid "Disconnected by D-Bus"
+msgstr "Rozłączono przez D-Bus"
+
+#: ../libnm-util/crypto_gnutls.c:88
+#, c-format
+msgid "Failed to initialize the MD5 engine: %s / %s."
+msgstr "Zainicjowanie modułu MD5 się nie powiodło: %s / %s."
+
+#: ../libnm-util/crypto_nss.c:102
+#, c-format
+msgid "Failed to initialize the MD5 context: %d."
+msgstr "Zainicjowanie kontekstu MD5 się nie powiodło: %d."
+
+#: ../libnm-util/crypto_nss.c:463
+#, c-format
+msgid "Couldn't convert password to UCS2: %d"
+msgstr "Nie można przekonwertować hasła do UCS2: %d"
+
+#: ../libnm-util/nm-setting-bluetooth.c:187
+#, c-format
+msgid "requires '%s' or '%s' setting"
+msgstr "wymaga ustawienia \"%s\" lub \"%s\""
+
+#: ../libnm-util/nm-setting-connection.c:863
+#, c-format
+msgid "requires presence of '%s' setting in the connection"
+msgstr "wymaga obecności ustawienia \"%s\" w połączeniu"
+
+#: ../libnm-util/nm-setting-connection.c:888
+msgid "Slave connections need a valid '"
+msgstr "Połączenia podrzędne wymagają prawidłowego \""
+
+#: ../libnm-util/nm-setting-connection.c:897
+msgid "Cannot set '"
+msgstr "Nie można ustawić \""
+
+#: ../libnm-util/nm-setting-ip4-config.c:940
+#, c-format
+msgid "%d. IPv4 address is invalid"
+msgstr "%d. adres IPv4 jest nieprawidłowy"
+
+#: ../libnm-util/nm-setting-ip4-config.c:950
+#, c-format
+msgid "%d. IPv4 address has invalid prefix"
+msgstr "%d. adres IPv4 posiada nieprawidłowy przedrostek"
+
+#: ../libnm-util/nm-setting-ip4-config.c:976
+#, c-format
+msgid "%d. route has invalid prefix"
+msgstr "%d. trasa posiada nieprawidłowy przedrostek"
+
+#: ../libnm-util/nm-setting-vpn.c:583
+#, c-format
+msgid "Failed to convert '%s' value '%s' to uint"
+msgstr "Przekonwertowanie \"%s\" wartości \"%s\" na uint się nie powiodło"
+
+#: ../libnm-util/nm-setting-vpn.c:590
+#, c-format
+msgid "Secret flags property '%s' not found"
+msgstr "Nie odnaleziono właściwości flag hasła \"%s\""
+
+#: ../libnm-util/nm-setting-wireless.c:790
#, c-format
msgid "requires setting '%s' property"
msgstr "wymaga ustawienia właściwości \"%s\""
+#: ../libnm/nm-device-adsl.c:73
+msgid "The connection was not an ADSL connection."
+msgstr "Połączenie nie jest połączeniem ADSL."
+
+#: ../libnm/nm-device-bond.c:115
+msgid "The connection was not a bond connection."
+msgstr "Połączenie nie jest połączeniem wiązanym"
+
+#: ../libnm/nm-device-bridge.c:115
+msgid "The connection was not a bridge connection."
+msgstr "Połączenie nie jest połączeniem mostkowanym."
+
+#: ../libnm/nm-device-bt.c:140
+#, c-format
+msgid "The connection was not a Bluetooth connection."
+msgstr "Połączenie nie jest połączeniem Bluetooth."
+
+#: ../libnm/nm-device-bt.c:149
+msgid "Invalid device Bluetooth address."
+msgstr "Nieprawidłowy adres urządzenia Bluetooth."
+
+#: ../libnm/nm-device-bt.c:156
+msgid "The Bluetooth addresses of the device and the connection didn't match."
+msgstr "Adresy Bluetooth urządzenia i połączenia się nie zgadzają."
+
+#: ../libnm/nm-device-bt.c:165
+msgid ""
+"The device is lacking Bluetooth capabilities required by the connection."
+msgstr ""
+"Urządzenie nie posiada możliwości Bluetooth wymaganych przez połączenie."
+
+#: ../libnm/nm-device-ethernet.c:138
+msgid "The connection was not an Ethernet or PPPoE connection."
+msgstr "Połączenie nie było połączeniem ethernetowym ani PPPoE."
+
+#: ../libnm/nm-device-ethernet.c:154 ../libnm/nm-device-infiniband.c:105
+#: ../libnm/nm-device-wifi.c:492 ../libnm/nm-device-wimax.c:311
+msgid "Invalid device MAC address."
+msgstr "Nieprawidłowy adres MAC urządzenia."
+
+#: ../libnm/nm-device-ethernet.c:160 ../libnm/nm-device-infiniband.c:113
+#: ../libnm/nm-device-wifi.c:499 ../libnm/nm-device-wimax.c:318
+msgid "The MACs of the device and the connection didn't match."
+msgstr "Adresy MAC urządzenia i połączenia się nie zgadzają."
+
+#: ../libnm/nm-device-generic.c:92
+msgid "The connection was not a generic connection."
+msgstr "Połączenie nie jest ogólnym połączeniem."
+
+#: ../libnm/nm-device-generic.c:99
+msgid "The connection did not specify an interface name."
+msgstr "Połączenie nie podało nazwy interfejsu."
+
+#: ../libnm/nm-device-infiniband.c:97
+msgid "The connection was not an InfiniBand connection."
+msgstr "Połączenie nie jest połączeniem InfiniBand."
+
+#: ../libnm/nm-device-modem.c:123
+msgid "The connection was not a modem connection."
+msgstr "Połączenie nie jest połączeniem modemowym."
+
+#: ../libnm/nm-device-modem.c:131
+msgid "The connection was not a valid modem connection."
+msgstr "Połączenie nie jest prawidłowym połączeniem modemowym."
+
+#: ../libnm/nm-device-modem.c:138
+msgid "The device is lacking capabilities required by the connection."
+msgstr "Urządzenie nie posiada możliwości wymaganych przez połączenie."
+
+#: ../libnm/nm-device-olpc-mesh.c:118
+msgid "The connection was not an OLPC Mesh connection."
+msgstr "Połączenie nie jest połączeniem kratowym OLPC."
+
+#: ../libnm/nm-device-team.c:121
+msgid "The connection was not a team connection."
+msgstr "Połączenie nie jest połączeniem zespołowym."
+
+#: ../libnm/nm-device-vlan.c:131
+msgid "The connection was not a VLAN connection."
+msgstr "Połączenie nie jest połączeniem VLAN."
+
+#: ../libnm/nm-device-vlan.c:138
+msgid "The VLAN identifiers of the device and the connection didn't match."
+msgstr "Identyfikatory VLAN urządzenia i połączenia się nie zgadzają."
+
+#: ../libnm/nm-device-vlan.c:151
+msgid "The hardware address of the device and the connection didn't match."
+msgstr "Adres sprzętowy urządzenia i połączenia się nie zgadza."
+
+#: ../libnm/nm-device-wifi.c:483
+msgid "The connection was not a Wi-Fi connection."
+msgstr "Połączenie nie jest połączeniem Wi-Fi."
+
+#: ../libnm/nm-device-wifi.c:519
+msgid "The device is lacking WPA capabilities required by the connection."
+msgstr "Urządzenie nie posiada możliwości WPA wymaganych przez połączenie."
+
+#: ../libnm/nm-device-wifi.c:526
+msgid "The device is lacking WPA2/RSN capabilities required by the connection."
+msgstr ""
+"Urządzenie nie posiada możliwości WPA2/RSN wymaganych przez połączenie."
+
+#: ../libnm/nm-device-wimax.c:302
+msgid "The connection was not a WiMAX connection."
+msgstr "Połączenie nie jest połączeniem WiMAX."
+
+#: ../libnm/nm-device.c:2133
+#, c-format
+msgid "The connection was not valid: %s"
+msgstr "Połączenie jest nieprawidłowe: %s"
+
+#: ../libnm/nm-device.c:2142
+#, c-format
+msgid "The interface names of the device and the connection didn't match."
+msgstr "Nazwy interfejsu urządzenia i połączenia się nie zgadzają."
+
+#: ../libnm/nm-manager.c:858
+msgid "Active connection could not be attached to the device"
+msgstr "Nie można podłączyć aktywnego połączenia do urządzenia"
+
+#: ../libnm/nm-manager.c:1082
+msgid "Active connection removed before it was initialized"
+msgstr "Usunięto aktywne połączenie przed jego inicjacją"
+
+#: ../libnm/nm-object.c:1439 ../libnm/nm-object.c:1585
+msgid "Caller did not specify D-Bus path for object"
+msgstr "Dzwoniący nie podał ścieżki D-Bus do obiektu"
+
+#: ../libnm/nm-remote-settings.c:261
+msgid "Connection removed before it was initialized"
+msgstr "Usunięto połączenie przed jego zainicjowaniem"
+
+#: ../libnm/nm-vpn-plugin-old.c:885
+msgid "No service name specified"
+msgstr "Nie podano nazwy usługi"
+
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:1
msgid "Enable or disable system networking"
msgstr "Włączenie lub wyłączenie sieci systemowej"
@@ -6089,86 +7825,57 @@ msgstr ""
#. * as "Wired Connection" or "VPN Connection". The %d is a number
#. * that is combined with the first argument to create a unique
#. * connection id.
-#: ../src/NetworkManagerUtils.c:457
+#: ../src/NetworkManagerUtils.c:1139
#, c-format
msgctxt "connection id fallback"
msgid "%s %d"
msgstr "%s %d"
-#: ../src/main.c:153
-#, c-format
-msgid "Opening %s failed: %s\n"
-msgstr "Otwarcie %s się nie powiodło: %s\n"
-
-#: ../src/main.c:159
-#, c-format
-msgid "Writing to %s failed: %s\n"
-msgstr "Zapisanie do %s się nie powiodło: %s\n"
-
-#: ../src/main.c:164
-#, c-format
-msgid "Closing %s failed: %s\n"
-msgstr "Zamknięcie %s się nie powiodło: %s\n"
-
-#: ../src/main.c:207
-#, c-format
-msgid "NetworkManager is already running (pid %ld)\n"
-msgstr "Usługa NetworkManager jest już uruchomiona (PID %ld)\n"
-
-#: ../src/main.c:360
+#. Logging/debugging
+#: ../src/main.c:221 ../src/nm-iface-helper.c:310
msgid "Print NetworkManager version and exit"
msgstr "Wyświetla wersję usługi NetworkManager i kończy działanie"
-#: ../src/main.c:361
+#: ../src/main.c:222 ../src/nm-iface-helper.c:311
msgid "Don't become a daemon"
msgstr "Bez zmiany w usługę"
-#: ../src/main.c:362
+#: ../src/main.c:223 ../src/nm-iface-helper.c:312
msgid "Don't become a daemon, and log to stderr"
msgstr ""
"Bez zmiany w usługę i zapisywanie dziennika do standardowego wyjścia błędów"
-#: ../src/main.c:363
+#: ../src/main.c:224 ../src/nm-iface-helper.c:313
#, c-format
msgid "Log level: one of [%s]"
msgstr "Poziom dziennika: jeden z [%s]"
-#: ../src/main.c:365
+#: ../src/main.c:226 ../src/nm-iface-helper.c:315
#, c-format
msgid "Log domains separated by ',': any combination of [%s]"
msgstr "Domeny dziennika oddzielone przez \",\": dowolne połączenie [%s]"
-#: ../src/main.c:367
+#: ../src/main.c:228 ../src/nm-iface-helper.c:317
msgid "Make all warnings fatal"
msgstr "Wszystkie ostrzeżenia jako krytyczne"
-#: ../src/main.c:368
+#: ../src/main.c:229
msgid "Specify the location of a PID file"
msgstr "Podaje położenie pliku PID"
-#: ../src/main.c:368
+#: ../src/main.c:229
msgid "filename"
msgstr "nazwa pliku"
-#: ../src/main.c:369
+#: ../src/main.c:230
msgid "State file location"
msgstr "Położenie pliku stanu"
-#: ../src/main.c:369
+#: ../src/main.c:230
msgid "/path/to/state.file"
msgstr "/ścieżka/do/pliku.stanu"
-#: ../src/main.c:395
-#, c-format
-msgid "GModules are not supported on your platform!\n"
-msgstr "GModules nie są obsługiwane na tej platformie.\n"
-
-#: ../src/main.c:400
-#, c-format
-msgid "You must be root to run NetworkManager!\n"
-msgstr "Tylko root może uruchamiać usługę NetworkManager.\n"
-
-#: ../src/main.c:423
+#: ../src/main.c:244
msgid ""
"NetworkManager monitors all network connections and automatically\n"
"chooses the best connection to use. It also allows the user to\n"
@@ -6180,49 +7887,84 @@ msgstr ""
"wybranie bezprzewodowych punktów dostępowych, z którymi karty\n"
"sieciowe w komputerze powinny być powiązane."
-#: ../src/main.c:429 ../src/main.c:445
+#: ../src/main.c:257 ../src/main-utils.c:271 ../src/nm-iface-helper.c:346
#, c-format
msgid "%s. Please use --help to see a list of valid options.\n"
msgstr "%s. Parametr --help wyświetli listę prawidłowych opcji.\n"
-#: ../src/main.c:450
+#: ../src/main.c:262 ../src/nm-iface-helper.c:351
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' passed on command line.\n"
msgstr ""
"Ignorowanie nierozpoznanych domen dziennika \"%s\" przekazanych w wierszu "
"poleceń.\n"
-#: ../src/main.c:501
+#: ../src/main.c:307
#, c-format
msgid "Failed to read configuration: (%d) %s\n"
msgstr "Odczytanie konfiguracji się nie powiodło: (%d) %s\n"
-#: ../src/main.c:515
+#: ../src/main.c:321
#, c-format
msgid "Error in configuration file: %s.\n"
msgstr "BÅ‚Ä…d w pliku konfiguracji: %s.\n"
-#: ../src/main.c:520
+#: ../src/main.c:326
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' from config files.\n"
msgstr ""
"Ignorowanie nierozpoznanych domen dziennika \"%s\" z plików konfiguracji.\n"
-#: ../src/main.c:528
+#: ../src/main.c:334
#, c-format
msgid "State file %s parsing failed: (%d) %s\n"
msgstr "Przetworzenie pliku stanu %s się nie powiodło: (%d) %s\n"
-#: ../src/main.c:541
+#: ../src/main.c:347 ../src/nm-iface-helper.c:368
#, c-format
msgid "Could not daemonize: %s [error %u]\n"
msgstr "Nie można zmienić w usługę: %s [błąd %u]\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:140
+#: ../src/main-utils.c:115
+#, c-format
+msgid "Failed to set signal mask: %d"
+msgstr "Ustawienie maski sygnału nie powiodło: %d"
+
+#: ../src/main-utils.c:124
+#, c-format
+msgid "Failed to create signal handling thread: %d"
+msgstr "Utworzenie wątku obsługującego sygnały się nie powiodło: %d"
+
+#: ../src/main-utils.c:139
+#, c-format
+msgid "Opening %s failed: %s\n"
+msgstr "Otwarcie %s się nie powiodło: %s\n"
+
+#: ../src/main-utils.c:145
+#, c-format
+msgid "Writing to %s failed: %s\n"
+msgstr "Zapisanie do %s się nie powiodło: %s\n"
+
+#: ../src/main-utils.c:150
+#, c-format
+msgid "Closing %s failed: %s\n"
+msgstr "Zamknięcie %s się nie powiodło: %s\n"
+
+#: ../src/main-utils.c:206
+#, c-format
+msgid "%s is already running (pid %ld)\n"
+msgstr "%s jest już uruchomione (PID %ld)\n"
+
+#: ../src/main-utils.c:248
+#, c-format
+msgid "You must be root to run %s!\n"
+msgstr "Tylko root może uruchamiać %s.\n"
+
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:205
msgid "# Created by NetworkManager\n"
msgstr "# Utworzony przez usługę NetworkManager\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:147
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:212
#, c-format
msgid ""
"# Merged from %s\n"
@@ -6231,23 +7973,15 @@ msgstr ""
"# Scalony od %s\n"
"\n"
-#: ../src/dhcp-manager/nm-dhcp-manager.c:311
+#: ../src/dhcp-manager/nm-dhcp-manager.c:130
+#, c-format
+msgid "'%s' support not found or not enabled."
+msgstr "Nie odnaleziono lub nie włączono obsługi \"%s\"."
+
+#: ../src/dhcp-manager/nm-dhcp-manager.c:177
msgid "no usable DHCP client could be found."
msgstr "nie odnaleziono używalnego klienta DHCP."
-#: ../src/dhcp-manager/nm-dhcp-manager.c:320
-msgid "'dhclient' could be found."
-msgstr "nie można odnaleźć polecenia \"dhclient\"."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:330
-msgid "'dhcpcd' could be found."
-msgstr "nie można odnaleźć usługi \"dhcpcd\"."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:338
-#, c-format
-msgid "unsupported DHCP client '%s'"
-msgstr "nieobsługiwany klient DHCP \"%s\""
-
#: ../src/dns-manager/nm-dns-manager.c:374
msgid "NOTE: the libc resolver may not support more than 3 nameservers."
msgstr "UWAGA: obsługa nazw libc nie obsługuje więcej niż 3 serwery nazw."
@@ -6256,950 +7990,431 @@ msgstr "UWAGA: obsługa nazw libc nie obsługuje więcej niż 3 serwery nazw."
msgid "The nameservers listed below may not be recognized."
msgstr "Poniższe serwery nazw nie mogą nie zostać rozpoznane."
-#: ../src/logging/nm-logging.c:150
-#, c-format
-msgid "Unknown log level '%s'"
-msgstr "Nieznany poziom dziennika \"%s\""
-
-#: ../src/logging/nm-logging.c:229
-#, c-format
-msgid "Unknown log domain '%s'"
-msgstr "Nieznana domena dziennika \"%s\""
-
-#: ../src/config/nm-config.c:281
-msgid "Config file location"
-msgstr "Położenie pliku konfiguracji"
-
-#: ../src/config/nm-config.c:281
-msgid "/path/to/config.file"
-msgstr "/ścieżka/do/pliku.konfiguracji"
-
-#: ../src/config/nm-config.c:282
-msgid "Config directory location"
-msgstr "Położenie katalogu konfiguracji"
-
-#: ../src/config/nm-config.c:282
-msgid "/path/to/config/dir"
-msgstr "/ścieżka/do/katalogu/konfiguracji"
-
-#: ../src/config/nm-config.c:284
-msgid "List of plugins separated by ','"
-msgstr "Lista wtyczek oddzielonych \",\""
-
-#: ../src/config/nm-config.c:284
-msgid "plugin1,plugin2"
-msgstr "wtyczka1,wtyczka2"
-
-#. These three are hidden for now, and should eventually just go away.
-#: ../src/config/nm-config.c:287
-msgid "An http(s) address for checking internet connectivity"
-msgstr "Adres http(s) do sprawdzania łączności internetowej"
-
-#: ../src/config/nm-config.c:288
-msgid "The interval between connectivity checks (in seconds)"
-msgstr "Czas między sprawdzaniem łączności (w sekundach)"
-
-#: ../src/config/nm-config.c:289
-msgid "The expected start of the response"
-msgstr "Oczekiwany poczÄ…tek odpowiedzi"
-
-#: ../src/config/nm-config.c:289
-msgid "Bingo!"
-msgstr "Bingo!"
-
-#: ../src/devices/adsl/nm-device-adsl.c:123
+#: ../src/devices/adsl/nm-device-adsl.c:129
msgid "ADSL connection"
msgstr "Połączenie ADSL"
-#: ../src/devices/bluetooth/nm-bluez-device.c:194
+#: ../src/devices/bluetooth/nm-bluez-device.c:200
#, c-format
msgid "%s Network"
msgstr "Sieć %s"
-#: ../src/devices/bluetooth/nm-device-bt.c:284
+#: ../src/devices/bluetooth/nm-device-bt.c:254
+msgid "PAN requested, but Bluetooth device does not support NAP"
+msgstr "Zażądano PAN, ale urządzenie Bluetooth nie obsługuje NAP"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:264
+msgid "PAN connections cannot specify GSM, CDMA, or serial settings"
+msgstr "Połączenia PAN nie mogą podawać ustawień GSM, CDMA lub szeregowych"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:277
msgid "PAN connection"
msgstr "Połączenie PAN"
-#: ../src/devices/bluetooth/nm-device-bt.c:309
-#: ../src/devices/wwan/nm-modem-broadband.c:439
-#: ../src/devices/wwan/nm-modem-old.c:816
+#: ../src/devices/bluetooth/nm-device-bt.c:284
+msgid "DUN requested, but Bluetooth device does not support DUN"
+msgstr "Zażądano DUN, ale urządzenie Bluetooth go nie obsługuje"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:294
+msgid "DUN connection must include a GSM or CDMA setting"
+msgstr "Połączenie DUN musi zawierać ustawienie GSM lub CDMA"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:304
+#: ../src/devices/wwan/nm-modem-broadband.c:488
msgid "GSM connection"
msgstr "Połączenie GSM"
-#: ../src/devices/bluetooth/nm-device-bt.c:313
-#: ../src/devices/wwan/nm-modem-broadband.c:461
-#: ../src/devices/wwan/nm-modem-old.c:843
+#: ../src/devices/bluetooth/nm-device-bt.c:308
+#: ../src/devices/wwan/nm-modem-broadband.c:511
msgid "CDMA connection"
msgstr "Połączenie CDMA"
-#: ../src/devices/bluetooth/nm-device-bt.c:317
-msgid "DUN connection"
-msgstr "Połączenie DUN"
+#: ../src/devices/bluetooth/nm-device-bt.c:316
+msgid "Unknown/unhandled Bluetooth connection type"
+msgstr "Nieznany/nieobsługiwany typ połączenia Bluetooth"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:336
+#: ../src/devices/nm-device-ethernet.c:1442
+#: ../src/devices/nm-device-infiniband.c:196
+#: ../src/devices/wifi/nm-device-wifi.c:1123
+#: ../src/devices/wimax/nm-device-wimax.c:450
+msgid "connection does not match device"
+msgstr "połączenie nie pasuje do urządzenia"
-#: ../src/devices/nm-device-bond.c:139
+#: ../src/devices/nm-device-bond.c:124
msgid "Bond connection"
msgstr "Połączenie wiązane"
-#: ../src/devices/nm-device-bridge.c:149
+#: ../src/devices/nm-device-bridge.c:131
msgid "Bridge connection"
msgstr "Połączenie mostkowane"
-#: ../src/devices/nm-device-ethernet.c:1487
+#: ../src/devices/nm-device-ethernet.c:1425
msgid "PPPoE connection"
msgstr "Połączenie PPPoE"
-#: ../src/devices/nm-device-ethernet.c:1487
+#: ../src/devices/nm-device-ethernet.c:1425
msgid "Wired connection"
msgstr "Połączenie przewodowe"
-#: ../src/devices/nm-device-infiniband.c:256
+#: ../src/devices/nm-device-ethernet-utils.c:40
+#, c-format
+msgid "Wired connection %d"
+msgstr "Połączenie przewodowe %d"
+
+#: ../src/devices/nm-device-infiniband.c:178
msgid "InfiniBand connection"
msgstr "Połączenie InfiniBand"
-#: ../src/devices/nm-device-team.c:153
-msgid "Team connection"
-msgstr "Połączenie zespołowe"
-
-#: ../src/devices/nm-device-vlan.c:231
+#: ../src/devices/nm-device-vlan.c:218
msgid "VLAN connection"
msgstr "Połączenie VLAN"
-#: ../src/devices/wifi/nm-device-olpc-mesh.c:165
+#: ../src/devices/team/nm-device-team.c:132
+msgid "Team connection"
+msgstr "Połączenie zespołowe"
+
+#: ../src/devices/wifi/nm-device-olpc-mesh.c:151
msgid "Mesh"
msgstr "Sieć kratowa"
-#: ../src/nm-manager.c:3385
-msgid "VPN connection"
-msgstr "Połączenie VPN"
-
-#: ../src/nm-sleep-monitor-systemd.c:116
-msgid "NetworkManager needs to turn off networks"
-msgstr "Usługa NetworkManager musi wyłączyć sieci"
-
-#: ../src/settings/plugins/ifcfg-rh/reader.c:113
-msgid "System"
-msgstr "Systemowe"
-
-#: ../src/settings/nm-settings-utils.c:50
-#, c-format
-msgid "Wired connection %d"
-msgstr "Połączenie przewodowe %d"
-
-#: ../test/nm-online.c:86
-#, c-format
-msgid "\rConnecting"
-msgstr "\rÅÄ…czenie"
-
-#: ../test/nm-online.c:118
-msgid ""
-"Time to wait for a connection, in seconds (without the option, default value "
-"is 30)"
-msgstr ""
-"Czas oczekiwania na połączenie, w sekundach (bez opcji, domyślna wartość to "
-"30)"
-
-#: ../test/nm-online.c:119
-msgid "Exit immediately if NetworkManager is not running or connecting"
-msgstr ""
-"Kończy działanie od razu, jeśli usługa NetworkManager nie jest uruchomiona "
-"lub nie Å‚Ä…czy"
-
-#: ../test/nm-online.c:120
-msgid "Don't print anything"
-msgstr "Bez wyświetlania czegokolwiek"
-
-#: ../test/nm-online.c:121
-msgid "Wait for NetworkManager startup instead of a connection"
-msgstr "Czeka na uruchomienie usługi NetworkManager zamiast połączenia"
-
-#: ../test/nm-online.c:141
-msgid ""
-"Waits for NetworkManager to finish activating startup network connections."
-msgstr ""
-"Czeka, aż usługa NetworkManager ukończy aktywowanie połączeń sieciowych."
-
-#: ../test/nm-online.c:148 ../test/nm-online.c:158
-msgid "Invalid option. Please use --help to see a list of valid options."
-msgstr ""
-"Nieprawidłowa opcja. Parametr --help wyświetli listę prawidłowych opcji."
-
-#: ../tui/newt/nmt-newt-utils.c:180 ../tui/nmt-editor.c:231
-#: ../tui/nmt-password-dialog.c:175 ../tui/nmt-route-editor.c:135
-#: ../tui/nmtui-hostname.c:71 ../tui/nmtui.c:121
-msgid "OK"
-msgstr "OK"
-
-#: ../tui/newt/nmt-newt-utils.c:328 ../tui/newt/nmt-newt-utils.c:360
-#, c-format
-msgid "Could not create temporary file: %s"
-msgstr "Nie można utworzyć pliku tymczasowego: %s"
-
-#: ../tui/newt/nmt-newt-utils.c:368
-#, c-format
-msgid "Editor failed: %s"
-msgstr "Edytor się nie powiódł: %s"
-
-#: ../tui/newt/nmt-newt-utils.c:376
-#, c-format
-msgid "Editor failed with status %d"
-msgstr "Edytor się nie powiódł ze stanem %d"
-
-#: ../tui/newt/nmt-newt-utils.c:378
-#, c-format
-msgid "Editor failed with signal %d"
-msgstr "Edytor się nie powiódł z sygnałem %d"
-
-#: ../tui/newt/nmt-newt-utils.c:382
-#, c-format
-msgid "Could not re-read file: %s"
-msgstr "Nie można ponownie odczytać pliku: %s"
-
-#: ../tui/nm-editor-utils.c:160
-#, c-format
-msgid "Ethernet connection %d"
-msgstr "Połączenie ethernet %d"
-
-#: ../tui/nm-editor-utils.c:168
-#, c-format
-msgid "Wi-Fi connection %d"
-msgstr "Połączenie Wi-Fi %d"
-
-#: ../tui/nm-editor-utils.c:177
-#, c-format
-msgid "InfiniBand connection %d"
-msgstr "Połączenie InfiniBand %d"
-
-#: ../tui/nm-editor-utils.c:185
-#, c-format
-msgid "Mobile broadband connection %d"
-msgstr "Połączenie komórkowe %d"
-
-#: ../tui/nm-editor-utils.c:190
-msgid "DSL"
-msgstr "DSL"
-
-#: ../tui/nm-editor-utils.c:194
-#, c-format
-msgid "DSL connection %d"
-msgstr "Połączenie DSL %d"
-
-#: ../tui/nm-editor-utils.c:204
-#, c-format
-msgid "Bond connection %d"
-msgstr "Połączenie wiązane %d"
-
-#: ../tui/nm-editor-utils.c:214
-#, c-format
-msgid "Bridge connection %d"
-msgstr "Połączenie mostkowane %d"
+#: ../src/devices/wifi/nm-device-wifi.c:1093
+msgid "WPA Ad-Hoc disabled due to kernel bugs"
+msgstr "Wyłączono WPA Ad-Hoc z powodu błędów jądra"
-#: ../tui/nm-editor-utils.c:223
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:44
#, c-format
-msgid "Team connection %d"
-msgstr "Połączenie zespołowe %d"
+msgid "%s is incompatible with static WEP keys"
+msgstr "\"%s\" nie jest zgodne ze statycznymi kluczami WEP"
-#: ../tui/nm-editor-utils.c:231
-#, c-format
-msgid "VLAN connection %d"
-msgstr "Połączenie VLAN %d"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:78
+msgid "LEAP authentication requires a LEAP username"
+msgstr "Uwierzytelnienie LEAP wymaga nazwy użytkownika LEAP"
-#: ../tui/nm-editor-utils.c:246
-#, c-format
-msgid "VPN connection %d"
-msgstr "Połączenie VPN %d"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:88
+msgid "LEAP username requires 'leap' authentication"
+msgstr "Nazwa użytkownika LEAP wymaga uwierzytelnienia \"leap\""
-#: ../tui/nmt-device-entry.c:391
-msgid "Select..."
-msgstr "Wybierz..."
-
-#: ../tui/nmt-edit-connection-list.c:129
-msgid "Add"
-msgstr "Dodaj"
-
-#: ../tui/nmt-edit-connection-list.c:132 ../tui/nmt-page-ip4.c:175
-#: ../tui/nmt-page-ip6.c:173 ../tui/nmt-page-team-port.c:110
-#: ../tui/nmt-page-team.c:180
-msgid "Edit..."
-msgstr "Modyfikuj..."
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:101
+msgid "LEAP authentication requires IEEE 802.1x key management"
+msgstr "Uwierzytelnienie LEAP wymaga zarzÄ…dzania kluczami IEEE 802.1x"
-#: ../tui/nmt-edit-connection-list.c:135 ../tui/nmtui-edit.c:462
-msgid "Delete"
-msgstr "Usuń"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:121
+msgid "LEAP authentication is incompatible with Ad-Hoc mode"
+msgstr "Uwierzytelnienie LEAP jest niezgodne z trybem Ad-Hoc"
-#: ../tui/nmt-editor.c:81
-#, c-format
-msgid "Could not create editor for connection '%s' of type '%s'."
-msgstr "Nie można utworzyć edytora dla połączenia \"%s\" typu \"%s\"."
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:133
+msgid "LEAP authentication is incompatible with 802.1x setting"
+msgstr "Uwierzytelnienie LEAP jest niezgodne z ustawieniem 802.1x"
-#: ../tui/nmt-editor.c:85
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:155
#, c-format
-msgid "Could not create editor for invalid connection '%s'."
-msgstr "Nie można utworzyć edytora dla nieprawidłowego połączenia \"%s\"."
-
-#: ../tui/nmt-editor.c:95
-msgid "Edit Connection"
-msgstr "Modyfikuj połączenie"
+msgid "a connection using '%s' authentication cannot use WPA key management"
+msgstr ""
+"połączenie używające uwierzytelniania \"%s\" nie może używać zarządzania "
+"kluczami WPA"
-#: ../tui/nmt-editor.c:134
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:166
#, c-format
-msgid "Error saving connection: %s"
-msgstr "Błąd podczas zapisywania połączenia: %s"
+msgid "a connection using '%s' authentication cannot specific WPA protocols"
+msgstr ""
+"połączenie używające uwierzytelniania \"%s\" nie może podawać protokołów WPA"
-#: ../tui/nmt-editor.c:144
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:182
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:199
#, c-format
-msgid "Unable to save connection: %s"
-msgstr "Nie można zapisać połączenia: %s"
+msgid "a connection using '%s' authentication cannot specific WPA ciphers"
+msgstr ""
+"połączenie używające uwierzytelniania \"%s\" nie może podawać szyfrów WPA"
-#: ../tui/nmt-editor.c:158
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:211
#, c-format
-msgid "Unable to add new connection: %s"
-msgstr "Nie można dodać nowego połączenia: %s"
-
-#: ../tui/nmt-editor.c:228 ../tui/nmt-password-dialog.c:172
-#: ../tui/nmt-route-editor.c:128 ../tui/nmtui-edit.c:192
-#: ../tui/nmtui-edit.c:461 ../tui/nmtui-hostname.c:69
-msgid "Cancel"
-msgstr "Anuluj"
-
-#: ../tui/nmt-mtu-entry.c:86
-msgid "(default)"
-msgstr "(domyślne)"
-
-#: ../tui/nmt-mtu-entry.c:88 ../tui/nmt-mtu-entry.c:119
-msgid "bytes"
-msgstr "bajty"
-
-#: ../tui/nmt-page-bond.c:88
-msgid "Round-robin"
-msgstr "Round-robin"
-
-#: ../tui/nmt-page-bond.c:89
-msgid "Active Backup"
-msgstr "Aktywna kopia zapasowa"
-
-#: ../tui/nmt-page-bond.c:90
-msgid "XOR"
-msgstr "XOR"
-
-#: ../tui/nmt-page-bond.c:91
-msgid "Broadcast"
-msgstr "Rozgłaszanie"
-
-#: ../tui/nmt-page-bond.c:92
-msgid "802.3ad"
-msgstr "802.3ad"
-
-#: ../tui/nmt-page-bond.c:93
-msgid "Adaptive Transmit Load Balancing (tlb)"
-msgstr "Adaptacyjne równoważenie obciążenia przesyłania (TLB)"
-
-#: ../tui/nmt-page-bond.c:94
-msgid "Adaptive Load Balancing (alb)"
-msgstr "Adaptacyjne równoważenie obciążenia (ALB)"
-
-#: ../tui/nmt-page-bond.c:100
-msgid "MII (recommended)"
-msgstr "MII (zalecane)"
-
-#: ../tui/nmt-page-bond.c:101
-msgid "ARP"
-msgstr "ARP"
-
-#: ../tui/nmt-page-bond.c:359 ../tui/nmt-page-bridge.c:86
-#: ../tui/nmt-page-team.c:159
-msgid "Slaves"
-msgstr "Podrzędne"
-
-#: ../tui/nmt-page-bond.c:371 ../tui/nmt-page-wifi.c:227
-msgid "Mode"
-msgstr "Tryb"
-
-#: ../tui/nmt-page-bond.c:377
-msgid "Primary"
-msgstr "Główne"
-
-#: ../tui/nmt-page-bond.c:383
-msgid "Link monitoring"
-msgstr "Monitorowanie Å‚Ä…cza"
-
-#: ../tui/nmt-page-bond.c:389 ../tui/nmt-page-bond.c:396
-#: ../tui/nmt-page-bond.c:403 ../tui/nmt-page-bond.c:410
-msgctxt "milliseconds"
-msgid "ms"
-msgstr "ms"
-
-#: ../tui/nmt-page-bond.c:390 ../tui/nmt-page-bond.c:411
-msgid "Monitoring frequency"
-msgstr "Częstotliwość monitorowania"
-
-#: ../tui/nmt-page-bond.c:397
-msgid "Link up delay"
-msgstr "Opóźnienie łącza wysyłania"
-
-#: ../tui/nmt-page-bond.c:404
-msgid "Link down delay"
-msgstr "Opóźnienie łącza pobierania"
-
-#: ../tui/nmt-page-bond.c:417
-msgid "ARP targets"
-msgstr "Cele ARP"
-
-#: ../tui/nmt-page-bridge-port.c:38
-msgid "BRIDGE PORT"
-msgstr "PORT MOSTKA"
-
-#: ../tui/nmt-page-bridge-port.c:69 ../tui/nmt-page-bridge.c:112
-msgid "Priority"
-msgstr "Priorytet"
-
-#: ../tui/nmt-page-bridge-port.c:75
-msgid "Path cost"
-msgstr "Koszt ścieżki"
-
-#: ../tui/nmt-page-bridge-port.c:77
-msgid "Hairpin mode"
-msgstr "Tryb hairpin"
-
-#: ../tui/nmt-page-bridge.c:42
-msgid "BRIDGE"
-msgstr "MOSTEK"
+msgid "a connection using '%s' authentication cannot specific a WPA password"
+msgstr ""
+"połączenie używające uwierzytelniania \"%s\" nie może podawać hasła WPA"
-#: ../tui/nmt-page-bridge.c:96 ../tui/nmt-page-bridge.c:121
-#: ../tui/nmt-page-bridge.c:131 ../tui/nmt-page-bridge.c:141
-msgid "seconds"
-msgstr "s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:242
+msgid "Dynamic WEP requires an 802.1x setting"
+msgstr "Dynamiczne WEP wymaga ustawienia 802.1x"
-#: ../tui/nmt-page-bridge.c:97
-msgid "Aging time"
-msgstr "Czas starzenia"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:252
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:280
+msgid "Dynamic WEP requires 'open' authentication"
+msgstr "Dynamiczne WEP wymaga uwierzytelnienia \"open\""
-#: ../tui/nmt-page-bridge.c:99
-msgid "Enable STP (Spanning Tree Protocol)"
-msgstr "WÅ‚Ä…czenie STP (Spanning Tree Protocol)"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:267
+msgid "Dynamic WEP requires 'ieee8021x' key management"
+msgstr "Dynamiczne WEP wymaga zarzÄ…dzania kluczami \"ieee8021x\""
-#: ../tui/nmt-page-bridge.c:122
-msgid "Forward delay"
-msgstr "Opóźnienie przekazywania"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:314
+msgid "WPA-PSK authentication is incompatible with 802.1x"
+msgstr "Uwierzytelnianie WPA-PSK jest niezgodne z 802.1x"
-#: ../tui/nmt-page-bridge.c:132
-msgid "Hello time"
-msgstr "Czas powitania"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:324
+msgid "WPA-PSK requires 'open' authentication"
+msgstr "WPA-PSK wymaga uwierzytelnienia \"open\""
-#: ../tui/nmt-page-bridge.c:142
-msgid "Max age"
-msgstr "Maksymalny wiek"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:336
+msgid "WPA Ad-Hoc authentication requires an Ad-Hoc mode AP"
+msgstr "Uwierzytelnianie WPA Ad-Hoc wymaga AP w trybie Ad-Hoc"
-#: ../tui/nmt-page-ethernet.c:41
-msgid "ETHERNET"
-msgstr "ETHERNET"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:349
+msgid "WPA Ad-Hoc authentication requires 'wpa' protocol"
+msgstr "Uwierzytelnianie WPA Ad-Hoc wymaga protokołu \"wpa\""
-#: ../tui/nmt-page-ethernet.c:80 ../tui/nmt-page-vlan.c:132
-#: ../tui/nmt-page-wifi.c:358
-msgid "Cloned MAC address"
-msgstr "Sklonowany adres MAC"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:361
+msgid "WPA Ad-Hoc authentication requires 'none' pairwise cipher"
+msgstr "Uwierzytelnienie WPA Ad-Hoc wymaga szyfru pairwise \"none\""
-#: ../tui/nmt-page-infiniband.c:40
-msgid "INFINIBAND"
-msgstr "INFINIBAND"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:373
+msgid "WPA Ad-Hoc requires 'tkip' group cipher"
+msgstr "WPA Ad-Hoc wymaga szyfru grupowego \"tkip\""
-#: ../tui/nmt-page-infiniband.c:51
-msgid "Datagram"
-msgstr "Datagram"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:387
+msgid "Access point does not support PSK but setting requires it"
+msgstr "Punkt dostępowy nie obsługuje PSK, ale ustawienie go wymaga"
-#: ../tui/nmt-page-infiniband.c:52
-msgid "Connected"
-msgstr "Połączone"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:417
+msgid "WPA-EAP authentication requires an 802.1x setting"
+msgstr "Uwierzytelnienie WPA-EAP wymaga ustawienia 802.1x"
-#: ../tui/nmt-page-infiniband.c:90
-msgid "Transport mode"
-msgstr "Tryb przesyłania"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:427
+msgid "WPA-EAP requires 'open' authentication"
+msgstr "WPA-EAP wymaga uwierzytelnienia \"open\""
-#: ../tui/nmt-page-ip4.c:41
-msgid "Disabled"
-msgstr "Wyłączone"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:438
+msgid "802.1x setting requires 'wpa-eap' key management"
+msgstr "Ustawienie 802.1x wymaga zarzÄ…dzania kluczami \"wpa-eap\""
-#: ../tui/nmt-page-ip4.c:42 ../tui/nmt-page-ip6.c:42
-msgid "Automatic"
-msgstr "Automatyczne"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:451
+msgid "Access point does not support 802.1x but setting requires it"
+msgstr "Punkt dostępowy nie obsługuje 802.1x, ale ustawienie go wymaga"
-#: ../tui/nmt-page-ip4.c:43 ../tui/nmt-page-ip6.c:44
-msgid "Link-Local"
-msgstr "Link-Local"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:479
+msgid ""
+"Access point mode is Ad-Hoc but setting requires Infrastructure security"
+msgstr ""
+"Tryb punktu dostępowego to Ad-Hoc, ale ustawienie wymaga zabezpieczeń "
+"Infrastruktury"
-#: ../tui/nmt-page-ip4.c:44 ../tui/nmt-page-ip6.c:45
-msgid "Manual"
-msgstr "Ręczne"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:489
+msgid "Ad-Hoc mode is incompatible with 802.1x security"
+msgstr "Tryb Ad-Hoc jest niezgodny z zabezpieczeniami 802.1x"
-#: ../tui/nmt-page-ip4.c:45
-msgid "Shared"
-msgstr "Współdzielone"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:498
+msgid "Ad-Hoc mode is incompatible with LEAP security"
+msgstr "Tryb Ad-Hoc jest niezgodny z zabezpieczeniami LEAP"
-#: ../tui/nmt-page-ip4.c:54
-msgid "IPv4 CONFIGURATION"
-msgstr "KONFIGURACJA IPv4"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:508
+msgid "Ad-Hoc mode requires 'open' authentication"
+msgstr "Tryb Ad-Hoc wymaga uwierzytelniania \"open\""
-#: ../tui/nmt-page-ip4.c:100 ../tui/nmt-page-ip6.c:100
-msgid "(No custom routes)"
-msgstr "(Brak reguł użytkownika)"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:518
+msgid ""
+"Access point mode is Infrastructure but setting requires Ad-Hoc security"
+msgstr ""
+"Tryb punktu dostępowego to Infrastruktura, ale ustawienie wymaga "
+"zabezpieczeń Ad-Hoc"
-#: ../tui/nmt-page-ip4.c:103 ../tui/nmt-page-ip6.c:103
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:560
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:590
#, c-format
-msgid "One custom route"
-msgid_plural "%d custom routes"
-msgstr[0] "%d reguła użytkownika"
-msgstr[1] "%d reguły użytkownika"
-msgstr[2] "%d reguł użytkownika"
-
-#: ../tui/nmt-page-ip4.c:144 ../tui/nmt-page-ip6.c:144
-msgid "Addresses"
-msgstr "Adresy"
-
-#: ../tui/nmt-page-ip4.c:150 ../tui/nmt-page-ip6.c:150
-msgid "Gateway"
-msgstr "Brama"
-
-#: ../tui/nmt-page-ip4.c:156 ../tui/nmt-page-ip6.c:156
-msgid "DNS servers"
-msgstr "Serwery DNS"
-
-#: ../tui/nmt-page-ip4.c:162 ../tui/nmt-page-ip6.c:162
-msgid "Search domains"
-msgstr "Domeny wyszukiwania"
-
-#: ../tui/nmt-page-ip4.c:177 ../tui/nmt-page-ip6.c:175
-msgid "Routing"
-msgstr "Trasowanie"
-
-#: ../tui/nmt-page-ip4.c:179 ../tui/nmt-page-ip6.c:177
-msgid "Never use this network for default route"
-msgstr "Bez używania tej sieci jako domyślnej trasy"
-
-#: ../tui/nmt-page-ip4.c:187
-msgid "Require IPv4 addressing for this connection"
-msgstr "Wymaganie adresowania IPv4 dla tego połączenia"
-
-#: ../tui/nmt-page-ip6.c:41
-msgid "Ignore"
-msgstr "Ignorowanie"
-
-#: ../tui/nmt-page-ip6.c:43
-msgid "Automatic (DHCP-only)"
-msgstr "Automatyczne (tylko DHCP)"
-
-#: ../tui/nmt-page-ip6.c:54
-msgid "IPv6 CONFIGURATION"
-msgstr "KONFIGURACJA IPv6"
-
-#: ../tui/nmt-page-ip6.c:185
-msgid "Require IPv6 addressing for this connection"
-msgstr "Wymaganie adresowania IPv6 dla tego połączenia"
-
-#: ../tui/nmt-page-main.c:134
-msgid "Hide"
-msgstr "Ukryj"
-
-#: ../tui/nmt-page-main.c:134
-msgid "Show"
-msgstr "Wyświetl"
-
-#: ../tui/nmt-page-main.c:181
-msgid "Profile name"
-msgstr "Nazwa profilu"
-
-#: ../tui/nmt-page-main.c:188
-msgid "Device"
-msgstr "UrzÄ…dzenie"
-
-#: ../tui/nmt-page-main.c:252
-msgid "Automatically connect"
-msgstr "ÅÄ…czenie automatyczne"
-
-#: ../tui/nmt-page-main.c:258
-msgid "Available to all users"
-msgstr "Dostępne dla wszystkich użytkowników"
-
-#: ../tui/nmt-page-team-port.c:45
-msgid "TEAM PORT"
-msgstr "PORT ZESPOÅU"
-
-#: ../tui/nmt-page-team-port.c:100 ../tui/nmt-page-team.c:170
-msgid "JSON configuration"
-msgstr "Konfiguracja JSON"
-
-#: ../tui/nmt-page-team.c:51
-msgid "TEAM"
-msgstr "ZESPÓÅ"
-
-#: ../tui/nmt-page-vlan.c:109
-msgid "Parent"
-msgstr "Nadrzędne"
-
-#: ../tui/nmt-page-vlan.c:124
-msgid "VLAN id"
-msgstr "Identyfikator VLAN"
-
-#: ../tui/nmt-page-wifi.c:58
-msgid "WI-FI"
-msgstr "WI-FI"
-
-#: ../tui/nmt-page-wifi.c:69
-msgctxt "Wi-Fi"
-msgid "Client"
-msgstr "Klient"
-
-#: ../tui/nmt-page-wifi.c:70
-msgid "Access Point"
-msgstr "Punkt dostępowy"
-
-#: ../tui/nmt-page-wifi.c:71
-msgid "Ad-Hoc Network"
-msgstr "Sieć Ad-hoc"
-
-#: ../tui/nmt-page-wifi.c:76
-msgctxt "Wi-Fi"
-msgid "Automatic"
-msgstr "Automatyczne"
-
-#. 802.11a Wi-Fi network
-#: ../tui/nmt-page-wifi.c:78
-msgid "A (5 GHz)"
-msgstr "A (5 GHz)"
-
-#. 802.11b / 802.11g Wi-Fi network
-#: ../tui/nmt-page-wifi.c:80
-msgid "B/G (2.4 GHz)"
-msgstr "B/G (2.4 GHz)"
-
-#: ../tui/nmt-page-wifi.c:85
-msgctxt "Wi-Fi security"
-msgid "None"
-msgstr "Brak"
+msgid "connection does not match access point"
+msgstr "połączenie nie pasuje do punktu dostępowego"
-#: ../tui/nmt-page-wifi.c:86
-msgid "WPA & WPA2 Personal"
-msgstr "WPA i WPA2 Personal"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:614
+msgid "Access point is unencrypted but setting specifies security"
+msgstr ""
+"Punkt dostępowy jest niezaszyfrowany, ale ustawienie podaje zabezpieczenia"
-#: ../tui/nmt-page-wifi.c:87
-msgid "WPA & WPA2 Enterprise"
-msgstr "WPA i WPA2 Enterprise"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:703
+msgid ""
+"WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic "
+"WEP"
+msgstr ""
+"Uwierzytelnianie WPA jest niezgodne z LEAP niebędącym EAP (oryginalnym) i "
+"dynamicznym WEP"
-#: ../tui/nmt-page-wifi.c:88
-msgid "WEP 40/128-bit Key (Hex or ASCII)"
-msgstr "40/128-bitowy klucz WEP (szesnastkowy lub ASCII)"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:713
+msgid "WPA authentication is incompatible with Shared Key authentication"
+msgstr ""
+"Uwierzytelnianie WPA jest niezgodne z uwierzytelnianiem kluczem "
+"współdzielonym"
-#: ../tui/nmt-page-wifi.c:89
-msgid "WEP 128-bit Passphrase"
-msgstr "128-bitowe hasło WEP"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:760
+msgid "Failed to determine AP security information"
+msgstr "Ustalenie informacji o zabezpieczeniach AP się nie powiodło"
-#: ../tui/nmt-page-wifi.c:90
-msgid "Dynamic WEP (802.1x)"
-msgstr "Dynamiczne WEP (802.1x)"
+#: ../src/devices/wwan/nm-modem-broadband.c:475
+msgid "GSM mobile broadband connection requires a 'gsm' setting"
+msgstr "Połączenie komórkowe GSM wymaga ustawienia \"gsm\""
-#: ../tui/nmt-page-wifi.c:91
-msgid "LEAP"
-msgstr "LEAP"
+#: ../src/nm-config.c:356
+msgid "Config file location"
+msgstr "Położenie pliku konfiguracji"
-#: ../tui/nmt-page-wifi.c:96
-msgctxt "WEP key index"
-msgid "1 (Default)"
-msgstr "1 (domyślne)"
+#: ../src/nm-config.c:356
+msgid "/path/to/config.file"
+msgstr "/ścieżka/do/pliku.konfiguracji"
-#: ../tui/nmt-page-wifi.c:97
-msgctxt "WEP key index"
-msgid "2"
-msgstr "2"
+#: ../src/nm-config.c:357
+msgid "Config directory location"
+msgstr "Położenie katalogu konfiguracji"
-#: ../tui/nmt-page-wifi.c:98
-msgctxt "WEP key index"
-msgid "3"
-msgstr "3"
+#: ../src/nm-config.c:357
+msgid "/path/to/config/dir"
+msgstr "/ścieżka/do/katalogu/konfiguracji"
-#: ../tui/nmt-page-wifi.c:99
-msgctxt "WEP key index"
-msgid "4"
-msgstr "4"
+#: ../src/nm-config.c:359
+msgid "List of plugins separated by ','"
+msgstr "Lista wtyczek oddzielonych \",\""
-#: ../tui/nmt-page-wifi.c:104
-msgid "Open System"
-msgstr "System otwarty"
+#: ../src/nm-config.c:359
+msgid "plugin1,plugin2"
+msgstr "wtyczka1,wtyczka2"
-#: ../tui/nmt-page-wifi.c:105
-msgid "Shared Key"
-msgstr "Klucz współdzielony"
+#. These three are hidden for now, and should eventually just go away.
+#: ../src/nm-config.c:362
+msgid "An http(s) address for checking internet connectivity"
+msgstr "Adres http(s) do sprawdzania łączności internetowej"
-#: ../tui/nmt-page-wifi.c:253
-msgid "Channel"
-msgstr "Kanał"
+#: ../src/nm-config.c:363
+msgid "The interval between connectivity checks (in seconds)"
+msgstr "Czas między sprawdzaniem łączności (w sekundach)"
-#: ../tui/nmt-page-wifi.c:258
-msgid "Security"
-msgstr "Zabezpieczenia"
+#: ../src/nm-config.c:364
+msgid "The expected start of the response"
+msgstr "Oczekiwany poczÄ…tek odpowiedzi"
-#: ../tui/nmt-page-wifi.c:274 ../tui/nmt-page-wifi.c:305
-#: ../tui/nmt-page-wifi.c:335 ../tui/nmt-secret-agent.c:214
-#: ../tui/nmt-secret-agent.c:251 ../tui/nmt-secret-agent.c:281
-#: ../tui/nmt-secret-agent.c:314 ../tui/nmt-secret-agent.c:380
-#: ../tui/nmt-secret-agent.c:393 ../tui/nmt-secret-agent.c:409
-msgid "Password"
-msgstr "Hasło"
+#: ../src/nm-config.c:364
+msgid "Bingo!"
+msgstr "Bingo!"
-#. "wpa-enterprise"
-#. FIXME
-#: ../tui/nmt-page-wifi.c:279
-msgid "(No support for wpa-enterprise yet...)"
-msgstr "(WPA Enterprise nie jest jeszcze obsługiwane)"
+#. Interface/IP config
+#: ../src/nm-iface-helper.c:296
+msgid "The interface to manage"
+msgstr "Interfejs do zarzÄ…dzania"
-#: ../tui/nmt-page-wifi.c:286 ../tui/nmt-secret-agent.c:265
-msgid "Key"
-msgstr "Klucz"
+#: ../src/nm-iface-helper.c:296
+msgid "eth0"
+msgstr "eth0"
-#: ../tui/nmt-page-wifi.c:289 ../tui/nmt-page-wifi.c:308
-msgid "WEP index"
-msgstr "Indeks WEP"
+#: ../src/nm-iface-helper.c:297
+msgid "Connection UUID"
+msgstr "UUID połączenia"
-#: ../tui/nmt-page-wifi.c:297 ../tui/nmt-page-wifi.c:316
-msgid "Authentication"
-msgstr "Uwierzytelnianie"
+#: ../src/nm-iface-helper.c:297
+msgid "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
+msgstr "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
-#. "dynamic-wep"
-#. FIXME
-#: ../tui/nmt-page-wifi.c:322
-msgid "(No support for dynamic-wep yet...)"
-msgstr "(Dynamiczne WEP nie jest jeszcze obsługiwane)"
+#: ../src/nm-iface-helper.c:298
+msgid "Whether to manage IPv6 SLAAC"
+msgstr "Czy zarządzać SLAAC IPv6"
-#. TTLS and PEAP are actually much more complicated, but this complication
-#. * is not visible here since we only care about phase2 authentication
-#. * (and don't even care of which one)
-#.
-#: ../tui/nmt-page-wifi.c:329 ../tui/nmt-secret-agent.c:209
-#: ../tui/nmt-secret-agent.c:304
-msgid "Username"
-msgstr "Nazwa użytkownika"
+#: ../src/nm-iface-helper.c:299
+msgid "Whether SLAAC must be successful"
+msgstr "Czy SLAAC musi się powieść"
-#: ../tui/nmt-password-fields.c:130
-msgid "Ask for this password every time"
-msgstr "Pytanie o to hasło za każdym razem"
+#: ../src/nm-iface-helper.c:300
+msgid "Use an IPv6 temporary privacy address"
+msgstr "Użycie tymczasowego adresu prywatnego IPv6"
-#: ../tui/nmt-password-fields.c:131
-msgid "Show password"
-msgstr "Wyświetlanie hasła"
+#: ../src/nm-iface-helper.c:301
+msgid "Current DHCPv4 address"
+msgstr "Bieżący adres DHCPv4"
-#: ../tui/nmt-route-table.c:226
-msgid "Destination"
-msgstr "Cel"
+#: ../src/nm-iface-helper.c:302
+msgid "Whether DHCPv4 must be successful"
+msgstr "Czy DHCPv4 musi się powieść"
-#: ../tui/nmt-route-table.c:226
-msgid "Prefix"
-msgstr "Przedrostek"
+#: ../src/nm-iface-helper.c:303
+msgid "Hex-encoded DHCPv4 client ID"
+msgstr "Identyfikator klienta DHCPv4 zakodowany szesnastkowo"
-#: ../tui/nmt-route-table.c:235
-msgid "Next Hop"
-msgstr "Następny krok"
+#: ../src/nm-iface-helper.c:304
+msgid "Hostname to send to DHCP server"
+msgstr "Nazwa komputera wysyłana do serwera DHCP"
-#: ../tui/nmt-route-table.c:243
-msgid "Metric"
-msgstr "Parametry"
+#: ../src/nm-iface-helper.c:304
+msgid "barbar"
+msgstr "barbar"
-#: ../tui/nmt-route-table.c:263
-msgid "No custom routes are defined."
-msgstr "Nie określono żadnych tras użytkownika."
+#: ../src/nm-iface-helper.c:305
+msgid "Route priority for IPv4"
+msgstr "Priorytet trasy dla IPv4"
-#: ../tui/nmt-secret-agent.c:223
-msgid "Identity"
-msgstr "Tożsamość"
+#: ../src/nm-iface-helper.c:305
+msgid "0"
+msgstr "0"
-#: ../tui/nmt-secret-agent.c:228
-msgid "Private key password"
-msgstr "Hasło klucza prywatnego"
+#: ../src/nm-iface-helper.c:306
+msgid "Route priority for IPv6"
+msgstr "Priorytet trasy dla IPv6"
-#: ../tui/nmt-secret-agent.c:309
-msgid "Service"
-msgstr "Usługa"
+#: ../src/nm-iface-helper.c:306
+msgid "1024"
+msgstr "1024"
-#: ../tui/nmt-secret-agent.c:340
-msgid "Authentication required by wireless network"
-msgstr "Sieć bezprzewodowa wymaga uwierzytelnienia"
+#: ../src/nm-iface-helper.c:307
+msgid "Hex-encoded Interface Identifier"
+msgstr "Identyfikator interfejsu zakodowany szesnastkowo"
-#: ../tui/nmt-secret-agent.c:341
-#, c-format
+#: ../src/nm-iface-helper.c:328
msgid ""
-"Passwords or encryption keys are required to access the wireless network "
-"'%s'."
+"nm-iface-helper is a small, standalone process that manages a single network "
+"interface."
msgstr ""
-"Wymagane są hasła lub klucze szyfrowania, aby uzyskać dostęp do sieci "
-"bezprzewodowej \"%s\"."
-
-#: ../tui/nmt-secret-agent.c:349
-msgid "Wired 802.1X authentication"
-msgstr "Przewodowe uwierzytelnianie 802.1X"
+"nm-iface-helper to mały, samodzielny proces zarządzający pojedynczym "
+"interfejsem sieciowym."
-#: ../tui/nmt-secret-agent.c:352
-msgid "Network name"
-msgstr "Nazwa sieci"
-
-#: ../tui/nmt-secret-agent.c:359
-msgid "DSL authentication"
-msgstr "Uwierzytelnianie DSL"
-
-#: ../tui/nmt-secret-agent.c:367
-msgid "PIN code required"
-msgstr "Wymagany jest kod PIN"
-
-#: ../tui/nmt-secret-agent.c:368
-msgid "PIN code is needed for the mobile broadband device"
-msgstr "Urządzenie komórkowe wymaga kodu PIN"
-
-#: ../tui/nmt-secret-agent.c:370
-msgid "PIN"
-msgstr "PIN"
-
-#: ../tui/nmt-secret-agent.c:376 ../tui/nmt-secret-agent.c:389
-#: ../tui/nmt-secret-agent.c:405
-msgid "Mobile broadband network password"
-msgstr "Hasło sieci komórkowej"
-
-#: ../tui/nmt-secret-agent.c:377 ../tui/nmt-secret-agent.c:390
-#: ../tui/nmt-secret-agent.c:406
+#: ../src/nm-iface-helper.c:337
#, c-format
-msgid "A password is required to connect to '%s'."
-msgstr "Wymagane jest hasło, aby połączyć z \"%s\"."
+msgid "An interface name and UUID are required\n"
+msgstr "Wymagana jest nazwa interfejsu i UUID\n"
-#: ../tui/nmt-slave-list.c:138
-msgid "Select the type of slave connection you wish to add."
-msgstr "Proszę wybrać typ połączenia podrzędnego do dodania."
-
-#: ../tui/nmt-widget-list.c:142
-msgid "Add..."
-msgstr "Dodaj..."
-
-#: ../tui/nmt-widget-list.c:205
-msgid "Remove"
-msgstr "Usuń"
-
-#: ../tui/nmtui-connect.c:94
-msgid "Activation failed"
-msgstr "Aktywacja się nie powiodła"
-
-#: ../tui/nmtui-connect.c:142
-msgid "Connecting..."
-msgstr "ÅÄ…czenie..."
-
-#: ../tui/nmtui-connect.c:172 ../tui/nmtui-connect.c:195
+#: ../src/nm-iface-helper.c:402
#, c-format
-msgid "Could not activate connection: %s"
-msgstr "Nie można aktywować połączenia: %s"
-
-#: ../tui/nmtui-connect.c:259 ../tui/nmtui-connect.c:308
-msgid "Activate"
-msgstr "Aktywuj"
+msgid "Failed to find interface index for %s\n"
+msgstr "Odnalezienie indeksu interfejsu dla %s się nie powiodło\n"
-#: ../tui/nmtui-connect.c:261
-msgid "Deactivate"
-msgstr "Deaktywuj"
-
-#: ../tui/nmtui-connect.c:313 ../tui/nmtui-edit.c:95 ../tui/nmtui.c:115
-msgid "Quit"
-msgstr "Zakończ"
-
-#: ../tui/nmtui-connect.c:336
+#: ../src/nm-iface-helper.c:418
#, c-format
-msgid "No such connection '%s'"
-msgstr "Brak połączenia \"%s\""
-
-#: ../tui/nmtui-connect.c:338
-msgid "Connection is already active"
-msgstr "Połączenie jest już aktywne"
+msgid "(%s): Invalid IID %s\n"
+msgstr "(%s): nieprawidłowy IID %s\n"
-#: ../tui/nmtui-edit.c:200
-msgid "Create"
-msgstr "Utwórz"
-
-#: ../tui/nmtui-edit.c:341
-msgid "Select the type of connection you wish to create."
-msgstr "Proszę wybrać typ połączenia do utworzenia."
-
-#: ../tui/nmtui-edit.c:348
-msgid ""
-"If you are creating a VPN, and the VPN connection you wish to create does "
-"not appear in the list, you may not have the correct VPN plugin installed."
-msgstr ""
-"Jeśli tworzone jest połączenie VPN, a tworzone połączenie VPN nie pojawia "
-"się na liście, to być może właściwa wtyczka VPN nie jest zainstalowana."
-
-#: ../tui/nmtui-edit.c:381 ../tui/nmtui-edit.c:397
-msgid "New Connection"
-msgstr "Nowe połączenie"
-
-#: ../tui/nmtui-edit.c:434
-#, c-format
-msgid "Unable to delete connection: %s"
-msgstr "Nie można usunąć połączenia: %s"
-
-#: ../tui/nmtui-edit.c:463
+#: ../src/nm-logging.c:137
#, c-format
-msgid "Are you sure you want to delete the connection '%s'?"
-msgstr "Na pewno usunąć połączenie \"%s\"?"
+msgid "Unknown log level '%s'"
+msgstr "Nieznany poziom dziennika \"%s\""
-#: ../tui/nmtui-edit.c:477
+#: ../src/nm-logging.c:219
#, c-format
-msgid "Could not delete connection: %s"
-msgstr "Nie można usunąć połączenia: %s"
+msgid "Unknown log domain '%s'"
+msgstr "Nieznana domena dziennika \"%s\""
-#: ../tui/nmtui-hostname.c:47
-msgid "Set Hostname"
-msgstr "Ustaw nazwÄ™ komputera"
+#: ../src/nm-manager.c:3413
+msgid "VPN connection"
+msgstr "Połączenie VPN"
-#: ../tui/nmtui-hostname.c:55
-msgid "Hostname"
-msgstr "Nazwa komputera"
+#: ../src/nm-sleep-monitor-systemd.c:115
+msgid "NetworkManager needs to turn off networks"
+msgstr "Usługa NetworkManager musi wyłączyć sieci"
-#. Translators: this indicates the result. ie, "I have set the hostname to ..."
-#: ../tui/nmtui-hostname.c:114
+#: ../src/settings/plugins/ibft/plugin.c:66
#, c-format
-msgid "Set hostname to '%s'"
-msgstr "Ustawiono nazwÄ™ komputera na \"%s\""
+msgid "ibft: failed to read iscsiadm records: %s"
+msgstr "ibft: odczytanie wpisów iscsiadm się nie powiodło: %s"
-#: ../tui/nmtui-hostname.c:116
+#: ../src/settings/plugins/ibft/plugin.c:74
#, c-format
-msgid "Unable to set hostname: %s"
-msgstr "Nie można ustawić nazwy komputera: %s"
-
-#: ../tui/nmtui.c:60 ../tui/nmtui.c:63
-msgid "connection"
-msgstr "połączenie"
+msgid "ibft: read connection '%s'"
+msgstr "ibft: odczytanie połączenia \"%s\""
-#: ../tui/nmtui.c:61
-msgid "Edit a connection"
-msgstr "Modyfikuj połączanie"
-
-#: ../tui/nmtui.c:64
-msgid "Activate a connection"
-msgstr "Aktywuj połączenie"
-
-#: ../tui/nmtui.c:66
-msgid "new hostname"
-msgstr "nowa nazwa komputera"
-
-#: ../tui/nmtui.c:67
-msgid "Set system hostname"
-msgstr "Ustaw systemowÄ… nazwÄ™ komputera"
-
-#: ../tui/nmtui.c:90
-msgid "NetworkManager TUI"
-msgstr "Tekstowy interfejs usługi NetworkManager"
-
-#: ../tui/nmtui.c:98
-msgid "Please select an option"
-msgstr "Proszę wybrać opcję"
-
-#: ../tui/nmtui.c:159
-msgid "Usage"
-msgstr "Użycie"
-
-#: ../tui/nmtui.c:241
-msgid "Could not parse arguments"
-msgstr "Nie można przetworzyć parametrów"
+#: ../src/settings/plugins/ibft/plugin.c:80
+#, c-format
+msgid "ibft: failed to read iscsiadm record: %s"
+msgstr "ibft: odczytanie wpisu iscsiadm się nie powiodło: %s"
-#: ../tui/nmtui.c:251
-msgid "NetworkManager is not running."
-msgstr "Usługa NetworkManager nie jest uruchomiona."
+#: ../src/settings/plugins/ifcfg-rh/reader.c:112
+msgid "System"
+msgstr "Systemowe"
diff --git a/po/ru.po b/po/ru.po
index 586414a2b3..5a0aaad9cf 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,575 +8,808 @@
# Yulia <ypoyarko@redhat.com>, 2010.
# Sergey Isachenko aka Zabuldon <vortexius@gmail.com>, 2011.
# Yuri Kozlov <yuray@komyakino.ru>, 2011.
-# Stas Solovey <whats_up@tut.by>, 2012.
# Yuri Myasoedov <omerta13@yandex.ru>, 2012.
# ypoyarko <ypoyarko@redhat.com>, 2013. #zanata
# ypoyarko <ypoyarko@redhat.com>, 2014. #zanata
+# Stas Solovey <whats_up@tut.by>, 2012, 2014, 2015.
+#
+#: ../src/nm-iface-helper.c:297
msgid ""
msgstr ""
"Project-Id-Version: ru\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
-"product=NetworkManager&keywords=I18N+L10N&component=general\n"
-"POT-Creation-Date: 2014-01-23 17:13+0530\n"
-"PO-Revision-Date: 2014-02-09 10:16-0500\n"
-"Last-Translator: ypoyarko <ypoyarko@redhat.com>\n"
-"Language-Team: руÑÑкий <gnome-cyr@gnome.org>\n"
+"product=NetworkManager&keywords=I18N+L10N&component=Translations\n"
+"POT-Creation-Date: 2015-02-26 11:39+0000\n"
+"PO-Revision-Date: 2015-02-27 02:25+0300\n"
+"Last-Translator: Stas Solovey <whats_up@tut.by>\n"
+"Language-Team: РуÑÑкий <gnome-cyr@gnome.org>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-10-20 12:08+0000\n"
-"X-Generator: Zanata 3.2.3\n"
+"X-Generator: Gtranslator 2.91.6\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
-#: ../cli/src/common.c:34 ../cli/src/common.c:46 ../cli/src/common.c:54
-#: ../cli/src/common.c:65 ../cli/src/connections.c:174
-#: ../cli/src/connections.c:200
+#: ../clients/cli/agent.c:42
+#, c-format
+msgid ""
+"Usage: nmcli agent { COMMAND | help }\n"
+"\n"
+"COMMAND := { secret | polkit | all }\n"
+"\n"
+msgstr ""
+
+#: ../clients/cli/agent.c:50
+#, c-format
+msgid ""
+"Usage: nmcli agent secret { help }\n"
+"\n"
+"Runs nmcli as NetworkManager secret agent. When NetworkManager requires\n"
+"a password it asks registered agents for it. This command keeps nmcli "
+"running\n"
+"and if a password is required asks the user for it.\n"
+"\n"
+msgstr ""
+
+#: ../clients/cli/agent.c:60
+#, c-format
+msgid ""
+"Usage: nmcli agent polkit { help }\n"
+"\n"
+"Registers nmcli as a polkit action for the user session.\n"
+"When a polkit daemon requires an authorization, nmcli asks the user and "
+"gives\n"
+"the response back to polkit.\n"
+"\n"
+msgstr ""
+
+#: ../clients/cli/agent.c:70
+#, c-format
+msgid ""
+"Usage: nmcli agent all { help }\n"
+"\n"
+"Runs nmcli as both NetworkManager secret and a polkit agent.\n"
+"\n"
+msgstr ""
+
+#: ../clients/cli/agent.c:152
+#, c-format
+msgid "nmcli successfully registered as a NetworkManager's secret agent.\n"
+msgstr ""
+
+#: ../clients/cli/agent.c:154
+#, fuzzy, c-format
+#| msgid "Modem initialization failed"
+msgid "Error: secret agent initialization failed"
+msgstr "Ðе удалоÑÑŒ инициализировать модем"
+
+#: ../clients/cli/agent.c:169
+#, fuzzy, c-format
+#| msgid "Error: Connection activation failed: %s"
+msgid "Error: polkit agent initialization failed: %s"
+msgstr "Ошибка: Ñбой активации ÑоединениÑ: %s"
+
+#: ../clients/cli/agent.c:177
+#, c-format
+msgid "nmcli successfully registered as a polkit agent.\n"
+msgstr ""
+
+#: ../clients/cli/agent.c:209 ../clients/cli/connections.c:8958
+#: ../clients/cli/connections.c:8984 ../clients/cli/connections.c:9182
+#: ../clients/cli/devices.c:2908 ../clients/cli/general.c:361
+#: ../clients/cli/general.c:514
+#, c-format
+msgid "Error: NetworkManager is not running."
+msgstr "Ошибка: NetworkManager не запущен."
+
+#: ../clients/cli/agent.c:245
+#, fuzzy, c-format
+#| msgid "Error: 'general' command '%s' is not valid."
+msgid "Error: 'agent' command '%s' is not valid."
+msgstr "Ошибка. ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «general»: «%s»."
+
+#: ../clients/cli/common.c:40 ../clients/cli/common.c:53
+#: ../clients/cli/common.c:61 ../clients/cli/common.c:73
+#: ../clients/cli/connections.c:172 ../clients/cli/connections.c:194
msgid "GROUP"
msgstr "ГРУППÐ"
-#: ../cli/src/common.c:35 ../cli/src/common.c:55
+#. 0
+#: ../clients/cli/common.c:41 ../clients/cli/common.c:62
msgid "ADDRESS"
msgstr "ÐДРЕС"
-#: ../cli/src/common.c:36 ../cli/src/common.c:56
+#. 1
+#. 2
+#: ../clients/cli/common.c:42 ../clients/cli/common.c:63
+#: ../clients/cli/connections.c:197
+msgid "GATEWAY"
+msgstr "ШЛЮЗ"
+
+#. 2
+#: ../clients/cli/common.c:43 ../clients/cli/common.c:64
msgid "ROUTE"
msgstr "ÐœÐРШРУТ"
-#: ../cli/src/common.c:37 ../cli/src/common.c:57
+#. 3
+#: ../clients/cli/common.c:44 ../clients/cli/common.c:65
msgid "DNS"
msgstr "DNS"
-#: ../cli/src/common.c:38 ../cli/src/common.c:58
+#. 4
+#: ../clients/cli/common.c:45 ../clients/cli/common.c:66
msgid "DOMAIN"
msgstr "ДОМЕÐ"
-#: ../cli/src/common.c:39
+#. 5
+#: ../clients/cli/common.c:46
msgid "WINS"
msgstr "WINS"
-#: ../cli/src/common.c:47 ../cli/src/common.c:66
+#. 0
+#: ../clients/cli/common.c:54 ../clients/cli/common.c:74
msgid "OPTION"
msgstr "ПÐРÐМЕТР"
-#: ../cli/src/common.c:404 ../cli/src/settings.c:2808
-#, c-format
-msgid "invalid IPv4 address '%s'"
-msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv4: «%s»"
-
-#: ../cli/src/common.c:412
-#, c-format
-msgid "invalid prefix '%s'; <1-32> allowed"
+#: ../clients/cli/common.c:378 ../clients/cli/common.c:438
+#, fuzzy, c-format
+#| msgid "invalid prefix '%s'; <1-32> allowed"
+msgid "invalid prefix '%s'; <1-%d> allowed"
msgstr "недопуÑтимый Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Â«%s» (допуÑкаетÑÑ <1-32>)"
-#: ../cli/src/common.c:419 ../cli/src/common.c:472
-#, c-format
-msgid "invalid gateway '%s'"
-msgstr "недопуÑтимый шлюз «%s»"
-
-#: ../cli/src/common.c:457 ../cli/src/settings.c:3054
-#, c-format
-msgid "invalid IPv6 address '%s'"
-msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv6: «%s»"
-
-#: ../cli/src/common.c:465
-#, c-format
-msgid "invalid prefix '%s'; <1-128> allowed"
-msgstr "недопуÑтимый Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Â«%s» (допуÑкаетÑÑ <1-128>)"
-
-#: ../cli/src/common.c:512
-#, c-format
-msgid "invalid IPv4 route '%s'"
-msgstr "недопуÑтимый маршрут IPv4: «%s»"
-
-#: ../cli/src/common.c:520
-#, c-format
-msgid "invalid prefix '%s'; <0-32> allowed"
-msgstr "недопуÑтимый Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Â«%s» (допуÑкаетÑÑ <0-32>)"
+#: ../clients/cli/common.c:386
+#, fuzzy, c-format
+#| msgid "invalid IPv4 address '%s'"
+msgid "invalid IP address: %s"
+msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv4: «%s»"
-#: ../cli/src/common.c:527 ../cli/src/common.c:590
+#: ../clients/cli/common.c:450
#, c-format
-msgid "invalid next hop address '%s'"
-msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´Ð°: «%s»"
+msgid ""
+"the second component of route ('%s') is neither a next hop address nor a "
+"metric"
+msgstr ""
-#: ../cli/src/common.c:534 ../cli/src/common.c:598
+#: ../clients/cli/common.c:459
#, c-format
msgid "invalid metric '%s'"
msgstr "недопуÑÑ‚Ð¸Ð¼Ð°Ñ Ð¼ÐµÑ‚Ñ€Ð¸ÐºÐ° «%s»"
-#: ../cli/src/common.c:575
-#, c-format
-msgid "invalid IPv6 route '%s'"
-msgstr "недопуÑтимый маршрут IPv6: «%s»"
+#: ../clients/cli/common.c:467
+#, fuzzy, c-format
+#| msgid "invalid IPv4 route '%s'"
+msgid "invalid route: %s"
+msgstr "недопуÑтимый маршрут IPv4: «%s»"
-#: ../cli/src/common.c:583
-#, c-format
-msgid "invalid prefix '%s'; <0-128> allowed"
-msgstr "недопуÑтимый Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Â«%s» (допуÑкаетÑÑ <0-128>)"
+#: ../clients/cli/common.c:479
+msgid "default route cannot be added (NetworkManager handles it by itself)"
+msgstr ""
-#: ../cli/src/common.c:619
+#: ../clients/cli/common.c:496
msgid "unmanaged"
msgstr "без управлениÑ"
-#: ../cli/src/common.c:621
+#: ../clients/cli/common.c:498
msgid "unavailable"
msgstr "недоÑтупен"
-#: ../cli/src/common.c:623 ../cli/src/network-manager.c:276
+#: ../clients/cli/common.c:500 ../clients/cli/general.c:260
msgid "disconnected"
msgstr "отключено"
-#: ../cli/src/common.c:625
+#: ../clients/cli/common.c:502
msgid "connecting (prepare)"
msgstr "подключение (подготовка)"
-#: ../cli/src/common.c:627
+#: ../clients/cli/common.c:504
msgid "connecting (configuring)"
msgstr "подключение (наÑтройка)"
-#: ../cli/src/common.c:629
+#: ../clients/cli/common.c:506
msgid "connecting (need authentication)"
msgstr "подключение (требуетÑÑ Ð°ÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ)"
-#: ../cli/src/common.c:631
+#: ../clients/cli/common.c:508
msgid "connecting (getting IP configuration)"
msgstr "подключение (получение конфигурации IP)"
-#: ../cli/src/common.c:633
+#: ../clients/cli/common.c:510
msgid "connecting (checking IP connectivity)"
msgstr "подключение (проверка IP-подключениÑ)"
-#: ../cli/src/common.c:635
+#: ../clients/cli/common.c:512
msgid "connecting (starting secondary connections)"
msgstr "подключение (запуÑк второÑтепенных Ñоединений)"
-#: ../cli/src/common.c:637 ../cli/src/network-manager.c:272
+#: ../clients/cli/common.c:514 ../clients/cli/general.c:256
msgid "connected"
msgstr "подключено"
-#: ../cli/src/common.c:639 ../cli/src/connections.c:732
+#: ../clients/cli/common.c:516 ../clients/cli/connections.c:540
msgid "deactivating"
msgstr "деактивациÑ"
-#: ../cli/src/common.c:641
+#: ../clients/cli/common.c:518
msgid "connection failed"
msgstr "Ñбой ÑоединениÑ"
-#: ../cli/src/common.c:643 ../cli/src/connections.c:737
-#: ../cli/src/connections.c:760 ../cli/src/connections.c:1462
-#: ../cli/src/devices.c:827 ../cli/src/devices.c:2257
-#: ../cli/src/network-manager.c:279 ../cli/src/network-manager.c:297
-#: ../cli/src/network-manager.c:360 ../cli/src/network-manager.c:363
-#: ../cli/src/network-manager.c:373 ../cli/src/network-manager.c:375
-#: ../cli/src/network-manager.c:432 ../cli/src/network-manager.c:448
-#: ../cli/src/settings.c:732 ../cli/src/settings.c:760
-#: ../cli/src/settings.c:822 ../cli/src/settings.c:1137
-#: ../cli/src/utils.c:1080 ../src/main.c:470 ../src/main.c:498
+#: ../clients/cli/common.c:520 ../clients/cli/connections.c:545
+#: ../clients/cli/connections.c:568 ../clients/cli/connections.c:1859
+#: ../clients/cli/devices.c:940 ../clients/cli/general.c:263
+#: ../clients/cli/general.c:301 ../clients/cli/general.c:462
+#: ../clients/cli/general.c:478 ../clients/cli/settings.c:721
+#: ../clients/cli/settings.c:783 ../clients/cli/settings.c:1077
+#: ../clients/cli/utils.c:1311 ../src/main.c:315 ../src/main.c:343
msgid "unknown"
msgstr "неизвеÑтно"
-#: ../cli/src/common.c:652
+#: ../clients/cli/common.c:529
msgid "No reason given"
msgstr "Причина не указана"
-#: ../cli/src/common.c:655 ../cli/src/connections.c:2258
+#: ../clients/cli/common.c:532 ../clients/cli/connections.c:2859
#, c-format
msgid "Unknown error"
msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°"
-#: ../cli/src/common.c:658
+#: ../clients/cli/common.c:535
msgid "Device is now managed"
msgstr "УÑтройÑтво обÑлуживаетÑÑ"
-#: ../cli/src/common.c:661
+#: ../clients/cli/common.c:538
msgid "Device is now unmanaged"
msgstr "УÑтройÑтво не обÑлуживаетÑÑ"
-#: ../cli/src/common.c:664
+#: ../clients/cli/common.c:541
msgid "The device could not be readied for configuration"
msgstr "УÑтройÑтво не позволÑет чтение конфигурации"
-#: ../cli/src/common.c:667
+#: ../clients/cli/common.c:544
msgid ""
"IP configuration could not be reserved (no available address, timeout, etc.)"
msgstr ""
"ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ IP не может быть зарезервирована (отÑутÑтвует доÑтупный адреÑ, "
"иÑтекло Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ð¸ Ñ‚.д.)"
-#: ../cli/src/common.c:670
+#: ../clients/cli/common.c:547
msgid "The IP configuration is no longer valid"
msgstr "ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ IP не актуальна"
-#: ../cli/src/common.c:673
+#: ../clients/cli/common.c:550
msgid "Secrets were required, but not provided"
msgstr "Ðе предоÑтавлена Ñ‚Ñ€ÐµÐ±ÑƒÐµÐ¼Ð°Ñ ÑÐµÐºÑ€ÐµÑ‚Ð½Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ"
-#: ../cli/src/common.c:676
+#: ../clients/cli/common.c:553
msgid "802.1X supplicant disconnected"
msgstr "ЗаÑвитель 802.1X отключён"
-#: ../cli/src/common.c:679
+#: ../clients/cli/common.c:556
msgid "802.1X supplicant configuration failed"
msgstr "Сбой конфигурации заÑÐ²Ð¸Ñ‚ÐµÐ»Ñ 802.1X"
-#: ../cli/src/common.c:682
+#: ../clients/cli/common.c:559
msgid "802.1X supplicant failed"
msgstr "Сбой заÑÐ²Ð¸Ñ‚ÐµÐ»Ñ 802.1X"
-#: ../cli/src/common.c:685
+#: ../clients/cli/common.c:562
msgid "802.1X supplicant took too long to authenticate"
msgstr "Превышено Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ð¿Ñ€Ð¸ проверке подлинноÑти заÑÐ²Ð¸Ñ‚ÐµÐ»Ñ 802.1X"
-#: ../cli/src/common.c:688
+#: ../clients/cli/common.c:565
msgid "PPP service failed to start"
msgstr "Ðе удалоÑÑŒ запуÑтить Ñлужбу PPP"
-#: ../cli/src/common.c:691
+#: ../clients/cli/common.c:568
msgid "PPP service disconnected"
msgstr "Служба PPP отключена"
-#: ../cli/src/common.c:694
+#: ../clients/cli/common.c:571
msgid "PPP failed"
msgstr "Сбой PPP"
-#: ../cli/src/common.c:697
+#: ../clients/cli/common.c:574
msgid "DHCP client failed to start"
msgstr "Ðе удалоÑÑŒ запуÑтить клиент DHCP"
-#: ../cli/src/common.c:700
+#: ../clients/cli/common.c:577
msgid "DHCP client error"
msgstr "Ошибка клиента DHCP"
-#: ../cli/src/common.c:703
+#: ../clients/cli/common.c:580
msgid "DHCP client failed"
msgstr "Сбой клиента DHCP"
-#: ../cli/src/common.c:706
+#: ../clients/cli/common.c:583
msgid "Shared connection service failed to start"
msgstr "Ðе удалоÑÑŒ запуÑтить Ñлужбу общего подключениÑ"
-#: ../cli/src/common.c:709
+#: ../clients/cli/common.c:586
msgid "Shared connection service failed"
msgstr "Сбой Ñлужбы общего подключениÑ"
-#: ../cli/src/common.c:712
+#: ../clients/cli/common.c:589
msgid "AutoIP service failed to start"
msgstr "Ðе удалоÑÑŒ запуÑтить Ñлужбу AutoIP"
-#: ../cli/src/common.c:715
+#: ../clients/cli/common.c:592
msgid "AutoIP service error"
msgstr "Сбой Ñлужбы AutoIP"
-#: ../cli/src/common.c:718
+#: ../clients/cli/common.c:595
msgid "AutoIP service failed"
msgstr "Ошибка Ñлужбы AutoIP"
-#: ../cli/src/common.c:721
+#: ../clients/cli/common.c:598
msgid "The line is busy"
msgstr "Ð›Ð¸Ð½Ð¸Ñ Ð·Ð°Ð½Ñта"
-#: ../cli/src/common.c:724
+#: ../clients/cli/common.c:601
msgid "No dial tone"
msgstr "Ðет гудка"
-#: ../cli/src/common.c:727
+#: ../clients/cli/common.c:604
msgid "No carrier could be established"
msgstr "Ðе удалоÑÑŒ уÑтановить неÑущую чаÑтоту"
-#: ../cli/src/common.c:730
+#: ../clients/cli/common.c:607
msgid "The dialing request timed out"
msgstr "ИÑтекло Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ð½Ð°Ð±Ð¾Ñ€Ð° номера"
-#: ../cli/src/common.c:733
+#: ../clients/cli/common.c:610
msgid "The dialing attempt failed"
msgstr "Во Ð²Ñ€ÐµÐ¼Ñ Ð½Ð°Ð±Ð¾Ñ€Ð° номера произошла ошибка"
-#: ../cli/src/common.c:736
+#: ../clients/cli/common.c:613
msgid "Modem initialization failed"
msgstr "Ðе удалоÑÑŒ инициализировать модем"
-#: ../cli/src/common.c:739
+#: ../clients/cli/common.c:616
msgid "Failed to select the specified APN"
msgstr "Ðе удалоÑÑŒ выбрать указанный APN"
-#: ../cli/src/common.c:742
+#: ../clients/cli/common.c:619
msgid "Not searching for networks"
msgstr "Ðе выполнÑÑ‚ÑŒ поиÑк Ñетей"
-#: ../cli/src/common.c:745
+#: ../clients/cli/common.c:622
msgid "Network registration denied"
msgstr "РегиÑÑ‚Ñ€Ð°Ñ†Ð¸Ñ Ñети запрещена"
-#: ../cli/src/common.c:748
+#: ../clients/cli/common.c:625
msgid "Network registration timed out"
msgstr "ИÑтекло Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ñ€ÐµÐ³Ð¸Ñтрации Ñети"
-#: ../cli/src/common.c:751
+#: ../clients/cli/common.c:628
msgid "Failed to register with the requested network"
msgstr "Ðе удалоÑÑŒ зарегиÑтрироватьÑÑ Ð² запрошенной Ñети"
-#: ../cli/src/common.c:754
+#: ../clients/cli/common.c:631
msgid "PIN check failed"
msgstr "PIN-код не прошёл проверку"
-#: ../cli/src/common.c:757
+#: ../clients/cli/common.c:634
msgid "Necessary firmware for the device may be missing"
msgstr ""
"Возможно Ð´Ð»Ñ ÑƒÑтройÑтва требуетÑÑ Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾Ðµ программное обеÑпечение"
-#: ../cli/src/common.c:760
+#: ../clients/cli/common.c:637
msgid "The device was removed"
msgstr "УÑтройÑтво извлечено"
-#: ../cli/src/common.c:763
+#: ../clients/cli/common.c:640
msgid "NetworkManager went to sleep"
msgstr "NetworkManager перешёл в ÑпÑщий режим"
-#: ../cli/src/common.c:766
+#: ../clients/cli/common.c:643
msgid "The device's active connection disappeared"
msgstr "УÑтройÑтво потерÑло иÑпользуемое Ñоединение"
-#: ../cli/src/common.c:769
+#: ../clients/cli/common.c:646
msgid "Device disconnected by user or client"
msgstr "УÑтройÑтво отключено пользователем или клиентом"
-#: ../cli/src/common.c:772
+#: ../clients/cli/common.c:649
msgid "Carrier/link changed"
msgstr "Произошли Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð»Ð¸Ð½Ð¸Ð¸ или неÑущей чаÑтоты"
-#: ../cli/src/common.c:775
+#: ../clients/cli/common.c:652
msgid "The device's existing connection was assumed"
msgstr "СущеÑтвующее Ñоединение уÑтройÑтва принÑто"
-#: ../cli/src/common.c:778
+#: ../clients/cli/common.c:655
msgid "The supplicant is now available"
msgstr "ДоÑтупен заÑвитель"
-#: ../cli/src/common.c:781
+#: ../clients/cli/common.c:658
msgid "The modem could not be found"
msgstr "Ðе удалоÑÑŒ обнаружить модем"
-#: ../cli/src/common.c:784
+#: ../clients/cli/common.c:661
msgid "The Bluetooth connection failed or timed out"
msgstr "Ð’Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¿Ð¾ Bluetooth иÑтекло или произошла ошибка"
-#: ../cli/src/common.c:787
+#: ../clients/cli/common.c:664
msgid "GSM Modem's SIM card not inserted"
msgstr "Ðе вÑтавлена SIM-карта GSM-модема"
-#: ../cli/src/common.c:790
+#: ../clients/cli/common.c:667
msgid "GSM Modem's SIM PIN required"
msgstr "ТребуетÑÑ PIN-код к SIM-карте GSM-модема"
-#: ../cli/src/common.c:793
+#: ../clients/cli/common.c:670
msgid "GSM Modem's SIM PUK required"
msgstr "ТребуетÑÑ PUK-код к SIM-карте GSM-модема"
-#: ../cli/src/common.c:796
+#: ../clients/cli/common.c:673
msgid "GSM Modem's SIM wrong"
msgstr "ÐÐµÐ²ÐµÑ€Ð½Ð°Ñ SIM-карта GSM модема"
-#: ../cli/src/common.c:799
+#: ../clients/cli/common.c:676
msgid "InfiniBand device does not support connected mode"
msgstr "УÑтройÑтво InfiniBand не поддерживает режим ÑоединениÑ"
-#: ../cli/src/common.c:802
+#: ../clients/cli/common.c:679
msgid "A dependency of the connection failed"
msgstr "Сбой завиÑимоÑти ÑоединениÑ"
-#: ../cli/src/common.c:805
+#: ../clients/cli/common.c:682
msgid "A problem with the RFC 2684 Ethernet over ADSL bridge"
msgstr "Ошибка RFC 2684 Ethernet Ñ Ð¸Ñпользованием моÑта ADSL"
-#: ../cli/src/common.c:808
+#: ../clients/cli/common.c:685
msgid "ModemManager is unavailable"
msgstr "ModemManager недоÑтупен"
-#: ../cli/src/common.c:811
+#: ../clients/cli/common.c:688
msgid "The Wi-Fi network could not be found"
msgstr "Ðе удалоÑÑŒ обнаружить Ñеть Wi-Fi"
-#: ../cli/src/common.c:814
+#: ../clients/cli/common.c:691
msgid "A secondary connection of the base connection failed"
msgstr "Сбой вторичного Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ð¾Ñнового ÑоединениÑ"
-#: ../cli/src/common.c:817
+#: ../clients/cli/common.c:694
msgid "DCB or FCoE setup failed"
msgstr "Ðе удалоÑÑŒ наÑтроить DCB или FCoE"
-#: ../cli/src/common.c:820
+#: ../clients/cli/common.c:697
msgid "teamd control failed"
msgstr "Ðе удалоÑÑŒ наÑтроить teamd"
-#: ../cli/src/common.c:824 ../cli/src/devices.c:634 ../tui/nm-ui-utils.c:359
+#: ../clients/cli/common.c:700
+#, fuzzy
+#| msgid "ModemManager is unavailable"
+msgid "Modem failed or no longer available"
+msgstr "ModemManager недоÑтупен"
+
+#: ../clients/cli/common.c:703
+#, fuzzy
+#| msgid "ModemManager is unavailable"
+msgid "Modem now ready and available"
+msgstr "ModemManager недоÑтупен"
+
+#: ../clients/cli/common.c:706
+msgid "SIM PIN was incorrect"
+msgstr "Ðеверный PIN-код SIM-карты"
+
+#. TRANSLATORS: Unknown reason for a device state change (NMDeviceStateReason)
+#: ../clients/cli/common.c:710 ../clients/cli/devices.c:681
+#: ../libnm-glib/nm-device.c:1813 ../libnm/nm-device.c:1635
msgid "Unknown"
msgstr "ÐеизвеÑтно"
-#: ../cli/src/common.c:866
+#: ../clients/cli/common.c:752
#, c-format
msgid "invalid priority map '%s'"
-msgstr "ÐÐµÐ²ÐµÑ€Ð½Ð°Ñ Ñхема приоритетов «%s»"
+msgstr "ÐÐµÐ²ÐµÑ€Ð½Ð°Ñ Ñхема приоритетов «%s»"
-#: ../cli/src/common.c:873 ../cli/src/common.c:879
+#: ../clients/cli/common.c:759 ../clients/cli/common.c:765
#, c-format
msgid "priority '%s' is not valid (<0-%ld>)"
msgstr "недопуÑтимый приоритет «%s» (<0-%ld>)"
-#: ../cli/src/common.c:935
+#: ../clients/cli/common.c:832
#, c-format
msgid "'%s' is not a valid team configuration or file name."
-msgstr "ÐедопуÑтимое Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° или Ð½ÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹: «%s»"
+msgstr ""
+"ÐедопуÑтимое Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° или Ð½ÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ Ð°Ð³Ñ€ÐµÐ³Ð°Ñ†Ð¸Ð¸ (team): «%s»"
+
+#: ../clients/cli/common.c:933
+#, c-format
+msgid ""
+"Warning: password for '%s' not given in 'passwd-file' and nmcli cannot ask "
+"without '--ask' option.\n"
+msgstr ""
-#: ../cli/src/connections.c:62
+#. define some prompts for connection editor
+#: ../clients/cli/connections.c:42
msgid "Setting name? "
msgstr "ÐаÑтройка имени?"
-#: ../cli/src/connections.c:63
+#: ../clients/cli/connections.c:43
msgid "Property name? "
msgstr "Ð˜Ð¼Ñ ÑвойÑтва?"
-#: ../cli/src/connections.c:64
+#: ../clients/cli/connections.c:44
msgid "Enter connection type: "
msgstr "Выберите тип ÑоединениÑ:"
-#: ../cli/src/connections.c:68 ../cli/src/connections.c:175
-#: ../cli/src/devices.c:86 ../cli/src/devices.c:114 ../cli/src/devices.c:124
-#: ../cli/src/devices.c:134 ../cli/src/devices.c:143 ../cli/src/devices.c:158
-#: ../cli/src/devices.c:171 ../cli/src/devices.c:197 ../cli/src/devices.c:212
-#: ../cli/src/devices.c:221
+#. define some other prompts
+#: ../clients/cli/connections.c:47
+msgid "Connection type: "
+msgstr "Тип ÑоединениÑ:"
+
+#: ../clients/cli/connections.c:48
+msgid "VPN type: "
+msgstr "Тип VPN:"
+
+#: ../clients/cli/connections.c:49
+msgid "Bond master: "
+msgstr "МаÑтер-агрегации (Bond):"
+
+#: ../clients/cli/connections.c:50
+msgid "Team master: "
+msgstr "МаÑтер-агрегации (Team):"
+
+#: ../clients/cli/connections.c:51
+msgid "Bridge master: "
+msgstr "МаÑтер-моÑÑ‚:"
+
+#: ../clients/cli/connections.c:52
+msgid "Connection (name, UUID, or path): "
+msgstr "Соединение (имÑ, UUID, или путь):"
+
+#. 0
+#: ../clients/cli/connections.c:60 ../clients/cli/connections.c:173
+#: ../clients/cli/devices.c:57 ../clients/cli/devices.c:86
+#: ../clients/cli/devices.c:96 ../clients/cli/devices.c:107
+#: ../clients/cli/devices.c:116 ../clients/cli/devices.c:131
+#: ../clients/cli/devices.c:144 ../clients/cli/devices.c:170
+#: ../clients/cli/devices.c:185 ../clients/cli/devices.c:194
+#: ../clients/cli/devices.c:204
msgid "NAME"
msgstr "ИМЯ"
-#: ../cli/src/connections.c:69 ../cli/src/connections.c:176
+#. 0
+#. 1
+#: ../clients/cli/connections.c:61 ../clients/cli/connections.c:174
msgid "UUID"
msgstr "UUID"
-#: ../cli/src/connections.c:70 ../cli/src/connections.c:201
-#: ../cli/src/devices.c:72 ../cli/src/devices.c:88 ../cli/src/devices.c:200
+#. 1
+#. 0
+#. 1
+#. 2
+#: ../clients/cli/connections.c:62 ../clients/cli/connections.c:195
+#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:59
+#: ../clients/cli/devices.c:173
msgid "TYPE"
msgstr "ТИП"
-#: ../cli/src/connections.c:71
+#. 2
+#: ../clients/cli/connections.c:63
msgid "TIMESTAMP"
msgstr "МЕТКРВРЕМЕÐИ"
-#: ../cli/src/connections.c:72
+#. 3
+#: ../clients/cli/connections.c:64
msgid "TIMESTAMP-REAL"
msgstr "ДЕЙСТВ. МЕТКРВРЕМЕÐИ"
-#: ../cli/src/connections.c:73 ../cli/src/devices.c:101
+#. 4
+#. 15
+#: ../clients/cli/connections.c:65 ../clients/cli/devices.c:73
msgid "AUTOCONNECT"
msgstr "ÐВТОПОДКЛЮЧЕÐИЕ"
-#: ../cli/src/connections.c:74
+#. 5
+#: ../clients/cli/connections.c:66
+#, fuzzy
+#| msgid "AUTOCONNECT"
+msgid "AUTOCONNECT-PRIORITY"
+msgstr "ÐВТОПОДКЛЮЧЕÐИЕ"
+
+#. 6
+#: ../clients/cli/connections.c:67
msgid "READONLY"
msgstr "ТОЛЬКО ДЛЯ ЧТЕÐИЯ"
-#: ../cli/src/connections.c:75 ../cli/src/connections.c:183
-#: ../cli/src/devices.c:74 ../cli/src/devices.c:187 ../cli/src/devices.c:203
+#. 7
+#. 8
+#. 2
+#. 15
+#. 5
+#: ../clients/cli/connections.c:68 ../clients/cli/connections.c:181
+#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:160
+#: ../clients/cli/devices.c:176
msgid "DBUS-PATH"
msgstr "DBUS-PATH"
-#: ../cli/src/connections.c:177
-msgid "DEVICES"
-msgstr "УСТРОЙСТВÐ"
+#. 8
+#. 13
+#. 4
+#: ../clients/cli/connections.c:69 ../clients/cli/devices.c:158
+#: ../clients/cli/devices.c:175
+msgid "ACTIVE"
+msgstr "ÐКТИВЕÐ"
+
+#. 9
+#. 0
+#. 12
+#. 3
+#: ../clients/cli/connections.c:70 ../clients/cli/devices.c:42
+#: ../clients/cli/devices.c:58 ../clients/cli/devices.c:157
+#: ../clients/cli/devices.c:174
+msgid "DEVICE"
+msgstr "УСТРОЙСТВО"
-#: ../cli/src/connections.c:178 ../cli/src/devices.c:73
-#: ../cli/src/devices.c:96 ../cli/src/network-manager.c:39
+#. 10
+#. 3
+#. 1
+#. 9
+#. 1
+#: ../clients/cli/connections.c:71 ../clients/cli/connections.c:176
+#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:67
+#: ../clients/cli/general.c:37
msgid "STATE"
msgstr "СОСТОЯÐИЕ"
-#: ../cli/src/connections.c:179
+#. 11
+#: ../clients/cli/connections.c:72
+#, fuzzy
+#| msgid "MASTER-PATH"
+msgid "ACTIVE-PATH"
+msgstr "ÐœÐСТЕР-ПУТЬ"
+
+#. 2
+#: ../clients/cli/connections.c:175
+msgid "DEVICES"
+msgstr "УСТРОЙСТВÐ"
+
+#. 4
+#: ../clients/cli/connections.c:177
msgid "DEFAULT"
msgstr "ПО УМОЛЧÐÐИЮ"
-#: ../cli/src/connections.c:180
+#. 5
+#: ../clients/cli/connections.c:178
msgid "DEFAULT6"
msgstr "ПО УМОЛЧÐÐИЮ 6"
-#: ../cli/src/connections.c:181
+#. 6
+#: ../clients/cli/connections.c:179
msgid "SPEC-OBJECT"
msgstr "SPEC-OBJECT"
-#: ../cli/src/connections.c:182 ../cli/src/connections.c:224
-#: ../tui/nm-editor-utils.c:243 ../tui/nmt-connect-connection-list.c:343
+#. 7
+#. 4
+#. Ask for optional 'vpn' arguments.
+#: ../clients/cli/connections.c:180 ../clients/cli/connections.c:218
+#: ../clients/cli/connections.c:3984 ../clients/tui/nm-editor-utils.c:234
+#: ../clients/tui/nmt-connect-connection-list.c:406
msgid "VPN"
msgstr "VPN"
-#: ../cli/src/connections.c:184 ../cli/src/devices.c:77
-#: ../cli/src/devices.c:105
+#. 9
+#. 5
+#. 19
+#: ../clients/cli/connections.c:182 ../clients/cli/devices.c:48
+#: ../clients/cli/devices.c:77
msgid "CON-PATH"
msgstr "ПУТЬ ПОДКЛЮЧЕÐИЯ"
-#: ../cli/src/connections.c:185
+#. 10
+#: ../clients/cli/connections.c:183
msgid "ZONE"
msgstr "ЗОÐÐ"
-#: ../cli/src/connections.c:186
+#. 11
+#: ../clients/cli/connections.c:184
msgid "MASTER-PATH"
msgstr "ÐœÐСТЕР-ПУТЬ"
-#: ../cli/src/connections.c:202
+#. 1
+#: ../clients/cli/connections.c:196
msgid "USERNAME"
msgstr "ИМЯ_ПОЛЬЗОВÐТЕЛЯ"
-#: ../cli/src/connections.c:203
-msgid "GATEWAY"
-msgstr "ШЛЮЗ"
-
-#: ../cli/src/connections.c:204
+#. 3
+#: ../clients/cli/connections.c:198
msgid "BANNER"
msgstr "БÐÐÐЕР"
-#: ../cli/src/connections.c:205
+#. 4
+#: ../clients/cli/connections.c:199
msgid "VPN-STATE"
msgstr "СТÐТУС VPN"
-#: ../cli/src/connections.c:206
+#. 5
+#: ../clients/cli/connections.c:200
msgid "CFG"
msgstr "CFG"
-#: ../cli/src/connections.c:219 ../cli/src/devices.c:236
+#: ../clients/cli/connections.c:213 ../clients/cli/devices.c:219
msgid "GENERAL"
msgstr "ОБЩИЕ"
-#: ../cli/src/connections.c:220 ../cli/src/devices.c:243
+#. 0
+#. 6
+#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:226
msgid "IP4"
msgstr "IP4"
-#: ../cli/src/connections.c:221 ../cli/src/devices.c:244
+#. 1
+#. 7
+#: ../clients/cli/connections.c:215 ../clients/cli/devices.c:227
msgid "DHCP4"
msgstr "DHCP4"
-#: ../cli/src/connections.c:222 ../cli/src/devices.c:245
+#. 2
+#. 8
+#: ../clients/cli/connections.c:216 ../clients/cli/devices.c:228
msgid "IP6"
msgstr "IP6"
-#: ../cli/src/connections.c:223 ../cli/src/devices.c:246
+#. 3
+#. 9
+#: ../clients/cli/connections.c:217 ../clients/cli/devices.c:229
msgid "DHCP6"
msgstr "DHCP6"
-#: ../cli/src/connections.c:255
-#, c-format
+#: ../clients/cli/connections.c:251
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: nmcli connection { COMMAND | help }\n"
+#| "\n"
+#| "COMMAND := { show | up | down | add | modify | edit | delete | reload | "
+#| "load }\n"
+#| "\n"
+#| " show configured [[id | uuid | path] <ID>]\n"
+#| " show active [[id | uuid | path | apath] <ID>]\n"
+#| "\n"
+#| " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp "
+#| "<name>]\n"
+#| "\n"
+#| " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n"
+#| "\n"
+#| " down [id | uuid | path | apath] <ID>\n"
+#| "\n"
+#| " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
+#| "\n"
+#| " modify [id | uuid | path] <ID> <setting>.<property> <value>\n"
+#| "\n"
+#| " edit [id | uuid | path] <ID>\n"
+#| " edit [type <new_con_type>] [con-name <new_con_name>]\n"
+#| "\n"
+#| " delete [id | uuid | path] <ID>\n"
+#| "\n"
+#| " reload\n"
+#| "\n"
+#| " load <filename> [ <filename>... ]\n"
+#| "\n"
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 | reload | "
+"load }\n"
"\n"
-" show configured [[id | uuid | path] <ID>]\n"
-" show active [[id | uuid | path | apath] <ID>]\n"
+" show [--active] [--order <order spec>]\n"
+" show [--active] [--show-secrets] [id | uuid | path | apath] <ID> ...\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] "
+"[passwd-file <file with passwords>]\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file "
+"<file with passwords>]\n"
"\n"
-" down [id | uuid | path | apath] <ID>\n"
+" down [id | uuid | path | apath] <ID> ...\n"
"\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
"\n"
-" modify [id | uuid | path] <ID> <setting>.<property> <value>\n"
+" modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> "
+"<value>)+\n"
"\n"
" edit [id | uuid | path] <ID>\n"
" edit [type <new_con_type>] [con-name <new_con_name>]\n"
@@ -590,8 +823,8 @@ msgid ""
msgstr ""
"Формат: nmcli connection { КОМÐÐДР| help }\n"
"\n"
-"КОМÐÐДР:= { show | up | down | add | modify | edit | delete | reload | load "
-"}\n"
+"КОМÐÐДР:= { show | up | down | add | modify | edit | delete | reload | "
+"load }\n"
"\n"
" show configured [[id | uuid | путь] <ID>]\n"
" show active [[id | uuid | путь | абÑ.путь] <ID>]\n"
@@ -616,62 +849,74 @@ msgstr ""
" load <файл> [ <файл>... ]\n"
"\n"
-#: ../cli/src/connections.c:278
+#: ../clients/cli/connections.c:273
#, c-format
msgid ""
"Usage: nmcli connection show { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := active [[id | uuid | path | apath] <ID>]\n"
-"\n"
-"Show connections which are currently used by a device to connect to a "
-"network.\n"
-"Without a parameter, all active connections are listed. When <ID> is "
-"provided,\n"
-"the connection details are displayed instead.\n"
-"\n"
-"ARGUMENTS := configured [[id | uuid | path] <ID>]\n"
-"\n"
-"Show in-memory and on-disk connections, some of which may also be active if\n"
-"a device is using that connection profile. Without a parameter, all profiles\n"
-"are listed. When <ID> is provided, the profile details are displayed instead."
-"\n"
-"\n"
+"ARGUMENTS := [--active] [--order <order spec>]\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. --order allows custom connection ordering (see manual "
+"page).\n"
+"\n"
+"ARGUMENTS := [--active] [--show-secrets] [id | uuid | path | apath] "
+"<ID> ...\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"
msgstr ""
-"Формат: nmcli connection show { ÐРГУМЕÐТЫ | help }\n"
-"\n"
-"ÐРГУМЕÐТЫ := active [[id | uuid | path | apath] <ID>]\n"
-"\n"
-"Показывает ÑпиÑок Ñоединений.\n"
-"ЕÑли параметры не указаны, команда вернет вÑе активные ÑоединениÑ.\n"
-"ЕÑли указан идентификатор, будет показана Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ его Ñоединении.\n"
-"\n"
-"ÐРГУМЕÐТЫ := configured [[id | uuid | path] <ID>]\n"
-"\n"
-"Показывает наÑтроенные ÑоединениÑ, которые могут быть активны,\n"
-"еÑли уÑтройÑтво иÑпользует ÑоответÑтвующий профиль ÑоединениÑ.\n"
-"ЕÑли параметры не указаны, команда вернет вÑе профили.\n"
-"ЕÑли указан идентификатор, будет показаны ÑÐ²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾ его профиле.\n"
-#: ../cli/src/connections.c:297
-#, c-format
+#: ../clients/cli/connections.c:294
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: nmcli connection up { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
+#| "<name>]\n"
+#| "\n"
+#| "Activate a connection on a device. The profile to activate is identified "
+#| "by its\n"
+#| "name, UUID or D-Bus path.\n"
+#| "\n"
+#| "ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+#| "\n"
+#| "Activate a device with a connection. The connection profile is selected\n"
+#| "automatically by NetworkManager.\n"
+#| "\n"
+#| "ifname - specifies the device to active the connection on\n"
+#| "ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+#| "nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+#| "\n"
msgid ""
"Usage: nmcli connection up { ARGUMENTS | help }\n"
"\n"
"ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
-"<name>]\n"
+"<name>] [passwd-file <file with passwords>]\n"
"\n"
"Activate a connection on a device. The profile to activate is identified by "
"its\n"
"name, UUID or D-Bus path.\n"
"\n"
-"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd-file <file "
+"with passwords>]\n"
"\n"
"Activate a device with a connection. The connection profile is selected\n"
"automatically by NetworkManager.\n"
"\n"
-"ifname - specifies the device to active the connection on\n"
-"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
-"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"ifname - specifies the device to active the connection on\n"
+"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"passwd-file - file with password(s) required to activate the connection\n"
"\n"
msgstr ""
"Формат: nmcli connection up { ÐРГУМЕÐТЫ | help }\n"
@@ -692,12 +937,23 @@ msgstr ""
"nsp — NSP (только Ð´Ð»Ñ WiMAX)\n"
"\n"
-#: ../cli/src/connections.c:318
-#, c-format
+#: ../clients/cli/connections.c:315
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: nmcli connection down { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+#| "\n"
+#| "Deactivate a connection from a device (without preventing the device "
+#| "from\n"
+#| "further auto-activation). The profile to deactivate is identified by its "
+#| "name,\n"
+#| "UUID or D-Bus path.\n"
+#| "\n"
msgid ""
"Usage: nmcli connection down { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+"ARGUMENTS := [id | uuid | path | apath] <ID> ...\n"
"\n"
"Deactivate a connection from a device (without preventing the device from\n"
"further auto-activation). The profile to deactivate is identified by its "
@@ -709,14 +965,108 @@ msgstr ""
"\n"
"ÐРГУМЕÐТЫ := [id | uuid | path | apath] <ID>\n"
"\n"
-"Отключение ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ ÑƒÑтройÑтвом, не Ð¾Ð³Ñ€Ð°Ð½Ð¸Ñ‡Ð¸Ð²Ð°Ñ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ðµ в дальнейшем."
-"\n"
+"Отключение ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ ÑƒÑтройÑтвом, не Ð¾Ð³Ñ€Ð°Ð½Ð¸Ñ‡Ð¸Ð²Ð°Ñ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ðµ в "
+"дальнейшем.\n"
"Профиль определÑетÑÑ Ð¿Ð¾ имени, UUID или пути D-Bus.\n"
"\n"
"\n"
-#: ../cli/src/connections.c:331
-#, c-format
+#: ../clients/cli/connections.c:327
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: nmcli connection add { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
+#| "\n"
+#| " COMMON_OPTIONS:\n"
+#| " type <type>\n"
+#| " ifname <interface name> | \"*\"\n"
+#| " [con-name <connection name>]\n"
+#| " [autoconnect yes|no]\n"
+#| "\n"
+#| " TYPE_SPECIFIC_OPTIONS:\n"
+#| " ethernet: [mac <MAC address>]\n"
+#| " [cloned-mac <cloned MAC address>]\n"
+#| " [mtu <MTU>]\n"
+#| "\n"
+#| " wifi: ssid <SSID>\n"
+#| " [mac <MAC address>]\n"
+#| " [cloned-mac <cloned MAC address>]\n"
+#| " [mtu <MTU>]\n"
+#| "\n"
+#| " wimax: [mac <MAC address>]\n"
+#| " [nsp <NSP>]\n"
+#| "\n"
+#| " pppoe: username <PPPoE username>\n"
+#| " [password <PPPoE password>]\n"
+#| " [service <PPPoE service name>]\n"
+#| " [mtu <MTU>]\n"
+#| " [mac <MAC address>]\n"
+#| "\n"
+#| " gsm: apn <APN>\n"
+#| " [user <username>]\n"
+#| " [password <password>]\n"
+#| "\n"
+#| " cdma: [user <username>]\n"
+#| " [password <password>]\n"
+#| "\n"
+#| " infiniband: [mac <MAC address>]\n"
+#| " [mtu <MTU>]\n"
+#| " [transport-mode datagram | connected]\n"
+#| " [parent <ifname>]\n"
+#| " [p-key <IPoIB P_Key>]\n"
+#| "\n"
+#| " bluetooth: [addr <bluetooth address>]\n"
+#| " [bt-type panu|dun-gsm|dun-cdma]\n"
+#| "\n"
+#| " vlan: dev <parent device (connection UUID, ifname, or MAC)>\n"
+#| " id <VLAN ID>\n"
+#| " [flags <VLAN flags>]\n"
+#| " [ingress <ingress priority mapping>]\n"
+#| " [egress <egress priority mapping>]\n"
+#| " [mtu <MTU>]\n"
+#| "\n"
+#| " bond: [mode balance-rr (0) | active-backup (1) | balance-xor "
+#| "(2) | broadcast (3) |\n"
+#| " 802.3ad (4) | balance-tlb (5) | balance-alb "
+#| "(6)]\n"
+#| " [primary <ifname>]\n"
+#| " [miimon <num>]\n"
+#| " [downdelay <num>]\n"
+#| " [updelay <num>]\n"
+#| " [arp-interval <num>]\n"
+#| " [arp-ip-target <num>]\n"
+#| "\n"
+#| " bond-slave: master <master (ifname or connection UUID)>\n"
+#| "\n"
+#| " team: [config <file>|<raw JSON data>]\n"
+#| "\n"
+#| " team-slave: master <master (ifname or connection UUID)>\n"
+#| " [config <file>|<raw JSON data>]\n"
+#| "\n"
+#| " bridge: [stp yes|no]\n"
+#| " [priority <num>]\n"
+#| " [forward-delay <2-30>]\n"
+#| " [hello-time <1-10>]\n"
+#| " [max-age <6-40>]\n"
+#| " [ageing-time <0-1000000>]\n"
+#| "\n"
+#| " bridge-slave: master <master (ifname or connection UUID)>\n"
+#| " [priority <0-63>]\n"
+#| " [path-cost <1-65535>]\n"
+#| " [hairpin yes|no]\n"
+#| "\n"
+#| " vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan\n"
+#| " [user <username>]\n"
+#| "\n"
+#| " olpc-mesh: ssid <SSID>\n"
+#| " [channel <1-13>]\n"
+#| " [dhcp-anycast <MAC address>]\n"
+#| "\n"
+#| " IP_OPTIONS:\n"
+#| " [ip4 <IPv4 address>] [gw4 <IPv4 gateway>]\n"
+#| " [ip6 <IPv6 address>] [gw6 <IPv6 gateway>]\n"
+#| "\n"
msgid ""
"Usage: nmcli connection add { ARGUMENTS | help }\n"
"\n"
@@ -728,6 +1078,8 @@ msgid ""
" [con-name <connection name>]\n"
" [autoconnect yes|no]\n"
"\n"
+" [save yes|no]\n"
+"\n"
" TYPE_SPECIFIC_OPTIONS:\n"
" ethernet: [mac <MAC address>]\n"
" [cloned-mac <cloned MAC address>]\n"
@@ -737,6 +1089,7 @@ msgid ""
" [mac <MAC address>]\n"
" [cloned-mac <cloned MAC address>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <MAC address>]\n"
" [nsp <NSP>]\n"
@@ -780,12 +1133,13 @@ msgid ""
" [updelay <num>]\n"
" [arp-interval <num>]\n"
" [arp-ip-target <num>]\n"
+" [lacp-rate slow (0) | fast (1)]\n"
"\n"
-" bond-slave: master <master (ifname or connection UUID)>\n"
+" bond-slave: master <master (ifname, or connection UUID or name)>\n"
"\n"
" team: [config <file>|<raw JSON data>]\n"
"\n"
-" team-slave: master <master (ifname or connection UUID)>\n"
+" team-slave: master <master (ifname, or connection UUID or name)>\n"
" [config <file>|<raw JSON data>]\n"
"\n"
" bridge: [stp yes|no]\n"
@@ -794,13 +1148,16 @@ msgid ""
" [hello-time <1-10>]\n"
" [max-age <6-40>]\n"
" [ageing-time <0-1000000>]\n"
+" [multicast-snooping yes|no]\n"
+" [mac <MAC address>]\n"
"\n"
-" bridge-slave: master <master (ifname or connection UUID)>\n"
+" bridge-slave: master <master (ifname, or connection UUID or name)>\n"
" [priority <0-63>]\n"
" [path-cost <1-65535>]\n"
" [hairpin yes|no]\n"
"\n"
-" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan\n"
+" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|"
+"ssh|l2tp|iodine|...\n"
" [user <username>]\n"
"\n"
" olpc-mesh: ssid <SSID>\n"
@@ -907,27 +1264,32 @@ msgstr ""
" [ip6 <Ð°Ð´Ñ€ÐµÑ IPv6>] [gw6 <шлюз IPv6>]\n"
"\n"
-#: ../cli/src/connections.c:408
+#: ../clients/cli/connections.c:408
#, c-format
msgid ""
"Usage: nmcli connection modify { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := [id | uuid | path] <ID> <setting name>.<property name> "
-"[<value>]\n"
+"ARGUMENTS := [id | uuid | path] <ID> ([+|-]<setting>.<property> <value>)+\n"
"\n"
-"Modify a single property in the connection profile.\n"
-"The profile is identified by its name, UUID or D-Bus path.\n"
-"\n"
-msgstr ""
-"Формат: nmcli connection modify { ÐРГУМЕÐТЫ | help }\n"
+"Modify one or more properties of the connection profile.\n"
+"The profile is identified by its name, UUID or D-Bus path. For multi-valued\n"
+"properties you can use optional '+' or '-' prefix to the property name.\n"
+"The '+' sign allows appending items instead of overwriting the whole value.\n"
+"The '-' sign allows removing selected items instead of the whole value.\n"
"\n"
-"ÐРГУМЕÐТЫ := [id | uuid | путь] <ID> <параметр>.<ÑвойÑтво> [<защита>]\n"
-"\n"
-"Изменение ÑвойÑтва в профиле ÑоединениÑ. \n"
-"Профиль определÑетÑÑ Ð¿Ð¾ имени, UUID или пути D-Bus.\n"
+"Examples:\n"
+"nmcli con mod home-wifi wifi.ssid rakosnicek\n"
+"nmcli con mod em1-1 ipv4.method manual ipv4.addr \"192.168.1.2/24, "
+"10.10.1.5/8\"\n"
+"nmcli con mod em1-1 +ipv4.dns 8.8.4.4\n"
+"nmcli con mod em1-1 -ipv4.dns 1\n"
+"nmcli con mod em1-1 -ipv6.addr \"abbe::cafe/56\"\n"
+"nmcli con mod bond0 +bond.options mii=500\n"
+"nmcli con mod bond0 -bond.options downdelay\n"
"\n"
+msgstr ""
-#: ../cli/src/connections.c:420
+#: ../clients/cli/connections.c:431
#, c-format
msgid ""
"Usage: nmcli connection edit { ARGUMENTS | help }\n"
@@ -954,7 +1316,7 @@ msgstr ""
"Добавление нового Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð² интерактивном редакторе.\n"
"\n"
-#: ../cli/src/connections.c:436
+#: ../clients/cli/connections.c:446
#, c-format
msgid ""
"Usage: nmcli connection delete { ARGUMENTS | help }\n"
@@ -973,7 +1335,7 @@ msgstr ""
"Профиль определÑетÑÑ Ð¿Ð¾ имени, UUID или пути D-Bus.\n"
"\n"
-#: ../cli/src/connections.c:448
+#: ../clients/cli/connections.c:457
#, c-format
msgid ""
"Usage: nmcli connection reload { help }\n"
@@ -986,7 +1348,7 @@ msgstr ""
"Перезагрузка файлов Ñоединений Ñ Ð´Ð¸Ñка.\n"
"\n"
-#: ../cli/src/connections.c:457
+#: ../clients/cli/connections.c:465
#, c-format
msgid ""
"Usage: nmcli connection load { ARGUMENTS | help }\n"
@@ -1008,926 +1370,1094 @@ msgstr ""
"\n"
"\n"
-#: ../cli/src/connections.c:515
-#, c-format
-msgid "Error: 'list configured': %s"
-msgstr "Ошибка «list configured»: %s"
-
-#: ../cli/src/connections.c:523
-msgid "Connection details"
-msgstr "СвойÑтва подключениÑ"
-
-#: ../cli/src/connections.c:589
-msgid "never"
-msgstr "никогда"
-
-#: ../cli/src/connections.c:590 ../cli/src/connections.c:591
-#: ../cli/src/connections.c:833 ../cli/src/connections.c:834
-#: ../cli/src/connections.c:836 ../cli/src/connections.c:6112
-#: ../cli/src/devices.c:604 ../cli/src/devices.c:654 ../cli/src/devices.c:796
-#: ../cli/src/devices.c:797 ../cli/src/devices.c:798 ../cli/src/devices.c:831
-#: ../cli/src/devices.c:860 ../cli/src/devices.c:861 ../cli/src/devices.c:862
-#: ../cli/src/devices.c:863 ../cli/src/devices.c:864 ../cli/src/devices.c:865
-#: ../cli/src/devices.c:866 ../cli/src/network-manager.c:442
-msgid "yes"
-msgstr "да"
-
-#: ../cli/src/connections.c:590 ../cli/src/connections.c:591
-#: ../cli/src/connections.c:833 ../cli/src/connections.c:834
-#: ../cli/src/connections.c:836 ../cli/src/connections.c:6112
-#: ../cli/src/devices.c:604 ../cli/src/devices.c:654 ../cli/src/devices.c:796
-#: ../cli/src/devices.c:797 ../cli/src/devices.c:798 ../cli/src/devices.c:831
-#: ../cli/src/devices.c:860 ../cli/src/devices.c:861 ../cli/src/devices.c:862
-#: ../cli/src/devices.c:863 ../cli/src/devices.c:864 ../cli/src/devices.c:865
-#: ../cli/src/devices.c:866 ../cli/src/network-manager.c:444
-msgid "no"
-msgstr "нет"
-
-#: ../cli/src/connections.c:667
-msgid "List of configured connections"
-msgstr "СпиÑок наÑтроенных Ñоединений"
-
-#: ../cli/src/connections.c:684 ../cli/src/connections.c:1225
-#: ../cli/src/connections.c:1785 ../cli/src/connections.c:1801
-#: ../cli/src/connections.c:1810 ../cli/src/connections.c:1820
-#: ../cli/src/connections.c:1916 ../cli/src/connections.c:7563
-#: ../cli/src/connections.c:7738 ../cli/src/devices.c:1633
-#: ../cli/src/devices.c:1641 ../cli/src/devices.c:2028
-#: ../cli/src/devices.c:2035 ../cli/src/devices.c:2049
-#: ../cli/src/devices.c:2056 ../cli/src/devices.c:2073
-#: ../cli/src/devices.c:2081 ../cli/src/devices.c:2277
-#: ../cli/src/devices.c:2373 ../cli/src/devices.c:2380
-#, c-format
-msgid "Error: %s argument is missing."
-msgstr "Ошибка: отÑутÑтвует аргумент %s."
-
-#: ../cli/src/connections.c:698
-#, c-format
-msgid "Error: %s - no such connection."
-msgstr "Ошибка: неизвеÑтное подключение %s."
-
-#: ../cli/src/connections.c:710
-#, c-format
-msgid "Error: 'show configured': %s"
-msgstr "Ошибка «show configured»: %s"
-
-#: ../cli/src/connections.c:715 ../cli/src/connections.c:1853
-#: ../cli/src/connections.c:7804 ../cli/src/connections.c:7845
-#: ../cli/src/connections.c:7997 ../cli/src/devices.c:2256
-#: ../cli/src/devices.c:2630 ../cli/src/network-manager.c:539
-#: ../cli/src/network-manager.c:582 ../cli/src/network-manager.c:599
-#: ../cli/src/network-manager.c:645 ../cli/src/network-manager.c:659
-#: ../cli/src/network-manager.c:776 ../cli/src/network-manager.c:820
-#: ../cli/src/network-manager.c:840
-#, c-format
-msgid "Error: %s."
-msgstr "Ошибка: %s."
-
-#: ../cli/src/connections.c:728
+#: ../clients/cli/connections.c:536
msgid "activating"
msgstr "активациÑ"
-#: ../cli/src/connections.c:730
+#: ../clients/cli/connections.c:538
msgid "activated"
msgstr "включено"
-#: ../cli/src/connections.c:734
+#: ../clients/cli/connections.c:542
msgid "deactivated"
msgstr "отключено"
-#: ../cli/src/connections.c:746
+#: ../clients/cli/connections.c:554
msgid "VPN connecting (prepare)"
msgstr "Подключение VPN (подготовка)"
-#: ../cli/src/connections.c:748
+#: ../clients/cli/connections.c:556
msgid "VPN connecting (need authentication)"
msgstr "Подключение VPN (требуетÑÑ Ð°ÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ)"
-#: ../cli/src/connections.c:750
+#: ../clients/cli/connections.c:558
msgid "VPN connecting"
msgstr "Подключение VPN"
-#: ../cli/src/connections.c:752
+#: ../clients/cli/connections.c:560
msgid "VPN connecting (getting IP configuration)"
msgstr "Подключение VPN (получение конфигурации IP)"
-#: ../cli/src/connections.c:754
+#: ../clients/cli/connections.c:562
msgid "VPN connected"
msgstr "VPN подключён"
-#: ../cli/src/connections.c:756
+#: ../clients/cli/connections.c:564
msgid "VPN connection failed"
msgstr "Сбой Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ VPN"
-#: ../cli/src/connections.c:758
+#: ../clients/cli/connections.c:566
msgid "VPN disconnected"
msgstr "VPN отключён"
-#: ../cli/src/connections.c:829 ../cli/src/connections.c:839
-#: ../cli/src/devices.c:594
-msgid "N/A"
-msgstr "Ð/Д"
+#: ../clients/cli/connections.c:636
+#, fuzzy, c-format
+#| msgid "Error saving connection: %s"
+msgid "Error updating secrets for %s: %s\n"
+msgstr "Ошибка при Ñохранении ÑоединениÑ: %s"
-#: ../cli/src/connections.c:1012
-#, c-format
-msgid "Error: 'list active': %s"
-msgstr "Ошибка «list active»: %s"
+#: ../clients/cli/connections.c:656
+#, fuzzy
+#| msgid "Connection details"
+msgid "Connection profile details"
+msgstr "СвойÑтва подключениÑ"
+
+#: ../clients/cli/connections.c:668 ../clients/cli/connections.c:1061
+#, fuzzy, c-format
+#| msgid "Error: 'device show': %s"
+msgid "Error: 'connection show': %s"
+msgstr "Ошибка «device show»: %s"
+
+#: ../clients/cli/connections.c:824
+msgid "never"
+msgstr "никогда"
+
+#. "CAPABILITIES"
+#: ../clients/cli/connections.c:825 ../clients/cli/connections.c:827
+#: ../clients/cli/connections.c:829 ../clients/cli/connections.c:863
+#: ../clients/cli/connections.c:932 ../clients/cli/connections.c:933
+#: ../clients/cli/connections.c:935 ../clients/cli/connections.c:3265
+#: ../clients/cli/connections.c:7123 ../clients/cli/connections.c:7124
+#: ../clients/cli/devices.c:644 ../clients/cli/devices.c:701
+#: ../clients/cli/devices.c:908 ../clients/cli/devices.c:909
+#: ../clients/cli/devices.c:910 ../clients/cli/devices.c:911
+#: ../clients/cli/devices.c:944 ../clients/cli/devices.c:946
+#: ../clients/cli/devices.c:974 ../clients/cli/devices.c:975
+#: ../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/general.c:472
+#: ../clients/cli/settings.c:1542
+msgid "yes"
+msgstr "да"
+
+#: ../clients/cli/connections.c:825 ../clients/cli/connections.c:827
+#: ../clients/cli/connections.c:829 ../clients/cli/connections.c:932
+#: ../clients/cli/connections.c:933 ../clients/cli/connections.c:935
+#: ../clients/cli/connections.c:3266 ../clients/cli/connections.c:7123
+#: ../clients/cli/connections.c:7124 ../clients/cli/devices.c:644
+#: ../clients/cli/devices.c:701 ../clients/cli/devices.c:908
+#: ../clients/cli/devices.c:909 ../clients/cli/devices.c:910
+#: ../clients/cli/devices.c:911 ../clients/cli/devices.c:944
+#: ../clients/cli/devices.c:946 ../clients/cli/devices.c:974
+#: ../clients/cli/devices.c:975 ../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/general.c:474 ../clients/cli/settings.c:1540
+msgid "no"
+msgstr "нет"
-#: ../cli/src/connections.c:1020
-msgid "Active connection details"
+#: ../clients/cli/connections.c:1049
+#, fuzzy
+#| msgid "Active connection details"
+msgid "Activate connection details"
msgstr "Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± активном Ñоединении"
-#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1840
-#: ../cli/src/connections.c:1899 ../cli/src/connections.c:7592
-#: ../cli/src/connections.c:7707 ../cli/src/connections.c:7798
-#: ../cli/src/connections.c:7826 ../cli/src/devices.c:1197
-#: ../cli/src/devices.c:1245 ../cli/src/devices.c:1403
-#: ../cli/src/devices.c:1538 ../cli/src/devices.c:1675
-#: ../cli/src/devices.c:2115 ../cli/src/devices.c:2414
-#: ../cli/src/network-manager.c:484
-#, c-format
-msgid "Error: NetworkManager is not running."
-msgstr "Ошибка: NetworkManager не запущен."
+#: ../clients/cli/connections.c:1285
+#, fuzzy, c-format
+#| msgid "invalid field '%s'; allowed fields: %s"
+msgid "invalid field '%s'; allowed fields: %s and %s, or %s,%s"
+msgstr "неверное поле «%s»; допуÑтимые полÑ: %s"
+
+#: ../clients/cli/connections.c:1300 ../clients/cli/connections.c:1308
+#, fuzzy, c-format
+#| msgid "field '%s' has to be alone"
+msgid "'%s' has to be alone"
+msgstr "поле «%s» должно быть единÑтвенным"
+
+#. Add headers
+#: ../clients/cli/connections.c:1525
+#, fuzzy
+#| msgid "NetworkManager status"
+msgid "NetworkManager active profiles"
+msgstr "СоÑтоÑние NetworkManager"
-#: ../cli/src/connections.c:1203
-msgid "List of active connections"
-msgstr "СпиÑок активных Ñоединений"
+#: ../clients/cli/connections.c:1526
+#, fuzzy
+#| msgid "NetworkManager went to sleep"
+msgid "NetworkManager connection profiles"
+msgstr "NetworkManager перешёл в ÑпÑщий режим"
-#: ../cli/src/connections.c:1239 ../cli/src/connections.c:1926
+#: ../clients/cli/connections.c:1572 ../clients/cli/connections.c:2299
+#: ../clients/cli/connections.c:2321 ../clients/cli/connections.c:2330
+#: ../clients/cli/connections.c:2340 ../clients/cli/connections.c:2350
+#: ../clients/cli/connections.c:2500 ../clients/cli/connections.c:8678
+#: ../clients/cli/connections.c:8895 ../clients/cli/devices.c:1985
+#: ../clients/cli/devices.c:1993 ../clients/cli/devices.c:2309
+#: ../clients/cli/devices.c:2316 ../clients/cli/devices.c:2330
+#: ../clients/cli/devices.c:2337 ../clients/cli/devices.c:2354
+#: ../clients/cli/devices.c:2362 ../clients/cli/devices.c:2550
+#: ../clients/cli/devices.c:2646 ../clients/cli/devices.c:2653
#, c-format
-msgid "Error: '%s' is not an active connection."
-msgstr "Ошибка: «%s» не ÑвлÑетÑÑ Ð°ÐºÑ‚Ð¸Ð²Ð½Ñ‹Ð¼ Ñоединением."
+msgid "Error: %s argument is missing."
+msgstr "Ошибка: отÑутÑтвует аргумент %s."
-#: ../cli/src/connections.c:1251
+#: ../clients/cli/connections.c:1587
+#, fuzzy, c-format
+#| msgid "Error: %s - no such connection."
+msgid "Error: %s - no such connection profile."
+msgstr "Ошибка: неизвеÑтное подключение %s."
+
+#: ../clients/cli/connections.c:1646 ../clients/cli/connections.c:2373
+#: ../clients/cli/connections.c:9269 ../clients/cli/devices.c:2529
+#: ../clients/cli/devices.c:2997 ../clients/cli/general.c:569
+#: ../clients/cli/general.c:618 ../clients/cli/general.c:635
+#: ../clients/cli/general.c:674 ../clients/cli/general.c:688
+#: ../clients/cli/general.c:806 ../clients/cli/general.c:853
+#: ../clients/cli/general.c:873
#, c-format
-msgid "Error: 'show active': %s"
-msgstr "Ошибка «show active»: %s"
+msgid "Error: %s."
+msgstr "Ошибка: %s."
-#: ../cli/src/connections.c:1344
+#: ../clients/cli/connections.c:1741
#, c-format
msgid "no active connection on device '%s'"
msgstr "на уÑтройÑтве «%s» нет активных Ñоединений"
-#: ../cli/src/connections.c:1352
+#: ../clients/cli/connections.c:1749
msgid "no active connection or device"
msgstr "на уÑтройÑтве нет активных Ñоединений"
-#: ../cli/src/connections.c:1423
+#: ../clients/cli/connections.c:1820
#, c-format
msgid "device '%s' not compatible with connection '%s'"
msgstr "уÑтройÑтво «%s» неÑовмеÑтимо Ñ Ñоединением «%s»"
-#: ../cli/src/connections.c:1426
+#: ../clients/cli/connections.c:1823
#, c-format
msgid "no device found for connection '%s'"
msgstr "не найдено уÑтройÑтво Ð´Ð»Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s»"
-#: ../cli/src/connections.c:1438
+#: ../clients/cli/connections.c:1835
msgid "unknown reason"
msgstr "неизвеÑÑ‚Ð½Ð°Ñ Ð¿Ñ€Ð¸Ñ‡Ð¸Ð½Ð°"
-#: ../cli/src/connections.c:1440 ../cli/src/network-manager.c:288
+#: ../clients/cli/connections.c:1837 ../clients/cli/general.c:292
msgid "none"
msgstr "нет"
-#: ../cli/src/connections.c:1442
+#: ../clients/cli/connections.c:1839
msgid "the user was disconnected"
msgstr "пользователь был отключён"
-#: ../cli/src/connections.c:1444
+#: ../clients/cli/connections.c:1841
msgid "the base network connection was interrupted"
msgstr "оÑновное Ñоединение Ñ Ñетью было разорвано"
-#: ../cli/src/connections.c:1446
+#: ../clients/cli/connections.c:1843
msgid "the VPN service stopped unexpectedly"
msgstr "Ñлужба VPN внезапно прекратила работу"
-#: ../cli/src/connections.c:1448
+#: ../clients/cli/connections.c:1845
msgid "the VPN service returned invalid configuration"
msgstr "Ñлужба VPN вернула недопуÑтимую конфигурацию"
-#: ../cli/src/connections.c:1450
+#: ../clients/cli/connections.c:1847
msgid "the connection attempt timed out"
msgstr "Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¸Ñтекло"
-#: ../cli/src/connections.c:1452
+#: ../clients/cli/connections.c:1849
msgid "the VPN service did not start in time"
msgstr "Ñлужба VPN не была запущена вовремÑ"
-#: ../cli/src/connections.c:1454
+#: ../clients/cli/connections.c:1851
msgid "the VPN service failed to start"
msgstr "не удалоÑÑŒ запуÑтить Ñлужбу VPN"
-#: ../cli/src/connections.c:1456
+#: ../clients/cli/connections.c:1853
msgid "no valid VPN secrets"
msgstr "нет верных Ñекретов VPN"
-#: ../cli/src/connections.c:1458
+#: ../clients/cli/connections.c:1855
msgid "invalid VPN secrets"
msgstr "неверные Ñекреты VPN"
-#: ../cli/src/connections.c:1460
+#: ../clients/cli/connections.c:1857
msgid "the connection was removed"
msgstr "Ñоединение удалено"
-#: ../cli/src/connections.c:1477 ../cli/src/connections.c:1633
-#: ../cli/src/connections.c:6016
+#: ../clients/cli/connections.c:1879 ../clients/cli/connections.c:1907
+#: ../clients/cli/connections.c:2068 ../clients/cli/connections.c:7014
#, c-format
msgid "Connection successfully activated (D-Bus active path: %s)\n"
msgstr "Соединение уÑпешно активировано (Ð°Ð´Ñ€ÐµÑ Ð´ÐµÐ¹Ñтвующего D-Bus: %s)\n"
-#: ../cli/src/connections.c:1482
+#: ../clients/cli/connections.c:1886
+#, fuzzy, c-format
+#| msgid "Connection successfully activated (D-Bus active path: %s)\n"
+msgid ""
+"Connection successfully activated (master waiting for slaves) (D-Bus active "
+"path: %s)\n"
+msgstr "Соединение уÑпешно активировано (Ð°Ð´Ñ€ÐµÑ Ð´ÐµÐ¹Ñтвующего D-Bus: %s)\n"
+
+#: ../clients/cli/connections.c:1890 ../clients/cli/connections.c:1912
#, c-format
msgid "Error: Connection activation failed."
msgstr "Ошибка: Ñбой активации ÑоединениÑ."
-#: ../cli/src/connections.c:1507
+#: ../clients/cli/connections.c:1963
#, c-format
msgid "VPN connection successfully activated (D-Bus active path: %s)\n"
msgstr "VPN-Ñоединение уÑпешно уÑтановлено (Ð°Ð´Ñ€ÐµÑ Ð´ÐµÐ¹Ñтвующего D-Bus: %s)\n"
-#: ../cli/src/connections.c:1514
+#: ../clients/cli/connections.c:1971
#, c-format
msgid "Error: Connection activation failed: %s."
msgstr "Ошибка: Ñбой активации ÑоединениÑ: %s."
-#: ../cli/src/connections.c:1532 ../cli/src/devices.c:1294
+#: ../clients/cli/connections.c:1990 ../clients/cli/devices.c:1397
#, c-format
msgid "Error: Timeout %d sec expired."
msgstr "Ошибка: превышено Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ (%d Ñ)."
-#: ../cli/src/connections.c:1597
+#: ../clients/cli/connections.c:2050
#, c-format
-msgid ""
-"Error: Device '%s' is waiting for slaves before proceeding with activation."
+msgid "Error: Connection activation failed: %s"
+msgstr "Ошибка: Ñбой активации ÑоединениÑ: %s"
+
+#: ../clients/cli/connections.c:2135
+#, fuzzy, c-format
+#| msgid "Error: failed to remove value of '%s': %s\n"
+msgid "failed to read passwd-file '%s': %s"
+msgstr "Ошибка. Ðе удалоÑÑŒ изменить значение «%s»: %s\n"
+
+#: ../clients/cli/connections.c:2147
+#, c-format
+msgid "missing colon in 'password' entry '%s'"
msgstr ""
-"Ошибка. Ð”Ð»Ñ Ð¿Ñ€Ð¾Ð´Ð¾Ð»Ð¶ÐµÐ½Ð¸Ñ Ð°ÐºÑ‚Ð¸Ð²Ð°Ñ†Ð¸Ð¸ уÑтройÑтва «%s» необходимо дождатьÑÑ ÐµÐ³Ð¾ "
-"подчиненных уÑтройÑтв."
-#: ../cli/src/connections.c:1617
+#: ../clients/cli/connections.c:2155
#, c-format
-msgid "Error: Connection activation failed: %s"
-msgstr "Ошибка: Ñбой активации ÑоединениÑ: %s"
+msgid "missing dot in 'password' entry '%s'"
+msgstr ""
-#: ../cli/src/connections.c:1722 ../cli/src/connections.c:1854
+#: ../clients/cli/connections.c:2168
+#, c-format
+msgid "invalid setting name in 'password' entry '%s'"
+msgstr ""
+
+#: ../clients/cli/connections.c:2215 ../clients/cli/connections.c:2374
msgid "unknown error"
msgstr "неизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°"
-#: ../cli/src/connections.c:1730
+#: ../clients/cli/connections.c:2224
#, c-format
msgid "unknown device '%s'."
msgstr "неизвеÑтное уÑтройÑтво «%s»"
-#: ../cli/src/connections.c:1735
+#: ../clients/cli/connections.c:2229
msgid "neither a valid connection nor device given"
msgstr "недейÑтвительное подключение или уÑтройÑтво не определено"
-#: ../cli/src/connections.c:1773 ../cli/src/connections.c:1884
-#: ../cli/src/connections.c:7714
-msgid "Connection (name, UUID, or path): "
-msgstr "Соединение (имÑ, UUID, путь):"
+#: ../clients/cli/connections.c:2312
+#, fuzzy, c-format
+#| msgid "Error: connection is not valid: %s\n"
+msgid "Error: Connection '%s' does not exist."
+msgstr "Ошибка. ÐедейÑтвительное Ñоединение: %s\n"
-#: ../cli/src/connections.c:1829 ../cli/src/devices.c:1171
-#: ../cli/src/devices.c:1647 ../cli/src/devices.c:2092
-#: ../cli/src/devices.c:2386
+#: ../clients/cli/connections.c:2358 ../clients/cli/devices.c:1296
+#: ../clients/cli/devices.c:1999 ../clients/cli/devices.c:2373
+#: ../clients/cli/devices.c:2659
#, c-format
msgid "Unknown parameter: %s\n"
msgstr "ÐеизвеÑтный параметр: %s\n"
-#: ../cli/src/connections.c:1862
+#: ../clients/cli/connections.c:2382
msgid "preparing"
msgstr "подготовка"
-#: ../cli/src/connections.c:1889 ../cli/src/connections.c:7719
-#: ../cli/src/connections.c:7832
+#: ../clients/cli/connections.c:2421
+#, fuzzy, c-format
+#| msgid "Connection successfully activated (D-Bus active path: %s)\n"
+msgid "Connection '%s' successfully deactivated (D-Bus active path: %s)\n"
+msgstr "Соединение уÑпешно активировано (Ð°Ð´Ñ€ÐµÑ Ð´ÐµÐ¹Ñтвующего D-Bus: %s)\n"
+
+#: ../clients/cli/connections.c:2479 ../clients/cli/connections.c:8876
+#: ../clients/cli/connections.c:8990
#, c-format
msgid "Error: No connection specified."
msgstr "Ошибка. Соединение не определено."
-#: ../cli/src/connections.c:2237 ../cli/src/utils.c:490
+#: ../clients/cli/connections.c:2510
+#, fuzzy, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: '%s' is not an active connection.\n"
+msgstr "Ошибка: «%s» не ÑвлÑетÑÑ Ð°ÐºÑ‚Ð¸Ð²Ð½Ñ‹Ð¼ Ñоединением."
+
+#: ../clients/cli/connections.c:2511
+#, fuzzy, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: not all active connections found."
+msgstr "Ошибка: «%s» не ÑвлÑетÑÑ Ð°ÐºÑ‚Ð¸Ð²Ð½Ñ‹Ð¼ Ñоединением."
+
+#: ../clients/cli/connections.c:2520
+#, fuzzy, c-format
+#| msgid "Error: %s - no such connection."
+msgid "Error: no active connection provided."
+msgstr "Ошибка: неизвеÑтное подключение %s."
+
+#: ../clients/cli/connections.c:2838 ../clients/cli/utils.c:609
#, c-format
msgid "'%s' not among [%s]"
msgstr "«%s» не входит в %s"
-#: ../cli/src/connections.c:2319
+#: ../clients/cli/connections.c:2917
#, c-format
msgid "Error: '%s': '%s' is not a valid %s MAC address."
msgstr "Ошибка. «%s»: «%s» не ÑвлÑетÑÑ Ð´ÐµÐ¹Ñтвительным %s MAC-адреÑом."
-#: ../cli/src/connections.c:2320 ../tui/nm-editor-utils.c:173
-#: ../tui/nm-ui-utils.c:347
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:2918 ../clients/cli/connections.c:3380
+#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1575
+#: ../libnm-glib/nm-device.c:1801 ../libnm/nm-device.c:1623
msgid "InfiniBand"
msgstr "InfiniBand"
-#: ../cli/src/connections.c:2320 ../tui/nm-editor-utils.c:156
-#: ../tui/nm-ui-utils.c:335
+#: ../clients/cli/connections.c:2918 ../clients/tui/nm-editor-utils.c:147
+#: ../libnm-glib/nm-device.c:1789 ../libnm/nm-device.c:1611
msgid "Ethernet"
msgstr "Ethernet"
-#: ../cli/src/connections.c:2343
+#: ../clients/cli/connections.c:2938
#, c-format
msgid "Error: 'mtu': '%s' is not a valid MTU."
msgstr "Ошибка «mtu». ÐедейÑтвительный MTU: «%s» "
-#: ../cli/src/connections.c:2359
+#: ../clients/cli/connections.c:2954
#, c-format
msgid "Error: 'parent': '%s' is not a valid interface name."
msgstr "Ошибка «parent». ÐедейÑтвительное Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа: «%s» "
-#: ../cli/src/connections.c:2380
+#: ../clients/cli/connections.c:2975
#, c-format
msgid "Error: 'p-key': '%s' is not a valid InfiniBand P_KEY."
msgstr "Ошибка «p-key». ÐедейÑтвительный InfiniBand P_KEY: «%s»"
-#: ../cli/src/connections.c:2396
-#, c-format
-msgid ""
-"Error: 'mode': '%s' is not a valid InfiniBand transport mode [datagram, "
-"connected]."
-msgstr ""
-"Ошибка «mode». ÐедейÑтвительный режим передачи InfiniBand: «%s» [датаграмма, "
-"подключено]."
+#: ../clients/cli/connections.c:3020
+#, fuzzy, c-format
+#| msgid "Error: '%s': '%s' is not valid; %s "
+msgid "Error: '%s': '%s' is not a valid %s %s."
+msgstr "Error: '%s': '%s' is not valid; %s "
+
+#: ../clients/cli/connections.c:3033
+#| msgid "Wi-Fi"
+msgid "Wi-Fi mode"
+msgstr "Режим Wi-Fi"
-#: ../cli/src/connections.c:2412
+#: ../clients/cli/connections.c:3042
+#, fuzzy
+#| msgid "Transport mode"
+msgid "InfiniBand transport mode"
+msgstr "ТранÑпортный режим"
+
+#: ../clients/cli/connections.c:3055
#, c-format
msgid "Error: 'flags': '%s' is not valid; use <0-7>."
-msgstr "Ошибка «flags». Ðеверное значение «%s». ДопуÑтимые значениÑ: <0-7>."
+msgstr "Ошибка «flags». Ðеверное значение «%s». ДопуÑтимые значениÑ: <0-7>."
-#: ../cli/src/connections.c:2434
+#: ../clients/cli/connections.c:3077
#, c-format
msgid "Error: '%s': '%s' is not valid; %s "
msgstr "Error: '%s': '%s' is not valid; %s "
-#: ../cli/src/connections.c:2541
+#: ../clients/cli/connections.c:3256
#, c-format
msgid "Error: '%s': '%s' is not valid; use <%u-%u>."
msgstr "Ошибка «%s». ÐедейÑтвительный «%s»: иÑпользуйте <%u-%u>."
-#: ../cli/src/connections.c:2555
+#. Ask for optional arguments.
+#: ../clients/cli/connections.c:3312
+#, fuzzy, c-format
+#| msgid "There is 1 optional argument for '%s' connection type.\n"
+msgid "There is %d optional argument for '%s' connection type.\n"
+msgid_plural "There are %d optional arguments for '%s' connection type.\n"
+msgstr[0] ""
+"При наÑтройке Ñоединений %s допуÑкаетÑÑ Ð¸Ñпользование одного дополнительного "
+"аргумента.\n"
+msgstr[1] ""
+"При наÑтройке Ñоединений %s допуÑкаетÑÑ Ð¸Ñпользование одного дополнительного "
+"аргумента.\n"
+msgstr[2] ""
+"При наÑтройке Ñоединений %s допуÑкаетÑÑ Ð¸Ñпользование одного дополнительного "
+"аргумента.\n"
+
+#: ../clients/cli/connections.c:3315
+#, fuzzy, c-format
+#| msgid "Do you want to provide it? (yes/no) [yes] "
+msgid "Do you want to provide it? %s"
+msgid_plural "Do you want to provide them? %s"
+msgstr[0] "Хотите его определить? (Да, нет) [да]"
+msgstr[1] "Хотите его определить? (Да, нет) [да]"
+msgstr[2] "Хотите его определить? (Да, нет) [да]"
+
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3332
msgid "ethernet"
msgstr "ethernet"
-#: ../cli/src/connections.c:2555 ../tui/nm-editor-utils.c:164
-#: ../tui/nm-ui-utils.c:337
-msgid "Wi-Fi"
-msgstr "Wi-Fi"
-
-#: ../cli/src/connections.c:2558
-#, c-format
-msgid "There are 3 optional arguments for '%s' connection type.\n"
-msgstr "Ð”Ð»Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» доÑтупно три дополнительных аргумента.\n"
-
-#: ../cli/src/connections.c:2559 ../cli/src/connections.c:2613
-#: ../cli/src/connections.c:2735 ../cli/src/connections.c:2781
-#: ../cli/src/connections.c:2841 ../cli/src/connections.c:2909
-#: ../cli/src/connections.c:3072 ../cli/src/connections.c:3168
-#: ../cli/src/connections.c:3250
-msgid "Do you want to provide them? (yes/no) [yes] "
-msgstr "Хотите их определить? (Да или нет)"
-
-#: ../cli/src/connections.c:2567 ../cli/src/connections.c:2621
-#: ../cli/src/connections.c:2748 ../cli/src/connections.c:2849
+#: ../clients/cli/connections.c:3337 ../clients/cli/connections.c:3385
+#: ../clients/cli/connections.c:3519 ../clients/cli/connections.c:3598
msgid "MTU [auto]: "
msgstr "MTU [авто]: "
-#: ../cli/src/connections.c:2578 ../cli/src/connections.c:2632
-#: ../cli/src/connections.c:2711 ../cli/src/connections.c:2759
+#: ../clients/cli/connections.c:3348 ../clients/cli/connections.c:3396
+#: ../clients/cli/connections.c:3491 ../clients/cli/connections.c:3530
+#: ../clients/cli/connections.c:3916
msgid "MAC [none]: "
msgstr "MAC [нет]: "
-#: ../cli/src/connections.c:2589
+#: ../clients/cli/connections.c:3359
msgid "Cloned MAC [none]: "
msgstr "Клонированный MAC [нет]:"
-#: ../cli/src/connections.c:2612
-#, c-format
-msgid "There are 5 optional arguments for 'InfiniBand' connection type.\n"
-msgstr "Ð”Ð»Ñ Ñоединений «InfiniBand» доÑтупно пÑÑ‚ÑŒ дополнительных аргументов.\n"
-
-#: ../cli/src/connections.c:2643
-msgid "Transport mode (datagram or connected) [datagram]: "
-msgstr "Режим передачи (датаграммы или подключенный) [датаграмма]:"
+#: ../clients/cli/connections.c:3407
+#, fuzzy, c-format
+#| msgid "Transport mode"
+msgid "Transport mode %s"
+msgstr "ТранÑпортный режим"
-#: ../cli/src/connections.c:2656
+#: ../clients/cli/connections.c:3420
msgid "Parent interface [none]: "
msgstr "РодительÑкий Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ [нет]:"
-#: ../cli/src/connections.c:2667
+#: ../clients/cli/connections.c:3431
msgid "P_KEY [none]: "
msgstr "P_KEY [нет]: "
-#: ../cli/src/connections.c:2677
+#: ../clients/cli/connections.c:3441
#, c-format
msgid "Error: 'p-key' is mandatory when 'parent' is specified.\n"
msgstr "Ошибка. ЕÑли задан «parent», необходимо определить «p-key» \n"
-#: ../cli/src/connections.c:2702
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3458 ../clients/tui/nm-editor-utils.c:155
+#: ../libnm-glib/nm-device.c:1791 ../libnm/nm-device.c:1613
+msgid "Wi-Fi"
+msgstr "Wi-Fi"
+
+#: ../clients/cli/connections.c:3466
#, c-format
-msgid "There is 1 optional argument for 'WiMax' connection type.\n"
-msgstr "Ð”Ð»Ñ Ñоединений «WiMax» доÑтупен один дополнительный аргумент.\n"
+#| msgid "Mode"
+msgid "Mode %s"
+msgstr "Режим %s"
-#: ../cli/src/connections.c:2703 ../cli/src/connections.c:2805
-#: ../cli/src/connections.c:3024 ../cli/src/connections.c:3226
-msgid "Do you want to provide it? (yes/no) [yes] "
-msgstr "Хотите его определить? (Да, нет) [да]"
+#. Ask for optional 'wimax' arguments.
+#: ../clients/cli/connections.c:3486 ../libnm-glib/nm-device.c:1797
+#: ../libnm/nm-device.c:1619
+msgid "WiMAX"
+msgstr "WiMAX"
-#: ../cli/src/connections.c:2734
-#, c-format
-msgid "There are 4 optional arguments for 'PPPoE' connection type.\n"
-msgstr ""
-"При наÑтройке Ñоединений PPPoE допуÑкаетÑÑ Ð¸Ñпользование четырех "
-"дополнительных аргументов.\n"
+#. Ask for optional 'pppoe' arguments.
+#: ../clients/cli/connections.c:3509
+msgid "PPPoE"
+msgstr "PPPoE"
-#: ../cli/src/connections.c:2742 ../cli/src/connections.c:2790
+#: ../clients/cli/connections.c:3513 ../clients/cli/connections.c:3551
msgid "Password [none]: "
-msgstr "Пароль [нет]:"
+msgstr "Пароль [нет]: "
-#: ../cli/src/connections.c:2744
+#: ../clients/cli/connections.c:3515
msgid "Service [none]: "
-msgstr "Служба [нет]:"
+msgstr "Служба [нет]: "
-#: ../cli/src/connections.c:2780
-#, c-format
-msgid ""
-"There are 2 optional arguments for 'mobile broadband' connection type.\n"
-msgstr ""
-"Ð”Ð»Ñ Ð¼Ð¾Ð±Ð¸Ð»ÑŒÐ½Ñ‹Ñ… широкополоÑных Ñоединений доÑтупно два дополнительных "
-"аргумента.\n"
+#. Ask for optional 'gsm' or 'cdma' arguments.
+#: ../clients/cli/connections.c:3545
+#| msgid "Mobile Broadband"
+msgid "mobile broadband"
+msgstr "мобильное широкополоÑное"
-#: ../cli/src/connections.c:2788 ../cli/src/connections.c:3233
+#: ../clients/cli/connections.c:3549 ../clients/cli/connections.c:3988
msgid "Username [none]: "
-msgstr "Пользователь [нет]:"
+msgstr "Пользователь [нет]: "
-#: ../cli/src/connections.c:2804
-#, c-format
-msgid "There is 1 optional argument for 'bluetooth' connection type.\n"
-msgstr "Ð”Ð»Ñ Ñоединений Bluetooth доÑтупен один дополнительный аргумент.\n"
+#. Ask for optional 'bluetooth' arguments.
+#: ../clients/cli/connections.c:3564
+#| msgid "Bluetooth"
+msgid "bluetooth"
+msgstr "bluetooth"
-#: ../cli/src/connections.c:2813
-msgid "Bluetooth type (panu, dun-gsm or dun-cdma) [panu]: "
-msgstr "Тип bluetooth (panu, dun-gsm, dun-cdma) [panu]: "
-
-#: ../cli/src/connections.c:2821
+#: ../clients/cli/connections.c:3571
#, c-format
-msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n"
-msgstr "Ошибка. ÐедопуÑтимый тип bluetooth: «%s»\n"
+#| msgid "Bluetooth"
+msgid "Bluetooth type %s"
+msgstr "Тип Bluetooth: %s"
-#: ../cli/src/connections.c:2840
+#: ../clients/cli/connections.c:3577
#, c-format
-msgid "There are 4 optional arguments for 'VLAN' connection type.\n"
-msgstr "Ð”Ð»Ñ Ñоединений «VLAN» доÑтупно четыре дополнительных аргумента.\n"
+msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n"
+msgstr "Ошибка: «bt-type»: «%s» не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым типом bluetooth.\n"
+
+#. Ask for optional 'vlan' arguments.
+#. 13
+#: ../clients/cli/connections.c:3593 ../clients/cli/devices.c:233
+#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:97
+#: ../libnm-core/nm-connection.c:1573 ../libnm-glib/nm-device.c:1809
+#: ../libnm-util/nm-connection.c:1614 ../libnm/nm-device.c:1631
+msgid "VLAN"
+msgstr "VLAN"
-#: ../cli/src/connections.c:2860
+#: ../clients/cli/connections.c:3609
msgid "VLAN flags (<0-7>) [none]: "
msgstr "Флаги VLAN (<0-7>) [нет]: "
-#: ../cli/src/connections.c:2871
+#: ../clients/cli/connections.c:3620
msgid "Ingress priority maps [none]: "
msgstr "СоответÑтвие приоритета на входе [нет]:"
-#: ../cli/src/connections.c:2882
+#: ../clients/cli/connections.c:3631
msgid "Egress priority maps [none]: "
msgstr "СоответÑтвие приоритета на выходе [нет]:"
-#: ../cli/src/connections.c:2908
-#, c-format
-msgid "There are optional arguments for 'bond' connection type.\n"
-msgstr "Ð”Ð»Ñ Ñоединений «bond» доÑтупны дополнительные аргументы.\n"
-
-#: ../cli/src/connections.c:2918
+#: ../clients/cli/connections.c:3642
msgid "Bonding mode [balance-rr]: "
-msgstr "Режим агрегации [balance-rr]: "
+msgstr "Режим агрегации (Bond) [balance-rr]: "
+
+#. Ask for optional 'bond' arguments.
+#: ../clients/cli/connections.c:3658
+msgid "bond"
+msgstr "агрегированное (Bond)"
-#: ../cli/src/connections.c:2934
+#: ../clients/cli/connections.c:3680
msgid "Bonding primary interface [none]: "
-msgstr "ОÑновной Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð°Ð³Ñ€ÐµÐ³Ð°Ñ†Ð¸Ð¸ [нет]:"
+msgstr "ОÑновной Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð°Ð³Ñ€ÐµÐ³Ð°Ñ†Ð¸Ð¸ (Bond) [нет]:"
-#: ../cli/src/connections.c:2937
+#: ../clients/cli/connections.c:3683
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name.\n"
-msgstr "Ошибка «primary». ÐедейÑтвительное Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа: «%s».\n"
+msgstr "Ошибка: «primary»: «%s» не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым именем интерфейÑа.\n"
-#: ../cli/src/connections.c:2945
-msgid "Bonding monitoring mode (miimon or arp) [miimon]: "
-msgstr "Режим мониторинга агрегации (miimon или arp) [miimon]: "
+#: ../clients/cli/connections.c:3691
+#, c-format
+#| msgid "Link monitoring"
+msgid "Bonding monitoring mode %s"
+msgstr "Режим мониторинга агрегации (Bond): %s"
-#: ../cli/src/connections.c:2950
+#: ../clients/cli/connections.c:3697
#, c-format
msgid "Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n"
msgstr ""
-"Ошибка. ÐедопуÑтимый режим мониторинга: «%s». ИÑпользуйте «%s» или «%s»."
-"\n"
+"Ошибка. ÐедопуÑтимый режим мониторинга: «%s». ИÑпользуйте «%s» или «%s».\n"
-#: ../cli/src/connections.c:2959
+#: ../clients/cli/connections.c:3706
msgid "Bonding miimon [100]: "
msgstr "Bonding miimon [100]: "
-#: ../cli/src/connections.c:2962
+#: ../clients/cli/connections.c:3709
#, c-format
msgid "Error: 'miimon': '%s' is not a valid number <0-%u>.\n"
msgstr "Ошибка «miimon». ÐедопуÑтимое значение «%s». ОжидаетÑÑ: <0-%u>.\n"
-#: ../cli/src/connections.c:2970
+#: ../clients/cli/connections.c:3717
msgid "Bonding downdelay [0]: "
msgstr "Bonding downdelay [0]: "
-#: ../cli/src/connections.c:2973
+#: ../clients/cli/connections.c:3720
#, c-format
msgid "Error: 'downdelay': '%s' is not a valid number <0-%u>.\n"
msgstr "Ошибка «downdelay». ÐедопуÑтимое значение «%s». ОжидаетÑÑ: <0-%u>.\n"
-#: ../cli/src/connections.c:2981
+#: ../clients/cli/connections.c:3728
msgid "Bonding updelay [0]: "
msgstr "Bonding updelay [0]: "
-#: ../cli/src/connections.c:2984
+#: ../clients/cli/connections.c:3731
#, c-format
msgid "Error: 'updelay': '%s' is not a valid number <0-%u>.\n"
msgstr "Ошибка «updelay». ÐедопуÑтимое значение «%s». ОжидаетÑÑ: <0-%u>.\n"
-#: ../cli/src/connections.c:2993
+#: ../clients/cli/connections.c:3740
msgid "Bonding arp-interval [0]: "
msgstr "Bonding arp-interval [0]: "
-#: ../cli/src/connections.c:2996
+#: ../clients/cli/connections.c:3743
#, c-format
msgid "Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n"
msgstr ""
"Ошибка «arp-interval». ÐедопуÑтимое значение «%s». ОжидаетÑÑ: <0-%u>.\n"
-#: ../cli/src/connections.c:3004
+#. FIXME: verify the string
+#: ../clients/cli/connections.c:3751
msgid "Bonding arp-ip-target [none]: "
msgstr "Bonding arp-ip-target [нет]: "
-#: ../cli/src/connections.c:3023
-#, c-format
-msgid "There is 1 optional argument for '%s' connection type.\n"
+#: ../clients/cli/connections.c:3758
+msgid "LACP rate ('slow' or 'fast') [slow]: "
msgstr ""
-"При наÑтройке Ñоединений %s допуÑкаетÑÑ Ð¸Ñпользование одного дополнительного "
-"аргумента.\n"
-#: ../cli/src/connections.c:3032
+#: ../clients/cli/connections.c:3764
+#, fuzzy, c-format
+#| msgid "Error: 'master': '%s' is not valid UUID nor interface."
+msgid "Error: 'lacp_rate': '%s' is invalid ('slow' or 'fast').\n"
+msgstr "Ошибка «master». «%s» не Ñодержит UUID или интерфейÑ."
+
+#: ../clients/cli/connections.c:3787
msgid "Team JSON configuration [none]: "
-msgstr "ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹ JSON [нет]:"
+msgstr "ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ JSON агрегированного ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ (team) [нет]:"
-#: ../cli/src/connections.c:3051
+#: ../clients/cli/connections.c:3804
msgid "team"
-msgstr "группа"
+msgstr "агрегированное (team)"
-#: ../cli/src/connections.c:3057
+#: ../clients/cli/connections.c:3810
msgid "team-slave"
-msgstr "Подчиненный группы:"
+msgstr "Слейв агрегированного ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ (team)"
-#: ../cli/src/connections.c:3071
-#, c-format
-msgid "There are 6 optional arguments for 'bridge' connection type.\n"
-msgstr "Ð”Ð»Ñ Ñоединений «bridge» доÑтупно шеÑÑ‚ÑŒ дополнительных аргументов.\n"
+#. Ask for optional 'bridge' arguments.
+#: ../clients/cli/connections.c:3822
+msgid "bridge"
+msgstr "моÑÑ‚"
-#: ../cli/src/connections.c:3081
-msgid "Enable STP (yes/no) [yes]: "
-msgstr "Включить STP (да, нет) [да]:"
+#: ../clients/cli/connections.c:3828
+#, c-format
+#| msgid "Enable STP (yes/no) [yes]: "
+msgid "Enable STP %s"
+msgstr "Включить STP %s"
-#: ../cli/src/connections.c:3085
+#: ../clients/cli/connections.c:3833
#, c-format
-msgid "Error: 'stp': '%s'.\n"
-msgstr "Ошибка «stp»: «%s»\n"
+#| msgid "Error: 'stp': %s."
+msgid "Error: 'stp': %s.\n"
+msgstr "Ошибка: «stp»: %s.\n"
-#: ../cli/src/connections.c:3093
-msgid "STP priority [128]: "
-msgstr "Приоритет STP [128]: "
+#: ../clients/cli/connections.c:3841
+#| msgid "STP priority [128]: "
+msgid "STP priority [32768]: "
+msgstr "Приоритет STP [32768]: "
-#: ../cli/src/connections.c:3097
+#: ../clients/cli/connections.c:3845
#, c-format
msgid "Error: 'priority': '%s' is not a valid number <0-%d>.\n"
msgstr "ÐедопуÑтимое значение «priority»: «%s». ОжидаетÑÑ: <0-%d>.\n"
-#: ../cli/src/connections.c:3105
+#: ../clients/cli/connections.c:3853
msgid "Forward delay [15]: "
-msgstr "Forward delay [15]:"
+msgstr "Forward delay [15]:"
-#: ../cli/src/connections.c:3109
+#: ../clients/cli/connections.c:3857
#, c-format
msgid "Error: 'forward-delay': '%s' is not a valid number <2-30>.\n"
msgstr ""
"Ошибка «forward-delay». ÐедопуÑтимое значение «%s». ОжидаетÑÑ: <2-30>.\n"
-#: ../cli/src/connections.c:3118
+#: ../clients/cli/connections.c:3866
msgid "Hello time [2]: "
msgstr "Hello time [2]: "
-#: ../cli/src/connections.c:3122
+#: ../clients/cli/connections.c:3870
#, c-format
msgid "Error: 'hello-time': '%s' is not a valid number <1-10>.\n"
msgstr "ÐедопуÑтимое значение «hello-time»: «%s». ОжидаетÑÑ: <1-10>.\n"
-#: ../cli/src/connections.c:3130
+#: ../clients/cli/connections.c:3878
msgid "Max age [20]: "
msgstr "Max age [20]: "
-#: ../cli/src/connections.c:3134
+#: ../clients/cli/connections.c:3882
#, c-format
msgid "Error: 'max-age': '%s' is not a valid number <6-40>.\n"
msgstr "ÐедопуÑтимое значение «max-age»: «%s». ОжидаетÑÑ: <6-40>.\n"
-#: ../cli/src/connections.c:3142
+#: ../clients/cli/connections.c:3890
msgid "MAC address ageing time [300]: "
msgstr "Ð’Ñ€ÐµÐ¼Ñ Ð´ÐµÐ¹ÑÑ‚Ð²Ð¸Ñ MAC-адреÑа [300]: "
-#: ../cli/src/connections.c:3146
+#: ../clients/cli/connections.c:3894
#, c-format
msgid "Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n"
msgstr "ÐедопуÑтимое значение «ageing-time»: «%s». ОжидаетÑÑ: <0-1000000>.\n"
-#: ../cli/src/connections.c:3167
+#: ../clients/cli/connections.c:3903
#, c-format
-msgid "There are 3 optional arguments for 'bridge-slave' connection type.\n"
-msgstr ""
-"Ð”Ð»Ñ Ñоединений «bridge-slave» доÑтупно три дополнительных аргумента.\n"
+#| msgid "Enable STP (yes/no) [yes]: "
+msgid "Enable IGMP snooping %s"
+msgstr "Включить IGMP snooping %s"
-#: ../cli/src/connections.c:3176
+#: ../clients/cli/connections.c:3908
+#, fuzzy, c-format
+#| msgid "Error: 'stp': %s."
+msgid "Error: 'multicast-snooping': %s.\n"
+msgstr "Ошибка «stp»: %s"
+
+#. Ask for optional 'bridge-slave' arguments.
+#: ../clients/cli/connections.c:3935
+#| msgid "team-slave"
+msgid "bridge-slave"
+msgstr "Слейв ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ‚Ð¸Ð¿Ð° «моÑт»"
+
+#: ../clients/cli/connections.c:3940
msgid "Bridge port priority [32]: "
msgstr "Приоритет порта моÑта [32]: "
-#: ../cli/src/connections.c:3189
+#: ../clients/cli/connections.c:3953
msgid "Bridge port STP path cost [100]: "
msgstr "СтоимоÑÑ‚ÑŒ STP порта моÑта [100]: "
-#: ../cli/src/connections.c:3203
-msgid "Hairpin (yes/no) [yes]: "
-msgstr "Hairpin (да/нет) [да]: "
-
-#: ../cli/src/connections.c:3207
-#, c-format
-msgid "Error: 'hairpin': '%s'.\n"
-msgstr "Ошибка «hairpin»: «%s»\n"
+#: ../clients/cli/connections.c:3967
+#, fuzzy, c-format
+#| msgid "Hairpin mode"
+msgid "Hairpin %s"
+msgstr "Режим разворота пакетов"
-#: ../cli/src/connections.c:3225
-#, c-format
-msgid "There is 1 optional argument for 'VPN' connection type.\n"
-msgstr "Ð”Ð»Ñ Ñоединений VPN доÑтупен один дополнительный аргумент.\n"
+#: ../clients/cli/connections.c:3972
+#, fuzzy, c-format
+#| msgid "Error: 'hairpin': %s."
+msgid "Error: 'hairpin': %s.\n"
+msgstr "Ошибка «hairpin»: %s"
-#: ../cli/src/connections.c:3249
-#, c-format
-msgid "There are 2 optional arguments for 'OLPC Mesh' connection type.\n"
-msgstr "Ð”Ð»Ñ Ñоединений «OLPC Mesh» доÑтупно два дополнительных аргумента.\n"
+#. Ask for optional 'olpc' arguments.
+#: ../clients/cli/connections.c:3999 ../libnm-glib/nm-device.c:1795
+#: ../libnm/nm-device.c:1617
+msgid "OLPC Mesh"
+msgstr "OLPC Mesh"
-#: ../cli/src/connections.c:3258
+#: ../clients/cli/connections.c:4004
msgid "OLPC Mesh channel [1]: "
msgstr "Канал OLPC mesh [1]:"
-#: ../cli/src/connections.c:3261
+#: ../clients/cli/connections.c:4007
#, c-format
msgid "Error: 'channel': '%s' is not a valid number <1-13>.\n"
msgstr "Ошибка «channel». ÐедопуÑтимое значение «%s». ОжидаетÑÑ: <1-13>.\n"
-#: ../cli/src/connections.c:3269
+#: ../clients/cli/connections.c:4015
msgid "DHCP anycast MAC address [none]: "
msgstr "MAC-Ð°Ð´Ñ€ÐµÑ Ñ€Ð°ÑÑылки DHCP [нет]:"
-#: ../cli/src/connections.c:3317
-msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
+#: ../clients/cli/connections.c:4057
+#, fuzzy
+#| msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
+msgid "IPv4 address (IP[/plen]) [none]: "
msgstr "ÐÐ´Ñ€ÐµÑ IPv4 (IP[/plen] [шлюз]) [нет]: "
-#: ../cli/src/connections.c:3319
-msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
+#: ../clients/cli/connections.c:4059
+#, fuzzy
+#| msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
+msgid "IPv6 address (IP[/plen]) [none]: "
msgstr "ÐÐ´Ñ€ÐµÑ IPv6 (IP[/plen] [шлюз]) [нет]: "
-#: ../cli/src/connections.c:3337
-#, c-format
-msgid " Address successfully added: %s %s\n"
+#: ../clients/cli/connections.c:4073
+#, fuzzy, c-format
+#| msgid " Address successfully added: %s %s\n"
+msgid " Address successfully added: %s\n"
msgstr "ÐÐ´Ñ€ÐµÑ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½: %s %s\n"
-#: ../cli/src/connections.c:3339
-#, c-format
-msgid " Warning: address already present: %s %s\n"
+#: ../clients/cli/connections.c:4075
+#, fuzzy, c-format
+#| msgid " Warning: address already present: %s %s\n"
+msgid " Warning: address already present: %s\n"
msgstr "Предупреждение. ÐÐ´Ñ€ÐµÑ ÑƒÐ¶Ðµ иÑпользуетÑÑ: %s %s\n"
-#: ../cli/src/connections.c:3341
+#: ../clients/cli/connections.c:4077
#, c-format
msgid " Warning: ignoring garbage at the end: '%s'\n"
msgstr "Предупреждение. ИгнорируетÑÑ Ð¼ÑƒÑор в конце: «%s».\n"
-#: ../cli/src/connections.c:3343 ../cli/src/connections.c:4192
-#: ../cli/src/connections.c:4247 ../cli/src/connections.c:4646
-#: ../cli/src/connections.c:4656
+#: ../clients/cli/connections.c:4079 ../clients/cli/connections.c:4960
+#: ../clients/cli/connections.c:5021 ../clients/cli/connections.c:5442
+#: ../clients/cli/connections.c:5475
msgid "Error: "
msgstr "Ошибка:"
-#: ../cli/src/connections.c:3361
-msgid "Do you want to add IP addresses? (yes/no) [yes] "
+#: ../clients/cli/connections.c:4099
+#, fuzzy
+#| msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
+msgid "IPv4 gateway [none]: "
+msgstr "ÐÐ´Ñ€ÐµÑ IPv4 (IP[/plen] [шлюз]) [нет]: "
+
+#: ../clients/cli/connections.c:4102
+#, fuzzy
+#| msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
+msgid "IPv6 gateway [none]: "
+msgstr "ÐÐ´Ñ€ÐµÑ IPv6 (IP[/plen] [шлюз]) [нет]: "
+
+#: ../clients/cli/connections.c:4122
+#, fuzzy, c-format
+#| msgid "Error: invalid extra argument '%s'."
+msgid "Error: invalid gateway address '%s'\n"
+msgstr "Ошибка. ÐедопуÑтимый дополнительный аргумент: «%s»."
+
+#. Ask for IP addresses
+#: ../clients/cli/connections.c:4135
+#, fuzzy, c-format
+#| msgid "Do you want to add IP addresses? (yes/no) [yes] "
+msgid "Do you want to add IP addresses? %s"
msgstr "Добавить IP-адреÑа? (Да или нет) [да]"
-#: ../cli/src/connections.c:3367
+#: ../clients/cli/connections.c:4143
#, c-format
msgid "Press <Enter> to finish adding addresses.\n"
msgstr "Ðажмите <Enter>, чтобы завершить процедуру Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð°Ð´Ñ€ÐµÑов.\n"
-#: ../cli/src/connections.c:3513
+#: ../clients/cli/connections.c:4282
#, c-format
msgid "Error: 'parent': not valid without 'p-key'."
msgstr "Ошибка «parent». ÐедейÑтвительно без «p-key». "
-#: ../cli/src/connections.c:3569 ../cli/src/connections.c:4562
+#: ../clients/cli/connections.c:4337 ../clients/cli/connections.c:5358
msgid "SSID: "
msgstr "SSID: "
-#: ../cli/src/connections.c:3572 ../cli/src/connections.c:4565
+#: ../clients/cli/connections.c:4340 ../clients/cli/connections.c:5361
msgid "Error: 'ssid' is required."
msgstr "Ошибка. Ðеобходимо определить «ssid»."
-#: ../cli/src/connections.c:3636
+#: ../clients/cli/connections.c:4404
msgid "WiMAX NSP name: "
msgstr "Ð˜Ð¼Ñ WiMAX NSP"
-#: ../cli/src/connections.c:3639
+#: ../clients/cli/connections.c:4407
msgid "Error: 'nsp' is required."
msgstr "Ошибка. Ðеобходимо определить «nsp»."
-#: ../cli/src/connections.c:3694
+#: ../clients/cli/connections.c:4459
msgid "PPPoE username: "
msgstr "Пользователь PPPoE:"
-#: ../cli/src/connections.c:3697
+#: ../clients/cli/connections.c:4462
msgid "Error: 'username' is required."
msgstr "Ошибка. Ðеобходимо определить Ð¸Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ."
-#: ../cli/src/connections.c:3768
+#: ../clients/cli/connections.c:4531
msgid "APN: "
msgstr "APN: "
-#: ../cli/src/connections.c:3771
+#: ../clients/cli/connections.c:4534
msgid "Error: 'apn' is required."
msgstr "Ошибка. Ðеобходимо определить «apn»."
-#: ../cli/src/connections.c:3830
+#: ../clients/cli/connections.c:4592
msgid "Bluetooth device address: "
msgstr "ÐÐ´Ñ€ÐµÑ ÑƒÑтройÑтва Bluetooth:"
-#: ../cli/src/connections.c:3833
+#: ../clients/cli/connections.c:4595
msgid "Error: 'addr' is required."
msgstr "Ошибка. Ðеобходимо определить «addr»."
-#: ../cli/src/connections.c:3876
+#: ../clients/cli/connections.c:4636
#, c-format
msgid "Error: 'bt-type': '%s' not valid; use [%s, %s (%s), %s]."
msgstr ""
"Ошибка «bt-type». Ðеверное значение «%s». ИÑпользуйте [%s, %s (%s), %s]."
-#: ../cli/src/connections.c:3921
+#: ../clients/cli/connections.c:4680
msgid "VLAN parent device or connection UUID: "
msgstr "РодительÑкое уÑтройÑтво VLAN или подключение UUID:"
-#: ../cli/src/connections.c:3924
+#: ../clients/cli/connections.c:4683
msgid "Error: 'dev' is required."
msgstr "Ошибка. Ðеобходимо определить «dev»."
-#: ../cli/src/connections.c:3928
+#: ../clients/cli/connections.c:4687
msgid "VLAN ID <0-4095>: "
msgstr "VLAN ID <0-4095>: "
-#: ../cli/src/connections.c:3931
+#: ../clients/cli/connections.c:4690
msgid "Error: 'id' is required."
msgstr "Ошибка. Ðеобходимо определить «id»."
-#: ../cli/src/connections.c:3937
+#: ../clients/cli/connections.c:4696
#, c-format
msgid "Error: 'id': '%s' is not valid; use <0-4095>."
-msgstr "Ошибка «id». Ðеверное значение «%s». ДопуÑтимые значениÑ: <0-4095>."
+msgstr "Ошибка «id». Ðеверное значение «%s». ДопуÑтимые значениÑ: <0-4095>."
-#: ../cli/src/connections.c:3947
+#: ../clients/cli/connections.c:4706
#, c-format
msgid "Error: 'dev': '%s' is neither UUID, interface name, nor MAC."
-msgstr ""
-"Ошибка «dev». «%s» может Ñодержать UUID, Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа или MAC-адреÑ."
+msgstr "Ошибка «dev». «%s» может Ñодержать UUID, Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа или MAC-адреÑ."
-#: ../cli/src/connections.c:4082
+#: ../clients/cli/connections.c:4840
#, c-format
msgid "Error: 'mode': %s."
msgstr "Ошибка «mode»: %s"
-#: ../cli/src/connections.c:4091
+#: ../clients/cli/connections.c:4849
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name."
msgstr "Ошибка «primary». ÐедейÑтвительное Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа: «%s»."
-#: ../cli/src/connections.c:4134
-msgid "Bond master: "
-msgstr "Bond-master:"
-
-#: ../cli/src/connections.c:4137 ../cli/src/connections.c:4229
-#: ../cli/src/connections.c:4416
+#: ../clients/cli/connections.c:4901 ../clients/cli/connections.c:4999
+#: ../clients/cli/connections.c:5217
msgid "Error: 'master' is required."
msgstr "Ошибка. Ðеобходимо определить «master»."
-#: ../cli/src/connections.c:4142 ../cli/src/connections.c:4239
-#: ../cli/src/connections.c:4427
+#: ../clients/cli/connections.c:4907 ../clients/cli/connections.c:5005
+#: ../clients/cli/connections.c:5223
+#, c-format
+msgid "Warning: master='%s' doesn't refer to any existing profile.\n"
+msgstr ""
+
+#: ../clients/cli/connections.c:4910 ../clients/cli/connections.c:5013
+#: ../clients/cli/connections.c:5226
#, c-format
msgid ""
"Warning: 'type' is currently ignored. We only support ethernet slaves for "
"now.\n"
msgstr ""
-"Предупреждение. ПоддерживаютÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ подчиненные Ethernet-подключениÑ, "
-"поÑтому «type» игнорируетÑÑ.\n"
+"Предупреждение: ÑÐµÐ¹Ñ‡Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶Ð¸Ð²Ð°ÑŽÑ‚ÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ Ñлейвы Ethernet, поÑтому «type» "
+"игнорируетÑÑ.\n"
-#: ../cli/src/connections.c:4226
-msgid "Team master: "
-msgstr "МаÑтер группы:"
-
-#: ../cli/src/connections.c:4329
+#: ../clients/cli/connections.c:5111
#, c-format
msgid "Error: 'stp': %s."
msgstr "Ошибка «stp»: %s"
-#: ../cli/src/connections.c:4413
-msgid "Bridge master: "
-msgstr "МаÑтер-моÑÑ‚:"
-
-#: ../cli/src/connections.c:4421
-#, c-format
-msgid "Error: 'master': '%s' is not valid UUID nor interface."
-msgstr "Ошибка «master». «%s» не Ñодержит UUID или интерфейÑ."
+#: ../clients/cli/connections.c:5120
+#, fuzzy, c-format
+#| msgid "Error: 'stp': %s."
+msgid "Error: 'multicast-snooping': %s."
+msgstr "Ошибка «stp»: %s"
-#: ../cli/src/connections.c:4454
+#: ../clients/cli/connections.c:5253
#, c-format
msgid "Error: 'hairpin': %s."
-msgstr "Ошибка «hairpin»: %s"
+msgstr "Ошибка «hairpin»: %s"
-#: ../cli/src/connections.c:4506
-msgid "VPN type: "
-msgstr "Тип VPN:"
-
-#: ../cli/src/connections.c:4509
+#: ../clients/cli/connections.c:5306
msgid "Error: 'vpn-type' is required."
msgstr "Ошибка. Ðеобходимо определить «vpn-type»."
-#: ../cli/src/connections.c:4520
-#, c-format
-msgid "Error: 'vpn-type': %s."
+#: ../clients/cli/connections.c:5313
+#, fuzzy, c-format
+#| msgid "Error: 'vpn-type': %s."
+msgid "Warning: 'vpn-type': %s not known.\n"
msgstr "Ошибка «vpn-type»: %s."
-#: ../cli/src/connections.c:4578
+#: ../clients/cli/connections.c:5374
#, c-format
msgid "Error: 'channel': '%s' is not valid; use <1-13>."
-msgstr ""
-"Ошибка «channel». Ðеверное значение «%s». ДопуÑтимые значениÑ: <1-13>."
+msgstr "Ошибка «channel». Ðеверное значение «%s». ДопуÑтимые значениÑ: <1-13>."
-#: ../cli/src/connections.c:4613
+#: ../clients/cli/connections.c:5410
#, c-format
msgid "Error: '%s' is not a valid connection type."
msgstr "Ошибка. ÐедопуÑтимый тип ÑоединениÑ: «%s»"
-#: ../cli/src/connections.c:4711
+#: ../clients/cli/connections.c:5454
+#, c-format
+msgid "Error: IPv4 gateway specified without IPv4 addresses"
+msgstr ""
+
+#: ../clients/cli/connections.c:5458
+#, fuzzy, c-format
+#| msgid "Error: No interface specified."
+msgid "Error: multiple IPv4 gateways specified"
+msgstr "Ошибка. Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½Ðµ определен."
+
+#: ../clients/cli/connections.c:5462
+#, fuzzy, c-format
+#| msgid "invalid gateway '%s'"
+msgid "Error: Invalid IPv4 gateway '%s'"
+msgstr "недопуÑтимый шлюз «%s»"
+
+#: ../clients/cli/connections.c:5487
#, c-format
-msgid "Error: Failed to add '%s' connection: (%d) %s"
+msgid "Error: IPv6 gateway specified without IPv6 addresses"
+msgstr ""
+
+#: ../clients/cli/connections.c:5491
+#, fuzzy, c-format
+#| msgid "Error: No interface specified."
+msgid "Error: multiple IPv6 gateways specified"
+msgstr "Ошибка. Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½Ðµ определен."
+
+#: ../clients/cli/connections.c:5495
+#, fuzzy, c-format
+#| msgid "invalid gateway '%s'"
+msgid "Error: Invalid IPv6 gateway '%s'"
+msgstr "недопуÑтимый шлюз «%s»"
+
+#: ../clients/cli/connections.c:5555
+#, fuzzy, c-format
+#| msgid "Error: Failed to add '%s' connection: (%d) %s"
+msgid "Error: Failed to add '%s' connection: %s"
msgstr "Ошибка. Ðе удалоÑÑŒ добавить Ñоединение «%s»: (%d) %s"
-#: ../cli/src/connections.c:4715
+#: ../clients/cli/connections.c:5560
#, c-format
msgid "Connection '%s' (%s) successfully added.\n"
msgstr "Соединение «%s» (%s) добавлено.\n"
-#: ../cli/src/connections.c:4761
-msgid "Connection type: "
-msgstr "Тип ÑоединениÑ:"
-
-#: ../cli/src/connections.c:4765
+#: ../clients/cli/connections.c:5780
#, c-format
msgid "Error: 'type' argument is required."
msgstr "Ошибка. Ðргумент «type» ÑвлÑетÑÑ Ð¾Ð±Ñзательным."
-#: ../cli/src/connections.c:4771
+#: ../clients/cli/connections.c:5788
#, c-format
msgid "Error: invalid connection type; %s."
msgstr "Ошибка. ÐедопуÑтимый тип ÑоединениÑ: %s."
-#: ../cli/src/connections.c:4780
+#: ../clients/cli/connections.c:5797
#, c-format
msgid "Error: 'autoconnect': %s."
msgstr "Ошибка «autoconnect»: %s."
-#: ../cli/src/connections.c:4796
+#: ../clients/cli/connections.c:5807
+#, fuzzy, c-format
+#| msgid "Error: 'stp': %s."
+msgid "Error: 'save': %s."
+msgstr "Ошибка «stp»: %s"
+
+#: ../clients/cli/connections.c:5823
msgid "Interface name [*]: "
msgstr "Ð˜Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа [*]: "
-#: ../cli/src/connections.c:4801
+#: ../clients/cli/connections.c:5828
#, c-format
msgid "Error: 'ifname' argument is required."
msgstr "Ошибка. ТребуетÑÑ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚ «ifname»."
-#: ../cli/src/connections.c:4808
+#: ../clients/cli/connections.c:5835
#, c-format
msgid "Error: 'ifname': '%s' is not a valid interface nor '*'."
msgstr ""
"Ошибка «ifname». ÐедейÑтвительный интерфейÑ: «%s». Укажите другой Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ "
"или «*»."
-#: ../cli/src/connections.c:5627
+#: ../clients/cli/connections.c:6596
#, c-format
msgid "['%s' setting values]\n"
msgstr "[«%s» уÑтанавливает значениÑ]\n"
-#: ../cli/src/connections.c:5708
-#, c-format
+#. TRANSLATORS: do not translate command names and keywords before ::
+#. * However, you should translate terms enclosed in <>.
+#.
+#: ../clients/cli/connections.c:6678
+#, fuzzy, c-format
+#| msgid ""
+#| "---[ Main menu ]---\n"
+#| "goto [<setting> | <prop>] :: go to a setting or property\n"
+#| "remove <setting>[.<prop>] | <prop> :: remove setting or reset property "
+#| "value\n"
+#| "set [<setting>.<prop> <value>] :: set property value\n"
+#| "describe [<setting>.<prop>] :: describe property\n"
+#| "print [all] :: print the connection\n"
+#| "verify [all] :: verify the connection\n"
+#| "save :: save the connection\n"
+#| "activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
+#| "back :: go one level up (back)\n"
+#| "help/? [<command>] :: print this help\n"
+#| "nmcli <conf-option> <value> :: nmcli configuration\n"
+#| "quit :: exit nmcli\n"
msgid ""
"---[ Main menu ]---\n"
"goto [<setting> | <prop>] :: go to a setting or property\n"
@@ -1935,9 +2465,9 @@ msgid ""
"value\n"
"set [<setting>.<prop> <value>] :: set property value\n"
"describe [<setting>.<prop>] :: describe property\n"
-"print [all] :: print the connection\n"
-"verify [all] :: verify the connection\n"
-"save :: save the connection\n"
+"print [all | <setting>[.<prop>]] :: print the connection\n"
+"verify [all | fix] :: verify the connection\n"
+"save [persistent|temporary] :: save the connection\n"
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
"back :: go one level up (back)\n"
"help/? [<command>] :: print this help\n"
@@ -1960,7 +2490,7 @@ msgstr ""
"nmcli <параметр> <значение> :: ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ nmcli\n"
"quit :: выход\n"
-#: ../cli/src/connections.c:5735
+#: ../clients/cli/connections.c:6705
#, c-format
msgid ""
"goto <setting>[.<prop>] | <prop> :: enter setting/property for editing\n"
@@ -1980,12 +2510,13 @@ msgstr ""
" nmcli connection> goto secondaries\n"
" nmcli> goto ipv4.addresses\n"
-#: ../cli/src/connections.c:5742
+#: ../clients/cli/connections.c:6712
#, c-format
msgid ""
"remove <setting>[.<prop>] :: remove setting or reset property value\n"
"\n"
-"This command removes an entire setting from the connection, or if a property\n"
+"This command removes an entire setting from the connection, or if a "
+"property\n"
"is given, resets that property to the default value.\n"
"\n"
"Examples: nmcli> remove wifi-sec\n"
@@ -1999,7 +2530,7 @@ msgstr ""
"Примеры: nmcli> remove wifi-sec\n"
" nmcli> remove eth.mtu\n"
-#: ../cli/src/connections.c:5749
+#: ../clients/cli/connections.c:6719
#, c-format
msgid ""
"set [<setting>.<prop> <value>] :: set property value\n"
@@ -2014,7 +2545,7 @@ msgstr ""
"\n"
"Пример: nmcli> set con.id My connection\n"
-#: ../cli/src/connections.c:5754
+#: ../clients/cli/connections.c:6724
#, c-format
msgid ""
"describe [<setting>.<prop>] :: describe property\n"
@@ -2027,7 +2558,7 @@ msgstr ""
"Возвращает опиÑание ÑвойÑтва. Полный ÑпиÑок параметров и их значений можно "
"найти на Ñправочной Ñтранице nm-settings(5).\n"
-#: ../cli/src/connections.c:5759
+#: ../clients/cli/connections.c:6729
#, c-format
msgid ""
"print [all] :: print setting or connection values\n"
@@ -2042,15 +2573,26 @@ msgstr ""
"\n"
"Пример: nmcli ipv4> print all\n"
-#: ../cli/src/connections.c:5764
-#, c-format
+#: ../clients/cli/connections.c:6734
+#, fuzzy, c-format
+#| msgid ""
+#| "verify [all] :: verify setting or connection validity\n"
+#| "\n"
+#| "Verifies whether the setting or connection is valid and can be saved "
+#| "later. It indicates invalid values on error.\n"
+#| "\n"
+#| "Examples: nmcli> verify\n"
+#| " nmcli bond> verify\n"
msgid ""
-"verify [all] :: verify setting or connection validity\n"
+"verify [all | fix] :: verify setting or connection validity\n"
"\n"
-"Verifies whether the setting or connection is valid and can be saved later. "
-"It indicates invalid values on error.\n"
+"Verifies whether the setting or connection is valid and can be saved later.\n"
+"It indicates invalid values on error. Some errors may be fixed "
+"automatically\n"
+"by 'fix' option.\n"
"\n"
"Examples: nmcli> verify\n"
+" nmcli> verify fix\n"
" nmcli bond> verify\n"
msgstr ""
"verify [all] :: проверка параметров ÑоединениÑ\n"
@@ -2060,18 +2602,23 @@ msgstr ""
"Примеры: nmcli> verify\n"
" nmcli bond> verify\n"
-#: ../cli/src/connections.c:5771
+#: ../clients/cli/connections.c:6743
#, c-format
msgid ""
-"save :: save the connection\n"
-"\n"
-"Sends the connection to NetworkManager that will save it.\n"
+"save [persistent|temporary] :: save the connection\n"
+"\n"
+"Sends the connection profile to NetworkManager that either will save it\n"
+"persistently, or will only keep it in memory. 'save' without an argument\n"
+"means 'save persistent'.\n"
+"Note that once you save the profile persistently those settings are saved\n"
+"across reboot or restart. Subsequent changes can also be temporary or\n"
+"persistent, but any temporary changes will not persist across reboot or\n"
+"restart. If you want to fully remove the persistent connection, the "
+"connection\n"
+"profile must be deleted.\n"
msgstr ""
-"save :: Ñохранение ÑоединениÑ\n"
-"\n"
-"СохранÑет Ñоединение в NetworkManager.\n"
-#: ../cli/src/connections.c:5775
+#: ../clients/cli/connections.c:6754
#, c-format
msgid ""
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
@@ -2092,28 +2639,53 @@ msgstr ""
"/<ap>|<nsp> - AP (Wi-Fi) или NSP (WiMAX) (еÑли Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½Ðµ задан, в начале "
"Ñтроки надо добавить /)\n"
-#: ../cli/src/connections.c:5782 ../cli/src/connections.c:5932
+#: ../clients/cli/connections.c:6761 ../clients/cli/connections.c:6919
#, c-format
-msgid "back :: go to upper menu level\n"
+msgid ""
+"back :: go to upper menu level\n"
"\n"
-msgstr "back :: возврат к предыдущему меню\n"
+msgstr ""
+"back :: возврат к предыдущему меню\n"
"\n"
-#: ../cli/src/connections.c:5785
+#: ../clients/cli/connections.c:6764
#, c-format
-msgid "help/? [<command>] :: help for the nmcli commands\n"
-"\n"
-msgstr "help/? [<команда>] :: Ñправка по командам nmcli\n"
+msgid ""
+"help/? [<command>] :: help for the nmcli commands\n"
"\n"
-
-#: ../cli/src/connections.c:5788
-#, c-format
+msgstr ""
+"help/? [<команда>] :: Ñправка по командам nmcli\n"
+"\n"
+
+#: ../clients/cli/connections.c:6767
+#, fuzzy, c-format
+#| msgid ""
+#| "nmcli [<conf-option> <value>] :: 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"
+#| "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"
+#| "Examples: nmcli> nmcli status-line yes\n"
+#| " nmcli> nmcli save-confirmation no\n"
+#| " nmcli> nmcli prompt-color 3\n"
msgid ""
"nmcli [<conf-option> <value>] :: 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"
@@ -2149,7 +2721,7 @@ msgstr ""
" nmcli> nmcli save-confirmation no\n"
" nmcli> nmcli prompt-color 3\n"
-#: ../cli/src/connections.c:5808 ../cli/src/connections.c:5938
+#: ../clients/cli/connections.c:6788 ../clients/cli/connections.c:6925
#, c-format
msgid ""
"quit :: exit nmcli\n"
@@ -2161,13 +2733,16 @@ msgstr ""
"\n"
"ЕÑли Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð½Ðµ Ñохранены, поÑвитÑÑ Ð¾ÐºÐ½Ð¾ подтверждениÑ.\n"
-#: ../cli/src/connections.c:5813 ../cli/src/connections.c:5943
-#: ../cli/src/connections.c:6313 ../cli/src/connections.c:7162
+#: ../clients/cli/connections.c:6793 ../clients/cli/connections.c:6930
+#: ../clients/cli/connections.c:7342 ../clients/cli/connections.c:8262
#, c-format
msgid "Unknown command: '%s'\n"
msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°: «%s»\n"
-#: ../cli/src/connections.c:5879
+#. TRANSLATORS: do not translate command names and keywords before ::
+#. * However, you should translate terms enclosed in <>.
+#.
+#: ../clients/cli/connections.c:6859
#, c-format
msgid ""
"---[ Property menu ]---\n"
@@ -2193,7 +2768,7 @@ msgstr ""
"help/? [<команда>] :: показать Ñправку или опиÑание команды\n"
"quit :: выход из nmcli\n"
-#: ../cli/src/connections.c:5904
+#: ../clients/cli/connections.c:6884
#, c-format
msgid ""
"set [<value>] :: set new value\n"
@@ -2204,14 +2779,20 @@ msgstr ""
"\n"
"Эта команда определÑет новое значение ÑвойÑтва.\n"
-#: ../cli/src/connections.c:5908
-#, c-format
+#: ../clients/cli/connections.c:6888
+#, fuzzy, c-format
+#| msgid ""
+#| "add [<value>] :: add new option to the property\n"
+#| "\n"
+#| "This command add provided <value> to this property, if the property is of "
+#| "a container type. For single-valued properties it replaces the value "
+#| "(same as 'set').\n"
msgid ""
-"add [<value>] :: add new option to the property\n"
+"add [<value>] :: append new value to the property\n"
"\n"
-"This command add provided <value> to this property, if the property is of a "
-"container type. For single-valued properties it replaces the value (same as "
-"'set').\n"
+"This command adds provided <value> to this property, if the property is of a "
+"container type. For single-valued properties the property value is replaced "
+"(same as 'set').\n"
msgstr ""
"add [<значение>] :: приÑвоение Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ ÑвойÑтву\n"
"\n"
@@ -2219,7 +2800,7 @@ msgstr ""
"контейнера). Ð”Ð»Ñ ÑвойÑтв Ñ ÐµÐ´Ð¸Ð½Ñтвенным значением, оно будет перезапиÑано "
"(аналогично команде «set»).\n"
-#: ../cli/src/connections.c:5914
+#: ../clients/cli/connections.c:6894
#, c-format
msgid ""
"change :: change current value\n"
@@ -2230,18 +2811,27 @@ msgstr ""
"\n"
"Показывает значение и позволÑет его отредактировать.\n"
-#: ../cli/src/connections.c:5918
+#: ../clients/cli/connections.c:6898
#, c-format
msgid ""
-"remove [<index>|<option>] :: delete the value\n"
+"remove [<value>|<index>|<option name>] :: delete the value\n"
+"\n"
+"Removes the property value. For single-valued properties, this sets the\n"
+"property back to its default value. For container-type properties, this "
+"removes\n"
+"all the values of that property, or you can specify an argument to remove "
+"just\n"
+"a single item or option. The argument is either a value or index of the item "
+"to\n"
+"remove, or an option name (for properties with named options).\n"
"\n"
-"Removes the property value (sets it to default).\n"
-msgstr ""
-"remove [<индекÑ>|<значение>] :: удаление значениÑ\n"
+"Examples: nmcli ipv4.dns> remove 8.8.8.8\n"
+" nmcli ipv4.dns> remove 2\n"
+" nmcli bond.options> remove downdelay\n"
"\n"
-"Очищает ÑвойÑтво и приÑваивает ему иÑходное значение.\n"
+msgstr ""
-#: ../cli/src/connections.c:5922
+#: ../clients/cli/connections.c:6909
#, c-format
msgid ""
"describe :: describe property\n"
@@ -2254,7 +2844,7 @@ msgstr ""
"Возвращает опиÑание ÑвойÑтва. Полный ÑпиÑок параметров и их значений можно "
"найти на Ñправочной Ñтранице nm-settings(5).\n"
-#: ../cli/src/connections.c:5927
+#: ../clients/cli/connections.c:6914
#, c-format
msgid ""
"print [property|setting|connection] :: print property (setting, connection) "
@@ -2269,675 +2859,844 @@ msgstr ""
"ЕÑли аргумент не указан, возвращает значение ÑвойÑтва. Укажите параметр или "
"Ñоединение, чтобы получить ÑоответÑтвующую информацию.\n"
-#: ../cli/src/connections.c:5935
+#: ../clients/cli/connections.c:6922
#, c-format
-msgid "help/? [<command>] :: help for nmcli commands\n"
+msgid ""
+"help/? [<command>] :: help for nmcli commands\n"
"\n"
-msgstr "help/? [<команда>] :: Ñправка по командам nmcli\n"
+msgstr ""
+"help/? [<команда>] :: Ñправка по командам nmcli\n"
"\n"
-#: ../cli/src/connections.c:6022
+#: ../clients/cli/connections.c:7020
#, c-format
msgid "Error: Connection activation failed.\n"
msgstr "Ошибка. Ðе удалоÑÑŒ активировать Ñоединение.\n"
-#: ../cli/src/connections.c:6093
+#: ../clients/cli/connections.c:7103
#, c-format
msgid "Error: setting '%s' is mandatory and cannot be removed.\n"
msgstr "Ошибка. ОбÑзательное значение «%s» не может быть удалено.\n"
-#: ../cli/src/connections.c:6111
-#, c-format
-msgid "[ Connection type: %s | name: %s | UUID: %s | dirty: %s ]\n"
+#. TRANSLATORS: status line in nmcli connection editor
+#: ../clients/cli/connections.c:7121
+#, fuzzy, c-format
+#| msgid "[ Connection type: %s | name: %s | UUID: %s | dirty: %s ]\n"
+msgid "[ Type: %s | Name: %s | UUID: %s | Dirty: %s | Temp: %s ]\n"
msgstr "[Тип ÑоединениÑ: %s | имÑ: %s | UUID: %s | грÑзное: %s ]\n"
-#: ../cli/src/connections.c:6171
+#: ../clients/cli/connections.c:7157
+#, fuzzy, c-format
+#| msgid "The connection is not saved. Do you really want to quit? [y/n]\n"
+msgid "The connection is not saved. Do you really want to quit? %s"
+msgstr "Соединение не Ñохранено. Ð’Ñ‹ дейÑтвительно хотите выйти? [y/n]\n"
+
+#: ../clients/cli/connections.c:7203
#, c-format
msgid ""
"The connection profile has been removed from another client. You may type "
"'save' in the main menu to restore it.\n"
msgstr ""
"Профиль ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð±Ñ‹Ð» удален из другого клиента. Чтобы его воÑÑтановить, "
-"введите «save».\n"
+"введите «save».\n"
-#: ../cli/src/connections.c:6192 ../cli/src/connections.c:6615
-#: ../cli/src/connections.c:6673
+#: ../clients/cli/connections.c:7225 ../clients/cli/connections.c:7648
+#: ../clients/cli/connections.c:7703
#, c-format
msgid "Enter '%s' value: "
-msgstr "Введите значение «%s»:"
+msgstr "Введите значение «%s»:"
-#: ../cli/src/connections.c:6209 ../cli/src/connections.c:6228
-#: ../cli/src/connections.c:6621 ../cli/src/connections.c:6680
+#: ../clients/cli/connections.c:7240 ../clients/cli/connections.c:7262
+#: ../clients/cli/connections.c:7652 ../clients/cli/connections.c:7708
#, c-format
msgid "Error: failed to set '%s' property: %s\n"
msgstr "Ошибка. Ðе удалоÑÑŒ уÑтановить ÑвойÑтво «%s»: %s\n"
-#: ../cli/src/connections.c:6221
+#: ../clients/cli/connections.c:7256
#, c-format
msgid "Edit '%s' value: "
msgstr "Измените значение «%s»:"
-#: ../cli/src/connections.c:6250
+#: ../clients/cli/connections.c:7285
#, c-format
msgid "Error: %s\n"
msgstr "Ошибка: %s\n"
-#: ../cli/src/connections.c:6256 ../cli/src/connections.c:6759
-#: ../cli/src/connections.c:6800
+#: ../clients/cli/connections.c:7291 ../clients/cli/connections.c:7787
+#: ../clients/cli/connections.c:7828
#, c-format
msgid "Error: failed to remove value of '%s': %s\n"
-msgstr "Ошибка. Ðе удалоÑÑŒ изменить значение «%s»: %s\n"
+msgstr "Ошибка. Ðе удалоÑÑŒ изменить значение «%s»: %s\n"
-#: ../cli/src/connections.c:6277
+#: ../clients/cli/connections.c:7312
#, c-format
msgid "Unknown command argument: '%s'\n"
msgstr "ÐеизвеÑтный аргумент команды: «%s»\n"
-#: ../cli/src/connections.c:6297 ../cli/src/connections.c:7150
-msgid "The connection is not saved. Do you really want to quit? [y/n]\n"
-msgstr "Соединение не Ñохранено. Ð’Ñ‹ дейÑтвительно хотите выйти? [y/n]\n"
-
-#: ../cli/src/connections.c:6409
+#: ../clients/cli/connections.c:7438
#, c-format
msgid "Available settings: %s\n"
msgstr "ДоÑтупные параметры: %s\n"
-#: ../cli/src/connections.c:6418
+#: ../clients/cli/connections.c:7447
#, c-format
msgid "Error: invalid setting name; %s\n"
msgstr "Ошибка. ÐедопуÑтимое значение параметра: %s\n"
-#: ../cli/src/connections.c:6435
+#: ../clients/cli/connections.c:7464
#, c-format
msgid "Available properties: %s\n"
msgstr "ДоÑтупные ÑвойÑтва: %s\n"
-#: ../cli/src/connections.c:6443
+#: ../clients/cli/connections.c:7472
#, c-format
msgid "Error: property %s\n"
msgstr "Ошибка ÑвойÑтва %s\n"
-#: ../cli/src/connections.c:6484
+#: ../clients/cli/connections.c:7513
+#, fuzzy, c-format
+#| msgid ""
+#| "Saving the connection with 'autoconnect=yes'. That might result in an "
+#| "immediate activation of the connection.\n"
+#| "Do you still want to save? [yes] "
msgid ""
"Saving the connection with 'autoconnect=yes'. That might result in an "
"immediate activation of the connection.\n"
-"Do you still want to save? [yes] "
+"Do you still want to save? %s"
msgstr ""
"Соединение будет Ñохранено Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ «autoconnect=yes», что немедленно "
"активирует Ñоединение. \n"
"Сохранить? [Да]"
-#: ../cli/src/connections.c:6557
+#: ../clients/cli/connections.c:7589
#, c-format
msgid "You may edit the following settings: %s\n"
msgstr "РазрешаетÑÑ Ð¸Ð·Ð¼ÐµÐ½Ð¸Ñ‚ÑŒ Ñледующие параметры: %s\n"
-#: ../cli/src/connections.c:6583
+#: ../clients/cli/connections.c:7617
#, c-format
msgid ""
"The connection profile has been removed from another client. You may type "
"'save' to restore it.\n"
msgstr ""
"Профиль ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð±Ñ‹Ð» удален из другого клиента. Чтобы его воÑÑтановить, "
-"введите «save».\n"
+"введите «save».\n"
-#: ../cli/src/connections.c:6613 ../cli/src/connections.c:6671
+#: ../clients/cli/connections.c:7646 ../clients/cli/connections.c:7701
#, c-format
msgid "Allowed values for '%s' property: %s\n"
msgstr "ДопуÑтимые Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Â«%s»: %s\n"
-#: ../cli/src/connections.c:6625 ../cli/src/connections.c:6842
+#: ../clients/cli/connections.c:7656 ../clients/cli/connections.c:7870
#, c-format
msgid "Error: no setting selected; valid are [%s]\n"
-msgstr "Ошибка. Параметр не выбран. ДопуÑкаетÑÑ: [%s]\n"
+msgstr "Ошибка. Параметр не выбран. ДопуÑкаетÑÑ: [%s]\n"
-#: ../cli/src/connections.c:6626
+#: ../clients/cli/connections.c:7657
#, c-format
msgid "use 'goto <setting>' first, or 'set <setting>.<property>'\n"
msgstr "иÑпользуйте «goto <параметр>» или «set <параметр>.<ÑвойÑтво>»\n"
-#: ../cli/src/connections.c:6641 ../cli/src/connections.c:6779
-#: ../cli/src/connections.c:6859
+#: ../clients/cli/connections.c:7671 ../clients/cli/connections.c:7807
+#: ../clients/cli/connections.c:7887
#, c-format
msgid "Error: invalid setting argument '%s'; valid are [%s]\n"
msgstr "Ошибка. ÐедопуÑтимый аргумент «%s». ДопуÑкаетÑÑ: [%s]\n"
-#: ../cli/src/connections.c:6651
+#: ../clients/cli/connections.c:7681
#, c-format
msgid "Error: missing setting for '%s' property\n"
msgstr "Ошибка. Ðет Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ ÑвойÑтва «%s»\n"
-#: ../cli/src/connections.c:6658
+#: ../clients/cli/connections.c:7688
#, c-format
msgid "Error: invalid property: %s\n"
msgstr "Ошибка. ÐедейÑтвительное ÑвойÑтво: %s\n"
-#: ../cli/src/connections.c:6707
+#: ../clients/cli/connections.c:7735
#, c-format
msgid "Error: unknown setting '%s'\n"
msgstr "Ошибка: неизвеÑтный параметр: %s\n"
-#: ../cli/src/connections.c:6720
+#: ../clients/cli/connections.c:7748
#, c-format
msgid "You may edit the following properties: %s\n"
msgstr "Ð’Ñ‹ можете изменить Ñледующие ÑвойÑтва: %s\n"
-#: ../cli/src/connections.c:6764
+#: ../clients/cli/connections.c:7792
#, c-format
msgid "Error: no argument given; valid are [%s]\n"
-msgstr "Ошибка. Ðргумент не задан. ДопуÑкаетÑÑ: [%s]\n"
+msgstr "Ошибка. Ðргумент не задан. ДопуÑкаетÑÑ: [%s]\n"
-#: ../cli/src/connections.c:6777
+#: ../clients/cli/connections.c:7805
#, c-format
msgid "Setting '%s' is not present in the connection.\n"
msgstr "Параметр «%s» не определен в Ñоединении.\n"
-#: ../cli/src/connections.c:6818
+#: ../clients/cli/connections.c:7846
#, c-format
msgid "Error: %s properties, nor it is a setting name.\n"
msgstr "Ошибка. %s не ÑвлÑетÑÑ Ð¸Ð¼ÐµÐ½ÐµÐ¼ параметра или ÑвойÑтва.\n"
-#: ../cli/src/connections.c:6843
+#: ../clients/cli/connections.c:7871
#, c-format
msgid "use 'goto <setting>' first, or 'describe <setting>.<property>'\n"
msgstr "иÑпользуйте «goto <параметр>» или «describe <параметр>.<ÑвойÑтво>»\n"
-#: ../cli/src/connections.c:6884
+#: ../clients/cli/connections.c:7912
#, c-format
msgid "Error: invalid property: %s, neither a valid setting name.\n"
msgstr "ÐедопуÑтимое ÑвойÑтво %s или неверное Ð¸Ð¼Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°.\n"
-#: ../cli/src/connections.c:6908
-#, c-format
-msgid "Error: '%s' setting not present\n"
-msgstr "Ошибка. Параметр «%s» не определен.\n"
-
-#: ../cli/src/connections.c:6911
+#: ../clients/cli/connections.c:7941
#, c-format
msgid "Error: unknown setting: '%s'\n"
msgstr "Ошибка. ÐеизвеÑтный параметр: %s\n"
-#: ../cli/src/connections.c:6927
+#: ../clients/cli/connections.c:7946
+#, fuzzy, c-format
+#| msgid "Setting '%s' is not present in the connection.\n"
+msgid "Error: '%s' setting not present in the connection\n"
+msgstr "Параметр «%s» не определен в Ñоединении.\n"
+
+#: ../clients/cli/connections.c:7971
+#, fuzzy, c-format
+#| msgid "Error: invalid property: %s\n"
+msgid "Error: invalid property: %s%s\n"
+msgstr "Ошибка. ÐедейÑтвительное ÑвойÑтво: %s\n"
+
+#: ../clients/cli/connections.c:7973
+#, fuzzy
+#| msgid "Error: invalid property: %s, neither a valid setting name.\n"
+msgid ", neither a valid setting name"
+msgstr "ÐедопуÑтимое ÑвойÑтво %s или неверное Ð¸Ð¼Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°.\n"
+
+#: ../clients/cli/connections.c:7990
+#, fuzzy, c-format
+#| msgid "invalid option '%s'"
+msgid "Invalid verify option: %s\n"
+msgstr "ÐедопуÑтимый параметр «%s»"
+
+#: ../clients/cli/connections.c:7998
#, c-format
msgid "Verify setting '%s': %s\n"
msgstr "Проверьте параметр «%s»: %s\n"
-#: ../cli/src/connections.c:6934
+#: ../clients/cli/connections.c:8013
#, c-format
msgid "Verify connection: %s\n"
msgstr "Проверьте Ñоединение: %s\n"
-#: ../cli/src/connections.c:6973
+#: ../clients/cli/connections.c:8016
#, c-format
-msgid "Error: Failed to save '%s' (%s) connection: (%d) %s\n"
+msgid "The error cannot be fixed automatically.\n"
+msgstr ""
+
+#: ../clients/cli/connections.c:8033
+#, fuzzy, c-format
+#| msgid "Error: invalid extra argument '%s'."
+msgid "Error: invalid argument '%s'\n"
+msgstr "Ошибка. ÐедопуÑтимый дополнительный аргумент: «%s»."
+
+#: ../clients/cli/connections.c:8066
+#, fuzzy, c-format
+#| msgid "Error: Failed to save '%s' (%s) connection: (%d) %s\n"
+msgid "Error: Failed to save '%s' (%s) connection: %s\n"
msgstr "Ошибка. Ðе удалоÑÑŒ Ñохранить Ñоединение «%s» (%s): (%d) %s\n"
-#: ../cli/src/connections.c:6980
+#: ../clients/cli/connections.c:8073
#, c-format
msgid "Connection '%s' (%s) successfully saved.\n"
msgstr "Соединение «%s» (%s) Ñохранено.\n"
-#: ../cli/src/connections.c:7014
+#: ../clients/cli/connections.c:8074
+#, fuzzy, c-format
+#| msgid "Connection '%s' (%s) successfully added.\n"
+msgid "Connection '%s' (%s) successfully updated.\n"
+msgstr "Соединение «%s» (%s) добавлено.\n"
+
+#: ../clients/cli/connections.c:8107
#, c-format
msgid "Error: connection verification failed: %s\n"
msgstr "Ошибка. Проверка ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð°ÑÑŒ неудачей: %s\n"
-#: ../cli/src/connections.c:7015
+#: ../clients/cli/connections.c:8108
msgid "(unknown error)"
msgstr "(неизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°)"
-#: ../cli/src/connections.c:7036
+#: ../clients/cli/connections.c:8109
+#, c-format
+msgid "You may try running 'verify fix' to fix errors.\n"
+msgstr ""
+
+#: ../clients/cli/connections.c:8131
#, c-format
msgid "Error: connection is not saved. Type 'save' first.\n"
msgstr "Ошибка. Соединение не Ñохранено. Сначала введите «type».\n"
-#: ../cli/src/connections.c:7040
+#: ../clients/cli/connections.c:8135
#, c-format
msgid "Error: connection is not valid: %s\n"
msgstr "Ошибка. ÐедейÑтвительное Ñоединение: %s\n"
-#: ../cli/src/connections.c:7051
+#: ../clients/cli/connections.c:8145
#, c-format
msgid "Error: Cannot activate connection: %s.\n"
msgstr "Ошибка. Ðе удалоÑÑŒ активировать Ñоединение: %s\n"
-#: ../cli/src/connections.c:7061
-#, c-format
-msgid "Error: Failed to activate '%s' (%s) connection: (%d) %s\n"
+#: ../clients/cli/connections.c:8155
+#, fuzzy, c-format
+#| msgid "Error: Failed to activate '%s' (%s) connection: (%d) %s\n"
+msgid "Error: Failed to activate '%s' (%s) connection: %s\n"
msgstr "Ошибка. Ðе удалоÑÑŒ активировать Ñоединение «%s» (%s): (%d) %s\n"
-#: ../cli/src/connections.c:7067
+#: ../clients/cli/connections.c:8161
#, c-format
msgid "Monitoring connection activation (press any key to continue)\n"
msgstr ""
"Контроль активации ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ (нажмите любую клавишу Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð´Ð¾Ð»Ð¶ÐµÐ½Ð¸Ñ)\n"
-#: ../cli/src/connections.c:7105
+#: ../clients/cli/connections.c:8199
#, c-format
msgid "Error: status-line: %s\n"
msgstr "Ошибка status-line: %s\n"
-#: ../cli/src/connections.c:7113
+#: ../clients/cli/connections.c:8207
#, c-format
msgid "Error: save-confirmation: %s\n"
msgstr "Ошибка save-confirmation: %s\n"
-#: ../cli/src/connections.c:7121
+#: ../clients/cli/connections.c:8215
+#, fuzzy, c-format
+#| msgid "Error: 'show active': %s"
+msgid "Error: show-secrets: %s\n"
+msgstr "Ошибка «show active»: %s"
+
+#: ../clients/cli/connections.c:8223
#, c-format
msgid "Error: bad color number: '%s'; use <0-8>\n"
-msgstr "Ошибка. Ðеверный код цвета: «%s». ДопуÑтимые значениÑ: <0-8>\n"
+msgstr "Ошибка. Ðеверный код цвета: «%s». ДопуÑтимые значениÑ: <0-8>\n"
-#: ../cli/src/connections.c:7133
+#: ../clients/cli/connections.c:8237
#, c-format
msgid "Current nmcli configuration:\n"
msgstr "Ð¢ÐµÐºÑƒÑ‰Ð°Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ nmcli:\n"
-#: ../cli/src/connections.c:7141
+#: ../clients/cli/connections.c:8247
#, c-format
msgid "Invalid configuration option '%s'; allowed [%s]\n"
msgstr "ÐедопуÑтимый параметр конфигурации «%s». ДопуÑкаетÑÑ: [%s]\n"
-#: ../cli/src/connections.c:7364
-#, c-format
-msgid ""
-">>> Command-line editing is not available. Consider installing a line "
-"editing library to enable the feature. <<<\n"
-"Supported libraries are:\n"
-" - GNU Readline (libreadline) http://cnswww.cns.cwru.edu/php/chet/"
-"readline/rltop.html\n"
-" - NetBSD Editline (libedit) http://www.thrysoee.dk/editline/\n"
-msgstr ""
-">>> Редактирование в командной Ñтроке недоÑтупно. Ð”Ð»Ñ Ñтого рекомендуетÑÑ "
-"уÑтановить библиотеку Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñ‚ÐµÐºÑта. <<<\n"
-"Поддерживаемые библиотеки:\n"
-" - GNU Readline (libreadline) http://cnswww.cns.cwru.edu/php/chet/"
-"readline/rltop.html\n"
-" - NetBSD Editline (libedit) http://www.thrysoee.dk/editline/\n"
-
-#: ../cli/src/connections.c:7390
+#: ../clients/cli/connections.c:8494
#, c-format
msgid "Error: only one of 'id', uuid, or 'path' can be provided."
msgstr "Ошибка. ДопуÑкаетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ одно значение: «id», «uuid» или «path»."
-#: ../cli/src/connections.c:7402 ../cli/src/connections.c:7599
+#: ../clients/cli/connections.c:8506 ../clients/cli/connections.c:8693
+#: ../clients/cli/connections.c:8700
#, c-format
msgid "Error: Unknown connection '%s'."
msgstr "Ошибка. ÐеизвеÑтное Ñоединение: «%s»."
-#: ../cli/src/connections.c:7417
+#: ../clients/cli/connections.c:8524
#, c-format
msgid "Warning: editing existing connection '%s'; 'type' argument is ignored\n"
msgstr ""
-"Предупреждение. При редактировании ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» аргумент «type» будет "
+"Предупреждение. При редактировании ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» аргумент «type» будет "
"пропущен.\n"
-#: ../cli/src/connections.c:7420
+#: ../clients/cli/connections.c:8527
#, c-format
msgid ""
"Warning: editing existing connection '%s'; 'con-name' argument is ignored\n"
msgstr ""
-"Предупреждение. При редактировании ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» аргумент «con-name» "
-"будет пропущен.\n"
+"Предупреждение. При редактировании ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» аргумент «con-name» будет "
+"пропущен.\n"
-#: ../cli/src/connections.c:7434
+#: ../clients/cli/connections.c:8541
#, c-format
msgid "Valid connection types: %s\n"
msgstr "ДоÑтупные типы подключений: %s\n"
-#: ../cli/src/connections.c:7436
+#: ../clients/cli/connections.c:8543
#, c-format
msgid "Error: invalid connection type; %s\n"
msgstr "Ошибка. ÐедопуÑтимый тип ÑоединениÑ: %s.\n"
-#: ../cli/src/connections.c:7472
+#: ../clients/cli/connections.c:8582
#, c-format
msgid "===| nmcli interactive connection editor |==="
msgstr "===| интерактивный редактор Ñоединений nmcli |==="
-#: ../cli/src/connections.c:7475
+#: ../clients/cli/connections.c:8585
#, c-format
msgid "Editing existing '%s' connection: '%s'"
msgstr "РедактируетÑÑ Ñоединение «%s»: «%s»"
-#: ../cli/src/connections.c:7477
+#: ../clients/cli/connections.c:8587
#, c-format
msgid "Adding a new '%s' connection"
msgstr "Добавление нового ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s»"
-#: ../cli/src/connections.c:7479
+#: ../clients/cli/connections.c:8589
#, c-format
msgid "Type 'help' or '?' for available commands."
msgstr "Ð”Ð»Ñ Ð¿Ñ€Ð¾Ñмотра доÑтупных команд введите «help» или «?»"
-#: ../cli/src/connections.c:7481
+#: ../clients/cli/connections.c:8591
#, c-format
msgid "Type 'describe [<setting>.<prop>]' for detailed property description."
msgstr ""
-"Ð”Ð»Ñ Ð¿Ñ€Ð¾Ñмотра опиÑÐ°Ð½Ð¸Ñ ÑвойÑтва введите «describe [<параметр>.<ÑвойÑтво>]»."
+"Ð”Ð»Ñ Ð¿Ñ€Ð¾Ñмотра опиÑÐ°Ð½Ð¸Ñ ÑвойÑтва введите «describe [<параметр>.<ÑвойÑтво>]»."
-#: ../cli/src/connections.c:7520
-#, c-format
-msgid "Error: Failed to modify connection '%s': (%d) %s"
+#: ../clients/cli/connections.c:8629
+#, fuzzy, c-format
+#| msgid "Error: Failed to modify connection '%s': (%d) %s"
+msgid "Error: Failed to modify connection '%s': %s"
msgstr "Ошибка. Ðе удалоÑÑŒ изменить Ñоединение «%s»: (%d) %s"
-#: ../cli/src/connections.c:7526
+#: ../clients/cli/connections.c:8636
#, c-format
msgid "Connection '%s' (%s) successfully modified.\n"
msgstr "Соединение «%s» (%s) изменено.\n"
-#: ../cli/src/connections.c:7553
+#: ../clients/cli/connections.c:8668
#, c-format
msgid "Error: No arguments provided."
msgstr "Ошибка. Ðргументы не определены."
-#: ../cli/src/connections.c:7577
+#: ../clients/cli/connections.c:8687
#, c-format
msgid "Error: connection ID is missing."
msgstr "Ошибка. Идентификатор ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¾Ñ‚ÑутÑтвует."
-#: ../cli/src/connections.c:7582
+#: ../clients/cli/connections.c:8709 ../clients/cli/connections.c:8722
#, c-format
msgid "Error: <setting>.<property> argument is missing."
msgstr "Ошибка. ОтÑутÑтвует аргумент <параметр>.<ÑвойÑтво>"
-#: ../cli/src/connections.c:7605
+#: ../clients/cli/connections.c:8727
+#, fuzzy, c-format
+#| msgid "Error: fields for '%s' options are missing."
+msgid "Error: value for '%s' is missing."
+msgstr "Ошибка: отÑутÑтвуют Ð¿Ð¾Ð»Ñ Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð² «%s»."
+
+#: ../clients/cli/connections.c:8745
#, c-format
msgid "Error: invalid <setting>.<property> '%s'."
-msgstr "Ошибка <параметр>.<ÑвойÑтво>: «%s»."
+msgstr "Ошибка <параметр>.<ÑвойÑтво>: «%s»."
-#: ../cli/src/connections.c:7620
+#: ../clients/cli/connections.c:8753
#, c-format
msgid "Error: invalid or not allowed setting '%s': %s."
-msgstr "Ошибка. ÐедопуÑтимый параметр «%s»: %s."
+msgstr "Ошибка. ÐедопуÑтимый параметр «%s»: %s."
-#: ../cli/src/connections.c:7641
+#: ../clients/cli/connections.c:8774
#, c-format
msgid "Error: invalid property '%s': %s."
-msgstr "Ошибка. ÐедопуÑтимое ÑвойÑтво «%s»: %s."
+msgstr "Ошибка. ÐедопуÑтимое ÑвойÑтво «%s»: %s."
-#: ../cli/src/connections.c:7647
+#: ../clients/cli/connections.c:8785
#, c-format
msgid "Error: failed to modify %s.%s: %s."
msgstr "Ошибка. Ðе удалоÑÑŒ изменить %s.%s: %s."
-#: ../cli/src/connections.c:7677
+#: ../clients/cli/connections.c:8803
+#, fuzzy, c-format
+#| msgid "Error: failed to remove value of '%s': %s\n"
+msgid "Error: failed to remove a value from %s.%s: %s."
+msgstr "Ошибка. Ðе удалоÑÑŒ изменить значение «%s»: %s\n"
+
+#: ../clients/cli/connections.c:8840
#, c-format
msgid "Error: Connection deletion failed: %s"
msgstr "Ошибка: Ñбой ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ ÑоединениÑ: %s"
-#: ../cli/src/connections.c:7747
+#: ../clients/cli/connections.c:8904
#, c-format
msgid "Error: unknown connection: %s\n"
msgstr "Ошибка. ÐеизвеÑтное Ñоединение: %s\n"
-#: ../cli/src/connections.c:7781
+#. truncate trailing ", "
+#: ../clients/cli/connections.c:8941
#, c-format
msgid "Error: cannot delete unknown connection(s): %s."
msgstr "Ошибка. Ðе удалоÑÑŒ удалить неизвеÑтные ÑоединениÑ: %s"
-#: ../cli/src/connections.c:7852
+#: ../clients/cli/connections.c:8964
+#, fuzzy, c-format
+#| msgid "Error: Failed to add '%s' connection: (%d) %s"
+msgid "Error: failed to reload connections: %s."
+msgstr "Ошибка. Ðе удалоÑÑŒ добавить Ñоединение «%s»: (%d) %s"
+
+#: ../clients/cli/connections.c:9003
+#, fuzzy, c-format
+#| msgid "Error: Failed to add '%s' connection: (%d) %s"
+msgid "Error: failed to load connection: %s."
+msgstr "Ошибка. Ðе удалоÑÑŒ добавить Ñоединение «%s»: (%d) %s"
+
+#: ../clients/cli/connections.c:9011
#, c-format
msgid "Could not load file '%s'\n"
msgstr "Ðе удалоÑÑŒ загрузить «%s»\n"
-#: ../cli/src/connections.c:7917
+#: ../clients/cli/connections.c:9108
#, c-format
-msgid ""
-"Error: 'configured' or 'active' command is expected for 'connection show'."
-msgstr "Ошибка. ПоÑле «connection show» ожидаетÑÑ Â«configured» или «active»."
+msgid "incorrect string '%s' of '--order' option"
+msgstr ""
-#: ../cli/src/connections.c:7984
+#: ../clients/cli/connections.c:9134
#, c-format
-msgid "Error: '%s' is not valid 'connection' command."
-msgstr "Ошибка. ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «connection»: «%s»"
+msgid "incorrect item '%s' in '--order' option"
+msgstr ""
-#: ../cli/src/connections.c:8053 ../cli/src/network-manager.c:615
-#, c-format
-msgid "Error: Could not get system settings."
-msgstr "Ошибка. Ðе удалоÑÑŒ получить ÑиÑтемные параметры."
+#: ../clients/cli/connections.c:9219
+#, fuzzy
+#| msgid "Error: %s argument is missing."
+msgid "'--order' argument is missing"
+msgstr "Ошибка: отÑутÑтвует аргумент %s."
-#: ../cli/src/connections.c:8063
+#: ../clients/cli/connections.c:9261
#, c-format
-msgid "Error: Can't obtain connections: settings service is not running."
-msgstr ""
-"Ошибка: не удалоÑÑŒ получить ÑоединениÑ: Ñлужба параметров не запущена."
+msgid "Error: '%s' is not valid 'connection' command."
+msgstr "Ошибка. ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «connection»: «%s»"
-#: ../cli/src/devices.c:71 ../cli/src/devices.c:87 ../cli/src/devices.c:184
-#: ../cli/src/devices.c:201
-msgid "DEVICE"
-msgstr "УСТРОЙСТВО"
+#. define some prompts
+#: ../clients/cli/devices.c:38
+msgid "Interface: "
+msgstr "ИнтерфейÑ:"
-#: ../cli/src/devices.c:75 ../cli/src/devices.c:103
+#. 3
+#. 17
+#: ../clients/cli/devices.c:46 ../clients/cli/devices.c:75
msgid "CONNECTION"
msgstr "СОЕДИÐЕÐИЕ"
-#: ../cli/src/devices.c:76 ../cli/src/devices.c:104
+#. 4
+#. 18
+#: ../clients/cli/devices.c:47 ../clients/cli/devices.c:76
msgid "CON-UUID"
msgstr "UUID СОЕДИÐЕÐИЯ"
-#: ../cli/src/devices.c:89
+#. 2
+#: ../clients/cli/devices.c:60
msgid "VENDOR"
msgstr "ПРОИЗВОДИТЕЛЬ"
-#: ../cli/src/devices.c:90
+#. 3
+#: ../clients/cli/devices.c:61
msgid "PRODUCT"
msgstr "ПРОДУКТ"
-#: ../cli/src/devices.c:91
+#. 4
+#: ../clients/cli/devices.c:62
msgid "DRIVER"
msgstr "ДРÐЙВЕР"
-#: ../cli/src/devices.c:92
+#. 5
+#: ../clients/cli/devices.c:63
msgid "DRIVER-VERSION"
msgstr "ВЕРСИЯ ДРÐЙВЕРÐ"
-#: ../cli/src/devices.c:93
+#. 6
+#: ../clients/cli/devices.c:64
msgid "FIRMWARE-VERSION"
msgstr "ВЕРСИЯ ПРОШИВКИ"
-#: ../cli/src/devices.c:94
+#. 7
+#: ../clients/cli/devices.c:65
msgid "HWADDR"
msgstr "ÐППÐРÐТÐЫЙ ÐДРЕС"
-#: ../cli/src/devices.c:95 ../tui/nmt-page-ethernet.c:86
-#: ../tui/nmt-page-infiniband.c:90 ../tui/nmt-page-vlan.c:138
-#: ../tui/nmt-page-wifi.c:364
+#. 8
+#: ../clients/cli/devices.c:66 ../clients/tui/nmt-page-ethernet.c:86
+#: ../clients/tui/nmt-page-infiniband.c:97 ../clients/tui/nmt-page-vlan.c:131
+#: ../clients/tui/nmt-page-wifi.c:373
msgid "MTU"
msgstr "MTU"
-#: ../cli/src/devices.c:97
+#. 10
+#: ../clients/cli/devices.c:68
msgid "REASON"
msgstr "ПРИЧИÐÐ"
-#: ../cli/src/devices.c:98
+#. 11
+#: ../clients/cli/devices.c:69
msgid "UDI"
msgstr "UDI"
-#: ../cli/src/devices.c:99
+#. 12
+#: ../clients/cli/devices.c:70
msgid "IP-IFACE"
msgstr "IP_ИÐТЕРФЕЙСÐ"
-#: ../cli/src/devices.c:100
+#. 13
+#. 2
+#: ../clients/cli/devices.c:71 ../clients/cli/devices.c:99
+msgid "IS-SOFTWARE"
+msgstr ""
+
+#. 14
+#: ../clients/cli/devices.c:72
msgid "NM-MANAGED"
msgstr "ПОД УПРÐВЛЕÐИЕМ NM"
-#: ../cli/src/devices.c:102
+#. 16
+#: ../clients/cli/devices.c:74
msgid "FIRMWARE-MISSING"
msgstr "ТРЕБУЕТСЯ ПРОШИВКÐ"
-#: ../cli/src/devices.c:115
+#. 0
+#: ../clients/cli/devices.c:87
msgid "AVAILABLE-CONNECTION-PATHS"
msgstr "ДОСТУПÐЫЕ ПУТИ СОЕДИÐЕÐИЯ"
-#: ../cli/src/devices.c:116
+#. 1
+#: ../clients/cli/devices.c:88
msgid "AVAILABLE-CONNECTIONS"
msgstr "ДОСТУПÐЫЕ СОЕДИÐЕÐИЯ"
-#: ../cli/src/devices.c:125
+#. 0
+#: ../clients/cli/devices.c:97
msgid "CARRIER-DETECT"
msgstr "ОПРЕД.ÐЕСУЩЕЙ"
-#: ../cli/src/devices.c:126
+#. 1
+#: ../clients/cli/devices.c:98
msgid "SPEED"
msgstr "СКОРОСТЬ"
-#: ../cli/src/devices.c:135
+#. 0
+#: ../clients/cli/devices.c:108
msgid "CARRIER"
msgstr "ÐЕСУЩÐЯ"
-#: ../cli/src/devices.c:144 ../cli/src/devices.c:563
+#. 0
+#: ../clients/cli/devices.c:117 ../clients/cli/devices.c:603
msgid "WEP"
msgstr "WEP"
-#: ../cli/src/devices.c:145
+#. 1
+#: ../clients/cli/devices.c:118
msgid "WPA"
msgstr "WPA"
-#: ../cli/src/devices.c:146 ../cli/src/devices.c:571
+#. 2
+#: ../clients/cli/devices.c:119 ../clients/cli/devices.c:611
msgid "WPA2"
msgstr "WPA2"
-#: ../cli/src/devices.c:147
+#. 3
+#: ../clients/cli/devices.c:120
msgid "TKIP"
msgstr "TKIP"
-#: ../cli/src/devices.c:148
+#. 4
+#: ../clients/cli/devices.c:121
msgid "CCMP"
msgstr "CCMP"
-#: ../cli/src/devices.c:149 ../cli/src/devices.c:239
+#. 5
+#. 2
+#: ../clients/cli/devices.c:122 ../clients/cli/devices.c:222
msgid "AP"
msgstr "ТОЧКРДОСТУПÐ"
-#: ../cli/src/devices.c:150
+#. 6
+#: ../clients/cli/devices.c:123
msgid "ADHOC"
msgstr "ADHOC"
-#: ../cli/src/devices.c:159
+#. 0
+#: ../clients/cli/devices.c:132
msgid "CTR-FREQ"
msgstr "CTR-FREQ"
-#: ../cli/src/devices.c:160
+#. 1
+#: ../clients/cli/devices.c:133
msgid "RSSI"
msgstr "RSSI"
-#: ../cli/src/devices.c:161
+#. 2
+#: ../clients/cli/devices.c:134
msgid "CINR"
msgstr "CINR"
-#: ../cli/src/devices.c:162
+#. 3
+#: ../clients/cli/devices.c:135
msgid "TX-POW"
msgstr "TX-POW"
-#: ../cli/src/devices.c:163
+#. 4
+#: ../clients/cli/devices.c:136
msgid "BSID"
msgstr "BSID"
-#: ../cli/src/devices.c:172 ../tui/nmt-page-wifi.c:221
+#. 0
+#: ../clients/cli/devices.c:145 ../clients/tui/nmt-page-wifi.c:227
msgid "SSID"
msgstr "SSID"
-#: ../cli/src/devices.c:173
+#. 1
+#: ../clients/cli/devices.c:146
msgid "SSID-HEX"
msgstr "SSID-HEX"
-#: ../cli/src/devices.c:174 ../tui/nmt-page-wifi.c:352
+#. 2
+#: ../clients/cli/devices.c:147 ../clients/tui/nmt-page-wifi.c:361
msgid "BSSID"
msgstr "BSSID"
-#: ../cli/src/devices.c:175
+#. 3
+#: ../clients/cli/devices.c:148
msgid "MODE"
msgstr "РЕЖИМ"
-#: ../cli/src/devices.c:176
+#. 4
+#: ../clients/cli/devices.c:149
msgid "CHAN"
msgstr "КÐÐÐЛ"
-#: ../cli/src/devices.c:177
+#. 5
+#: ../clients/cli/devices.c:150
msgid "FREQ"
msgstr "ЧÐСТОТÐ"
-#: ../cli/src/devices.c:178
+#. 6
+#: ../clients/cli/devices.c:151
msgid "RATE"
msgstr "СКОРОСТЬ"
-#: ../cli/src/devices.c:179 ../cli/src/devices.c:199
+#. 7
+#. 1
+#: ../clients/cli/devices.c:152 ../clients/cli/devices.c:172
msgid "SIGNAL"
msgstr "СИГÐÐЛ"
-#: ../cli/src/devices.c:180
+#. 8
+#: ../clients/cli/devices.c:153
msgid "BARS"
msgstr "СТОЛБЦЫ"
-#: ../cli/src/devices.c:181
+#. 9
+#: ../clients/cli/devices.c:154
msgid "SECURITY"
msgstr "ЗÐЩИТÐ"
-#: ../cli/src/devices.c:182
+#. 10
+#: ../clients/cli/devices.c:155
msgid "WPA-FLAGS"
msgstr "ФЛÐГИ WPA"
-#: ../cli/src/devices.c:183
+#. 11
+#: ../clients/cli/devices.c:156
msgid "RSN-FLAGS"
msgstr "ФЛÐГИ RSN"
-#: ../cli/src/devices.c:185 ../cli/src/devices.c:202
-msgid "ACTIVE"
-msgstr "ÐКТИВЕÐ"
-
-#: ../cli/src/devices.c:186
+#. 14
+#: ../clients/cli/devices.c:159
msgid "*"
msgstr "*"
-#: ../cli/src/devices.c:198 ../cli/src/devices.c:242
+#. 0
+#. 5
+#: ../clients/cli/devices.c:171 ../clients/cli/devices.c:225
msgid "NSP"
msgstr "NSP"
-#: ../cli/src/devices.c:213
+#. 0
+#: ../clients/cli/devices.c:186
msgid "SLAVES"
-msgstr "ПОДЧИÐЕÐÐЫЕ"
+msgstr "СЛЕЙВЫ"
+
+#. 0
+#: ../clients/cli/devices.c:195
+msgid "PARENT"
+msgstr ""
-#: ../cli/src/devices.c:222
+#. 1
+#: ../clients/cli/devices.c:196
msgid "ID"
msgstr "ID"
-#: ../cli/src/devices.c:237
+#. 0
+#: ../clients/cli/devices.c:205 ../clients/cli/devices.c:220
msgid "CAPABILITIES"
msgstr "ВОЗМОЖÐОСТИ"
-#: ../cli/src/devices.c:238
+#. 1
+#: ../clients/cli/devices.c:221
msgid "WIFI-PROPERTIES"
msgstr "СВОЙСТВРWIFI"
-#: ../cli/src/devices.c:240
+#. 3
+#: ../clients/cli/devices.c:223
msgid "WIRED-PROPERTIES"
msgstr "СВОЙСТВРПРОВОДÐОГО СОЕДИÐЕÐИЯ"
-#: ../cli/src/devices.c:241
+#. 4
+#: ../clients/cli/devices.c:224
msgid "WIMAX-PROPERTIES"
msgstr "СВОЙСТВРWIMAX"
-#: ../cli/src/devices.c:247 ../tui/nmt-page-bond.c:73
+#. 10
+#: ../clients/cli/devices.c:230 ../clients/tui/nmt-page-bond.c:354
msgid "BOND"
-msgstr "ÐГРЕГÐЦИЯ"
+msgstr "ÐГРЕГÐЦИЯ (BOND)"
-#: ../cli/src/devices.c:248 ../tui/nm-editor-utils.c:227
-#: ../tui/nm-ui-utils.c:355 ../tui/nm-ui-utils.c:580 ../tui/nmt-page-vlan.c:53
-msgid "VLAN"
-msgstr "VLAN"
+#. 11
+#: ../clients/cli/devices.c:231 ../clients/tui/nmt-page-team.c:148
+msgid "TEAM"
+msgstr "ÐГРЕГÐЦИЯ (TEAM)"
+
+#. 12
+#: ../clients/cli/devices.c:232 ../clients/tui/nmt-page-bridge.c:77
+msgid "BRIDGE"
+msgstr "МОСТ"
+
+#. 14
+#: ../clients/cli/devices.c:234
+msgid "BLUETOOTH"
+msgstr "BLUETOOTH"
-#: ../cli/src/devices.c:249
+#. 15
+#: ../clients/cli/devices.c:235
msgid "CONNECTIONS"
msgstr "СОЕДИÐЕÐИЯ"
-#: ../cli/src/devices.c:274
-#, c-format
+#: ../clients/cli/devices.c:259
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: nmcli device { COMMAND | help }\n"
+#| "\n"
+#| "COMMAND := { status | show | connect | disconnect | wifi | wimax }\n"
+#| "\n"
+#| "COMMAND := { status | show | connect | disconnect | wifi }\n"
+#| "\n"
+#| " status\n"
+#| "\n"
+#| " show [<ifname>]\n"
+#| "\n"
+#| " connect <ifname>\n"
+#| "\n"
+#| " disconnect <ifname>\n"
+#| "\n"
+#| " wifi [list [ifname <ifname>] [bssid <BSSID>]]\n"
+#| "\n"
+#| " wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] "
+#| "[ifname <ifname>]\n"
+#| " [bssid <BSSID>] [name <name>] [private yes|no]\n"
+#| "\n"
+#| " wifi rescan [[ifname] <ifname>]\n"
+#| "\n"
+#| " wimax [list [ifname <ifname>] [nsp <name>]]\n"
+#| "\n"
msgid ""
"Usage: nmcli device { COMMAND | help }\n"
"\n"
-"COMMAND := { status | show | connect | disconnect | wifi | wimax }\n"
+"COMMAND := { status | show | connect | disconnect | delete | wifi | wimax }\n"
"\n"
-"COMMAND := { status | show | connect | disconnect | wifi }\n"
+"COMMAND := { status | show | connect | disconnect | delete | wifi }\n"
"\n"
" status\n"
"\n"
@@ -2947,6 +3706,8 @@ msgid ""
"\n"
" disconnect <ifname>\n"
"\n"
+" delete <ifname>\n"
+"\n"
" wifi [list [ifname <ifname>] [bssid <BSSID>]]\n"
"\n"
" wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] "
@@ -2983,7 +3744,7 @@ msgstr ""
" wimax [list [ifname <интерфейÑ>] [nsp <имÑ>]]\n"
"\n"
-#: ../cli/src/devices.c:298
+#: ../clients/cli/devices.c:283
#, c-format
msgid ""
"Usage: nmcli device status { help }\n"
@@ -2994,8 +3755,10 @@ msgid ""
" TYPE - device type\n"
" STATE - device state\n"
" CONNECTION - connection activated on device (if any)\n"
-"Displayed columns can be changed using '--fields' global option. 'status' is\n"
-"the default command, which means 'nmcli device' calls 'nmcli device status'.\n"
+"Displayed columns can be changed using '--fields' global option. 'status' "
+"is\n"
+"the default command, which means 'nmcli device' calls 'nmcli device "
+"status'.\n"
"\n"
msgstr ""
"Формат: nmcli device status { help }\n"
@@ -3011,7 +3774,7 @@ msgstr ""
"gen status».\n"
"\n"
-#: ../cli/src/devices.c:314
+#: ../clients/cli/devices.c:298
#, c-format
msgid ""
"Usage: nmcli device show { ARGUMENTS | help }\n"
@@ -3030,7 +3793,7 @@ msgstr ""
"отдельно выбранном уÑтройÑтве.\n"
"\n"
-#: ../cli/src/devices.c:326
+#: ../clients/cli/devices.c:309
#, c-format
msgid ""
"Usage: nmcli device connect { ARGUMENTS | help }\n"
@@ -3038,8 +3801,8 @@ msgid ""
"ARGUMENTS := <ifname>\n"
"\n"
"Connect the device.\n"
-"NetworkManager will try to find a suitable connection that will be activated."
-"\n"
+"NetworkManager will try to find a suitable connection that will be "
+"activated.\n"
"It will also consider connections that are not set to auto-connect.\n"
"\n"
msgstr ""
@@ -3052,7 +3815,7 @@ msgstr ""
"Ð¿Ñ€Ð¸Ð½Ð¸Ð¼Ð°Ñ Ð²Ð¾ внимание ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð±ÐµÐ· включенных функций\n"
"автоматичеÑкого запуÑка.\n"
-#: ../cli/src/devices.c:339
+#: ../clients/cli/devices.c:321
#, c-format
msgid ""
"Usage: nmcli device disconnect { ARGUMENTS | help }\n"
@@ -3073,7 +3836,36 @@ msgstr ""
"\n"
"\n"
-#: ../cli/src/devices.c:352
+#: ../clients/cli/devices.c:333
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: nmcli device show { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := [<ifname>]\n"
+#| "\n"
+#| "Show details of device(s).\n"
+#| "The command lists details for all devices, or for a given device.\n"
+#| "\n"
+msgid ""
+"Usage: nmcli device delete { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := <ifname>\n"
+"\n"
+"Deletes the software device.\n"
+"The command removes the interface. It only works for software devices\n"
+"(like bonds, bridges, etc.). Hardware devices cannot be deleted by the\n"
+"command.\n"
+"\n"
+msgstr ""
+"Формат: nmcli device show { ÐРГУМЕÐТЫ | help }\n"
+"\n"
+"ÐРГУМЕÐТЫ := [<интерфейÑ>]\n"
+"\n"
+"Показывает информацию обо вÑех или\n"
+"отдельно выбранном уÑтройÑтве.\n"
+"\n"
+
+#: ../clients/cli/devices.c:346
#, c-format
msgid ""
"Usage: nmcli device wifi { ARGUMENTS | help }\n"
@@ -3085,8 +3877,8 @@ msgid ""
"List available Wi-Fi access points. The 'ifname' and 'bssid' options can be\n"
"used to list APs for a particular interface, or with a specific BSSID.\n"
"\n"
-"ARGUMENTS := connect <(B)SSID> [password <password>] [wep-key-type "
-"key|phrase] [ifname <ifname>]\n"
+"ARGUMENTS := connect <(B)SSID> [password <password>] [wep-key-type key|"
+"phrase] [ifname <ifname>]\n"
" [bssid <BSSID>] [name <name>] [private yes|no]\n"
"\n"
"Connect to a Wi-Fi network specified by SSID or BSSID. The command creates\n"
@@ -3100,8 +3892,10 @@ msgid ""
"\n"
"ARGUMENTS := rescan [[ifname] <ifname>]\n"
"\n"
-"Request that NetworkManager immediately re-scan for available access points.\n"
-"NetworkManager scans Wi-Fi networks periodically, but in some cases it might\n"
+"Request that NetworkManager immediately re-scan for available access "
+"points.\n"
+"NetworkManager scans Wi-Fi networks periodically, but in some cases it "
+"might\n"
"be useful to start scanning manually. Note that this command does not show\n"
"the APs, use 'nmcli device wifi list' for that.\n"
"\n"
@@ -3137,7 +3931,7 @@ msgstr ""
"но иногда Ñто надо Ñделать Ñразу. Эта команда не показывает ÑпиÑок \n"
"точек доÑтупа — Ð´Ð»Ñ Ñтой цели Ñлужит «nmcli device wifi list».\n"
-#: ../cli/src/devices.c:386
+#: ../clients/cli/devices.c:379
#, c-format
msgid ""
"Usage: nmcli device wimax { ARGUMENTS | help }\n"
@@ -3156,203 +3950,226 @@ msgstr ""
"\n"
"ÐРГУМЕÐТЫ := [list [ifname <интерфейÑ>] [nsp <имÑ>]]\n"
"\n"
-"Возвращает ÑпиÑок доÑтупных WiMAX NSP. С помощью параметров \n"
+"Возвращает ÑпиÑок доÑтупных WiMAX NSP. С помощью параметров \n"
"«ifname» и «ncp» можно выбрать Ñети Ð´Ð»Ñ ÐºÐ¾Ð½ÐºÑ€ÐµÑ‚Ð½Ð¾Ð³Ð¾ интерфейÑа или NCP.\n"
"\n"
-#: ../cli/src/devices.c:480
+#: ../clients/cli/devices.c:522 ../clients/cli/devices.c:721
msgid "(none)"
msgstr "(нет)"
-#: ../cli/src/devices.c:547
+#: ../clients/cli/devices.c:591
#, c-format
msgid "%u MHz"
msgstr "%u МГц"
-#: ../cli/src/devices.c:548
+#: ../clients/cli/devices.c:592
#, c-format
msgid "%u Mbit/s"
msgstr "%u МБ/Ñ"
-#: ../cli/src/devices.c:567
+#: ../clients/cli/devices.c:607
msgid "WPA1"
msgstr "WPA1"
-#: ../cli/src/devices.c:576
+#: ../clients/cli/devices.c:616
msgid "802.1X"
msgstr "802.1X"
-#: ../cli/src/devices.c:592
+#: ../clients/cli/devices.c:632
msgid "Ad-Hoc"
msgstr "Ad-Hoc"
-#: ../cli/src/devices.c:593
+#: ../clients/cli/devices.c:633
msgid "Infra"
msgstr "ИнфраÑтруктура"
-#: ../cli/src/devices.c:625
+#: ../clients/cli/devices.c:634
+msgid "N/A"
+msgstr "Ð/Д"
+
+#: ../clients/cli/devices.c:672
msgid "Home"
msgstr "Дом"
-#: ../cli/src/devices.c:628
+#: ../clients/cli/devices.c:675
msgid "Partner"
msgstr "Партнёр"
-#: ../cli/src/devices.c:631
+#: ../clients/cli/devices.c:678
msgid "Roaming"
msgstr "Роуминг"
-#: ../cli/src/devices.c:725
+#: ../clients/cli/devices.c:836
msgid "Device details"
msgstr "Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± уÑтройÑтве"
-#: ../cli/src/devices.c:737
+#: ../clients/cli/devices.c:848
#, c-format
msgid "Error: 'device show': %s"
msgstr "Ошибка «device show»: %s"
-#: ../cli/src/devices.c:787 ../cli/src/devices.c:790 ../cli/src/devices.c:1334
-#: ../cli/src/devices.c:1474
+#: ../clients/cli/devices.c:899 ../clients/cli/devices.c:902
msgid "(unknown)"
msgstr "(неизвеÑтно)"
-#: ../cli/src/devices.c:827
+#: ../clients/cli/devices.c:940
#, c-format
msgid "%u Mb/s"
msgstr "%u Мб/c"
-#: ../cli/src/devices.c:913
+#: ../clients/cli/devices.c:1027
msgid "on"
msgstr "вкл."
-#: ../cli/src/devices.c:913
+#: ../clients/cli/devices.c:1027
msgid "off"
msgstr "выкл."
-#: ../cli/src/devices.c:1188
+#: ../clients/cli/devices.c:1313
#, c-format
msgid "Error: 'device status': %s"
msgstr "Ошибка: «device status»: %s"
-#: ../cli/src/devices.c:1206
+#. Add headers
+#: ../clients/cli/devices.c:1320
msgid "Status of devices"
msgstr "СоÑтоÑние уÑтройÑтв"
-#: ../cli/src/devices.c:1237
+#: ../clients/cli/devices.c:1351
#, c-format
msgid "Error: invalid extra argument '%s'."
msgstr "Ошибка. ÐедопуÑтимый дополнительный аргумент: «%s»."
-#: ../cli/src/devices.c:1265 ../cli/src/devices.c:1422
-#: ../cli/src/devices.c:1557 ../cli/src/devices.c:1696
-#: ../cli/src/devices.c:2436
+#: ../clients/cli/devices.c:1368 ../clients/cli/devices.c:1666
+#: ../clients/cli/devices.c:1816 ../clients/cli/devices.c:1903
+#: ../clients/cli/devices.c:2037 ../clients/cli/devices.c:2698
#, c-format
msgid "Error: Device '%s' not found."
msgstr "Ошибка: не найдено уÑтройÑтво «%s»."
-#: ../cli/src/devices.c:1319
-#, c-format
-msgid "Success: Device '%s' successfully activated."
+#: ../clients/cli/devices.c:1446
+#, fuzzy, c-format
+#| msgid "Success: Device '%s' successfully activated."
+msgid "Device '%s' successfully activated with '%s'.\n"
msgstr "УÑтройÑтво «%s» уÑпешно подключено."
-#: ../cli/src/devices.c:1333
+#: ../clients/cli/devices.c:1452
+#, fuzzy, c-format
+#| msgid "Error: Connection activation failed: (%d) %s."
+msgid "Error: Connection activation failed: (%d) %s.\n"
+msgstr "Ошибка: Ñбой активации ÑоединениÑ: (%d) %s."
+
+#: ../clients/cli/devices.c:1486
+#, fuzzy, c-format
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Error: Failed to add/activate new connection: %s"
+msgstr "Ошибка: не удалоÑÑŒ добавить или активировать новое Ñоединение: (%d) %s"
+
+#: ../clients/cli/devices.c:1495
+#, c-format
+msgid "Error: Failed to add/activate new connection: Unknown error"
+msgstr ""
+"Ошибка: не удалоÑÑŒ добавить или активировать новое Ñоединение: неизвеÑÑ‚Ð½Ð°Ñ "
+"ошибка"
+
+#: ../clients/cli/devices.c:1506
+#, c-format
+msgid "Connection with UUID '%s' created and activated on device '%s'\n"
+msgstr "Соединение Ñ UUID «%s» Ñоздано и задейÑтвовано на уÑтройÑтве «%s»\n"
+
+#: ../clients/cli/devices.c:1570
#, c-format
msgid "Error: Device activation failed: %s"
msgstr "Ошибка. Ðе удалоÑÑŒ отключить уÑтройÑтво: %s"
-#: ../cli/src/devices.c:1350
+#: ../clients/cli/devices.c:1579
+#, fuzzy, c-format
+#| msgid "Error: Device activation failed: %s"
+msgid "Error: Device activation failed: device was disconnected"
+msgstr "Ошибка. Ðе удалоÑÑŒ отключить уÑтройÑтво: %s"
+
+#: ../clients/cli/devices.c:1594
#, c-format
msgid "Device '%s' has been connected.\n"
msgstr "УÑтройÑтво «%s» подключено.\n"
-#: ../cli/src/devices.c:1377 ../cli/src/devices.c:1512
-msgid "Interface: "
-msgstr "ИнтерфейÑ:"
-
-#: ../cli/src/devices.c:1381 ../cli/src/devices.c:1390
-#: ../cli/src/devices.c:1516 ../cli/src/devices.c:1525
+#: ../clients/cli/devices.c:1635 ../clients/cli/devices.c:1644
+#: ../clients/cli/devices.c:1785 ../clients/cli/devices.c:1794
+#: ../clients/cli/devices.c:1873 ../clients/cli/devices.c:1881
#, c-format
msgid "Error: No interface specified."
msgstr "Ошибка. Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½Ðµ определен."
-#: ../cli/src/devices.c:1396 ../cli/src/devices.c:1531
+#: ../clients/cli/devices.c:1650 ../clients/cli/devices.c:1800
+#: ../clients/cli/devices.c:1887
#, c-format
msgid "Error: extra argument not allowed: '%s'."
msgstr "Ошибка. Дополнительный аргумент не разрешен: «%s»."
-#: ../cli/src/devices.c:1459
-#, c-format
-msgid "Success: Device '%s' successfully disconnected."
+#: ../clients/cli/devices.c:1714 ../clients/cli/devices.c:1725
+#, fuzzy, c-format
+#| msgid "Success: Device '%s' successfully disconnected."
+msgid "Device '%s' successfully disconnected.\n"
msgstr "Выполнено: уÑтройÑтво «%s» отключено."
-#: ../cli/src/devices.c:1471
+#: ../clients/cli/devices.c:1739
#, c-format
msgid "Error: Device '%s' (%s) disconnecting failed: %s"
msgstr "Ошибка: не удалоÑÑŒ отключить уÑтройÑтво «%s» (%s): %s"
-#: ../cli/src/devices.c:1485
+#: ../clients/cli/devices.c:1754
#, c-format
msgid "Device '%s' has been disconnected.\n"
msgstr "УÑтройÑтво «%s» отключено.\n"
-#: ../cli/src/devices.c:1628
+#: ../clients/cli/devices.c:1845
+#, fuzzy, c-format
+#| msgid "Error: Device '%s' (%s) disconnecting failed: %s"
+msgid "Error: Device '%s' (%s) deletion failed: %s"
+msgstr "Ошибка: не удалоÑÑŒ отключить уÑтройÑтво «%s» (%s): %s"
+
+#: ../clients/cli/devices.c:1909
+#, fuzzy, c-format
+#| msgid "Error: setting '%s' is mandatory and cannot be removed.\n"
+msgid "Error: Device '%s' is a hardware device. It can't be deleted."
+msgstr "Ошибка. ОбÑзательное значение «%s» не может быть удалено.\n"
+
+#: ../clients/cli/devices.c:1980
msgid "Wi-Fi scan list"
msgstr "СпиÑок ÑÐºÐ°Ð½Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Wi-Fi"
-#: ../cli/src/devices.c:1666
+#: ../clients/cli/devices.c:2018
#, c-format
msgid "Error: 'device wifi': %s"
msgstr "Ошибка «device wifi»: «%s»"
-#: ../cli/src/devices.c:1719 ../cli/src/devices.c:1788
+#: ../clients/cli/devices.c:2060 ../clients/cli/devices.c:2135
#, c-format
msgid "Error: Access point with bssid '%s' not found."
msgstr "Ошибка: точка доÑтупа Ñ bssid «%s» не найдена."
-#: ../cli/src/devices.c:1743 ../cli/src/devices.c:2131
-#: ../cli/src/devices.c:2293
+#: ../clients/cli/devices.c:2084 ../clients/cli/devices.c:2401
+#: ../clients/cli/devices.c:2565
#, c-format
msgid "Error: Device '%s' is not a Wi-Fi device."
msgstr "Ошибка: «%s» не ÑвлÑетÑÑ ÑƒÑтройÑтвом WiFi."
-#: ../cli/src/devices.c:1825 ../cli/src/devices.c:1872
-#, c-format
-msgid "Connection with UUID '%s' created and activated on device '%s'\n"
-msgstr "Соединение Ñ UUID «%s» Ñоздано и задейÑтвовано на уÑтройÑтве «%s»\n"
-
-#: ../cli/src/devices.c:1829
-#, c-format
-msgid "Error: Connection activation failed: (%d) %s."
-msgstr "Ошибка: Ñбой активации ÑоединениÑ: (%d) %s."
-
-#: ../cli/src/devices.c:1854
-#, c-format
-msgid "Error: Failed to add/activate new connection: (%d) %s"
-msgstr ""
-"Ошибка: не удалоÑÑŒ добавить или активировать новое Ñоединение: (%d) %s"
-
-#: ../cli/src/devices.c:1862
-#, c-format
-msgid "Error: Failed to add/activate new connection: Unknown error"
-msgstr ""
-"Ошибка: не удалоÑÑŒ добавить или активировать новое Ñоединение: неизвеÑÑ‚Ð½Ð°Ñ "
-"ошибка"
-
-#: ../cli/src/devices.c:2013
+#: ../clients/cli/devices.c:2294
msgid "SSID or BSSID: "
msgstr "SSID или BSSID: "
-#: ../cli/src/devices.c:2018
+#: ../clients/cli/devices.c:2299
#, c-format
msgid "Error: SSID or BSSID are missing."
msgstr "Ошибка: не указан SSID или BSSID."
-#: ../cli/src/devices.c:2042
+#: ../clients/cli/devices.c:2323
#, c-format
msgid "Error: bssid argument value '%s' is not a valid BSSID."
msgstr "Ошибка: недопуÑтимое значение аргумента bssid «%s»."
-#: ../cli/src/devices.c:2066
+#: ../clients/cli/devices.c:2347
#, c-format
msgid ""
"Error: wep-key-type argument value '%s' is invalid, use 'key' or 'phrase'."
@@ -3360,141 +4177,153 @@ msgstr ""
"Ошибка: недопуÑтимое значение аргумента wep-key-type «%s»; иÑпользуйте «key» "
"или «phrase»."
-#: ../cli/src/devices.c:2086
+#: ../clients/cli/devices.c:2367
#, c-format
msgid "Error: %s: %s."
msgstr "Ошибка: %s: %s."
-#: ../cli/src/devices.c:2101
+#: ../clients/cli/devices.c:2382
#, c-format
msgid "Error: BSSID to connect to (%s) differs from bssid argument (%s)."
msgstr ""
"Ошибка: BSSID Ð´Ð»Ñ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ðº (%s) отличаетÑÑ Ð¾Ñ‚ bssid аргумента (%s)."
-#: ../cli/src/devices.c:2107
+#: ../clients/cli/devices.c:2388
#, c-format
msgid "Error: Parameter '%s' is neither SSID nor BSSID."
msgstr "Ошибка: параметр «%s» не ÑвлÑетÑÑ SSID или BSSID."
-#: ../cli/src/devices.c:2133 ../cli/src/devices.c:2295
+#: ../clients/cli/devices.c:2403 ../clients/cli/devices.c:2567
#, c-format
msgid "Error: No Wi-Fi device found."
msgstr "Ошибка: уÑтройÑтва Wi-Fi не найдены."
-#: ../cli/src/devices.c:2151
+#: ../clients/cli/devices.c:2421
#, c-format
msgid "Error: No network with SSID '%s' found."
msgstr "Ошибка: не найдена Ñеть Ñ SSID «%s»."
-#: ../cli/src/devices.c:2153
+#: ../clients/cli/devices.c:2423
#, c-format
msgid "Error: No access point with BSSID '%s' found."
msgstr "Ошибка: точка доÑтупа Ñ BSSID «%s» не найдена."
-#: ../cli/src/devices.c:2192
+#: ../clients/cli/devices.c:2462
msgid "Password: "
msgstr "Пароль:"
-#: ../cli/src/devices.c:2321
+#: ../clients/cli/devices.c:2594
#, c-format
msgid "Error: 'device wifi' command '%s' is not valid."
msgstr "Ошибка. ÐÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «device wifi»: «%s»."
-#: ../cli/src/devices.c:2368
+#: ../clients/cli/devices.c:2641
msgid "WiMAX NSP list"
msgstr "СпиÑок WiMAX NSP"
-#: ../cli/src/devices.c:2405
+#: ../clients/cli/devices.c:2678
#, c-format
msgid "Error: 'device wimax': %s"
msgstr "Ошибка: «device wimax»: %s"
-#: ../cli/src/devices.c:2459
+#: ../clients/cli/devices.c:2721
#, c-format
msgid "Error: NSP with name '%s' not found."
msgstr "Ошибка: NSP Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ «%s» не найден."
-#: ../cli/src/devices.c:2472
+#: ../clients/cli/devices.c:2734
#, c-format
msgid "Error: Device '%s' is not a WiMAX device."
msgstr "Ошибка: «%s» не ÑвлÑетÑÑ ÑƒÑтройÑтвом WIMAX."
-#: ../cli/src/devices.c:2510
+#: ../clients/cli/devices.c:2778
#, c-format
msgid "Error: Access point with nsp '%s' not found."
msgstr "Ошибка: точка доÑтупа Ñ nsp «%s» не найдена."
-#: ../cli/src/devices.c:2542
+#: ../clients/cli/devices.c:2815
#, c-format
msgid "Error: 'device wimax' command '%s' is not valid."
msgstr "Ошибка. ÐÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «device wimax»: «%s»."
-#: ../cli/src/devices.c:2621
+#: ../clients/cli/devices.c:2988
#, c-format
msgid "Error: 'dev' command '%s' is not valid."
msgstr "Ошибка. ÐÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «dev»: «%s»."
-#: ../cli/src/network-manager.c:37
+#: ../clients/cli/general.c:35
msgid "RUNNING"
msgstr "ВЫПОЛÐЯЕТСЯ"
-#: ../cli/src/network-manager.c:38
+#. 0
+#: ../clients/cli/general.c:36
msgid "VERSION"
msgstr "ВЕРСИЯ"
-#: ../cli/src/network-manager.c:40
+#. 2
+#: ../clients/cli/general.c:38
msgid "STARTUP"
msgstr "ЗÐПУСК"
-#: ../cli/src/network-manager.c:41
+#. 3
+#: ../clients/cli/general.c:39
msgid "CONNECTIVITY"
msgstr "СВЯЗЬ"
-#: ../cli/src/network-manager.c:42
+#. 4
+#: ../clients/cli/general.c:40
msgid "NETWORKING"
msgstr "СЕТЬ"
-#: ../cli/src/network-manager.c:43
+#. 5
+#: ../clients/cli/general.c:41
msgid "WIFI-HW"
msgstr "WIFI-HW"
-#: ../cli/src/network-manager.c:44
+#. 6
+#: ../clients/cli/general.c:42
msgid "WIFI"
msgstr "WIFI"
-#: ../cli/src/network-manager.c:45
+#. 7
+#: ../clients/cli/general.c:43
msgid "WWAN-HW"
msgstr "WWAN-HW"
-#: ../cli/src/network-manager.c:46
+#. 8
+#: ../clients/cli/general.c:44
msgid "WWAN"
msgstr "WWAN"
-#: ../cli/src/network-manager.c:47
+#. 9
+#: ../clients/cli/general.c:45
msgid "WIMAX-HW"
msgstr "WIMAX-HW"
-#: ../cli/src/network-manager.c:48
+#. 10
+#: ../clients/cli/general.c:46
msgid "WIMAX"
msgstr "WIMAX"
-#: ../cli/src/network-manager.c:70
+#: ../clients/cli/general.c:68
msgid "PERMISSION"
msgstr "РÐЗРЕШЕÐИЕ"
-#: ../cli/src/network-manager.c:71
+#. 0
+#: ../clients/cli/general.c:69
msgid "VALUE"
msgstr "ЗÐÐЧЕÐИЕ"
-#: ../cli/src/network-manager.c:79
+#: ../clients/cli/general.c:77
msgid "LEVEL"
msgstr "УРОВЕÐЬ"
-#: ../cli/src/network-manager.c:80
+#. 0
+#: ../clients/cli/general.c:78
msgid "DOMAINS"
msgstr "ДОМЕÐЫ"
-#: ../cli/src/network-manager.c:95
+#: ../clients/cli/general.c:92
#, c-format
msgid ""
"Usage: nmcli general { COMMAND | help }\n"
@@ -3523,7 +4352,7 @@ msgstr ""
" logging [level <уровень>] [domains <домены>]\n"
"\n"
-#: ../cli/src/network-manager.c:107
+#: ../clients/cli/general.c:103
#, c-format
msgid ""
"Usage: nmcli general status { help }\n"
@@ -3536,11 +4365,11 @@ msgstr ""
"Формат: nmcli general status { help }\n"
"\n"
"Возвращает ÑÑ‚Ð°Ñ‚ÑƒÑ NetworkManager.\n"
-"«status» иÑпользуетÑÑ Ð¿Ð¾ умолчанию, то еÑÑ‚ÑŒ «nmcli gen» Ñквивалентно «nmcli "
+"«status» иÑпользуетÑÑ Ð¿Ð¾ умолчанию, то еÑÑ‚ÑŒ «nmcli gen» Ñквивалентно «nmcli "
"gen status».\n"
"\n"
-#: ../cli/src/network-manager.c:117
+#: ../clients/cli/general.c:112
#, c-format
msgid ""
"Usage: nmcli general hostname { ARGUMENTS | help }\n"
@@ -3549,8 +4378,8 @@ msgid ""
"\n"
"Get or change persistent system hostname.\n"
"With no arguments, this prints currently configured hostname. When you pass\n"
-"a hostname, NetworkManager will set it as the new persistent system hostname."
-"\n"
+"a hostname, NetworkManager will set it as the new persistent system "
+"hostname.\n"
"\n"
msgstr ""
"Формат: nmcli general hostname { ÐРГУМЕÐТЫ | help }\n"
@@ -3562,7 +4391,7 @@ msgstr ""
"Ð’ противном Ñлучае Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð° будет изменено. \n"
"\n"
-#: ../cli/src/network-manager.c:130
+#: ../clients/cli/general.c:124
#, c-format
msgid ""
"Usage: nmcli general permissions { help }\n"
@@ -3575,7 +4404,7 @@ msgstr ""
"Возвращает Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ð´Ð»Ñ Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ñ‹Ñ… операций.\n"
"\n"
-#: ../cli/src/network-manager.c:139
+#: ../clients/cli/general.c:132
#, c-format
msgid ""
"Usage: nmcli general logging { ARGUMENTS | help }\n"
@@ -3599,7 +4428,7 @@ msgstr ""
"Полный ÑпиÑок доменов можно найти на Ñправочной Ñтранице команды.\n"
"\n"
-#: ../cli/src/network-manager.c:153
+#: ../clients/cli/general.c:145
#, c-format
msgid ""
"Usage: nmcli networking { COMMAND | help }\n"
@@ -3624,29 +4453,33 @@ msgstr ""
" connectivity [check]\n"
"\n"
-#: ../cli/src/network-manager.c:164
+#: ../clients/cli/general.c:155
#, c-format
-msgid "Usage: nmcli networking on { help }\n"
+msgid ""
+"Usage: nmcli networking on { help }\n"
"\n"
"Switch networking on.\n"
"\n"
-msgstr "Формат: nmcli networking on { help }\n"
+msgstr ""
+"Формат: nmcli networking on { help }\n"
"\n"
"Включает Ñетевые функции.\n"
"\n"
-#: ../cli/src/network-manager.c:173
+#: ../clients/cli/general.c:163
#, c-format
-msgid "Usage: nmcli networking off { help }\n"
+msgid ""
+"Usage: nmcli networking off { help }\n"
"\n"
"Switch networking off.\n"
"\n"
-msgstr "Формат: nmcli networking off { help }\n"
+msgstr ""
+"Формат: nmcli networking off { help }\n"
"\n"
"Отключает Ñетевые функции.\n"
"\n"
-#: ../cli/src/network-manager.c:182
+#: ../clients/cli/general.c:171
#, c-format
msgid ""
"Usage: nmcli networking connectivity { ARGUMENTS | help }\n"
@@ -3654,8 +4487,8 @@ msgid ""
"ARGUMENTS := [check]\n"
"\n"
"Get network connectivity state.\n"
-"The optional 'check' argument makes NetworkManager re-check the connectivity."
-"\n"
+"The optional 'check' argument makes NetworkManager re-check the "
+"connectivity.\n"
"\n"
msgstr ""
"Формат: nmcli networking connectivity { ÐРГУМЕÐТЫ | help }\n"
@@ -3666,7 +4499,7 @@ msgstr ""
"Дополнительный аргумент «check» повторно проверÑет подключение.\n"
"\n"
-#: ../cli/src/network-manager.c:195
+#: ../clients/cli/general.c:183
#, c-format
msgid ""
"Usage: nmcli radio { COMMAND | help }\n"
@@ -3691,7 +4524,7 @@ msgstr ""
" all | wifi | wwan [ on | off ]\n"
"\n"
-#: ../cli/src/network-manager.c:210
+#: ../clients/cli/general.c:197
#, c-format
msgid ""
"Usage: nmcli radio all { ARGUMENTS | help }\n"
@@ -3708,7 +4541,7 @@ msgstr ""
"ПроÑмотр и изменение ÑтатуÑа вÑех переключателей.\n"
"\n"
-#: ../cli/src/network-manager.c:221
+#: ../clients/cli/general.c:207
#, c-format
msgid ""
"Usage: nmcli radio wifi { ARGUMENTS | help }\n"
@@ -3725,7 +4558,7 @@ msgstr ""
"ПроÑмотр и изменение ÑтатуÑа Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð°Ñ‚ÐµÐ»Ñ Wi-Fi.\n"
"\n"
-#: ../cli/src/network-manager.c:232
+#: ../clients/cli/general.c:217
#, c-format
msgid ""
"Usage: nmcli radio wwan { ARGUMENTS | help }\n"
@@ -3742,7 +4575,7 @@ msgstr ""
"ПроÑмотр и изменение ÑтатуÑа Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð°Ñ‚ÐµÐ»Ñ Ð¼Ð¾Ð±Ð¸Ð»ÑŒÐ½Ð¾Ð³Ð¾ ÑоединениÑ.\n"
"\n"
-#: ../cli/src/network-manager.c:244
+#: ../clients/cli/general.c:228
#, c-format
msgid ""
"Usage: nmcli radio wimax { ARGUMENTS | help }\n"
@@ -3759,171 +4592,191 @@ msgstr ""
"ПроÑмотр и изменение ÑтатуÑа Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð°Ñ‚ÐµÐ»Ñ WiMAX.\n"
"\n"
-#: ../cli/src/network-manager.c:264
+#: ../clients/cli/general.c:248
msgid "asleep"
msgstr "ÑпÑщий"
-#: ../cli/src/network-manager.c:266
+#: ../clients/cli/general.c:250
msgid "connecting"
msgstr "подключение"
-#: ../cli/src/network-manager.c:268
+#: ../clients/cli/general.c:252
msgid "connected (local only)"
msgstr "подключен (локально)"
-#: ../cli/src/network-manager.c:270
+#: ../clients/cli/general.c:254
msgid "connected (site only)"
msgstr "подключен (на узле)"
-#: ../cli/src/network-manager.c:274
+#: ../clients/cli/general.c:258
msgid "disconnecting"
msgstr "отключение"
-#: ../cli/src/network-manager.c:290
+#: ../clients/cli/general.c:294
msgid "portal"
msgstr "портал"
-#: ../cli/src/network-manager.c:292
+#: ../clients/cli/general.c:296
msgid "limited"
msgstr "ограничено"
-#: ../cli/src/network-manager.c:294
+#: ../clients/cli/general.c:298
msgid "full"
msgstr "полноÑтью"
-#: ../cli/src/network-manager.c:332
+#: ../clients/cli/general.c:352
#, c-format
msgid "Error: only these fields are allowed: %s"
msgstr "Ошибка. ДопуÑтимые полÑ: %s"
-#: ../cli/src/network-manager.c:348 ../cli/src/network-manager.c:349
-#: ../cli/src/network-manager.c:350 ../cli/src/network-manager.c:351
-#: ../cli/src/network-manager.c:352 ../cli/src/network-manager.c:354
-#: ../cli/src/network-manager.c:355
-msgid "enabled"
-msgstr "включен"
-
-#: ../cli/src/network-manager.c:348 ../cli/src/network-manager.c:349
-#: ../cli/src/network-manager.c:350 ../cli/src/network-manager.c:351
-#: ../cli/src/network-manager.c:352 ../cli/src/network-manager.c:354
-#: ../cli/src/network-manager.c:355
-msgid "disabled"
-msgstr "отключен"
-
-#: ../cli/src/network-manager.c:367
+#: ../clients/cli/general.c:382
msgid "NetworkManager status"
msgstr "СоÑтоÑние NetworkManager"
-#: ../cli/src/network-manager.c:372
+#: ../clients/cli/general.c:387
msgid "running"
msgstr "выполнÑетÑÑ"
-#: ../cli/src/network-manager.c:372
-msgid "not running"
-msgstr "не выполнÑетÑÑ"
-
-#: ../cli/src/network-manager.c:375
+#: ../clients/cli/general.c:390
msgid "starting"
msgstr "запуÑкаетÑÑ"
-#: ../cli/src/network-manager.c:375
+#: ../clients/cli/general.c:390
msgid "started"
msgstr "запущено"
-#: ../cli/src/network-manager.c:446
+#: ../clients/cli/general.c:392 ../clients/cli/general.c:393
+#: ../clients/cli/general.c:394 ../clients/cli/general.c:395
+#: ../clients/cli/general.c:396 ../clients/cli/general.c:398
+#: ../clients/cli/general.c:399
+msgid "enabled"
+msgstr "включен"
+
+#: ../clients/cli/general.c:392 ../clients/cli/general.c:393
+#: ../clients/cli/general.c:394 ../clients/cli/general.c:395
+#: ../clients/cli/general.c:396 ../clients/cli/general.c:398
+#: ../clients/cli/general.c:399
+msgid "disabled"
+msgstr "отключен"
+
+#: ../clients/cli/general.c:476
msgid "auth"
msgstr "подлинный"
-#: ../cli/src/network-manager.c:475
+#: ../clients/cli/general.c:505
#, c-format
msgid "Error: 'general permissions': %s"
msgstr "Ошибка общих разрешений: %s"
-#: ../cli/src/network-manager.c:489
+#: ../clients/cli/general.c:519
msgid "NetworkManager permissions"
msgstr "Ð Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ NetworkManager"
-#: ../cli/src/network-manager.c:530
+#: ../clients/cli/general.c:560
#, c-format
msgid "Error: 'general logging': %s"
msgstr "Ошибка «general logging»: %s"
-#: ../cli/src/network-manager.c:545
+#: ../clients/cli/general.c:575
msgid "NetworkManager logging"
msgstr "Ведение журналов NetworkManager"
-#: ../cli/src/network-manager.c:565
-#, c-format
-msgid "Error: failed to set hostname: (%d) %s"
+#: ../clients/cli/general.c:597
+#, fuzzy, c-format
+#| msgid "Error: failed to set hostname: (%d) %s"
+msgid "Error: failed to set hostname: %s"
msgstr "Ошибка. Ðе удалоÑÑŒ уÑтановить Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°: (%d) %s"
-#: ../cli/src/network-manager.c:682
-#, c-format
-msgid "Error: access denied to set logging; %s"
+#: ../clients/cli/general.c:710
+#, fuzzy, c-format
+#| msgid "Error: access denied to set logging; %s"
+msgid "Error: failed to set logging: %s"
msgstr "Ошибка. Отказ доÑтупа при наÑтройке журналированиÑ, %s"
-#: ../cli/src/network-manager.c:684
-#, c-format
-msgid "Error: %s"
-msgstr "Ошибка: %s"
-
-#: ../cli/src/network-manager.c:692
+#: ../clients/cli/general.c:719
#, c-format
msgid "Error: 'general' command '%s' is not valid."
msgstr "Ошибка. ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «general»: «%s»."
-#: ../cli/src/network-manager.c:710
+#: ../clients/cli/general.c:737
#, c-format
msgid "Error: '--fields' value '%s' is not valid here (allowed field: %s)"
msgstr "ÐедопуÑтимое поле «--fields»: «%s». ДопуÑкаетÑÑ: %s"
-#: ../cli/src/network-manager.c:735
+#: ../clients/cli/general.c:762
#, c-format
msgid "Error: invalid '%s' argument: '%s' (use on/off)."
-msgstr ""
-"ÐедопуÑтимый аргумент «%s»: «%s». Может принимать Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ on или off."
+msgstr "ÐедопуÑтимый аргумент «%s»: «%s». Может принимать Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ on или off."
-#: ../cli/src/network-manager.c:746
+#: ../clients/cli/general.c:773
msgid "Connectivity"
msgstr "Соединение"
-#: ../cli/src/network-manager.c:758
+#: ../clients/cli/general.c:788
msgid "Networking"
msgstr "Сеть"
-#: ../cli/src/network-manager.c:783
+#: ../clients/cli/general.c:813
#, c-format
msgid "Error: 'networking connectivity' command '%s' is not valid."
msgstr "Ошибка. ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «networking connectivity»: «%s»."
-#: ../cli/src/network-manager.c:799
+#: ../clients/cli/general.c:829
#, c-format
msgid "Error: 'networking' command '%s' is not valid."
msgstr "Ошибка. ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «networking»: «%s»."
-#: ../cli/src/network-manager.c:825 ../cli/src/network-manager.c:845
+#: ../clients/cli/general.c:858 ../clients/cli/general.c:878
msgid "Radio switches"
msgstr "Переключатели"
-#: ../cli/src/network-manager.c:863
+#. no argument, show current WiFi state
+#: ../clients/cli/general.c:896
msgid "Wi-Fi radio switch"
msgstr "Переключатель Wi-Fi"
-#: ../cli/src/network-manager.c:879
+#. no argument, show current WWAN (mobile broadband) state
+#: ../clients/cli/general.c:912
msgid "WWAN radio switch"
msgstr "Переключатель WWAN"
-#: ../cli/src/network-manager.c:896
+#. no argument, show current WiMAX state
+#: ../clients/cli/general.c:929
msgid "WiMAX radio switch"
msgstr "Переключатель WiMAX"
-#: ../cli/src/network-manager.c:908
+#: ../clients/cli/general.c:941
#, c-format
msgid "Error: 'radio' command '%s' is not valid."
msgstr "Ошибка. ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° «radio»: «%s»."
-#: ../cli/src/nmcli.c:78
-#, c-format
+#: ../clients/cli/nmcli.c:86
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
+#| "\n"
+#| "OPTIONS\n"
+#| " -t[erse] terse output\n"
+#| " -p[retty] pretty output\n"
+#| " -m[ode] tabular|multiline output mode\n"
+#| " -f[ields] <field1,field2,...>|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"
+#| " -w[ait] <seconds> set timeout waiting for "
+#| "finishing operations\n"
+#| " -v[ersion] show program version\n"
+#| " -h[elp] print this help\n"
+#| "\n"
+#| "OBJECT\n"
+#| " g[eneral] NetworkManager's general status and operations\n"
+#| " n[etworking] overall networking control\n"
+#| " r[adio] NetworkManager radio switches\n"
+#| " c[onnection] NetworkManager's connections\n"
+#| " d[evice] devices managed by NetworkManager\n"
+#| "\n"
msgid ""
"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
"\n"
@@ -3931,6 +4784,8 @@ msgid ""
" -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] <field1,field2,...>|all|common specify fields to output\n"
" -e[scape] yes|no escape columns separators in "
"values\n"
@@ -3948,6 +4803,7 @@ msgid ""
" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+" a[gent] NetworkManager secret agent or polkit agent\n"
"\n"
msgstr ""
"Формат: %s [ПÐРÐМЕТРЫ] ОБЪЕКТ { КОМÐÐДР| help }\n"
@@ -3976,372 +4832,483 @@ msgstr ""
" d[evice] уÑтройÑтва под управлением NetworkManager\n"
"\n"
-#: ../cli/src/nmcli.c:132
+#: ../clients/cli/nmcli.c:143
#, c-format
msgid "Error: Object '%s' is unknown, try 'nmcli help'."
msgstr "ÐеизвеÑтный объект «%s». Попробуйте выполнить «nmcli help»."
-#: ../cli/src/nmcli.c:162
+#: ../clients/cli/nmcli.c:173
#, c-format
msgid "Error: Option '--terse' is specified the second time."
msgstr "Ошибка. Параметр «--terse» указан дважды."
-#: ../cli/src/nmcli.c:167
+#: ../clients/cli/nmcli.c:178
#, c-format
msgid "Error: Option '--terse' is mutually exclusive with '--pretty'."
msgstr "Ошибка: параметры «--terse» и «--pretty» взаимоиÑключаемы."
-#: ../cli/src/nmcli.c:175
+#: ../clients/cli/nmcli.c:186
#, c-format
msgid "Error: Option '--pretty' is specified the second time."
msgstr "Ошибка: параметр «--pretty» указан дважды."
-#: ../cli/src/nmcli.c:180
+#: ../clients/cli/nmcli.c:191
#, c-format
msgid "Error: Option '--pretty' is mutually exclusive with '--terse'."
msgstr "Ошибка: параметры «--pretty» и «--terse» взаимоиÑключаемы."
-#: ../cli/src/nmcli.c:190 ../cli/src/nmcli.c:206 ../cli/src/nmcli.c:235
+#: ../clients/cli/nmcli.c:201 ../clients/cli/nmcli.c:217
+#: ../clients/cli/nmcli.c:235 ../clients/cli/nmcli.c:264
#, c-format
msgid "Error: missing argument for '%s' option."
msgstr "Ошибка: отÑутÑтвует аргумент параметра «%s»."
-#: ../cli/src/nmcli.c:199 ../cli/src/nmcli.c:215
+#: ../clients/cli/nmcli.c:210 ../clients/cli/nmcli.c:228
+#: ../clients/cli/nmcli.c:244
#, c-format
msgid "Error: '%s' is not valid argument for '%s' option."
msgstr "Ошибка: недопуÑтимый аргумент «%s» Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s»."
-#: ../cli/src/nmcli.c:222
+#: ../clients/cli/nmcli.c:251
#, c-format
msgid "Error: fields for '%s' options are missing."
msgstr "Ошибка: отÑутÑтвуют Ð¿Ð¾Ð»Ñ Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð² «%s»."
-#: ../cli/src/nmcli.c:240
+#: ../clients/cli/nmcli.c:269
#, c-format
msgid "Error: '%s' is not a valid timeout for '%s' option."
msgstr "Ошибка. ÐедопуÑтимое Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ («%s») Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s»."
-#: ../cli/src/nmcli.c:247
+#: ../clients/cli/nmcli.c:276
#, c-format
msgid "nmcli tool, version %s\n"
msgstr "утилита nmcli, верÑÐ¸Ñ %s\n"
-#: ../cli/src/nmcli.c:253
+#: ../clients/cli/nmcli.c:282
#, c-format
msgid "Error: Option '%s' is unknown, try 'nmcli -help'."
-msgstr ""
-"Ошибка: неизвеÑтный параметр «%s». Попробуйте выполнить «nmcli -help»."
+msgstr "Ошибка: неизвеÑтный параметр «%s». Попробуйте выполнить «nmcli -help»."
-#: ../cli/src/nmcli.c:288
-#, c-format
-msgid "\n"
-"Error: nmcli terminated by signal %d."
-msgstr "\n"
+#: ../clients/cli/nmcli.c:365 ../clients/cli/nmcli.c:375
+#, fuzzy, c-format
+#| msgid ""
+#| "\n"
+#| "Error: nmcli terminated by signal %d."
+msgid ""
+"\n"
+"Error: nmcli terminated by signal %s (%d)\n"
+msgstr ""
+"\n"
"Ошибка. Работа nmcli прервана по Ñигналу %d."
-#: ../cli/src/nmcli.c:318 ../src/main.c:130
-#, c-format
-msgid "Failed to set signal mask: %d"
+#: ../clients/cli/nmcli.c:406
+#, fuzzy, c-format
+#| msgid "Failed to set signal mask: %d"
+msgid "Failed to set signal mask: %d\n"
msgstr "Ошибка уÑтановки маÑки Ñигнала: %d"
-#: ../cli/src/nmcli.c:325 ../src/main.c:139
-#, c-format
-msgid "Failed to create signal handling thread: %d"
+#: ../clients/cli/nmcli.c:413
+#, fuzzy, c-format
+#| msgid "Failed to create signal handling thread: %d"
+msgid "Failed to create signal handling thread: %d\n"
msgstr "Ошибка ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð¿Ð¾Ñ‚Ð¾ÐºÐ° обработки Ñигнала: %d"
-#: ../cli/src/nmcli.c:338 ../test/nm-online.c:149
-#, c-format
-msgid "Error: Could not create NMClient object."
+#: ../clients/cli/nmcli.c:510 ../clients/nm-online.c:197
+#, fuzzy, c-format
+#| msgid "Error: Could not create NMClient object."
+msgid "Error: Could not create NMClient object: %s."
msgstr "Ошибка: невозможно Ñоздать объект NMClient."
-#: ../cli/src/nmcli.c:354
+#: ../clients/cli/nmcli.c:527
msgid "Success"
msgstr "УÑпешно"
-#: ../cli/src/settings.c:666
-#, c-format
-msgid "%d (hex-ascii-key)"
+#: ../clients/cli/polkit-agent.c:82
+#, fuzzy, c-format
+#| msgid "Authentication"
+msgid "Authentication message: %s\n"
+msgstr "ÐутентификациÑ"
+
+#: ../clients/cli/polkit-agent.c:88
+#, fuzzy, c-format
+#| msgid "Authentication"
+msgid "Authentication error: %s\n"
+msgstr "ÐутентификациÑ"
+
+#: ../clients/cli/polkit-agent.c:134
+#, fuzzy, c-format
+#| msgid "Modem initialization failed"
+msgid "Warning: polkit agent initialization failed: %s\n"
+msgstr "Ðе удалоÑÑŒ инициализировать модем"
+
+#: ../clients/cli/settings.c:674
+#, fuzzy, c-format
+#| msgid "%d (hex-ascii-key)"
+msgid "%d (key)"
msgstr "%d (16-теричный ASCII-ключ)"
-#: ../cli/src/settings.c:668
-#, c-format
-msgid "%d (104/128-bit passphrase)"
+#: ../clients/cli/settings.c:676
+#, fuzzy, c-format
+#| msgid "%d (104/128-bit passphrase)"
+msgid "%d (passphrase)"
msgstr "%d (104/128-Ð±Ð¸Ñ‚Ð½Ð°Ñ Ð¿Ð°Ñ€Ð¾Ð»ÑŒÐ½Ð°Ñ Ñ„Ñ€Ð°Ð·Ð°)"
-#: ../cli/src/settings.c:671 ../cli/src/settings.c:799
+#: ../clients/cli/settings.c:679 ../clients/cli/settings.c:760
#, c-format
msgid "%d (unknown)"
msgstr "%d (неизвеÑтно)"
-#: ../cli/src/settings.c:697
-msgid "0 (unknown)"
-msgstr "0 (неизвеÑтно)"
-
-#: ../cli/src/settings.c:703
-msgid "any, "
-msgstr "любой, "
-
-#: ../cli/src/settings.c:705
-msgid "900 MHz, "
-msgstr "900 МГц, "
-
-#: ../cli/src/settings.c:707
-msgid "1800 MHz, "
-msgstr "1800 МГц, "
-
-#: ../cli/src/settings.c:709
-msgid "1900 MHz, "
-msgstr "1900 МГц, "
-
-#: ../cli/src/settings.c:711
-msgid "850 MHz, "
-msgstr "850 МГц, "
-
-#: ../cli/src/settings.c:713
-msgid "WCDMA 3GPP UMTS 2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 2100 МГц, "
-
-#: ../cli/src/settings.c:715
-msgid "WCDMA 3GPP UMTS 1800 MHz, "
-msgstr "WCDMA 3GPP UMTS 1800 МГц, "
-
-#: ../cli/src/settings.c:717
-msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700/2100 МГц, "
-
-#: ../cli/src/settings.c:719
-msgid "WCDMA 3GPP UMTS 800 MHz, "
-msgstr "WCDMA 3GPP UMTS 800 МГц, "
-
-#: ../cli/src/settings.c:721
-msgid "WCDMA 3GPP UMTS 850 MHz, "
-msgstr "WCDMA 3GPP UMTS 850 МГц, "
-
-#: ../cli/src/settings.c:723
-msgid "WCDMA 3GPP UMTS 900 MHz, "
-msgstr "WCDMA 3GPP UMTS 900 МГц, "
-
-#: ../cli/src/settings.c:725
-msgid "WCDMA 3GPP UMTS 1700 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700 МГц, "
-
-#: ../cli/src/settings.c:727
-msgid "WCDMA 3GPP UMTS 1900 MHz, "
-msgstr "WCDMA 3GPP UMTS 1900 МГц, "
-
-#: ../cli/src/settings.c:729
-msgid "WCDMA 3GPP UMTS 2600 MHz, "
-msgstr "WCDMA 3GPP UMTS 2600 МГц, "
-
-#: ../cli/src/settings.c:747
+#: ../clients/cli/settings.c:708
msgid "0 (NONE)"
msgstr "0 (ÐЕТ)"
-#: ../cli/src/settings.c:753
+#: ../clients/cli/settings.c:714
msgid "REORDER_HEADERS, "
msgstr "УПОРЯДОЧИТЬ_ЗÐГОЛОВКИ,"
-#: ../cli/src/settings.c:755
+#: ../clients/cli/settings.c:716
msgid "GVRP, "
msgstr "GVRP, "
-#: ../cli/src/settings.c:757
+#: ../clients/cli/settings.c:718
msgid "LOOSE_BINDING, "
msgstr "LOOSE_BINDING, "
-#: ../cli/src/settings.c:793
+#: ../clients/cli/settings.c:754
#, c-format
msgid "%d (disabled)"
msgstr "%d (отключено)"
-#: ../cli/src/settings.c:795
+#: ../clients/cli/settings.c:756
#, c-format
msgid "%d (enabled, prefer public IP)"
msgstr "%d (включено, Ð¿Ñ€ÐµÐ´Ð¿Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ñ‹Ð¹ IP)"
-#: ../cli/src/settings.c:797
+#: ../clients/cli/settings.c:758
#, c-format
msgid "%d (enabled, prefer temporary IP)"
msgstr "%d (включено, Ð¿Ñ€ÐµÐ´Ð¿Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¹ IP)"
-#: ../cli/src/settings.c:809
+#: ../clients/cli/settings.c:770
msgid "0 (none)"
msgstr "0 (нет)"
-#: ../cli/src/settings.c:815
+#: ../clients/cli/settings.c:776
msgid "agent-owned, "
msgstr "под управлением агента,"
-#: ../cli/src/settings.c:817
+#: ../clients/cli/settings.c:778
msgid "not saved, "
msgstr "не Ñохранено,"
-#: ../cli/src/settings.c:819
+#: ../clients/cli/settings.c:780
msgid "not required, "
msgstr "не требуетÑÑ,"
-#: ../cli/src/settings.c:1124
+#: ../clients/cli/settings.c:1064
msgid "0 (disabled)"
msgstr "0 (отключено)"
-#: ../cli/src/settings.c:1130
+#: ../clients/cli/settings.c:1070
msgid "enabled, "
msgstr "включено,"
-#: ../cli/src/settings.c:1132
+#: ../clients/cli/settings.c:1072
msgid "advertise, "
msgstr "объÑвление,"
-#: ../cli/src/settings.c:1134
+#: ../clients/cli/settings.c:1074
msgid "willing, "
msgstr "разрешение,"
-#: ../cli/src/settings.c:1162
+#: ../clients/cli/settings.c:1102
msgid "-1 (unset)"
msgstr "-1 (не задано)"
-#: ../cli/src/settings.c:1270 ../cli/src/settings.c:1453
-#: ../cli/src/settings.c:1493
+#: ../clients/cli/settings.c:1199 ../clients/cli/settings.c:1486
+#: ../clients/cli/settings.c:1528
msgid "auto"
msgstr "автоматичеÑки"
-#: ../cli/src/settings.c:1283
+#: ../clients/cli/settings.c:1212
msgid "default"
msgstr "по умолчанию"
-#: ../cli/src/settings.c:1614
+#: ../clients/cli/settings.c:1544
+#, c-format
+msgid "yes (%u)"
+msgstr ""
+
+#: ../clients/cli/settings.c:1670
#, c-format
msgid "Do you also want to set '%s' to '%s'? [yes]: "
-msgstr "ПриÑвоить «%s» значение «%s»? [да]:"
+msgstr "ПриÑвоить «%s» значение «%s»? [да]:"
-#: ../cli/src/settings.c:1616
+#: ../clients/cli/settings.c:1672
#, c-format
msgid "Do you also want to clear '%s'? [yes]: "
-msgstr "ОчиÑтить «%s»? [да]:"
+msgstr "ОчиÑтить «%s»? [да]:"
+
+#: ../clients/cli/settings.c:1833
+#, c-format
+msgid ""
+"Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"
+msgstr ""
-#: ../cli/src/settings.c:1814 ../cli/src/settings.c:2069
-#: ../cli/src/settings.c:3673
+#: ../clients/cli/settings.c:1852
+#, c-format
+msgid "Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"
+msgstr ""
+
+#: ../clients/cli/settings.c:1854
+#, fuzzy
+#| msgid "Do you want to provide them? (yes/no) [yes] "
+msgid "Do you want to remove them? [yes] "
+msgstr "Хотите их определить? (Да или нет)"
+
+#: ../clients/cli/settings.c:1950 ../clients/cli/settings.c:2272
+#: ../clients/cli/settings.c:4405
#, c-format
msgid "'%s' is not valid"
-msgstr "ÐедопуÑтимое значение «%s»"
+msgstr "ÐедопуÑтимое значение «%s»"
-#: ../cli/src/settings.c:1837
+#: ../clients/cli/settings.c:1973
#, c-format
msgid "'%d' is not valid; use <%d-%d>"
+msgstr "«%d» выходит за пределы диапазона <%d-%d>"
+
+#: ../clients/cli/settings.c:1995
+#, fuzzy, c-format
+#| msgid "'%d' is not valid; use <%d-%d>"
+msgid "'%lld' is not valid; use <%lld-%lld>"
msgstr "«%d» выходит за пределы диапазона <%d-%d>"
-#: ../cli/src/settings.c:1859
-#, c-format
-msgid "'%u' is not valid; use <%d-%d>"
+#: ../clients/cli/settings.c:2017
+#, fuzzy, c-format
+#| msgid "'%u' is not valid; use <%d-%d>"
+msgid "'%u' is not valid; use <%u-%u>"
msgstr "«%u» выходит за пределы <%d-%d>"
-#: ../cli/src/settings.c:1925
+#: ../clients/cli/settings.c:2083
#, c-format
msgid "'%s' is not valid; use <option>=<value>"
-msgstr ""
-"ÐедопуÑтимое значение «%s». ИÑпользуйте формат: <параметр>=<значение>"
+msgstr "ÐедопуÑтимое значение «%s». ИÑпользуйте формат: <параметр>=<значение>"
-#: ../cli/src/settings.c:1959
+#: ../clients/cli/settings.c:2117
#, c-format
msgid "index '%s' is not valid"
-msgstr "ÐедопуÑтимый Ð¸Ð½Ð´ÐµÐºÑ Â«%s»."
+msgstr "ÐедопуÑтимый Ð¸Ð½Ð´ÐµÐºÑ Â«%s»."
-#: ../cli/src/settings.c:1964
+#: ../clients/cli/settings.c:2122 ../clients/cli/settings.c:2147
msgid "no item to remove"
msgstr "нечего удалÑÑ‚ÑŒ"
-#: ../cli/src/settings.c:1968
+#: ../clients/cli/settings.c:2126 ../clients/cli/settings.c:2151
#, c-format
msgid "index '%d' is not in range <0-%d>"
-msgstr "Ð˜Ð½Ð´ÐµÐºÑ Â«%d» выходит за пределы диапазона <0-%d>"
+msgstr "Ð˜Ð½Ð´ÐµÐºÑ Â«%d» выходит за пределы диапазона <0-%d>"
-#: ../cli/src/settings.c:1983
+#: ../clients/cli/settings.c:2166
#, c-format
msgid "invalid option '%s'"
-msgstr "ÐедопуÑтимый параметр «%s»"
+msgstr "ÐедопуÑтимый параметр «%s»"
-#: ../cli/src/settings.c:1985
+#: ../clients/cli/settings.c:2168
msgid "missing option"
msgstr "пропущен параметр"
-#: ../cli/src/settings.c:2015 ../cli/src/settings.c:2035
+#: ../clients/cli/settings.c:2198 ../clients/cli/settings.c:2218
+#: ../clients/cli/settings.c:2238
#, c-format
msgid "'%s' is not a valid number (or out of range)"
-msgstr "ЧиÑло выходит за пределы диапазона или определено неверно: «%s»"
+msgstr "ЧиÑло выходит за пределы диапазона или определено неверно: «%s»"
-#: ../cli/src/settings.c:2089
+#: ../clients/cli/settings.c:2288
#, c-format
msgid "'%s' is not a valid Ethernet MAC"
-msgstr "ÐедейÑтвительный MAC Ethernet: «%s»"
+msgstr "ÐедейÑтвительный MAC Ethernet: «%s»"
-#: ../cli/src/settings.c:2115 ../libnm-util/nm-setting-bridge.c:277
-#: ../libnm-util/nm-setting-connection.c:752
-#: ../libnm-util/nm-setting-vlan.c:475
+#: ../clients/cli/settings.c:2313 ../libnm-core/nm-setting-connection.c:795
+#: ../libnm-core/nm-setting-infiniband.c:256
+#: ../libnm-util/nm-setting-connection.c:835
+#: ../libnm-util/nm-setting-infiniband.c:270
#, c-format
msgid "'%s' is not a valid interface name"
-msgstr "ÐедейÑтвительное Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа: «%s»"
+msgstr "ÐедейÑтвительное Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа: «%s»"
+
+#: ../clients/cli/settings.c:2337
+#, fuzzy, c-format
+#| msgid "'%s' is not a valid channel; use <1-13>"
+msgid "'%s' is not a valid flag number; use <0-%d>"
+msgstr "ÐедопуÑтимое значение «%s». ИÑпользуйте Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¾Ñ‚ 1 до 13."
-#: ../cli/src/settings.c:2133 ../cli/src/settings.c:3212
-#: ../libnm-util/nm-setting-gsm.c:375
+#: ../clients/cli/settings.c:2349
#, c-format
-msgid "'%s' is not a number"
-msgstr " «%s» не ÑвлÑетÑÑ Ñ‡Ð¸Ñлом"
+msgid "Warning: '%s' sum is higher than all flags => all flags set\n"
+msgstr ""
-#: ../cli/src/settings.c:2185
+#: ../clients/cli/settings.c:2390
#, c-format
msgid "'%s' is not a valid hex character"
-msgstr "Ðеверное шеÑтнадцатеричное значение: «%s»"
+msgstr "Ðеверное шеÑтнадцатеричное значение: «%s»"
-#: ../cli/src/settings.c:2215
+#: ../clients/cli/settings.c:2420
#, c-format
msgid "'%s' is not a valid MAC"
-msgstr "ÐедейÑтвительный MAC-адреÑ: «%s»"
+msgstr "ÐедейÑтвительный MAC-адреÑ: «%s»"
-#: ../cli/src/settings.c:2252 ../libnm-util/nm-setting-connection.c:715
+#: ../clients/cli/settings.c:2457 ../libnm-core/nm-setting-connection.c:784
+#: ../libnm-util/nm-setting-connection.c:792
#, c-format
msgid "'%s' is not a valid UUID"
-msgstr "ÐедейÑтвительный UUID: «%s»"
+msgstr "ÐедейÑтвительный UUID: «%s»"
-#: ../cli/src/settings.c:2317
+#: ../clients/cli/settings.c:2524
+#, c-format
+msgid "the property doesn't contain permission '%s'"
+msgstr ""
+
+#: ../clients/cli/settings.c:2536
msgid ""
-"Enter a list of user permissions. This is a list of user names formatted as:\n"
+"Enter a list of user permissions. This is a list of user names formatted "
+"as:\n"
" [user:]<user name 1>, [user:]<user name 2>,...\n"
"The items can be separated by commas or spaces.\n"
"\n"
"Example: alice bob charlie\n"
msgstr ""
"Введите ÑпиÑок разрешений в виде:\n"
-" [user:]<пользователь 1>, [user:]<пользователь 2>,...\n"
+" [user:]<пользователь 1>, [user:]<пользователь 2>,...\n"
"ЗапиÑи могут разделÑÑ‚ÑŒÑÑ Ð¿Ñ€Ð¾Ð±ÐµÐ»Ð¾Ð¼ или запÑтой.\n"
"\n"
"Пример: alice bob charlie\n"
-#: ../cli/src/settings.c:2332
+#: ../clients/cli/settings.c:2555
#, c-format
msgid "'%s' is not valid master; use ifname or connection UUID"
msgstr ""
"ÐедейÑтвительный маÑтер: «%s». ИÑпользуйте Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа или UUID "
"ÑоединениÑ."
-#: ../cli/src/settings.c:2453
+#: ../clients/cli/settings.c:2599
+#, c-format
+msgid "Warning: %s is not an UUID of any existing connection profile\n"
+msgstr ""
+
+#: ../clients/cli/settings.c:2603 ../clients/cli/settings.c:2619
+#, fuzzy, c-format
+#| msgid "Error: '%s' is not a valid connection type."
+msgid "'%s' is not a VPN connection profile"
+msgstr "Ошибка. ÐедопуÑтимый тип ÑоединениÑ: «%s»"
+
+#: ../clients/cli/settings.c:2612
+#, fuzzy, c-format
+#| msgid "'%s' is not a valid team configuration or file name."
+msgid "'%s' is not a name of any exiting profile"
+msgstr "ÐедопуÑтимое Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° или Ð½ÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹: «%s»"
+
+#: ../clients/cli/settings.c:2646
+#, fuzzy, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "the value '%s' is not a valid UUID"
+msgstr "ÐедейÑтвительный UUID: «%s»"
+
+#: ../clients/cli/settings.c:2653
+#, c-format
+msgid "the property doesn't contain UUID '%s'"
+msgstr ""
+
+#: ../clients/cli/settings.c:2665
+msgid ""
+"Enter secondary connections that should be activated when this connection "
+"is\n"
+"activated. Connections can be specified either by UUID or ID (name). nmcli\n"
+"transparently translates names to UUIDs. Note that NetworkManager only "
+"supports\n"
+"VPNs as secondary connections at the moment.\n"
+"The items can be separated by commas or spaces.\n"
+"\n"
+"Example: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"
+msgstr ""
+
+#: ../clients/cli/settings.c:2742
msgid "private key password not provided"
msgstr "Ðе указан пароль чаÑтного ключа "
-#: ../cli/src/settings.c:2513
+#: ../clients/cli/settings.c:2769
+#, fuzzy, c-format
+#| msgid "the property can't be changed"
+msgid "the property doesn't contain EAP method '%s'"
+msgstr "ÑвойÑтво не может быть изменено"
+
+#: ../clients/cli/settings.c:2784
+msgid ""
+"Enter file path to CA certificate (optionally prefixed with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/cacert.crt\n"
+msgstr ""
+
+#: ../clients/cli/settings.c:2803
+#, c-format
+msgid "the property doesn't contain alternative subject match '%s'"
+msgstr ""
+
+#: ../clients/cli/settings.c:2819
+msgid ""
+"Enter file path to client certificate (optionally prefixed with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/jara.crt\n"
+msgstr ""
+
+#: ../clients/cli/settings.c:2831
+msgid ""
+"Enter file path to CA certificate for inner authentication (optionally "
+"prefixed\n"
+"with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/ca-zweite-phase.crt\n"
+msgstr ""
+
+#: ../clients/cli/settings.c:2851
+#, c-format
+msgid "the property doesn't contain \"phase2\" alternative subject match '%s'"
+msgstr ""
+
+#: ../clients/cli/settings.c:2867
+msgid ""
+"Enter file path to client certificate for inner authentication (optionally "
+"prefixed\n"
+"with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/jara-zweite-phase.crt\n"
+msgstr ""
+
+#: ../clients/cli/settings.c:2887
+#, fuzzy
+#| msgid ""
+#| "Enter path to a private key and the key password (if not set yet):\n"
+#| " <file path> [<password>]\n"
+#| "Example: /home/cimrman/jara-priv-key Dardanely\n"
msgid ""
"Enter path to a private key and the key password (if not set yet):\n"
-" <file path> [<password>]\n"
+" [file://]<file path> [<password>]\n"
+"Note that nmcli does not support specifying private key as raw blob data.\n"
"Example: /home/cimrman/jara-priv-key Dardanely\n"
msgstr ""
"Введите Ð°Ð´Ñ€ÐµÑ Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¾Ð³Ð¾ ключа и пароль (еÑли еще не определен):\n"
" <путь> [<пароль>]\n"
"Пример: /home/cimrman/jara-priv-key Dardanely\n"
-#: ../cli/src/settings.c:2583
+#: ../clients/cli/settings.c:2958
msgid ""
"Enter bytes as a list of hexadecimal values.\n"
"Two formats are accepted:\n"
-"(a) a string of hexadecimal digits, where each two digits represent one byte\n"
+"(a) a string of hexadecimal digits, where each two digits represent one "
+"byte\n"
"(b) space-separated list of bytes written as hexadecimal digits (with "
"optional 0x/0X prefix, and optional leading 0).\n"
"\n"
@@ -4357,7 +5324,7 @@ msgstr ""
"Примеры: ab0455a6ea3a74C2\n"
" ab 4 55 0xa6 ea 3a 74 C2\n"
-#: ../cli/src/settings.c:2686
+#: ../clients/cli/settings.c:3061
#, c-format
msgid ""
"Enter a list of bonding options formatted as:\n"
@@ -4374,7 +5341,7 @@ msgid ""
"\n"
"Example: mode=2,miimon=120\n"
msgstr ""
-"Введите ÑпиÑок параметров:\n"
+"Введите ÑпиÑок параметров агрегации:\n"
" параметр = <значение>, параметр = <значение>,... \n"
"ДоÑтупные параметры: %s\n"
"«режим» можно определить Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ имени или кода:\n"
@@ -4388,38 +5355,68 @@ msgstr ""
"\n"
"Пример: mode=2,miimon=120\n"
-#: ../cli/src/settings.c:2727
+#: ../clients/cli/settings.c:3099
#, c-format
msgid "'%s' is not a valid InfiniBand MAC"
-msgstr "ÐедейÑтвительный MAC InfiniBand: «%s»"
+msgstr "ÐедейÑтвительный MAC InfiniBand: «%s»"
-#: ../cli/src/settings.c:2765
+#: ../clients/cli/settings.c:3136
#, c-format
msgid "'%s' is not a valid IBoIP P_Key"
msgstr "ÐедопуÑтимое значение IBoIP P_Key: «%s»"
-#: ../cli/src/settings.c:2825
+#: ../clients/cli/settings.c:3167
+#, fuzzy, c-format
+#| msgid "'%s' is not valid (use ip/[prefix] next-hop [metric])"
+msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
+msgstr ""
+"ÐедейÑтвительное значение «%s». ДопуÑтимый формат: ip[/префикÑ] next-hop "
+"[метрика]."
+
+#: ../clients/cli/settings.c:3215 ../clients/cli/settings.c:3234
+#, c-format
+msgid "invalid IPv4 address '%s'"
+msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv4: «%s»"
+
+#: ../clients/cli/settings.c:3240 ../clients/cli/settings.c:3541
+#, c-format
+msgid "the property doesn't contain DNS server '%s'"
+msgstr ""
+
+#: ../clients/cli/settings.c:3252
msgid ""
"Enter a list of IPv4 addresses of DNS servers.\n"
"\n"
"Example: 8.8.8.8, 8.8.4.4\n"
-msgstr "Введите ÑпиÑок адреÑов IPv4 Ñерверов DNS.\n"
+msgstr ""
+"Введите ÑпиÑок адреÑов IPv4 Ñерверов DNS.\n"
"\n"
"Пример: 8.8.8.8, 8.8.4.4\n"
-#: ../cli/src/settings.c:2871 ../cli/src/settings.c:3123
+#: ../clients/cli/settings.c:3288 ../clients/cli/settings.c:3595
#, c-format
-msgid "'%s' is not valid (use ip[/prefix] [gateway])"
+msgid "the property doesn't contain DNS search domain '%s'"
msgstr ""
-"ÐедейÑтвительное значение «%s». ДопуÑтимый формат: ip[/префикÑ] [шлюз]."
-#: ../cli/src/settings.c:2897
+#: ../clients/cli/settings.c:3342 ../clients/cli/settings.c:3648
+#, c-format
+msgid "the property doesn't contain IP address '%s'"
+msgstr ""
+
+#: ../clients/cli/settings.c:3355
+#, fuzzy
+#| msgid ""
+#| "Enter a list of IPv4 addresses formatted as:\n"
+#| " ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+#| "Missing prefix is regarded as prefix of 32.\n"
+#| "\n"
+#| "Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
msgid ""
"Enter a list of IPv4 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 32.\n"
"\n"
-"Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+"Example: 192.168.1.5/24, 10.0.0.11/24\n"
msgstr ""
"Введите ÑпиÑок адреÑов IPv4 в формате:\n"
" ip[/префикÑ] [шлюз], ip[/префикÑ] [шлюз],...\n"
@@ -4427,21 +5424,37 @@ msgstr ""
"\n"
"Пример: 92.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
-#: ../cli/src/settings.c:2954
-#, c-format
-msgid "'%s' is not valid (use ip/[prefix] next-hop [metric])"
-msgstr ""
-"ÐедейÑтвительное значение «%s». ДопуÑтимый формат: ip[/префикÑ] next-hop "
-"[метрика]."
+#: ../clients/cli/settings.c:3371 ../clients/cli/settings.c:3677
+#, fuzzy, c-format
+#| msgid "invalid gateway '%s'"
+msgid "invalid gateway address '%s'"
+msgstr "недопуÑтимый шлюз «%s»"
+
+#: ../clients/cli/settings.c:3426 ../clients/cli/settings.c:3732
+#, fuzzy, c-format
+#| msgid "the property can't be changed"
+msgid "the property doesn't contain route '%s'"
+msgstr "ÑвойÑтво не может быть изменено"
-#: ../cli/src/settings.c:2980
+#: ../clients/cli/settings.c:3439
+#, fuzzy
+#| msgid ""
+#| "Enter a list of IPv4 routes formatted as:\n"
+#| " ip/[prefix] next-hop [metric],...\n"
+#| "Missing prefix is regarded as a prefix of 32.\n"
+#| "Missing metric is regarded as a metric of 0.\n"
+#| "\n"
+#| "Example: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
msgid ""
"Enter a list of IPv4 routes formatted as:\n"
-" ip/[prefix] next-hop [metric],...\n"
+" ip[/prefix] [next-hop] [metric],...\n"
+"\n"
"Missing prefix is regarded as a prefix of 32.\n"
-"Missing metric is regarded as a metric of 0.\n"
+"Missing next-hop is regarded as 0.0.0.0.\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
-"Example: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
+"Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
+" 10.1.2.0/24\n"
msgstr ""
"Введите ÑпиÑок маршрутов IPv4 в формате:\n"
" ip/[префикÑ] Ñлед.переход [метрика],...\n"
@@ -4450,7 +5463,12 @@ msgstr ""
"\n"
"Пример: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
-#: ../cli/src/settings.c:3071
+#: ../clients/cli/settings.c:3516 ../clients/cli/settings.c:3535
+#, c-format
+msgid "invalid IPv6 address '%s'"
+msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv6: «%s»"
+
+#: ../clients/cli/settings.c:3553
msgid ""
"Enter a list of IPv6 addresses of DNS servers. If the IPv6 configuration "
"method is 'auto' these DNS servers are appended to those (if any) returned "
@@ -4461,7 +5479,7 @@ msgid ""
"\n"
"Example: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
msgstr ""
-"Введите ÑпиÑок адреÑов IPv6 Ñерверов DNS. ЕÑли IPv6 наÑтроен в режиме "
+"Введите ÑпиÑок адреÑов IPv6 Ñерверов DNS. ЕÑли IPv6 наÑтроен в режиме "
"«auto», Ñерверы будут добавлены в ÑпиÑок, полученный в результате "
"автоматичеÑкой конфигурации. Серверы DNS не могут иÑпользоватьÑÑ Ð² режимах "
"«shared» и «link-local». Ð’ оÑтальных режимах они раÑÑматриваютÑÑ ÐºÐ°Ðº "
@@ -4469,38 +5487,50 @@ msgstr ""
"\n"
"Пример: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
-#: ../cli/src/settings.c:3149
+#: ../clients/cli/settings.c:3661
+#, fuzzy
+#| msgid ""
+#| "Enter a list of IPv6 addresses formatted as:\n"
+#| " ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+#| "Missing prefix is regarded as prefix of 128.\n"
+#| "\n"
+#| "Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
+#| "1050:0:0:0:5:600:300c:326b\n"
msgid ""
"Enter a list of IPv6 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 128.\n"
"\n"
-"Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, 1050:0:0:0:5:600:300c:"
-"326b\n"
+"Example: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"
msgstr ""
"Введите ÑпиÑок адреÑов IPv6 в формате:\n"
" ip[/префикÑ] [шлюз], ip[/префикÑ] [шлюз],...\n"
"По умолчанию иÑполльзуетÑÑ Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ 128.\n"
"\n"
-"Пример: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, 1050:0:0:0:5:600:300c:"
-"326b\n"
-
-#: ../cli/src/settings.c:3171
-#, c-format
-msgid "'%s' is not valid (use <dest IP>/prefix <next-hop IP> [metric])"
-msgstr ""
-"ÐедейÑтвительное значение «%s». ДопуÑтимый формат: <целевой_ip>/Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ "
-"<ip_перехода> [метрика]."
-
-#: ../cli/src/settings.c:3197
+"Пример: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
+"1050:0:0:0:5:600:300c:326b\n"
+
+#: ../clients/cli/settings.c:3745
+#, fuzzy
+#| msgid ""
+#| "Enter a list of IPv6 routes formatted as:\n"
+#| " ip/[prefix] next-hop [metric],...\n"
+#| "Missing prefix is regarded as a prefix of 128.\n"
+#| "Missing metric is regarded as a metric of 0.\n"
+#| "\n"
+#| "Example: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
+#| "db8:beef::3 2\n"
msgid ""
"Enter a list of IPv6 routes formatted as:\n"
-" ip/[prefix] next-hop [metric],...\n"
+" ip[/prefix] [next-hop] [metric],...\n"
+"\n"
"Missing prefix is regarded as a prefix of 128.\n"
-"Missing metric is regarded as a metric of 0.\n"
+"Missing next-hop is regarded as \"::\".\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
-"Example: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
+"Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
"db8:beef::3 2\n"
+" abbe::/64 55\n"
msgstr ""
"Введите ÑпиÑок маршрутов IPv6 в формате:\n"
" ip/[префикÑ] Ñлед.переход [метрика],...\n"
@@ -4510,22 +5540,28 @@ msgstr ""
"Пример: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:db8:"
"beef::3 2\n"
-#: ../cli/src/settings.c:3219
+#: ../clients/cli/settings.c:3762 ../libnm-core/nm-setting-gsm.c:317
+#: ../libnm-util/nm-setting-gsm.c:374
+#, c-format
+msgid "'%s' is not a number"
+msgstr " «%s» не ÑвлÑетÑÑ Ñ‡Ð¸Ñлом"
+
+#: ../clients/cli/settings.c:3769
#, c-format
msgid "'%s' is not valid; use 0, 1, or 2"
-msgstr "ÐедопуÑтимое значение «%s». ИÑпользуйте 0, 1 или 2."
+msgstr "ÐедопуÑтимое значение «%s». ИÑпользуйте 0, 1 или 2."
-#: ../cli/src/settings.c:3236
+#: ../clients/cli/settings.c:3786
#, c-format
msgid "'%s' is not a valid channel; use <1-13>"
-msgstr "ÐедопуÑтимое значение «%s». ИÑпользуйте Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¾Ñ‚ 1 до 13."
+msgstr "ÐедопуÑтимое значение «%s». ИÑпользуйте Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¾Ñ‚ 1 до 13."
-#: ../cli/src/settings.c:3257
+#: ../clients/cli/settings.c:3823
#, c-format
msgid "'%s' is not valid; use [e, o, n]"
-msgstr "Ðеверное значение «%s». ДопуÑтимые значениÑ: [e, o, n]."
+msgstr "Ðеверное значение «%s». ДопуÑтимые значениÑ: [e, o, n]."
-#: ../cli/src/settings.c:3285
+#: ../clients/cli/settings.c:3851
msgid ""
"nmcli can accepts both direct JSON configuration data and a file name "
"containing the configuration. In the latter case the file is read and the "
@@ -4541,23 +5577,57 @@ msgstr ""
"\"roundrobin\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }\n"
" set team.config /etc/my-team.conf\n"
-#: ../cli/src/settings.c:3325
+#: ../clients/cli/settings.c:3891
msgid "no priority to remove"
msgstr "нет приоритета Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ"
-#: ../cli/src/settings.c:3329
+#: ../clients/cli/settings.c:3895
#, c-format
msgid "index '%d' is not in the range of <0-%d>"
-msgstr "Ð˜Ð½Ð´ÐµÐºÑ Â«%d» выходит за пределы диапазона <0-%d>"
+msgstr "Ð˜Ð½Ð´ÐµÐºÑ Â«%d» выходит за пределы диапазона <0-%d>"
-#: ../cli/src/settings.c:3444
+#: ../clients/cli/settings.c:3934
#, c-format
-msgid "'%s' is not valid; 3 strings should be provided"
+msgid ""
+"Warning: only one mapping at a time is supported; taking the first one (%s)\n"
+msgstr ""
+
+#: ../clients/cli/settings.c:3941
+#, fuzzy, c-format
+#| msgid "the property can't be changed"
+msgid "the property doesn't contain mapping '%s'"
+msgstr "ÑвойÑтво не может быть изменено"
+
+#: ../clients/cli/settings.c:4050 ../clients/cli/settings.c:4213
+#: ../libnm-core/nm-setting-wired.c:604
+#: ../libnm-core/nm-setting-wireless.c:803
+#: ../libnm-core/nm-setting-wireless.c:815
+#: ../libnm-util/nm-setting-wired.c:647
+#: ../libnm-util/nm-setting-wireless.c:860
+#: ../libnm-util/nm-setting-wireless.c:874
+#, c-format
+msgid "'%s' is not a valid MAC address"
+msgstr "ÐедейÑтвительный MAC-адреÑ: «%s»"
+
+#: ../clients/cli/settings.c:4056 ../clients/cli/settings.c:4219
+#, c-format
+msgid "the property doesn't contain MAC address '%s'"
+msgstr ""
+
+#: ../clients/cli/settings.c:4075
+#, fuzzy, c-format
+#| msgid "'%s' is not valid; 3 strings should be provided"
+msgid "'%s' is not valid; 2 or 3 strings should be provided"
msgstr "Строка «%s» должна Ñодержать три значениÑ."
-#: ../cli/src/settings.c:3463
+#: ../clients/cli/settings.c:4089
+#, fuzzy
+#| msgid ""
+#| "Enter a list of three channels (comma or space separated).\n"
+#| "\n"
+#| "Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
msgid ""
-"Enter a list of three channels (comma or space separated).\n"
+"Enter a list of subchannels (comma or space separated).\n"
"\n"
"Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
msgstr ""
@@ -4565,7 +5635,7 @@ msgstr ""
"\n"
"Пример: 0.0.0e20 0.0.0e21 0.0.0e22\n"
-#: ../cli/src/settings.c:3513
+#: ../clients/cli/settings.c:4139
#, c-format
msgid ""
"Enter a list of S/390 options formatted as:\n"
@@ -4576,28 +5646,60 @@ msgstr ""
" параметр = <значение>, параметр = <значение>,...\n"
"ДопуÑтимые параметры: %s\n"
-#: ../cli/src/settings.c:3559
+#: ../clients/cli/settings.c:4185
#, c-format
msgid "'%s' is not a valid channel"
-msgstr "ÐедопуÑтимый канал «%s»."
+msgstr "ÐедопуÑтимый канал «%s»."
-#: ../cli/src/settings.c:3565
+#: ../clients/cli/settings.c:4191
#, c-format
msgid "'%ld' is not a valid channel"
-msgstr "ÐедопуÑтимый канал «%ld»."
+msgstr "ÐедопуÑтимый канал «%ld»."
+
+#: ../clients/cli/settings.c:4239
+#, fuzzy, c-format
+#| msgid "'%s' is not a valid duplex value"
+msgid "'%s' is not a valid powersave value"
+msgstr "ÐедопуÑтимое дуплекÑное значение: «%s»"
+
+#: ../clients/cli/settings.c:4299 ../clients/cli/settings.c:4337
+#: ../clients/cli/settings.c:4375
+#, c-format
+msgid "the property doesn't contain protocol '%s'"
+msgstr ""
-#: ../cli/src/settings.c:3668 ../cli/src/settings.c:3671
+#: ../clients/cli/settings.c:4414
+#, c-format
+msgid ""
+"'%s' not compatible with %s '%s', please change the key or set the right %s "
+"first."
+msgstr ""
+
+#: ../clients/cli/settings.c:4422
#, c-format
msgid "WEP key is guessed to be of '%s'\n"
msgstr "Ключ WEP определен как «%s»\n"
-#: ../cli/src/settings.c:3695
+#: ../clients/cli/settings.c:4424
+#, fuzzy, c-format
+#| msgid "WEP key is guessed to be of '%s'\n"
+msgid "WEP key index set to '%d'\n"
+msgstr "Ключ WEP определен как «%s»\n"
+
+#: ../clients/cli/settings.c:4447
#, c-format
msgid "'%s' not among [0 (unknown), 1 (key), 2 (passphrase)]"
+msgstr "«%s» может быть равно [0 (неизвеÑтно), 1 (ключ), 2 (Ð¿Ð°Ñ€Ð¾Ð»ÑŒÐ½Ð°Ñ Ñ„Ñ€Ð°Ð·Ð°)]"
+
+#: ../clients/cli/settings.c:4463 ../clients/cli/settings.c:4466
+#: ../clients/cli/settings.c:4469 ../clients/cli/settings.c:4472
+#, c-format
+msgid ""
+"Warning: '%s' is not compatible with '%s' type, please change or delete the "
+"key.\n"
msgstr ""
-"«%s» может быть равно [0 (неизвеÑтно), 1 (ключ), 2 (Ð¿Ð°Ñ€Ð¾Ð»ÑŒÐ½Ð°Ñ Ñ„Ñ€Ð°Ð·Ð°)]"
-#: ../cli/src/settings.c:3715
+#: ../clients/cli/settings.c:4485
#, c-format
msgid ""
"Enter the type of WEP keys. The accepted values are: 0 or unknown, 1 or key, "
@@ -4606,127 +5708,144 @@ msgstr ""
"Определите тип ключей WEP. Возможные значениÑ: 0 (неизвеÑтно), 1 (ключ), 2 "
"(Ð¿Ð°Ñ€Ð¾Ð»ÑŒÐ½Ð°Ñ Ñ„Ñ€Ð°Ð·Ð°).\n"
-#: ../cli/src/settings.c:3728
+#: ../clients/cli/settings.c:4498
#, c-format
msgid "'%s' is not a valid PSK"
msgstr "«%s» не ÑвлÑетÑÑ Ð´ÐµÐ¹Ñтвительным PSK"
-#: ../cli/src/settings.c:3772
+#: ../clients/cli/settings.c:4542
#, c-format
msgid "'%s' is not a valid DCB flag"
msgstr "«%s» не Ñодержит допуÑтимый флаг DCB"
-#: ../cli/src/settings.c:3795
+#: ../clients/cli/settings.c:4565
#, c-format
msgid "'%s' is not a DCB app priority"
msgstr "«%s» не Ñодержит приоритет Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ DCB"
-#: ../cli/src/settings.c:3821
+#: ../clients/cli/settings.c:4591
msgid "must contain 8 comma-separated numbers"
msgstr "должен Ñодержать 8 чиÑел, разделенных запÑтой"
-#: ../cli/src/settings.c:3838
+#: ../clients/cli/settings.c:4608
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive) or %u"
msgstr "«%s» не ÑвлÑетÑÑ Ñ‡Ð¸Ñлом в диапазоне от 0 до %u включительно или %u"
-#: ../cli/src/settings.c:3841
+#: ../clients/cli/settings.c:4611
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive)"
msgstr "«%s» не ÑвлÑетÑÑ Ñ‡Ð¸Ñлом в диапазоне от 0 до %u включительно"
-#: ../cli/src/settings.c:3863
+#: ../clients/cli/settings.c:4633
#, c-format
-msgid "Warning: changes will have no effect until '%s' includes 1 (enabled)\n"
+msgid ""
+"Warning: changes will have no effect until '%s' includes 1 (enabled)\n"
"\n"
msgstr ""
-"Предупреждение. Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð²ÑтупÑÑ‚ в Ñилу, только когда «%s» будет равно 1 "
+"Предупреждение. Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð²ÑтупÑÑ‚ в Ñилу, только когда «%s» будет равно 1 "
"(включено)\n"
"\n"
-#: ../cli/src/settings.c:3916
+#: ../clients/cli/settings.c:4686
#, c-format
msgid "bandwidth percentages must total 100%%"
-msgstr ""
-"Ñумма процентных чаÑтей пропуÑкной ÑпоÑобноÑти должна быть равна 100%%"
+msgstr "Ñумма процентных чаÑтей пропуÑкной ÑпоÑобноÑти должна быть равна 100%%"
-#: ../cli/src/settings.c:5594
+#: ../clients/cli/settings.c:6395
msgid "don't know how to get the property value"
msgstr "неизвеÑтно, как получить значение ÑвойÑтва"
-#: ../cli/src/settings.c:5647 ../cli/src/settings.c:5687
+#: ../clients/cli/settings.c:6448 ../clients/cli/settings.c:6488
msgid "the property can't be changed"
msgstr "ÑвойÑтво не может быть изменено"
-#: ../cli/src/settings.c:5791
+#: ../clients/cli/settings.c:6572
+#, fuzzy
+#| msgid "unavailable"
+msgid "(not available)"
+msgstr "недоÑтупен"
+
+#: ../clients/cli/settings.c:6597
msgid "[NM property description]"
msgstr "[опиÑание ÑвойÑтва NM]"
-#: ../cli/src/settings.c:5797
+#: ../clients/cli/settings.c:6602
msgid "[nmcli specific description]"
msgstr "[опиÑание в nmcli]"
-#: ../cli/src/utils.c:111
+#. ----------------------------------------------------------------------------
+#: ../clients/cli/settings.c:6651
+msgid "<hidden>"
+msgstr ""
+
+#: ../clients/cli/utils.c:127
#, c-format
msgid "Error: value for '%s' argument is required."
msgstr "Ошибка. Значение «%s» ÑвлÑетÑÑ Ð¾Ð±Ñзательным."
-#: ../cli/src/utils.c:136
+#: ../clients/cli/utils.c:152
#, c-format
msgid "Error: Argument '%s' was expected, but '%s' provided."
-msgstr "Ошибка. ОжидаетÑÑ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚ «%s», а получен «%s»."
+msgstr "Ошибка. ОжидаетÑÑ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚ «%s», а получен «%s»."
-#: ../cli/src/utils.c:139
+#: ../clients/cli/utils.c:155
#, c-format
msgid "Error: Unexpected argument '%s'"
-msgstr "Ошибка. Ðепредвиденный аргумент: «%s»"
+msgstr "Ошибка. Ðепредвиденный аргумент: «%s»"
-#: ../cli/src/utils.c:189
+#: ../clients/cli/utils.c:205
#, c-format
msgid "Error converting IP4 address '0x%X' to text form"
msgstr "Ошибка Ð¿Ñ€ÐµÐ¾Ð±Ñ€Ð°Ð·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð°Ð´Ñ€ÐµÑа IP4 «0x%X» в текÑтовый формат"
-#: ../cli/src/utils.c:217
+#: ../clients/cli/utils.c:233
#, c-format
msgid "Error converting IP6 address '%s' to text form"
msgstr "Ошибка Ð¿Ñ€ÐµÐ¾Ð±Ñ€Ð°Ð·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð°Ð´Ñ€ÐµÑа IP6 «%s» в текÑтовый формат"
-#: ../cli/src/utils.c:393
+#: ../clients/cli/utils.c:503
+#, fuzzy, c-format
+#| msgid "'%s' is ambiguous (%s x %s)"
+msgid "'%s' is ambiguous (on x off)"
+msgstr "Ðеоднозначное значение «%s» (%s x %s)"
+
+#: ../clients/cli/utils.c:513
#, c-format
msgid "'%s' is not valid; use [%s] or [%s]"
-msgstr "ÐедопуÑтимое значение «%s». ОжидаетÑÑ [%s] или [%s]"
+msgstr "ÐедопуÑтимое значение «%s». ОжидаетÑÑ [%s] или [%s]"
-#: ../cli/src/utils.c:475
+#: ../clients/cli/utils.c:595
#, c-format
msgid "'%s' is ambiguous (%s x %s)"
-msgstr "Ðеоднозначное значение «%s» (%s x %s)"
+msgstr "Ðеоднозначное значение «%s» (%s x %s)"
-#: ../cli/src/utils.c:487
+#: ../clients/cli/utils.c:607
#, c-format
msgid "missing name, try one of [%s]"
msgstr "Ð¸Ð¼Ñ Ð½Ðµ определено, попробуйте выбрать значение из [%s]"
-#: ../cli/src/utils.c:718
+#: ../clients/cli/utils.c:869
#, c-format
msgid "field '%s' has to be alone"
msgstr "поле «%s» должно быть единÑтвенным"
-#: ../cli/src/utils.c:720
+#: ../clients/cli/utils.c:872
#, c-format
msgid "invalid field '%s'; allowed fields: %s"
msgstr "неверное поле «%s»; допуÑтимые полÑ: %s"
-#: ../cli/src/utils.c:747
+#: ../clients/cli/utils.c:929
msgid "Option '--terse' requires specifying '--fields'"
msgstr "Параметр «--terse» требует ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ Â«--fields»"
-#: ../cli/src/utils.c:751
+#: ../clients/cli/utils.c:933
#, c-format
msgid "Option '--terse' requires specific '--fields' option values , not '%s'"
msgstr ""
"Параметр «--terse» требует определённых значений «--fields», но не «%s»"
-#: ../cli/src/utils.c:1070
+#: ../clients/cli/utils.c:1301
#, c-format
msgid ""
"Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --"
@@ -4735,7 +5854,7 @@ msgstr ""
"Предупреждение: верÑии nmcli (%s) и NetworkManager (%s) не Ñовпадают. "
"ИÑпользуйте --nocheck Ð´Ð»Ñ Ð¿Ð¾Ð´Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ñтого предупреждениÑ.\n"
-#: ../cli/src/utils.c:1079
+#: ../clients/cli/utils.c:1310
#, c-format
msgid ""
"Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force "
@@ -4743,695 +5862,2214 @@ msgid ""
msgstr ""
"Ошибка: верÑии nmcli (%s) и NetworkManager (%s) не Ñовпадают. Ð”Ð»Ñ "
"принудительного запуÑка иÑпользуйте --nocheck, но результаты не предÑказуемы."
-""
-#: ../libnm-util/crypto.c:133
+#: ../clients/common/nm-polkit-listener.c:215
+msgid "An authentication session is already underway."
+msgstr ""
+
+#. TTLS and PEAP are actually much more complicated, but this complication
+#. * is not visible here since we only care about phase2 authentication
+#. * (and don't even care of which one)
+#.
+#: ../clients/common/nm-secret-agent-simple.c:209
+#: ../clients/common/nm-secret-agent-simple.c:300
+#: ../clients/tui/nmt-page-dsl.c:69 ../clients/tui/nmt-page-wifi.c:335
+msgid "Username"
+msgstr "Пользователь"
+
+#: ../clients/common/nm-secret-agent-simple.c:214
+#: ../clients/common/nm-secret-agent-simple.c:251
+#: ../clients/common/nm-secret-agent-simple.c:277
+#: ../clients/common/nm-secret-agent-simple.c:310
+#: ../clients/common/nm-secret-agent-simple.c:379
+#: ../clients/common/nm-secret-agent-simple.c:392
+#: ../clients/common/nm-secret-agent-simple.c:408
+#: ../clients/tui/nmt-page-dsl.c:78 ../clients/tui/nmt-page-wifi.c:280
+#: ../clients/tui/nmt-page-wifi.c:311 ../clients/tui/nmt-page-wifi.c:344
+msgid "Password"
+msgstr "Пароль"
+
+#: ../clients/common/nm-secret-agent-simple.c:223
+msgid "Identity"
+msgstr "ИдентификациÑ"
+
+#: ../clients/common/nm-secret-agent-simple.c:228
+msgid "Private key password"
+msgstr "Пароль Ñекретного ключа"
+
+#: ../clients/common/nm-secret-agent-simple.c:265
+#: ../clients/tui/nmt-page-wifi.c:292
+msgid "Key"
+msgstr "Ключ"
+
+#: ../clients/common/nm-secret-agent-simple.c:305
+#: ../clients/tui/nmt-page-dsl.c:81
+msgid "Service"
+msgstr "Служба"
+
+#: ../clients/common/nm-secret-agent-simple.c:339
+msgid "Authentication required by wireless network"
+msgstr "Ð”Ð»Ñ Ð´Ð¾Ñтупа к беÑпроводной Ñети требуетÑÑ Ð°ÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ"
+
+#: ../clients/common/nm-secret-agent-simple.c:340
+#, c-format
+msgid ""
+"Passwords or encryption keys are required to access the wireless network "
+"'%s'."
+msgstr ""
+"Ð”Ð»Ñ Ð´Ð¾Ñтупа к беÑпроводной Ñети «%s» требуютÑÑ Ð¿Ð°Ñ€Ð¾Ð»Ð¸ или ключи шифрованиÑ."
+
+#: ../clients/common/nm-secret-agent-simple.c:348
+msgid "Wired 802.1X authentication"
+msgstr "ÐÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð¿Ñ€Ð¾Ð²Ð¾Ð´Ð½Ð¾Ð³Ð¾ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ 802.1X"
+
+#: ../clients/common/nm-secret-agent-simple.c:351
+msgid "Network name"
+msgstr "Ð˜Ð¼Ñ Ñети"
+
+#: ../clients/common/nm-secret-agent-simple.c:358
+msgid "DSL authentication"
+msgstr "ÐÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ DSL"
+
+#: ../clients/common/nm-secret-agent-simple.c:366
+msgid "PIN code required"
+msgstr "ТребуетÑÑ PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:367
+msgid "PIN code is needed for the mobile broadband device"
+msgstr "Ð”Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¼Ð¾Ð±Ð¸Ð»ÑŒÐ½Ð¾Ð³Ð¾ уÑтройÑтва требуетÑÑ PIN-код"
+
+#: ../clients/common/nm-secret-agent-simple.c:369
+msgid "PIN"
+msgstr "PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:375
+#: ../clients/common/nm-secret-agent-simple.c:388
+#: ../clients/common/nm-secret-agent-simple.c:404
+msgid "Mobile broadband network password"
+msgstr "Пароль мобильной Ñети"
+
+#: ../clients/common/nm-secret-agent-simple.c:376
+#: ../clients/common/nm-secret-agent-simple.c:389
+#: ../clients/common/nm-secret-agent-simple.c:405
+#, c-format
+msgid "A password is required to connect to '%s'."
+msgstr "Ð”Ð»Ñ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ðº «%s» требуетÑÑ Ð¿Ð°Ñ€Ð¾Ð»ÑŒ."
+
+#: ../clients/nm-online.c:96
+#, c-format
+msgid "\rConnecting"
+msgstr "Подключение..."
+
+#: ../clients/nm-online.c:149
+msgid ""
+"Time to wait for a connection, in seconds (without the option, default value "
+"is 30)"
+msgstr "Ð’Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð² Ñекундах (по умолчанию 30)"
+
+#: ../clients/nm-online.c:150
+#, fuzzy
+#| msgid "Exit immediately if NetworkManager is not running"
+msgid "Exit immediately if NetworkManager is not running or connecting"
+msgstr "Выйти немедленно, еÑли NetworkManager не запущен"
+
+#: ../clients/nm-online.c:151
+msgid "Don't print anything"
+msgstr "Ðичего не выводить"
+
+#: ../clients/nm-online.c:152
+#, fuzzy
+#| msgid ""
+#| "Waits for NetworkManager to finish activating startup network connections."
+msgid "Wait for NetworkManager startup instead of a connection"
+msgstr "Ожидать уÑпешного ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð² NetworkManager."
+
+#: ../clients/nm-online.c:173
+msgid ""
+"Waits for NetworkManager to finish activating startup network connections."
+msgstr "Ожидать уÑпешного ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð² NetworkManager."
+
+#: ../clients/nm-online.c:180 ../clients/nm-online.c:186
+msgid "Invalid option. Please use --help to see a list of valid options."
+msgstr "Ðеверный параметр. ИÑпользуйте --help Ð´Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° ÑпиÑка параметров."
+
+#: ../clients/tui/newt/nmt-newt-utils.c:180 ../clients/tui/nmt-editor.c:417
+#: ../clients/tui/nmt-password-dialog.c:174
+#: ../clients/tui/nmt-route-editor.c:125 ../clients/tui/nmtui-hostname.c:71
+#: ../clients/tui/nmtui.c:117
+msgid "OK"
+msgstr "OK"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:328
+#: ../clients/tui/newt/nmt-newt-utils.c:360
+#, c-format
+msgid "Could not create temporary file: %s"
+msgstr "Ðе удалоÑÑŒ Ñоздать временный файл: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:368
+#, c-format
+msgid "Editor failed: %s"
+msgstr "Ошибка редактора: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:376
+#, fuzzy, c-format
+#| msgid "Editor failed: %s"
+msgid "Editor failed with status %d"
+msgstr "Ошибка редактора: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:378
+#, fuzzy, c-format
+#| msgid "Editor failed: %s"
+msgid "Editor failed with signal %d"
+msgstr "Ошибка редактора: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:382
+#, c-format
+msgid "Could not re-read file: %s"
+msgstr "Ðе удалоÑÑŒ заново прочитать файл: %s"
+
+#: ../clients/tui/nm-editor-utils.c:151
+#, c-format
+msgid "Ethernet connection %d"
+msgstr "Проводное Ñоединение %d"
+
+#: ../clients/tui/nm-editor-utils.c:159
+#, c-format
+msgid "Wi-Fi connection %d"
+msgstr "Соединение Wi-Fi %d"
+
+#: ../clients/tui/nm-editor-utils.c:168
+#, c-format
+msgid "InfiniBand connection %d"
+msgstr "Соединение InfiniBand %d"
+
+#: ../clients/tui/nm-editor-utils.c:173 ../libnm-glib/nm-device.c:1799
+#: ../libnm/nm-device.c:1621
+msgid "Mobile Broadband"
+msgstr "Мобильное"
+
+#: ../clients/tui/nm-editor-utils.c:176
+#, c-format
+msgid "Mobile broadband connection %d"
+msgstr "Мобильное Ñоединение %d"
+
+#: ../clients/tui/nm-editor-utils.c:182 ../clients/tui/nmt-page-dsl.c:65
+msgid "DSL"
+msgstr "DSL"
+
+#: ../clients/tui/nm-editor-utils.c:186
+#, c-format
+msgid "DSL connection %d"
+msgstr "Cоединение DSL %d"
+
+#: ../clients/tui/nm-editor-utils.c:191 ../libnm-core/nm-connection.c:1567
+#: ../libnm-glib/nm-device.c:1803 ../libnm-util/nm-connection.c:1608
+#: ../libnm/nm-device.c:1625 ../src/settings/plugins/ifcfg-rh/reader.c:3921
+msgid "Bond"
+msgstr "Ðгрегированное (Bond)"
+
+#: ../clients/tui/nm-editor-utils.c:195
+#, c-format
+msgid "Bond connection %d"
+msgstr "Ðгрегированное (Bond) Ñоединение %d"
+
+#: ../clients/tui/nm-editor-utils.c:200 ../libnm-core/nm-connection.c:1571
+#: ../libnm-glib/nm-device.c:1807 ../libnm-util/nm-connection.c:1612
+#: ../libnm/nm-device.c:1629 ../src/settings/plugins/ifcfg-rh/reader.c:4218
+msgid "Bridge"
+msgstr "МоÑÑ‚"
+
+#: ../clients/tui/nm-editor-utils.c:205
+#, c-format
+msgid "Bridge connection %d"
+msgstr "Соединение типа «моÑт» %d"
+
+#: ../clients/tui/nm-editor-utils.c:209 ../libnm-core/nm-connection.c:1569
+#: ../libnm-glib/nm-device.c:1805 ../libnm-util/nm-connection.c:1610
+#: ../libnm/nm-device.c:1627 ../src/settings/plugins/ifcfg-rh/reader.c:4027
+msgid "Team"
+msgstr "Ðгрегированное (Team)"
+
+#: ../clients/tui/nm-editor-utils.c:214
+#, c-format
+msgid "Team connection %d"
+msgstr "Ðгрегированное (Team) Ñоединение %d"
+
+#: ../clients/tui/nm-editor-utils.c:222
+#, c-format
+msgid "VLAN connection %d"
+msgstr "Соединение VLAN %d"
+
+#: ../clients/tui/nm-editor-utils.c:237
+#, c-format
+msgid "VPN connection %d"
+msgstr "Соединение VPN %d"
+
+#: ../clients/tui/nmt-device-entry.c:371
+msgid "Select..."
+msgstr "Выбрать..."
+
+#: ../clients/tui/nmt-edit-connection-list.c:112
+msgid "Add"
+msgstr "Добавить"
+
+#: ../clients/tui/nmt-edit-connection-list.c:115
+#: ../clients/tui/nmt-page-ip4.c:172 ../clients/tui/nmt-page-ip6.c:170
+#: ../clients/tui/nmt-page-team-port.c:112 ../clients/tui/nmt-page-team.c:176
+msgid "Edit..."
+msgstr "Изменить..."
+
+#: ../clients/tui/nmt-edit-connection-list.c:118
+#: ../clients/tui/nmtui-edit.c:527
+msgid "Delete"
+msgstr "Удалить"
+
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Hide"
+msgstr "Скрыть"
+
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Show"
+msgstr "Показать"
+
+#: ../clients/tui/nmt-editor.c:99
+#, c-format
+msgid "Could not create editor for connection '%s' of type '%s'."
+msgstr "Ðе удалоÑÑŒ открыть окно редактора Ð´Ð»Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» типа «%s»."
+
+#: ../clients/tui/nmt-editor.c:103
+#, c-format
+msgid "Could not create editor for invalid connection '%s'."
+msgstr "Ðе удалоÑÑŒ открыть окно редактора Ð´Ð»Ñ Ð½ÐµÐ²ÐµÑ€Ð½Ð¾Ð³Ð¾ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s»."
+
+#: ../clients/tui/nmt-editor.c:113
+msgid "Edit Connection"
+msgstr "Изменить Ñоединение"
+
+#: ../clients/tui/nmt-editor.c:166
+#, c-format
+msgid "Unable to save connection: %s"
+msgstr "Ðе удалоÑÑŒ Ñохранить Ñоединение: %s"
+
+#: ../clients/tui/nmt-editor.c:180
+#, c-format
+msgid "Unable to add new connection: %s"
+msgstr "Ðе удалоÑÑŒ добавить новое Ñоединение: %s"
+
+#: ../clients/tui/nmt-editor.c:322
+msgid "Profile name"
+msgstr "Ð˜Ð¼Ñ Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ"
+
+#: ../clients/tui/nmt-editor.c:333
+#, fuzzy
+#| msgid "Ethernet"
+msgid "Ethernet device"
+msgstr "Ethernet"
+
+#: ../clients/tui/nmt-editor.c:335
+msgid "Device"
+msgstr "УÑтройÑтво"
+
+#. And finally the bottom widgets
+#: ../clients/tui/nmt-editor.c:393
+msgid "Automatically connect"
+msgstr "ПодключатьÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑки"
+
+#: ../clients/tui/nmt-editor.c:399
+msgid "Available to all users"
+msgstr "ДоÑтупно вÑем"
+
+#: ../clients/tui/nmt-editor.c:414 ../clients/tui/nmt-password-dialog.c:171
+#: ../clients/tui/nmt-route-editor.c:118 ../clients/tui/nmtui-edit.c:218
+#: ../clients/tui/nmtui-edit.c:526 ../clients/tui/nmtui-hostname.c:69
+msgid "Cancel"
+msgstr "Отменить"
+
+#: ../clients/tui/nmt-mtu-entry.c:86
+msgid "(default)"
+msgstr "(по умолчанию)"
+
+#: ../clients/tui/nmt-mtu-entry.c:88 ../clients/tui/nmt-mtu-entry.c:119
+msgid "bytes"
+msgstr "байт"
+
+#: ../clients/tui/nmt-page-bond.c:87
+msgid "Round-robin"
+msgstr "ЦикличеÑкий"
+
+#: ../clients/tui/nmt-page-bond.c:88
+msgid "Active Backup"
+msgstr "Ðктивный и запаÑные"
+
+#: ../clients/tui/nmt-page-bond.c:89
+msgid "XOR"
+msgstr "XOR"
+
+#: ../clients/tui/nmt-page-bond.c:90
+msgid "Broadcast"
+msgstr "РаÑÑылка"
+
+#: ../clients/tui/nmt-page-bond.c:91
+msgid "802.3ad"
+msgstr "802.3ad"
+
+#: ../clients/tui/nmt-page-bond.c:92
+msgid "Adaptive Transmit Load Balancing (tlb)"
+msgstr "Ðдаптивное раÑпределение нагрузки иÑходÑщего трафика (TLB)"
+
+#: ../clients/tui/nmt-page-bond.c:93
+msgid "Adaptive Load Balancing (alb)"
+msgstr "Ðдаптивное раÑпределение нагрузки (ALB)"
+
+#: ../clients/tui/nmt-page-bond.c:99
+msgid "MII (recommended)"
+msgstr "MII (рекомендуетÑÑ)"
+
+#: ../clients/tui/nmt-page-bond.c:100
+msgid "ARP"
+msgstr "ARP"
+
+#: ../clients/tui/nmt-page-bond.c:358 ../clients/tui/nmt-page-bridge.c:81
+#: ../clients/tui/nmt-page-team.c:155
+msgid "Slaves"
+msgstr "Слейвы"
+
+#: ../clients/tui/nmt-page-bond.c:370 ../clients/tui/nmt-page-wifi.c:233
+msgid "Mode"
+msgstr "Режим"
+
+#: ../clients/tui/nmt-page-bond.c:376
+msgid "Primary"
+msgstr "ОÑновной"
+
+#: ../clients/tui/nmt-page-bond.c:382
+msgid "Link monitoring"
+msgstr "Мониторинг ÑоединениÑ"
+
+#: ../clients/tui/nmt-page-bond.c:388 ../clients/tui/nmt-page-bond.c:395
+#: ../clients/tui/nmt-page-bond.c:402 ../clients/tui/nmt-page-bond.c:409
+msgctxt "milliseconds"
+msgid "ms"
+msgstr "мÑ"
+
+#: ../clients/tui/nmt-page-bond.c:389 ../clients/tui/nmt-page-bond.c:410
+msgid "Monitoring frequency"
+msgstr "ЧаÑтота мониторинга"
+
+#: ../clients/tui/nmt-page-bond.c:396
+msgid "Link up delay"
+msgstr "Задержка уÑтановки ÑоединениÑ"
+
+#: ../clients/tui/nmt-page-bond.c:403
+msgid "Link down delay"
+msgstr "Задержка разрыва ÑоединениÑ"
+
+#: ../clients/tui/nmt-page-bond.c:416
+msgid "ARP targets"
+msgstr "Получатели ARP"
+
+#: ../clients/tui/nmt-page-bridge-port.c:63
+msgid "BRIDGE PORT"
+msgstr "ПОРТ МОСТÐ"
+
+#: ../clients/tui/nmt-page-bridge-port.c:70
+#: ../clients/tui/nmt-page-bridge.c:107
+msgid "Priority"
+msgstr "Приоритет"
+
+#: ../clients/tui/nmt-page-bridge-port.c:76
+msgid "Path cost"
+msgstr "СтоимоÑÑ‚ÑŒ пути"
+
+#: ../clients/tui/nmt-page-bridge-port.c:78
+msgid "Hairpin mode"
+msgstr "Режим разворота пакетов"
+
+#: ../clients/tui/nmt-page-bridge.c:91 ../clients/tui/nmt-page-bridge.c:116
+#: ../clients/tui/nmt-page-bridge.c:126 ../clients/tui/nmt-page-bridge.c:136
+msgid "seconds"
+msgstr "Ñек."
+
+#: ../clients/tui/nmt-page-bridge.c:92
+msgid "Aging time"
+msgstr "Ð’Ñ€ÐµÐ¼Ñ ÑтарениÑ"
+
+#: ../clients/tui/nmt-page-bridge.c:94
+msgid "Enable STP (Spanning Tree Protocol)"
+msgstr "Включить STP (Spanning Tree Protocol)"
+
+#: ../clients/tui/nmt-page-bridge.c:117
+msgid "Forward delay"
+msgstr "Задержка переадреÑации"
+
+#: ../clients/tui/nmt-page-bridge.c:127
+msgid "Hello time"
+msgstr "Ð’Ñ€ÐµÐ¼Ñ Ð¿Ñ€Ð¸Ð²ÐµÑ‚ÑтвиÑ"
+
+#: ../clients/tui/nmt-page-bridge.c:137
+msgid "Max age"
+msgstr "МакÑимальный Ñрок"
+
+#: ../clients/tui/nmt-page-ethernet.c:73
+msgid "ETHERNET"
+msgstr "ETHERNET"
+
+#: ../clients/tui/nmt-page-ethernet.c:80 ../clients/tui/nmt-page-vlan.c:125
+#: ../clients/tui/nmt-page-wifi.c:367
+msgid "Cloned MAC address"
+msgstr "Клонированный MAC-адреÑ"
+
+#: ../clients/tui/nmt-page-infiniband.c:50
+msgid "Datagram"
+msgstr "Датаграмма"
+
+#: ../clients/tui/nmt-page-infiniband.c:51
+msgid "Connected"
+msgstr "Подключено"
+
+#: ../clients/tui/nmt-page-infiniband.c:84
+msgid "INFINIBAND"
+msgstr "INFINIBAND"
+
+#: ../clients/tui/nmt-page-infiniband.c:91
+msgid "Transport mode"
+msgstr "ТранÑпортный режим"
+
+#: ../clients/tui/nmt-page-ip4.c:41
+msgid "Disabled"
+msgstr "Отключено"
+
+#: ../clients/tui/nmt-page-ip4.c:42 ../clients/tui/nmt-page-ip6.c:42
+msgid "Automatic"
+msgstr "ÐвтоматичеÑки"
+
+#: ../clients/tui/nmt-page-ip4.c:43 ../clients/tui/nmt-page-ip6.c:44
+msgid "Link-Local"
+msgstr "Ð›Ð¾ÐºÐ°Ð»ÑŒÐ½Ð°Ñ ÑвÑзь"
+
+#: ../clients/tui/nmt-page-ip4.c:44 ../clients/tui/nmt-page-ip6.c:45
+msgid "Manual"
+msgstr "Вручную"
+
+#: ../clients/tui/nmt-page-ip4.c:45
+msgid "Shared"
+msgstr "Общее"
+
+#: ../clients/tui/nmt-page-ip4.c:85 ../clients/tui/nmt-page-ip6.c:85
+msgid "(No custom routes)"
+msgstr "(нет дополнительных маршрутов)"
+
+#: ../clients/tui/nmt-page-ip4.c:88 ../clients/tui/nmt-page-ip6.c:88
+#, c-format
+msgid "One custom route"
+msgid_plural "%d custom routes"
+msgstr[0] "%d дополнительный маршрут"
+msgstr[1] "%d дополнительных маршрута"
+msgstr[2] "%d дополнительных маршрутов"
+
+#: ../clients/tui/nmt-page-ip4.c:131
+msgid "IPv4 CONFIGURATION"
+msgstr "КОÐФИГУРÐЦИЯ IPv4"
+
+#: ../clients/tui/nmt-page-ip4.c:139 ../clients/tui/nmt-page-ip6.c:139
+msgid "Addresses"
+msgstr "ÐдреÑа"
+
+#: ../clients/tui/nmt-page-ip4.c:146 ../clients/tui/nmt-page-ip6.c:146
+msgid "Gateway"
+msgstr "Шлюз"
+
+#: ../clients/tui/nmt-page-ip4.c:153 ../clients/tui/nmt-page-ip6.c:153
+msgid "DNS servers"
+msgstr "Серверы DNS"
+
+#: ../clients/tui/nmt-page-ip4.c:159 ../clients/tui/nmt-page-ip6.c:159
+msgid "Search domains"
+msgstr "ПоиÑк доменов"
+
+#: ../clients/tui/nmt-page-ip4.c:174 ../clients/tui/nmt-page-ip6.c:172
+msgid "Routing"
+msgstr "МаршрутизациÑ"
+
+#: ../clients/tui/nmt-page-ip4.c:176 ../clients/tui/nmt-page-ip6.c:174
+msgid "Never use this network for default route"
+msgstr "Ðе иÑпользовать Ñту Ñеть Ð´Ð»Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ³Ð¾ маршрута"
+
+#: ../clients/tui/nmt-page-ip4.c:184
+msgid "Require IPv4 addressing for this connection"
+msgstr "Соединение требует адреÑацию IPv4"
+
+#: ../clients/tui/nmt-page-ip6.c:41
+msgid "Ignore"
+msgstr "Игнорировать"
+
+#: ../clients/tui/nmt-page-ip6.c:43
+msgid "Automatic (DHCP-only)"
+msgstr "ÐвтоматичеÑки (только DHCP)"
+
+#: ../clients/tui/nmt-page-ip6.c:131
+msgid "IPv6 CONFIGURATION"
+msgstr "КОÐФИГУРÐЦИЯ IPv6"
+
+#: ../clients/tui/nmt-page-ip6.c:182
+msgid "Require IPv6 addressing for this connection"
+msgstr "Соединение требует адреÑацию IPv6"
+
+#: ../clients/tui/nmt-page-ppp.c:134
+msgid "PPP CONFIGURATION"
+msgstr "КОÐФИГУРÐЦИЯ PPP"
+
+#: ../clients/tui/nmt-page-ppp.c:143
+#, fuzzy
+#| msgid "Authentication"
+msgid "Allowed authentication methods:"
+msgstr "ÐутентификациÑ"
+
+#: ../clients/tui/nmt-page-ppp.c:150
+msgid "EAP"
+msgstr "EAP"
+
+#: ../clients/tui/nmt-page-ppp.c:158
+msgid "PAP"
+msgstr "PAP"
+
+#: ../clients/tui/nmt-page-ppp.c:166
+msgid "CHAP"
+msgstr "CHAP"
+
+#: ../clients/tui/nmt-page-ppp.c:174
+msgid "MSCHAPv2"
+msgstr "MSCHAPv2"
+
+#: ../clients/tui/nmt-page-ppp.c:182
+msgid "MSCHAP"
+msgstr "MSCHAP"
+
+#: ../clients/tui/nmt-page-ppp.c:198
+msgid "Use point-to-point encryption (MPPE)"
+msgstr ""
+
+#: ../clients/tui/nmt-page-ppp.c:210
+msgid "Require 128-bit encryption"
+msgstr ""
+
+#: ../clients/tui/nmt-page-ppp.c:220
+msgid "Use stateful MPPE"
+msgstr ""
+
+#: ../clients/tui/nmt-page-ppp.c:232
+msgid "Allow BSD data compression"
+msgstr ""
+
+#: ../clients/tui/nmt-page-ppp.c:240
+msgid "Allow Deflate data compression"
+msgstr ""
+
+#: ../clients/tui/nmt-page-ppp.c:248
+msgid "Use TCP header compression"
+msgstr ""
+
+#: ../clients/tui/nmt-page-ppp.c:258
+msgid "Send PPP echo packets"
+msgstr ""
+
+#: ../clients/tui/nmt-page-team-port.c:95
+msgid "TEAM PORT"
+msgstr "ПОРТ ÐГРЕГÐЦИИ (TEAM)"
+
+#: ../clients/tui/nmt-page-team-port.c:102 ../clients/tui/nmt-page-team.c:166
+msgid "JSON configuration"
+msgstr "ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ JSON"
+
+#: ../clients/tui/nmt-page-vlan.c:102
+msgid "Parent"
+msgstr "РодительÑкий"
+
+#: ../clients/tui/nmt-page-vlan.c:117
+msgid "VLAN id"
+msgstr "VLAN ID"
+
+#: ../clients/tui/nmt-page-wifi.c:67
+msgctxt "Wi-Fi"
+msgid "Client"
+msgstr "Клиент"
+
+#: ../clients/tui/nmt-page-wifi.c:68
+msgid "Access Point"
+msgstr "Точка доÑтупа"
+
+#: ../clients/tui/nmt-page-wifi.c:69
+msgid "Ad-Hoc Network"
+msgstr "ДинамичеÑÐºÐ°Ñ Ñеть"
+
+#: ../clients/tui/nmt-page-wifi.c:74
+msgctxt "Wi-Fi"
+msgid "Automatic"
+msgstr "ÐвтоматичеÑки"
+
+#. 802.11a Wi-Fi network
+#: ../clients/tui/nmt-page-wifi.c:76
+msgid "A (5 GHz)"
+msgstr "A (5 ГГц)"
+
+#. 802.11b / 802.11g Wi-Fi network
+#: ../clients/tui/nmt-page-wifi.c:78
+msgid "B/G (2.4 GHz)"
+msgstr "B/G (2.4 ГГц)"
+
+#: ../clients/tui/nmt-page-wifi.c:83
+msgctxt "Wi-Fi security"
+msgid "None"
+msgstr "Ðет"
+
+#: ../clients/tui/nmt-page-wifi.c:84
+msgid "WPA & WPA2 Personal"
+msgstr "WPA и WPA2 Personal"
+
+#: ../clients/tui/nmt-page-wifi.c:85
+msgid "WPA & WPA2 Enterprise"
+msgstr "WPA и WPA2 Enterprise"
+
+#: ../clients/tui/nmt-page-wifi.c:86
+msgid "WEP 40/128-bit Key (Hex or ASCII)"
+msgstr "40/128-битный ключ WEP (Hex или ASCII))"
+
+#: ../clients/tui/nmt-page-wifi.c:87
+msgid "WEP 128-bit Passphrase"
+msgstr "128-битный ключ WEP"
+
+#: ../clients/tui/nmt-page-wifi.c:88
+msgid "Dynamic WEP (802.1x)"
+msgstr "ДинамичеÑкий WEP (802.1x)"
+
+#: ../clients/tui/nmt-page-wifi.c:89
+msgid "LEAP"
+msgstr "LEAP"
+
+#: ../clients/tui/nmt-page-wifi.c:94
+msgctxt "WEP key index"
+msgid "1 (Default)"
+msgstr "1 (по умолчанию)"
+
+#: ../clients/tui/nmt-page-wifi.c:95
+msgctxt "WEP key index"
+msgid "2"
+msgstr "2"
+
+#: ../clients/tui/nmt-page-wifi.c:96
+msgctxt "WEP key index"
+msgid "3"
+msgstr "3"
+
+#: ../clients/tui/nmt-page-wifi.c:97
+msgctxt "WEP key index"
+msgid "4"
+msgstr "4"
+
+#: ../clients/tui/nmt-page-wifi.c:102
+msgid "Open System"
+msgstr "ÐžÑ‚ÐºÑ€Ñ‹Ñ‚Ð°Ñ ÑиÑтема"
+
+#: ../clients/tui/nmt-page-wifi.c:103
+msgid "Shared Key"
+msgstr "Общий ключ"
+
+#: ../clients/tui/nmt-page-wifi.c:217
+msgid "WI-FI"
+msgstr "WI-FI"
+
+#: ../clients/tui/nmt-page-wifi.c:259
+msgid "Channel"
+msgstr "Канал"
+
+#: ../clients/tui/nmt-page-wifi.c:264
+msgid "Security"
+msgstr "Защита"
+
+#. "wpa-enterprise"
+#. FIXME
+#: ../clients/tui/nmt-page-wifi.c:285
+msgid "(No support for wpa-enterprise yet...)"
+msgstr "(wpa-enterprise не поддерживаетÑÑ)"
+
+#: ../clients/tui/nmt-page-wifi.c:295 ../clients/tui/nmt-page-wifi.c:314
+msgid "WEP index"
+msgstr "Ð˜Ð½Ð´ÐµÐºÑ WEP"
+
+#: ../clients/tui/nmt-page-wifi.c:303 ../clients/tui/nmt-page-wifi.c:322
+msgid "Authentication"
+msgstr "ÐутентификациÑ"
+
+#. "dynamic-wep"
+#. FIXME
+#: ../clients/tui/nmt-page-wifi.c:328
+msgid "(No support for dynamic-wep yet...)"
+msgstr "(dynamic-wep не поддерживаетÑÑ)"
+
+#: ../clients/tui/nmt-password-fields.c:130
+msgid "Ask for this password every time"
+msgstr "Запрашивать пароль каждый раз"
+
+#: ../clients/tui/nmt-password-fields.c:131
+msgid "Show password"
+msgstr "Показать пароль"
+
+#: ../clients/tui/nmt-route-table.c:192
+msgid "Destination"
+msgstr "Ðазначение"
+
+#: ../clients/tui/nmt-route-table.c:192
+msgid "Prefix"
+msgstr "ПрефикÑ"
+
+#: ../clients/tui/nmt-route-table.c:201
+msgid "Next Hop"
+msgstr "Следующий переход"
+
+#: ../clients/tui/nmt-route-table.c:209
+msgid "Metric"
+msgstr "Метрика"
+
+#: ../clients/tui/nmt-route-table.c:229
+msgid "No custom routes are defined."
+msgstr "Ðет дополнительных маршрутов."
+
+#: ../clients/tui/nmt-slave-list.c:137
+msgid "Select the type of slave connection you wish to add."
+msgstr "Выберите тип добавлÑемого подчиненного ÑоединениÑ."
+
+#: ../clients/tui/nmt-widget-list.c:141
+msgid "Add..."
+msgstr "Добавить..."
+
+#: ../clients/tui/nmt-widget-list.c:204
+msgid "Remove"
+msgstr "Удалить"
+
+#: ../clients/tui/nmtui-connect.c:90
+msgid "Activation failed"
+msgstr "Ошибка подключениÑ"
+
+#: ../clients/tui/nmtui-connect.c:145
+msgid "Connecting..."
+msgstr "Подключение..."
+
+#: ../clients/tui/nmtui-connect.c:180 ../clients/tui/nmtui-connect.c:211
+#, c-format
+msgid "Could not activate connection: %s"
+msgstr "Ðе удалоÑÑŒ подключитьÑÑ Ðº %s"
+
+#: ../clients/tui/nmtui-connect.c:271 ../clients/tui/nmtui-connect.c:320
+msgid "Activate"
+msgstr "Включить"
+
+#: ../clients/tui/nmtui-connect.c:273
+msgid "Deactivate"
+msgstr "Отключить"
+
+#: ../clients/tui/nmtui-connect.c:325 ../clients/tui/nmtui-edit.c:121
+#: ../clients/tui/nmtui.c:111
+msgid "Quit"
+msgstr "Выйти"
+
+#: ../clients/tui/nmtui-connect.c:348
+#, c-format
+msgid "No such connection '%s'"
+msgstr "Ðет ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s»."
+
+#: ../clients/tui/nmtui-connect.c:350
+msgid "Connection is already active"
+msgstr "Соединение активно"
+
+#: ../clients/tui/nmtui-edit.c:226
+msgid "Create"
+msgstr "Создать"
+
+#: ../clients/tui/nmtui-edit.c:368
+msgid "Select the type of connection you wish to create."
+msgstr "Выберите тип нового ÑоединениÑ."
+
+#: ../clients/tui/nmtui-edit.c:376
+msgid ""
+"If you are creating a VPN, and the VPN connection you wish to create does "
+"not appear in the list, you may not have the correct VPN plugin installed."
+msgstr ""
+"ОтÑутÑтвие необходимого типа VPN в ÑпиÑке может говорить о том, что в "
+"ÑиÑтеме не уÑтановлен ÑоответÑтвующий модуль VPN."
+
+#: ../clients/tui/nmtui-edit.c:412 ../clients/tui/nmtui-edit.c:428
+msgid "New Connection"
+msgstr "Ðовое Ñоединение"
+
+#: ../clients/tui/nmtui-edit.c:467
+#, c-format
+msgid "Unable to delete connection: %s"
+msgstr "Ðе удалоÑÑŒ удалить Ñоединение: %s"
+
+#: ../clients/tui/nmtui-edit.c:506
+#, fuzzy, c-format
+#| msgid "Could not delete connection: %s"
+msgid "Could not delete connection '%s': %s"
+msgstr "Ðе удалоÑÑŒ удалить Ñоединение: %s"
+
+#: ../clients/tui/nmtui-edit.c:528
+#, c-format
+msgid "Are you sure you want to delete the connection '%s'?"
+msgstr "ДейÑтвительно удалить Ñоединение «%s»?"
+
+#: ../clients/tui/nmtui-hostname.c:47
+msgid "Set Hostname"
+msgstr "Измените Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°"
+
+#: ../clients/tui/nmtui-hostname.c:55
+msgid "Hostname"
+msgstr "Ð˜Ð¼Ñ ÑƒÐ·Ð»Ð°"
+
+#. Translators: this indicates the result. ie, "I have set the hostname to ..."
+#: ../clients/tui/nmtui-hostname.c:118
+#, c-format
+msgid "Set hostname to '%s'"
+msgstr "Изменить Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð° на «%s»"
+
+#: ../clients/tui/nmtui-hostname.c:120
+#, c-format
+msgid "Unable to set hostname: %s"
+msgstr "Ðе удалоÑÑŒ уÑтановить Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°: %s"
+
+#: ../clients/tui/nmtui.c:56 ../clients/tui/nmtui.c:59
+msgid "connection"
+msgstr "Ñоединение"
+
+#: ../clients/tui/nmtui.c:57
+msgid "Edit a connection"
+msgstr "Изменить Ñоединение"
+
+#: ../clients/tui/nmtui.c:60
+msgid "Activate a connection"
+msgstr "ПодключитьÑÑ"
+
+#: ../clients/tui/nmtui.c:62
+msgid "new hostname"
+msgstr "новое Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°"
+
+#: ../clients/tui/nmtui.c:63
+msgid "Set system hostname"
+msgstr "Измените Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°"
+
+#: ../clients/tui/nmtui.c:86
+msgid "NetworkManager TUI"
+msgstr "TUI NetworkManager"
+
+#: ../clients/tui/nmtui.c:94
+msgid "Please select an option"
+msgstr "Выберите вариант"
+
+#: ../clients/tui/nmtui.c:146
+msgid "Usage"
+msgstr "ИÑпользование"
+
+#: ../clients/tui/nmtui.c:227
+msgid "Could not parse arguments"
+msgstr "Ðе удалоÑÑŒ обработать аргументы"
+
+#: ../clients/tui/nmtui.c:237
+#, fuzzy, c-format
+#| msgid "Could not activate connection: %s"
+msgid "Could not contact NetworkManager: %s.\n"
+msgstr "Ðе удалоÑÑŒ подключитьÑÑ Ðº %s"
+
+#: ../clients/tui/nmtui.c:242
+msgid "NetworkManager is not running."
+msgstr "NetworkManager не работает."
+
+#: ../libnm-core/crypto.c:120 ../libnm-util/crypto.c:133
#, c-format
msgid "PEM key file had no end tag '%s'."
msgstr "Файл ключа PEM не Ñодержит завершающий тег «%s»."
-#: ../libnm-util/crypto.c:146
+#: ../libnm-core/crypto.c:133 ../libnm-util/crypto.c:146
#, c-format
msgid "Doesn't look like a PEM private key file."
msgstr "Возможно, Ñто не файл личного ключа PEM."
-#: ../libnm-util/crypto.c:163
+#: ../libnm-core/crypto.c:150 ../libnm-util/crypto.c:163
#, c-format
msgid "Malformed PEM file: Proc-Type was not first tag."
msgstr "Ðекорректный файл PEM: Proc-Type не ÑвлÑетÑÑ Ð¿ÐµÑ€Ð²Ñ‹Ð¼ тегом."
-#: ../libnm-util/crypto.c:171
+#: ../libnm-core/crypto.c:158 ../libnm-util/crypto.c:171
#, c-format
msgid "Malformed PEM file: unknown Proc-Type tag '%s'."
msgstr "Ðекорректный файл PEM: неизвеÑтный тег Proc-Type «%s»."
-#: ../libnm-util/crypto.c:181
+#: ../libnm-core/crypto.c:168 ../libnm-util/crypto.c:181
#, c-format
msgid "Malformed PEM file: DEK-Info was not the second tag."
msgstr "Ðекорректный файл PEM: DEK-Info не ÑвлÑетÑÑ Ð²Ñ‚Ð¾Ñ€Ñ‹Ð¼ тегом."
-#: ../libnm-util/crypto.c:192
+#: ../libnm-core/crypto.c:179 ../libnm-util/crypto.c:192
#, c-format
msgid "Malformed PEM file: no IV found in DEK-Info tag."
msgstr "Ðекорректный файл PEM: в теге DEK-Info не найден ВИ."
-#: ../libnm-util/crypto.c:199
+#: ../libnm-core/crypto.c:186 ../libnm-util/crypto.c:199
#, c-format
msgid "Malformed PEM file: invalid format of IV in DEK-Info tag."
msgstr "Ðекорректный файл PEM: неверный формат ВИ в теге DEK-Info."
-#: ../libnm-util/crypto.c:212
+#: ../libnm-core/crypto.c:201 ../libnm-util/crypto.c:214
#, c-format
msgid "Malformed PEM file: unknown private key cipher '%s'."
msgstr "Ðекорректный файл PEM: неизвеÑтный шифр личного ключа «%s»."
-#: ../libnm-util/crypto.c:231
+#: ../libnm-core/crypto.c:220 ../libnm-util/crypto.c:233
#, c-format
msgid "Could not decode private key."
msgstr "Ðе удалоÑÑŒ раÑшифровать личный ключ."
-#: ../libnm-util/crypto.c:283
+#: ../libnm-core/crypto.c:274 ../libnm-util/crypto.c:285
msgid "Failed to find expected PKCS#8 start tag."
msgstr "Ðе удалоÑÑŒ найти открывающий тег PKCS#8."
-#: ../libnm-util/crypto.c:291
+#: ../libnm-core/crypto.c:282 ../libnm-util/crypto.c:293
#, c-format
msgid "Failed to find expected PKCS#8 end tag '%s'."
msgstr "Ðе удалоÑÑŒ найти закрывающий тег PKCS#8 — «%s»."
-#: ../libnm-util/crypto.c:310
+#: ../libnm-core/crypto.c:301 ../libnm-util/crypto.c:312
msgid "Failed to decode PKCS#8 private key."
msgstr "Ðе удалоÑÑŒ раÑшифровать личный ключ PKCS#8."
-#: ../libnm-util/crypto.c:352
+#: ../libnm-core/crypto.c:343 ../libnm-util/crypto.c:354
#, c-format
msgid "IV must be an even number of bytes in length."
msgstr "Длина ВИ должна быть равна чётному количеÑтву байт."
-#: ../libnm-util/crypto.c:366
+#: ../libnm-core/crypto.c:357 ../libnm-util/crypto.c:368
#, c-format
msgid "IV contains non-hexadecimal digits."
msgstr "ВИ включает не шеÑтнадцатеричные цифры."
-#: ../libnm-util/crypto.c:404 ../libnm-util/crypto_gnutls.c:147
-#: ../libnm-util/crypto_gnutls.c:259 ../libnm-util/crypto_nss.c:167
-#: ../libnm-util/crypto_nss.c:326
+#: ../libnm-core/crypto.c:397 ../libnm-core/crypto_gnutls.c:93
+#: ../libnm-core/crypto_gnutls.c:214 ../libnm-core/crypto_nss.c:115
+#: ../libnm-core/crypto_nss.c:280 ../libnm-util/crypto.c:408
+#: ../libnm-util/crypto_gnutls.c:146 ../libnm-util/crypto_gnutls.c:263
+#: ../libnm-util/crypto_nss.c:165 ../libnm-util/crypto_nss.c:326
#, c-format
msgid "Private key cipher '%s' was unknown."
msgstr "ÐеизвеÑтный шифр личного ключа «%s»."
-#: ../libnm-util/crypto.c:511
+#: ../libnm-core/crypto.c:496 ../libnm-util/crypto.c:518
#, c-format
msgid "Unable to determine private key type."
msgstr "Ðе удалоÑÑŒ определить тип личного ключа."
-#: ../libnm-util/crypto.c:566
+#: ../libnm-core/crypto.c:504
+#, c-format
+msgid "Password provided, but key was not encrypted."
+msgstr ""
+
+#: ../libnm-core/crypto.c:557 ../libnm-util/crypto.c:573
#, c-format
msgid "PEM certificate had no start tag '%s'."
msgstr "Сертификат PEM не имеет тега начала «%s»."
-#: ../libnm-util/crypto.c:575
+#: ../libnm-core/crypto.c:566 ../libnm-util/crypto.c:582
#, c-format
msgid "PEM certificate had no end tag '%s'."
msgstr "Сертификат PEM не имеет тега Ð¾ÐºÐ¾Ð½Ñ‡Ð°Ð½Ð¸Ñ Â«%s»."
-#: ../libnm-util/crypto.c:593
+#: ../libnm-core/crypto.c:584 ../libnm-util/crypto.c:600
#, c-format
msgid "Failed to decode certificate."
msgstr "Ðе удалоÑÑŒ раÑшифровать Ñертификат."
-#: ../libnm-util/crypto_gnutls.c:50
+#: ../libnm-core/crypto_gnutls.c:51 ../libnm-util/crypto_gnutls.c:51
msgid "Failed to initialize the crypto engine."
msgstr "Ðе удалоÑÑŒ инициализировать криптографичеÑкий модуль."
-#: ../libnm-util/crypto_gnutls.c:92
-#, c-format
-msgid "Failed to initialize the MD5 engine: %s / %s."
-msgstr "Ðе удалоÑÑŒ инициализировать модуль MD5: %s / %s."
-
-#: ../libnm-util/crypto_gnutls.c:155
+#: ../libnm-core/crypto_gnutls.c:101 ../libnm-util/crypto_gnutls.c:154
#, c-format
msgid "Invalid IV length (must be at least %zd)."
msgstr "ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ Ð´Ð»Ð¸Ð½Ð° ВИ (минимально %zd)."
-#: ../libnm-util/crypto_gnutls.c:166
+#: ../libnm-core/crypto_gnutls.c:112 ../libnm-util/crypto_gnutls.c:165
#, c-format
msgid "Failed to initialize the decryption cipher context: %s / %s."
msgstr "Ðе удалоÑÑŒ инициализировать контекÑÑ‚ шифра декодированиÑ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:175
+#: ../libnm-core/crypto_gnutls.c:121 ../libnm-util/crypto_gnutls.c:174
#, c-format
msgid "Failed to set symmetric key for decryption: %s / %s."
msgstr "Ðе удалоÑÑŒ Ñоздать Ñимметричный ключ Ð´Ð»Ñ Ñ€Ð°Ñшифровки: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:184
+#: ../libnm-core/crypto_gnutls.c:130 ../libnm-util/crypto_gnutls.c:183
#, c-format
msgid "Failed to set IV for decryption: %s / %s."
msgstr "Ðе удалоÑÑŒ Ñоздать ВИ Ð´Ð»Ñ Ñ€Ð°Ñшифровки: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:193
+#: ../libnm-core/crypto_gnutls.c:139 ../libnm-util/crypto_gnutls.c:192
#, c-format
msgid "Failed to decrypt the private key: %s / %s."
msgstr "Ðе удалоÑÑŒ Ñоздать ВИ Ð´Ð»Ñ Ñ€Ð°Ñшифровки: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:203 ../libnm-util/crypto_nss.c:257
+#: ../libnm-core/crypto_gnutls.c:149 ../libnm-core/crypto_nss.c:205
+#: ../libnm-util/crypto_gnutls.c:202 ../libnm-util/crypto_nss.c:255
#, c-format
msgid "Failed to decrypt the private key: unexpected padding length."
msgstr "Ðе удалоÑÑŒ раÑшифровать личный ключ: Ð½ÐµÐ¿Ñ€ÐµÐ´Ð²Ð¸Ð´ÐµÐ½Ð½Ð°Ñ Ð´Ð»Ð¸Ð½Ð° заполнениÑ."
-#: ../libnm-util/crypto_gnutls.c:214 ../libnm-util/crypto_nss.c:268
+#: ../libnm-core/crypto_gnutls.c:160 ../libnm-core/crypto_nss.c:216
+#: ../libnm-util/crypto_gnutls.c:213 ../libnm-util/crypto_nss.c:266
#, c-format
msgid "Failed to decrypt the private key."
msgstr "Ðе удалоÑÑŒ раÑшифровать личный ключ."
-#: ../libnm-util/crypto_gnutls.c:281
+#: ../libnm-core/crypto_gnutls.c:236 ../libnm-util/crypto_gnutls.c:285
#, c-format
msgid "Failed to initialize the encryption cipher context: %s / %s."
msgstr "Ðе удалоÑÑŒ инициализировать контекÑÑ‚ кода шифрованиÑ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:290
+#: ../libnm-core/crypto_gnutls.c:245 ../libnm-util/crypto_gnutls.c:294
#, c-format
msgid "Failed to set symmetric key for encryption: %s / %s."
msgstr "Ðе удалоÑÑŒ Ñоздать Ñимметричный ключ Ð´Ð»Ñ ÑˆÐ¸Ñ„Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:300
+#: ../libnm-core/crypto_gnutls.c:255 ../libnm-util/crypto_gnutls.c:304
#, c-format
msgid "Failed to set IV for encryption: %s / %s."
msgstr "Ðе удалоÑÑŒ Ñоздать ВИ Ð´Ð»Ñ ÑˆÐ¸Ñ„Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:309
+#: ../libnm-core/crypto_gnutls.c:264 ../libnm-util/crypto_gnutls.c:313
#, c-format
msgid "Failed to encrypt the data: %s / %s."
msgstr "Ðе удалоÑÑŒ зашифровать данные: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:349
+#: ../libnm-core/crypto_gnutls.c:307 ../libnm-util/crypto_gnutls.c:353
#, c-format
msgid "Error initializing certificate data: %s"
msgstr "Ошибка инициализации данных Ñертификата: %s"
-#: ../libnm-util/crypto_gnutls.c:371
+#: ../libnm-core/crypto_gnutls.c:329 ../libnm-util/crypto_gnutls.c:375
#, c-format
msgid "Couldn't decode certificate: %s"
msgstr "Ðе удалоÑÑŒ раÑшифровать Ñертификат: %s"
-#: ../libnm-util/crypto_gnutls.c:395
+#: ../libnm-core/crypto_gnutls.c:357 ../libnm-util/crypto_gnutls.c:399
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %s"
msgstr "Ðе удалоÑÑŒ инициализировать декодер PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:408
+#: ../libnm-core/crypto_gnutls.c:370 ../libnm-util/crypto_gnutls.c:412
#, c-format
msgid "Couldn't decode PKCS#12 file: %s"
msgstr "Ðе удалоÑÑŒ раÑшифровать файл PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:420
+#: ../libnm-core/crypto_gnutls.c:382 ../libnm-util/crypto_gnutls.c:424
#, c-format
msgid "Couldn't verify PKCS#12 file: %s"
msgstr "Ðе удалоÑÑŒ проверить файл PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:448
+#: ../libnm-core/crypto_gnutls.c:414 ../libnm-util/crypto_gnutls.c:452
#, c-format
msgid "Couldn't initialize PKCS#8 decoder: %s"
msgstr "Ðе удалоÑÑŒ инициализировать декодер PKCS#8: %s"
-#: ../libnm-util/crypto_gnutls.c:471
+#: ../libnm-core/crypto_gnutls.c:437 ../libnm-util/crypto_gnutls.c:475
#, c-format
msgid "Couldn't decode PKCS#8 file: %s"
msgstr "Ðе удалоÑÑŒ раÑшифровать файл PKCS#12: %s"
-#: ../libnm-util/crypto_nss.c:56
+#: ../libnm-core/crypto_nss.c:57 ../libnm-util/crypto_nss.c:56
#, c-format
msgid "Failed to initialize the crypto engine: %d."
msgstr "Ðе удалоÑÑŒ инициализировать криптографичеÑкий модуль: %d."
-#: ../libnm-util/crypto_nss.c:107
-#, c-format
-msgid "Failed to initialize the MD5 context: %d."
-msgstr "Ðе удалоÑÑŒ инициализировать контекÑÑ‚ MD5: %d."
-
-#: ../libnm-util/crypto_nss.c:175
+#: ../libnm-core/crypto_nss.c:123 ../libnm-util/crypto_nss.c:173
#, c-format
msgid "Invalid IV length (must be at least %d)."
msgstr "ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ Ð´Ð»Ð¸Ð½Ð° ВИ (минимально %d)."
-#: ../libnm-util/crypto_nss.c:186
+#: ../libnm-core/crypto_nss.c:134 ../libnm-util/crypto_nss.c:184
#, c-format
msgid "Failed to initialize the decryption cipher slot."
msgstr "Ðе удалоÑÑŒ инициализировать Ñлот шифра декодированиÑ."
-#: ../libnm-util/crypto_nss.c:196
+#: ../libnm-core/crypto_nss.c:144 ../libnm-util/crypto_nss.c:194
#, c-format
msgid "Failed to set symmetric key for decryption."
msgstr "Ðе удалоÑÑŒ задать Ñимметричный ключ раÑшифровки."
-#: ../libnm-util/crypto_nss.c:206
+#: ../libnm-core/crypto_nss.c:154 ../libnm-util/crypto_nss.c:204
#, c-format
msgid "Failed to set IV for decryption."
msgstr "Ðе удалоÑÑŒ задать ВИ раÑшифровки."
-#: ../libnm-util/crypto_nss.c:214
+#: ../libnm-core/crypto_nss.c:162 ../libnm-util/crypto_nss.c:212
#, c-format
msgid "Failed to initialize the decryption context."
msgstr "Ðе удалоÑÑŒ инициализировать контекÑÑ‚ раÑшифровки."
-#: ../libnm-util/crypto_nss.c:227
+#: ../libnm-core/crypto_nss.c:175 ../libnm-util/crypto_nss.c:225
#, c-format
msgid "Failed to decrypt the private key: %d."
msgstr "Ðе удалоÑÑŒ раÑшифровать личный ключ: %d."
-#: ../libnm-util/crypto_nss.c:235
+#: ../libnm-core/crypto_nss.c:183 ../libnm-util/crypto_nss.c:233
#, c-format
msgid "Failed to decrypt the private key: decrypted data too large."
msgstr ""
"Ðе удалоÑÑŒ раÑшифровать личный ключ: Ñлишком большой объем раÑшифрованных "
"данных."
-#: ../libnm-util/crypto_nss.c:246
+#: ../libnm-core/crypto_nss.c:194 ../libnm-util/crypto_nss.c:244
#, c-format
msgid "Failed to finalize decryption of the private key: %d."
msgstr "Ðе удалоÑÑŒ завершить раÑшифровку личного ключа: %d."
-#: ../libnm-util/crypto_nss.c:348
+#: ../libnm-core/crypto_nss.c:302 ../libnm-util/crypto_nss.c:348
#, c-format
msgid "Failed to initialize the encryption cipher slot."
msgstr "Ðе удалоÑÑŒ инициализировать Ñлот шифра декодированиÑ."
-#: ../libnm-util/crypto_nss.c:356
+#: ../libnm-core/crypto_nss.c:310 ../libnm-util/crypto_nss.c:356
#, c-format
msgid "Failed to set symmetric key for encryption."
msgstr "Ðе удалоÑÑŒ задать Ñимметричный ключ Ð´Ð»Ñ ÑˆÐ¸Ñ„Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ."
-#: ../libnm-util/crypto_nss.c:364
+#: ../libnm-core/crypto_nss.c:318 ../libnm-util/crypto_nss.c:364
#, c-format
msgid "Failed to set IV for encryption."
msgstr "Ðе удалоÑÑŒ задать ВИ раÑшифровки."
-#: ../libnm-util/crypto_nss.c:372
+#: ../libnm-core/crypto_nss.c:326 ../libnm-util/crypto_nss.c:372
#, c-format
msgid "Failed to initialize the encryption context."
msgstr "Ðе удалоÑÑŒ инициализировать контекÑÑ‚ шифрованиÑ."
-#: ../libnm-util/crypto_nss.c:380
+#: ../libnm-core/crypto_nss.c:334 ../libnm-util/crypto_nss.c:380
#, c-format
msgid "Failed to encrypt: %d."
msgstr "Ðе удалоÑÑŒ зашифровать: %d."
-#: ../libnm-util/crypto_nss.c:388
+#: ../libnm-core/crypto_nss.c:342 ../libnm-util/crypto_nss.c:388
#, c-format
msgid "Unexpected amount of data after encrypting."
msgstr "Ðепредвиденный объём данных поÑле шифрованиÑ."
-#: ../libnm-util/crypto_nss.c:431
+#: ../libnm-core/crypto_nss.c:385 ../libnm-util/crypto_nss.c:428
#, c-format
msgid "Couldn't decode certificate: %d"
msgstr "Ðе удалоÑÑŒ раÑшифровать Ñертификат: %d"
-#: ../libnm-util/crypto_nss.c:466
+#: ../libnm-core/crypto_nss.c:423
#, c-format
-msgid "Couldn't convert password to UCS2: %d"
-msgstr "Ðе удалоÑÑŒ преобразовать пароль в UCS2: %d"
+msgid "Password must be UTF-8"
+msgstr ""
-#: ../libnm-util/crypto_nss.c:494
+#: ../libnm-core/crypto_nss.c:453 ../libnm-util/crypto_nss.c:491
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %d"
msgstr "Ðе удалоÑÑŒ инициализировать декодер PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:503
+#: ../libnm-core/crypto_nss.c:462 ../libnm-util/crypto_nss.c:500
#, c-format
msgid "Couldn't decode PKCS#12 file: %d"
msgstr "Ðе удалоÑÑŒ раÑшифровать файл PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:512
+#: ../libnm-core/crypto_nss.c:471 ../libnm-util/crypto_nss.c:509
#, c-format
msgid "Couldn't verify PKCS#12 file: %d"
msgstr "Ðе удалоÑÑŒ проверить файл PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:556
+#: ../libnm-core/crypto_nss.c:522 ../libnm-util/crypto_nss.c:553
msgid "Could not generate random data."
msgstr "Ошибка при генерации Ñлучайных данных."
-#: ../libnm-util/nm-setting-8021x.c:2170 ../libnm-util/nm-setting-8021x.c:2187
-#: ../libnm-util/nm-setting-8021x.c:2228 ../libnm-util/nm-setting-8021x.c:2245
-#: ../libnm-util/nm-setting-8021x.c:2297 ../libnm-util/nm-setting-8021x.c:2309
-#: ../libnm-util/nm-setting-8021x.c:2327 ../libnm-util/nm-setting-8021x.c:2339
-#: ../libnm-util/nm-setting-8021x.c:2363 ../libnm-util/nm-setting-8021x.c:2539
-#: ../libnm-util/nm-setting-adsl.c:212
-#: ../libnm-util/nm-setting-bluetooth.c:144
-#: ../libnm-util/nm-setting-bluetooth.c:162
-#: ../libnm-util/nm-setting-bond.c:498 ../libnm-util/nm-setting-bridge.c:268
+#: ../libnm-core/nm-connection.c:225
+msgid "wrong type; should be a list of strings."
+msgstr ""
+
+#: ../libnm-core/nm-connection.c:280
+#, fuzzy
+#| msgid "Error: unknown setting '%s'\n"
+msgid "unknown setting name"
+msgstr "Ошибка: неизвеÑтный параметр: %s\n"
+
+#: ../libnm-core/nm-connection.c:804
+msgid "setting not found"
+msgstr ""
+
+#: ../libnm-core/nm-connection.c:868
+#, fuzzy
+#| msgid "Setting '%s' is not present in the connection.\n"
+msgid "setting not allowed in slave connection"
+msgstr "Параметр «%s» не определен в Ñоединении.\n"
+
+#: ../libnm-core/nm-connection.c:879
+msgid "setting is required for non-slave connections"
+msgstr ""
+
+#: ../libnm-core/nm-connection.c:945
+#, fuzzy
+#| msgid "Unable to delete connection: %s"
+msgid "Unexpected failure to verify the connection"
+msgstr "Ðе удалоÑÑŒ удалить Ñоединение: %s"
+
+#: ../libnm-core/nm-connection.c:978
+#, fuzzy
+#| msgid "Unable to delete connection: %s"
+msgid "Unexpected failure to normalize the connection"
+msgstr "Ðе удалоÑÑŒ удалить Ñоединение: %s"
+
+#: ../libnm-core/nm-connection.c:1442 ../libnm-core/nm-setting-8021x.c:2275
+#: ../libnm-core/nm-setting-8021x.c:2292 ../libnm-core/nm-setting-8021x.c:2323
+#: ../libnm-core/nm-setting-8021x.c:2340 ../libnm-core/nm-setting-8021x.c:2382
+#: ../libnm-core/nm-setting-8021x.c:2394 ../libnm-core/nm-setting-8021x.c:2412
+#: ../libnm-core/nm-setting-8021x.c:2424 ../libnm-core/nm-setting-8021x.c:2448
+#: ../libnm-core/nm-setting-8021x.c:2630 ../libnm-core/nm-setting-adsl.c:190
+#: ../libnm-core/nm-setting-bluetooth.c:121
+#: ../libnm-core/nm-setting-bluetooth.c:139
+#: ../libnm-core/nm-setting-cdma.c:142
+#: ../libnm-core/nm-setting-connection.c:768
+#: ../libnm-core/nm-setting-connection.c:807
+#: ../libnm-core/nm-setting-connection.c:908
+#: ../libnm-core/nm-setting-ip-config.c:1841
+#: ../libnm-core/nm-setting-olpc-mesh.c:113
+#: ../libnm-core/nm-setting-pppoe.c:143 ../libnm-core/nm-setting-vpn.c:400
+#: ../libnm-core/nm-setting-wimax.c:117
+#: ../libnm-core/nm-setting-wireless-security.c:862
+#: ../libnm-core/nm-setting-wireless.c:712 ../libnm-util/nm-setting.c:1366
+#: ../libnm-util/nm-setting.c:1385 ../libnm-util/nm-setting.c:1403
+#: ../libnm-util/nm-setting-8021x.c:2284 ../libnm-util/nm-setting-8021x.c:2301
+#: ../libnm-util/nm-setting-8021x.c:2342 ../libnm-util/nm-setting-8021x.c:2359
+#: ../libnm-util/nm-setting-8021x.c:2411 ../libnm-util/nm-setting-8021x.c:2423
+#: ../libnm-util/nm-setting-8021x.c:2441 ../libnm-util/nm-setting-8021x.c:2453
+#: ../libnm-util/nm-setting-8021x.c:2477 ../libnm-util/nm-setting-8021x.c:2655
+#: ../libnm-util/nm-setting-adsl.c:210
+#: ../libnm-util/nm-setting-bluetooth.c:143
+#: ../libnm-util/nm-setting-bluetooth.c:161
#: ../libnm-util/nm-setting-cdma.c:163
-#: ../libnm-util/nm-setting-connection.c:692
-#: ../libnm-util/nm-setting-connection.c:708
-#: ../libnm-util/nm-setting-connection.c:763
-#: ../libnm-util/nm-setting-ip4-config.c:705
-#: ../libnm-util/nm-setting-ip4-config.c:715
-#: ../libnm-util/nm-setting-ip6-config.c:687
-#: ../libnm-util/nm-setting-ip6-config.c:697
-#: ../libnm-util/nm-setting-ip6-config.c:750
-#: ../libnm-util/nm-setting-olpc-mesh.c:127
-#: ../libnm-util/nm-setting-pppoe.c:165 ../libnm-util/nm-setting-team.c:131
-#: ../libnm-util/nm-setting-vpn.c:405 ../libnm-util/nm-setting-wimax.c:137
-#: ../libnm-util/nm-setting-wireless-security.c:795
-#: ../libnm-util/nm-setting-wireless.c:697
+#: ../libnm-util/nm-setting-connection.c:769
+#: ../libnm-util/nm-setting-connection.c:785
+#: ../libnm-util/nm-setting-connection.c:846
+#: ../libnm-util/nm-setting-ip4-config.c:852
+#: ../libnm-util/nm-setting-ip6-config.c:833
+#: ../libnm-util/nm-setting-ip6-config.c:897
+#: ../libnm-util/nm-setting-olpc-mesh.c:124
+#: ../libnm-util/nm-setting-pppoe.c:164 ../libnm-util/nm-setting-vpn.c:424
+#: ../libnm-util/nm-setting-wimax.c:139
+#: ../libnm-util/nm-setting-wireless-security.c:892
+#: ../libnm-util/nm-setting-wireless.c:770
msgid "property is missing"
msgstr "ÑвойÑтво не определено"
-#: ../libnm-util/nm-setting-8021x.c:2177 ../libnm-util/nm-setting-8021x.c:2194
-#: ../libnm-util/nm-setting-8021x.c:2235 ../libnm-util/nm-setting-8021x.c:2252
-#: ../libnm-util/nm-setting-8021x.c:2303 ../libnm-util/nm-setting-8021x.c:2315
-#: ../libnm-util/nm-setting-8021x.c:2333 ../libnm-util/nm-setting-8021x.c:2345
-#: ../libnm-util/nm-setting-8021x.c:2369 ../libnm-util/nm-setting-adsl.c:219
-#: ../libnm-util/nm-setting-adsl.c:228 ../libnm-util/nm-setting-cdma.c:179
+#: ../libnm-core/nm-setting-8021x.c:579 ../libnm-util/nm-setting-8021x.c:598
+msgid "CA certificate must be in X.509 format"
+msgstr ""
+
+#: ../libnm-core/nm-setting-8021x.c:894 ../libnm-core/nm-setting-8021x.c:1158
+#: ../libnm-core/nm-setting-8021x.c:1478 ../libnm-util/nm-setting-8021x.c:916
+#: ../libnm-util/nm-setting-8021x.c:1179 ../libnm-util/nm-setting-8021x.c:1502
+#, fuzzy
+#| msgid "Error initializing certificate data: %s"
+msgid "invalid certificate format"
+msgstr "Ошибка инициализации данных Ñертификата: %s"
+
+#: ../libnm-core/nm-setting-8021x.c:1761 ../libnm-util/nm-setting-8021x.c:1771
+#, fuzzy
+#| msgid "invalid gateway '%s'"
+msgid "invalid private key"
+msgstr "недопуÑтимый шлюз «%s»"
+
+#: ../libnm-core/nm-setting-8021x.c:2072 ../libnm-util/nm-setting-8021x.c:2082
+#, fuzzy
+#| msgid "Failed to decrypt the private key."
+msgid "invalid phase2 private key"
+msgstr "Ðе удалоÑÑŒ раÑшифровать личный ключ."
+
+#: ../libnm-core/nm-setting-8021x.c:2282 ../libnm-core/nm-setting-8021x.c:2299
+#: ../libnm-core/nm-setting-8021x.c:2330 ../libnm-core/nm-setting-8021x.c:2347
+#: ../libnm-core/nm-setting-8021x.c:2388 ../libnm-core/nm-setting-8021x.c:2400
+#: ../libnm-core/nm-setting-8021x.c:2418 ../libnm-core/nm-setting-8021x.c:2430
+#: ../libnm-core/nm-setting-8021x.c:2455 ../libnm-core/nm-setting-adsl.c:197
+#: ../libnm-core/nm-setting-adsl.c:206 ../libnm-core/nm-setting-cdma.c:158
+#: ../libnm-core/nm-setting-cdma.c:167
+#: ../libnm-core/nm-setting-connection.c:775
+#: ../libnm-core/nm-setting-connection.c:818
+#: ../libnm-core/nm-setting-gsm.c:226 ../libnm-core/nm-setting-gsm.c:283
+#: ../libnm-core/nm-setting-gsm.c:292
+#: ../libnm-core/nm-setting-ip-config.c:1848
+#: ../libnm-core/nm-setting-ip4-config.c:178
+#: ../libnm-core/nm-setting-pppoe.c:150 ../libnm-core/nm-setting-pppoe.c:159
+#: ../libnm-core/nm-setting-vpn.c:409 ../libnm-core/nm-setting-vpn.c:419
+#: ../libnm-core/nm-setting-wimax.c:126
+#: ../libnm-core/nm-setting-wireless-security.c:892
+#: ../libnm-core/nm-setting-wireless-security.c:900
+#: ../libnm-core/nm-setting-wireless-security.c:924
+#: ../libnm-util/nm-setting-8021x.c:2291 ../libnm-util/nm-setting-8021x.c:2308
+#: ../libnm-util/nm-setting-8021x.c:2349 ../libnm-util/nm-setting-8021x.c:2366
+#: ../libnm-util/nm-setting-8021x.c:2417 ../libnm-util/nm-setting-8021x.c:2429
+#: ../libnm-util/nm-setting-8021x.c:2447 ../libnm-util/nm-setting-8021x.c:2459
+#: ../libnm-util/nm-setting-8021x.c:2484 ../libnm-util/nm-setting-adsl.c:217
+#: ../libnm-util/nm-setting-adsl.c:226 ../libnm-util/nm-setting-cdma.c:179
#: ../libnm-util/nm-setting-cdma.c:188
-#: ../libnm-util/nm-setting-connection.c:699
-#: ../libnm-util/nm-setting-connection.c:770
-#: ../libnm-util/nm-setting-gsm.c:284 ../libnm-util/nm-setting-gsm.c:341
-#: ../libnm-util/nm-setting-gsm.c:350
-#: ../libnm-util/nm-setting-ip4-config.c:766
-#: ../libnm-util/nm-setting-ip4-config.c:775
-#: ../libnm-util/nm-setting-pppoe.c:172 ../libnm-util/nm-setting-pppoe.c:181
-#: ../libnm-util/nm-setting-vpn.c:414 ../libnm-util/nm-setting-vpn.c:424
-#: ../libnm-util/nm-setting-wimax.c:146
-#: ../libnm-util/nm-setting-wireless-security.c:825
-#: ../libnm-util/nm-setting-wireless-security.c:833
-#: ../libnm-util/nm-setting-wireless-security.c:857
+#: ../libnm-util/nm-setting-connection.c:776
+#: ../libnm-util/nm-setting-connection.c:853
+#: ../libnm-util/nm-setting-gsm.c:283 ../libnm-util/nm-setting-gsm.c:340
+#: ../libnm-util/nm-setting-gsm.c:349
+#: ../libnm-util/nm-setting-ip4-config.c:917
+#: ../libnm-util/nm-setting-ip4-config.c:926
+#: ../libnm-util/nm-setting-pppoe.c:171 ../libnm-util/nm-setting-pppoe.c:180
+#: ../libnm-util/nm-setting-vpn.c:433 ../libnm-util/nm-setting-vpn.c:443
+#: ../libnm-util/nm-setting-wimax.c:148
+#: ../libnm-util/nm-setting-wireless-security.c:922
+#: ../libnm-util/nm-setting-wireless-security.c:930
+#: ../libnm-util/nm-setting-wireless-security.c:954
msgid "property is empty"
msgstr "пуÑтое ÑвойÑтво"
-#: ../libnm-util/nm-setting-8021x.c:2205 ../libnm-util/nm-setting-8021x.c:2217
-#: ../libnm-util/nm-setting-8021x.c:2263 ../libnm-util/nm-setting-8021x.c:2275
+#: ../libnm-core/nm-setting-8021x.c:2312 ../libnm-core/nm-setting-8021x.c:2360
+#: ../libnm-util/nm-setting-8021x.c:2319 ../libnm-util/nm-setting-8021x.c:2331
+#: ../libnm-util/nm-setting-8021x.c:2377 ../libnm-util/nm-setting-8021x.c:2389
#, c-format
msgid "has to match '%s' property for PKCS#12"
-msgstr "должно ÑоответÑтвовать ÑвойÑтву «%s» Ð´Ð»Ñ PKCS#12"
-
-#: ../libnm-util/nm-setting-8021x.c:2514 ../libnm-util/nm-setting-8021x.c:2548
-#: ../libnm-util/nm-setting-bluetooth.c:153
-#: ../libnm-util/nm-setting-bond.c:507
-#: ../libnm-util/nm-setting-infiniband.c:203
-#: ../libnm-util/nm-setting-infiniband.c:218
-#: ../libnm-util/nm-setting-ip4-config.c:757
-#: ../libnm-util/nm-setting-ip6-config.c:741
-#: ../libnm-util/nm-setting-olpc-mesh.c:155
-#: ../libnm-util/nm-setting-team.c:140 ../libnm-util/nm-setting-wimax.c:155
-#: ../libnm-util/nm-setting-wired.c:607 ../libnm-util/nm-setting-wired.c:616
-#: ../libnm-util/nm-setting-wireless-security.c:876
-#: ../libnm-util/nm-setting-wireless-security.c:885
-#: ../libnm-util/nm-setting-wireless-security.c:893
-#: ../libnm-util/nm-setting-wireless-security.c:901
-#: ../libnm-util/nm-setting-wireless-security.c:909
-#: ../libnm-util/nm-setting-wireless-security.c:918
-#: ../libnm-util/nm-setting-wireless-security.c:927
-#: ../libnm-util/nm-setting-wireless-security.c:936
-#: ../libnm-util/nm-setting-wireless-security.c:972
+msgstr "должно ÑоответÑтвовать ÑвойÑтву «%s» Ð´Ð»Ñ PKCS#12"
+
+#: ../libnm-core/nm-setting-8021x.c:2605 ../libnm-core/nm-setting-8021x.c:2639
+#: ../libnm-core/nm-setting-bluetooth.c:130
+#: ../libnm-core/nm-setting-infiniband.c:193
+#: ../libnm-core/nm-setting-infiniband.c:208
+#: ../libnm-core/nm-setting-ip4-config.c:169
+#: ../libnm-core/nm-setting-ip6-config.c:166
+#: ../libnm-core/nm-setting-olpc-mesh.c:142
+#: ../libnm-core/nm-setting-wimax.c:135 ../libnm-core/nm-setting-wired.c:618
+#: ../libnm-core/nm-setting-wired.c:628
+#: ../libnm-core/nm-setting-wireless-security.c:943
+#: ../libnm-core/nm-setting-wireless-security.c:952
+#: ../libnm-core/nm-setting-wireless-security.c:960
+#: ../libnm-core/nm-setting-wireless-security.c:968
+#: ../libnm-core/nm-setting-wireless-security.c:976
+#: ../libnm-core/nm-setting-wireless-security.c:985
+#: ../libnm-core/nm-setting-wireless-security.c:994
+#: ../libnm-core/nm-setting-wireless-security.c:1003
+#: ../libnm-core/nm-setting-wireless-security.c:1039
+#: ../libnm-core/nm-setting-wireless-security.c:1049
+#: ../libnm-core/nm-setting-wireless.c:773
+#: ../libnm-core/nm-setting-wireless.c:782
+#: ../libnm-core/nm-setting-wireless.c:791 ../libnm-util/nm-setting.c:1376
+#: ../libnm-util/nm-setting.c:1394 ../libnm-util/nm-setting.c:1413
+#: ../libnm-util/nm-setting-8021x.c:2630 ../libnm-util/nm-setting-8021x.c:2664
+#: ../libnm-util/nm-setting-bluetooth.c:152
+#: ../libnm-util/nm-setting-infiniband.c:206
+#: ../libnm-util/nm-setting-infiniband.c:222
+#: ../libnm-util/nm-setting-ip4-config.c:908
+#: ../libnm-util/nm-setting-ip6-config.c:888
+#: ../libnm-util/nm-setting-olpc-mesh.c:152
+#: ../libnm-util/nm-setting-wimax.c:157 ../libnm-util/nm-setting-wired.c:659
+#: ../libnm-util/nm-setting-wired.c:668
+#: ../libnm-util/nm-setting-wireless-security.c:973
#: ../libnm-util/nm-setting-wireless-security.c:982
-#: ../libnm-util/nm-setting-wireless.c:757
-#: ../libnm-util/nm-setting-wireless.c:766
-#: ../libnm-util/nm-setting-wireless.c:775
+#: ../libnm-util/nm-setting-wireless-security.c:990
+#: ../libnm-util/nm-setting-wireless-security.c:998
+#: ../libnm-util/nm-setting-wireless-security.c:1006
+#: ../libnm-util/nm-setting-wireless-security.c:1015
+#: ../libnm-util/nm-setting-wireless-security.c:1024
+#: ../libnm-util/nm-setting-wireless-security.c:1033
+#: ../libnm-util/nm-setting-wireless-security.c:1069
+#: ../libnm-util/nm-setting-wireless-security.c:1079
+#: ../libnm-util/nm-setting-wireless.c:830
+#: ../libnm-util/nm-setting-wireless.c:839
+#: ../libnm-util/nm-setting-wireless.c:848
msgid "property is invalid"
msgstr "неверное ÑвойÑтво"
-#: ../libnm-util/nm-setting-8021x.c:2573 ../libnm-util/nm-setting-8021x.c:2583
-#: ../libnm-util/nm-setting-8021x.c:2593 ../libnm-util/nm-setting-8021x.c:2603
-#: ../libnm-util/nm-setting-8021x.c:2613 ../libnm-util/nm-setting-adsl.c:239
+#: ../libnm-core/nm-setting-8021x.c:2664 ../libnm-core/nm-setting-8021x.c:2674
+#: ../libnm-core/nm-setting-8021x.c:2684 ../libnm-core/nm-setting-8021x.c:2694
+#: ../libnm-core/nm-setting-8021x.c:2704 ../libnm-core/nm-setting-adsl.c:218
+#: ../libnm-core/nm-setting-adsl.c:230
+#: ../libnm-core/nm-setting-bluetooth.c:147
+#: ../libnm-core/nm-setting-wireless-security.c:871
+#: ../libnm-util/nm-setting-8021x.c:2689 ../libnm-util/nm-setting-8021x.c:2699
+#: ../libnm-util/nm-setting-8021x.c:2709 ../libnm-util/nm-setting-8021x.c:2719
+#: ../libnm-util/nm-setting-8021x.c:2729 ../libnm-util/nm-setting-adsl.c:238
#: ../libnm-util/nm-setting-adsl.c:250
-#: ../libnm-util/nm-setting-bluetooth.c:170
-#: ../libnm-util/nm-setting-wireless-security.c:804
+#: ../libnm-util/nm-setting-bluetooth.c:169
+#: ../libnm-util/nm-setting-wireless-security.c:901
#, c-format
msgid "'%s' is not a valid value for the property"
msgstr "«%s» — недопуÑтимое значение ÑвойÑтва"
-#: ../libnm-util/nm-setting-bluetooth.c:188
-#, c-format
-msgid "requires '%s' or '%s' setting"
+#: ../libnm-core/nm-setting-bluetooth.c:169
+#, fuzzy, c-format
+#| msgid "requires '%s' or '%s' setting"
+msgid "'%s' connection requires '%s' or '%s' setting"
msgstr "требует Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Â«%s» или «%s»"
-#: ../libnm-util/nm-setting-bond.c:518
+#: ../libnm-core/nm-setting-bond.c:455 ../libnm-util/nm-setting-bond.c:503
#, c-format
msgid "invalid option '%s' or its value '%s'"
-msgstr "недопуÑтимый параметр «%s» или его значение «%s»"
+msgstr "недопуÑтимый параметр «%s» или его значение «%s»"
-#: ../libnm-util/nm-setting-bond.c:537
+#: ../libnm-core/nm-setting-bond.c:474 ../libnm-util/nm-setting-bond.c:522
#, c-format
msgid "only one of '%s' and '%s' can be set"
-msgstr "Может быть определено только одно из двух — «%s» или «%s»."
+msgstr "Может быть определено только одно из двух — «%s» или «%s»."
-#: ../libnm-util/nm-setting-bond.c:548
+#: ../libnm-core/nm-setting-bond.c:486 ../libnm-util/nm-setting-bond.c:533
#, c-format
msgid "mandatory option '%s' is missing"
msgstr "ОбÑзательный параметр «%s» не определен."
-#: ../libnm-util/nm-setting-bond.c:557
+#: ../libnm-core/nm-setting-bond.c:496 ../libnm-util/nm-setting-bond.c:542
#, c-format
msgid "'%s' is not a valid value for '%s'"
msgstr "«%s» — недопуÑтимое значение «%s» "
-#: ../libnm-util/nm-setting-bond.c:570
+#: ../libnm-core/nm-setting-bond.c:510 ../libnm-util/nm-setting-bond.c:555
#, c-format
msgid "'%s=%s' is incompatible with '%s > 0'"
-msgstr " «%s=%s» неÑовмеÑтимо Ñ Â«%s > 0»"
+msgstr " «%s=%s» неÑовмеÑтимо Ñ Â«%s > 0»"
-#: ../libnm-util/nm-setting-bond.c:583
+#: ../libnm-core/nm-setting-bond.c:523 ../libnm-util/nm-setting-bond.c:568
#, c-format
msgid "'%s' is not a valid interface name for '%s' option"
msgstr "ÐедопуÑтимое Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа («%s») Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s»"
-#: ../libnm-util/nm-setting-bond.c:593
+#: ../libnm-core/nm-setting-bond.c:533 ../libnm-util/nm-setting-bond.c:578
#, c-format
msgid "'%s' option is only valid for '%s=%s'"
msgstr "Параметр «%s» дейÑтвителен только Ð´Ð»Ñ Â«%s=%s»."
-#: ../libnm-util/nm-setting-bond.c:606
+#: ../libnm-core/nm-setting-bond.c:546 ../libnm-util/nm-setting-bond.c:591
#, c-format
msgid "'%s=%s' is not a valid configuration for '%s'"
msgstr "ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ («%s=%s») Ð´Ð»Ñ Â«%s»"
-#: ../libnm-util/nm-setting-bond.c:619 ../libnm-util/nm-setting-bond.c:628
-#: ../libnm-util/nm-setting-bond.c:648 ../libnm-util/nm-setting-bond.c:684
+#: ../libnm-core/nm-setting-bond.c:559 ../libnm-core/nm-setting-bond.c:568
+#: ../libnm-core/nm-setting-bond.c:588 ../libnm-core/nm-setting-bond.c:624
+#: ../libnm-util/nm-setting-bond.c:604 ../libnm-util/nm-setting-bond.c:613
+#: ../libnm-util/nm-setting-bond.c:633 ../libnm-util/nm-setting-bond.c:669
#, c-format
msgid "'%s' option requires '%s' option to be set"
-msgstr " Ð”Ð»Ñ Â«%s» необходимо, чтобы был определен параметр «%s»"
+msgstr " Ð”Ð»Ñ Â«%s» необходимо, чтобы был определен параметр «%s»"
-#: ../libnm-util/nm-setting-bond.c:659
+#: ../libnm-core/nm-setting-bond.c:599 ../libnm-util/nm-setting-bond.c:644
#, c-format
msgid "'%s' option is empty"
msgstr "ПуÑтой параметр: «%s»"
-#: ../libnm-util/nm-setting-bond.c:671
+#: ../libnm-core/nm-setting-bond.c:611 ../libnm-util/nm-setting-bond.c:656
#, c-format
msgid "'%s' is not a valid IPv4 address for '%s' option"
msgstr "ÐедопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv4 («%s») Ð´Ð»Ñ Â«%s»."
+#: ../libnm-core/nm-setting-bond.c:638 ../libnm-util/nm-setting-bond.c:683
+#, fuzzy, c-format
+#| msgid "'%s' option is only valid for '%s=%s'"
+msgid "'%s' option is only valid with mode '%s'"
+msgstr "Параметр «%s» дейÑтвителен только Ð´Ð»Ñ Â«%s=%s»."
+
+#: ../libnm-core/nm-setting-bond.c:653
+#, fuzzy, c-format
+#| msgid "'%s' option is empty"
+msgid "'%s' option should be string"
+msgstr "ПуÑтой параметр: «%s»"
+
+#: ../libnm-core/nm-setting-bridge-port.c:125
+#: ../libnm-core/nm-setting-bridge-port.c:137
#: ../libnm-util/nm-setting-bridge-port.c:155
#: ../libnm-util/nm-setting-bridge-port.c:167
#, c-format
msgid "'%d' is not a valid value for the property (should be <= %d)"
-msgstr "ÐедопуÑтимое значение ÑвойÑтва: «%d» (должно быть <= %d)."
+msgstr "ÐедопуÑтимое значение ÑвойÑтва: «%d» (должно быть <= %d)."
-#: ../libnm-util/nm-setting-bridge.c:251
+#: ../libnm-core/nm-setting-bridge-port.c:155
+#: ../libnm-core/nm-setting-team-port.c:98
+#, fuzzy, c-format
+#| msgid "requires '%s' or '%s' setting"
+msgid "missing setting"
+msgstr "требует Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Â«%s» или «%s»"
+
+#: ../libnm-core/nm-setting-bridge-port.c:166
+#: ../libnm-core/nm-setting-team-port.c:109
+#, c-format
+msgid ""
+"A connection with a '%s' setting must have the slave-type set to '%s'. "
+"Instead it is '%s'"
+msgstr ""
+
+#: ../libnm-core/nm-setting-bridge.c:228 ../libnm-util/nm-setting-bridge.c:270
#, c-format
msgid "value '%d' is out of range <%d-%d>"
msgstr "значение «%d» выходит за пределы допуÑтимого диапазона: <%d-%d>"
-#: ../libnm-util/nm-setting-cdma.c:170
+#: ../libnm-core/nm-setting-bridge.c:245 ../libnm-core/nm-setting-wired.c:592
+#: ../libnm-core/nm-setting-wired.c:652 ../libnm-util/nm-setting-bridge.c:287
+#: ../libnm-util/nm-setting-wired.c:634 ../libnm-util/nm-setting-wired.c:692
+msgid "is not a valid MAC address"
+msgstr "недопуÑтимый MAC-адреÑ"
+
+#: ../libnm-core/nm-setting-cdma.c:149 ../libnm-util/nm-setting-cdma.c:170
msgid "property is empty'"
msgstr "пуÑтое ÑвойÑтво"
-#: ../libnm-util/nm-setting-connection.c:734
-#, c-format
-msgid "'%s' doesn't match the virtual interface name '%s'"
-msgstr "«%s» не ÑоответÑтвует виртуальному интерфейÑу «%s»."
+#: ../libnm-core/nm-setting-connection.c:747
+#, fuzzy, c-format
+#| msgid "Could not create editor for connection '%s' of type '%s'."
+msgid "setting required for connection of type '%s'"
+msgstr "Ðе удалоÑÑŒ открыть окно редактора Ð´Ð»Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» типа «%s»."
+
+#: ../libnm-core/nm-setting-connection.c:828
+#, fuzzy, c-format
+#| msgid "index '%s' is not valid"
+msgid "connection type '%s' is not valid"
+msgstr "ÐедопуÑтимый Ð¸Ð½Ð´ÐµÐºÑ Â«%s»."
-#: ../libnm-util/nm-setting-connection.c:780
+#: ../libnm-core/nm-setting-connection.c:863
+#: ../libnm-util/nm-setting-connection.c:878
+#, fuzzy, c-format
+#| msgid "Unknown log level '%s'"
+msgid "Unknown slave type '%s'"
+msgstr "ÐеизвеÑтный уровень Ð¶ÑƒÑ€Ð½Ð°Ð»Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Â«%s»"
+
+#: ../libnm-core/nm-setting-connection.c:873
+#: ../libnm-util/nm-setting-connection.c:888
+#, fuzzy, c-format
+#| msgid "Shared connection service failed"
+msgid "Slave connections need a valid '%s' property"
+msgstr "Сбой Ñлужбы общего подключениÑ"
+
+#: ../libnm-core/nm-setting-connection.c:894
+#: ../libnm-util/nm-setting-connection.c:898
+#, fuzzy, c-format
+#| msgid "not saved, "
+msgid "Cannot set '%s' without '%s'"
+msgstr "не Ñохранено,"
+
+#: ../libnm-core/nm-setting-connection.c:917
#, c-format
-msgid "requires presence of '%s' setting in the connection"
-msgstr "требует Ð½Ð°Ð»Ð¸Ñ‡Ð¸Ñ Â«%s» в определении ÑоединениÑ"
+msgid "property type should be set to '%s'"
+msgstr ""
-#: ../libnm-util/nm-setting-connection.c:802
-msgid "IPv4 configuration is not allowed for slave"
-msgstr "Ð”Ð»Ñ Ð¿Ð¾Ð´Ñ‡Ð¸Ð½ÐµÐ½Ð½Ñ‹Ñ… интерфейÑов Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать конфигурацию IPv4"
+#: ../libnm-core/nm-setting-connection.c:932
+#, fuzzy, c-format
+#| msgid "requires presence of '%s' setting in the connection"
+msgid "slave-type '%s' requires a '%s' setting in the connection"
+msgstr "требует Ð½Ð°Ð»Ð¸Ñ‡Ð¸Ñ Â«%s» в определении ÑоединениÑ"
-#: ../libnm-util/nm-setting-connection.c:815
-msgid "IPv6 configuration is not allowed for slave"
-msgstr "Ð”Ð»Ñ Ð¿Ð¾Ð´Ñ‡Ð¸Ð½ÐµÐ½Ð½Ñ‹Ñ… интерфейÑов Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать конфигурацию IPv6"
+#: ../libnm-core/nm-setting-connection.c:942
+#, c-format
+msgid ""
+"Detect a slave connection with '%s' set and a port type '%s'. '%s' should be "
+"set to '%s'"
+msgstr ""
-#: ../libnm-util/nm-setting-dcb.c:595
+#: ../libnm-core/nm-setting-dcb.c:523 ../libnm-util/nm-setting-dcb.c:595
msgid "flags invalid"
msgstr "неверные флаги"
-#: ../libnm-util/nm-setting-dcb.c:604
+#: ../libnm-core/nm-setting-dcb.c:532 ../libnm-util/nm-setting-dcb.c:604
msgid "flags invalid - disabled"
msgstr "флаги не уÑтановлены или уÑтановлены неверно"
+#: ../libnm-core/nm-setting-dcb.c:558 ../libnm-core/nm-setting-dcb.c:607
#: ../libnm-util/nm-setting-dcb.c:630 ../libnm-util/nm-setting-dcb.c:679
msgid "property invalid (not enabled)"
msgstr "неверное ÑвойÑтво (отключено)"
-#: ../libnm-util/nm-setting-dcb.c:639
+#: ../libnm-core/nm-setting-dcb.c:567 ../libnm-util/nm-setting-dcb.c:639
msgid "element invalid"
msgstr "недопуÑтимый Ñлемент"
-#: ../libnm-util/nm-setting-dcb.c:654
+#: ../libnm-core/nm-setting-dcb.c:582 ../libnm-util/nm-setting-dcb.c:654
msgid "sum not 100%"
msgstr "Ñумма не равна 100%"
+#: ../libnm-core/nm-setting-dcb.c:616 ../libnm-core/nm-setting-dcb.c:648
#: ../libnm-util/nm-setting-dcb.c:688 ../libnm-util/nm-setting-dcb.c:720
msgid "property invalid"
msgstr "неверное ÑвойÑтво"
-#: ../libnm-util/nm-setting-dcb.c:710
+#: ../libnm-core/nm-setting-dcb.c:638 ../libnm-util/nm-setting-dcb.c:710
msgid "property missing"
msgstr "ÑвойÑтво не определено"
-#: ../libnm-util/nm-setting-gsm.c:297
+#: ../libnm-core/nm-setting-gsm.c:239 ../libnm-util/nm-setting-gsm.c:296
#, c-format
msgid "property value '%s' is empty or too long (>64)"
msgstr "пуÑтое значение «%s» или ÑвойÑтво не определено (>64)"
-#: ../libnm-util/nm-setting-gsm.c:329
+#: ../libnm-core/nm-setting-gsm.c:271 ../libnm-util/nm-setting-gsm.c:328
#, c-format
msgid "'%s' contains invalid char(s) (use [A-Za-z._-])"
msgstr "«%s» Ñодержит недопуÑтимые Ñимволы. ИÑпользуйте [A-Za-z._-]."
-#: ../libnm-util/nm-setting-gsm.c:364
+#: ../libnm-core/nm-setting-gsm.c:306 ../libnm-util/nm-setting-gsm.c:363
#, c-format
msgid "'%s' length is invalid (should be 5 or 6 digits)"
msgstr "«%s» должно Ñодержать 5-6 цифр"
-#: ../libnm-util/nm-setting-infiniband.c:228
+#: ../libnm-core/nm-setting-infiniband.c:218
+#: ../libnm-util/nm-setting-infiniband.c:232
msgid "not a valid interface name"
msgstr "недейÑтвительное Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа"
-#: ../libnm-util/nm-setting-infiniband.c:236
+#: ../libnm-core/nm-setting-infiniband.c:226
+#: ../libnm-util/nm-setting-infiniband.c:240
msgid "Must specify a P_Key if specifying parent"
msgstr "При определении родительÑкого интерфейÑа необходимо определить P_Key"
-#: ../libnm-util/nm-setting-infiniband.c:246
+#: ../libnm-core/nm-setting-infiniband.c:236
+#: ../libnm-util/nm-setting-infiniband.c:250
msgid "InfiniBand P_Key connection did not specify parent interface name"
msgstr "InfiniBand P_Key не Ñодержит Ð¸Ð¼Ñ Ñ€Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÑкого интерфеÑа"
-#: ../libnm-util/nm-setting-ip4-config.c:726
-#: ../libnm-util/nm-setting-ip4-config.c:736
-#: ../libnm-util/nm-setting-ip4-config.c:746
-#: ../libnm-util/nm-setting-ip6-config.c:709
-#: ../libnm-util/nm-setting-ip6-config.c:719
-#: ../libnm-util/nm-setting-ip6-config.c:729
+#: ../libnm-core/nm-setting-infiniband.c:272
+#: ../libnm-util/nm-setting-infiniband.c:286
#, c-format
-msgid "this property is not allowed for '%s=%s'"
-msgstr "Ñто ÑвойÑтво не может иÑпользоватьÑÑ Ð´Ð»Ñ Â«%s=%s»"
+msgid ""
+"interface name of software infiniband device must be '%s' or unset (instead "
+"it is '%s')"
+msgstr ""
-#: ../libnm-util/nm-setting-ip4-config.c:789
+#: ../libnm-core/nm-setting-infiniband.c:287
#, c-format
-msgid "%d. IPv4 address is invalid"
+msgid "mtu for transport mode '%s' can be at most %d but it is %d"
+msgstr ""
+
+#: ../libnm-core/nm-setting-ip-config.c:79
+#, fuzzy, c-format
+#| msgid "invalid IPv4 address '%s'"
+msgid "Invalid IPv4 address '%s'"
+msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv4: «%s»"
+
+#: ../libnm-core/nm-setting-ip-config.c:79
+#, fuzzy, c-format
+#| msgid "invalid IPv6 address '%s'"
+msgid "Invalid IPv6 address '%s"
+msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv6: «%s»"
+
+#: ../libnm-core/nm-setting-ip-config.c:93
+#, fuzzy, c-format
+#| msgid "invalid IPv4 address '%s'"
+msgid "Invalid IPv4 address prefix '%u'"
+msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv4: «%s»"
+
+#: ../libnm-core/nm-setting-ip-config.c:93
+#, fuzzy, c-format
+#| msgid "invalid IPv6 address '%s'"
+msgid "Invalid IPv6 address prefix '%u"
+msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ IPv6: «%s»"
+
+#: ../libnm-core/nm-setting-ip-config.c:111
+#, fuzzy, c-format
+#| msgid "invalid metric '%s'"
+msgid "Invalid routing metric '%s'"
+msgstr "недопуÑÑ‚Ð¸Ð¼Ð°Ñ Ð¼ÐµÑ‚Ñ€Ð¸ÐºÐ° «%s»"
+
+#: ../libnm-core/nm-setting-ip-config.c:1861
+#, fuzzy, c-format
+#| msgid "%d. IPv4 address is invalid"
+msgid "%d. DNS server address is invalid"
msgstr "%d. Ðеверный Ð°Ð´Ñ€ÐµÑ IPv4"
-#: ../libnm-util/nm-setting-ip4-config.c:799
-#, c-format
-msgid "%d. IPv4 address has invalid prefix"
+#: ../libnm-core/nm-setting-ip-config.c:1877
+#, fuzzy, c-format
+#| msgid "%d. IPv4 address is invalid"
+msgid "%d. IP address is invalid"
+msgstr "%d. Ðеверный Ð°Ð´Ñ€ÐµÑ IPv4"
+
+#: ../libnm-core/nm-setting-ip-config.c:1889
+#, fuzzy, c-format
+#| msgid "%d. IPv4 address has invalid prefix"
+msgid "%d. IP address has 'label' property with invalid type"
msgstr "%d. ÐÐ´Ñ€ÐµÑ IPv4 Ñодержит недопуÑтимый префикÑ"
-#: ../libnm-util/nm-setting-ip4-config.c:815
+#: ../libnm-core/nm-setting-ip-config.c:1898
+#, fuzzy, c-format
+#| msgid "%d. IPv4 address has invalid prefix"
+msgid "%d. IP address has invalid label '%s'"
+msgstr "%d. ÐÐ´Ñ€ÐµÑ IPv4 Ñодержит недопуÑтимый префикÑ"
+
+#: ../libnm-core/nm-setting-ip-config.c:1912
+msgid "gateway cannot be set if there are no addresses configured"
+msgstr ""
+
+#: ../libnm-core/nm-setting-ip-config.c:1921
+#, fuzzy
+#| msgid "property is invalid"
+msgid "gateway is invalid"
+msgstr "неверное ÑвойÑтво"
+
+#: ../libnm-core/nm-setting-ip-config.c:1935
+#: ../libnm-util/nm-setting-ip4-config.c:966
#, c-format
msgid "%d. route is invalid"
msgstr "%d. Ðеверный маршрут"
-#: ../libnm-util/nm-setting-ip4-config.c:825
+#: ../libnm-core/nm-setting-ip-config.c:1944
#, c-format
-msgid "%d. route has invalid prefix"
-msgstr "%d. Маршрут Ñодержит недопуÑтимый префикÑ"
+msgid "%d. route cannot be a default route"
+msgstr ""
-#: ../libnm-util/nm-setting-ip6-config.c:708
+#: ../libnm-core/nm-setting-ip4-config.c:123
+#: ../libnm-core/nm-setting-ip6-config.c:121
+#: ../libnm-util/nm-setting-ip4-config.c:862
+#: ../libnm-util/nm-setting-ip6-config.c:843
+#, fuzzy, c-format
+#| msgid "this property is not allowed for '%s=%s'"
+msgid "this property cannot be empty for '%s=%s'"
+msgstr "Ñто ÑвойÑтво не может иÑпользоватьÑÑ Ð´Ð»Ñ Â«%s=%s»"
+
+#: ../libnm-core/nm-setting-ip4-config.c:135
+#: ../libnm-core/nm-setting-ip4-config.c:145
+#: ../libnm-core/nm-setting-ip4-config.c:157
+#: ../libnm-core/nm-setting-ip6-config.c:134
+#: ../libnm-core/nm-setting-ip6-config.c:144
+#: ../libnm-core/nm-setting-ip6-config.c:154
+#: ../libnm-util/nm-setting-ip4-config.c:874
+#: ../libnm-util/nm-setting-ip4-config.c:884
+#: ../libnm-util/nm-setting-ip4-config.c:896
+#: ../libnm-util/nm-setting-ip6-config.c:856
+#: ../libnm-util/nm-setting-ip6-config.c:866
+#: ../libnm-util/nm-setting-ip6-config.c:876
+#, c-format
+msgid "this property is not allowed for '%s=%s'"
+msgstr "Ñто ÑвойÑтво не может иÑпользоватьÑÑ Ð´Ð»Ñ Â«%s=%s»"
+
+#: ../libnm-core/nm-setting-ip6-config.c:133
+#: ../libnm-util/nm-setting-ip6-config.c:855
#, c-format
msgid "'%s' not allowed for %s=%s"
-msgstr "«%s» не может иÑпользоватьÑÑ Ð´Ð»Ñ Â«%s=%s»"
+msgstr "«%s» не может иÑпользоватьÑÑ Ð´Ð»Ñ Â«%s=%s»"
-#: ../libnm-util/nm-setting-olpc-mesh.c:136
-#: ../libnm-util/nm-setting-wireless.c:706
+#: ../libnm-core/nm-setting-olpc-mesh.c:123
+#: ../libnm-core/nm-setting-wireless.c:722
+#: ../libnm-util/nm-setting-olpc-mesh.c:133
+#: ../libnm-util/nm-setting-wireless.c:779
msgid "SSID length is out of range <1-32> bytes"
-msgstr "Длина SSID должна быть в пределах от 1 до 32 байт."
+msgstr "Длина SSID должна быть в пределах от 1 до 32 байт."
-#: ../libnm-util/nm-setting-olpc-mesh.c:145
-#: ../libnm-util/nm-setting-wireless.c:746
+#: ../libnm-core/nm-setting-olpc-mesh.c:132
+#: ../libnm-core/nm-setting-wireless.c:762
+#: ../libnm-util/nm-setting-olpc-mesh.c:142
+#: ../libnm-util/nm-setting-wireless.c:819
#, c-format
msgid "'%d' is not a valid channel"
-msgstr "ÐедопуÑтимый канал «%d»."
+msgstr "ÐедопуÑтимый канал «%d»."
-#: ../libnm-util/nm-setting-ppp.c:390
+#: ../libnm-core/nm-setting-ppp.c:367 ../libnm-util/nm-setting-ppp.c:389
#, c-format
msgid "'%d' is out of valid range <128-16384>"
-msgstr "«%d» выходит за пределы диапазона <128-16384>"
+msgstr "«%d» выходит за пределы диапазона <128-16384>"
-#: ../libnm-util/nm-setting-ppp.c:403
+#: ../libnm-core/nm-setting-ppp.c:380 ../libnm-util/nm-setting-ppp.c:402
#, c-format
msgid "setting this property requires non-zero '%s' property"
msgstr ""
-"Ð´Ð»Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ñтого ÑвойÑтва необходимо, чтобы «%s» имело ненулевое "
+"Ð´Ð»Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ñтого ÑвойÑтва необходимо, чтобы «%s» имело ненулевое "
"значение"
-#: ../libnm-util/nm-setting-vlan.c:497
+#: ../libnm-core/nm-setting-vlan.c:516 ../libnm-util/nm-setting-vlan.c:557
#, c-format
msgid "'%s' value doesn't match '%s=%s'"
-msgstr "Значение «%s» не ÑоответÑтвует «%s=%s»"
+msgstr "Значение «%s» не ÑоответÑтвует «%s=%s»"
-#: ../libnm-util/nm-setting-vlan.c:508
+#: ../libnm-core/nm-setting-vlan.c:527 ../libnm-util/nm-setting-vlan.c:568
#, c-format
msgid "'%s' is neither an UUID nor an interface name"
-msgstr "«%s» может Ñодержать UUID или Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа."
+msgstr "«%s» может Ñодержать UUID или Ð¸Ð¼Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñа."
-#: ../libnm-util/nm-setting-vlan.c:521
+#: ../libnm-core/nm-setting-vlan.c:541 ../libnm-util/nm-setting-vlan.c:581
#, c-format
msgid "property is not specified and neither is '%s:%s'"
msgstr "Ðе определено ÑвойÑтво и «%s:%s»"
-#: ../libnm-util/nm-setting-vlan.c:534
+#: ../libnm-core/nm-setting-vlan.c:554 ../libnm-util/nm-setting-vlan.c:594
msgid "flags are invalid"
msgstr "неверные флаги"
-#: ../libnm-util/nm-setting-wired.c:562
-#, c-format
-msgid "'%s' is not a valid ethernet port value"
-msgstr "ÐедопуÑтимое значение Ð´Ð»Ñ Ð¿Ð¾Ñ€Ñ‚Ð° Ethernet: «%s»"
+#: ../libnm-core/nm-setting-vpn.c:441
+#, fuzzy, c-format
+#| msgid "property is empty"
+msgid "secret was empty"
+msgstr "пуÑтое ÑвойÑтво"
-#: ../libnm-util/nm-setting-wired.c:572
+#: ../libnm-core/nm-setting-vpn.c:471
+msgid "setting contained a secret with an empty name"
+msgstr ""
+
+#: ../libnm-core/nm-setting-vpn.c:479
#, c-format
-msgid "'%s' is not a valid duplex value"
-msgstr "ÐедопуÑтимое дуплекÑное значение: «%s»"
+msgid "secret value was empty"
+msgstr ""
-#: ../libnm-util/nm-setting-wired.c:582 ../libnm-util/nm-setting-wired.c:640
-msgid "is not a valid MAC address"
-msgstr "недопуÑтимый MAC-адреÑ"
+#: ../libnm-core/nm-setting-vpn.c:526 ../libnm-core/nm-setting.c:1607
+msgid "not a secret property"
+msgstr ""
-#: ../libnm-util/nm-setting-wired.c:595
-#: ../libnm-util/nm-setting-wireless.c:787
-#: ../libnm-util/nm-setting-wireless.c:801
+#: ../libnm-core/nm-setting-vpn.c:532
+msgid "secret is not of correct type"
+msgstr ""
+
+#: ../libnm-core/nm-setting-vpn.c:567
+#, fuzzy, c-format
+#| msgid "Error: failed to remove value of '%s': %s\n"
+msgid "failed to convert value '%s' to uint"
+msgstr "Ошибка. Ðе удалоÑÑŒ изменить значение «%s»: %s\n"
+
+#: ../libnm-core/nm-setting-vpn.c:575
+msgid "secret flags property not found"
+msgstr ""
+
+#: ../libnm-core/nm-setting-wired.c:572 ../libnm-util/nm-setting-wired.c:614
#, c-format
-msgid "'%s' is not a valid MAC address"
-msgstr "ÐедейÑтвительный MAC-адреÑ: «%s»"
+#| msgid "'%s' is not a valid ethernet port value"
+msgid "'%s' is not a valid Ethernet port value"
+msgstr "«%s» не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым значением порта Ethernet"
+
+#: ../libnm-core/nm-setting-wired.c:582 ../libnm-util/nm-setting-wired.c:624
+#, c-format
+msgid "'%s' is not a valid duplex value"
+msgstr "«%s» не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым значением дуплекÑа"
-#: ../libnm-util/nm-setting-wired.c:629
+#: ../libnm-core/nm-setting-wired.c:641 ../libnm-util/nm-setting-wired.c:681
#, c-format
msgid "invalid '%s' or its value '%s'"
-msgstr "недопуÑтимый параметр «%s» или его значение «%s»"
+msgstr "недопуÑтимый параметр «%s» или его значение «%s»"
-#: ../libnm-util/nm-setting-wireless-security.c:816
+#: ../libnm-core/nm-setting-wireless-security.c:883
+#: ../libnm-util/nm-setting-wireless-security.c:913
#, c-format
msgid "'%s' security requires '%s=%s'"
-msgstr "Ð”Ð»Ñ Ð·Ð°Ñ‰Ð¸Ñ‚Ñ‹ «%s» необходимо выражение «%s=%s»"
+msgstr "Ð”Ð»Ñ Ð·Ð°Ñ‰Ð¸Ñ‚Ñ‹ «%s» необходимо выражение «%s=%s»"
-#: ../libnm-util/nm-setting-wireless-security.c:845
+#: ../libnm-core/nm-setting-wireless-security.c:912
+#: ../libnm-util/nm-setting-wireless-security.c:942
#, c-format
msgid "'%s' security requires '%s' setting presence"
-msgstr "Ð”Ð»Ñ Ð·Ð°Ñ‰Ð¸Ñ‚Ñ‹ «%s» необходимо определить «%s»"
+msgstr "Ð”Ð»Ñ Ð·Ð°Ñ‰Ð¸Ñ‚Ñ‹ «%s» необходимо определить «%s»"
-#: ../libnm-util/nm-setting-wireless-security.c:866
+#: ../libnm-core/nm-setting-wireless-security.c:933
+#: ../libnm-util/nm-setting-wireless-security.c:963
#, c-format
msgid "'%d' value is out of range <0-3>"
-msgstr "ДопуÑтимые Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Â«%d»: <0-3>"
+msgstr "Значение «%d» вне диапазона <0-3>"
-#: ../libnm-util/nm-setting-wireless-security.c:963
+#: ../libnm-core/nm-setting-wireless-security.c:1030
+#: ../libnm-util/nm-setting-wireless-security.c:1060
#, c-format
msgid "'%s' connections require '%s' in this property"
-msgstr "Ð¡Ð¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» требуют, чтобы ÑвойÑтво Ñодержало «%s»"
+msgstr "Ð¡Ð¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» требуют «%s» в Ñтот ÑвойÑтве"
-#: ../libnm-util/nm-setting-wireless-security.c:993
+#: ../libnm-core/nm-setting-wireless-security.c:1060
+#: ../libnm-util/nm-setting-wireless-security.c:1090
#, c-format
msgid "'%s' can only be used with '%s=%s' (WEP)"
-msgstr " «%s» может иÑпользоватьÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ вмеÑте Ñ Â«%s=%s» (WEP)"
+msgstr " «%s» может иÑпользоватьÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ вмеÑте Ñ Â«%s=%s» (WEP)"
-#: ../libnm-util/nm-setting-wireless.c:715
+#: ../libnm-core/nm-setting-wireless.c:731
+#: ../libnm-util/nm-setting-wireless.c:788
#, c-format
msgid "'%s' is not a valid Wi-Fi mode"
-msgstr "ÐедопуÑтимый режим Wi-Fi: «%s»"
+msgstr "«%s» не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым режимом Wi-Fi"
-#: ../libnm-util/nm-setting-wireless.c:725
+#: ../libnm-core/nm-setting-wireless.c:741
+#: ../libnm-util/nm-setting-wireless.c:798
#, c-format
msgid "'%s' is not a valid band"
-msgstr "ÐедопуÑтимый диапазон «%s»"
+msgstr "«%s» не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым диапазоном"
+
+#: ../libnm-core/nm-setting-wireless.c:751
+#, c-format
+#| msgid "requires setting '%s' property"
+msgid "'%s' requires setting '%s' property"
+msgstr "«%s» требует уÑтановки ÑвойÑтва «%s»"
+
+#: ../libnm-core/nm-setting.c:827
+#, c-format
+msgid "can't set property of type '%s' from value of type '%s'"
+msgstr ""
+
+#: ../libnm-core/nm-setting.c:1505
+msgid "secret not found"
+msgstr ""
+
+#: ../libnm-core/nm-setting.c:1597
+msgid "secret is not set"
+msgstr ""
+
+#: ../libnm-core/nm-utils.c:2276 ../libnm-util/nm-utils.c:1813
+#, c-format
+msgid "Could not find \"%s\" binary"
+msgstr "Ðе удалоÑÑŒ найти бинарный файл «%s»"
+
+#: ../libnm-glib/nm-device.c:1793 ../libnm/nm-device.c:1615
+msgid "Bluetooth"
+msgstr "Bluetooth"
+
+#: ../libnm-glib/nm-device.c:1811 ../libnm/nm-device.c:1633
+msgid "ADSL"
+msgstr "ADSL"
+
+#: ../libnm-glib/nm-device.c:1839 ../libnm/nm-device.c:1661
+msgid "Wired"
+msgstr "Проводное"
+
+#: ../libnm-glib/nm-device.c:1870 ../libnm/nm-device.c:1692
+msgid "PCI"
+msgstr "PCI"
+
+#: ../libnm-glib/nm-device.c:1872 ../libnm/nm-device.c:1694
+msgid "USB"
+msgstr "USB"
+
+#. Translators: the first %s is a bus name (eg, "USB") or
+#. * product name, the second is a device type (eg,
+#. * "Ethernet"). You can change this to something like
+#. * "%2$s (%1$s)" if there's no grammatical way to combine
+#. * the strings otherwise.
+#.
+#: ../libnm-glib/nm-device.c:1968 ../libnm-glib/nm-device.c:1987
+#: ../libnm/nm-device.c:1788 ../libnm/nm-device.c:1807
+#, c-format
+msgctxt "long device name"
+msgid "%s %s"
+msgstr "%s %s"
+
+#: ../libnm-glib/nm-remote-connection.c:151
+#| msgid "disconnected"
+msgid "Disconnected by D-Bus"
+msgstr "Отключено через D-Bus"
+
+#: ../libnm-util/crypto_gnutls.c:88
+#, c-format
+msgid "Failed to initialize the MD5 engine: %s / %s."
+msgstr "Ðе удалоÑÑŒ инициализировать модуль MD5: %s / %s."
-#: ../libnm-util/nm-setting-wireless.c:735
+#: ../libnm-util/crypto_nss.c:102
+#, c-format
+msgid "Failed to initialize the MD5 context: %d."
+msgstr "Ðе удалоÑÑŒ инициализировать контекÑÑ‚ MD5: %d."
+
+#: ../libnm-util/crypto_nss.c:463
+#, c-format
+msgid "Couldn't convert password to UCS2: %d"
+msgstr "Ðе удалоÑÑŒ преобразовать пароль в UCS2: %d"
+
+#: ../libnm-util/nm-setting-bluetooth.c:187
+#, c-format
+msgid "requires '%s' or '%s' setting"
+msgstr "требует Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Â«%s» или «%s»"
+
+#: ../libnm-util/nm-setting-connection.c:863
+#, c-format
+msgid "requires presence of '%s' setting in the connection"
+msgstr "требует Ð½Ð°Ð»Ð¸Ñ‡Ð¸Ñ Â«%s» в определении ÑоединениÑ"
+
+#: ../libnm-util/nm-setting-ip4-config.c:940
+#, c-format
+msgid "%d. IPv4 address is invalid"
+msgstr "%d. Ðеверный Ð°Ð´Ñ€ÐµÑ IPv4"
+
+#: ../libnm-util/nm-setting-ip4-config.c:950
+#, c-format
+msgid "%d. IPv4 address has invalid prefix"
+msgstr "%d. ÐÐ´Ñ€ÐµÑ IPv4 Ñодержит недопуÑтимый префикÑ"
+
+#: ../libnm-util/nm-setting-ip4-config.c:976
+#, c-format
+msgid "%d. route has invalid prefix"
+msgstr "%d. Маршрут Ñодержит недопуÑтимый префикÑ"
+
+#: ../libnm-util/nm-setting-vpn.c:583
+#, c-format
+msgid "Failed to convert '%s' value '%s' to uint"
+msgstr ""
+
+#: ../libnm-util/nm-setting-vpn.c:590
+#, c-format
+msgid "Secret flags property '%s' not found"
+msgstr ""
+
+#: ../libnm-util/nm-setting-wireless.c:808
#, c-format
msgid "requires setting '%s' property"
msgstr "требует Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ ÑвойÑтва «%s»"
+#: ../libnm/nm-device-adsl.c:73
+#, fuzzy
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not an ADSL connection."
+msgstr "подключение (запуÑк второÑтепенных Ñоединений)"
+
+#: ../libnm/nm-device-bond.c:115
+#, fuzzy
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a bond connection."
+msgstr "подключение (запуÑк второÑтепенных Ñоединений)"
+
+#: ../libnm/nm-device-bridge.c:115
+#, fuzzy
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a bridge connection."
+msgstr "подключение (запуÑк второÑтепенных Ñоединений)"
+
+#: ../libnm/nm-device-bt.c:140
+#, fuzzy, c-format
+#| msgid "There is 1 optional argument for 'bluetooth' connection type.\n"
+msgid "The connection was not a Bluetooth connection."
+msgstr "Ð”Ð»Ñ Ñоединений Bluetooth доÑтупен один дополнительный аргумент.\n"
+
+#: ../libnm/nm-device-bt.c:149
+msgid "Invalid device Bluetooth address."
+msgstr ""
+
+#: ../libnm/nm-device-bt.c:156
+msgid "The Bluetooth addresses of the device and the connection didn't match."
+msgstr ""
+
+#: ../libnm/nm-device-bt.c:165
+msgid ""
+"The device is lacking Bluetooth capabilities required by the connection."
+msgstr ""
+
+#: ../libnm/nm-device-ethernet.c:138
+#, fuzzy
+#| msgid "There are 4 optional arguments for 'PPPoE' connection type.\n"
+msgid "The connection was not an Ethernet or PPPoE connection."
+msgstr ""
+"При наÑтройке Ñоединений PPPoE допуÑкаетÑÑ Ð¸Ñпользование четырех "
+"дополнительных аргументов.\n"
+
+#: ../libnm/nm-device-ethernet.c:154 ../libnm/nm-device-infiniband.c:105
+#: ../libnm/nm-device-wifi.c:492 ../libnm/nm-device-wimax.c:311
+#, fuzzy
+#| msgid "is not a valid MAC address"
+msgid "Invalid device MAC address."
+msgstr "недопуÑтимый MAC-адреÑ"
+
+#: ../libnm/nm-device-ethernet.c:160 ../libnm/nm-device-infiniband.c:113
+#: ../libnm/nm-device-wifi.c:499 ../libnm/nm-device-wimax.c:318
+msgid "The MACs of the device and the connection didn't match."
+msgstr ""
+
+#: ../libnm/nm-device-generic.c:92
+#, fuzzy
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a generic connection."
+msgstr "подключение (запуÑк второÑтепенных Ñоединений)"
+
+#: ../libnm/nm-device-generic.c:99
+#, fuzzy
+#| msgid "InfiniBand P_Key connection did not specify parent interface name"
+msgid "The connection did not specify an interface name."
+msgstr "InfiniBand P_Key не Ñодержит Ð¸Ð¼Ñ Ñ€Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÑкого интерфеÑа"
+
+#: ../libnm/nm-device-infiniband.c:97
+#, fuzzy
+#| msgid "There are 5 optional arguments for 'InfiniBand' connection type.\n"
+msgid "The connection was not an InfiniBand connection."
+msgstr "Ð”Ð»Ñ Ñоединений «InfiniBand» доÑтупно пÑÑ‚ÑŒ дополнительных аргументов.\n"
+
+#: ../libnm/nm-device-modem.c:123
+#, fuzzy
+#| msgid "the connection was removed"
+msgid "The connection was not a modem connection."
+msgstr "Ñоединение удалено"
+
+#: ../libnm/nm-device-modem.c:131
+#, fuzzy
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a valid modem connection."
+msgstr "подключение (запуÑк второÑтепенных Ñоединений)"
+
+#: ../libnm/nm-device-modem.c:138
+msgid "The device is lacking capabilities required by the connection."
+msgstr ""
+
+#: ../libnm/nm-device-olpc-mesh.c:118
+#, fuzzy
+#| msgid "There are 2 optional arguments for 'OLPC Mesh' connection type.\n"
+msgid "The connection was not an OLPC Mesh connection."
+msgstr "Ð”Ð»Ñ Ñоединений «OLPC Mesh» доÑтупно два дополнительных аргумента.\n"
+
+#: ../libnm/nm-device-team.c:121
+#, fuzzy
+#| msgid "the connection was removed"
+msgid "The connection was not a team connection."
+msgstr "Ñоединение удалено"
+
+#: ../libnm/nm-device-vlan.c:131
+#, fuzzy
+#| msgid "There are 4 optional arguments for 'VLAN' connection type.\n"
+msgid "The connection was not a VLAN connection."
+msgstr "Ð”Ð»Ñ Ñоединений «VLAN» доÑтупно четыре дополнительных аргумента.\n"
+
+#: ../libnm/nm-device-vlan.c:138
+msgid "The VLAN identifiers of the device and the connection didn't match."
+msgstr ""
+
+#: ../libnm/nm-device-vlan.c:151
+msgid "The hardware address of the device and the connection didn't match."
+msgstr ""
+
+#: ../libnm/nm-device-wifi.c:483
+msgid "The connection was not a Wi-Fi connection."
+msgstr ""
+
+#: ../libnm/nm-device-wifi.c:519
+msgid "The device is lacking WPA capabilities required by the connection."
+msgstr ""
+
+#: ../libnm/nm-device-wifi.c:526
+msgid "The device is lacking WPA2/RSN capabilities required by the connection."
+msgstr ""
+
+#: ../libnm/nm-device-wimax.c:302
+#, fuzzy
+#| msgid "There is 1 optional argument for 'WiMax' connection type.\n"
+msgid "The connection was not a WiMAX connection."
+msgstr "Ð”Ð»Ñ Ñоединений «WiMax» доÑтупен один дополнительный аргумент.\n"
+
+#: ../libnm/nm-device.c:2152
+#, fuzzy, c-format
+#| msgid "Error: connection is not valid: %s\n"
+msgid "The connection was not valid: %s"
+msgstr "Ошибка. ÐедейÑтвительное Ñоединение: %s\n"
+
+#: ../libnm/nm-device.c:2161
+#, c-format
+msgid "The interface names of the device and the connection didn't match."
+msgstr ""
+
+#: ../libnm/nm-manager.c:858
+#, fuzzy
+#| msgid "no active connection or device"
+msgid "Active connection could not be attached to the device"
+msgstr "на уÑтройÑтве нет активных Ñоединений"
+
+#: ../libnm/nm-manager.c:1082
+#, fuzzy
+#| msgid "Active connection details"
+msgid "Active connection removed before it was initialized"
+msgstr "Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± активном Ñоединении"
+
+#: ../libnm/nm-object.c:1439 ../libnm/nm-object.c:1585
+msgid "Caller did not specify D-Bus path for object"
+msgstr ""
+
+#: ../libnm/nm-remote-settings.c:261
+msgid "Connection removed before it was initialized"
+msgstr ""
+
+#: ../libnm/nm-vpn-plugin-old.c:885
+#, fuzzy
+#| msgid "Error: No interface specified."
+msgid "No service name specified"
+msgstr "Ошибка. Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½Ðµ определен."
+
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:1
msgid "Enable or disable system networking"
msgstr "Включение или выключение Ñетевой подÑиÑтемы"
@@ -5497,8 +8135,7 @@ msgid "Connection sharing via a protected WiFi network"
msgstr "СовмеÑтное иÑпользование Ñоединений в закрытой Ñети WiFi"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:14
-msgid ""
-"System policy prevents sharing connections via a protected WiFi network"
+msgid "System policy prevents sharing connections via a protected WiFi network"
msgstr ""
"СиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¿Ð¾Ð»Ð¸Ñ‚Ð¸ÐºÐ° запрещает ÑовмеÑтное иÑпользование Ñоединений в закрытой "
"Ñети WiFi"
@@ -5527,8 +8164,7 @@ msgstr "Изменить Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ð´Ð¾Ñтупные вÑем по
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:20
msgid "System policy prevents modification of network settings for all users"
-msgstr ""
-"СиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¿Ð¾Ð»Ð¸Ñ‚Ð¸ÐºÐ° запрещает изменение наÑтроек Ð´Ð»Ñ Ð²Ñех пользователей"
+msgstr "СиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¿Ð¾Ð»Ð¸Ñ‚Ð¸ÐºÐ° запрещает изменение наÑтроек Ð´Ð»Ñ Ð²Ñех пользователей"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:21
msgid "Modify persistent system hostname"
@@ -5539,81 +8175,64 @@ msgid "System policy prevents modification of the persistent system hostname"
msgstr ""
"СиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¿Ð¾Ð»Ð¸Ñ‚Ð¸ÐºÐ° запрещает изменение поÑтоÑнного имени узла компьютера"
-#: ../src/main.c:154
+#. Translators: the first %s is a prefix for the connection id, such
+#. * as "Wired Connection" or "VPN Connection". The %d is a number
+#. * that is combined with the first argument to create a unique
+#. * connection id.
+#: ../src/NetworkManagerUtils.c:1294
#, c-format
-msgid "Opening %s failed: %s\n"
-msgstr "При открытии %s произошла ошибка: %s\n"
+#| msgctxt "long device name"
+#| msgid "%s %s"
+msgctxt "connection id fallback"
+msgid "%s %d"
+msgstr "%s %d"
-#: ../src/main.c:160
-#, c-format
-msgid "Writing to %s failed: %s\n"
-msgstr "При запиÑи в %s произошла ошибка: %s\n"
-
-#: ../src/main.c:165
-#, c-format
-msgid "Closing %s failed: %s\n"
-msgstr "При закрытии %s произошла ошибка: %s\n"
-
-#: ../src/main.c:208
-#, c-format
-msgid "NetworkManager is already running (pid %ld)\n"
-msgstr "NetworkManager уже запущен (pid %ld)\n"
-
-#: ../src/main.c:329
+#. Logging/debugging
+#: ../src/main.c:223 ../src/nm-iface-helper.c:300
msgid "Print NetworkManager version and exit"
msgstr "Показать верÑию NetworkManager и выйти"
-#: ../src/main.c:330
+#: ../src/main.c:224 ../src/nm-iface-helper.c:301
msgid "Don't become a daemon"
msgstr "Ðе иÑпользовать в качеÑтве Ñлужбы"
-#: ../src/main.c:331
+#: ../src/main.c:225 ../src/nm-iface-helper.c:302
msgid "Don't become a daemon, and log to stderr"
msgstr "Ðе работать в режиме Ñлужбы и не входить в stderr"
-#: ../src/main.c:332
+#: ../src/main.c:226 ../src/nm-iface-helper.c:303
#, c-format
msgid "Log level: one of [%s]"
-msgstr "Уровень журнала: одно значение из [%s]"
+msgstr "Уровень журнала: одно значение из [%s]"
-#: ../src/main.c:334
+#: ../src/main.c:228 ../src/nm-iface-helper.c:305
#, c-format
msgid "Log domains separated by ',': any combination of [%s]"
msgstr ""
"Домены журналов должны быть перечиÑлены через запÑтую и могут Ñодержать "
-"любую комбинацию [%s]. "
+"любую комбинацию [%s]. "
-#: ../src/main.c:336
+#: ../src/main.c:230 ../src/nm-iface-helper.c:307
msgid "Make all warnings fatal"
msgstr "Сделать вÑе Ð¿Ñ€ÐµÐ´ÑƒÐ¿Ñ€ÐµÐ¶Ð´ÐµÐ½Ð¸Ñ ÐºÑ€Ð¸Ñ‚Ð¸Ñ‡ÐµÑкими"
-#: ../src/main.c:337
+#: ../src/main.c:231
msgid "Specify the location of a PID file"
msgstr "Укажите раÑположение PID файла"
-#: ../src/main.c:337
+#: ../src/main.c:231
msgid "filename"
msgstr "Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð°"
-#: ../src/main.c:338
+#: ../src/main.c:232
msgid "State file location"
msgstr "РаÑположение файла ÑоÑтоÑниÑ"
-#: ../src/main.c:338
+#: ../src/main.c:232
msgid "/path/to/state.file"
msgstr "/путь/к/state.file"
-#: ../src/main.c:364
-#, c-format
-msgid "GModules are not supported on your platform!\n"
-msgstr "GModules не поддерживаютÑÑ Ð½Ð° вашей платформе.\n"
-
-#: ../src/main.c:369
-#, c-format
-msgid "You must be root to run NetworkManager!\n"
-msgstr "Ð”Ð»Ñ Ð·Ð°Ð¿ÑƒÑка NetworkManager, необходимы права админиÑтратора.\n"
-
-#: ../src/main.c:392
+#: ../src/main.c:248
msgid ""
"NetworkManager monitors all network connections and automatically\n"
"chooses the best connection to use. It also allows the user to\n"
@@ -5621,1065 +8240,894 @@ msgid ""
"should associate with."
msgstr ""
"NetworkManager отÑлеживает вÑе Ñетевые ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¸ автоматичеÑки\n"
-"выбирает Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð½Ð°Ð¸Ð±Ð¾Ð»ÐµÐµ подходÑщее Ñоединение. Ртакже позволÑет\n"
+"выбирает Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð½Ð°Ð¸Ð±Ð¾Ð»ÐµÐµ подходÑщее Ñоединение. Ртакже "
+"позволÑет\n"
"пользователю задать беÑпроводным картам точки доÑтупа, Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ð¼Ð¸ они \n"
"должны аÑÑоциироватьÑÑ."
-#: ../src/main.c:398
-#, c-format
-msgid "Invalid option. Please use --help to see a list of valid options.\n"
-msgstr ""
-"Ðеверный параметр. ИÑпользуйте --help Ð´Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° ÑпиÑка возможных параметров."
-"\n"
-
-#: ../src/main.c:412
+#: ../src/main.c:261 ../src/main-utils.c:228 ../src/nm-iface-helper.c:337
#, c-format
msgid "%s. Please use --help to see a list of valid options.\n"
msgstr "%s. ИÑпользуйте --help Ð´Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° ÑпиÑка допуÑтимых параметров.\n"
-#: ../src/main.c:417
+#: ../src/main.c:266 ../src/nm-iface-helper.c:342
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' passed on command line.\n"
msgstr "ÐеизвеÑтные домены журналов «%s» в Ñтроке команды. ПропуÑкаютÑÑ...\n"
-#: ../src/main.c:468
+#: ../src/main.c:313
#, c-format
msgid "Failed to read configuration: (%d) %s\n"
msgstr "Ðе удалоÑÑŒ прочитать конфигурацию: (%d) %s\n"
-#: ../src/main.c:482
+#: ../src/main.c:327
#, c-format
msgid "Error in configuration file: %s.\n"
msgstr "Ошибка в файле конфигурации: %s\n"
-#: ../src/main.c:487
+#: ../src/main.c:332
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' from config files.\n"
msgstr ""
"ÐеизвеÑтный домен журналов «%s» в файле конфигурации. ПропуÑкаетÑÑ...\n"
-#: ../src/main.c:495
+#: ../src/main.c:340
#, c-format
msgid "State file %s parsing failed: (%d) %s\n"
msgstr "Сбой при разборе файла ÑоÑтоÑÐ½Ð¸Ñ %s: (%d) %s\n"
-#: ../src/main.c:508
+#: ../src/main.c:353 ../src/nm-iface-helper.c:359
#, c-format
msgid "Could not daemonize: %s [error %u]\n"
msgstr "Ðевозможно преобразовать в Ñлужбу: %s [ошибка %u]\n"
-#: ../src/bluez-manager/nm-bluez-device.c:198
+#: ../src/main-utils.c:95
#, c-format
-msgid "%s Network"
-msgstr "Сеть %s"
+msgid "Opening %s failed: %s\n"
+msgstr "При открытии %s произошла ошибка: %s\n"
+
+#: ../src/main-utils.c:101
+#, c-format
+msgid "Writing to %s failed: %s\n"
+msgstr "При запиÑи в %s произошла ошибка: %s\n"
+
+#: ../src/main-utils.c:106
+#, c-format
+msgid "Closing %s failed: %s\n"
+msgstr "При закрытии %s произошла ошибка: %s\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:143
+#: ../src/main-utils.c:162
+#, c-format
+#| msgid "NetworkManager is already running (pid %ld)\n"
+msgid "%s is already running (pid %ld)\n"
+msgstr "%s уже запущен (pid %ld)\n"
+
+#: ../src/main-utils.c:205
+#, c-format
+#| msgid "You must be root to run NetworkManager!\n"
+msgid "You must be root to run %s!\n"
+msgstr "Ð’Ñ‹ должны быть Ñуперпользователем Ð´Ð»Ñ Ð·Ð°Ð¿ÑƒÑка %s\n"
+
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:205
msgid "# Created by NetworkManager\n"
msgstr "# Создано в NetworkManager\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:150
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:212
#, c-format
-msgid "# Merged from %s\n"
+msgid ""
+"# Merged from %s\n"
"\n"
-msgstr "# Объединено Ñ %s\n"
+msgstr ""
+"# Объединено Ñ %s\n"
"\n"
-#: ../src/dhcp-manager/nm-dhcp-manager.c:313
-msgid "no usable DHCP client could be found."
-msgstr "не найден клиент DHCP."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:322
-msgid "'dhclient' could be found."
-msgstr "«dhclient» не найден."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:332
-msgid "'dhcpcd' could be found."
+#: ../src/dhcp-manager/nm-dhcp-manager.c:130
+#, fuzzy, c-format
+#| msgid "'dhcpcd' could be found."
+msgid "'%s' support not found or not enabled."
msgstr "«dhcpcd» не найден."
-#: ../src/dhcp-manager/nm-dhcp-manager.c:340
-#, c-format
-msgid "unsupported DHCP client '%s'"
-msgstr "клиент DHCP «%s» не поддерживаетÑÑ"
+#: ../src/dhcp-manager/nm-dhcp-manager.c:177
+#, fuzzy
+msgid "no usable DHCP client could be found."
+msgstr "невозможно найти клиентов DHCP."
-#: ../src/dns-manager/nm-dns-manager.c:401
+#: ../src/dns-manager/nm-dns-manager.c:363
msgid "NOTE: the libc resolver may not support more than 3 nameservers."
msgstr ""
"ЗÐМЕЧÐÐИЕ: преобразователь имён glibc не поддерживает более трёх Ñерверов "
"имён."
-#: ../src/dns-manager/nm-dns-manager.c:403
+#: ../src/dns-manager/nm-dns-manager.c:365
msgid "The nameservers listed below may not be recognized."
msgstr "ÐижеперечиÑленные Ñерверы имён могут быть не раÑпознаны."
-#: ../src/logging/nm-logging.c:149
-#, c-format
-msgid "Unknown log level '%s'"
-msgstr "ÐеизвеÑтный уровень Ð¶ÑƒÑ€Ð½Ð°Ð»Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Â«%s»"
+#: ../src/devices/adsl/nm-device-adsl.c:129
+#| msgid "ADSL connection %d"
+msgid "ADSL connection"
+msgstr "Соединение ADSL"
-#: ../src/logging/nm-logging.c:226
+#: ../src/devices/bluetooth/nm-bluez-device.c:200
#, c-format
-msgid "Unknown log domain '%s'"
-msgstr "ÐеизвеÑтный домен Ð¶ÑƒÑ€Ð½Ð°Ð»Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Â«%s»"
-
-#: ../src/config/nm-config.c:271
-msgid "Config file location"
-msgstr "РаÑположение файла конфигурации"
-
-#: ../src/config/nm-config.c:271
-msgid "/path/to/config.file"
-msgstr "/путь/к/config.file"
-
-#: ../src/config/nm-config.c:272
-msgid "Config directory location"
-msgstr "Путь к каталогу конфигурации"
-
-#: ../src/config/nm-config.c:272
-msgid "/path/to/config/dir"
-msgstr "/путь/к/каталогу"
-
-#: ../src/config/nm-config.c:274
-msgid "List of plugins separated by ','"
-msgstr "СпиÑок модулей (через запÑтую)"
+msgid "%s Network"
+msgstr "Сеть %s"
-#: ../src/config/nm-config.c:274
-msgid "plugin1,plugin2"
-msgstr "модуль1,модуль2"
+#: ../src/devices/bluetooth/nm-device-bt.c:255
+msgid "PAN requested, but Bluetooth device does not support NAP"
+msgstr ""
-#: ../src/config/nm-config.c:277
-msgid "An http(s) address for checking internet connectivity"
-msgstr "http(s) Ð°Ð´Ñ€ÐµÑ Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ð˜Ð½Ñ‚ÐµÑ€Ð½ÐµÑ‚Ð¾Ð¼"
+#: ../src/devices/bluetooth/nm-device-bt.c:265
+msgid "PAN connections cannot specify GSM, CDMA, or serial settings"
+msgstr ""
-#: ../src/config/nm-config.c:278
-msgid "The interval between connectivity checks (in seconds)"
-msgstr "Интервал между проверками ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ (в Ñекундах)"
+#: ../src/devices/bluetooth/nm-device-bt.c:278
+#| msgid "PAN connection %d"
+msgid "PAN connection"
+msgstr "Соединение PAN"
-#: ../src/config/nm-config.c:279
-msgid "The expected start of the response"
-msgstr "ОжидаетÑÑ Ð½Ð°Ñ‡Ð°Ð»Ð¾ ответа"
+#: ../src/devices/bluetooth/nm-device-bt.c:285
+msgid "DUN requested, but Bluetooth device does not support DUN"
+msgstr ""
-#: ../src/config/nm-config.c:279
-msgid "Bingo!"
-msgstr "Бинго!"
+#: ../src/devices/bluetooth/nm-device-bt.c:295
+msgid "DUN connection must include a GSM or CDMA setting"
+msgstr ""
-#: ../src/modem-manager/nm-modem-broadband.c:459
-#: ../src/modem-manager/nm-modem-old.c:864 ../src/devices/nm-device-bt.c:333
-#, c-format
-msgid "GSM connection %d"
-msgstr "Подключение GSM %d"
+#: ../src/devices/bluetooth/nm-device-bt.c:305
+#: ../src/devices/wwan/nm-modem-broadband.c:540
+#| msgid "GSM connection %d"
+msgid "GSM connection"
+msgstr "Соединение GSM"
-#: ../src/modem-manager/nm-modem-broadband.c:481
-#: ../src/modem-manager/nm-modem-old.c:891 ../src/devices/nm-device-bt.c:337
-#, c-format
-msgid "CDMA connection %d"
-msgstr "Подключение CDMA %d"
+#: ../src/devices/bluetooth/nm-device-bt.c:309
+#: ../src/devices/wwan/nm-modem-broadband.c:563
+#| msgid "CDMA connection %d"
+msgid "CDMA connection"
+msgstr "Соединение CDMA"
-#: ../src/devices/nm-device-bond.c:146 ../tui/nm-editor-utils.c:204
-#, c-format
-msgid "Bond connection %d"
-msgstr "Подключение Bond %d"
+#: ../src/devices/bluetooth/nm-device-bt.c:317
+msgid "Unknown/unhandled Bluetooth connection type"
+msgstr ""
-#: ../src/devices/nm-device-adsl.c:150
-#, c-format
-msgid "ADSL connection %d"
-msgstr "Подключение ADSL %d"
+#: ../src/devices/bluetooth/nm-device-bt.c:337
+#: ../src/devices/nm-device-ethernet.c:1442
+#: ../src/devices/nm-device-infiniband.c:196
+#: ../src/devices/wifi/nm-device-wifi.c:1116
+#: ../src/devices/wimax/nm-device-wimax.c:454
+#, fuzzy
+#| msgid "index '%s' is not valid"
+msgid "connection does not match device"
+msgstr "ÐедопуÑтимый Ð¸Ð½Ð´ÐµÐºÑ Â«%s»."
-#: ../src/devices/nm-device-bridge.c:143 ../tui/nm-editor-utils.c:214
-#, c-format
-msgid "Bridge connection %d"
-msgstr "Подключение моÑта %d"
+#: ../src/devices/nm-device-bond.c:126
+#| msgid "Bond connection %d"
+msgid "Bond connection"
+msgstr "Ðгрегированное (Bond) Ñоединение"
-#: ../src/devices/nm-device-bt.c:308
-#, c-format
-msgid "PAN connection %d"
-msgstr "Подключение PAN %d"
+#: ../src/devices/nm-device-bridge.c:132
+#| msgid "Bridge connection %d"
+msgid "Bridge connection"
+msgstr "Соединение типа «моÑт»"
-#: ../src/devices/nm-device-bt.c:341
-#, c-format
-msgid "DUN connection %d"
-msgstr "Подключение DUN %d"
+#: ../src/devices/nm-device-ethernet.c:1425
+#| msgid "PPPoE connection %d"
+msgid "PPPoE connection"
+msgstr "Соединение PPPoE"
-#: ../src/devices/nm-device-ethernet.c:1254
-#, c-format
-msgid "PPPoE connection %d"
-msgstr "Подключение PPoE %d"
+#: ../src/devices/nm-device-ethernet.c:1425
+#| msgid "Wired connection %d"
+msgid "Wired connection"
+msgstr "Проводное Ñоединение"
-#: ../src/devices/nm-device-ethernet.c:1254
-#: ../src/settings/nm-settings-utils.c:50
+#: ../src/devices/nm-device-ethernet-utils.c:40
#, c-format
msgid "Wired connection %d"
msgstr "Проводное Ñоединение %d"
-#: ../src/devices/nm-device-infiniband.c:270 ../tui/nm-editor-utils.c:177
-#, c-format
-msgid "InfiniBand connection %d"
-msgstr "Подключение InfiniBand %d"
-
-#: ../src/devices/nm-device-olpc-mesh.c:242
-#, c-format
-msgid "Mesh %d"
+#: ../src/devices/nm-device-infiniband.c:178
+#| msgid "InfiniBand connection %d"
+msgid "InfiniBand connection"
+msgstr "Соединение InfiniBand"
+
+#: ../src/devices/nm-device-vlan.c:218
+#| msgid "VLAN connection %d"
+msgid "VLAN connection"
+msgstr "Соединение VLAN"
+
+#: ../src/devices/team/nm-device-team.c:132
+#| msgid "Team connection %d"
+msgid "Team connection"
+msgstr "Ðгрегированное (Team) Ñоединение"
+
+#: ../src/devices/wifi/nm-device-olpc-mesh.c:151
+#, fuzzy
+#| msgid "Mesh %d"
+msgid "Mesh"
msgstr "Mesh %d"
-#: ../src/devices/nm-device-team.c:158 ../tui/nm-editor-utils.c:223
-#, c-format
-msgid "Team connection %d"
-msgstr "Групповое Ñоединение %d"
-
-#: ../src/devices/nm-device-vlan.c:255 ../tui/nm-editor-utils.c:231
-#, c-format
-msgid "VLAN connection %d"
-msgstr "Подключение VLAN %d"
-
-#: ../src/nm-manager.c:3420 ../tui/nm-editor-utils.c:246
-#, c-format
-msgid "VPN connection %d"
-msgstr "Подключение VPN %d"
+#: ../src/devices/wifi/nm-device-wifi.c:1086
+msgid "WPA Ad-Hoc disabled due to kernel bugs"
+msgstr ""
-#: ../src/nm-netlink-monitor.c:219
-msgid "error occurred while waiting for data on socket"
-msgstr "произошла ошибка при ожидании данных из Ñокета"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:44
+#, fuzzy, c-format
+#| msgid "'%s=%s' is incompatible with '%s > 0'"
+msgid "%s is incompatible with static WEP keys"
+msgstr " «%s=%s» неÑовмеÑтимо Ñ Â«%s > 0»"
-#: ../src/nm-netlink-monitor.c:240
-#, c-format
-msgid "error processing netlink message: %s"
-msgstr "ошибка обработки ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ netlink: %s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:78
+#, fuzzy
+#| msgid "Authentication required by wireless network"
+msgid "LEAP authentication requires a LEAP username"
+msgstr "Ð”Ð»Ñ Ð´Ð¾Ñтупа к беÑпроводной Ñети требуетÑÑ Ð°ÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ"
-#: ../src/nm-netlink-monitor.c:264
-#, c-format
-msgid "unable to connect to netlink for monitoring link status: %s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:88
+msgid "LEAP username requires 'leap' authentication"
msgstr ""
-"не удалоÑÑŒ подключитьÑÑ Ðº netlink Ð´Ð»Ñ Ð¾Ñ‚ÑÐ»ÐµÐ¶Ð¸Ð²Ð°Ð½Ð¸Ñ ÑоÑтоÑÐ½Ð¸Ñ ÑоединениÑ: %s"
-
-#: ../src/nm-netlink-monitor.c:275
-#, c-format
-msgid "unable to enable netlink handle credential passing: %s"
-msgstr "не удалоÑÑŒ включить передачу мандата идентификатора netlink: %s"
-#: ../src/nm-netlink-monitor.c:319 ../src/nm-netlink-monitor.c:381
-#, c-format
-msgid "unable to allocate netlink handle for monitoring link status: %s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:101
+msgid "LEAP authentication requires IEEE 802.1x key management"
msgstr ""
-"не удалоÑÑŒ Ñоздать идентификатор netlink Ð´Ð»Ñ Ð¾Ñ‚ÑÐ»ÐµÐ¶Ð¸Ð²Ð°Ð½Ð¸Ñ ÑоÑтоÑÐ½Ð¸Ñ "
-"ÑоединениÑ: %s"
-
-#: ../src/nm-netlink-monitor.c:469
-#, c-format
-msgid "unable to join netlink group: %s"
-msgstr "не удалоÑÑŒ войти в группу netlink: %s"
-
-#: ../src/nm-sleep-monitor-systemd.c:116
-msgid "NetworkManager needs to turn off networks"
-msgstr "NetworkManager должен отключить Ñети"
-
-#: ../src/settings/plugins/ifcfg-rh/reader.c:115
-msgid "System"
-msgstr "СиÑтема"
-
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4158 ../tui/nm-editor-utils.c:200
-#: ../tui/nm-ui-utils.c:349 ../tui/nm-ui-utils.c:574
-msgid "Bond"
-msgstr "Bond"
-
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4240 ../tui/nm-editor-utils.c:218
-#: ../tui/nm-ui-utils.c:351 ../tui/nm-ui-utils.c:576
-msgid "Team"
-msgstr "Группа"
-
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4424 ../tui/nm-editor-utils.c:209
-#: ../tui/nm-ui-utils.c:353 ../tui/nm-ui-utils.c:578
-msgid "Bridge"
-msgstr "МоÑÑ‚"
-#: ../test/nm-online.c:73
-#, c-format
-msgid "\rConnecting"
-msgstr "Подключение..."
-
-#: ../test/nm-online.c:104
-msgid ""
-"Time to wait for a connection, in seconds (without the option, default value "
-"is 30)"
-msgstr "Ð’Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð² Ñекундах (по умолчанию 30)"
-
-#: ../test/nm-online.c:105
-msgid "Exit immediately if NetworkManager is not running"
-msgstr "Выйти немедленно, еÑли NetworkManager не запущен"
-
-#: ../test/nm-online.c:106
-msgid "Don't print anything"
-msgstr "Ðичего не выводить"
-
-#: ../test/nm-online.c:124
-msgid ""
-"Waits for NetworkManager to finish activating startup network connections."
-msgstr "Ожидать уÑпешного ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð² NetworkManager."
-
-#: ../test/nm-online.c:131 ../test/nm-online.c:141
-msgid "Invalid option. Please use --help to see a list of valid options."
-msgstr "Ðеверный параметр. ИÑпользуйте --help Ð´Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° ÑпиÑка параметров."
-
-#: ../tui/newt/nmt-newt-utils.c:168 ../tui/nmt-editor.c:231
-#: ../tui/nmt-password-dialog.c:175 ../tui/nmt-route-editor.c:135
-#: ../tui/nmtui-hostname.c:71 ../tui/nmtui.c:120
-msgid "OK"
-msgstr "OK"
-
-#: ../tui/newt/nmt-newt-utils.c:316 ../tui/newt/nmt-newt-utils.c:348
-#, c-format
-msgid "Could not create temporary file: %s"
-msgstr "Ðе удалоÑÑŒ Ñоздать временный файл: %s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:121
+msgid "LEAP authentication is incompatible with Ad-Hoc mode"
+msgstr ""
-#: ../tui/newt/nmt-newt-utils.c:354
-#, c-format
-msgid "Editor failed: %s"
-msgstr "Ошибка редактора: %s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:133
+msgid "LEAP authentication is incompatible with 802.1x setting"
+msgstr ""
-#: ../tui/newt/nmt-newt-utils.c:360
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:155
#, c-format
-msgid "Could not re-read file: %s"
-msgstr "Ðе удалоÑÑŒ заново прочитать файл: %s"
+msgid "a connection using '%s' authentication cannot use WPA key management"
+msgstr ""
-#: ../tui/nm-editor-utils.c:160
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:166
#, c-format
-msgid "Ethernet connection %d"
-msgstr "Проводное Ñоединение %d"
+msgid "a connection using '%s' authentication cannot specific WPA protocols"
+msgstr ""
-#: ../tui/nm-editor-utils.c:168
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:182
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:199
#, c-format
-msgid "Wi-Fi connection %d"
-msgstr "Соединение Wi-Fi %d"
-
-#: ../tui/nm-editor-utils.c:182 ../tui/nm-ui-utils.c:345
-msgid "Mobile Broadband"
-msgstr "Мобильное"
+msgid "a connection using '%s' authentication cannot specific WPA ciphers"
+msgstr ""
-#: ../tui/nm-editor-utils.c:185
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:211
#, c-format
-msgid "Mobile broadband connection %d"
-msgstr "Мобильное Ñоединение %d"
+msgid "a connection using '%s' authentication cannot specific a WPA password"
+msgstr ""
-#: ../tui/nm-editor-utils.c:190
-msgid "DSL"
-msgstr "DSL"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:242
+#, fuzzy
+#| msgid "Dynamic WEP (802.1x)"
+msgid "Dynamic WEP requires an 802.1x setting"
+msgstr "ДинамичеÑкий WEP (802.1x)"
-#: ../tui/nm-editor-utils.c:194
-#, c-format
-msgid "DSL connection %d"
-msgstr "DSL-Ñоединение %d"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:252
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:280
+msgid "Dynamic WEP requires 'open' authentication"
+msgstr ""
-#: ../tui/nm-ui-utils.c:316 ../tui/nm-ui-utils.c:385
-msgid "Wired"
-msgstr "Проводное"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:267
+msgid "Dynamic WEP requires 'ieee8021x' key management"
+msgstr ""
-#: ../tui/nm-ui-utils.c:339
-msgid "Bluetooth"
-msgstr "Bluetooth"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:314
+msgid "WPA-PSK authentication is incompatible with 802.1x"
+msgstr ""
-#: ../tui/nm-ui-utils.c:341
-msgid "OLPC Mesh"
-msgstr "OLPC Mesh"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:324
+#, fuzzy
+#| msgid "Wired 802.1X authentication"
+msgid "WPA-PSK requires 'open' authentication"
+msgstr "ÐÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð¿Ñ€Ð¾Ð²Ð¾Ð´Ð½Ð¾Ð³Ð¾ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ 802.1X"
-#: ../tui/nm-ui-utils.c:343
-msgid "WiMAX"
-msgstr "WiMAX"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:336
+msgid "WPA Ad-Hoc authentication requires an Ad-Hoc mode AP"
+msgstr ""
-#: ../tui/nm-ui-utils.c:357
-msgid "ADSL"
-msgstr "ADSL"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:349
+msgid "WPA Ad-Hoc authentication requires 'wpa' protocol"
+msgstr ""
-#: ../tui/nm-ui-utils.c:420
-msgid "PCI"
-msgstr "PCI"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:361
+#, fuzzy
+#| msgid "Authentication required by wireless network"
+msgid "WPA Ad-Hoc authentication requires 'none' pairwise cipher"
+msgstr "Ð”Ð»Ñ Ð´Ð¾Ñтупа к беÑпроводной Ñети требуетÑÑ Ð°ÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ"
-#: ../tui/nm-ui-utils.c:422
-msgid "USB"
-msgstr "USB"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:373
+msgid "WPA Ad-Hoc requires 'tkip' group cipher"
+msgstr ""
-#: ../tui/nm-ui-utils.c:498 ../tui/nm-ui-utils.c:518
-#, c-format
-msgctxt "long device name"
-msgid "%s %s"
-msgstr "%s %s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:387
+msgid "Access point does not support PSK but setting requires it"
+msgstr ""
-#: ../tui/nmt-device-entry.c:391
-msgid "Select..."
-msgstr "Выбрать..."
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:417
+msgid "WPA-EAP authentication requires an 802.1x setting"
+msgstr ""
-#: ../tui/nmt-edit-connection-list.c:129
-msgid "Add"
-msgstr "Добавить"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:427
+#, fuzzy
+#| msgid "Wired 802.1X authentication"
+msgid "WPA-EAP requires 'open' authentication"
+msgstr "ÐÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð¿Ñ€Ð¾Ð²Ð¾Ð´Ð½Ð¾Ð³Ð¾ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ 802.1X"
-#: ../tui/nmt-edit-connection-list.c:132 ../tui/nmt-page-ip4.c:172
-#: ../tui/nmt-page-ip6.c:170 ../tui/nmt-page-team-port.c:110
-#: ../tui/nmt-page-team.c:180
-msgid "Edit..."
-msgstr "Изменить..."
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:438
+msgid "802.1x setting requires 'wpa-eap' key management"
+msgstr ""
-#: ../tui/nmt-edit-connection-list.c:135 ../tui/nmtui-edit.c:471
-msgid "Delete"
-msgstr "Удалить"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:451
+msgid "Access point does not support 802.1x but setting requires it"
+msgstr ""
-#: ../tui/nmt-editor.c:81
-#, c-format
-msgid "Could not create editor for connection '%s' of type '%s'."
-msgstr "Ðе удалоÑÑŒ открыть окно редактора Ð´Ð»Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» типа «%s»."
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:479
+msgid ""
+"Access point mode is Ad-Hoc but setting requires Infrastructure security"
+msgstr ""
-#: ../tui/nmt-editor.c:85
-#, c-format
-msgid "Could not create editor for invalid connection '%s'."
-msgstr "Ðе удалоÑÑŒ открыть окно редактора Ð´Ð»Ñ Ð½ÐµÐ²ÐµÑ€Ð½Ð¾Ð³Ð¾ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s»."
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:489
+msgid "Ad-Hoc mode is incompatible with 802.1x security"
+msgstr ""
-#: ../tui/nmt-editor.c:95
-msgid "Edit connection"
-msgstr "Изменить Ñоединение"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:498
+msgid "Ad-Hoc mode is incompatible with LEAP security"
+msgstr ""
-#: ../tui/nmt-editor.c:134
-#, c-format
-msgid "Error saving connection: %s"
-msgstr "Ошибка при Ñохранении ÑоединениÑ: %s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:508
+msgid "Ad-Hoc mode requires 'open' authentication"
+msgstr ""
-#: ../tui/nmt-editor.c:144
-#, c-format
-msgid "Unable to save connection: %s"
-msgstr "Ðе удалоÑÑŒ Ñохранить Ñоединение: %s"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:518
+msgid ""
+"Access point mode is Infrastructure but setting requires Ad-Hoc security"
+msgstr ""
-#: ../tui/nmt-editor.c:158
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:560
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:590
#, c-format
-msgid "Unable to add new connection: %s"
-msgstr "Ðе удалоÑÑŒ добавить новое Ñоединение: %s"
-
-#: ../tui/nmt-editor.c:228 ../tui/nmt-password-dialog.c:172
-#: ../tui/nmt-route-editor.c:128 ../tui/nmtui-edit.c:201
-#: ../tui/nmtui-edit.c:470 ../tui/nmtui-hostname.c:69
-msgid "Cancel"
-msgstr "Отмена"
-
-#: ../tui/nmt-mtu-entry.c:86
-msgid "(default)"
-msgstr "(по умолчанию)"
-
-#: ../tui/nmt-mtu-entry.c:88 ../tui/nmt-mtu-entry.c:119
-msgid "bytes"
-msgstr "байт"
-
-#: ../tui/nmt-page-bond.c:88
-msgid "Round-robin"
-msgstr "ЦикличеÑкий"
-
-#: ../tui/nmt-page-bond.c:89
-msgid "Active Backup"
-msgstr "Ðктивный и запаÑные"
-
-#: ../tui/nmt-page-bond.c:90
-msgid "XOR"
-msgstr "XOR"
-
-#: ../tui/nmt-page-bond.c:91
-msgid "Broadcast"
-msgstr "РаÑÑылка"
-
-#: ../tui/nmt-page-bond.c:92
-msgid "802.3ad"
-msgstr "802.3ad"
-
-#: ../tui/nmt-page-bond.c:93
-msgid "Adaptive Transmit Load Balancing (tlb)"
-msgstr "Ðдаптивное раÑпределение нагрузки иÑходÑщего трафика (TLB)"
-
-#: ../tui/nmt-page-bond.c:94
-msgid "Adaptive Load Balancing (alb)"
-msgstr "Ðдаптивное раÑпределение нагрузки (ATLB)"
+msgid "connection does not match access point"
+msgstr ""
-#: ../tui/nmt-page-bond.c:100
-msgid "MII (recommended)"
-msgstr "MII (рекомендуетÑÑ)"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:614
+msgid "Access point is unencrypted but setting specifies security"
+msgstr ""
-#: ../tui/nmt-page-bond.c:101
-msgid "ARP"
-msgstr "ARP"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:703
+msgid ""
+"WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic "
+"WEP"
+msgstr ""
-#: ../tui/nmt-page-bond.c:359 ../tui/nmt-page-bridge.c:86
-#: ../tui/nmt-page-team.c:159
-msgid "Slaves"
-msgstr "Подчиненные"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:713
+msgid "WPA authentication is incompatible with Shared Key authentication"
+msgstr ""
-#: ../tui/nmt-page-bond.c:371 ../tui/nmt-page-wifi.c:227
-msgid "Mode"
-msgstr "Режим"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:760
+#, fuzzy
+#| msgid "Failed to set symmetric key for decryption."
+msgid "Failed to determine AP security information"
+msgstr "Ðе удалоÑÑŒ задать Ñимметричный ключ раÑшифровки."
-#: ../tui/nmt-page-bond.c:377
-msgid "Primary"
-msgstr "ОÑновной"
+#: ../src/devices/wwan/nm-modem-broadband.c:527
+#, fuzzy
+#| msgid "Mobile broadband connection %d"
+msgid "GSM mobile broadband connection requires a 'gsm' setting"
+msgstr "Мобильное Ñоединение %d"
-#: ../tui/nmt-page-bond.c:383
-msgid "Link monitoring"
-msgstr "Мониторинг ÑоединениÑ"
+#: ../src/nm-config.c:393
+msgid "Config file location"
+msgstr "РаÑположение файла конфигурации"
-#: ../tui/nmt-page-bond.c:389 ../tui/nmt-page-bond.c:396
-#: ../tui/nmt-page-bond.c:403 ../tui/nmt-page-bond.c:410
-msgctxt "milliseconds"
-msgid "ms"
-msgstr "мÑ"
+#: ../src/nm-config.c:393
+msgid "/path/to/config.file"
+msgstr "/путь/к/config.file"
-#: ../tui/nmt-page-bond.c:390 ../tui/nmt-page-bond.c:411
-msgid "Monitoring frequency"
-msgstr "ЧаÑтота мониторинга"
+#: ../src/nm-config.c:394
+msgid "Config directory location"
+msgstr "Путь к каталогу конфигурации"
-#: ../tui/nmt-page-bond.c:397
-msgid "Link up delay"
-msgstr "Задержка уÑтановки ÑоединениÑ"
+#: ../src/nm-config.c:394
+msgid "/path/to/config/dir"
+msgstr "/путь/к/каталогу"
-#: ../tui/nmt-page-bond.c:404
-msgid "Link down delay"
-msgstr "Задержка разрыва ÑоединениÑ"
+#: ../src/nm-config.c:396
+msgid "List of plugins separated by ','"
+msgstr "СпиÑок модулей (через запÑтую)"
-#: ../tui/nmt-page-bond.c:417
-msgid "ARP targets"
-msgstr "Получатели ARP"
+#: ../src/nm-config.c:396
+msgid "plugin1,plugin2"
+msgstr "модуль1,модуль2"
-#: ../tui/nmt-page-bridge-port.c:38
-msgid "BRIDGE PORT"
-msgstr "ПОРТ МОСТÐ"
+#: ../src/nm-config.c:397
+#, fuzzy
+#| msgid "Current nmcli configuration:\n"
+msgid "Quit after initial configuration"
+msgstr "Ð¢ÐµÐºÑƒÑ‰Ð°Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ nmcli:\n"
-#: ../tui/nmt-page-bridge-port.c:69 ../tui/nmt-page-bridge.c:112
-msgid "Priority"
-msgstr "Приоритет"
+#. These three are hidden for now, and should eventually just go away.
+#: ../src/nm-config.c:400
+msgid "An http(s) address for checking internet connectivity"
+msgstr "http(s) Ð°Ð´Ñ€ÐµÑ Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ð˜Ð½Ñ‚ÐµÑ€Ð½ÐµÑ‚Ð¾Ð¼"
-#: ../tui/nmt-page-bridge-port.c:75
-msgid "Path cost"
-msgstr "СтоимоÑÑ‚ÑŒ пути"
+#: ../src/nm-config.c:401
+msgid "The interval between connectivity checks (in seconds)"
+msgstr "Интервал между проверками ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ (в Ñекундах)"
-#: ../tui/nmt-page-bridge-port.c:77
-msgid "Hairpin mode"
-msgstr "Режим разворота пакетов"
+#: ../src/nm-config.c:402
+msgid "The expected start of the response"
+msgstr "ОжидаетÑÑ Ð½Ð°Ñ‡Ð°Ð»Ð¾ ответа"
-#: ../tui/nmt-page-bridge.c:42
-msgid "BRIDGE"
-msgstr "МОСТ"
+#: ../src/nm-config.c:402
+msgid "Bingo!"
+msgstr "Бинго!"
-#: ../tui/nmt-page-bridge.c:96 ../tui/nmt-page-bridge.c:121
-#: ../tui/nmt-page-bridge.c:131 ../tui/nmt-page-bridge.c:141
-msgid "seconds"
-msgstr "Ñек."
+#. Interface/IP config
+#: ../src/nm-iface-helper.c:286
+#, fuzzy
+#| msgid "Parent interface [none]: "
+msgid "The interface to manage"
+msgstr "РодительÑкий Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ [нет]:"
-#: ../tui/nmt-page-bridge.c:97
-msgid "Aging time"
-msgstr "Ð’Ñ€ÐµÐ¼Ñ ÑтарениÑ"
+#: ../src/nm-iface-helper.c:286
+msgid "eth0"
+msgstr "eth0"
-#: ../tui/nmt-page-bridge.c:99
-msgid "Enable STP (Spanning Tree Protocol)"
-msgstr "Включить STP (Spanning Tree Protocol)"
+#: ../src/nm-iface-helper.c:287
+#, fuzzy
+#| msgid "connection"
+msgid "Connection UUID"
+msgstr "Ñоединение"
-#: ../tui/nmt-page-bridge.c:122
-msgid "Forward delay"
-msgstr "Задержка переадреÑации"
+#: ../src/nm-iface-helper.c:287
+msgid "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
+msgstr ""
-#: ../tui/nmt-page-bridge.c:132
-msgid "Hello time"
-msgstr "Ð’Ñ€ÐµÐ¼Ñ Ð¿Ñ€Ð¸Ð²ÐµÑ‚ÑтвиÑ"
+#: ../src/nm-iface-helper.c:288
+msgid "Whether to manage IPv6 SLAAC"
+msgstr ""
-#: ../tui/nmt-page-bridge.c:142
-msgid "Max age"
-msgstr "МакÑимальный Ñрок"
+#: ../src/nm-iface-helper.c:289
+msgid "Whether SLAAC must be successful"
+msgstr ""
-#: ../tui/nmt-page-ethernet.c:41
-msgid "ETHERNET"
-msgstr "ETHERNET"
+#: ../src/nm-iface-helper.c:290
+msgid "Use an IPv6 temporary privacy address"
+msgstr ""
-#: ../tui/nmt-page-ethernet.c:80 ../tui/nmt-page-vlan.c:132
-#: ../tui/nmt-page-wifi.c:358
-msgid "Cloned MAC address"
+#: ../src/nm-iface-helper.c:291
+#, fuzzy
+#| msgid "Cloned MAC address"
+msgid "Current DHCPv4 address"
msgstr "Клонированный MAC-адреÑ"
-#: ../tui/nmt-page-infiniband.c:40
-msgid "INFINIBAND"
-msgstr "INFINIBAND"
-
-#: ../tui/nmt-page-infiniband.c:51
-msgid "Datagram"
-msgstr "Датаграмма"
+#: ../src/nm-iface-helper.c:292
+msgid "Whether DHCPv4 must be successful"
+msgstr ""
-#: ../tui/nmt-page-infiniband.c:52
-msgid "Connected"
-msgstr "Подключено"
+#: ../src/nm-iface-helper.c:293
+#, fuzzy
+#| msgid "unsupported DHCP client '%s'"
+msgid "Hex-encoded DHCPv4 client ID"
+msgstr "клиент DHCP «%s» не поддерживаетÑÑ"
-#: ../tui/nmt-page-infiniband.c:84
-msgid "Transport mode"
-msgstr "ТранÑпортный режим"
+#: ../src/nm-iface-helper.c:294
+msgid "Hostname to send to DHCP server"
+msgstr ""
-#: ../tui/nmt-page-ip4.c:41
-msgid "Disabled"
-msgstr "Отключено"
+#: ../src/nm-iface-helper.c:294
+msgid "barbar"
+msgstr ""
-#: ../tui/nmt-page-ip4.c:42 ../tui/nmt-page-ip6.c:42
-msgid "Automatic"
-msgstr "ÐвтоматичеÑки"
+#: ../src/nm-iface-helper.c:295
+#, fuzzy
+#| msgid "no priority to remove"
+msgid "Route priority for IPv4"
+msgstr "нет приоритета Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ"
-#: ../tui/nmt-page-ip4.c:43 ../tui/nmt-page-ip6.c:44
-msgid "Link-Local"
-msgstr "Ð›Ð¾ÐºÐ°Ð»ÑŒÐ½Ð°Ñ ÑвÑзь"
+#: ../src/nm-iface-helper.c:295
+msgid "0"
+msgstr "0"
-#: ../tui/nmt-page-ip4.c:44 ../tui/nmt-page-ip6.c:45
-msgid "Manual"
-msgstr "Вручную"
+#: ../src/nm-iface-helper.c:296
+#, fuzzy
+#| msgid "no priority to remove"
+msgid "Route priority for IPv6"
+msgstr "нет приоритета Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ"
-#: ../tui/nmt-page-ip4.c:45
-msgid "Shared"
-msgstr "Общее"
+#: ../src/nm-iface-helper.c:296
+msgid "1024"
+msgstr "1024"
-#: ../tui/nmt-page-ip4.c:54
-msgid "IPv4 CONFIGURATION"
-msgstr "КОÐФИГУРÐЦИЯ IPv4"
+#: ../src/nm-iface-helper.c:297
+msgid "Hex-encoded Interface Identifier"
+msgstr ""
-#: ../tui/nmt-page-ip4.c:100 ../tui/nmt-page-ip6.c:100
-msgid "(No custom routes)"
-msgstr "(нет дополнительных маршрутов)"
+#: ../src/nm-iface-helper.c:319
+msgid ""
+"nm-iface-helper is a small, standalone process that manages a single network "
+"interface."
+msgstr ""
-#: ../tui/nmt-page-ip4.c:103 ../tui/nmt-page-ip6.c:103
+#: ../src/nm-iface-helper.c:328
#, c-format
-msgid "One custom route"
-msgid_plural "%d custom routes"
-msgstr[0] "%d дополнительный маршрут"
-msgstr[1] "%d дополнительных маршрута"
-msgstr[2] "%d дополнительных маршрутов"
-
-#: ../tui/nmt-page-ip4.c:141 ../tui/nmt-page-ip6.c:141
-msgid "Addresses"
-msgstr "ÐдреÑа"
-
-#: ../tui/nmt-page-ip4.c:147 ../tui/nmt-page-ip6.c:147
-msgid "Gateway"
-msgstr "Шлюз"
-
-#: ../tui/nmt-page-ip4.c:153 ../tui/nmt-page-ip6.c:153
-msgid "DNS servers"
-msgstr "DNS-Ñерверы"
-
-#: ../tui/nmt-page-ip4.c:159 ../tui/nmt-page-ip6.c:159
-msgid "Search domains"
-msgstr "ПоиÑк доменов"
-
-#: ../tui/nmt-page-ip4.c:174 ../tui/nmt-page-ip6.c:172
-msgid "Routing"
-msgstr "МаршрутизациÑ"
-
-#: ../tui/nmt-page-ip4.c:176 ../tui/nmt-page-ip6.c:174
-msgid "Never use this network for default route"
-msgstr "Ðе иÑпользовать Ñту Ñеть Ð´Ð»Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ³Ð¾ маршрута"
-
-#: ../tui/nmt-page-ip4.c:184
-msgid "Require IPv4 addressing for this connection"
-msgstr "Соединение требует адреÑацию IPv4"
-
-#: ../tui/nmt-page-ip6.c:41
-msgid "Ignore"
-msgstr "Игнорировать"
-
-#: ../tui/nmt-page-ip6.c:43
-msgid "Automatic (DHCP-only)"
-msgstr "ÐвтоматичеÑки (только DHCP)"
-
-#: ../tui/nmt-page-ip6.c:54
-msgid "IPv6 CONFIGURATION"
-msgstr "КОÐФИГУРÐЦИЯ IPv6"
-
-#: ../tui/nmt-page-ip6.c:182
-msgid "Require IPv6 addressing for this connection"
-msgstr "Соединение требует адреÑацию IPv6"
-
-#: ../tui/nmt-page-main.c:134
-msgid "Hide"
-msgstr "Скрыть"
-
-#: ../tui/nmt-page-main.c:134
-msgid "Show"
-msgstr "Показать"
-
-#: ../tui/nmt-page-main.c:181
-msgid "Profile name"
-msgstr "Ð˜Ð¼Ñ Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ"
-
-#: ../tui/nmt-page-main.c:188
-msgid "Device"
-msgstr "УÑтройÑтво"
-
-#: ../tui/nmt-page-main.c:252
-msgid "Automatically connect"
-msgstr "ПодключатьÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑки"
-
-#: ../tui/nmt-page-main.c:258
-msgid "Available to all users"
-msgstr "ДоÑтупно вÑем"
-
-#: ../tui/nmt-page-team-port.c:45
-msgid "TEAM PORT"
-msgstr "ПОРТ ГРУППЫ"
-
-#: ../tui/nmt-page-team-port.c:100 ../tui/nmt-page-team.c:170
-msgid "JSON configuration"
-msgstr "ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ JSON"
-
-#: ../tui/nmt-page-team.c:51
-msgid "TEAM"
-msgstr "ГРУППÐ"
-
-#: ../tui/nmt-page-vlan.c:109
-msgid "Parent"
-msgstr "РодительÑкий"
-
-#: ../tui/nmt-page-vlan.c:124
-msgid "VLAN id"
-msgstr "VLAN ID"
-
-#: ../tui/nmt-page-wifi.c:58
-msgid "WI-FI"
-msgstr "WI-FI"
-
-#: ../tui/nmt-page-wifi.c:69
-msgctxt "Wi-Fi"
-msgid "Client"
-msgstr "Клиент"
-
-#: ../tui/nmt-page-wifi.c:70
-msgid "Access Point"
-msgstr "Точка доÑтупа"
-
-#: ../tui/nmt-page-wifi.c:71
-msgid "Ad-Hoc Network"
-msgstr "ДинамичеÑÐºÐ°Ñ Ñеть"
-
-#: ../tui/nmt-page-wifi.c:76
-msgctxt "Wi-Fi"
-msgid "Automatic"
-msgstr "ÐвтоматичеÑки"
-
-#: ../tui/nmt-page-wifi.c:78
-msgid "A (5 GHz)"
-msgstr "A (5 ГГц)"
-
-#: ../tui/nmt-page-wifi.c:80
-msgid "B/G (2.4 GHz)"
-msgstr "B/G (2.4 ГГц)"
-
-#: ../tui/nmt-page-wifi.c:85
-msgctxt "Wi-Fi security"
-msgid "None"
-msgstr "Ðет"
-
-#: ../tui/nmt-page-wifi.c:86
-msgid "WPA & WPA2 Personal"
-msgstr "WPA и WPA2 Personal"
-
-#: ../tui/nmt-page-wifi.c:87
-msgid "WPA & WPA2 Enterprise"
-msgstr "WPA и WPA2 Enterprise"
-
-#: ../tui/nmt-page-wifi.c:88
-msgid "WEP 40/128-bit Key (Hex or ASCII)"
-msgstr "40/128-битный ключ WEP (Hex или ASCII))"
-
-#: ../tui/nmt-page-wifi.c:89
-msgid "WEP 128-bit Passphrase"
-msgstr "128-битный ключ WEP"
-
-#: ../tui/nmt-page-wifi.c:90
-msgid "Dynamic WEP (802.1x)"
-msgstr "ДинамичеÑкий WEP (802.1x)"
-
-#: ../tui/nmt-page-wifi.c:91
-msgid "LEAP"
-msgstr "LEAP"
-
-#: ../tui/nmt-page-wifi.c:96
-msgctxt "WEP key index"
-msgid "1 (Default)"
-msgstr "1 (по умолчанию)"
-
-#: ../tui/nmt-page-wifi.c:97
-msgctxt "WEP key index"
-msgid "2"
-msgstr "2"
-
-#: ../tui/nmt-page-wifi.c:98
-msgctxt "WEP key index"
-msgid "3"
-msgstr "3"
-
-#: ../tui/nmt-page-wifi.c:99
-msgctxt "WEP key index"
-msgid "4"
-msgstr "4"
-
-#: ../tui/nmt-page-wifi.c:104
-msgid "Open System"
-msgstr "ÐžÑ‚ÐºÑ€Ñ‹Ñ‚Ð°Ñ ÑиÑтема"
-
-#: ../tui/nmt-page-wifi.c:105
-msgid "Shared Key"
-msgstr "Общий ключ"
-
-#: ../tui/nmt-page-wifi.c:253
-msgid "Channel"
-msgstr "Канал"
-
-#: ../tui/nmt-page-wifi.c:258
-msgid "Security"
-msgstr "Защита"
-
-#: ../tui/nmt-page-wifi.c:274 ../tui/nmt-page-wifi.c:305
-#: ../tui/nmt-page-wifi.c:335 ../tui/nmt-secret-agent.c:214
-#: ../tui/nmt-secret-agent.c:251 ../tui/nmt-secret-agent.c:281
-#: ../tui/nmt-secret-agent.c:314 ../tui/nmt-secret-agent.c:380
-#: ../tui/nmt-secret-agent.c:393 ../tui/nmt-secret-agent.c:409
-msgid "Password"
-msgstr "Пароль"
-
-#: ../tui/nmt-page-wifi.c:279
-msgid "(No support for wpa-enterprise yet...)"
-msgstr "(wpa-enterprise не поддерживаетÑÑ)"
-
-#: ../tui/nmt-page-wifi.c:286 ../tui/nmt-secret-agent.c:265
-msgid "Key"
-msgstr "Ключ"
-
-#: ../tui/nmt-page-wifi.c:289 ../tui/nmt-page-wifi.c:308
-msgid "WEP index"
-msgstr "Ð˜Ð½Ð´ÐµÐºÑ WEP"
-
-#: ../tui/nmt-page-wifi.c:297 ../tui/nmt-page-wifi.c:316
-msgid "Authentication"
-msgstr "ÐутентификациÑ"
-
-#: ../tui/nmt-page-wifi.c:322
-msgid "(No support for dynamic-wep yet...)"
-msgstr "(dynamic-wep не поддерживаетÑÑ)"
-
-#: ../tui/nmt-page-wifi.c:329 ../tui/nmt-secret-agent.c:209
-#: ../tui/nmt-secret-agent.c:304
-msgid "Username"
-msgstr "Пользователь"
-
-#: ../tui/nmt-password-fields.c:130
-msgid "Ask for this password every time"
-msgstr "Запрашивать пароль каждый раз"
-
-#: ../tui/nmt-password-fields.c:131
-msgid "Show password"
-msgstr "Показать пароль"
-
-#: ../tui/nmt-route-table.c:219
-msgid "Destination"
-msgstr "Ðазначение"
-
-#: ../tui/nmt-route-table.c:219
-msgid "Prefix"
-msgstr "ПрефикÑ"
-
-#: ../tui/nmt-route-table.c:228
-msgid "Next Hop"
-msgstr "Следующий переход"
-
-#: ../tui/nmt-route-table.c:236
-msgid "Metric"
-msgstr "Метрика"
-
-#: ../tui/nmt-route-table.c:256
-msgid "No custom routes are defined."
-msgstr "Ðет дополнительных маршрутов."
-
-#: ../tui/nmt-secret-agent.c:223
-msgid "Identity"
-msgstr "ИдентификациÑ"
-
-#: ../tui/nmt-secret-agent.c:228
-msgid "Private key password"
-msgstr "Пароль Ñекретного ключа"
-
-#: ../tui/nmt-secret-agent.c:309
-msgid "Service"
-msgstr "Служба"
+msgid "An interface name and UUID are required\n"
+msgstr ""
-#: ../tui/nmt-secret-agent.c:340
-msgid "Authentication required by wireless network"
-msgstr "Ð”Ð»Ñ Ð´Ð¾Ñтупа к беÑпроводной Ñети требуетÑÑ Ð°ÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ"
+#: ../src/nm-iface-helper.c:393
+#, fuzzy, c-format
+#| msgid "Failed to find expected PKCS#8 end tag '%s'."
+msgid "Failed to find interface index for %s\n"
+msgstr "Ðе удалоÑÑŒ найти закрывающий тег PKCS#8 — «%s»."
-#: ../tui/nmt-secret-agent.c:341
+#: ../src/nm-iface-helper.c:409
#, c-format
-msgid ""
-"Passwords or encryption keys are required to access the wireless network "
-"'%s'."
+msgid "(%s): Invalid IID %s\n"
msgstr ""
-"Ð”Ð»Ñ Ð´Ð¾Ñтупа к беÑпроводной Ñети «%s» требуютÑÑ Ð¿Ð°Ñ€Ð¾Ð»Ð¸ или ключи шифрованиÑ."
-#: ../tui/nmt-secret-agent.c:349
-msgid "Wired 802.1X authentication"
-msgstr "ÐÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð¿Ñ€Ð¾Ð²Ð¾Ð´Ð½Ð¾Ð³Ð¾ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ 802.1X"
-
-#: ../tui/nmt-secret-agent.c:352
-msgid "Network name"
-msgstr "Ð˜Ð¼Ñ Ñети"
+#: ../src/nm-logging.c:140
+#, c-format
+msgid "Unknown log level '%s'"
+msgstr "ÐеизвеÑтный уровень Ð¶ÑƒÑ€Ð½Ð°Ð»Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Â«%s»"
-#: ../tui/nmt-secret-agent.c:359
-msgid "DSL authentication"
-msgstr "ÐÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ DSL"
+#: ../src/nm-logging.c:222
+#, c-format
+msgid "Unknown log domain '%s'"
+msgstr "ÐеизвеÑтный домен Ð¶ÑƒÑ€Ð½Ð°Ð»Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Â«%s»"
-#: ../tui/nmt-secret-agent.c:367
-msgid "PIN code required"
-msgstr "ТребуетÑÑ PIN"
+#: ../src/nm-manager.c:3437
+#| msgid "VPN connecting"
+msgid "VPN connection"
+msgstr "VPN-Ñоединение"
-#: ../tui/nmt-secret-agent.c:368
-msgid "PIN code is needed for the mobile broadband device"
-msgstr "Ð”Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¼Ð¾Ð±Ð¸Ð»ÑŒÐ½Ð¾Ð³Ð¾ уÑтройÑтва требуетÑÑ PIN-код"
+#: ../src/nm-sleep-monitor-systemd.c:115
+msgid "NetworkManager needs to turn off networks"
+msgstr "NetworkManager должен отключить Ñети"
-#: ../tui/nmt-secret-agent.c:370
-msgid "PIN"
-msgstr "PIN"
+#: ../src/settings/plugins/ibft/plugin.c:66
+#, c-format
+msgid "ibft: failed to read iscsiadm records: %s"
+msgstr ""
-#: ../tui/nmt-secret-agent.c:376 ../tui/nmt-secret-agent.c:389
-#: ../tui/nmt-secret-agent.c:405
-msgid "Mobile broadband network password"
-msgstr "Пароль мобильной Ñети"
+#: ../src/settings/plugins/ibft/plugin.c:74
+#, fuzzy, c-format
+#| msgid "Wired connection %d"
+msgid "ibft: read connection '%s'"
+msgstr "Проводное Ñоединение %d"
-#: ../tui/nmt-secret-agent.c:377 ../tui/nmt-secret-agent.c:390
-#: ../tui/nmt-secret-agent.c:406
+#: ../src/settings/plugins/ibft/plugin.c:80
#, c-format
-msgid "A password is required to connect to '%s'."
-msgstr "Ð”Ð»Ñ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ðº «%s» требуетÑÑ Ð¿Ð°Ñ€Ð¾Ð»ÑŒ."
-
-#: ../tui/nmt-slave-list.c:138
-msgid "Select the type of slave connection you wish to add."
-msgstr "Выберите тип добавлÑемого подчиненного ÑоединениÑ."
+msgid "ibft: failed to read iscsiadm record: %s"
+msgstr ""
-#: ../tui/nmt-widget-list.c:142
-msgid "Add..."
-msgstr "Добавить..."
+#: ../src/settings/plugins/ifcfg-rh/reader.c:112
+msgid "System"
+msgstr "СиÑтема"
-#: ../tui/nmt-widget-list.c:205
-msgid "Remove"
-msgstr "Удалить"
+#~ msgid "invalid prefix '%s'; <1-32> allowed"
+#~ msgstr "недопуÑтимый Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Â«%s» (допуÑкаетÑÑ <1-32>)"
+
+#~ msgid "invalid prefix '%s'; <1-128> allowed"
+#~ msgstr "недопуÑтимый Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Â«%s» (допуÑкаетÑÑ <1-128>)"
+
+#, fuzzy
+#~| msgid "invalid next hop address '%s'"
+#~ msgid "invalid route destination address '%s'"
+#~ msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´Ð°: «%s»"
+
+#~ msgid "invalid next hop address '%s'"
+#~ msgstr "недопуÑтимый Ð°Ð´Ñ€ÐµÑ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´Ð°: «%s»"
+
+#~ msgid ""
+#~ "Error: 'mode': '%s' is not a valid InfiniBand transport mode [datagram, "
+#~ "connected]."
+#~ msgstr ""
+#~ "Ошибка «mode». ÐедейÑтвительный режим передачи InfiniBand: "
+#~ "«%s» [датаграмма, подключено]."
+
+#, fuzzy
+#~| msgid "Error: Could not get system settings."
+#~ msgid "Error: could not get remote settings: %s."
+#~ msgstr "Ошибка. Ðе удалоÑÑŒ получить ÑиÑтемные параметры."
+
+#~ msgid "Error: Can't obtain connections: settings service is not running."
+#~ msgstr ""
+#~ "Ошибка: не удалоÑÑŒ получить ÑоединениÑ: Ñлужба параметров не запущена."
+
+#, fuzzy
+#~| msgid "Error: Could not get system settings."
+#~ msgid "Error: Could not get system settings: %s."
+#~ msgstr "Ошибка. Ðе удалоÑÑŒ получить ÑиÑтемные параметры."
+
+#~ msgid "'%s' is not valid (use ip[/prefix] [gateway])"
+#~ msgstr ""
+#~ "ÐедейÑтвительное значение «%s». ДопуÑтимый формат: ip[/префикÑ] [шлюз]."
+
+#, fuzzy
+#~| msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n"
+#~ msgid "connection type '%s' is not a valid base type"
+#~ msgstr "Ошибка. ÐедопуÑтимый тип bluetooth: «%s»\n"
+
+#, fuzzy
+#~| msgid "Select the type of slave connection you wish to add."
+#~ msgid "Detect a slave connection with '"
+#~ msgstr "Выберите тип добавлÑемого подчиненного ÑоединениÑ."
+
+#~ msgid "Failed to set signal mask: %d"
+#~ msgstr "Ошибка уÑтановки маÑки Ñигнала: %d"
+
+#~ msgid "Failed to create signal handling thread: %d"
+#~ msgstr "Ошибка ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð¿Ð¾Ñ‚Ð¾ÐºÐ° обработки Ñигнала: %d"
+
+#~ msgid "GModules are not supported on your platform!\n"
+#~ msgstr "GModules не поддерживаютÑÑ Ð½Ð° вашей платформе.\n"
+
+#, fuzzy
+#~| msgid "'dhclient' could be found."
+#~ msgid "'dhclient' could not be found or was disabled."
+#~ msgstr "«dhclient» не найден."
+
+#, fuzzy
+#~| msgid "DUN connection %d"
+#~ msgid "DUN connection"
+#~ msgstr "Подключение DUN %d"
+
+#~ msgid "invalid prefix '%s'; <0-32> allowed"
+#~ msgstr "недопуÑтимый Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Â«%s» (допуÑкаетÑÑ <0-32>)"
+
+#~ msgid "invalid IPv6 route '%s'"
+#~ msgstr "недопуÑтимый маршрут IPv6: «%s»"
+
+#~ msgid "invalid prefix '%s'; <0-128> allowed"
+#~ msgstr "недопуÑтимый Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Â«%s» (допуÑкаетÑÑ <0-128>)"
+
+#~ msgid ""
+#~ "Usage: nmcli connection show { ARGUMENTS | help }\n"
+#~ "\n"
+#~ "ARGUMENTS := active [[id | uuid | path | apath] <ID>]\n"
+#~ "\n"
+#~ "Show connections which are currently used by a device to connect to a "
+#~ "network.\n"
+#~ "Without a parameter, all active connections are listed. When <ID> is "
+#~ "provided,\n"
+#~ "the connection details are displayed instead.\n"
+#~ "\n"
+#~ "ARGUMENTS := configured [[id | uuid | path] <ID>]\n"
+#~ "\n"
+#~ "Show in-memory and on-disk connections, some of which may also be active "
+#~ "if\n"
+#~ "a device is using that connection profile. Without a parameter, all "
+#~ "profiles\n"
+#~ "are listed. When <ID> is provided, the profile details are displayed "
+#~ "instead.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Формат: nmcli connection show { ÐРГУМЕÐТЫ | help }\n"
+#~ "\n"
+#~ "ÐРГУМЕÐТЫ := active [[id | uuid | path | apath] <ID>]\n"
+#~ "\n"
+#~ "Показывает ÑпиÑок Ñоединений.\n"
+#~ "ЕÑли параметры не указаны, команда вернет вÑе активные ÑоединениÑ.\n"
+#~ "ЕÑли указан идентификатор, будет показана Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ его Ñоединении.\n"
+#~ "\n"
+#~ "ÐРГУМЕÐТЫ := configured [[id | uuid | path] <ID>]\n"
+#~ "\n"
+#~ "Показывает наÑтроенные ÑоединениÑ, которые могут быть активны,\n"
+#~ "еÑли уÑтройÑтво иÑпользует ÑоответÑтвующий профиль ÑоединениÑ.\n"
+#~ "ЕÑли параметры не указаны, команда вернет вÑе профили.\n"
+#~ "ЕÑли указан идентификатор, будет показаны ÑÐ²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾ его профиле.\n"
+
+#~ msgid ""
+#~ "Usage: nmcli connection modify { ARGUMENTS | help }\n"
+#~ "\n"
+#~ "ARGUMENTS := [id | uuid | path] <ID> <setting name>.<property name> "
+#~ "[<value>]\n"
+#~ "\n"
+#~ "Modify a single property in the connection profile.\n"
+#~ "The profile is identified by its name, UUID or D-Bus path.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Формат: nmcli connection modify { ÐРГУМЕÐТЫ | help }\n"
+#~ "\n"
+#~ "ÐРГУМЕÐТЫ := [id | uuid | путь] <ID> <параметр>.<ÑвойÑтво> [<защита>]\n"
+#~ "\n"
+#~ "Изменение ÑвойÑтва в профиле ÑоединениÑ. \n"
+#~ "Профиль определÑетÑÑ Ð¿Ð¾ имени, UUID или пути D-Bus.\n"
+#~ "\n"
+
+#~ msgid "Error: 'list configured': %s"
+#~ msgstr "Ошибка «list configured»: %s"
+
+#~ msgid "List of configured connections"
+#~ msgstr "СпиÑок наÑтроенных Ñоединений"
+
+#~ msgid "Error: 'show configured': %s"
+#~ msgstr "Ошибка «show configured»: %s"
+
+#~ msgid "Error: 'list active': %s"
+#~ msgstr "Ошибка «list active»: %s"
+
+#~ msgid "List of active connections"
+#~ msgstr "СпиÑок активных Ñоединений"
+
+#~ msgid ""
+#~ "Error: Device '%s' is waiting for slaves before proceeding with "
+#~ "activation."
+#~ msgstr ""
+#~ "Ошибка. Ð”Ð»Ñ Ð¿Ñ€Ð¾Ð´Ð¾Ð»Ð¶ÐµÐ½Ð¸Ñ Ð°ÐºÑ‚Ð¸Ð²Ð°Ñ†Ð¸Ð¸ уÑтройÑтва «%s» необходимо дождатьÑÑ "
+#~ "его подчиненных уÑтройÑтв."
+
+#~ msgid "There are 3 optional arguments for '%s' connection type.\n"
+#~ msgstr "Ð”Ð»Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s» доÑтупно три дополнительных аргумента.\n"
+
+#~ msgid "Transport mode (datagram or connected) [datagram]: "
+#~ msgstr "Режим передачи (датаграммы или подключенный) [датаграмма]:"
+
+#~ msgid ""
+#~ "There are 2 optional arguments for 'mobile broadband' connection type.\n"
+#~ msgstr ""
+#~ "Ð”Ð»Ñ Ð¼Ð¾Ð±Ð¸Ð»ÑŒÐ½Ñ‹Ñ… широкополоÑных Ñоединений доÑтупно два дополнительных "
+#~ "аргумента.\n"
+
+#~ msgid "Bluetooth type (panu, dun-gsm or dun-cdma) [panu]: "
+#~ msgstr "Тип bluetooth (panu, dun-gsm, dun-cdma) [panu]: "
+
+#~ msgid "There are optional arguments for 'bond' connection type.\n"
+#~ msgstr "Ð”Ð»Ñ Ñоединений «bond» доÑтупны дополнительные аргументы.\n"
+
+#~ msgid "Bonding monitoring mode (miimon or arp) [miimon]: "
+#~ msgstr "Режим мониторинга агрегации (miimon или arp) [miimon]: "
+
+#~ msgid "There are 6 optional arguments for 'bridge' connection type.\n"
+#~ msgstr "Ð”Ð»Ñ Ñоединений «bridge» доÑтупно шеÑÑ‚ÑŒ дополнительных аргументов.\n"
+
+#~ msgid "Error: 'stp': '%s'.\n"
+#~ msgstr "Ошибка «stp»: «%s»\n"
+
+#~ msgid "There are 3 optional arguments for 'bridge-slave' connection type.\n"
+#~ msgstr ""
+#~ "Ð”Ð»Ñ Ñоединений «bridge-slave» доÑтупно три дополнительных аргумента.\n"
+
+#~ msgid "Hairpin (yes/no) [yes]: "
+#~ msgstr "Hairpin (да/нет) [да]: "
+
+#~ msgid "Error: 'hairpin': '%s'.\n"
+#~ msgstr "Ошибка «hairpin»: «%s»\n"
+
+#~ msgid "There is 1 optional argument for 'VPN' connection type.\n"
+#~ msgstr "Ð”Ð»Ñ Ñоединений VPN доÑтупен один дополнительный аргумент.\n"
+
+#~ msgid ""
+#~ "save :: save the connection\n"
+#~ "\n"
+#~ "Sends the connection to NetworkManager that will save it.\n"
+#~ msgstr ""
+#~ "save :: Ñохранение ÑоединениÑ\n"
+#~ "\n"
+#~ "СохранÑет Ñоединение в NetworkManager.\n"
+
+#~ msgid ""
+#~ "remove [<index>|<option>] :: delete the value\n"
+#~ "\n"
+#~ "Removes the property value (sets it to default).\n"
+#~ msgstr ""
+#~ "remove [<индекÑ>|<значение>] :: удаление значениÑ\n"
+#~ "\n"
+#~ "Очищает ÑвойÑтво и приÑваивает ему иÑходное значение.\n"
+
+#~ msgid "Error: '%s' setting not present\n"
+#~ msgstr "Ошибка. Параметр «%s» не определен.\n"
+
+#~ msgid ""
+#~ ">>> Command-line editing is not available. Consider installing a line "
+#~ "editing library to enable the feature. <<<\n"
+#~ "Supported libraries are:\n"
+#~ " - GNU Readline (libreadline) http://cnswww.cns.cwru.edu/php/chet/"
+#~ "readline/rltop.html\n"
+#~ " - NetBSD Editline (libedit) http://www.thrysoee.dk/editline/\n"
+#~ msgstr ""
+#~ ">>> Редактирование в командной Ñтроке недоÑтупно. Ð”Ð»Ñ Ñтого рекомендуетÑÑ "
+#~ "уÑтановить библиотеку Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñ‚ÐµÐºÑта. <<<\n"
+#~ "Поддерживаемые библиотеки:\n"
+#~ " - GNU Readline (libreadline) http://cnswww.cns.cwru.edu/php/chet/"
+#~ "readline/rltop.html\n"
+#~ " - NetBSD Editline (libedit) http://www.thrysoee.dk/editline/\n"
-#: ../tui/nmtui-connect.c:82
-msgid "Activation failed"
-msgstr "Ошибка подключениÑ"
+#~ msgid ""
+#~ "Error: 'configured' or 'active' command is expected for 'connection show'."
+#~ msgstr ""
+#~ "Ошибка. ПоÑле «connection show» ожидаетÑÑ Â«configured» или «active»."
-#: ../tui/nmtui-connect.c:134
-msgid "Connecting..."
-msgstr "Подключение..."
+#~ msgid "not running"
+#~ msgstr "не выполнÑетÑÑ"
-#: ../tui/nmtui-connect.c:159
-#, c-format
-msgid "Could not activate connection: %s"
-msgstr "Ðе удалоÑÑŒ подключитьÑÑ Ðº %s"
+#~ msgid "Error: %s"
+#~ msgstr "Ошибка: %s"
-#: ../tui/nmtui-connect.c:218 ../tui/nmtui-connect.c:274
-msgid "Activate"
-msgstr "Включить"
+#~ msgid "0 (unknown)"
+#~ msgstr "0 (неизвеÑтно)"
-#: ../tui/nmtui-connect.c:220
-msgid "Deactivate"
-msgstr "Отключить"
+#~ msgid "any, "
+#~ msgstr "любой, "
-#: ../tui/nmtui-connect.c:279 ../tui/nmtui-edit.c:102 ../tui/nmtui.c:114
-msgid "Quit"
-msgstr "Выход"
+#~ msgid "900 MHz, "
+#~ msgstr "900 МГц, "
-#: ../tui/nmtui-connect.c:304
-#, c-format
-msgid "No such connection '%s'"
-msgstr "Ðет ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s»."
+#~ msgid "1800 MHz, "
+#~ msgstr "1800 МГц, "
-#: ../tui/nmtui-connect.c:306
-msgid "Connection is already active"
-msgstr "Соединение активно"
+#~ msgid "1900 MHz, "
+#~ msgstr "1900 МГц, "
-#: ../tui/nmtui-edit.c:209
-msgid "Create"
-msgstr "Создать"
+#~ msgid "850 MHz, "
+#~ msgstr "850 МГц, "
-#: ../tui/nmtui-edit.c:350
-msgid "Select the type of connection you wish to create."
-msgstr "Выберите тип нового ÑоединениÑ."
+#~ msgid "WCDMA 3GPP UMTS 2100 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 2100 МГц, "
-#: ../tui/nmtui-edit.c:357
-msgid ""
-"If you are creating a VPN, and the VPN connection you wish to create does "
-"not appear in the list, you may not have the correct VPN plugin installed."
-msgstr ""
-"ОтÑутÑтвие необходимого типа VPN в ÑпиÑке может говорить о том, что в "
-"ÑиÑтеме не уÑтановлен ÑоответÑтвующий модуль VPN."
+#~ msgid "WCDMA 3GPP UMTS 1800 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1800 МГц, "
-#: ../tui/nmtui-edit.c:390 ../tui/nmtui-edit.c:406
-msgid "New Connection"
-msgstr "Ðовое Ñоединение"
+#~ msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1700/2100 МГц, "
-#: ../tui/nmtui-edit.c:443
-#, c-format
-msgid "Unable to delete connection: %s"
-msgstr "Ðе удалоÑÑŒ удалить Ñоединение: %s"
+#~ msgid "WCDMA 3GPP UMTS 800 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 800 МГц, "
-#: ../tui/nmtui-edit.c:472
-#, c-format
-msgid "Are you sure you want to delete the connection '%s'?"
-msgstr "ДейÑтвительно удалить Ñоединение «%s»?"
+#~ msgid "WCDMA 3GPP UMTS 850 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 850 МГц, "
-#: ../tui/nmtui-edit.c:486
-#, c-format
-msgid "Could not delete connection: %s"
-msgstr "Ðе удалоÑÑŒ удалить Ñоединение: %s"
+#~ msgid "WCDMA 3GPP UMTS 900 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 900 МГц, "
-#: ../tui/nmtui-hostname.c:47
-msgid "Set Hostname"
-msgstr "Измените Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°"
+#~ msgid "WCDMA 3GPP UMTS 1700 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1700 МГц, "
-#: ../tui/nmtui-hostname.c:55
-msgid "Hostname"
-msgstr "Ð˜Ð¼Ñ ÑƒÐ·Ð»Ð°"
+#~ msgid "WCDMA 3GPP UMTS 1900 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1900 МГц, "
-#: ../tui/nmtui-hostname.c:114
-#, c-format
-msgid "Set hostname to '%s'"
-msgstr "Изменить Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð° на «%s»"
+#~ msgid "WCDMA 3GPP UMTS 2600 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 2600 МГц, "
-#: ../tui/nmtui-hostname.c:116
-#, c-format
-msgid "Unable to set hostname: %s"
-msgstr "Ðе удалоÑÑŒ уÑтановить Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°: %s"
+#~ msgid "'%s' is not valid (use <dest IP>/prefix <next-hop IP> [metric])"
+#~ msgstr ""
+#~ "ÐедейÑтвительное значение «%s». ДопуÑтимый формат: <целевой_ip>/Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ "
+#~ "<ip_перехода> [метрика]."
-#: ../tui/nmtui.c:59 ../tui/nmtui.c:62
-msgid "connection"
-msgstr "Ñоединение"
+#~ msgid "'%s' doesn't match the virtual interface name '%s'"
+#~ msgstr "«%s» не ÑоответÑтвует виртуальному интерфейÑу «%s»."
-#: ../tui/nmtui.c:60
-msgid "Edit a connection"
-msgstr "Изменить Ñоединение"
+#~ msgid "IPv4 configuration is not allowed for slave"
+#~ msgstr "Ð”Ð»Ñ Ð¿Ð¾Ð´Ñ‡Ð¸Ð½ÐµÐ½Ð½Ñ‹Ñ… интерфейÑов Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать конфигурацию IPv4"
-#: ../tui/nmtui.c:63
-msgid "Activate a connection"
-msgstr "ПодключитьÑÑ"
+#~ msgid "IPv6 configuration is not allowed for slave"
+#~ msgstr "Ð”Ð»Ñ Ð¿Ð¾Ð´Ñ‡Ð¸Ð½ÐµÐ½Ð½Ñ‹Ñ… интерфейÑов Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать конфигурацию IPv6"
-#: ../tui/nmtui.c:65
-msgid "new hostname"
-msgstr "новое Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°"
+#~ msgid "Invalid option. Please use --help to see a list of valid options.\n"
+#~ msgstr ""
+#~ "Ðеверный параметр. ИÑпользуйте --help Ð´Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° ÑпиÑка возможных "
+#~ "параметров.\n"
-#: ../tui/nmtui.c:66
-msgid "Set system hostname"
-msgstr "Измените Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°"
+#~ msgid "error occurred while waiting for data on socket"
+#~ msgstr "произошла ошибка при ожидании данных из Ñокета"
-#: ../tui/nmtui.c:89
-msgid "NetworkManager TUI"
-msgstr "TUI NetworkManager"
+#~ msgid "error processing netlink message: %s"
+#~ msgstr "ошибка обработки ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ netlink: %s"
-#: ../tui/nmtui.c:97
-msgid "Please select an option"
-msgstr "Выберите вариант"
+#~ msgid "unable to connect to netlink for monitoring link status: %s"
+#~ msgstr ""
+#~ "не удалоÑÑŒ подключитьÑÑ Ðº netlink Ð´Ð»Ñ Ð¾Ñ‚ÑÐ»ÐµÐ¶Ð¸Ð²Ð°Ð½Ð¸Ñ ÑоÑтоÑÐ½Ð¸Ñ ÑоединениÑ: "
+#~ "%s"
-#: ../tui/nmtui.c:154
-msgid "Usage"
-msgstr "ИÑпользование"
+#~ msgid "unable to enable netlink handle credential passing: %s"
+#~ msgstr "не удалоÑÑŒ включить передачу мандата идентификатора netlink: %s"
-#: ../tui/nmtui.c:221
-msgid "Could not parse arguments"
-msgstr "Ðе удалоÑÑŒ обработать аргументы"
+#~ msgid "unable to allocate netlink handle for monitoring link status: %s"
+#~ msgstr ""
+#~ "не удалоÑÑŒ Ñоздать идентификатор netlink Ð´Ð»Ñ Ð¾Ñ‚ÑÐ»ÐµÐ¶Ð¸Ð²Ð°Ð½Ð¸Ñ ÑоÑтоÑÐ½Ð¸Ñ "
+#~ "ÑоединениÑ: %s"
-#: ../tui/nmtui.c:229
-msgid "NetworkManager is not running."
-msgstr "NetworkManager не работает."
+#~ msgid "unable to join netlink group: %s"
+#~ msgstr "не удалоÑÑŒ войти в группу netlink: %s"
diff --git a/po/sv.po b/po/sv.po
index c617da6e68..0e4323119d 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -2,496 +2,563 @@
# Copyright © 2004-2014 Free Software Foundation, Inc.
# Christian Rose <menthos@menthos.com>, 2004, 2005, 2006.
# Daniel Nylander <po@danielnylander.se>, 2006, 2008, 2009, 2010, 2012.
-# Josef Andersson <josef.andersson@fripost.org>, 2014.
-#
+# Josef Andersson <josef.andersson@fripost.org>, 2014, 2015.
msgid ""
msgstr ""
"Project-Id-Version: NetworkManager\n"
-"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
-"product=NetworkManager&keywords=I18N+L10N&component=Translations\n"
-"POT-Creation-Date: 2014-10-27 23:12+0000\n"
-"PO-Revision-Date: 2014-10-26 16:03+0100\n"
+"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&keywords=I18N+L10N&component=Translations\n"
+"POT-Creation-Date: 2015-02-16 23:23+0000\n"
+"PO-Revision-Date: 2015-02-22 00:10+0100\n"
"Last-Translator: Josef Andersson <josef.andersson@fripost.org>\n"
-"Language-Team: Svenska <tp-sv@listor.tp-sv.se>\n"
+"Language-Team: Swedish\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Gtranslator 2.91.6\n"
+"X-Generator: Poedit 1.5.4\n"
+"X-Project-Style: gnome\n"
-#: ../clients/cli/common.c:38 ../clients/cli/common.c:50
-#: ../clients/cli/common.c:58 ../clients/cli/common.c:69
-#: ../clients/cli/connections.c:170 ../clients/cli/connections.c:192
+#: ../clients/cli/agent.c:42
+#, c-format
+msgid ""
+"Usage: nmcli agent { COMMAND | help }\n"
+"\n"
+"COMMAND := { secret | polkit | all }\n"
+"\n"
+msgstr ""
+"Användning: nmcli agent { KOMMANDO | help }\n"
+"\n"
+"KOMMANDO := { secret | polkit | all }\n"
+
+#: ../clients/cli/agent.c:50
+#, c-format
+msgid ""
+"Usage: nmcli agent secret { help }\n"
+"\n"
+"Runs nmcli as NetworkManager secret agent. When NetworkManager requires\n"
+"a password it asks registered agents for it. This command keeps nmcli running\n"
+"and if a password is required asks the user for it.\n"
+"\n"
+msgstr ""
+"Användning: nmcli agent secret { help }\n"
+"\n"
+"Kör nmcli som en hemlig agent för Nätverkshanteraren. När Nätverkshanteraren kräver ett lösenord frågar den efter dess registrerade agenter. Detta kommando håller nmcli körandes,\n"
+"och om ett lösenord begärs frågas användaren om det.\n"
+"\n"
+
+#: ../clients/cli/agent.c:60
+#, c-format
+msgid ""
+"Usage: nmcli agent polkit { help }\n"
+"\n"
+"Registers nmcli as a polkit action for the user session.\n"
+"When a polkit daemon requires an authorization, nmcli asks the user and gives\n"
+"the response back to polkit.\n"
+"\n"
+msgstr ""
+"Användning: nmcli agent polkit { help }\n"
+"\n"
+"Registrerar nmcli some en polkit-åtgärd för dess användarsession.\n"
+"När en polkit-demon begär behörighet frågar nmcli användaren och ger\n"
+"tillbaka svaret till polkit.\n"
+"\n"
+
+#: ../clients/cli/agent.c:70
+#, c-format
+msgid ""
+"Usage: nmcli agent all { help }\n"
+"\n"
+"Runs nmcli as both NetworkManager secret and a polkit agent.\n"
+"\n"
+msgstr ""
+"Användning: nmcli agent all { help }\n"
+"\n"
+"Kör nmcli som både hemlig Nätverkshanterare och en polkit-agent.\n"
+"\n"
+
+#: ../clients/cli/agent.c:152
+#, c-format
+msgid "nmcli successfully registered as a NetworkManager's secret agent.\n"
+msgstr "nmcli registrerades som en hemlig Nätverkshanteraragent.\n"
+
+#: ../clients/cli/agent.c:154
+#, c-format
+msgid "Error: secret agent initialization failed"
+msgstr "Fel: misslyckades med initiering av hemlig agent"
+
+#: ../clients/cli/agent.c:169
+#, c-format
+msgid "Error: polkit agent initialization failed: %s"
+msgstr "Fel: Initiering av polkit-agent misslyckades: %s"
+
+#: ../clients/cli/agent.c:177
+#, c-format
+msgid "nmcli successfully registered as a polkit agent.\n"
+msgstr "nmcli registrerade en polkit-agent.\n"
+
+#: ../clients/cli/agent.c:209 ../clients/cli/connections.c:8784
+#: ../clients/cli/connections.c:8810 ../clients/cli/connections.c:8948
+#: ../clients/cli/devices.c:2832 ../clients/cli/general.c:325
+#: ../clients/cli/general.c:463
+#, c-format
+msgid "Error: NetworkManager is not running."
+msgstr "Fel: Nätverkshanteraren är inte igång."
+
+#: ../clients/cli/agent.c:245
+#, c-format
+msgid "Error: 'agent' command '%s' is not valid."
+msgstr "Fel: â€agentâ€-kommandot â€%s†är inte giltigt."
+
+#: ../clients/cli/common.c:40 ../clients/cli/common.c:53
+#: ../clients/cli/common.c:61 ../clients/cli/common.c:73
+#: ../clients/cli/connections.c:172 ../clients/cli/connections.c:194
msgid "GROUP"
msgstr "GRUPP"
#. 0
-#: ../clients/cli/common.c:39 ../clients/cli/common.c:59
+#: ../clients/cli/common.c:41 ../clients/cli/common.c:62
msgid "ADDRESS"
msgstr "ADRESS"
#. 1
-#: ../clients/cli/common.c:40 ../clients/cli/common.c:60
+#. 2
+#: ../clients/cli/common.c:42 ../clients/cli/common.c:63
+#: ../clients/cli/connections.c:197
+msgid "GATEWAY"
+msgstr "GATEWAY"
+
+#. 2
+#: ../clients/cli/common.c:43 ../clients/cli/common.c:64
msgid "ROUTE"
msgstr "RUTT"
-#. 2
-#: ../clients/cli/common.c:41 ../clients/cli/common.c:61
+#. 3
+#: ../clients/cli/common.c:44 ../clients/cli/common.c:65
msgid "DNS"
msgstr "DNS"
-#. 3
-#: ../clients/cli/common.c:42 ../clients/cli/common.c:62
+#. 4
+#: ../clients/cli/common.c:45 ../clients/cli/common.c:66
msgid "DOMAIN"
msgstr "DOMÄN"
-#. 4
-#: ../clients/cli/common.c:43
+#. 5
+#: ../clients/cli/common.c:46
msgid "WINS"
msgstr "WINS"
#. 0
-#: ../clients/cli/common.c:51 ../clients/cli/common.c:70
+#: ../clients/cli/common.c:54 ../clients/cli/common.c:74
msgid "OPTION"
msgstr "FLAGGA"
-#: ../clients/cli/common.c:377 ../clients/cli/settings.c:3078
-#: ../clients/cli/settings.c:3097
-#, c-format
-msgid "invalid IPv4 address '%s'"
-msgstr "ogiltig IPv4-adress â€%sâ€"
-
-#: ../clients/cli/common.c:385
-#, c-format
-msgid "invalid prefix '%s'; <1-32> allowed"
-msgstr "ogiltigt prefix â€%sâ€; <1-32> tillÃ¥tet"
-
-#: ../clients/cli/common.c:392 ../clients/cli/common.c:445
-#, c-format
-msgid "invalid gateway '%s'"
-msgstr "ogiltig gateway â€%sâ€"
-
-#: ../clients/cli/common.c:430 ../clients/cli/settings.c:3424
-#: ../clients/cli/settings.c:3443
-#, c-format
-msgid "invalid IPv6 address '%s'"
-msgstr "ogiltig IPv6-adress â€%sâ€"
-
-#: ../clients/cli/common.c:438
-#, c-format
-msgid "invalid prefix '%s'; <1-128> allowed"
-msgstr "ogiltigt prefix â€%sâ€; <1-128> tillÃ¥tet"
-
-#: ../clients/cli/common.c:521
-#, c-format
-msgid "invalid route destination address '%s'"
-msgstr "ogiltig destinationsadress för rutten â€%sâ€"
-
-#: ../clients/cli/common.c:528
+#: ../clients/cli/common.c:378 ../clients/cli/common.c:438
#, c-format
msgid "invalid prefix '%s'; <1-%d> allowed"
msgstr "ogiltigt prefix â€%sâ€; <1-%d> tillÃ¥tet"
-#: ../clients/cli/common.c:538
+#: ../clients/cli/common.c:386
#, c-format
-msgid "invalid next hop address '%s'"
-msgstr "ogiltigt nästa-hoppadress â€%sâ€"
+msgid "invalid IP address: %s"
+msgstr "ogiltig IP-adress â€%sâ€"
-#: ../clients/cli/common.c:543
+#: ../clients/cli/common.c:450
#, c-format
-msgid ""
-"the second component of route ('%s') is neither a next hop address nor a "
-"metric"
-msgstr ""
-"andra komponenten pÃ¥ rutten (â€%sâ€) är varken nästa hoppadress eller ett "
-"mätvärde"
+msgid "the second component of route ('%s') is neither a next hop address nor a metric"
+msgstr "andra komponenten pÃ¥ rutten (â€%sâ€) är varken nästa hoppadress eller ett mätvärde"
-#: ../clients/cli/common.c:553
+#: ../clients/cli/common.c:459
#, c-format
msgid "invalid metric '%s'"
msgstr "ogiltigt mätvärde â€%sâ€"
-#: ../clients/cli/common.c:562
+#: ../clients/cli/common.c:467
+#, c-format
+msgid "invalid route: %s"
+msgstr "ogiltig rutt: â€%sâ€"
+
+#: ../clients/cli/common.c:479
msgid "default route cannot be added (NetworkManager handles it by itself)"
-msgstr ""
-"standardrutten kan inte läggas till (Nätverkshanteraren klarar det själv)"
+msgstr "standardrutten kan inte läggas till (Nätverkshanteraren klarar det själv)"
-#: ../clients/cli/common.c:650
+#: ../clients/cli/common.c:496
msgid "unmanaged"
msgstr "ohanterad"
-#: ../clients/cli/common.c:652
+#: ../clients/cli/common.c:498
msgid "unavailable"
msgstr "otillgänglig"
-#: ../clients/cli/common.c:654 ../clients/cli/general.c:259
+#: ../clients/cli/common.c:500 ../clients/cli/general.c:260
msgid "disconnected"
msgstr "frånkopplad"
-#: ../clients/cli/common.c:656
+#: ../clients/cli/common.c:502
msgid "connecting (prepare)"
msgstr "ansluter (förbereder)"
-#: ../clients/cli/common.c:658
+#: ../clients/cli/common.c:504
msgid "connecting (configuring)"
msgstr "ansluter (konfigurerar)"
-#: ../clients/cli/common.c:660
+#: ../clients/cli/common.c:506
msgid "connecting (need authentication)"
msgstr "ansluter (behöver autentisering)"
-#: ../clients/cli/common.c:662
+#: ../clients/cli/common.c:508
msgid "connecting (getting IP configuration)"
msgstr "ansluter (hämtar IP-konfiguration)"
-#: ../clients/cli/common.c:664
+#: ../clients/cli/common.c:510
msgid "connecting (checking IP connectivity)"
msgstr "ansluter (kontrollerar IP-anslutning)"
-#: ../clients/cli/common.c:666
+#: ../clients/cli/common.c:512
msgid "connecting (starting secondary connections)"
msgstr "ansluter (startar sekundära anslutningar)"
-#: ../clients/cli/common.c:668 ../clients/cli/general.c:255
+#: ../clients/cli/common.c:514 ../clients/cli/general.c:256
msgid "connected"
msgstr "ansluten"
-#: ../clients/cli/common.c:670 ../clients/cli/connections.c:534
+#: ../clients/cli/common.c:516 ../clients/cli/connections.c:538
msgid "deactivating"
msgstr "inaktiverar"
-#: ../clients/cli/common.c:672
+#: ../clients/cli/common.c:518
msgid "connection failed"
msgstr "anslutningen misslyckades"
-#: ../clients/cli/common.c:674 ../clients/cli/connections.c:539
-#: ../clients/cli/connections.c:562 ../clients/cli/connections.c:1674
-#: ../clients/cli/devices.c:877 ../clients/cli/general.c:262
-#: ../clients/cli/general.c:280 ../clients/cli/general.c:410
-#: ../clients/cli/general.c:426 ../clients/cli/settings.c:704
-#: ../clients/cli/settings.c:766 ../clients/cli/settings.c:1059
-#: ../clients/cli/utils.c:1123 ../src/main.c:509 ../src/main.c:537
+#: ../clients/cli/common.c:520 ../clients/cli/connections.c:543
+#: ../clients/cli/connections.c:566 ../clients/cli/connections.c:1705
+#: ../clients/cli/devices.c:878 ../clients/cli/general.c:263
+#: ../clients/cli/general.c:281 ../clients/cli/general.c:411
+#: ../clients/cli/general.c:427 ../clients/cli/settings.c:719
+#: ../clients/cli/settings.c:781 ../clients/cli/settings.c:1074
+#: ../clients/cli/utils.c:1145 ../src/main.c:315 ../src/main.c:343
msgid "unknown"
msgstr "okänd"
-#: ../clients/cli/common.c:683
+#: ../clients/cli/common.c:529
msgid "No reason given"
msgstr "Ingen anledning angiven"
-#: ../clients/cli/common.c:686 ../clients/cli/connections.c:2444
+#: ../clients/cli/common.c:532 ../clients/cli/connections.c:2705
#, c-format
msgid "Unknown error"
msgstr "Okänt fel"
-#: ../clients/cli/common.c:689
+#: ../clients/cli/common.c:535
msgid "Device is now managed"
msgstr "Enheten är nu hanterad"
-#: ../clients/cli/common.c:692
+#: ../clients/cli/common.c:538
msgid "Device is now unmanaged"
msgstr "Enheten är nu ohanterad"
-#: ../clients/cli/common.c:695
+#: ../clients/cli/common.c:541
msgid "The device could not be readied for configuration"
msgstr "Enheten kunde inte göras redo för konfiguration"
-#: ../clients/cli/common.c:698
-msgid ""
-"IP configuration could not be reserved (no available address, timeout, etc.)"
-msgstr ""
-"IP-konfigurationen kunde inte reserveras (ingen tillgänglig adress, "
-"tidsgräns, etc.)"
+#: ../clients/cli/common.c:544
+msgid "IP configuration could not be reserved (no available address, timeout, etc.)"
+msgstr "IP-konfigurationen kunde inte reserveras (ingen tillgänglig adress, tidsgräns, etc.)"
-#: ../clients/cli/common.c:701
+#: ../clients/cli/common.c:547
msgid "The IP configuration is no longer valid"
msgstr "IP-konfigurationen är inte längre giltig"
-#: ../clients/cli/common.c:704
+#: ../clients/cli/common.c:550
msgid "Secrets were required, but not provided"
msgstr "Hemligheter krävdes men tillhandahölls ej"
-#: ../clients/cli/common.c:707
+#: ../clients/cli/common.c:553
msgid "802.1X supplicant disconnected"
msgstr "802.1X-supplikanten kopplade från"
-#: ../clients/cli/common.c:710
+#: ../clients/cli/common.c:556
msgid "802.1X supplicant configuration failed"
msgstr "Konfiguration av 802.1X-supplikanten misslyckades"
-#: ../clients/cli/common.c:713
+#: ../clients/cli/common.c:559
msgid "802.1X supplicant failed"
msgstr "802.1X-supplikanten misslyckades"
-#: ../clients/cli/common.c:716
+#: ../clients/cli/common.c:562
msgid "802.1X supplicant took too long to authenticate"
msgstr "802.1X-supplikanten tog för lång tid att autentisera"
-#: ../clients/cli/common.c:719
+#: ../clients/cli/common.c:565
msgid "PPP service failed to start"
msgstr "PPP-tjänsten misslyckades med att starta"
-#: ../clients/cli/common.c:722
+#: ../clients/cli/common.c:568
msgid "PPP service disconnected"
msgstr "PPP-tjänsten kopplades från"
-#: ../clients/cli/common.c:725
+#: ../clients/cli/common.c:571
msgid "PPP failed"
msgstr "PPP misslyckades"
-#: ../clients/cli/common.c:728
+#: ../clients/cli/common.c:574
msgid "DHCP client failed to start"
msgstr "DHCP-klienten misslyckades med att starta"
-#: ../clients/cli/common.c:731
+#: ../clients/cli/common.c:577
msgid "DHCP client error"
msgstr "Fel i DHCP-klienten"
-#: ../clients/cli/common.c:734
+#: ../clients/cli/common.c:580
msgid "DHCP client failed"
msgstr "DHCP-klienten misslyckades"
-#: ../clients/cli/common.c:737
+#: ../clients/cli/common.c:583
msgid "Shared connection service failed to start"
msgstr "Tjänsten för delad anslutning misslyckades med att starta"
-#: ../clients/cli/common.c:740
+#: ../clients/cli/common.c:586
msgid "Shared connection service failed"
msgstr "Tjänsten för delad anslutning misslyckades"
-#: ../clients/cli/common.c:743
+#: ../clients/cli/common.c:589
msgid "AutoIP service failed to start"
msgstr "AutoIP-tjänsten misslyckades med att starta"
-#: ../clients/cli/common.c:746
+#: ../clients/cli/common.c:592
msgid "AutoIP service error"
msgstr "Fel i AutoIP-tjänsten"
-#: ../clients/cli/common.c:749
+#: ../clients/cli/common.c:595
msgid "AutoIP service failed"
msgstr "AutoIP-tjänsten misslyckades"
-#: ../clients/cli/common.c:752
+#: ../clients/cli/common.c:598
msgid "The line is busy"
msgstr "Linjen är upptagen"
-#: ../clients/cli/common.c:755
+#: ../clients/cli/common.c:601
msgid "No dial tone"
msgstr "Ingen rington"
-#: ../clients/cli/common.c:758
+#: ../clients/cli/common.c:604
msgid "No carrier could be established"
msgstr "Ingen bärare kunde etableras"
-#: ../clients/cli/common.c:761
+#: ../clients/cli/common.c:607
msgid "The dialing request timed out"
msgstr "Uppringningsbegäran översteg tidsgränsen"
-#: ../clients/cli/common.c:764
+#: ../clients/cli/common.c:610
msgid "The dialing attempt failed"
msgstr "Uppringningsförsöket misslyckades"
-#: ../clients/cli/common.c:767
+#: ../clients/cli/common.c:613
msgid "Modem initialization failed"
msgstr "Initiering av modem misslyckades"
-#: ../clients/cli/common.c:770
+#: ../clients/cli/common.c:616
msgid "Failed to select the specified APN"
msgstr "Misslyckades med att välja angiven APN"
-#: ../clients/cli/common.c:773
+#: ../clients/cli/common.c:619
msgid "Not searching for networks"
msgstr "Söker inte efter nätverk"
-#: ../clients/cli/common.c:776
+#: ../clients/cli/common.c:622
msgid "Network registration denied"
msgstr "Nätverksregistreringen nekades"
-#: ../clients/cli/common.c:779
+#: ../clients/cli/common.c:625
msgid "Network registration timed out"
msgstr "Tidsgränsen för nätverksregistrering överstegs"
-#: ../clients/cli/common.c:782
+#: ../clients/cli/common.c:628
msgid "Failed to register with the requested network"
msgstr "Misslyckades med att registrera mot det begärda nätverket"
-#: ../clients/cli/common.c:785
+#: ../clients/cli/common.c:631
msgid "PIN check failed"
msgstr "Kontroll av PIN-kod misslyckades"
-#: ../clients/cli/common.c:788
+#: ../clients/cli/common.c:634
msgid "Necessary firmware for the device may be missing"
msgstr "Nödvändig fast programvara för enheten kanske saknas"
-#: ../clients/cli/common.c:791
+#: ../clients/cli/common.c:637
msgid "The device was removed"
msgstr "Enheten togs bort"
-#: ../clients/cli/common.c:794
+#: ../clients/cli/common.c:640
msgid "NetworkManager went to sleep"
msgstr "Nätverkshanteraren somnade"
-#: ../clients/cli/common.c:797
+#: ../clients/cli/common.c:643
msgid "The device's active connection disappeared"
msgstr "Enhetens aktiva anslutning försvann"
-#: ../clients/cli/common.c:800
+#: ../clients/cli/common.c:646
msgid "Device disconnected by user or client"
msgstr "Enheten kopplades från av användare eller klient"
-#: ../clients/cli/common.c:803
+#: ../clients/cli/common.c:649
msgid "Carrier/link changed"
msgstr "Bärare/länk ändrades"
-#: ../clients/cli/common.c:806
+#: ../clients/cli/common.c:652
msgid "The device's existing connection was assumed"
msgstr "Enhetens befintliga anslutning antogs"
-#: ../clients/cli/common.c:809
+#: ../clients/cli/common.c:655
msgid "The supplicant is now available"
msgstr "Supplikanten finns nu tillgänglig"
-#: ../clients/cli/common.c:812
+#: ../clients/cli/common.c:658
msgid "The modem could not be found"
msgstr "Modemet kunde inte hittas"
-#: ../clients/cli/common.c:815
+#: ../clients/cli/common.c:661
msgid "The Bluetooth connection failed or timed out"
msgstr "Bluetoothanslutningen misslyckades eller översteg tidsgränsen"
-#: ../clients/cli/common.c:818
+#: ../clients/cli/common.c:664
msgid "GSM Modem's SIM card not inserted"
msgstr "SIM-kortet i GSM-modemet är inte anslutet"
-#: ../clients/cli/common.c:821
+#: ../clients/cli/common.c:667
msgid "GSM Modem's SIM PIN required"
msgstr "PIN-kod för SIM-kortet i GSM-modemet krävs"
-#: ../clients/cli/common.c:824
+#: ../clients/cli/common.c:670
msgid "GSM Modem's SIM PUK required"
msgstr "PUK-kod för SIM-kortet i GSM-modemet krävs"
-#: ../clients/cli/common.c:827
+#: ../clients/cli/common.c:673
msgid "GSM Modem's SIM wrong"
msgstr "SIM-kortet i GSM-modemet är felaktigt"
-#: ../clients/cli/common.c:830
+#: ../clients/cli/common.c:676
msgid "InfiniBand device does not support connected mode"
msgstr "InfiniBand-enheten saknar stöd för anslutet läge"
-#: ../clients/cli/common.c:833
+#: ../clients/cli/common.c:679
msgid "A dependency of the connection failed"
msgstr "Ett beroende till anslutningen misslyckades"
-#: ../clients/cli/common.c:836
+#: ../clients/cli/common.c:682
msgid "A problem with the RFC 2684 Ethernet over ADSL bridge"
msgstr "Ett problem med RFC 2684 över ADSL-brygga"
-#: ../clients/cli/common.c:839
+#: ../clients/cli/common.c:685
msgid "ModemManager is unavailable"
msgstr "ModemManager är inte tillgängligt"
-#: ../clients/cli/common.c:842
+#: ../clients/cli/common.c:688
msgid "The Wi-Fi network could not be found"
msgstr "Trådlösa nätverket kunde inte hittas"
-#: ../clients/cli/common.c:845
+#: ../clients/cli/common.c:691
msgid "A secondary connection of the base connection failed"
msgstr "En sekundär anslutning för basanslutningen misslyckades"
-#: ../clients/cli/common.c:848
+#: ../clients/cli/common.c:694
msgid "DCB or FCoE setup failed"
msgstr "DCB eller FCoE-inställning misslyckades"
-#: ../clients/cli/common.c:851
+#: ../clients/cli/common.c:697
msgid "teamd control failed"
msgstr "teamd-kontroll misslyckades"
-#: ../clients/cli/common.c:854
+#: ../clients/cli/common.c:700
msgid "Modem failed or no longer available"
msgstr "Modemet misslyckades eller är inte tillgängligt längre"
-#: ../clients/cli/common.c:857
+#: ../clients/cli/common.c:703
msgid "Modem now ready and available"
msgstr "Modemet redo och tillgängligt"
-#: ../clients/cli/common.c:860
+#: ../clients/cli/common.c:706
msgid "SIM PIN was incorrect"
msgstr "SIM PIN var felaktig"
#. TRANSLATORS: Unknown reason for a device state change (NMDeviceStateReason)
-#: ../clients/cli/common.c:864 ../clients/cli/devices.c:616
-#: ../libnm-glib/nm-device.c:1812 ../libnm/nm-device.c:1622
+#: ../clients/cli/common.c:710 ../clients/cli/devices.c:619
+#: ../libnm-glib/nm-device.c:1813 ../libnm/nm-device.c:1635
msgid "Unknown"
msgstr "Okänd"
-#: ../clients/cli/common.c:906
+#: ../clients/cli/common.c:752
#, c-format
msgid "invalid priority map '%s'"
msgstr "ogiltig prioritetshash â€%sâ€"
-#: ../clients/cli/common.c:913 ../clients/cli/common.c:919
+#: ../clients/cli/common.c:759 ../clients/cli/common.c:765
#, c-format
msgid "priority '%s' is not valid (<0-%ld>)"
msgstr "prioriteten â€%s†är inte giltig (<0-%ld>)"
-#: ../clients/cli/common.c:986
+#: ../clients/cli/common.c:832
#, c-format
msgid "'%s' is not a valid team configuration or file name."
-msgstr "â€%s†är inte en giltig teamkonfiguration eller ett giltigt filnamn,"
+msgstr "â€%s†är inte en giltig teamkonfiguration eller ett giltigt filnamn."
+
+#: ../clients/cli/common.c:933
+#, c-format
+msgid "Warning: password for '%s' not given in 'passwd-file' and nmcli cannot ask without '--ask' option.\n"
+msgstr "Varning: Lösenord för â€%s†inte angivet i â€passwd-file†och nmcli kan inte frÃ¥ga utan alternativet â€--askâ€.\n"
#. define some prompts for connection editor
-#: ../clients/cli/connections.c:40
+#: ../clients/cli/connections.c:42
msgid "Setting name? "
msgstr "Inställningsnamn? "
-#: ../clients/cli/connections.c:41
+#: ../clients/cli/connections.c:43
msgid "Property name? "
msgstr "Egenskapsnamn? "
-#: ../clients/cli/connections.c:42
+#: ../clients/cli/connections.c:44
msgid "Enter connection type: "
msgstr "Ange anslutningstyp: "
#. define some other prompts
-#: ../clients/cli/connections.c:45
+#: ../clients/cli/connections.c:47
msgid "Connection type: "
msgstr "Anslutningstyp: "
-#: ../clients/cli/connections.c:46
+#: ../clients/cli/connections.c:48
msgid "VPN type: "
msgstr "VPN-typ: "
-#: ../clients/cli/connections.c:47
+#: ../clients/cli/connections.c:49
msgid "Bond master: "
msgstr "Master för kombination: "
-#: ../clients/cli/connections.c:48
+#: ../clients/cli/connections.c:50
msgid "Team master: "
msgstr "Master för grupp: "
-#: ../clients/cli/connections.c:49
+#: ../clients/cli/connections.c:51
msgid "Bridge master: "
msgstr "Master för brygga: "
-#: ../clients/cli/connections.c:50
+#: ../clients/cli/connections.c:52
msgid "Connection (name, UUID, or path): "
msgstr "Anslutning (namn, UUID eller sökväg): "
#. 0
-#: ../clients/cli/connections.c:58 ../clients/cli/connections.c:171
-#: ../clients/cli/devices.c:55 ../clients/cli/devices.c:84
-#: ../clients/cli/devices.c:94 ../clients/cli/devices.c:105
-#: ../clients/cli/devices.c:114 ../clients/cli/devices.c:129
-#: ../clients/cli/devices.c:142 ../clients/cli/devices.c:168
-#: ../clients/cli/devices.c:183 ../clients/cli/devices.c:192
-#: ../clients/cli/devices.c:201
+#: ../clients/cli/connections.c:60 ../clients/cli/connections.c:173
+#: ../clients/cli/devices.c:57 ../clients/cli/devices.c:86
+#: ../clients/cli/devices.c:96 ../clients/cli/devices.c:107
+#: ../clients/cli/devices.c:116 ../clients/cli/devices.c:131
+#: ../clients/cli/devices.c:144 ../clients/cli/devices.c:170
+#: ../clients/cli/devices.c:185 ../clients/cli/devices.c:194
+#: ../clients/cli/devices.c:204
msgid "NAME"
msgstr "NAMN"
#. 0
#. 1
-#: ../clients/cli/connections.c:59 ../clients/cli/connections.c:172
+#: ../clients/cli/connections.c:61 ../clients/cli/connections.c:174
msgid "UUID"
msgstr "UUID"
@@ -499,35 +566,35 @@ msgstr "UUID"
#. 0
#. 1
#. 2
-#: ../clients/cli/connections.c:60 ../clients/cli/connections.c:193
-#: ../clients/cli/devices.c:41 ../clients/cli/devices.c:57
-#: ../clients/cli/devices.c:171
+#: ../clients/cli/connections.c:62 ../clients/cli/connections.c:195
+#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:59
+#: ../clients/cli/devices.c:173
msgid "TYPE"
msgstr "TYP"
#. 2
-#: ../clients/cli/connections.c:61
+#: ../clients/cli/connections.c:63
msgid "TIMESTAMP"
msgstr "TIDSSTÄMPEL"
#. 3
-#: ../clients/cli/connections.c:62
+#: ../clients/cli/connections.c:64
msgid "TIMESTAMP-REAL"
msgstr "TIDSSTÄMPEL-REELL"
#. 4
#. 15
-#: ../clients/cli/connections.c:63 ../clients/cli/devices.c:71
+#: ../clients/cli/connections.c:65 ../clients/cli/devices.c:73
msgid "AUTOCONNECT"
msgstr "AUTOANSLUT"
#. 5
-#: ../clients/cli/connections.c:64
+#: ../clients/cli/connections.c:66
msgid "AUTOCONNECT-PRIORITY"
msgstr "AUTOANSLUT-PRIORITET"
#. 6
-#: ../clients/cli/connections.c:65
+#: ../clients/cli/connections.c:67
msgid "READONLY"
msgstr "SKRIVSKYDDAD"
@@ -536,17 +603,17 @@ msgstr "SKRIVSKYDDAD"
#. 2
#. 15
#. 5
-#: ../clients/cli/connections.c:66 ../clients/cli/connections.c:179
-#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:158
-#: ../clients/cli/devices.c:174
+#: ../clients/cli/connections.c:68 ../clients/cli/connections.c:181
+#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:160
+#: ../clients/cli/devices.c:176
msgid "DBUS-PATH"
msgstr "DBUS-SÖKVÄG"
#. 8
#. 13
#. 4
-#: ../clients/cli/connections.c:67 ../clients/cli/devices.c:156
-#: ../clients/cli/devices.c:173
+#: ../clients/cli/connections.c:69 ../clients/cli/devices.c:158
+#: ../clients/cli/devices.c:175
msgid "ACTIVE"
msgstr "AKTIV"
@@ -554,9 +621,9 @@ msgstr "AKTIV"
#. 0
#. 12
#. 3
-#: ../clients/cli/connections.c:68 ../clients/cli/devices.c:40
-#: ../clients/cli/devices.c:56 ../clients/cli/devices.c:155
-#: ../clients/cli/devices.c:172
+#: ../clients/cli/connections.c:70 ../clients/cli/devices.c:42
+#: ../clients/cli/devices.c:58 ../clients/cli/devices.c:157
+#: ../clients/cli/devices.c:174
msgid "DEVICE"
msgstr "ENHET"
@@ -565,137 +632,130 @@ msgstr "ENHET"
#. 1
#. 9
#. 1
-#: ../clients/cli/connections.c:69 ../clients/cli/connections.c:174
-#: ../clients/cli/devices.c:42 ../clients/cli/devices.c:65
-#: ../clients/cli/general.c:36
+#: ../clients/cli/connections.c:71 ../clients/cli/connections.c:176
+#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:67
+#: ../clients/cli/general.c:37
msgid "STATE"
msgstr "TILLSTÃ…ND"
#. 11
-#: ../clients/cli/connections.c:70
+#: ../clients/cli/connections.c:72
msgid "ACTIVE-PATH"
msgstr "AKTIV-SÖKVÄG"
#. 2
-#: ../clients/cli/connections.c:173
+#: ../clients/cli/connections.c:175
msgid "DEVICES"
msgstr "ENHETER"
#. 4
-#: ../clients/cli/connections.c:175
+#: ../clients/cli/connections.c:177
msgid "DEFAULT"
msgstr "STANDARD"
#. 5
-#: ../clients/cli/connections.c:176
+#: ../clients/cli/connections.c:178
msgid "DEFAULT6"
msgstr "STANDARD6"
#. 6
-#: ../clients/cli/connections.c:177
+#: ../clients/cli/connections.c:179
msgid "SPEC-OBJECT"
msgstr "SPEC-OBJEKT"
#. 7
#. 4
#. Ask for optional 'vpn' arguments.
-#: ../clients/cli/connections.c:178 ../clients/cli/connections.c:216
-#: ../clients/cli/connections.c:3498 ../clients/tui/nm-editor-utils.c:234
-#: ../clients/tui/nmt-connect-connection-list.c:407
+#: ../clients/cli/connections.c:180 ../clients/cli/connections.c:218
+#: ../clients/cli/connections.c:3816 ../clients/tui/nm-editor-utils.c:234
+#: ../clients/tui/nmt-connect-connection-list.c:406
msgid "VPN"
msgstr "VPN"
#. 9
#. 5
#. 19
-#: ../clients/cli/connections.c:180 ../clients/cli/devices.c:46
-#: ../clients/cli/devices.c:75
+#: ../clients/cli/connections.c:182 ../clients/cli/devices.c:48
+#: ../clients/cli/devices.c:77
msgid "CON-PATH"
msgstr "ANS-SÖKV"
#. 10
-#: ../clients/cli/connections.c:181
+#: ../clients/cli/connections.c:183
msgid "ZONE"
msgstr "ZON"
#. 11
-#: ../clients/cli/connections.c:182
+#: ../clients/cli/connections.c:184
msgid "MASTER-PATH"
msgstr "HUVUDSÖKVÄG"
#. 1
-#: ../clients/cli/connections.c:194
+#: ../clients/cli/connections.c:196
msgid "USERNAME"
msgstr "ANVÄNDARNAMN"
-#. 2
-#: ../clients/cli/connections.c:195
-msgid "GATEWAY"
-msgstr "GATEWAY"
-
#. 3
-#: ../clients/cli/connections.c:196
+#: ../clients/cli/connections.c:198
msgid "BANNER"
msgstr "BANDEROLL"
#. 4
-#: ../clients/cli/connections.c:197
+#: ../clients/cli/connections.c:199
msgid "VPN-STATE"
msgstr "VPN-TILLSTÃ…ND"
#. 5
-#: ../clients/cli/connections.c:198
+#: ../clients/cli/connections.c:200
msgid "CFG"
msgstr "KFG"
-#: ../clients/cli/connections.c:211 ../clients/cli/devices.c:216
+#: ../clients/cli/connections.c:213 ../clients/cli/devices.c:219
msgid "GENERAL"
msgstr "ALLMÄNT"
#. 0
#. 6
-#: ../clients/cli/connections.c:212 ../clients/cli/devices.c:223
+#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:226
msgid "IP4"
msgstr "IP4"
#. 1
#. 7
-#: ../clients/cli/connections.c:213 ../clients/cli/devices.c:224
+#: ../clients/cli/connections.c:215 ../clients/cli/devices.c:227
msgid "DHCP4"
msgstr "DHCP4"
#. 2
#. 8
-#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:225
+#: ../clients/cli/connections.c:216 ../clients/cli/devices.c:228
msgid "IP6"
msgstr "IP6"
#. 3
#. 9
-#: ../clients/cli/connections.c:215 ../clients/cli/devices.c:226
+#: ../clients/cli/connections.c:217 ../clients/cli/devices.c:229
msgid "DHCP6"
msgstr "DHCP6"
-#: ../clients/cli/connections.c:249
+#: ../clients/cli/connections.c:251
#, 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 | reload | load }\n"
"\n"
-" show [--active] [[id | uuid | path | apath] <ID>] ...\n"
+" show [--active] [[--show-secrets] [id | uuid | path | apath] <ID>] ...\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] [passwd-file <file with passwords>]\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file <file with passwords>]\n"
"\n"
-" down [id | uuid | path | apath] <ID>\n"
+" down [id | uuid | path | apath] <ID> ...\n"
"\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
"\n"
-" modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> "
-"<value>)+\n"
+" modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> <value>)+\n"
"\n"
" edit [id | uuid | path] <ID>\n"
" edit [type <new_con_type>] [con-name <new_con_name>]\n"
@@ -709,21 +769,19 @@ msgid ""
msgstr ""
"Användning: nmcli connection { KOMMANDO | help }\n"
"\n"
-"KOMMANDO := { show | up | down | add | modify | edit | delete | reload | "
-"load }\n"
+"KOMMANDO := { show | up | down | add | modify | edit | delete | reload | load }\n"
"\n"
-" show [--active] [[id | uuid | path | apath] <ID>] …\n"
+" show [--active] [[--show-secrets] [id | uuid | path | apath] <ID>] ...\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <grnamn>] [ap <BSSID>] [nsp <namn>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] [passwd-file <fil med lösenord>]\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <grnamn>] [ap <BSSID>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file <fil med lösenord>]\n"
"\n"
-" down [id | uuid | path | apath] <ID>\n"
+" down [id | uuid | path | apath] <ID> ...\n"
"\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
"\n"
-" modify [--temporary] [id | uuid | path] <ID> ([+|-]<inställning>."
-"<egenskap> <värde>)+\n"
+" modify [--temporary] [id | uuid | path] <ID> ([+|-]<inställning>.<egenskap> <värde>)+\n"
"\n"
" edit [id | uuid | path] <ID>\n"
" edit [type <new_con_type>] [con-name <new_con_name>]\n"
@@ -735,7 +793,7 @@ msgstr ""
" load <filnamn> [ <filnamn>... ]\n"
"\n"
-#: ../clients/cli/connections.c:270
+#: ../clients/cli/connections.c:272
#, c-format
msgid ""
"Usage: nmcli connection show { ARGUMENTS | help }\n"
@@ -743,73 +801,64 @@ msgid ""
"ARGUMENTS := [--active]\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"
+"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"
"\n"
-"ARGUMENTS := [--active] [id | uuid | path | apath] <ID> ...\n"
+"ARGUMENTS := [--active] [--show-secrets] [id | uuid | path | apath] <ID> ...\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"
+"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.\n"
+"account. --show-secrets option will reveal associated secrets as well.\n"
msgstr ""
"Användning: nmcli connection show { ARGUMENT | help }\n"
"\n"
"ARGUMENT := [--active]\n"
"\n"
"Listar anslutningsprofiler i minnet och på disk, varav några också kan vara\n"
-"aktiva om enheten använder den anslutningsprofilen. Utan en parameter kommer "
-"alla\n"
+"aktiva om enheten använder den anslutningsprofilen. Utan en parameter kommer alla\n"
"profiler att listas. Om flaggan -- active anges kommer endast de aktiva\n"
"profilerna att visas.\n"
"\n"
-"ARGUMENT := [--active] [id | uuid | sökväg | apath] <ID> …\n"
+"ARGUMENT := [--active] [--show-secrets] [id | uuid | sökväg | apath] <ID> …\n"
"\n"
-"Visar detaljer för angivna anslutningar. Som standard visas både statiska "
-"och aktiva\n"
+"Visar detaljer för angivna anslutningar. Som standard visas både statiska och aktiva\n"
"konfigurationer. Det är möjligt att filtrera utdata\n"
"med globala flaggan '--fields'. Se manualen för mer information.\n"
"När flaggan --active anges kommer endast den aktiva profilen att\n"
-"räknas.\n"
+"räknas. Alternativet --show-secrets kommer också att visa associerade hemligheter.\n"
-#: ../clients/cli/connections.c:291
+#: ../clients/cli/connections.c:293
#, c-format
msgid ""
"Usage: nmcli connection up { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
-"<name>]\n"
+"ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp <name>] [passwd-file <file with passwords>]\n"
"\n"
-"Activate a connection on a device. The profile to activate is identified by "
-"its\n"
+"Activate a connection on a device. The profile to activate is identified by its\n"
"name, UUID or D-Bus path.\n"
"\n"
-"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd-file <file with passwords>]\n"
"\n"
"Activate a device with a connection. The connection profile is selected\n"
"automatically by NetworkManager.\n"
"\n"
-"ifname - specifies the device to active the connection on\n"
-"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
-"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"ifname - specifies the device to active the connection on\n"
+"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"passwd-file - file with password(s) required to activate the connection\n"
"\n"
msgstr ""
"Användning: nmcli connection up { ARGUMENT | help }\n"
"\n"
-"ARGUMENT := [id | uuid | path ] <ID> [ifname <grnamn>] [ap <BSSID>] [nsp "
-"<namn>]\n"
+"ARGUMENT := [id | uuid | path ] <ID> [ifname <grnamn>] [ap <BSSID>] [nsp <namn>] [passwd-file <fil med lösenord>]\n"
"\n"
-"Aktivera en anslutning på en enhet. Profilen som ska aktiveras identifieras "
-"genom dess\n"
+"Aktivera en anslutning på en enhet. Profilen som ska aktiveras identifieras genom dess\n"
"namn, UUID eller D-Bus-sökväg.\n"
"\n"
-"ARGUMENT := ifname <grnamn> [ap <BSSID>] [nsp <namn>]\n"
+"ARGUMENT := ifname <grnamn> [ap <BSSID>] [nsp <namn>] [passwd-file <file med lösenord>]\n"
"\n"
"Aktivera en enhet med en anslutning. Anslutningsprofilen väljs\n"
"automatiskt av Nätverkshanteraren.\n"
@@ -817,32 +866,31 @@ msgstr ""
"ifname - anger enhet att aktivera anslutningen på\n"
"ap - anger AP att ansluta till (endast giltig för Wi-Fi)\n"
"nsp - anger NSP att ansluta till (endast giltigt för WiMAX)\n"
+"passwd-file - fil med lösenord som krävs för att aktivera anslutningen\n"
"\n"
-#: ../clients/cli/connections.c:311
+#: ../clients/cli/connections.c:314
#, c-format
msgid ""
"Usage: nmcli connection down { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+"ARGUMENTS := [id | uuid | path | apath] <ID> ...\n"
"\n"
"Deactivate a connection from a device (without preventing the device from\n"
-"further auto-activation). The profile to deactivate is identified by its "
-"name,\n"
+"further auto-activation). The profile to deactivate is identified by its name,\n"
"UUID or D-Bus path.\n"
"\n"
msgstr ""
"Användning: nmcli connection down { ARGUMENT | help }\n"
"\n"
-"ARGUMENT := [id | uuid | path | apath] <ID>\n"
+"ARGUMENT := [id | uuid | path | apath] <ID> ...\n"
"\n"
"Inaktivera en anslutning från en enhet (utan att hindra enheten från\n"
-"vidare autoaktivering). Profilen att inaktivera identifieras genom dess "
-"namn,\n"
+"vidare autoaktivering). Profilen att inaktivera identifieras genom dess namn,\n"
"UUID eller D-Bus-sökväg.\n"
"\n"
-#: ../clients/cli/connections.c:323
+#: ../clients/cli/connections.c:326
#, c-format
msgid ""
"Usage: nmcli connection add { ARGUMENTS | help }\n"
@@ -866,6 +914,7 @@ msgid ""
" [mac <MAC address>]\n"
" [cloned-mac <cloned MAC address>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <MAC address>]\n"
" [nsp <NSP>]\n"
@@ -899,10 +948,8 @@ msgid ""
" [egress <egress priority mapping>]\n"
" [mtu <MTU>]\n"
"\n"
-" bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) "
-"| broadcast (3) |\n"
-" 802.3ad (4) | balance-tlb (5) | balance-alb "
-"(6)]\n"
+" bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) | broadcast (3) |\n"
+" 802.3ad (4) | balance-tlb (5) | balance-alb (6)]\n"
" [primary <ifname>]\n"
" [miimon <num>]\n"
" [downdelay <num>]\n"
@@ -931,8 +978,7 @@ msgid ""
" [path-cost <1-65535>]\n"
" [hairpin yes|no]\n"
"\n"
-" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|"
-"ssh|l2tp|iodine|...\n"
+" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n"
" [user <username>]\n"
"\n"
" olpc-mesh: ssid <SSID>\n"
@@ -946,7 +992,7 @@ msgid ""
msgstr ""
"Användning: nmcli connection add { ARGUMENT | help }\n"
"\n"
-"ARGUMENT := VANLIGA_FLAGGOR TYP_SPECIFIKA_FLAGGOR IP_FLAGGOR\n"
+"ARGUMENT := VANLIGA_FLAGGOR TYPSPECIFIKA_FLAGGOR IP-FLAGGOR\n"
"\n"
" VANLIGA_FLAGGOR:\n"
" type <typ>\n"
@@ -956,7 +1002,7 @@ msgstr ""
"\n"
" [save yes|no]\n"
"\n"
-" TYP_SPECIFIKA_FLAGGOR:\n"
+" TYPSPECIFIKA_FLAGGOR:\n"
" ethernet: [mac <MAC-adress>]\n"
" [cloned-mac <klonad MAC-adress>]\n"
" [mtu <MTU>]\n"
@@ -965,6 +1011,7 @@ msgstr ""
" [mac <MAC-adress>]\n"
" [cloned-mac <klonad MAC-adress>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <MAC-adress>]\n"
" [nsp <NSP>]\n"
@@ -998,10 +1045,8 @@ msgstr ""
" [egress <egress priority mapping>]\n"
" [mtu <MTU>]\n"
"\n"
-" bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) "
-"| broadcast (3) |\n"
-" 802.3ad (4) | balance-tlb (5) | balance-alb "
-"(6)]\n"
+" bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) | broadcast (3) |\n"
+" 802.3ad (4) | balance-tlb (5) | balance-alb (6)]\n"
" [primary <grnamn>]\n"
" [miimon <num>]\n"
" [downdelay <num>]\n"
@@ -1010,14 +1055,12 @@ msgstr ""
" [arp-ip-target <num>]\n"
" [lacp-rate slow (0) | fast (1)]\n"
"\n"
-" bond-slave: master <master (grnamn, eller anslutnings-UUID eller "
-"namn)>\n"
+" bond-slave: master <master (grnamn, eller anslutnings-UUID eller namn)>\n"
"\n"
" team: [config <file>|<rå JSON-data>]\n"
"\n"
-" team-slave: master <master (grnamn, eller anslutnings-UUID eller "
-"namn)>\n"
-" [config <file>|<rå JSON-data>]\n"
+" team-slave: master <master (grnamn, eller anslutnings-UUID eller namn)>\n"
+" [config <fil>|<rå JSON-data>]\n"
"\n"
" bridge: [stp yes|no]\n"
" [priority <num>]\n"
@@ -1027,26 +1070,24 @@ msgstr ""
" [ageing-time <0-1000000>]\n"
" [mac <MAC-adress>]\n"
"\n"
-" bridge-slave: master <master (grnamn, eller anslutnings-UUID eller "
-"namn)>\n"
+" bridge-slave: master <master (grnamn, eller anslutnings-UUID eller namn)>\n"
" [priority <0-63>]\n"
" [path-cost <1-65535>]\n"
" [hairpin yes|no]\n"
"\n"
-" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|"
-"ssh|l2tp|iodine|…\n"
+" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|…\n"
" [user <användarnamn>]\n"
"\n"
" olpc-mesh: ssid <SSID>\n"
" [channel <1-13>]\n"
" [dhcp-anycast <MAC-adress>]\n"
"\n"
-" IP_ALTERNATIV:\n"
+" IP-FLAGGOR:\n"
" [ip4 <IPv4-adress>] [gw4 <IPv4-gateway>]\n"
" [ip6 <IPv6-adress>] [gw6 <IPv6-gateway>]\n"
"\n"
-#: ../clients/cli/connections.c:402
+#: ../clients/cli/connections.c:406
#, c-format
msgid ""
"Usage: nmcli connection modify { ARGUMENTS | help }\n"
@@ -1061,8 +1102,7 @@ msgid ""
"\n"
"Examples:\n"
"nmcli con mod home-wifi wifi.ssid rakosnicek\n"
-"nmcli con mod em1-1 ipv4.method manual ipv4.addr \"192.168.1.2/24, "
-"10.10.1.5/8\"\n"
+"nmcli con mod em1-1 ipv4.method manual ipv4.addr \"192.168.1.2/24, 10.10.1.5/8\"\n"
"nmcli con mod em1-1 +ipv4.dns 8.8.4.4\n"
"nmcli con mod em1-1 -ipv4.dns 1\n"
"nmcli con mod em1-1 -ipv6.addr \"abbe::cafe/56\"\n"
@@ -1072,23 +1112,17 @@ msgid ""
msgstr ""
"Användning: nmcli connection modify { ARGUMENT | help }\n"
"\n"
-"ARGUMENT := [id | uuid | path] <ID> ([+|-]<inställning>.<egenskap> "
-"<värde>)+\n"
+"ARGUMENT := [id | uuid | path] <ID> ([+|-]<inställning>.<egenskap> <värde>)+\n"
"\n"
"Modifiera en eller flera av anslutningsprofilens egenskaper.\n"
-"Profilen identifieras genom dess namn, UUID eller D-BUS-sökväg. För "
-"egenskaper\n"
-"med flera värden kan du valfritt ange prefix '+' eller '-' till "
-"egenskapsnamnet.\n"
-"'+'-tecknet gör det möjligt att lägga till objekt istället för att skriva "
-"över hela värdet.\n"
-"'-'-tecknet gör det möjligt att ta bort markerade objekt istället för hela "
-"värdet.\n"
+"Profilen identifieras genom dess namn, UUID eller D-BUS-sökväg. För egenskaper\n"
+"med flera värden kan du valfritt ange prefix '+' eller '-' till egenskapsnamnet.\n"
+"'+'-tecknet gör det möjligt att lägga till objekt istället för att skriva över hela värdet.\n"
+"'-'-tecknet gör det möjligt att ta bort markerade objekt istället för hela värdet.\n"
"\n"
"Exempel:\n"
"nmcli con mod home-wifi wifi.ssid rakosnicek\n"
-"nmcli con mod em1-1 ipv4.method manual ipv4.addr â€192.168.1.2/24, "
-"10.10.1.5/8â€\n"
+"nmcli con mod em1-1 ipv4.method manual ipv4.addr â€192.168.1.2/24, 10.10.1.5/8â€\n"
"nmcli con mod em1-1 +ipv4.dns 8.8.4.4\n"
"nmcli con mod em1-1 -ipv4.dns 1\n"
"nmcli con mod em1-1 -ipv6.addr â€abbe::cafe/56â€\n"
@@ -1096,7 +1130,7 @@ msgstr ""
"nmcli con mod bond0 -bond.options downdelay\n"
"\n"
-#: ../clients/cli/connections.c:425
+#: ../clients/cli/connections.c:429
#, c-format
msgid ""
"Usage: nmcli connection edit { ARGUMENTS | help }\n"
@@ -1123,7 +1157,7 @@ msgstr ""
"Lägg till en ny anslutningsprofil i en interaktiv redigerare.\n"
"\n"
-#: ../clients/cli/connections.c:440
+#: ../clients/cli/connections.c:444
#, c-format
msgid ""
"Usage: nmcli connection delete { ARGUMENTS | help }\n"
@@ -1142,7 +1176,7 @@ msgstr ""
"Profilen identifieras genom dess namn, UUID, och D-Bus-sökväg.\n"
"\n"
-#: ../clients/cli/connections.c:451
+#: ../clients/cli/connections.c:455
#, c-format
msgid ""
"Usage: nmcli connection reload { help }\n"
@@ -1155,7 +1189,7 @@ msgstr ""
"Läs om alla anslutningsfiler från disk.\n"
"\n"
-#: ../clients/cli/connections.c:459
+#: ../clients/cli/connections.c:463
#, c-format
msgid ""
"Usage: nmcli connection load { ARGUMENTS | help }\n"
@@ -1163,8 +1197,7 @@ msgid ""
"ARGUMENTS := <filename> [<filename>...]\n"
"\n"
"Load/reload one or more connection files from disk. Use this after manually\n"
-"editing a connection file to ensure that NetworkManager is aware of its "
-"latest\n"
+"editing a connection file to ensure that NetworkManager is aware of its latest\n"
"state.\n"
"\n"
msgstr ""
@@ -1172,891 +1205,979 @@ msgstr ""
"\n"
"ARGUMENT := <filnamn> [<filnamn>…]\n"
"\n"
-"Läs in/om en eller flera anslutningsfiler från disk. Använd detta efter att "
-"ha uppdaterat\n"
-"en anslutningsfil manuellt för att försäkra dig om att Nätverkshanteraren är "
-"medveten om sitt senaste\n"
+"Läs in/om en eller flera anslutningsfiler från disk. Använd detta efter att ha uppdaterat\n"
+"en anslutningsfil manuellt för att försäkra dig om att Nätverkshanteraren är medveten om sitt senaste\n"
"tillstånd.\n"
"\n"
-#: ../clients/cli/connections.c:530
+#: ../clients/cli/connections.c:534
msgid "activating"
msgstr "aktiverar"
-#: ../clients/cli/connections.c:532
+#: ../clients/cli/connections.c:536
msgid "activated"
msgstr "aktiverad"
-#: ../clients/cli/connections.c:536
+#: ../clients/cli/connections.c:540
msgid "deactivated"
msgstr "inaktiverad"
-#: ../clients/cli/connections.c:548
+#: ../clients/cli/connections.c:552
msgid "VPN connecting (prepare)"
msgstr "VPN ansluter (förbereder)"
-#: ../clients/cli/connections.c:550
+#: ../clients/cli/connections.c:554
msgid "VPN connecting (need authentication)"
msgstr "VPN ansluter (behöver autentisering)"
-#: ../clients/cli/connections.c:552
+#: ../clients/cli/connections.c:556
msgid "VPN connecting"
msgstr "VPN ansluter"
-#: ../clients/cli/connections.c:554
+#: ../clients/cli/connections.c:558
msgid "VPN connecting (getting IP configuration)"
msgstr "VPN ansluter (hämtar IP-konfiguration)"
-#: ../clients/cli/connections.c:556
+#: ../clients/cli/connections.c:560
msgid "VPN connected"
msgstr "VPN ansluten"
-#: ../clients/cli/connections.c:558
+#: ../clients/cli/connections.c:562
msgid "VPN connection failed"
msgstr "VPN-anslutning misslyckades"
-#: ../clients/cli/connections.c:560
+#: ../clients/cli/connections.c:564
msgid "VPN disconnected"
msgstr "VPN frånkopplad"
-#: ../clients/cli/connections.c:628
+#: ../clients/cli/connections.c:634
+#, c-format
+msgid "Error updating secrets for %s: %s\n"
+msgstr "Fel vid uppdatering av hemligheterna för %s: %s\n"
+
+#: ../clients/cli/connections.c:654
msgid "Connection profile details"
msgstr "Detaljer för anslutningsprofil"
-#: ../clients/cli/connections.c:640 ../clients/cli/connections.c:1050
+#: ../clients/cli/connections.c:666 ../clients/cli/connections.c:1075
#, c-format
msgid "Error: 'connection show': %s"
msgstr "Fel: â€connection showâ€: %s"
-#: ../clients/cli/connections.c:786
+#: ../clients/cli/connections.c:812
msgid "never"
msgstr "aldrig"
#. "CAPABILITIES"
-#: ../clients/cli/connections.c:787 ../clients/cli/connections.c:789
-#: ../clients/cli/connections.c:791 ../clients/cli/connections.c:823
-#: ../clients/cli/connections.c:890 ../clients/cli/connections.c:891
-#: ../clients/cli/connections.c:893 ../clients/cli/connections.c:2817
-#: ../clients/cli/connections.c:6544 ../clients/cli/connections.c:6545
-#: ../clients/cli/devices.c:586 ../clients/cli/devices.c:636
-#: ../clients/cli/devices.c:845 ../clients/cli/devices.c:846
-#: ../clients/cli/devices.c:847 ../clients/cli/devices.c:848
-#: ../clients/cli/devices.c:881 ../clients/cli/devices.c:883
-#: ../clients/cli/devices.c:911 ../clients/cli/devices.c:912
-#: ../clients/cli/devices.c:913 ../clients/cli/devices.c:914
-#: ../clients/cli/devices.c:915 ../clients/cli/devices.c:916
-#: ../clients/cli/devices.c:917 ../clients/cli/general.c:420
-msgid "yes"
-msgstr "ja"
-
-#: ../clients/cli/connections.c:787 ../clients/cli/connections.c:789
-#: ../clients/cli/connections.c:791 ../clients/cli/connections.c:890
-#: ../clients/cli/connections.c:891 ../clients/cli/connections.c:893
-#: ../clients/cli/connections.c:2818 ../clients/cli/connections.c:6544
-#: ../clients/cli/connections.c:6545 ../clients/cli/devices.c:586
-#: ../clients/cli/devices.c:636 ../clients/cli/devices.c:845
+#: ../clients/cli/connections.c:813 ../clients/cli/connections.c:815
+#: ../clients/cli/connections.c:817 ../clients/cli/connections.c:849
+#: ../clients/cli/connections.c:916 ../clients/cli/connections.c:917
+#: ../clients/cli/connections.c:919 ../clients/cli/connections.c:3111
+#: ../clients/cli/connections.c:6954 ../clients/cli/connections.c:6955
+#: ../clients/cli/devices.c:589 ../clients/cli/devices.c:639
#: ../clients/cli/devices.c:846 ../clients/cli/devices.c:847
-#: ../clients/cli/devices.c:848 ../clients/cli/devices.c:881
-#: ../clients/cli/devices.c:883 ../clients/cli/devices.c:911
+#: ../clients/cli/devices.c:848 ../clients/cli/devices.c:849
+#: ../clients/cli/devices.c:882 ../clients/cli/devices.c:884
#: ../clients/cli/devices.c:912 ../clients/cli/devices.c:913
#: ../clients/cli/devices.c:914 ../clients/cli/devices.c:915
#: ../clients/cli/devices.c:916 ../clients/cli/devices.c:917
-#: ../clients/cli/general.c:422
+#: ../clients/cli/devices.c:918 ../clients/cli/general.c:421
+#: ../clients/cli/settings.c:1539
+msgid "yes"
+msgstr "ja"
+
+#: ../clients/cli/connections.c:813 ../clients/cli/connections.c:815
+#: ../clients/cli/connections.c:817 ../clients/cli/connections.c:916
+#: ../clients/cli/connections.c:917 ../clients/cli/connections.c:919
+#: ../clients/cli/connections.c:3112 ../clients/cli/connections.c:6954
+#: ../clients/cli/connections.c:6955 ../clients/cli/devices.c:589
+#: ../clients/cli/devices.c:639 ../clients/cli/devices.c:846
+#: ../clients/cli/devices.c:847 ../clients/cli/devices.c:848
+#: ../clients/cli/devices.c:849 ../clients/cli/devices.c:882
+#: ../clients/cli/devices.c:884 ../clients/cli/devices.c:912
+#: ../clients/cli/devices.c:913 ../clients/cli/devices.c:914
+#: ../clients/cli/devices.c:915 ../clients/cli/devices.c:916
+#: ../clients/cli/devices.c:917 ../clients/cli/devices.c:918
+#: ../clients/cli/general.c:423 ../clients/cli/settings.c:1537
msgid "no"
msgstr "nej"
-#: ../clients/cli/connections.c:1038
+#: ../clients/cli/connections.c:1063
msgid "Activate connection details"
msgstr "Aktivera anslutningsdetaljer"
-#: ../clients/cli/connections.c:1271
+#: ../clients/cli/connections.c:1299
#, c-format
msgid "invalid field '%s'; allowed fields: %s and %s, or %s,%s"
msgstr "ogiltigt fält â€%sâ€; tillÃ¥tna fält: %s och %s, eller %s, %s"
-#: ../clients/cli/connections.c:1286 ../clients/cli/connections.c:1294
+#: ../clients/cli/connections.c:1314 ../clients/cli/connections.c:1322
#, c-format
msgid "'%s' has to be alone"
msgstr "â€%s†mÃ¥ste vara ensamt"
#. Add headers
-#: ../clients/cli/connections.c:1348
+#: ../clients/cli/connections.c:1377
msgid "NetworkManager active profiles"
msgstr "Aktiva profiler för Nätverkshanteraren"
-#: ../clients/cli/connections.c:1349
+#: ../clients/cli/connections.c:1378
msgid "NetworkManager connection profiles"
msgstr "Anslutningsprofiler för Nätverkshanteraren"
-#: ../clients/cli/connections.c:1389 ../clients/cli/connections.c:1998
-#: ../clients/cli/connections.c:2014 ../clients/cli/connections.c:2023
-#: ../clients/cli/connections.c:2033 ../clients/cli/connections.c:2112
-#: ../clients/cli/connections.c:8052 ../clients/cli/connections.c:8269
-#: ../clients/cli/devices.c:1866 ../clients/cli/devices.c:1874
-#: ../clients/cli/devices.c:2190 ../clients/cli/devices.c:2197
-#: ../clients/cli/devices.c:2211 ../clients/cli/devices.c:2218
-#: ../clients/cli/devices.c:2235 ../clients/cli/devices.c:2243
-#: ../clients/cli/devices.c:2431 ../clients/cli/devices.c:2527
-#: ../clients/cli/devices.c:2534
+#: ../clients/cli/connections.c:1418 ../clients/cli/connections.c:2145
+#: ../clients/cli/connections.c:2167 ../clients/cli/connections.c:2176
+#: ../clients/cli/connections.c:2186 ../clients/cli/connections.c:2196
+#: ../clients/cli/connections.c:2346 ../clients/cli/connections.c:8504
+#: ../clients/cli/connections.c:8721 ../clients/cli/devices.c:1909
+#: ../clients/cli/devices.c:1917 ../clients/cli/devices.c:2233
+#: ../clients/cli/devices.c:2240 ../clients/cli/devices.c:2254
+#: ../clients/cli/devices.c:2261 ../clients/cli/devices.c:2278
+#: ../clients/cli/devices.c:2286 ../clients/cli/devices.c:2474
+#: ../clients/cli/devices.c:2570 ../clients/cli/devices.c:2577
#, c-format
msgid "Error: %s argument is missing."
msgstr "Fel: %s-argument saknas."
-#: ../clients/cli/connections.c:1404
+#: ../clients/cli/connections.c:1433
#, c-format
msgid "Error: %s - no such connection profile."
msgstr "Fel: %s - inga sådana anslutningsprofiler."
-#: ../clients/cli/connections.c:1461 ../clients/cli/connections.c:2057
-#: ../clients/cli/connections.c:8558 ../clients/cli/devices.c:2410
-#: ../clients/cli/devices.c:2875 ../clients/cli/general.c:517
-#: ../clients/cli/general.c:563 ../clients/cli/general.c:580
-#: ../clients/cli/general.c:619 ../clients/cli/general.c:633
-#: ../clients/cli/general.c:748 ../clients/cli/general.c:792
-#: ../clients/cli/general.c:812
+#: ../clients/cli/connections.c:1492 ../clients/cli/connections.c:2219
+#: ../clients/cli/connections.c:9021 ../clients/cli/devices.c:2453
+#: ../clients/cli/devices.c:2921 ../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
#, c-format
msgid "Error: %s."
msgstr "Fel: %s."
-#: ../clients/cli/connections.c:1556
+#: ../clients/cli/connections.c:1587
#, c-format
msgid "no active connection on device '%s'"
msgstr "ingen aktiv anslutning pÃ¥ enheten â€%sâ€"
-#: ../clients/cli/connections.c:1564
+#: ../clients/cli/connections.c:1595
msgid "no active connection or device"
msgstr "ingen aktiv anslutning eller enhet"
-#: ../clients/cli/connections.c:1635
+#: ../clients/cli/connections.c:1666
#, c-format
msgid "device '%s' not compatible with connection '%s'"
msgstr "enheten â€%s†är inte kompatibel med anslutningen â€%sâ€"
-#: ../clients/cli/connections.c:1638
+#: ../clients/cli/connections.c:1669
#, c-format
msgid "no device found for connection '%s'"
msgstr "ingen enhet hittades för anslutningen â€%sâ€"
-#: ../clients/cli/connections.c:1650
+#: ../clients/cli/connections.c:1681
msgid "unknown reason"
msgstr "okänd anledning"
-#: ../clients/cli/connections.c:1652 ../clients/cli/general.c:271
+#: ../clients/cli/connections.c:1683 ../clients/cli/general.c:272
msgid "none"
msgstr "ingen"
-#: ../clients/cli/connections.c:1654
+#: ../clients/cli/connections.c:1685
msgid "the user was disconnected"
msgstr "användaren kopplades från"
-#: ../clients/cli/connections.c:1656
+#: ../clients/cli/connections.c:1687
msgid "the base network connection was interrupted"
msgstr "basnätverksanslutningen avbröts"
-#: ../clients/cli/connections.c:1658
+#: ../clients/cli/connections.c:1689
msgid "the VPN service stopped unexpectedly"
msgstr "VPN-tjänsten stoppades oväntat"
-#: ../clients/cli/connections.c:1660
+#: ../clients/cli/connections.c:1691
msgid "the VPN service returned invalid configuration"
msgstr "VPN-tjänsten returnerade en ogiltig konfiguration"
-#: ../clients/cli/connections.c:1662
+#: ../clients/cli/connections.c:1693
msgid "the connection attempt timed out"
msgstr "anslutningsförsöket översteg tidsgränsen"
-#: ../clients/cli/connections.c:1664
+#: ../clients/cli/connections.c:1695
msgid "the VPN service did not start in time"
msgstr "VPN-tjänsten startade inte i tid"
-#: ../clients/cli/connections.c:1666
+#: ../clients/cli/connections.c:1697
msgid "the VPN service failed to start"
msgstr "VPN-tjänsten misslyckades med att starta"
-#: ../clients/cli/connections.c:1668
+#: ../clients/cli/connections.c:1699
msgid "no valid VPN secrets"
msgstr "inga giltiga VPN-hemligheter"
-#: ../clients/cli/connections.c:1670
+#: ../clients/cli/connections.c:1701
msgid "invalid VPN secrets"
msgstr "ogiltiga VPN-hemligheter"
-#: ../clients/cli/connections.c:1672
+#: ../clients/cli/connections.c:1703
msgid "the connection was removed"
msgstr "anslutningen togs bort"
-#: ../clients/cli/connections.c:1694 ../clients/cli/connections.c:1722
-#: ../clients/cli/connections.c:1877 ../clients/cli/connections.c:6435
+#: ../clients/cli/connections.c:1725 ../clients/cli/connections.c:1753
+#: ../clients/cli/connections.c:1914 ../clients/cli/connections.c:6845
#, c-format
msgid "Connection successfully activated (D-Bus active path: %s)\n"
msgstr "Anslutning aktiverades (aktiv sökväg för D-Bus: %s)\n"
-#: ../clients/cli/connections.c:1701
+#: ../clients/cli/connections.c:1732
#, c-format
-msgid ""
-"Connection successfully activated (master waiting for slaves) (D-Bus active "
-"path: %s)\n"
-msgstr ""
-"Anslutning aktiverades (master väntar på slavar) (aktiv sökväg för D-Bus: "
-"%s)\n"
+msgid "Connection successfully activated (master waiting for slaves) (D-Bus active path: %s)\n"
+msgstr "Anslutning aktiverades (master väntar på slavar) (aktiv sökväg för D-Bus: %s)\n"
-#: ../clients/cli/connections.c:1705 ../clients/cli/connections.c:1728
+#: ../clients/cli/connections.c:1736 ../clients/cli/connections.c:1758
#, c-format
msgid "Error: Connection activation failed."
msgstr "Fel: Aktivering av anslutning misslyckades."
-#: ../clients/cli/connections.c:1772
+#: ../clients/cli/connections.c:1809
#, c-format
msgid "VPN connection successfully activated (D-Bus active path: %s)\n"
msgstr "VPN-anslutning aktiverad (aktiv sökväg för D-Bus: %s)\n"
-#: ../clients/cli/connections.c:1780
+#: ../clients/cli/connections.c:1817
#, c-format
msgid "Error: Connection activation failed: %s."
msgstr "Fel: Aktivering av anslutning misslyckades: %s."
-#: ../clients/cli/connections.c:1799 ../clients/cli/devices.c:1319
+#: ../clients/cli/connections.c:1836 ../clients/cli/devices.c:1322
#, c-format
msgid "Error: Timeout %d sec expired."
msgstr "Fel: Tidsgränsen %d sekunder gick ut."
-#: ../clients/cli/connections.c:1859
+#: ../clients/cli/connections.c:1896
#, c-format
msgid "Error: Connection activation failed: %s"
msgstr "Fel: Aktivering av anslutning misslyckades: %s"
-#: ../clients/cli/connections.c:1936 ../clients/cli/connections.c:2058
+#: ../clients/cli/connections.c:1981
+#, c-format
+msgid "failed to read passwd-file '%s': %s"
+msgstr "misslyckades med att läsa lösenordsfilen â€%sâ€: %s"
+
+#: ../clients/cli/connections.c:1993
+#, c-format
+msgid "missing colon in 'password' entry '%s'"
+msgstr "saknar kolon i â€passwordâ€-posten â€%sâ€"
+
+#: ../clients/cli/connections.c:2001
+#, c-format
+msgid "missing dot in 'password' entry '%s'"
+msgstr "saknar . i â€passwordâ€-posten â€%sâ€"
+
+#: ../clients/cli/connections.c:2014
+#, c-format
+msgid "invalid setting name in 'password' entry '%s'"
+msgstr "ogiltig inställning i â€passwordâ€-posten â€%sâ€"
+
+#: ../clients/cli/connections.c:2061 ../clients/cli/connections.c:2220
msgid "unknown error"
-msgstr "Okänt fel"
+msgstr "okänt fel"
-#: ../clients/cli/connections.c:1944
+#: ../clients/cli/connections.c:2070
#, c-format
msgid "unknown device '%s'."
-msgstr "Okänd enhet â€%sâ€"
+msgstr "okänd enhet â€%sâ€."
-#: ../clients/cli/connections.c:1949
+#: ../clients/cli/connections.c:2075
msgid "neither a valid connection nor device given"
msgstr "ingen aktiv anslutning eller enhet angiven"
-#: ../clients/cli/connections.c:2042 ../clients/cli/devices.c:1218
-#: ../clients/cli/devices.c:1880 ../clients/cli/devices.c:2254
-#: ../clients/cli/devices.c:2540
+#: ../clients/cli/connections.c:2158
+#, c-format
+msgid "Error: Connection '%s' does not exist."
+msgstr "Fel: anslutningen â€%s†finns inte."
+
+#: ../clients/cli/connections.c:2204 ../clients/cli/devices.c:1221
+#: ../clients/cli/devices.c:1923 ../clients/cli/devices.c:2297
+#: ../clients/cli/devices.c:2583
#, c-format
msgid "Unknown parameter: %s\n"
msgstr "Okänd parameter: %s\n"
-#: ../clients/cli/connections.c:2066
+#: ../clients/cli/connections.c:2228
msgid "preparing"
msgstr "förbereder"
-#: ../clients/cli/connections.c:2094 ../clients/cli/connections.c:8250
-#: ../clients/cli/connections.c:8364
+#: ../clients/cli/connections.c:2267
+#, c-format
+msgid "Connection '%s' successfully deactivated (D-Bus active path: %s)\n"
+msgstr "Anslutningen â€%s†inaktiverades (aktiv sökväg för D-Bus: %s)\n"
+
+#: ../clients/cli/connections.c:2325 ../clients/cli/connections.c:8702
+#: ../clients/cli/connections.c:8816
#, c-format
msgid "Error: No connection specified."
msgstr "Fel: Ingen anslutning angiven."
-#: ../clients/cli/connections.c:2122
+#: ../clients/cli/connections.c:2356
#, c-format
-msgid "Error: '%s' is not an active connection."
-msgstr "Fel: â€%s†är inte en aktiv anslutning."
+msgid "Error: '%s' is not an active connection.\n"
+msgstr "Fel: â€%s†är inte en aktiv anslutning.\n"
-#: ../clients/cli/connections.c:2423 ../clients/cli/utils.c:517
+#: ../clients/cli/connections.c:2357
+#, c-format
+msgid "Error: not all active connections found."
+msgstr "Fel: hittade inte alla aktiva anslutningar."
+
+#: ../clients/cli/connections.c:2366
+#, c-format
+msgid "Error: no active connection provided."
+msgstr "Fel: inga aktiva anslutningar tillhandahållna."
+
+#: ../clients/cli/connections.c:2684 ../clients/cli/utils.c:516
#, c-format
msgid "'%s' not among [%s]"
msgstr "â€%s†inte bland [%s]"
-#: ../clients/cli/connections.c:2502
+#: ../clients/cli/connections.c:2763
#, c-format
msgid "Error: '%s': '%s' is not a valid %s MAC address."
msgstr "Fel: '%s': '%s' är inte en giltig %s-MAC-adress."
#. Ask for optional arguments
-#: ../clients/cli/connections.c:2503 ../clients/cli/connections.c:2933
-#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1490
-#: ../libnm-glib/nm-device.c:1800 ../libnm/nm-device.c:1610
+#: ../clients/cli/connections.c:2764 ../clients/cli/connections.c:3226
+#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1575
+#: ../libnm-glib/nm-device.c:1801 ../libnm/nm-device.c:1623
msgid "InfiniBand"
msgstr "InfiniBand"
-#: ../clients/cli/connections.c:2503 ../clients/tui/nm-editor-utils.c:147
-#: ../libnm-glib/nm-device.c:1788 ../libnm/nm-device.c:1598
+#: ../clients/cli/connections.c:2764 ../clients/tui/nm-editor-utils.c:147
+#: ../libnm-glib/nm-device.c:1789 ../libnm/nm-device.c:1611
msgid "Ethernet"
msgstr "Ethernet"
-#: ../clients/cli/connections.c:2523
+#: ../clients/cli/connections.c:2784
#, c-format
msgid "Error: 'mtu': '%s' is not a valid MTU."
msgstr "Fel: â€mtuâ€: â€%s†är inte ett giltigt MTU."
-#: ../clients/cli/connections.c:2539
+#: ../clients/cli/connections.c:2800
#, c-format
msgid "Error: 'parent': '%s' is not a valid interface name."
msgstr "Fel: â€parentâ€: â€%s†är inte ett giltigt gränssnittsnamn."
-#: ../clients/cli/connections.c:2560
+#: ../clients/cli/connections.c:2821
#, c-format
msgid "Error: 'p-key': '%s' is not a valid InfiniBand P_KEY."
msgstr "Fel: â€p-keyâ€: â€%s†är inte en giltig InfiniBand P_KEY."
-#: ../clients/cli/connections.c:2589
+#: ../clients/cli/connections.c:2866
#, c-format
-msgid ""
-"Error: 'mode': '%s' is not a valid InfiniBand transport mode [datagram, "
-"connected]."
-msgstr ""
-"Fel: â€mode“: â€%s†är inte ett giltigt transportläge för InfiniBand "
-"[datagram, connected]."
+msgid "Error: '%s': '%s' is not a valid %s %s."
+msgstr "Fel: â€%sâ€: â€%s†är inte en giltig %s %s."
-#: ../clients/cli/connections.c:2603
+#: ../clients/cli/connections.c:2879
+msgid "Wi-Fi mode"
+msgstr "Wi-Fi-läge"
+
+#: ../clients/cli/connections.c:2888
+msgid "InfiniBand transport mode"
+msgstr "InfiniBand transportläge"
+
+#: ../clients/cli/connections.c:2901
#, c-format
msgid "Error: 'flags': '%s' is not valid; use <0-7>."
-msgstr "Fel: â€flagsâ€: â€%s†är inte giltig; använd <0-7>"
+msgstr "Fel: â€flagsâ€: â€%s†är inte giltig; använd <0-7>."
-#: ../clients/cli/connections.c:2625
+#: ../clients/cli/connections.c:2923
#, c-format
msgid "Error: '%s': '%s' is not valid; %s "
-msgstr "Fel: â€%sâ€: â€%s†är inte giltig; %s"
+msgstr "Fel: â€%sâ€: â€%s†är inte giltig; %s "
-#: ../clients/cli/connections.c:2808
+#: ../clients/cli/connections.c:3102
#, c-format
msgid "Error: '%s': '%s' is not valid; use <%u-%u>."
msgstr "Fel: â€%sâ€: â€%s†är inte giltig; använd <%u-%u>."
#. Ask for optional arguments.
-#: ../clients/cli/connections.c:2864
+#: ../clients/cli/connections.c:3158
#, 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"
msgstr[0] "Det finns %d valfritt argument för anslutningstypen â€%sâ€.\n"
msgstr[1] "Det finns %d valfria argument för anslutningstypen â€%sâ€.\n"
-#: ../clients/cli/connections.c:2867
+#: ../clients/cli/connections.c:3161
#, c-format
msgid "Do you want to provide it? %s"
msgid_plural "Do you want to provide them? %s"
msgstr[0] "Vill du tillhandahålla det? %s"
msgstr[1] "Vill du tillhandahålla dem? %s"
-#: ../clients/cli/connections.c:2882
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3178
msgid "ethernet"
msgstr "ethernet"
-#: ../clients/cli/connections.c:2882 ../clients/tui/nm-editor-utils.c:155
-#: ../libnm-glib/nm-device.c:1790 ../libnm/nm-device.c:1600
-msgid "Wi-Fi"
-msgstr "Wi-Fi"
-
-#: ../clients/cli/connections.c:2890 ../clients/cli/connections.c:2938
-#: ../clients/cli/connections.c:3047 ../clients/cli/connections.c:3126
+#: ../clients/cli/connections.c:3183 ../clients/cli/connections.c:3231
+#: ../clients/cli/connections.c:3365 ../clients/cli/connections.c:3444
msgid "MTU [auto]: "
-msgstr "MTU [auto]:"
+msgstr "MTU [auto]: "
-#: ../clients/cli/connections.c:2901 ../clients/cli/connections.c:2949
-#: ../clients/cli/connections.c:3019 ../clients/cli/connections.c:3058
-#: ../clients/cli/connections.c:3430
+#: ../clients/cli/connections.c:3194 ../clients/cli/connections.c:3242
+#: ../clients/cli/connections.c:3337 ../clients/cli/connections.c:3376
+#: ../clients/cli/connections.c:3748
msgid "MAC [none]: "
msgstr "MAC [none]: "
-#: ../clients/cli/connections.c:2912
+#: ../clients/cli/connections.c:3205
msgid "Cloned MAC [none]: "
msgstr "Klonad MAC [none]: "
-#: ../clients/cli/connections.c:2960
+#: ../clients/cli/connections.c:3253
#, c-format
msgid "Transport mode %s"
msgstr "Transportläge %s"
-#: ../clients/cli/connections.c:2973
+#: ../clients/cli/connections.c:3266
msgid "Parent interface [none]: "
msgstr "Föräldragränssnitt [none]: "
-#: ../clients/cli/connections.c:2984
+#: ../clients/cli/connections.c:3277
msgid "P_KEY [none]: "
msgstr "P_KEY [none]: "
-#: ../clients/cli/connections.c:2994
+#: ../clients/cli/connections.c:3287
#, c-format
msgid "Error: 'p-key' is mandatory when 'parent' is specified.\n"
msgstr "Fel: â€p-key†är obligatoriskt när â€parent†är angett.\n"
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3304 ../clients/tui/nm-editor-utils.c:155
+#: ../libnm-glib/nm-device.c:1791 ../libnm/nm-device.c:1613
+msgid "Wi-Fi"
+msgstr "Wi-Fi"
+
+#: ../clients/cli/connections.c:3312
+#, c-format
+msgid "Mode %s"
+msgstr "Läge %s"
+
#. Ask for optional 'wimax' arguments.
-#: ../clients/cli/connections.c:3014 ../libnm-glib/nm-device.c:1796
-#: ../libnm/nm-device.c:1606
+#: ../clients/cli/connections.c:3332 ../libnm-glib/nm-device.c:1797
+#: ../libnm/nm-device.c:1619
msgid "WiMAX"
msgstr "WiMAX"
#. Ask for optional 'pppoe' arguments.
-#: ../clients/cli/connections.c:3037
+#: ../clients/cli/connections.c:3355
msgid "PPPoE"
msgstr "PPPoE"
-#: ../clients/cli/connections.c:3041 ../clients/cli/connections.c:3079
+#: ../clients/cli/connections.c:3359 ../clients/cli/connections.c:3397
msgid "Password [none]: "
-msgstr "Lösenord [none]:"
+msgstr "Lösenord [none]: "
-#: ../clients/cli/connections.c:3043
+#: ../clients/cli/connections.c:3361
msgid "Service [none]: "
-msgstr "Tjänst [none]:"
+msgstr "Tjänst [none]: "
#. Ask for optional 'gsm' or 'cdma' arguments.
-#: ../clients/cli/connections.c:3073
+#: ../clients/cli/connections.c:3391
msgid "mobile broadband"
msgstr "mobilt bredband"
-#: ../clients/cli/connections.c:3077 ../clients/cli/connections.c:3502
+#: ../clients/cli/connections.c:3395 ../clients/cli/connections.c:3820
msgid "Username [none]: "
-msgstr "Användarnamn [none]:"
+msgstr "Användarnamn [none]: "
#. Ask for optional 'bluetooth' arguments.
-#: ../clients/cli/connections.c:3092
+#: ../clients/cli/connections.c:3410
msgid "bluetooth"
msgstr "bluetooth"
-#: ../clients/cli/connections.c:3099
+#: ../clients/cli/connections.c:3417
#, c-format
msgid "Bluetooth type %s"
msgstr "Bluetooth-typen %s"
-#: ../clients/cli/connections.c:3105
+#: ../clients/cli/connections.c:3423
#, c-format
msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n"
msgstr "Fel: â€bt-type'â€: â€%s†är inte en giltig Bluetoothtyp.\n"
#. Ask for optional 'vlan' arguments.
#. 13
-#: ../clients/cli/connections.c:3121 ../clients/cli/devices.c:230
-#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:51
-#: ../libnm-core/nm-connection.c:1488 ../libnm-glib/nm-device.c:1808
-#: ../libnm-util/nm-connection.c:1612 ../libnm/nm-device.c:1618
+#: ../clients/cli/connections.c:3439 ../clients/cli/devices.c:233
+#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:97
+#: ../libnm-core/nm-connection.c:1573 ../libnm-glib/nm-device.c:1809
+#: ../libnm-util/nm-connection.c:1614 ../libnm/nm-device.c:1631
msgid "VLAN"
msgstr "VLAN"
-#: ../clients/cli/connections.c:3137
+#: ../clients/cli/connections.c:3455
msgid "VLAN flags (<0-7>) [none]: "
-msgstr "VLAN-flaggor (<0-7>) [none]:"
+msgstr "VLAN-flaggor (<0-7>) [none]: "
-#: ../clients/cli/connections.c:3148
+#: ../clients/cli/connections.c:3466
msgid "Ingress priority maps [none]: "
-msgstr "Inträdesprioritetshash [none]:"
+msgstr "Inträdesprioritetshash [none]: "
-#: ../clients/cli/connections.c:3159
+#: ../clients/cli/connections.c:3477
msgid "Egress priority maps [none]: "
-msgstr "Utträdesprioritetshash [none]:"
+msgstr "Utträdesprioritetshash [none]: "
-#: ../clients/cli/connections.c:3170
+#: ../clients/cli/connections.c:3488
msgid "Bonding mode [balance-rr]: "
-msgstr "Kombineringsläge [balance-rr]:"
+msgstr "Kombineringsläge [balance-rr]: "
#. Ask for optional 'bond' arguments.
-#: ../clients/cli/connections.c:3186
+#: ../clients/cli/connections.c:3504
msgid "bond"
msgstr "kombinera"
-#: ../clients/cli/connections.c:3208
+#: ../clients/cli/connections.c:3526
msgid "Bonding primary interface [none]: "
-msgstr "Kombinerar primärt gränssnittet [none]:"
+msgstr "Kombinerar primärt gränssnittet [none]: "
-#: ../clients/cli/connections.c:3211
+#: ../clients/cli/connections.c:3529
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name.\n"
msgstr "Fel: â€primaryâ€: â€%s†är inte ett giltigt gränssnittsnamn.\n"
-#: ../clients/cli/connections.c:3219
+#: ../clients/cli/connections.c:3537
#, c-format
msgid "Bonding monitoring mode %s"
msgstr "Kombinerar övervakningsläget %s"
-#: ../clients/cli/connections.c:3225
+#: ../clients/cli/connections.c:3543
#, c-format
msgid "Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n"
-msgstr ""
-"Fel: â€%sâ€: är inte ett giltigt övervakningsläge; använd â€%s†eller â€%sâ€.\n"
+msgstr "Fel: â€%sâ€: är inte ett giltigt övervakningsläge; använd â€%s†eller â€%sâ€.\n"
-#: ../clients/cli/connections.c:3234
+#: ../clients/cli/connections.c:3552
msgid "Bonding miimon [100]: "
-msgstr "Kombinerar miimon [100]:"
+msgstr "Kombinerar miimon [100]: "
-#: ../clients/cli/connections.c:3237
+#: ../clients/cli/connections.c:3555
#, c-format
msgid "Error: 'miimon': '%s' is not a valid number <0-%u>.\n"
msgstr "Fel: â€miimon†: â€%s†är inte ett giltigt nummer <0-%u>.\n"
-#: ../clients/cli/connections.c:3245
+#: ../clients/cli/connections.c:3563
msgid "Bonding downdelay [0]: "
-msgstr "Kombinerar nedfördröjning [0]:"
+msgstr "Kombinerar nedfördröjning [0]: "
-#: ../clients/cli/connections.c:3248
+#: ../clients/cli/connections.c:3566
#, c-format
msgid "Error: 'downdelay': '%s' is not a valid number <0-%u>.\n"
msgstr "Fel: â€downdelayâ€: â€%s†är inte ett giltigt nummer <0-%u>.\n"
-#: ../clients/cli/connections.c:3256
+#: ../clients/cli/connections.c:3574
msgid "Bonding updelay [0]: "
-msgstr "Kombinerar uppfördröjning [0]:"
+msgstr "Kombinerar uppfördröjning [0]: "
-#: ../clients/cli/connections.c:3259
+#: ../clients/cli/connections.c:3577
#, c-format
msgid "Error: 'updelay': '%s' is not a valid number <0-%u>.\n"
msgstr "Fel: â€updelayâ€: â€%s†är inte ett giltigt nummer <0-%u>.\n"
-#: ../clients/cli/connections.c:3268
+#: ../clients/cli/connections.c:3586
msgid "Bonding arp-interval [0]: "
-msgstr "Kombinerar arp-intervall [0]:"
+msgstr "Kombinerar arp-intervall [0]: "
-#: ../clients/cli/connections.c:3271
+#: ../clients/cli/connections.c:3589
#, c-format
msgid "Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n"
msgstr "Fel: â€arp-intervalâ€: â€%s†är inte ett giltigt nummer <0-%u>.\n"
#. FIXME: verify the string
-#: ../clients/cli/connections.c:3279
+#: ../clients/cli/connections.c:3597
msgid "Bonding arp-ip-target [none]: "
-msgstr "Kombinerar arp-ip-target [none]:"
+msgstr "Kombinerar arp-ip-target [none]: "
-#: ../clients/cli/connections.c:3286
+#: ../clients/cli/connections.c:3604
msgid "LACP rate ('slow' or 'fast') [slow]: "
-msgstr "LACP-hastighet (\"slow\" eller \"fast\") [slow]:"
+msgstr "LACP-hastighet (\"slow\" eller \"fast\") [slow]: "
-#: ../clients/cli/connections.c:3292
+#: ../clients/cli/connections.c:3610
#, c-format
msgid "Error: 'lacp_rate': '%s' is invalid ('slow' or 'fast').\n"
msgstr "Fel: â€lacp-rateâ€: â€%s†är ogiltig (â€slow†eller â€fastâ€).\n"
-#: ../clients/cli/connections.c:3315
+#: ../clients/cli/connections.c:3633
msgid "Team JSON configuration [none]: "
-msgstr "JSON-konfiguration för grupp [none]:"
+msgstr "JSON-konfiguration för grupp [none]: "
-#: ../clients/cli/connections.c:3332
+#: ../clients/cli/connections.c:3650
msgid "team"
msgstr "grupp"
-#: ../clients/cli/connections.c:3338
+#: ../clients/cli/connections.c:3656
msgid "team-slave"
msgstr "grupp-slav"
#. Ask for optional 'bridge' arguments.
-#: ../clients/cli/connections.c:3350
+#: ../clients/cli/connections.c:3668
msgid "bridge"
msgstr "brygga"
-#: ../clients/cli/connections.c:3356
+#: ../clients/cli/connections.c:3674
#, c-format
msgid "Enable STP %s"
msgstr "Aktivera STP %s"
-#: ../clients/cli/connections.c:3361
+#: ../clients/cli/connections.c:3679
#, c-format
msgid "Error: 'stp': %s.\n"
msgstr "Fel: â€stpâ€: %s.\n"
-#: ../clients/cli/connections.c:3369
+#: ../clients/cli/connections.c:3687
msgid "STP priority [32768]: "
-msgstr "STP-prioritet [32768]:"
+msgstr "STP-prioritet [32768]: "
-#: ../clients/cli/connections.c:3373
+#: ../clients/cli/connections.c:3691
#, c-format
msgid "Error: 'priority': '%s' is not a valid number <0-%d>.\n"
msgstr "Fel: â€priorityâ€: â€%s†är inte ett giltigt nummer <0-%d>.\n"
-#: ../clients/cli/connections.c:3381
+#: ../clients/cli/connections.c:3699
msgid "Forward delay [15]: "
-msgstr "Framåtfördröjning [15]:"
+msgstr "Framåtfördröjning [15]: "
-#: ../clients/cli/connections.c:3385
+#: ../clients/cli/connections.c:3703
#, c-format
msgid "Error: 'forward-delay': '%s' is not a valid number <2-30>.\n"
msgstr "Fel: â€forward-delayâ€: â€%s†är inte ett giltigt nummer <2-30>.\n"
-#: ../clients/cli/connections.c:3394
+#: ../clients/cli/connections.c:3712
msgid "Hello time [2]: "
-msgstr "Hallå-tid [2]:"
+msgstr "Hallå-tid [2]: "
-#: ../clients/cli/connections.c:3398
+#: ../clients/cli/connections.c:3716
#, c-format
msgid "Error: 'hello-time': '%s' is not a valid number <1-10>.\n"
msgstr "Fel: â€hello-timeâ€: â€%s†är inte ett giltigt nummer <1-10>.\n"
-#: ../clients/cli/connections.c:3406
+#: ../clients/cli/connections.c:3724
msgid "Max age [20]: "
-msgstr "Max ålder [20]:"
+msgstr "Max ålder [20]: "
-#: ../clients/cli/connections.c:3410
+#: ../clients/cli/connections.c:3728
#, c-format
msgid "Error: 'max-age': '%s' is not a valid number <6-40>.\n"
msgstr "Fel: â€max-ageâ€: â€%s†är inte ett giltig nummer <6-40>.\n"
-#: ../clients/cli/connections.c:3418
+#: ../clients/cli/connections.c:3736
msgid "MAC address ageing time [300]: "
-msgstr "Livstid för MAC-adress [300]:"
+msgstr "Livstid för MAC-adress [300]: "
-#: ../clients/cli/connections.c:3422
+#: ../clients/cli/connections.c:3740
#, c-format
msgid "Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n"
msgstr "Fel: â€ageing-timeâ€: â€%s†är inte ett giltig nummer <0-1000000>.\n"
#. Ask for optional 'bridge-slave' arguments.
-#: ../clients/cli/connections.c:3449
+#: ../clients/cli/connections.c:3767
msgid "bridge-slave"
msgstr "brygga-slav"
-#: ../clients/cli/connections.c:3454
+#: ../clients/cli/connections.c:3772
msgid "Bridge port priority [32]: "
-msgstr "Prioritet för bryggport [32]:"
+msgstr "Prioritet för bryggport [32]: "
-#: ../clients/cli/connections.c:3467
+#: ../clients/cli/connections.c:3785
msgid "Bridge port STP path cost [100]: "
-msgstr "STP-sökvägskostnad för bryggport [100]:"
+msgstr "STP-sökvägskostnad för bryggport [100]: "
-#: ../clients/cli/connections.c:3481
+#: ../clients/cli/connections.c:3799
#, c-format
msgid "Hairpin %s"
msgstr "Hårnål %s"
-#: ../clients/cli/connections.c:3486
+#: ../clients/cli/connections.c:3804
#, c-format
msgid "Error: 'hairpin': %s.\n"
msgstr "Fel: â€hairpinâ€: %s.\n"
#. Ask for optional 'olpc' arguments.
-#: ../clients/cli/connections.c:3513 ../libnm-glib/nm-device.c:1794
-#: ../libnm/nm-device.c:1604
+#: ../clients/cli/connections.c:3831 ../libnm-glib/nm-device.c:1795
+#: ../libnm/nm-device.c:1617
msgid "OLPC Mesh"
msgstr "OLPC-mesh"
-#: ../clients/cli/connections.c:3518
+#: ../clients/cli/connections.c:3836
msgid "OLPC Mesh channel [1]: "
-msgstr "OLPC-meshkanal [1]:"
+msgstr "OLPC-meshkanal [1]: "
-#: ../clients/cli/connections.c:3521
+#: ../clients/cli/connections.c:3839
#, c-format
msgid "Error: 'channel': '%s' is not a valid number <1-13>.\n"
msgstr "Fel: â€channelâ€: â€%s†är inte ett giltigt nummer <1-13>.\n"
-#: ../clients/cli/connections.c:3529
+#: ../clients/cli/connections.c:3847
msgid "DHCP anycast MAC address [none]: "
-msgstr "DHCP-anycast MAC-adress [ingen]:"
+msgstr "DHCP-anycast MAC-adress [none]: "
-#: ../clients/cli/connections.c:3574
-msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
-msgstr "IPv4-adress (IP[/plen] [gateway]) [none]: "
+#: ../clients/cli/connections.c:3889
+msgid "IPv4 address (IP[/plen]) [none]: "
+msgstr "IPv4-adress (IP[/plen]) [none]: "
-#: ../clients/cli/connections.c:3576
-msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
-msgstr "IPv6-adress (IP[/plen] [gateway]) [none]: "
+#: ../clients/cli/connections.c:3891
+msgid "IPv6 address (IP[/plen]) [none]: "
+msgstr "IPv6-adress (IP[/plen]) [none]: "
-#: ../clients/cli/connections.c:3594
+#: ../clients/cli/connections.c:3905
#, c-format
-msgid " Address successfully added: %s %s\n"
-msgstr " Adress lades till: %s %s\n"
+msgid " Address successfully added: %s\n"
+msgstr " Adress lades till: %s\n"
-#: ../clients/cli/connections.c:3596
+#: ../clients/cli/connections.c:3907
#, c-format
-msgid " Warning: address already present: %s %s\n"
-msgstr " Varning: adressen finns redan: %s %s\n"
+msgid " Warning: address already present: %s\n"
+msgstr " Varning: adressen finns redan: %s\n"
-#: ../clients/cli/connections.c:3598
+#: ../clients/cli/connections.c:3909
#, c-format
msgid " Warning: ignoring garbage at the end: '%s'\n"
-msgstr " Varning: ignorerar skräp på slutet: '%s'\n"
+msgstr " Varning: ignorerar skräp pÃ¥ slutet: â€%sâ€\n"
-#: ../clients/cli/connections.c:3600 ../clients/cli/connections.c:4431
-#: ../clients/cli/connections.c:4492 ../clients/cli/connections.c:4894
-#: ../clients/cli/connections.c:4904
+#: ../clients/cli/connections.c:3911 ../clients/cli/connections.c:4792
+#: ../clients/cli/connections.c:4853 ../clients/cli/connections.c:5258
+#: ../clients/cli/connections.c:5291
msgid "Error: "
-msgstr "Fel:"
+msgstr "Fel: "
+
+#: ../clients/cli/connections.c:3931
+msgid "IPv4 gateway [none]: "
+msgstr "IPv4-gateway [none]: "
+
+#: ../clients/cli/connections.c:3934
+msgid "IPv6 gateway [none]: "
+msgstr "IPv6-gateway [none]: "
+
+#: ../clients/cli/connections.c:3954
+#, c-format
+msgid "Error: invalid gateway address '%s'\n"
+msgstr "Fel: ogiltig gateway-adress â€%sâ€\n"
#. Ask for IP addresses
-#: ../clients/cli/connections.c:3617
+#: ../clients/cli/connections.c:3967
#, c-format
msgid "Do you want to add IP addresses? %s"
msgstr "Vill du lägga till IP-adresser? %s"
-#: ../clients/cli/connections.c:3624
+#: ../clients/cli/connections.c:3975
#, c-format
msgid "Press <Enter> to finish adding addresses.\n"
msgstr "Tryck <Retur> för att sluta lägga till adresser.\n"
-#: ../clients/cli/connections.c:3763
+#: ../clients/cli/connections.c:4114
#, c-format
msgid "Error: 'parent': not valid without 'p-key'."
msgstr "Fel: â€parentâ€: inte giltig utan â€p-keyâ€."
-#: ../clients/cli/connections.c:3815 ../clients/cli/connections.c:4813
+#: ../clients/cli/connections.c:4169 ../clients/cli/connections.c:5174
msgid "SSID: "
msgstr "SSID: "
-#: ../clients/cli/connections.c:3818 ../clients/cli/connections.c:4816
+#: ../clients/cli/connections.c:4172 ../clients/cli/connections.c:5177
msgid "Error: 'ssid' is required."
msgstr "Fel: â€ssid†krävs."
-#: ../clients/cli/connections.c:3875
+#: ../clients/cli/connections.c:4236
msgid "WiMAX NSP name: "
-msgstr "WiMAX NSP-lista:"
+msgstr "WiMAX NSP-lista: "
-#: ../clients/cli/connections.c:3878
+#: ../clients/cli/connections.c:4239
msgid "Error: 'nsp' is required."
msgstr "Fel: â€nsp†krävs."
-#: ../clients/cli/connections.c:3930
+#: ../clients/cli/connections.c:4291
msgid "PPPoE username: "
-msgstr "PPPoE-användarnamn:"
+msgstr "PPPoE-användarnamn: "
-#: ../clients/cli/connections.c:3933
+#: ../clients/cli/connections.c:4294
msgid "Error: 'username' is required."
-msgstr "Fel: â€username†krävs"
+msgstr "Fel: â€username†krävs."
-#: ../clients/cli/connections.c:4002
+#: ../clients/cli/connections.c:4363
msgid "APN: "
msgstr "APN: "
-#: ../clients/cli/connections.c:4005
+#: ../clients/cli/connections.c:4366
msgid "Error: 'apn' is required."
msgstr "Fel: â€apn†krävs."
-#: ../clients/cli/connections.c:4063
+#: ../clients/cli/connections.c:4424
msgid "Bluetooth device address: "
-msgstr "Adress för Bluetooth-enhet:"
+msgstr "Adress för Bluetooth-enhet: "
-#: ../clients/cli/connections.c:4066
+#: ../clients/cli/connections.c:4427
msgid "Error: 'addr' is required."
msgstr "Fel: â€addr†krävs."
-#: ../clients/cli/connections.c:4107
+#: ../clients/cli/connections.c:4468
#, c-format
msgid "Error: 'bt-type': '%s' not valid; use [%s, %s (%s), %s]."
msgstr "Fel: â€bt-typeâ€: â€%s†inte giltig; använd [%s, %s (%s), %s]."
-#: ../clients/cli/connections.c:4151
+#: ../clients/cli/connections.c:4512
msgid "VLAN parent device or connection UUID: "
-msgstr "VLAN-föräldraenhet eller anslutnings-UUID:"
+msgstr "VLAN-föräldraenhet eller anslutnings-UUID: "
-#: ../clients/cli/connections.c:4154
+#: ../clients/cli/connections.c:4515
msgid "Error: 'dev' is required."
msgstr "Fel: â€dev†krävs."
-#: ../clients/cli/connections.c:4158
+#: ../clients/cli/connections.c:4519
msgid "VLAN ID <0-4095>: "
msgstr "VLAN ID <0-4095>: "
-#: ../clients/cli/connections.c:4161
+#: ../clients/cli/connections.c:4522
msgid "Error: 'id' is required."
msgstr "Fel: â€id†krävs."
-#: ../clients/cli/connections.c:4167
+#: ../clients/cli/connections.c:4528
#, c-format
msgid "Error: 'id': '%s' is not valid; use <0-4095>."
msgstr "Fel: â€idâ€: â€%s†är inte giltigt: använd <0-4095>."
-#: ../clients/cli/connections.c:4177
+#: ../clients/cli/connections.c:4538
#, c-format
msgid "Error: 'dev': '%s' is neither UUID, interface name, nor MAC."
msgstr "Fel: â€devâ€: â€%s†är varken UUID, gränssnittsnamn eller MAC."
-#: ../clients/cli/connections.c:4311
+#: ../clients/cli/connections.c:4672
#, c-format
msgid "Error: 'mode': %s."
-msgstr "Fel: â€modeâ€: %s"
+msgstr "Fel: â€modeâ€: %s."
-#: ../clients/cli/connections.c:4320
+#: ../clients/cli/connections.c:4681
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name."
msgstr "Fel: â€primaryâ€: â€%s†är inte ett giltigt gränssnittsnamn."
-#: ../clients/cli/connections.c:4372 ../clients/cli/connections.c:4470
-#: ../clients/cli/connections.c:4672
+#: ../clients/cli/connections.c:4733 ../clients/cli/connections.c:4831
+#: ../clients/cli/connections.c:5033
msgid "Error: 'master' is required."
msgstr "Fel: â€master†krävs."
-#: ../clients/cli/connections.c:4378 ../clients/cli/connections.c:4476
-#: ../clients/cli/connections.c:4678
+#: ../clients/cli/connections.c:4739 ../clients/cli/connections.c:4837
+#: ../clients/cli/connections.c:5039
#, c-format
msgid "Warning: master='%s' doesn't refer to any existing profile.\n"
msgstr "Varning: master=â€%s†hänvisar inte till nÃ¥gon befintlig profil.\n"
-#: ../clients/cli/connections.c:4381 ../clients/cli/connections.c:4484
-#: ../clients/cli/connections.c:4681
+#: ../clients/cli/connections.c:4742 ../clients/cli/connections.c:4845
+#: ../clients/cli/connections.c:5042
#, c-format
-msgid ""
-"Warning: 'type' is currently ignored. We only support ethernet slaves for "
-"now.\n"
-msgstr ""
-"Varning: â€type†ignoreras för närvarande. Vi stöder bara trÃ¥dbundna slavar "
-"för tillfället.\n"
+msgid "Warning: 'type' is currently ignored. We only support ethernet slaves for now.\n"
+msgstr "Varning: â€type†ignoreras för närvarande. Vi stöder bara trÃ¥dbundna slavar för tillfället.\n"
-#: ../clients/cli/connections.c:4578
+#: ../clients/cli/connections.c:4939
#, c-format
msgid "Error: 'stp': %s."
msgstr "Fel: â€stpâ€: %s."
-#: ../clients/cli/connections.c:4708
+#: ../clients/cli/connections.c:5069
#, c-format
msgid "Error: 'hairpin': %s."
msgstr "Fel: â€hairpinâ€: %s."
-#: ../clients/cli/connections.c:4761
+#: ../clients/cli/connections.c:5122
msgid "Error: 'vpn-type' is required."
msgstr "Fel: â€vpn-type†krävs."
-#: ../clients/cli/connections.c:4768
+#: ../clients/cli/connections.c:5129
#, c-format
msgid "Warning: 'vpn-type': %s not known.\n"
msgstr "Varning: â€vpn-typeâ€: %s okänd.\n"
-#: ../clients/cli/connections.c:4829
+#: ../clients/cli/connections.c:5190
#, c-format
msgid "Error: 'channel': '%s' is not valid; use <1-13>."
msgstr "Fel: â€channelâ€: â€%s†är inte giltigt; använd <1-13>."
-#: ../clients/cli/connections.c:4861
+#: ../clients/cli/connections.c:5226
#, c-format
msgid "Error: '%s' is not a valid connection type."
msgstr "Fel: â€%s†är inte en giltig anslutningstyp."
-#: ../clients/cli/connections.c:4961
+#: ../clients/cli/connections.c:5270
+#, c-format
+msgid "Error: IPv4 gateway specified without IPv4 addresses"
+msgstr "Fel: IPv4-gateway angiven utan IPv4-adresser"
+
+#: ../clients/cli/connections.c:5274
+#, c-format
+msgid "Error: multiple IPv4 gateways specified"
+msgstr "Fel: flera IPv4-gateways angivna"
+
+#: ../clients/cli/connections.c:5278
+#, c-format
+msgid "Error: Invalid IPv4 gateway '%s'"
+msgstr "Fel: ogiltig IPv4-gateway â€%sâ€"
+
+#: ../clients/cli/connections.c:5303
+#, c-format
+msgid "Error: IPv6 gateway specified without IPv6 addresses"
+msgstr "Fel: IPv6-gateway angiven utan IPv6-adresser"
+
+#: ../clients/cli/connections.c:5307
+#, c-format
+msgid "Error: multiple IPv6 gateways specified"
+msgstr "Fel: flera IPv6-gateways angivna"
+
+#: ../clients/cli/connections.c:5311
+#, c-format
+msgid "Error: Invalid IPv6 gateway '%s'"
+msgstr "Fel: ogiltig IPv6-gateway â€%sâ€"
+
+#: ../clients/cli/connections.c:5371
#, c-format
msgid "Error: Failed to add '%s' connection: %s"
msgstr "Fel: Misslyckades med att lägga till â€%sâ€-anslutning: %s"
-#: ../clients/cli/connections.c:4966
+#: ../clients/cli/connections.c:5376
#, c-format
msgid "Connection '%s' (%s) successfully added.\n"
msgstr "Anslutning â€%s†(%s) lades till.\n"
-#: ../clients/cli/connections.c:5177
+#: ../clients/cli/connections.c:5596
#, c-format
msgid "Error: 'type' argument is required."
msgstr "Fel: â€typeâ€-argument saknas."
-#: ../clients/cli/connections.c:5185
+#: ../clients/cli/connections.c:5604
#, c-format
msgid "Error: invalid connection type; %s."
msgstr "Fel: ogiltig anslutningstyp; %s."
-#: ../clients/cli/connections.c:5194
+#: ../clients/cli/connections.c:5613
#, c-format
msgid "Error: 'autoconnect': %s."
msgstr "Fel: â€autoconnectâ€: %s."
-#: ../clients/cli/connections.c:5204
+#: ../clients/cli/connections.c:5623
#, c-format
msgid "Error: 'save': %s."
msgstr "Fel: â€saveâ€: %s."
-#: ../clients/cli/connections.c:5220
+#: ../clients/cli/connections.c:5639
msgid "Interface name [*]: "
-msgstr "Gränssnittsnamn [*]:"
+msgstr "Gränssnittsnamn [*]: "
-#: ../clients/cli/connections.c:5225
+#: ../clients/cli/connections.c:5644
#, c-format
msgid "Error: 'ifname' argument is required."
msgstr "Fel: â€ifnameâ€-argument krävs."
-#: ../clients/cli/connections.c:5232
+#: ../clients/cli/connections.c:5651
#, c-format
msgid "Error: 'ifname': '%s' is not a valid interface nor '*'."
-msgstr ""
-"Fel: â€ifnameâ€: â€%s†är inte ett giltigt gränssnittsnamn, inte heller â€*â€."
+msgstr "Fel: â€ifnameâ€: â€%s†är inte ett giltigt gränssnittsnamn, inte heller â€*â€."
-#: ../clients/cli/connections.c:6020
+#: ../clients/cli/connections.c:6427
#, c-format
msgid "['%s' setting values]\n"
msgstr "[â€%sâ€-inställningsvärden]\n"
@@ -2064,17 +2185,16 @@ msgstr "[â€%sâ€-inställningsvärden]\n"
#. TRANSLATORS: do not translate command names and keywords before ::
#. * However, you should translate terms enclosed in <>.
#.
-#: ../clients/cli/connections.c:6102
+#: ../clients/cli/connections.c:6509
#, c-format
msgid ""
"---[ Main menu ]---\n"
"goto [<setting> | <prop>] :: go to a setting or property\n"
-"remove <setting>[.<prop>] | <prop> :: remove setting or reset property "
-"value\n"
+"remove <setting>[.<prop>] | <prop> :: remove setting or reset property value\n"
"set [<setting>.<prop> <value>] :: set property value\n"
"describe [<setting>.<prop>] :: describe property\n"
"print [all | <setting>[.<prop>]] :: print the connection\n"
-"verify [all] :: verify the connection\n"
+"verify [all | fix] :: verify the connection\n"
"save [persistent|temporary] :: save the connection\n"
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
"back :: go one level up (back)\n"
@@ -2083,22 +2203,20 @@ msgid ""
"quit :: exit nmcli\n"
msgstr ""
"---[ Huvudmeny ]---\n"
-"goto [<inställning> | <egenskap>] :: gå till inställning eller "
-"egenskap\n"
-"remove <inställning>[.<egenskap>] | <egenskap> :: ta bort inställning "
-"eller återståll egenskapsvärde\n"
+"goto [<inställning> | <egenskap>] :: gå till inställning eller egenskap\n"
+"remove <inställning>[.<egenskap>] | <egenskap> :: ta bort inställning eller återställ egenskapsvärde\n"
"set [<inställning>.<egenskap> <värde>] :: sätt egenskapsvärde\n"
"describe [<inställning>.<egenskap>] :: beskriv egenskap\n"
"print [all | <inställning>[.<egenskap>]] :: skriv ut anslutning\n"
-"verify [all] :: verifiera anslutning\n"
+"verify [all | fix] :: verifiera anslutning\n"
"save [persistent|temporary] :: spara anslutning\n"
-"activate [<grnamn>] [/<ap>|<nsp>] :: aktivera ansluting\n"
+"activate [<grnamn>] [/<ap>|<nsp>] :: aktivera anslutning\n"
"back :: gå upp en nivå (backa)\n"
"help/? [<kommando>] :: skriv ut denna hjälp\n"
"nmcli <konf-flagga> <value> :: nmcli-konfiguration\n"
"quit :: avsluta nmcli\n"
-#: ../clients/cli/connections.c:6129
+#: ../clients/cli/connections.c:6536
#, c-format
msgid ""
"goto <setting>[.<prop>] | <prop> :: enter setting/property for editing\n"
@@ -2109,8 +2227,7 @@ msgid ""
" nmcli connection> goto secondaries\n"
" nmcli> goto ipv4.addresses\n"
msgstr ""
-"goto <inställning>[.<egenskap>] | <egenskap> :: ange inställning/egenskap "
-"för redigering\n"
+"goto <inställning>[.<egenskap>] | <egenskap> :: ange inställning/egenskap för redigering\n"
"\n"
"Det här kommandot anger en inställning eller egenskap för redigering.\n"
"\n"
@@ -2118,29 +2235,26 @@ msgstr ""
" nmcli connection> goto secondaries\n"
" nmcli> goto ipv4.addresses\n"
-#: ../clients/cli/connections.c:6136
+#: ../clients/cli/connections.c:6543
#, c-format
msgid ""
"remove <setting>[.<prop>] :: remove setting or reset property value\n"
"\n"
-"This command removes an entire setting from the connection, or if a "
-"property\n"
+"This command removes an entire setting from the connection, or if a property\n"
"is given, resets that property to the default value.\n"
"\n"
"Examples: nmcli> remove wifi-sec\n"
" nmcli> remove eth.mtu\n"
msgstr ""
-"remove <inställning>[.<egenskap>] :: ta bort inställning eller återställ "
-"egenskapsvärde\n"
+"remove <inställning>[.<egenskap>] :: ta bort inställning eller återställ egenskapsvärde\n"
"\n"
-"Kommandot tar bort en hel inställning från anslutningen, eller om en "
-"egenskap\n"
+"Kommandot tar bort en hel inställning från anslutningen, eller om en egenskap\n"
"angetts, återställs egenskapen till standardvärdet.\n"
"\n"
"Exempel: nmcli> remove wifi-sec\n"
" nmcli> remove eth.mtu\n"
-#: ../clients/cli/connections.c:6143
+#: ../clients/cli/connections.c:6550
#, c-format
msgid ""
"set [<setting>.<prop> <value>] :: set property value\n"
@@ -2155,20 +2269,18 @@ msgstr ""
"\n"
"Exempel: nmcli> set con.id My connection\n"
-#: ../clients/cli/connections.c:6148
+#: ../clients/cli/connections.c:6555
#, c-format
msgid ""
"describe [<setting>.<prop>] :: describe property\n"
"\n"
-"Shows property description. You can consult nm-settings(5) manual page to "
-"see all NM settings and properties.\n"
+"Shows property description. You can consult nm-settings(5) manual page to see all NM settings and properties.\n"
msgstr ""
"describe [<inställning>.<egenskap>] :: beskriv egenskap\n"
"\n"
-"Visar egenskapsbeskrivning. Du kan titta i handboken för nm-settings(5) för "
-"att se alla NH-inställningar och egenskaper.\n"
+"Visar egenskapsbeskrivning. Du kan titta i handboken för nm-settings(5) för att se alla NH-inställningar och egenskaper.\n"
-#: ../clients/cli/connections.c:6153
+#: ../clients/cli/connections.c:6560
#, c-format
msgid ""
"print [all] :: print setting or connection values\n"
@@ -2183,26 +2295,30 @@ msgstr ""
"\n"
"Exempel: nmcli ipv4> print all\n"
-#: ../clients/cli/connections.c:6158
+#: ../clients/cli/connections.c:6565
#, c-format
msgid ""
-"verify [all] :: verify setting or connection validity\n"
+"verify [all | fix] :: verify setting or connection validity\n"
"\n"
-"Verifies whether the setting or connection is valid and can be saved later. "
-"It indicates invalid values on error.\n"
+"Verifies whether the setting or connection is valid and can be saved later.\n"
+"It indicates invalid values on error. Some errors may be fixed automatically\n"
+"by 'fix' option.\n"
"\n"
"Examples: nmcli> verify\n"
+" nmcli> verify fix\n"
" nmcli bond> verify\n"
msgstr ""
-"verify [all] :: verifiera inställningen eller anslutningens giltighet\n"
+"verify [all | fix] :: verifiera inställningen eller anslutningens giltighet\n"
"\n"
-"Verifierar huruvida inställningen eller anslutningen är giltig och kan "
-"sparas senare. Indikerar ogiltiga värden vid fel.\n"
+"Verifierar huruvida inställningen eller anslutningen är giltig och kan sparas senare.\n"
+"Indikerar ogiltiga värden vid fel. En del fel kan fixas automatiskt\n"
+"genom alternativet â€fixâ€.\n"
"\n"
"Exempel: nmcli> verify\n"
-" nmcli bond> verify\n"
+" nmcli> verify fix\n"
+" nmcli bond> verify\n"
-#: ../clients/cli/connections.c:6165
+#: ../clients/cli/connections.c:6574
#, c-format
msgid ""
"save [persistent|temporary] :: save the connection\n"
@@ -2213,8 +2329,7 @@ msgid ""
"Note that once you save the profile persistently those settings are saved\n"
"across reboot or restart. Subsequent changes can also be temporary or\n"
"persistent, but any temporary changes will not persist across reboot or\n"
-"restart. If you want to fully remove the persistent connection, the "
-"connection\n"
+"restart. If you want to fully remove the persistent connection, the connection\n"
"profile must be deleted.\n"
msgstr ""
"save [persistent|temporary] :: spara anslutningen\n"
@@ -2228,7 +2343,7 @@ msgstr ""
"Om du vill ta bort den sparade anslutningen helt\n"
"måste profilen tas bort.\n"
-#: ../clients/cli/connections.c:6176
+#: ../clients/cli/connections.c:6585
#, c-format
msgid ""
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
@@ -2237,8 +2352,7 @@ msgid ""
"\n"
"Available options:\n"
"<ifname> - device the connection will be activated on\n"
-"/<ap>|<nsp> - AP (Wi-Fi) or NSP (WiMAX) (prepend with / when <ifname> is not "
-"specified)\n"
+"/<ap>|<nsp> - AP (Wi-Fi) or NSP (WiMAX) (prepend with / when <ifname> is not specified)\n"
msgstr ""
"activate [<grnamn>] [/<ap>|<nsp>] :: aktivera anslutningen\n"
"\n"
@@ -2246,10 +2360,9 @@ msgstr ""
"\n"
"Tillgängliga alternativ:\n"
"<grnamn> - den enhet anslutningen kommer att aktiveras på\n"
-"/<ap>|<nsp> - AP (Wi-Fi) eller NSP (WiMAX) (lägg till / i början när "
-"<grnamn> inte anges)\n"
+"/<ap>|<nsp> - AP (Wi-Fi) eller NSP (WiMAX) (lägg till / i början när <grnamn> inte anges)\n"
-#: ../clients/cli/connections.c:6183 ../clients/cli/connections.c:6340
+#: ../clients/cli/connections.c:6592 ../clients/cli/connections.c:6750
#, c-format
msgid ""
"back :: go to upper menu level\n"
@@ -2258,7 +2371,7 @@ msgstr ""
"back :: gå upp en menynivå\n"
"\n"
-#: ../clients/cli/connections.c:6186
+#: ../clients/cli/connections.c:6595
#, c-format
msgid ""
"help/? [<command>] :: help for the nmcli commands\n"
@@ -2267,7 +2380,7 @@ msgstr ""
"help/? [<kommando>] :: hjälp för nmcli-kommandot\n"
"\n"
-#: ../clients/cli/connections.c:6189
+#: ../clients/cli/connections.c:6598
#, c-format
msgid ""
"nmcli [<conf-option> <value>] :: nmcli configuration\n"
@@ -2275,6 +2388,7 @@ msgid ""
"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"
@@ -2295,6 +2409,7 @@ msgstr ""
"Konfigurerar nmcli. Följande flaggor är tillgängliga:\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 = [30mblack[0m\n"
@@ -2307,24 +2422,22 @@ msgstr ""
" 8 = [37mwhite[0m\n"
"\n"
"Exempel: nmcli> nmcli status-line yes\n"
-" nmcli> nmcli save-confirmation no\n"
-" nmcli> nmcli prompt-color 3\n"
+" nmcli> nmcli save-confirmation no\n"
+" nmcli> nmcli prompt-color 3\n"
-#: ../clients/cli/connections.c:6209 ../clients/cli/connections.c:6346
+#: ../clients/cli/connections.c:6619 ../clients/cli/connections.c:6756
#, c-format
msgid ""
"quit :: exit nmcli\n"
"\n"
-"This command exits nmcli. When the connection being edited is not saved, the "
-"user is asked to confirm the action.\n"
+"This command exits nmcli. When the connection being edited is not saved, the user is asked to confirm the action.\n"
msgstr ""
"quit :: avsluta nmcli\n"
"\n"
-"Kommandot avslutar nmcli. När anslutningen som redigerats inte sparas frågas "
-"användaren om att bekräfta åtgärden.\n"
+"Kommandot avslutar nmcli. När anslutningen som redigerats inte sparas frågas användaren om att bekräfta åtgärden.\n"
-#: ../clients/cli/connections.c:6214 ../clients/cli/connections.c:6351
-#: ../clients/cli/connections.c:6755 ../clients/cli/connections.c:7644
+#: ../clients/cli/connections.c:6624 ../clients/cli/connections.c:6761
+#: ../clients/cli/connections.c:7172 ../clients/cli/connections.c:8088
#, c-format
msgid "Unknown command: '%s'\n"
msgstr "Okänt kommando: â€%sâ€\n"
@@ -2332,7 +2445,7 @@ msgstr "Okänt kommando: â€%sâ€\n"
#. TRANSLATORS: do not translate command names and keywords before ::
#. * However, you should translate terms enclosed in <>.
#.
-#: ../clients/cli/connections.c:6280
+#: ../clients/cli/connections.c:6690
#, c-format
msgid ""
"---[ Property menu ]---\n"
@@ -2341,27 +2454,23 @@ msgid ""
"change :: change current value\n"
"remove [<index> | <option>] :: delete the value\n"
"describe :: describe property\n"
-"print [setting | connection] :: print property (setting/connection) "
-"value(s)\n"
+"print [setting | connection] :: print property (setting/connection) value(s)\n"
"back :: go to upper level\n"
"help/? [<command>] :: print this help or command description\n"
"quit :: exit nmcli\n"
msgstr ""
"---[ Egenskapsmeny ]---\n"
"set [<värde>] :: sätt nytt värde\n"
-"add [<värde>] :: lägg till nytt alternativ till "
-"egenskapen\n"
+"add [<värde>] :: lägg till nytt alternativ till egenskapen\n"
"change :: ändra aktuellt värde\n"
"remove [<index> | <flagga>] :: ta bort värdet\n"
"describe :: beskriv egenskapen\n"
-"print [setting | connection] :: skriv ut egenskapen (inställnings-/"
-"anslutnings-) värden)\n"
+"print [setting | connection] :: skriv ut egenskapen (inställnings-/anslutnings-) värden)\n"
"back :: gå upp en nivå\n"
-"help/? [<kommando>] :: skriv ut denna hjälp- eller "
-"kommandobeskrivning\n"
+"help/? [<kommando>] :: skriv ut denna hjälp- eller kommandobeskrivning\n"
"quit :: avsluta nmcli\n"
-#: ../clients/cli/connections.c:6305
+#: ../clients/cli/connections.c:6715
#, c-format
msgid ""
"set [<value>] :: set new value\n"
@@ -2372,22 +2481,18 @@ msgstr ""
"\n"
"Detta kommando sätter angivet <värde> till denna egenskap\n"
-#: ../clients/cli/connections.c:6309
+#: ../clients/cli/connections.c:6719
#, c-format
msgid ""
"add [<value>] :: append new value to the property\n"
"\n"
-"This command adds provided <value> to this property, if the property is of a "
-"container type. For single-valued properties the property value is replaced "
-"(same as 'set').\n"
+"This command adds provided <value> to this property, if the property is of a container type. For single-valued properties the property value is replaced (same as 'set').\n"
msgstr ""
"add [<värde>] :: lägg till nytt värde till egenskapen\n"
"\n"
-"Detta kommando lägger till angivet <värde> till denna egenskap, om "
-"egenskapen är av en behållartyp. För egenskaper med ett värde ersätts "
-"egenskapsvärdet (samma som â€setâ€).\n"
+"Detta kommando lägger till angivet <värde> till denna egenskap, om egenskapen är av en behÃ¥llartyp. För egenskaper med ett värde ersätts egenskapsvärdet (samma som â€setâ€).\n"
-#: ../clients/cli/connections.c:6315
+#: ../clients/cli/connections.c:6725
#, c-format
msgid ""
"change :: change current value\n"
@@ -2398,18 +2503,15 @@ msgstr ""
"\n"
"Visar aktuellt värde och tillåter redigering av det.\n"
-#: ../clients/cli/connections.c:6319
+#: ../clients/cli/connections.c:6729
#, c-format
msgid ""
"remove [<value>|<index>|<option name>] :: delete the value\n"
"\n"
"Removes the property value. For single-valued properties, this sets the\n"
-"property back to its default value. For container-type properties, this "
-"removes\n"
-"all the values of that property, or you can specify an argument to remove "
-"just\n"
-"a single item or option. The argument is either a value or index of the item "
-"to\n"
+"property back to its default value. For container-type properties, this removes\n"
+"all the values of that property, or you can specify an argument to remove just\n"
+"a single item or option. The argument is either a value or index of the item to\n"
"remove, or an option name (for properties with named options).\n"
"\n"
"Examples: nmcli ipv4.dns> remove 8.8.8.8\n"
@@ -2420,49 +2522,39 @@ msgstr ""
"remove [<värde>|<index>|<alternativnamn>] :: ta bort värdet\n"
"\n"
"Tar bort egenskapsvärdet. För enskilda egenskapsvärden sätter denna\n"
-"egenskapen till dess standardvärde. För värden av behållartyp tar denna "
-"bort\n"
-"alla värden egenskapen har, eller så kan du ange ett argument för att ta "
-"bort endast\n"
-"ett enskilt objekt eller alternativ. Argumentet är antingen ett värde eller "
-"index för objektet som ska\n"
-"tas bort, eller ett alternativt namn (för egenskaper med namngivna "
-"alternativ).\n"
+"egenskapen till dess standardvärde. För värden av behållartyp tar denna bort\n"
+"alla värden egenskapen har, eller så kan du ange ett argument för att ta bort endast\n"
+"ett enskilt objekt eller alternativ. Argumentet är antingen ett värde eller index för objektet som ska\n"
+"tas bort, eller ett alternativt namn (för egenskaper med namngivna alternativ).\n"
"\n"
"Exempel: nmcli ipv4.dns> remove 8.8.8.8\n"
" nmcli ipv4.dns> remove 2\n"
" nmcli bond.options> remove downdelay\n"
"\n"
-#: ../clients/cli/connections.c:6330
+#: ../clients/cli/connections.c:6740
#, c-format
msgid ""
"describe :: describe property\n"
"\n"
-"Shows property description. You can consult nm-settings(5) manual page to "
-"see all NM settings and properties.\n"
+"Shows property description. You can consult nm-settings(5) manual page to see all NM settings and properties.\n"
msgstr ""
"describe :: beskriv egenskap\n"
"\n"
-"Visar egenskapsbeskrivning. Se nm-settings(5)-manualen för att se alla NM-"
-"inställningar och egenskaper.\n"
+"Visar egenskapsbeskrivning. Se nm-settings(5)-manualen för att se alla NM-inställningar och egenskaper.\n"
-#: ../clients/cli/connections.c:6335
+#: ../clients/cli/connections.c:6745
#, c-format
msgid ""
-"print [property|setting|connection] :: print property (setting, connection) "
-"value(s)\n"
+"print [property|setting|connection] :: print property (setting, connection) value(s)\n"
"\n"
-"Shows property value. Providing an argument you can also display values for "
-"the whole setting or connection.\n"
+"Shows property value. Providing an argument you can also display values for the whole setting or connection.\n"
msgstr ""
-"print [property|setting|connection] :: utskriftsegenskap (inställning, "
-"anslutning) värde(n)\n"
+"print [property|setting|connection] :: utskriftsegenskap (inställning, anslutning) värde(n)\n"
"\n"
-"Visar egenskapsvärdet. Med argument kan du också visa värden för hela "
-"inställningen eller anslutningen.\n"
+"Visar egenskapsvärdet. Med argument kan du också visa värden för hela inställningen eller anslutningen.\n"
-#: ../clients/cli/connections.c:6343
+#: ../clients/cli/connections.c:6753
#, c-format
msgid ""
"help/? [<command>] :: help for nmcli commands\n"
@@ -2471,752 +2563,749 @@ msgstr ""
"help/? [<kommando>] :: hjälp för nmcli-kommandon\n"
"\n"
-#: ../clients/cli/connections.c:6441
+#: ../clients/cli/connections.c:6851
#, c-format
msgid "Error: Connection activation failed.\n"
msgstr "Fel: Aktivering av anslutning misslyckades.\n"
-#: ../clients/cli/connections.c:6524
+#: ../clients/cli/connections.c:6934
#, c-format
msgid "Error: setting '%s' is mandatory and cannot be removed.\n"
msgstr "Fel: inställningen â€%s†är obligatorisk och kan inte tas bort.\n"
#. TRANSLATORS: status line in nmcli connection editor
-#: ../clients/cli/connections.c:6542
+#: ../clients/cli/connections.c:6952
#, c-format
msgid "[ Type: %s | Name: %s | UUID: %s | Dirty: %s | Temp: %s ]\n"
msgstr "[ Typ: %s | Namn: %s | UUID: %s | Dirty: %s | Temp: %s ]\n"
-#: ../clients/cli/connections.c:6577
+#: ../clients/cli/connections.c:6988
#, c-format
msgid "The connection is not saved. Do you really want to quit? %s"
msgstr "Anslutningen sparas inte. Vill du verkligen avsluta? %s"
-#: ../clients/cli/connections.c:6622
+#: ../clients/cli/connections.c:7033
#, c-format
-msgid ""
-"The connection profile has been removed from another client. You may type "
-"'save' in the main menu to restore it.\n"
-msgstr ""
-"Anslutningsprofilen har tagits bort från en annan klient. Du kan skriva "
-"â€save†i huvudmenyn för att Ã¥terställa den.\n"
+msgid "The connection profile has been removed from another client. You may type 'save' in the main menu to restore it.\n"
+msgstr "Anslutningsprofilen har tagits bort frÃ¥n en annan klient. Du kan skriva â€save†i huvudmenyn för att Ã¥terställa den.\n"
-#: ../clients/cli/connections.c:6644 ../clients/cli/connections.c:7059
-#: ../clients/cli/connections.c:7114
+#: ../clients/cli/connections.c:7055 ../clients/cli/connections.c:7476
+#: ../clients/cli/connections.c:7531
#, c-format
msgid "Enter '%s' value: "
-msgstr "Ange â€%sâ€-värde:"
+msgstr "Ange â€%sâ€-värde: "
-#: ../clients/cli/connections.c:6659 ../clients/cli/connections.c:6677
-#: ../clients/cli/connections.c:7063 ../clients/cli/connections.c:7119
+#: ../clients/cli/connections.c:7070 ../clients/cli/connections.c:7092
+#: ../clients/cli/connections.c:7480 ../clients/cli/connections.c:7536
#, c-format
msgid "Error: failed to set '%s' property: %s\n"
msgstr "Fel: misslyckades med att sätta â€%sâ€-egenskapen: %s\n"
-#: ../clients/cli/connections.c:6671
+#: ../clients/cli/connections.c:7086
#, c-format
msgid "Edit '%s' value: "
-msgstr "Redigera â€%sâ€-värde:"
+msgstr "Redigera â€%sâ€-värde: "
-#: ../clients/cli/connections.c:6698
+#: ../clients/cli/connections.c:7115
#, c-format
msgid "Error: %s\n"
msgstr "Fel: %s\n"
-#: ../clients/cli/connections.c:6704 ../clients/cli/connections.c:7198
-#: ../clients/cli/connections.c:7239
+#: ../clients/cli/connections.c:7121 ../clients/cli/connections.c:7615
+#: ../clients/cli/connections.c:7656
#, c-format
msgid "Error: failed to remove value of '%s': %s\n"
msgstr "Fel: misslyckades med att ta bort värdet â€%sâ€: %s\n"
-#: ../clients/cli/connections.c:6725
+#: ../clients/cli/connections.c:7142
#, c-format
msgid "Unknown command argument: '%s'\n"
msgstr "Okänt kommandoargument: â€%sâ€\n"
-#: ../clients/cli/connections.c:6851
+#: ../clients/cli/connections.c:7268
#, c-format
msgid "Available settings: %s\n"
msgstr "Tillgängliga inställningar: %s\n"
-#: ../clients/cli/connections.c:6860
+#: ../clients/cli/connections.c:7277
#, c-format
msgid "Error: invalid setting name; %s\n"
-msgstr "Fel: ogiltig namn på inställning; %s\n"
+msgstr "Fel: ogiltigt namn på inställning; %s\n"
-#: ../clients/cli/connections.c:6877
+#: ../clients/cli/connections.c:7294
#, c-format
msgid "Available properties: %s\n"
msgstr "Tillgängliga egenskaper: %s\n"
-#: ../clients/cli/connections.c:6885
+#: ../clients/cli/connections.c:7302
#, c-format
msgid "Error: property %s\n"
msgstr "Fel: egenskapen %s\n"
-#: ../clients/cli/connections.c:6926
+#: ../clients/cli/connections.c:7343
#, c-format
msgid ""
-"Saving the connection with 'autoconnect=yes'. That might result in an "
-"immediate activation of the connection.\n"
+"Saving the connection with 'autoconnect=yes'. That might result in an immediate activation of the connection.\n"
"Do you still want to save? %s"
msgstr ""
-"Sparar anslutningen med â€autoconnect=yes†Det kan resultera i att "
-"anslutningen aktiveras omedelbart.\n"
+"Sparar anslutningen med â€autoconnect=yes†Det kan resultera i att anslutningen aktiveras omedelbart.\n"
"Vill du fortfarande spara? %s"
-#: ../clients/cli/connections.c:7001
+#: ../clients/cli/connections.c:7418
#, c-format
msgid "You may edit the following settings: %s\n"
msgstr "Du kan redigera följande inställningar: %s\n"
-#: ../clients/cli/connections.c:7028
+#: ../clients/cli/connections.c:7445
#, c-format
-msgid ""
-"The connection profile has been removed from another client. You may type "
-"'save' to restore it.\n"
-msgstr ""
-"Anslutningsprofilen har tagits bort från en annan klient. Du kan skriva "
-"â€save†för att Ã¥terställa den.\n"
+msgid "The connection profile has been removed from another client. You may type 'save' to restore it.\n"
+msgstr "Anslutningsprofilen har tagits bort frÃ¥n en annan klient. Du kan skriva â€save†för att Ã¥terställa den.\n"
-#: ../clients/cli/connections.c:7057 ../clients/cli/connections.c:7112
+#: ../clients/cli/connections.c:7474 ../clients/cli/connections.c:7529
#, c-format
msgid "Allowed values for '%s' property: %s\n"
msgstr "Tillgängliga värden för â€%sâ€-egenskapen: %s\n"
-#: ../clients/cli/connections.c:7067 ../clients/cli/connections.c:7281
+#: ../clients/cli/connections.c:7484 ../clients/cli/connections.c:7698
#, c-format
msgid "Error: no setting selected; valid are [%s]\n"
msgstr "Fel: ingen inställning vald; giltiga är [%s]\n"
-#: ../clients/cli/connections.c:7068
+#: ../clients/cli/connections.c:7485
#, c-format
msgid "use 'goto <setting>' first, or 'set <setting>.<property>'\n"
-msgstr ""
-"använd â€goto <inställning>†först eller â€set <inställning>.<egenskap>â€\n"
+msgstr "använd â€goto <inställning>†först eller â€set <inställning>.<egenskap>â€\n"
-#: ../clients/cli/connections.c:7082 ../clients/cli/connections.c:7218
-#: ../clients/cli/connections.c:7298
+#: ../clients/cli/connections.c:7499 ../clients/cli/connections.c:7635
+#: ../clients/cli/connections.c:7715
#, c-format
msgid "Error: invalid setting argument '%s'; valid are [%s]\n"
msgstr "Fel: ogiltigt argument för inställningen â€%sâ€; giltiga är [%s]\n"
-#: ../clients/cli/connections.c:7092
+#: ../clients/cli/connections.c:7509
#, c-format
msgid "Error: missing setting for '%s' property\n"
msgstr "Fel: saknar inställning för egenskapen â€%sâ€\n"
-#: ../clients/cli/connections.c:7099
+#: ../clients/cli/connections.c:7516
#, c-format
msgid "Error: invalid property: %s\n"
msgstr "Fel: ogiltig egenskap: %s\n"
-#: ../clients/cli/connections.c:7146
+#: ../clients/cli/connections.c:7563
#, c-format
msgid "Error: unknown setting '%s'\n"
msgstr "Fel: Okänd inställning: â€%sâ€\n"
-#: ../clients/cli/connections.c:7159
+#: ../clients/cli/connections.c:7576
#, c-format
msgid "You may edit the following properties: %s\n"
msgstr "Du kan redigera följande egenskaper: %s\n"
-#: ../clients/cli/connections.c:7203
+#: ../clients/cli/connections.c:7620
#, c-format
msgid "Error: no argument given; valid are [%s]\n"
msgstr "Fel: inga argument givna; giltiga är [%s]\n"
-#: ../clients/cli/connections.c:7216
+#: ../clients/cli/connections.c:7633
#, c-format
msgid "Setting '%s' is not present in the connection.\n"
-msgstr "Inställningen â€%s†är finns inte i anslutningen.\n"
+msgstr "Inställningen â€%s†finns inte i anslutningen.\n"
-#: ../clients/cli/connections.c:7257
+#: ../clients/cli/connections.c:7674
#, c-format
msgid "Error: %s properties, nor it is a setting name.\n"
msgstr "Fel: %s-egenskaper, inte heller ett inställningsnamn.\n"
-#: ../clients/cli/connections.c:7282
+#: ../clients/cli/connections.c:7699
#, c-format
msgid "use 'goto <setting>' first, or 'describe <setting>.<property>'\n"
-msgstr ""
-"använd â€goto <inställning>†först, eller â€describe <inställning>."
-"<egenskap>â€\n"
+msgstr "använd â€goto <inställning>†först, eller â€describe <inställning>.<egenskap>â€\n"
-#: ../clients/cli/connections.c:7323
+#: ../clients/cli/connections.c:7740
#, c-format
msgid "Error: invalid property: %s, neither a valid setting name.\n"
-msgstr ""
-"Fel: ogiltig egenskap: %s, och inte heller ett giltigt inställningsnamn.\n"
+msgstr "Fel: ogiltig egenskap: %s, och inte heller ett giltigt inställningsnamn.\n"
-#: ../clients/cli/connections.c:7352
+#: ../clients/cli/connections.c:7769
#, c-format
msgid "Error: unknown setting: '%s'\n"
msgstr "Fel: okänd inställning: â€%sâ€\n"
-#: ../clients/cli/connections.c:7357
+#: ../clients/cli/connections.c:7774
#, c-format
msgid "Error: '%s' setting not present in the connection\n"
msgstr "Fel: inställningen â€%s†finns inte i anslutningen\n"
-#: ../clients/cli/connections.c:7382
+#: ../clients/cli/connections.c:7799
#, c-format
msgid "Error: invalid property: %s%s\n"
msgstr "Fel: ogiltig egenskap: %s%s\n"
-#: ../clients/cli/connections.c:7384
+#: ../clients/cli/connections.c:7801
msgid ", neither a valid setting name"
msgstr ", inte heller ett giltigt inställningsnamn"
-#: ../clients/cli/connections.c:7404
+#: ../clients/cli/connections.c:7818
+#, c-format
+msgid "Invalid verify option: %s\n"
+msgstr "Ogiltigt kontrollalternativ â€%sâ€\n"
+
+#: ../clients/cli/connections.c:7826
#, c-format
msgid "Verify setting '%s': %s\n"
msgstr "Verifiera inställningen â€%sâ€: %s\n"
-#: ../clients/cli/connections.c:7411
+#: ../clients/cli/connections.c:7841
#, c-format
msgid "Verify connection: %s\n"
msgstr "Verifiera anslutningen: %s\n"
-#: ../clients/cli/connections.c:7429
+#: ../clients/cli/connections.c:7844
+#, c-format
+msgid "The error cannot be fixed automatically.\n"
+msgstr "Felet kan inte lagas automatiskt.\n"
+
+#: ../clients/cli/connections.c:7861
#, c-format
msgid "Error: invalid argument '%s'\n"
msgstr "Fel: ogiltigt argument â€%sâ€\n"
-#: ../clients/cli/connections.c:7462
+#: ../clients/cli/connections.c:7894
#, c-format
msgid "Error: Failed to save '%s' (%s) connection: %s\n"
msgstr "Fel: Misslyckades med att spara â€%s†(%s)-anslutning %s\n"
-#: ../clients/cli/connections.c:7469
+#: ../clients/cli/connections.c:7901
#, c-format
msgid "Connection '%s' (%s) successfully saved.\n"
msgstr "Anslutningen â€%s†(%s) sparades.\n"
-#: ../clients/cli/connections.c:7470
+#: ../clients/cli/connections.c:7902
#, c-format
msgid "Connection '%s' (%s) successfully updated.\n"
msgstr "Anslutningen â€%s†(%s) uppdaterades.\n"
-#: ../clients/cli/connections.c:7503
+#: ../clients/cli/connections.c:7935
#, c-format
msgid "Error: connection verification failed: %s\n"
msgstr "Fel: verifiering av anslutning misslyckades: %s\n"
-#: ../clients/cli/connections.c:7504
+#: ../clients/cli/connections.c:7936
msgid "(unknown error)"
msgstr "(okänt fel)"
-#: ../clients/cli/connections.c:7525
+#: ../clients/cli/connections.c:7937
+#, c-format
+msgid "You may try running 'verify fix' to fix errors.\n"
+msgstr "Du kan prova att köra â€verify fix†för att laga fel.\n"
+
+#: ../clients/cli/connections.c:7959
#, c-format
msgid "Error: connection is not saved. Type 'save' first.\n"
msgstr "Fel: anslutningen sparas ej. Skriv â€save†först.\n"
-#: ../clients/cli/connections.c:7529
+#: ../clients/cli/connections.c:7963
#, c-format
msgid "Error: connection is not valid: %s\n"
msgstr "Fel: anslutningen är inte giltig: %s\n"
-#: ../clients/cli/connections.c:7539
+#: ../clients/cli/connections.c:7973
#, c-format
msgid "Error: Cannot activate connection: %s.\n"
msgstr "Fel: Kan inte aktivera anslutningen: %s.\n"
-#: ../clients/cli/connections.c:7549
+#: ../clients/cli/connections.c:7983
#, c-format
msgid "Error: Failed to activate '%s' (%s) connection: %s\n"
msgstr "Fel: Misslyckades med att aktivera â€%s†(%s)-anslutning: %s\n"
-#: ../clients/cli/connections.c:7555
+#: ../clients/cli/connections.c:7989
#, c-format
msgid "Monitoring connection activation (press any key to continue)\n"
-msgstr ""
-"Övervakar anslutningsaktivering (tryck valfri tangent för att fortsätta)\n"
+msgstr "Övervakar anslutningsaktivering (tryck valfri tangent för att fortsätta)\n"
-#: ../clients/cli/connections.c:7593
+#: ../clients/cli/connections.c:8027
#, c-format
msgid "Error: status-line: %s\n"
msgstr "Fel: status-line: %s\n"
-#: ../clients/cli/connections.c:7601
+#: ../clients/cli/connections.c:8035
#, c-format
msgid "Error: save-confirmation: %s\n"
msgstr "Fel: save-confirmation: %s\n"
-#: ../clients/cli/connections.c:7609
+#: ../clients/cli/connections.c:8043
+#, c-format
+msgid "Error: show-secrets: %s\n"
+msgstr "Fel: show-secrets: %s\n"
+
+#: ../clients/cli/connections.c:8051
#, c-format
msgid "Error: bad color number: '%s'; use <0-8>\n"
msgstr "Fel: dÃ¥ligt färgnummer: â€%sâ€; använd <0-8>\n"
-#: ../clients/cli/connections.c:7621
+#: ../clients/cli/connections.c:8063
#, c-format
msgid "Current nmcli configuration:\n"
msgstr "Aktuell nmcli-konfiguration:\n"
-#: ../clients/cli/connections.c:7629
+#: ../clients/cli/connections.c:8073
#, c-format
msgid "Invalid configuration option '%s'; allowed [%s]\n"
msgstr "Ogiltigt konfigurationsalternativ â€%sâ€; tillÃ¥tet [%s]\n"
-#: ../clients/cli/connections.c:7871
+#: ../clients/cli/connections.c:8320
#, c-format
msgid "Error: only one of 'id', uuid, or 'path' can be provided."
msgstr "Fel: endast en av â€idâ€, uuid eller â€path†kan ges."
-#: ../clients/cli/connections.c:7883 ../clients/cli/connections.c:8067
-#: ../clients/cli/connections.c:8074
+#: ../clients/cli/connections.c:8332 ../clients/cli/connections.c:8519
+#: ../clients/cli/connections.c:8526
#, c-format
msgid "Error: Unknown connection '%s'."
msgstr "Fel: Okänd anslutning: â€%sâ€."
-#: ../clients/cli/connections.c:7898
+#: ../clients/cli/connections.c:8350
#, c-format
msgid "Warning: editing existing connection '%s'; 'type' argument is ignored\n"
-msgstr ""
-"Varning: redigerar befintliga anslutningen â€%sâ€; â€typeâ€-argument ignoreras\n"
+msgstr "Varning: redigerar befintliga anslutningen â€%sâ€; â€typeâ€-argument ignoreras\n"
-#: ../clients/cli/connections.c:7901
+#: ../clients/cli/connections.c:8353
#, c-format
-msgid ""
-"Warning: editing existing connection '%s'; 'con-name' argument is ignored\n"
-msgstr ""
-"Varning: redigerar befintliga anslutningen â€%sâ€; â€con-nameâ€-argument "
-"ignoreras\n"
+msgid "Warning: editing existing connection '%s'; 'con-name' argument is ignored\n"
+msgstr "Varning: redigerar befintliga anslutningen â€%sâ€; â€con-nameâ€-argument ignoreras\n"
-#: ../clients/cli/connections.c:7915
+#: ../clients/cli/connections.c:8367
#, c-format
msgid "Valid connection types: %s\n"
msgstr "Giltiga anslutningstyper: %s\n"
-#: ../clients/cli/connections.c:7917
+#: ../clients/cli/connections.c:8369
#, c-format
msgid "Error: invalid connection type; %s\n"
msgstr "Fel: ogiltig anslutningstyp: %s\n"
-#: ../clients/cli/connections.c:7956
+#: ../clients/cli/connections.c:8408
#, c-format
msgid "===| nmcli interactive connection editor |==="
msgstr "===| nmcli interaktiv anslutningsredigerare |==="
-#: ../clients/cli/connections.c:7959
+#: ../clients/cli/connections.c:8411
#, c-format
msgid "Editing existing '%s' connection: '%s'"
msgstr "Redigerar befintlig â€%sâ€-anslutning: â€%sâ€"
-#: ../clients/cli/connections.c:7961
+#: ../clients/cli/connections.c:8413
#, c-format
msgid "Adding a new '%s' connection"
msgstr "Lägger till en ny â€%sâ€-anslutning"
-#: ../clients/cli/connections.c:7963
+#: ../clients/cli/connections.c:8415
#, c-format
msgid "Type 'help' or '?' for available commands."
msgstr "Skriv â€help†eller â€?†för tillgängliga kommandon."
-#: ../clients/cli/connections.c:7965
+#: ../clients/cli/connections.c:8417
#, c-format
msgid "Type 'describe [<setting>.<prop>]' for detailed property description."
-msgstr ""
-"Skriv â€describe [<inställning>.<egenskap>]†för en detaljerad "
-"egenskapsbeskrivning."
+msgstr "Skriv â€describe [<inställning>.<egenskap>]†för en detaljerad egenskapsbeskrivning."
-#: ../clients/cli/connections.c:8003
+#: ../clients/cli/connections.c:8455
#, c-format
msgid "Error: Failed to modify connection '%s': %s"
msgstr "Fel: Misslyckades med att ändra konfigurationen: â€%s†%s"
-#: ../clients/cli/connections.c:8010
+#: ../clients/cli/connections.c:8462
#, c-format
msgid "Connection '%s' (%s) successfully modified.\n"
msgstr "Anslutningen â€%s†(%s) ändrades.\n"
-#: ../clients/cli/connections.c:8042
+#: ../clients/cli/connections.c:8494
#, c-format
msgid "Error: No arguments provided."
msgstr "Fel: Inga argument angavs."
-#: ../clients/cli/connections.c:8061
+#: ../clients/cli/connections.c:8513
#, c-format
msgid "Error: connection ID is missing."
msgstr "Fel: anslutnings-ID saknas."
-#: ../clients/cli/connections.c:8083 ../clients/cli/connections.c:8096
+#: ../clients/cli/connections.c:8535 ../clients/cli/connections.c:8548
#, c-format
msgid "Error: <setting>.<property> argument is missing."
msgstr "Fel: <inställning>.<egenskap>-argument saknas."
-#: ../clients/cli/connections.c:8101
+#: ../clients/cli/connections.c:8553
#, c-format
msgid "Error: value for '%s' is missing."
msgstr "Fel: värdet för â€%s†saknas."
-#: ../clients/cli/connections.c:8119
+#: ../clients/cli/connections.c:8571
#, c-format
msgid "Error: invalid <setting>.<property> '%s'."
msgstr "Fel: ogiltig <inställning>.<egenskap> â€%sâ€."
-#: ../clients/cli/connections.c:8127
+#: ../clients/cli/connections.c:8579
#, c-format
msgid "Error: invalid or not allowed setting '%s': %s."
msgstr "Fel: ogiltig eller ej tillÃ¥ten inställning: â€%sâ€: %s."
-#: ../clients/cli/connections.c:8148
+#: ../clients/cli/connections.c:8600
#, c-format
msgid "Error: invalid property '%s': %s."
msgstr "Fel: ogiltig egenskap â€%sâ€: %s."
-#: ../clients/cli/connections.c:8159
+#: ../clients/cli/connections.c:8611
#, c-format
msgid "Error: failed to modify %s.%s: %s."
msgstr "Fel: misslyckades med att ändra %s.%s: %s."
-#: ../clients/cli/connections.c:8177
+#: ../clients/cli/connections.c:8629
#, c-format
msgid "Error: failed to remove a value from %s.%s: %s."
msgstr "Fel: misslyckades att ta bort ett värde från %s.%s: %s."
-#: ../clients/cli/connections.c:8214
+#: ../clients/cli/connections.c:8666
#, c-format
msgid "Error: Connection deletion failed: %s"
msgstr "Fel: Borttagning av anslutningen misslyckades: %s"
-#: ../clients/cli/connections.c:8278
+#: ../clients/cli/connections.c:8730
#, c-format
msgid "Error: unknown connection: %s\n"
msgstr "Fel: Okänd anslutning: %s\n"
#. truncate trailing ", "
-#: ../clients/cli/connections.c:8315
+#: ../clients/cli/connections.c:8767
#, c-format
msgid "Error: cannot delete unknown connection(s): %s."
msgstr "Fel: kan inte ta bort okänd(a) anslutning(ar): %s."
-#: ../clients/cli/connections.c:8332 ../clients/cli/connections.c:8358
-#: ../clients/cli/connections.c:8494 ../clients/cli/devices.c:2786
-#: ../clients/cli/general.c:324 ../clients/cli/general.c:462
-#, c-format
-msgid "Error: NetworkManager is not running."
-msgstr "Fel: Nätverkshanteraren är inte igång."
-
-#: ../clients/cli/connections.c:8338
+#: ../clients/cli/connections.c:8790
#, c-format
msgid "Error: failed to reload connections: %s."
msgstr "Fel: Misslyckades med att läsa om anslutningar: %s."
-#: ../clients/cli/connections.c:8377
+#: ../clients/cli/connections.c:8829
#, c-format
msgid "Error: failed to load connection: %s."
msgstr "Fel: misslyckades med att läsa in anslutningen: %s."
-#: ../clients/cli/connections.c:8385
+#: ../clients/cli/connections.c:8837
#, c-format
msgid "Could not load file '%s'\n"
msgstr "Kunde inte läsa in filen: â€%sâ€\n"
-#: ../clients/cli/connections.c:8550
+#: ../clients/cli/connections.c:9013
#, c-format
msgid "Error: '%s' is not valid 'connection' command."
msgstr "Fel: â€%s†är inte ett giltigt “connection“-kommando."
#. define some prompts
-#: ../clients/cli/devices.c:36
+#: ../clients/cli/devices.c:38
msgid "Interface: "
-msgstr "Gränssnitt:"
+msgstr "Gränssnitt: "
#. 3
#. 17
-#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:73
+#: ../clients/cli/devices.c:46 ../clients/cli/devices.c:75
msgid "CONNECTION"
msgstr "ANSLUTNING"
#. 4
#. 18
-#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:74
+#: ../clients/cli/devices.c:47 ../clients/cli/devices.c:76
msgid "CON-UUID"
msgstr "CON-UUID"
#. 2
-#: ../clients/cli/devices.c:58
+#: ../clients/cli/devices.c:60
msgid "VENDOR"
msgstr "TILLVERKARE"
#. 3
-#: ../clients/cli/devices.c:59
+#: ../clients/cli/devices.c:61
msgid "PRODUCT"
msgstr "PRODUKT"
#. 4
-#: ../clients/cli/devices.c:60
+#: ../clients/cli/devices.c:62
msgid "DRIVER"
msgstr "DRIVRUTIN"
#. 5
-#: ../clients/cli/devices.c:61
+#: ../clients/cli/devices.c:63
msgid "DRIVER-VERSION"
msgstr "DRIVRUTINS-VERSION"
#. 6
-#: ../clients/cli/devices.c:62
+#: ../clients/cli/devices.c:64
msgid "FIRMWARE-VERSION"
msgstr "FAST-PROGRAMVARA-VERSION"
#. 7
-#: ../clients/cli/devices.c:63
+#: ../clients/cli/devices.c:65
msgid "HWADDR"
msgstr "HVADR"
#. 8
-#: ../clients/cli/devices.c:64 ../clients/tui/nmt-page-ethernet.c:86
-#: ../clients/tui/nmt-page-infiniband.c:96 ../clients/tui/nmt-page-vlan.c:130
-#: ../clients/tui/nmt-page-wifi.c:372
+#: ../clients/cli/devices.c:66 ../clients/tui/nmt-page-ethernet.c:86
+#: ../clients/tui/nmt-page-infiniband.c:97 ../clients/tui/nmt-page-vlan.c:131
+#: ../clients/tui/nmt-page-wifi.c:373
msgid "MTU"
msgstr "MTU"
#. 10
-#: ../clients/cli/devices.c:66
+#: ../clients/cli/devices.c:68
msgid "REASON"
msgstr "ANLEDNING"
#. 11
-#: ../clients/cli/devices.c:67
+#: ../clients/cli/devices.c:69
msgid "UDI"
msgstr "UDI"
#. 12
-#: ../clients/cli/devices.c:68
+#: ../clients/cli/devices.c:70
msgid "IP-IFACE"
msgstr "IP-GRÄNS"
#. 13
#. 2
-#: ../clients/cli/devices.c:69 ../clients/cli/devices.c:97
+#: ../clients/cli/devices.c:71 ../clients/cli/devices.c:99
msgid "IS-SOFTWARE"
msgstr "IS-SOFTWARE"
#. 14
-#: ../clients/cli/devices.c:70
+#: ../clients/cli/devices.c:72
msgid "NM-MANAGED"
msgstr "NM-HANTERAD"
#. 16
-#: ../clients/cli/devices.c:72
+#: ../clients/cli/devices.c:74
msgid "FIRMWARE-MISSING"
msgstr "FAST-PROGRAMVARA-SAKNAS"
#. 0
-#: ../clients/cli/devices.c:85
+#: ../clients/cli/devices.c:87
msgid "AVAILABLE-CONNECTION-PATHS"
msgstr "TILLGÄNGLIGA-ANSLUTNINGS-SÖKVÄGAR"
#. 1
-#: ../clients/cli/devices.c:86
+#: ../clients/cli/devices.c:88
msgid "AVAILABLE-CONNECTIONS"
msgstr "TILLGÄNGLIGA-ANSLUTNINGAR"
#. 0
-#: ../clients/cli/devices.c:95
+#: ../clients/cli/devices.c:97
msgid "CARRIER-DETECT"
msgstr "BÄRARE-UPPTÄCK"
#. 1
-#: ../clients/cli/devices.c:96
+#: ../clients/cli/devices.c:98
msgid "SPEED"
msgstr "HASTIGHET"
#. 0
-#: ../clients/cli/devices.c:106
+#: ../clients/cli/devices.c:108
msgid "CARRIER"
msgstr "BÄRARE"
#. 0
-#: ../clients/cli/devices.c:115 ../clients/cli/devices.c:545
+#: ../clients/cli/devices.c:117 ../clients/cli/devices.c:548
msgid "WEP"
msgstr "WEP"
#. 1
-#: ../clients/cli/devices.c:116
+#: ../clients/cli/devices.c:118
msgid "WPA"
msgstr "WPA"
#. 2
-#: ../clients/cli/devices.c:117 ../clients/cli/devices.c:553
+#: ../clients/cli/devices.c:119 ../clients/cli/devices.c:556
msgid "WPA2"
msgstr "WPA2"
#. 3
-#: ../clients/cli/devices.c:118
+#: ../clients/cli/devices.c:120
msgid "TKIP"
msgstr "TKIP"
#. 4
-#: ../clients/cli/devices.c:119
+#: ../clients/cli/devices.c:121
msgid "CCMP"
msgstr "CCMP"
#. 5
#. 2
-#: ../clients/cli/devices.c:120 ../clients/cli/devices.c:219
+#: ../clients/cli/devices.c:122 ../clients/cli/devices.c:222
msgid "AP"
msgstr "AP"
#. 6
-#: ../clients/cli/devices.c:121
+#: ../clients/cli/devices.c:123
msgid "ADHOC"
msgstr "ADHOC"
#. 0
-#: ../clients/cli/devices.c:130
+#: ../clients/cli/devices.c:132
msgid "CTR-FREQ"
msgstr "CTR-FREQ"
#. 1
-#: ../clients/cli/devices.c:131
+#: ../clients/cli/devices.c:133
msgid "RSSI"
msgstr "RSSI"
#. 2
-#: ../clients/cli/devices.c:132
+#: ../clients/cli/devices.c:134
msgid "CINR"
msgstr "CINR"
#. 3
-#: ../clients/cli/devices.c:133
+#: ../clients/cli/devices.c:135
msgid "TX-POW"
msgstr "TX-POW"
#. 4
-#: ../clients/cli/devices.c:134
+#: ../clients/cli/devices.c:136
msgid "BSID"
msgstr "BSID"
#. 0
-#: ../clients/cli/devices.c:143 ../clients/tui/nmt-page-wifi.c:226
+#: ../clients/cli/devices.c:145 ../clients/tui/nmt-page-wifi.c:227
msgid "SSID"
msgstr "SSID"
#. 1
-#: ../clients/cli/devices.c:144
+#: ../clients/cli/devices.c:146
msgid "SSID-HEX"
msgstr "SSID-HEX"
#. 2
-#: ../clients/cli/devices.c:145 ../clients/tui/nmt-page-wifi.c:360
+#: ../clients/cli/devices.c:147 ../clients/tui/nmt-page-wifi.c:361
msgid "BSSID"
msgstr "BSSID"
#. 3
-#: ../clients/cli/devices.c:146
+#: ../clients/cli/devices.c:148
msgid "MODE"
msgstr "LÄGE"
#. 4
-#: ../clients/cli/devices.c:147
+#: ../clients/cli/devices.c:149
msgid "CHAN"
msgstr "CHAN"
#. 5
-#: ../clients/cli/devices.c:148
+#: ../clients/cli/devices.c:150
msgid "FREQ"
msgstr "FREK"
#. 6
-#: ../clients/cli/devices.c:149
+#: ../clients/cli/devices.c:151
msgid "RATE"
msgstr "FREKVENS"
#. 7
#. 1
-#: ../clients/cli/devices.c:150 ../clients/cli/devices.c:170
+#: ../clients/cli/devices.c:152 ../clients/cli/devices.c:172
msgid "SIGNAL"
msgstr "SIGNAL"
#. 8
-#: ../clients/cli/devices.c:151
+#: ../clients/cli/devices.c:153
msgid "BARS"
msgstr "BARS"
#. 9
-#: ../clients/cli/devices.c:152
+#: ../clients/cli/devices.c:154
msgid "SECURITY"
msgstr "SÄKERHET"
#. 10
-#: ../clients/cli/devices.c:153
+#: ../clients/cli/devices.c:155
msgid "WPA-FLAGS"
msgstr "WPA-FLAGGOR"
#. 11
-#: ../clients/cli/devices.c:154
+#: ../clients/cli/devices.c:156
msgid "RSN-FLAGS"
msgstr "RSN-FLAGGOR"
#. 14
-#: ../clients/cli/devices.c:157
+#: ../clients/cli/devices.c:159
msgid "*"
msgstr "*"
#. 0
#. 5
-#: ../clients/cli/devices.c:169 ../clients/cli/devices.c:222
+#: ../clients/cli/devices.c:171 ../clients/cli/devices.c:225
msgid "NSP"
msgstr "NSP"
#. 0
-#: ../clients/cli/devices.c:184
+#: ../clients/cli/devices.c:186
msgid "SLAVES"
msgstr "SLAVAR"
#. 0
-#: ../clients/cli/devices.c:193
+#: ../clients/cli/devices.c:195
+msgid "PARENT"
+msgstr "ÖVERORDNAD"
+
+#. 1
+#: ../clients/cli/devices.c:196
msgid "ID"
msgstr "ID"
#. 0
-#: ../clients/cli/devices.c:202 ../clients/cli/devices.c:217
+#: ../clients/cli/devices.c:205 ../clients/cli/devices.c:220
msgid "CAPABILITIES"
msgstr "FÖRMÅGOR"
#. 1
-#: ../clients/cli/devices.c:218
+#: ../clients/cli/devices.c:221
msgid "WIFI-PROPERTIES"
msgstr "WIFI-EGENSKAPER"
#. 3
-#: ../clients/cli/devices.c:220
+#: ../clients/cli/devices.c:223
msgid "WIRED-PROPERTIES"
msgstr "TRÃ…DADE-EGENSKAPER"
#. 4
-#: ../clients/cli/devices.c:221
+#: ../clients/cli/devices.c:224
msgid "WIMAX-PROPERTIES"
msgstr "WIMAX-EGENSKAPER"
#. 10
-#: ../clients/cli/devices.c:227 ../clients/tui/nmt-page-bond.c:73
+#: ../clients/cli/devices.c:230 ../clients/tui/nmt-page-bond.c:354
msgid "BOND"
msgstr "KOMBINERING"
#. 11
-#: ../clients/cli/devices.c:228 ../clients/tui/nmt-page-team.c:51
+#: ../clients/cli/devices.c:231 ../clients/tui/nmt-page-team.c:148
msgid "TEAM"
msgstr "GRUPP"
#. 12
-#: ../clients/cli/devices.c:229 ../clients/tui/nmt-page-bridge.c:42
+#: ../clients/cli/devices.c:232 ../clients/tui/nmt-page-bridge.c:77
msgid "BRIDGE"
msgstr "BRYGGA"
#. 14
-#: ../clients/cli/devices.c:231
+#: ../clients/cli/devices.c:234
msgid "BLUETOOTH"
msgstr "BLUETOOTH"
#. 15
-#: ../clients/cli/devices.c:232
+#: ../clients/cli/devices.c:235
msgid "CONNECTIONS"
msgstr "ANSLUTNINGAR"
-#: ../clients/cli/devices.c:256
+#: ../clients/cli/devices.c:259
#, c-format
msgid ""
"Usage: nmcli device { COMMAND | help }\n"
@@ -3237,8 +3326,7 @@ msgid ""
"\n"
" wifi [list [ifname <ifname>] [bssid <BSSID>]]\n"
"\n"
-" wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] "
-"[ifname <ifname>]\n"
+" wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] [ifname <ifname>]\n"
" [bssid <BSSID>] [name <name>] [private yes|no]\n"
"\n"
" wifi rescan [[ifname] <ifname>]\n"
@@ -3248,8 +3336,7 @@ msgid ""
msgstr ""
"Användning: nmcli device { KOMMANDO | help }\n"
"\n"
-"KOMMANDO := { status | show | connect | disconnect | delete | wifi | "
-"wimax }\n"
+"KOMMANDO := { status | show | connect | disconnect | delete | wifi | wimax }\n"
"\n"
"KOMMANDO := { status | show | connect | disconnect | delete | wifi }\n"
"\n"
@@ -3265,8 +3352,7 @@ msgstr ""
"\n"
" wifi [list [ifname <grnamn>] [bssid <BSSID>]]\n"
"\n"
-" wifi connect <(B)SSID> [password <lösenord>] [wep-key-type key|phrase] "
-"[ifname <grnamn>]\n"
+" wifi connect <(B)SSID> [password <lösenord>] [wep-key-type key|phrase] [ifname <grnamn>]\n"
" [bssid <BSSID>] [name <namn>] [private yes|no]\n"
"\n"
" wifi rescan [[ifname] <grnamn>]\n"
@@ -3274,7 +3360,7 @@ msgstr ""
" wimax [list [ifname <grnamn>] [nsp <namn>]]\n"
"\n"
-#: ../clients/cli/devices.c:280
+#: ../clients/cli/devices.c:283
#, c-format
msgid ""
"Usage: nmcli device status { help }\n"
@@ -3285,10 +3371,8 @@ msgid ""
" TYPE - device type\n"
" STATE - device state\n"
" CONNECTION - connection activated on device (if any)\n"
-"Displayed columns can be changed using '--fields' global option. 'status' "
-"is\n"
-"the default command, which means 'nmcli device' calls 'nmcli device "
-"status'.\n"
+"Displayed columns can be changed using '--fields' global option. 'status' is\n"
+"the default command, which means 'nmcli device' calls 'nmcli device status'.\n"
"\n"
msgstr ""
"Användning: nmcli device status { help }\n"
@@ -3300,11 +3384,10 @@ msgstr ""
" TILLSTÅND - enhetstillstånd\n"
" ANSLUTNING - aktiverad anslutning på enheten (om någon)\n"
"Visade kolumner kan ändras med globala flaggan â€--fieldsâ€. â€status†är\n"
-"standardflaggan, vilket betyder att â€nmcli device†anropar â€nmcli device "
-"statusâ€.\n"
+"standardflaggan, vilket betyder att â€nmcli device†anropar â€nmcli device statusâ€.\n"
"\n"
-#: ../clients/cli/devices.c:295
+#: ../clients/cli/devices.c:298
#, c-format
msgid ""
"Usage: nmcli device show { ARGUMENTS | help }\n"
@@ -3315,7 +3398,7 @@ msgid ""
"The command lists details for all devices, or for a given device.\n"
"\n"
msgstr ""
-"Använding: nmcli device show { ARGUMENT ]| help }\n"
+"Användning: nmcli device show { ARGUMENT | help }\n"
"\n"
"ARGUMENT := [<grnamn>]\n"
"\n"
@@ -3323,7 +3406,7 @@ msgstr ""
"Kommandot listar detaljer för alla enheter eller för en given enhet.\n"
"\n"
-#: ../clients/cli/devices.c:306
+#: ../clients/cli/devices.c:309
#, c-format
msgid ""
"Usage: nmcli device connect { ARGUMENTS | help }\n"
@@ -3331,8 +3414,7 @@ msgid ""
"ARGUMENTS := <ifname>\n"
"\n"
"Connect the device.\n"
-"NetworkManager will try to find a suitable connection that will be "
-"activated.\n"
+"NetworkManager will try to find a suitable connection that will be activated.\n"
"It will also consider connections that are not set to auto-connect.\n"
"\n"
msgstr ""
@@ -3341,13 +3423,11 @@ msgstr ""
"ARGUMENT := <ifnamn>\n"
"\n"
"Anslut enheten.\n"
-"Nätverkshanteraren försöker då att finna en passande anslutning att "
-"aktivera.\n"
-"Den kommer också att ta hänsyn till anslutningar som inte är inställda på "
-"att autoansluta.\n"
+"Nätverkshanteraren försöker då att finna en passande anslutning att aktivera.\n"
+"Den kommer också att ta hänsyn till anslutningar som inte är inställda på att autoansluta.\n"
"\n"
-#: ../clients/cli/devices.c:318
+#: ../clients/cli/devices.c:321
#, c-format
msgid ""
"Usage: nmcli device disconnect { ARGUMENTS | help }\n"
@@ -3368,7 +3448,7 @@ msgstr ""
"vidare anslutningar utan användar-/manuellinblandning.\n"
"\n"
-#: ../clients/cli/devices.c:330
+#: ../clients/cli/devices.c:333
#, c-format
msgid ""
"Usage: nmcli device delete { ARGUMENTS | help }\n"
@@ -3391,7 +3471,7 @@ msgstr ""
"kommandot.\n"
"\n"
-#: ../clients/cli/devices.c:343
+#: ../clients/cli/devices.c:346
#, c-format
msgid ""
"Usage: nmcli device wifi { ARGUMENTS | help }\n"
@@ -3403,8 +3483,7 @@ msgid ""
"List available Wi-Fi access points. The 'ifname' and 'bssid' options can be\n"
"used to list APs for a particular interface, or with a specific BSSID.\n"
"\n"
-"ARGUMENTS := connect <(B)SSID> [password <password>] [wep-key-type key|"
-"phrase] [ifname <ifname>]\n"
+"ARGUMENTS := connect <(B)SSID> [password <password>] [wep-key-type key|phrase] [ifname <ifname>]\n"
" [bssid <BSSID>] [name <name>] [private yes|no]\n"
"\n"
"Connect to a Wi-Fi network specified by SSID or BSSID. The command creates\n"
@@ -3418,10 +3497,8 @@ msgid ""
"\n"
"ARGUMENTS := rescan [[ifname] <ifname>]\n"
"\n"
-"Request that NetworkManager immediately re-scan for available access "
-"points.\n"
-"NetworkManager scans Wi-Fi networks periodically, but in some cases it "
-"might\n"
+"Request that NetworkManager immediately re-scan for available access points.\n"
+"NetworkManager scans Wi-Fi networks periodically, but in some cases it might\n"
"be useful to start scanning manually. Note that this command does not show\n"
"the APs, use 'nmcli device wifi list' for that.\n"
"\n"
@@ -3432,22 +3509,16 @@ msgstr ""
"\n"
"ARGUMENT := [list [ifname <grnamn>] [bssid <BSSID>]]\n"
"\n"
-"List över tillgängliga trÃ¥dlösa accesspunkter. â€ifname†och â€bssidâ€-"
-"flaggorna kan\n"
-"användas för att lista accesspunkter för ett specifikt gränssnitt, eller med "
-"ett specifikt BSSID.\n"
+"Lista över tillgängliga trÃ¥dlösa accesspunkter. â€ifname†och â€bssidâ€-flaggorna kan\n"
+"användas för att lista accesspunkter för ett specifikt gränssnitt, eller med ett specifikt BSSID.\n"
"\n"
-"ARGUMENT := connect <(B)SSID> [password <lösenord>] [wep-key-type key|"
-"phrase] [ifname <ifnamn>]\n"
+"ARGUMENT := connect <(B)SSID> [password <lösenord>] [wep-key-type key|phrase] [ifname <ifnamn>]\n"
" [bssid <BSSID>] [name <namn>] [private yes|no]\n"
"\n"
-"Anslut till ett trådlöst nätverk angivet genom SSID eller BSSID. Kommandot "
-"skapar\n"
+"Anslut till ett trådlöst nätverk angivet genom SSID eller BSSID. Kommandot skapar\n"
"en ny anslutning och aktiverar den på en enhet. Det är en kommandorad-\n"
-"motsvarighet till att klicka på ett SSID i en GUI-klient. Kommandot skapar "
-"alltid\n"
-"en ny anslutning och är därför mest användbart för att ansluta till nya "
-"trådlösa\n"
+"motsvarighet till att klicka på ett SSID i en GUI-klient. Kommandot skapar alltid\n"
+"en ny anslutning och är därför mest användbart för att ansluta till nya trådlösa\n"
"nätverk. Om en anslutning för nätverket redan finns är det bättre att\n"
"ta fram befintliga profiler enligt: nmcli con up id <namn>. Observera att\n"
"endast öppna WEP och WPA-PSK-nätverk stöds för tillfället. Det antas också\n"
@@ -3455,15 +3526,13 @@ msgstr ""
"\n"
"ARGUMENT := rescan [[ifnamn] <grnamn>]\n"
"\n"
-"Begär att Nätverkshanteraren omedelbart söker av efter tillgängliga "
-"accesspunkter.\n"
+"Begär att Nätverkshanteraren omedelbart söker av efter tillgängliga accesspunkter.\n"
"Nätverkshanteraren söker av trådlösa nätverk periodiskt, men i några fall\n"
-"kan det vara användbart att söka av manuellt. Observera att detta kommando "
-"inte visar\n"
+"kan det vara användbart att söka av manuellt. Observera att detta kommando inte visar\n"
"APs, använd â€nmcli device wifi list†för det.\n"
"\n"
-#: ../clients/cli/devices.c:376
+#: ../clients/cli/devices.c:379
#, c-format
msgid ""
"Usage: nmcli device wimax { ARGUMENTS | help }\n"
@@ -3482,372 +3551,367 @@ msgstr ""
"\n"
"ARGUMENT := [list [ifname <grnamn>] [nsp <namn>]]\n"
"\n"
-"Lista tillgängliga WiMAX NSP:er. Flaggorna â€ifname†och â€nsp†kan användas "
-"för att\n"
+"Lista tillgängliga WiMAX NSP:er. Flaggorna â€ifname†och â€nsp†kan användas för att\n"
"lista nätverk för ett specifikt gränssnitt, eller med ett specifik NSP.\n"
"\n"
-#: ../clients/cli/devices.c:465 ../clients/cli/devices.c:656
+#: ../clients/cli/devices.c:468 ../clients/cli/devices.c:659
msgid "(none)"
msgstr "(ingen)"
-#: ../clients/cli/devices.c:533
+#: ../clients/cli/devices.c:536
#, c-format
msgid "%u MHz"
msgstr "%u MHz"
-#: ../clients/cli/devices.c:534
+#: ../clients/cli/devices.c:537
#, c-format
msgid "%u Mbit/s"
msgstr "%u Mbit/s"
-#: ../clients/cli/devices.c:549
+#: ../clients/cli/devices.c:552
msgid "WPA1"
msgstr "WPA1"
-#: ../clients/cli/devices.c:558
+#: ../clients/cli/devices.c:561
msgid "802.1X"
msgstr "802.1X"
-#: ../clients/cli/devices.c:574
+#: ../clients/cli/devices.c:577
msgid "Ad-Hoc"
msgstr "Ad-Hoc"
-#: ../clients/cli/devices.c:575
+#: ../clients/cli/devices.c:578
msgid "Infra"
msgstr "Infra"
-#: ../clients/cli/devices.c:576
+#: ../clients/cli/devices.c:579
msgid "N/A"
msgstr "N/A"
-#: ../clients/cli/devices.c:607
+#: ../clients/cli/devices.c:610
msgid "Home"
msgstr "Hem"
-#: ../clients/cli/devices.c:610
+#: ../clients/cli/devices.c:613
msgid "Partner"
msgstr "Partner"
-#: ../clients/cli/devices.c:613
+#: ../clients/cli/devices.c:616
msgid "Roaming"
msgstr "Roaming"
-#: ../clients/cli/devices.c:773
+#: ../clients/cli/devices.c:774
msgid "Device details"
msgstr "Enhetsdetaljer"
-#: ../clients/cli/devices.c:785
+#: ../clients/cli/devices.c:786
#, c-format
msgid "Error: 'device show': %s"
msgstr "Fel: â€device showâ€: %s"
-#: ../clients/cli/devices.c:836 ../clients/cli/devices.c:839
+#: ../clients/cli/devices.c:837 ../clients/cli/devices.c:840
msgid "(unknown)"
msgstr "(okänd)"
-#: ../clients/cli/devices.c:877
+#: ../clients/cli/devices.c:878
#, c-format
msgid "%u Mb/s"
msgstr "%u Mb/s"
-#: ../clients/cli/devices.c:963
+#: ../clients/cli/devices.c:964
msgid "on"
msgstr "på"
-#: ../clients/cli/devices.c:963
+#: ../clients/cli/devices.c:964
msgid "off"
msgstr "av"
-#: ../clients/cli/devices.c:1235
+#: ../clients/cli/devices.c:1238
#, c-format
msgid "Error: 'device status': %s"
msgstr "Fel: â€device statusâ€: %s"
#. Add headers
-#: ../clients/cli/devices.c:1242
+#: ../clients/cli/devices.c:1245
msgid "Status of devices"
msgstr "Status för enheter"
-#: ../clients/cli/devices.c:1273
+#: ../clients/cli/devices.c:1276
#, c-format
msgid "Error: invalid extra argument '%s'."
msgstr "Fel: ogiltigt extra argument: â€%sâ€."
-#: ../clients/cli/devices.c:1290 ../clients/cli/devices.c:1565
-#: ../clients/cli/devices.c:1698 ../clients/cli/devices.c:1785
-#: ../clients/cli/devices.c:1918 ../clients/cli/devices.c:2579
+#: ../clients/cli/devices.c:1293 ../clients/cli/devices.c:1591
+#: ../clients/cli/devices.c:1741 ../clients/cli/devices.c:1828
+#: ../clients/cli/devices.c:1961 ../clients/cli/devices.c:2622
#, c-format
msgid "Error: Device '%s' not found."
msgstr "Fel: Enheten â€%s†hittades inte."
-#: ../clients/cli/devices.c:1345
+#: ../clients/cli/devices.c:1371
#, c-format
msgid "Device '%s' successfully activated with '%s'.\n"
msgstr "Enheten â€%s†aktiverades med â€%sâ€.\n"
-#: ../clients/cli/devices.c:1367 ../clients/cli/devices.c:1418
+#: ../clients/cli/devices.c:1377
#, c-format
-msgid "Connection with UUID '%s' created and activated on device '%s'\n"
-msgstr "Anslutningen med UUID â€%s†skapad och aktiverad pÃ¥ enhet â€%sâ€\n"
-
-#: ../clients/cli/devices.c:1372
-#, c-format
-msgid "Error: Connection activation failed: (%d) %s."
-msgstr "Fel: Aktivering av anslutningen misslyckades: (%d) %s."
+msgid "Error: Connection activation failed: (%d) %s.\n"
+msgstr "Fel: Aktivering av anslutningen misslyckades: (%d) %s.\n"
-#: ../clients/cli/devices.c:1399
+#: ../clients/cli/devices.c:1411
#, c-format
msgid "Error: Failed to add/activate new connection: %s"
msgstr "Fel: Misslyckades med att lägga till/aktivera ny anslutning: %s"
-#: ../clients/cli/devices.c:1408
+#: ../clients/cli/devices.c:1420
#, c-format
msgid "Error: Failed to add/activate new connection: Unknown error"
msgstr "Fel: Misslyckades att lägga till/aktivera ny anslutning: Okänt fel"
-#: ../clients/cli/devices.c:1480
+#: ../clients/cli/devices.c:1431
+#, c-format
+msgid "Connection with UUID '%s' created and activated on device '%s'\n"
+msgstr "Anslutningen med UUID â€%s†skapad och aktiverad pÃ¥ enhet â€%sâ€\n"
+
+#: ../clients/cli/devices.c:1495
#, c-format
msgid "Error: Device activation failed: %s"
msgstr "Fel: Aktivering av enheten misslyckades: %s"
-#: ../clients/cli/devices.c:1489
+#: ../clients/cli/devices.c:1504
#, c-format
msgid "Error: Device activation failed: device was disconnected"
msgstr "Fel: Aktivering av enheten misslyckades: enheten blev frånkopplad"
-#: ../clients/cli/devices.c:1503
+#: ../clients/cli/devices.c:1519
#, c-format
msgid "Device '%s' has been connected.\n"
msgstr "Enheten â€%s†är ansluten.\n"
-#: ../clients/cli/devices.c:1534 ../clients/cli/devices.c:1543
-#: ../clients/cli/devices.c:1667 ../clients/cli/devices.c:1676
-#: ../clients/cli/devices.c:1755 ../clients/cli/devices.c:1763
+#: ../clients/cli/devices.c:1560 ../clients/cli/devices.c:1569
+#: ../clients/cli/devices.c:1710 ../clients/cli/devices.c:1719
+#: ../clients/cli/devices.c:1798 ../clients/cli/devices.c:1806
#, c-format
msgid "Error: No interface specified."
msgstr "Fel: Inget gränssnitt angivet."
-#: ../clients/cli/devices.c:1549 ../clients/cli/devices.c:1682
-#: ../clients/cli/devices.c:1769
+#: ../clients/cli/devices.c:1575 ../clients/cli/devices.c:1725
+#: ../clients/cli/devices.c:1812
#, c-format
msgid "Error: extra argument not allowed: '%s'."
msgstr "Fel: extra argument saknas: â€%sâ€."
-#: ../clients/cli/devices.c:1608
+#: ../clients/cli/devices.c:1639 ../clients/cli/devices.c:1650
#, c-format
-msgid "Success: Device '%s' successfully disconnected."
-msgstr "Lyckades: Enheten â€%s†kopplades frÃ¥n."
+msgid "Device '%s' successfully disconnected.\n"
+msgstr "Lyckades: Enheten â€%s†kopplades frÃ¥n.\n"
-#: ../clients/cli/devices.c:1622
+#: ../clients/cli/devices.c:1664
#, c-format
msgid "Error: Device '%s' (%s) disconnecting failed: %s"
msgstr "Fel: FrÃ¥nkoppling av enheten â€%s†(%s) misslyckades: %s"
-#: ../clients/cli/devices.c:1637
+#: ../clients/cli/devices.c:1679
#, c-format
msgid "Device '%s' has been disconnected.\n"
msgstr "Enheten â€%s†kopplades frÃ¥n.\n"
-#: ../clients/cli/devices.c:1727
+#: ../clients/cli/devices.c:1770
#, c-format
msgid "Error: Device '%s' (%s) deletion failed: %s"
msgstr "Fel: Borttagning av enheten â€%s†(%s) misslyckades: %s"
-#: ../clients/cli/devices.c:1791
+#: ../clients/cli/devices.c:1834
#, c-format
msgid "Error: Device '%s' is a hardware device. It can't be deleted."
-msgstr "Fel: Enheten â€%s†är en hÃ¥rdvaruenhet. Det kan inte tas bort."
+msgstr "Fel: Enheten â€%s†är en hÃ¥rdvaruenhet. Den kan inte tas bort."
-#: ../clients/cli/devices.c:1861
+#: ../clients/cli/devices.c:1904
msgid "Wi-Fi scan list"
msgstr "Trådlös avsökningslista"
-#: ../clients/cli/devices.c:1899
+#: ../clients/cli/devices.c:1942
#, c-format
msgid "Error: 'device wifi': %s"
msgstr "Fel: â€device wifiâ€: %s"
-#: ../clients/cli/devices.c:1941 ../clients/cli/devices.c:2016
+#: ../clients/cli/devices.c:1984 ../clients/cli/devices.c:2059
#, c-format
msgid "Error: Access point with bssid '%s' not found."
msgstr "Fel: Accesspunkt med bssid â€%s†hittades inte."
-#: ../clients/cli/devices.c:1965 ../clients/cli/devices.c:2282
-#: ../clients/cli/devices.c:2446
+#: ../clients/cli/devices.c:2008 ../clients/cli/devices.c:2325
+#: ../clients/cli/devices.c:2489
#, c-format
msgid "Error: Device '%s' is not a Wi-Fi device."
msgstr "Fel: Enheten â€%s†är inte en trÃ¥dlös enhet."
-#: ../clients/cli/devices.c:2175
+#: ../clients/cli/devices.c:2218
msgid "SSID or BSSID: "
msgstr "SSID eller BSSID: "
-#: ../clients/cli/devices.c:2180
+#: ../clients/cli/devices.c:2223
#, c-format
msgid "Error: SSID or BSSID are missing."
msgstr "Fel: SSID eller BSSID saknas."
-#: ../clients/cli/devices.c:2204
+#: ../clients/cli/devices.c:2247
#, c-format
msgid "Error: bssid argument value '%s' is not a valid BSSID."
msgstr "Fel: bssid-argumentvärdet â€%s†är inte ett giltigt BSSID."
-#: ../clients/cli/devices.c:2228
+#: ../clients/cli/devices.c:2271
#, c-format
-msgid ""
-"Error: wep-key-type argument value '%s' is invalid, use 'key' or 'phrase'."
-msgstr ""
-"Fel: wep-key-type-argumentvärdet â€%s†är ogiltigt, använd â€key†eller "
-"â€phraseâ€."
+msgid "Error: wep-key-type argument value '%s' is invalid, use 'key' or 'phrase'."
+msgstr "Fel: wep-key-type-argumentvärdet â€%s†är ogiltigt, använd â€key†eller â€phraseâ€."
-#: ../clients/cli/devices.c:2248
+#: ../clients/cli/devices.c:2291
#, c-format
msgid "Error: %s: %s."
msgstr "Fel: %s %s."
-#: ../clients/cli/devices.c:2263
+#: ../clients/cli/devices.c:2306
#, c-format
msgid "Error: BSSID to connect to (%s) differs from bssid argument (%s)."
-msgstr ""
-"Fel: BSSID att ansluta till (%s) skiljer sig från bssid-argumentet (%s)."
+msgstr "Fel: BSSID att ansluta till (%s) skiljer sig från bssid-argumentet (%s)."
-#: ../clients/cli/devices.c:2269
+#: ../clients/cli/devices.c:2312
#, c-format
msgid "Error: Parameter '%s' is neither SSID nor BSSID."
msgstr "Fel: Parameter â€%s†är varken SSID eller BSSID."
-#: ../clients/cli/devices.c:2284 ../clients/cli/devices.c:2448
+#: ../clients/cli/devices.c:2327 ../clients/cli/devices.c:2491
#, c-format
msgid "Error: No Wi-Fi device found."
msgstr "Fel: Ingen trådlös enhet hittades."
-#: ../clients/cli/devices.c:2302
+#: ../clients/cli/devices.c:2345
#, c-format
msgid "Error: No network with SSID '%s' found."
msgstr "Fel: Inget nätverk med SSID â€%s†hittades."
-#: ../clients/cli/devices.c:2304
+#: ../clients/cli/devices.c:2347
#, c-format
msgid "Error: No access point with BSSID '%s' found."
msgstr "Fel: Ingen accesspunkt med BSSID â€%s†hittades."
-#: ../clients/cli/devices.c:2343
+#: ../clients/cli/devices.c:2386
msgid "Password: "
-msgstr "Lösenord:"
+msgstr "Lösenord: "
-#: ../clients/cli/devices.c:2475
+#: ../clients/cli/devices.c:2518
#, c-format
msgid "Error: 'device wifi' command '%s' is not valid."
msgstr "Fel: “device wifi“-kommandot â€%s†är inte giltigt."
-#: ../clients/cli/devices.c:2522
+#: ../clients/cli/devices.c:2565
msgid "WiMAX NSP list"
msgstr "WiMAX NSP-lista"
-#: ../clients/cli/devices.c:2559
+#: ../clients/cli/devices.c:2602
#, c-format
msgid "Error: 'device wimax': %s"
msgstr "Fel: â€device wimaxâ€: %s"
-#: ../clients/cli/devices.c:2602
+#: ../clients/cli/devices.c:2645
#, c-format
msgid "Error: NSP with name '%s' not found."
msgstr "Fel: NSP med namnet â€%s†hittades inte."
-#: ../clients/cli/devices.c:2615
+#: ../clients/cli/devices.c:2658
#, c-format
msgid "Error: Device '%s' is not a WiMAX device."
msgstr "Fel: Enheten â€%s†är inte en WiMAX-enhet."
-#: ../clients/cli/devices.c:2659
+#: ../clients/cli/devices.c:2702
#, c-format
msgid "Error: Access point with nsp '%s' not found."
msgstr "Fel: Accesspunkt med nsp â€%s†hittades inte."
-#: ../clients/cli/devices.c:2696
+#: ../clients/cli/devices.c:2739
#, c-format
msgid "Error: 'device wimax' command '%s' is not valid."
msgstr "Fel: â€device wimaxâ€-kommandot â€%s†är inte giltigt."
-#: ../clients/cli/devices.c:2866
+#: ../clients/cli/devices.c:2912
#, c-format
msgid "Error: 'dev' command '%s' is not valid."
msgstr "Fel: â€devâ€-kommandot â€%s†är inte giltigt."
-#: ../clients/cli/general.c:34
+#: ../clients/cli/general.c:35
msgid "RUNNING"
msgstr "KÖR"
#. 0
-#: ../clients/cli/general.c:35
+#: ../clients/cli/general.c:36
msgid "VERSION"
msgstr "VERSION"
#. 2
-#: ../clients/cli/general.c:37
+#: ../clients/cli/general.c:38
msgid "STARTUP"
msgstr "UPPSTART"
#. 3
-#: ../clients/cli/general.c:38
+#: ../clients/cli/general.c:39
msgid "CONNECTIVITY"
msgstr "ANSLUTNING"
#. 4
-#: ../clients/cli/general.c:39
+#: ../clients/cli/general.c:40
msgid "NETWORKING"
msgstr "NÄTVERK"
#. 5
-#: ../clients/cli/general.c:40
+#: ../clients/cli/general.c:41
msgid "WIFI-HW"
msgstr "WIFI-HW"
#. 6
-#: ../clients/cli/general.c:41
+#: ../clients/cli/general.c:42
msgid "WIFI"
msgstr "WIFI"
#. 7
-#: ../clients/cli/general.c:42
+#: ../clients/cli/general.c:43
msgid "WWAN-HW"
msgstr "WWAN-HW"
#. 8
-#: ../clients/cli/general.c:43
+#: ../clients/cli/general.c:44
msgid "WWAN"
msgstr "WWAN"
#. 9
-#: ../clients/cli/general.c:44
+#: ../clients/cli/general.c:45
msgid "WIMAX-HW"
msgstr "WIMAX_HW"
#. 10
-#: ../clients/cli/general.c:45
+#: ../clients/cli/general.c:46
msgid "WIMAX"
msgstr "WIMAX"
-#: ../clients/cli/general.c:67
+#: ../clients/cli/general.c:68
msgid "PERMISSION"
msgstr "TILLSTÃ…ND"
#. 0
-#: ../clients/cli/general.c:68
+#: ../clients/cli/general.c:69
msgid "VALUE"
msgstr "VÄRDE"
-#: ../clients/cli/general.c:76
+#: ../clients/cli/general.c:77
msgid "LEVEL"
msgstr "NIVÃ…"
#. 0
-#: ../clients/cli/general.c:77
+#: ../clients/cli/general.c:78
msgid "DOMAINS"
msgstr "DOMÄN"
-#: ../clients/cli/general.c:91
+#: ../clients/cli/general.c:92
#, c-format
msgid ""
"Usage: nmcli general { COMMAND | help }\n"
@@ -3876,24 +3940,22 @@ msgstr ""
" logging [level <loggnivå>] [domains <loggdomäner>]\n"
"\n"
-#: ../clients/cli/general.c:102
+#: ../clients/cli/general.c:103
#, c-format
msgid ""
"Usage: nmcli general status { help }\n"
"\n"
"Show overall status of NetworkManager.\n"
-"'status' is the default action, which means 'nmcli gen' calls 'nmcli gen "
-"status'\n"
+"'status' is the default action, which means 'nmcli gen' calls 'nmcli gen status'\n"
"\n"
msgstr ""
"Användning: nmcli general status { help }\n"
"\n"
"Visar allmän status för Nätverkshanteraren.\n"
-"â€status†är standardÃ¥tgärden, vilket betyder â€nmcli gen†anropar â€nmcli gen "
-"statusâ€\n"
+"â€status†är standardÃ¥tgärden, vilket betyder â€nmcli gen†anropar â€nmcli gen statusâ€\n"
"\n"
-#: ../clients/cli/general.c:111
+#: ../clients/cli/general.c:112
#, c-format
msgid ""
"Usage: nmcli general hostname { ARGUMENTS | help }\n"
@@ -3902,8 +3964,7 @@ msgid ""
"\n"
"Get or change persistent system hostname.\n"
"With no arguments, this prints currently configured hostname. When you pass\n"
-"a hostname, NetworkManager will set it as the new persistent system "
-"hostname.\n"
+"a hostname, NetworkManager will set it as the new persistent system hostname.\n"
"\n"
msgstr ""
"Användning: nmcli general hostname { ARGUMENT | help }\n"
@@ -3912,11 +3973,10 @@ msgstr ""
"\n"
"Hämta eller ändra sparat systemvärdnamn.\n"
"Om inga argument, skrivs aktuellt konfigurerat värdnamn ut. Om du anger\n"
-"ett värdnamn, kommer Nätverkshanteraren att sätta det som nya sparade "
-"systemvärdnamnet.\n"
+"ett värdnamn, kommer Nätverkshanteraren att sätta det som nya sparade systemvärdnamnet.\n"
"\n"
-#: ../clients/cli/general.c:123
+#: ../clients/cli/general.c:124
#, c-format
msgid ""
"Usage: nmcli general permissions { help }\n"
@@ -3929,7 +3989,7 @@ msgstr ""
"Visar anropsrättigheter för autentiserade åtgärder.\n"
"\n"
-#: ../clients/cli/general.c:131
+#: ../clients/cli/general.c:132
#, c-format
msgid ""
"Usage: nmcli general logging { ARGUMENTS | help }\n"
@@ -3937,10 +3997,8 @@ msgid ""
"ARGUMENTS := [level <log level>] [domains <log domains>]\n"
"\n"
"Get or change NetworkManager logging level and domains.\n"
-"Without any argument current logging level and domains are shown. In order "
-"to\n"
-"change logging state, provide level and/or domain. Please refer to the man "
-"page\n"
+"Without any argument current logging level and domains are shown. In order to\n"
+"change logging state, provide level and/or domain. Please refer to the man page\n"
"for the list of possible logging domains.\n"
"\n"
msgstr ""
@@ -3949,12 +4007,12 @@ msgstr ""
"ARGUMENT := [level <loggnivå>] [domains <loggdomäner>]\n"
"\n"
"Hämta eller ändra Nätverkshanterarens loggnivå och domäner.\n"
-"Utan några arguement visas aktuell loggnivå och domäner. För att\n"
+"Utan några argument visas aktuell loggnivå och domäner. För att\n"
"ändra loggtillstånd, skicka med nivå och/eller domän. Se manualsidan\n"
"för en lista över möjliga loggdomäner.\n"
"\n"
-#: ../clients/cli/general.c:144
+#: ../clients/cli/general.c:145
#, c-format
msgid ""
"Usage: nmcli networking { COMMAND | help }\n"
@@ -3979,7 +4037,7 @@ msgstr ""
" connectivity [check]\n"
"\n"
-#: ../clients/cli/general.c:154
+#: ../clients/cli/general.c:155
#, c-format
msgid ""
"Usage: nmcli networking on { help }\n"
@@ -3992,7 +4050,7 @@ msgstr ""
"Slå på nätverk.\n"
"\n"
-#: ../clients/cli/general.c:162
+#: ../clients/cli/general.c:163
#, c-format
msgid ""
"Usage: nmcli networking off { help }\n"
@@ -4005,7 +4063,7 @@ msgstr ""
"Slå av nätverk.\n"
"\n"
-#: ../clients/cli/general.c:170
+#: ../clients/cli/general.c:171
#, c-format
msgid ""
"Usage: nmcli networking connectivity { ARGUMENTS | help }\n"
@@ -4013,8 +4071,7 @@ msgid ""
"ARGUMENTS := [check]\n"
"\n"
"Get network connectivity state.\n"
-"The optional 'check' argument makes NetworkManager re-check the "
-"connectivity.\n"
+"The optional 'check' argument makes NetworkManager re-check the connectivity.\n"
"\n"
msgstr ""
"Användning: nmcli networking connectivity { ARGUMENT | help }\n"
@@ -4022,11 +4079,10 @@ msgstr ""
"ARGUMENT := [check]\n"
"\n"
"Hämta tillstånd för nätverksanslutning.\n"
-"Valfria argumentet â€check†gör att Nätverkshanteraren Ã¥terkontrollerar "
-"anslutning.\n"
+"Valfria argumentet â€check†gör att Nätverkshanteraren Ã¥terkontrollerar anslutning.\n"
"\n"
-#: ../clients/cli/general.c:182
+#: ../clients/cli/general.c:183
#, c-format
msgid ""
"Usage: nmcli radio { COMMAND | help }\n"
@@ -4051,7 +4107,7 @@ msgstr ""
" all | wifi | wwan [ on | off ]\n"
"\n"
-#: ../clients/cli/general.c:196
+#: ../clients/cli/general.c:197
#, c-format
msgid ""
"Usage: nmcli radio all { ARGUMENTS | help }\n"
@@ -4068,7 +4124,7 @@ msgstr ""
"Hämta statusen för alla radioväxlar eller slå på/av dem.\n"
"\n"
-#: ../clients/cli/general.c:206
+#: ../clients/cli/general.c:207
#, c-format
msgid ""
"Usage: nmcli radio wifi { ARGUMENTS | help }\n"
@@ -4085,7 +4141,7 @@ msgstr ""
"Hämta status för trådlösa radioväxeln eller slå på/av den.\n"
"\n"
-#: ../clients/cli/general.c:216
+#: ../clients/cli/general.c:217
#, c-format
msgid ""
"Usage: nmcli radio wwan { ARGUMENTS | help }\n"
@@ -4102,7 +4158,7 @@ msgstr ""
"Hämta status för mobila bredbandsradioväxeln eller slå på/av den.\n"
"\n"
-#: ../clients/cli/general.c:227
+#: ../clients/cli/general.c:228
#, c-format
msgid ""
"Usage: nmcli radio wimax { ARGUMENTS | help }\n"
@@ -4119,164 +4175,163 @@ msgstr ""
"Hämta status för WiMAX-radioväxeln, eller slå på/av den.\n"
"\n"
-#: ../clients/cli/general.c:247
+#: ../clients/cli/general.c:248
msgid "asleep"
msgstr "sover"
-#: ../clients/cli/general.c:249
+#: ../clients/cli/general.c:250
msgid "connecting"
msgstr "ansluter"
-#: ../clients/cli/general.c:251
+#: ../clients/cli/general.c:252
msgid "connected (local only)"
msgstr "ansluten (endast lokalt)"
-#: ../clients/cli/general.c:253
+#: ../clients/cli/general.c:254
msgid "connected (site only)"
msgstr "ansluten (endast plats)"
-#: ../clients/cli/general.c:257
+#: ../clients/cli/general.c:258
msgid "disconnecting"
msgstr "kopplar från"
-#: ../clients/cli/general.c:273
+#: ../clients/cli/general.c:274
msgid "portal"
msgstr "portal"
-#: ../clients/cli/general.c:275
+#: ../clients/cli/general.c:276
msgid "limited"
msgstr "begränsad"
-#: ../clients/cli/general.c:277
+#: ../clients/cli/general.c:278
msgid "full"
msgstr "full"
-#: ../clients/cli/general.c:315
+#: ../clients/cli/general.c:316
#, c-format
msgid "Error: only these fields are allowed: %s"
msgstr "Fel: endast dessa fält är tillåtna: %s"
-#: ../clients/cli/general.c:335 ../clients/cli/general.c:336
-#: ../clients/cli/general.c:337 ../clients/cli/general.c:338
-#: ../clients/cli/general.c:339 ../clients/cli/general.c:341
-#: ../clients/cli/general.c:342
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "enabled"
msgstr "aktiverad"
-#: ../clients/cli/general.c:335 ../clients/cli/general.c:336
-#: ../clients/cli/general.c:337 ../clients/cli/general.c:338
-#: ../clients/cli/general.c:339 ../clients/cli/general.c:341
-#: ../clients/cli/general.c:342
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "disabled"
msgstr "inaktiverad"
-#: ../clients/cli/general.c:345
+#: ../clients/cli/general.c:346
msgid "NetworkManager status"
msgstr "Status för Nätverkshanteraren"
-#: ../clients/cli/general.c:350
+#: ../clients/cli/general.c:351
msgid "running"
msgstr "kör"
-#: ../clients/cli/general.c:353
+#: ../clients/cli/general.c:354
msgid "starting"
msgstr "startar"
-#: ../clients/cli/general.c:353
+#: ../clients/cli/general.c:354
msgid "started"
msgstr "startad"
-#: ../clients/cli/general.c:424
+#: ../clients/cli/general.c:425
msgid "auth"
msgstr "aute"
-#: ../clients/cli/general.c:453
+#: ../clients/cli/general.c:454
#, c-format
msgid "Error: 'general permissions': %s"
msgstr "Fel: â€general permissionsâ€: %s"
-#: ../clients/cli/general.c:467
+#: ../clients/cli/general.c:468
msgid "NetworkManager permissions"
msgstr "Rättigheter för Nätverkshanteraren"
-#: ../clients/cli/general.c:508
+#: ../clients/cli/general.c:509
#, c-format
msgid "Error: 'general logging': %s"
msgstr "Fel: â€general loggingâ€: %s"
-#: ../clients/cli/general.c:523
+#: ../clients/cli/general.c:524
msgid "NetworkManager logging"
msgstr "Loggning för Nätverkshanteraren"
-#: ../clients/cli/general.c:545
+#: ../clients/cli/general.c:546
#, c-format
msgid "Error: failed to set hostname: %s"
msgstr "Fel: misslyckades med att sätta värdnamn: %s"
-#: ../clients/cli/general.c:655
+#: ../clients/cli/general.c:659
#, c-format
msgid "Error: failed to set logging: %s"
msgstr "Fel: misslyckades att sätta loggning: %s"
-#: ../clients/cli/general.c:664
+#: ../clients/cli/general.c:668
#, c-format
msgid "Error: 'general' command '%s' is not valid."
msgstr "Fel: â€generalâ€-kommandot â€%s†är inte giltigt."
-#: ../clients/cli/general.c:682
+#: ../clients/cli/general.c:686
#, c-format
msgid "Error: '--fields' value '%s' is not valid here (allowed field: %s)"
-msgstr ""
-"Fel: värdet â€%s†för â€--fields†är inte giltigt här (tillÃ¥tna fält: %s)"
+msgstr "Fel: värdet â€%s†för â€--fields†är inte giltigt här (tillÃ¥tna fält: %s)"
-#: ../clients/cli/general.c:707
+#: ../clients/cli/general.c:711
#, c-format
msgid "Error: invalid '%s' argument: '%s' (use on/off)."
msgstr "Fel: ogiltigt â€%sâ€-argument: â€%s†(använd pÃ¥/av)."
-#: ../clients/cli/general.c:718
+#: ../clients/cli/general.c:722
msgid "Connectivity"
msgstr "Anslutning"
-#: ../clients/cli/general.c:730
+#: ../clients/cli/general.c:737
msgid "Networking"
msgstr "Nätverk"
-#: ../clients/cli/general.c:755
+#: ../clients/cli/general.c:762
#, c-format
msgid "Error: 'networking connectivity' command '%s' is not valid."
msgstr "Fel: â€networking connectivityâ€-kommandot â€%s†är inte giltigt."
-#: ../clients/cli/general.c:771
+#: ../clients/cli/general.c:778
#, c-format
msgid "Error: 'networking' command '%s' is not valid."
msgstr "Fel: â€networkingâ€-kommandot â€%s†är inte giltigt."
-#: ../clients/cli/general.c:797 ../clients/cli/general.c:817
+#: ../clients/cli/general.c:807 ../clients/cli/general.c:827
msgid "Radio switches"
msgstr "Radioväxlar"
#. no argument, show current WiFi state
-#: ../clients/cli/general.c:835
+#: ../clients/cli/general.c:845
msgid "Wi-Fi radio switch"
msgstr "Trådlös radioväxel"
#. no argument, show current WWAN (mobile broadband) state
-#: ../clients/cli/general.c:851
+#: ../clients/cli/general.c:861
msgid "WWAN radio switch"
msgstr "WWAN radioväxel"
#. no argument, show current WiMAX state
-#: ../clients/cli/general.c:868
+#: ../clients/cli/general.c:878
msgid "WiMAX radio switch"
msgstr "WiMAX radioväxel"
-#: ../clients/cli/general.c:880
+#: ../clients/cli/general.c:890
#, c-format
msgid "Error: 'radio' command '%s' is not valid."
msgstr "Fel: â€radioâ€-kommandot â€%s†är inte giltigt."
-#: ../clients/cli/nmcli.c:81
+#: ../clients/cli/nmcli.c:86
#, c-format
msgid ""
"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
@@ -4286,13 +4341,10 @@ msgid ""
" -p[retty] pretty output\n"
" -m[ode] tabular|multiline output mode\n"
" -f[ields] <field1,field2,...>|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"
+" -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"
-" -w[ait] <seconds> set timeout waiting for "
-"finishing operations\n"
+" -w[ait] <seconds> set timeout waiting for finishing operations\n"
" -v[ersion] show program version\n"
" -h[elp] print this help\n"
"\n"
@@ -4302,6 +4354,7 @@ msgid ""
" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+" a[gent] NetworkManager secret agent or polkit agent\n"
"\n"
msgstr ""
"Användning: %s [FLAGGOR] OBJEKT { KOMMANDO | help }\n"
@@ -4310,11 +4363,9 @@ msgstr ""
" -t[erse] sparsam utdata\n"
" -p[retty] vacker utdata\n"
" -m[ode] tabular|multiline utdataläge\n"
-" -f[ields] <field1,field2,…>|all|common ange fält för utdata\n"
-" -e[scape] yes|no escape columns separators in "
-"values\n"
-" -n[ocheck] kontrollera inte nmcli och "
-"Nätverkshanterarens versioner\n"
+" -f[ields] <field1,field2,…>|all|common ange fält för utdata\n"
+" -e[scape] yes|no omge kolumnseparatorer i värden med säker sträng\n"
+" -n[ocheck] kontrollera inte nmcli och Nätverkshanterarens versioner\n"
" -a[sk] fråga efter saknade parametrar\n"
" -w[ait] <seconds> sätt en tidsgräns för åtgärder\n"
" -v[ersion] visa programversionen\n"
@@ -4326,65 +4377,66 @@ msgstr ""
" r[adio] Nätverkshanterarens radioväxlar\n"
" c[onnection] Nätverkshanterarens anslutningar\n"
" d[evice] enheter som hanteras av Nätverkshanteraren\n"
+" a[gent] hemlig- eller polkitagent för Nätverkshanteraren\n"
"\n"
-#: ../clients/cli/nmcli.c:135
+#: ../clients/cli/nmcli.c:142
#, c-format
msgid "Error: Object '%s' is unknown, try 'nmcli help'."
msgstr "Fel: Objektet â€%s†är okänt, prova â€nmcli helpâ€."
-#: ../clients/cli/nmcli.c:165
+#: ../clients/cli/nmcli.c:172
#, c-format
msgid "Error: Option '--terse' is specified the second time."
msgstr "Fel: Flaggan â€--terse†har angivits en andra gÃ¥ng."
-#: ../clients/cli/nmcli.c:170
+#: ../clients/cli/nmcli.c:177
#, c-format
msgid "Error: Option '--terse' is mutually exclusive with '--pretty'."
msgstr "Fel: Flaggan â€--terse†är ömsesidigt uteslutande med â€--prettyâ€."
-#: ../clients/cli/nmcli.c:178
+#: ../clients/cli/nmcli.c:185
#, c-format
msgid "Error: Option '--pretty' is specified the second time."
msgstr "Fel: Flaggan â€--pretty†har angivits en andra gÃ¥ng."
-#: ../clients/cli/nmcli.c:183
+#: ../clients/cli/nmcli.c:190
#, c-format
msgid "Error: Option '--pretty' is mutually exclusive with '--terse'."
msgstr "Fel: Flaggan â€--pretty†är ömsesidigt uteslutande med â€--terseâ€."
-#: ../clients/cli/nmcli.c:193 ../clients/cli/nmcli.c:209
-#: ../clients/cli/nmcli.c:238
+#: ../clients/cli/nmcli.c:200 ../clients/cli/nmcli.c:216
+#: ../clients/cli/nmcli.c:245
#, c-format
msgid "Error: missing argument for '%s' option."
msgstr "Fel: argument för flaggan â€%s†saknas."
-#: ../clients/cli/nmcli.c:202 ../clients/cli/nmcli.c:218
+#: ../clients/cli/nmcli.c:209 ../clients/cli/nmcli.c:225
#, c-format
msgid "Error: '%s' is not valid argument for '%s' option."
msgstr "Fel: â€%s†är inte ett giltigt argument för flaggan â€%sâ€."
-#: ../clients/cli/nmcli.c:225
+#: ../clients/cli/nmcli.c:232
#, c-format
msgid "Error: fields for '%s' options are missing."
msgstr "Fel: fält för â€%sâ€-flaggor saknas."
-#: ../clients/cli/nmcli.c:243
+#: ../clients/cli/nmcli.c:250
#, c-format
msgid "Error: '%s' is not a valid timeout for '%s' option."
msgstr "Fel: â€%s†är inte en giltig tidsgräns för flaggan â€%sâ€."
-#: ../clients/cli/nmcli.c:250
+#: ../clients/cli/nmcli.c:257
#, c-format
msgid "nmcli tool, version %s\n"
msgstr "nmcli-verktyg, version %s\n"
-#: ../clients/cli/nmcli.c:256
+#: ../clients/cli/nmcli.c:263
#, c-format
msgid "Error: Option '%s' is unknown, try 'nmcli -help'."
msgstr "Fel: Flaggan â€%s†är okänd, prova â€nmcli -helpâ€."
-#: ../clients/cli/nmcli.c:336 ../clients/cli/nmcli.c:345
+#: ../clients/cli/nmcli.c:346 ../clients/cli/nmcli.c:356
#, c-format
msgid ""
"\n"
@@ -4393,279 +4445,308 @@ msgstr ""
"\n"
"Fel: nmcli dödad av signalen %s (%d)\n"
-#: ../clients/cli/nmcli.c:376
+#: ../clients/cli/nmcli.c:387
#, c-format
msgid "Failed to set signal mask: %d\n"
msgstr "Misslyckades med att sätta signalmasken: %d\n"
-#: ../clients/cli/nmcli.c:383
+#: ../clients/cli/nmcli.c:394
#, c-format
msgid "Failed to create signal handling thread: %d\n"
msgstr "Misslyckades med att skapa signalhanteringstråd: %d\n"
-#: ../clients/cli/nmcli.c:480 ../clients/nm-online.c:197
+#: ../clients/cli/nmcli.c:491 ../clients/nm-online.c:197
#, c-format
msgid "Error: Could not create NMClient object: %s."
msgstr "Fel: Kunde inte skapa NMClient-objektet: %s."
-#: ../clients/cli/nmcli.c:497
+#: ../clients/cli/nmcli.c:508
msgid "Success"
msgstr "Lyckades"
-#: ../clients/cli/settings.c:657
+#: ../clients/cli/polkit-agent.c:82
+#, c-format
+msgid "Authentication message: %s\n"
+msgstr "Autentiseringsmeddelande: %s\n"
+
+#: ../clients/cli/polkit-agent.c:88
+#, c-format
+msgid "Authentication error: %s\n"
+msgstr "Autentiseringsfel: %s\n"
+
+#: ../clients/cli/polkit-agent.c:134
+#, c-format
+msgid "Warning: polkit agent initialization failed: %s\n"
+msgstr "Varning: Initiering av polkit-agent misslyckades: %s\n"
+
+#: ../clients/cli/settings.c:672
#, c-format
msgid "%d (key)"
msgstr "%d (nyckel)"
-#: ../clients/cli/settings.c:659
+#: ../clients/cli/settings.c:674
#, c-format
msgid "%d (passphrase)"
msgstr "%d (lösenfras)"
-#: ../clients/cli/settings.c:662 ../clients/cli/settings.c:743
+#: ../clients/cli/settings.c:677 ../clients/cli/settings.c:758
#, c-format
msgid "%d (unknown)"
msgstr "%d (okänt)"
-#: ../clients/cli/settings.c:691
+#: ../clients/cli/settings.c:706
msgid "0 (NONE)"
msgstr "0 (INGEN)"
-#: ../clients/cli/settings.c:697
+#: ../clients/cli/settings.c:712
msgid "REORDER_HEADERS, "
msgstr "REORDER_HEADERS, "
-#: ../clients/cli/settings.c:699
+#: ../clients/cli/settings.c:714
msgid "GVRP, "
msgstr "GVRP, "
-#: ../clients/cli/settings.c:701
+#: ../clients/cli/settings.c:716
msgid "LOOSE_BINDING, "
msgstr "LOOSE_BINDING, "
-#: ../clients/cli/settings.c:737
+#: ../clients/cli/settings.c:752
#, c-format
msgid "%d (disabled)"
-msgstr "(%d) (inaktiverad)"
+msgstr "%d (inaktiverad)"
-#: ../clients/cli/settings.c:739
+#: ../clients/cli/settings.c:754
#, c-format
msgid "%d (enabled, prefer public IP)"
msgstr "%d (aktiverad, föredra publik IP)"
-#: ../clients/cli/settings.c:741
+#: ../clients/cli/settings.c:756
#, c-format
msgid "%d (enabled, prefer temporary IP)"
msgstr "%d (aktiverad, föredra temporärt IP)"
-#: ../clients/cli/settings.c:753
+#: ../clients/cli/settings.c:768
msgid "0 (none)"
msgstr "0 (ingen)"
-#: ../clients/cli/settings.c:759
+#: ../clients/cli/settings.c:774
msgid "agent-owned, "
msgstr "agent-owned, "
-#: ../clients/cli/settings.c:761
+#: ../clients/cli/settings.c:776
msgid "not saved, "
msgstr "inte sparad, "
-#: ../clients/cli/settings.c:763
+#: ../clients/cli/settings.c:778
msgid "not required, "
msgstr "krävs ej, "
-#: ../clients/cli/settings.c:1046
+#: ../clients/cli/settings.c:1061
msgid "0 (disabled)"
msgstr "0 (inaktiverad)"
-#: ../clients/cli/settings.c:1052
+#: ../clients/cli/settings.c:1067
msgid "enabled, "
msgstr "aktiverad, "
-#: ../clients/cli/settings.c:1054
+#: ../clients/cli/settings.c:1069
msgid "advertise, "
msgstr "ropa ut, "
-#: ../clients/cli/settings.c:1056
+#: ../clients/cli/settings.c:1071
msgid "willing, "
msgstr "villig, "
-#: ../clients/cli/settings.c:1084
+#: ../clients/cli/settings.c:1099
msgid "-1 (unset)"
msgstr "-1 (välj ej)"
-#: ../clients/cli/settings.c:1181 ../clients/cli/settings.c:1512
-#: ../clients/cli/settings.c:1554
+#: ../clients/cli/settings.c:1196 ../clients/cli/settings.c:1483
+#: ../clients/cli/settings.c:1525
msgid "auto"
msgstr "auto"
-#: ../clients/cli/settings.c:1194
+#: ../clients/cli/settings.c:1209
msgid "default"
msgstr "standard"
-#: ../clients/cli/settings.c:1682
+#: ../clients/cli/settings.c:1541
+#, c-format
+msgid "yes (%u)"
+msgstr "yes (%u)"
+
+#: ../clients/cli/settings.c:1667
#, c-format
msgid "Do you also want to set '%s' to '%s'? [yes]: "
msgstr "Vill du ocksÃ¥ sätta â€%s†till â€%sâ€? [yes]: "
-#: ../clients/cli/settings.c:1684
+#: ../clients/cli/settings.c:1669
#, c-format
msgid "Do you also want to clear '%s'? [yes]: "
msgstr "Vill du ocksÃ¥ rensa â€%sâ€? [yes]: "
-#: ../clients/cli/settings.c:1845
+#: ../clients/cli/settings.c:1830
#, c-format
-msgid ""
-"Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"
-msgstr ""
-"Varning: %s.%s sätts till â€%sâ€, men kan ignoreras i infrastrukturläge\n"
+msgid "Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"
+msgstr "Varning: %s.%s sätts till â€%sâ€, men kan ignoreras i infrastrukturläge\n"
+
+#: ../clients/cli/settings.c:1849
+#, c-format
+msgid "Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"
+msgstr "Varning: inställningen %s.%s kräver att inställningar för ipv4 och ipv6 tas bort\n"
+
+#: ../clients/cli/settings.c:1851
+msgid "Do you want to remove them? [yes] "
+msgstr "Vill du ta bort dem? [ja] "
-#: ../clients/cli/settings.c:1927 ../clients/cli/settings.c:2207
-#: ../clients/cli/settings.c:4307
+#: ../clients/cli/settings.c:1947 ../clients/cli/settings.c:2269
+#: ../clients/cli/settings.c:4402
#, c-format
msgid "'%s' is not valid"
-msgstr "â€%s†är inte giltigt."
+msgstr "â€%s†är inte giltigt"
-#: ../clients/cli/settings.c:1950
+#: ../clients/cli/settings.c:1970
#, c-format
msgid "'%d' is not valid; use <%d-%d>"
msgstr "â€%d†är inte giltigt; använd <%d-%d>"
-#: ../clients/cli/settings.c:1972
+#: ../clients/cli/settings.c:1992
+#, c-format
+msgid "'%lld' is not valid; use <%lld-%lld>"
+msgstr "â€%lld†är inte giltigt; använd <%lld-%lld>"
+
+#: ../clients/cli/settings.c:2014
#, c-format
-msgid "'%u' is not valid; use <%d-%d>"
-msgstr "â€%u†är inte giltigt; använd <%d-%d>"
+msgid "'%u' is not valid; use <%u-%u>"
+msgstr "â€%u†är inte giltigt; använd <%u-%u>"
-#: ../clients/cli/settings.c:2038
+#: ../clients/cli/settings.c:2080
#, c-format
msgid "'%s' is not valid; use <option>=<value>"
msgstr "â€%s†är inte giltigt; använd <flagga>=<värde>"
-#: ../clients/cli/settings.c:2072
+#: ../clients/cli/settings.c:2114
#, c-format
msgid "index '%s' is not valid"
msgstr "indexet â€%s†är inte giltigt"
-#: ../clients/cli/settings.c:2077 ../clients/cli/settings.c:2102
+#: ../clients/cli/settings.c:2119 ../clients/cli/settings.c:2144
msgid "no item to remove"
msgstr "inget objekt att ta bort"
-#: ../clients/cli/settings.c:2081 ../clients/cli/settings.c:2106
+#: ../clients/cli/settings.c:2123 ../clients/cli/settings.c:2148
#, c-format
msgid "index '%d' is not in range <0-%d>"
msgstr "index â€%d†är inte i intervallet <0-%d>"
-#: ../clients/cli/settings.c:2121
+#: ../clients/cli/settings.c:2163
#, c-format
msgid "invalid option '%s'"
msgstr "ogiltig flagga â€%sâ€"
-#: ../clients/cli/settings.c:2123
+#: ../clients/cli/settings.c:2165
msgid "missing option"
msgstr "saknat alternativ"
-#: ../clients/cli/settings.c:2153 ../clients/cli/settings.c:2173
+#: ../clients/cli/settings.c:2195 ../clients/cli/settings.c:2215
+#: ../clients/cli/settings.c:2235
#, c-format
msgid "'%s' is not a valid number (or out of range)"
msgstr "â€%s†är inte ett giltigt nummer (eller utanför intervallet)"
-#: ../clients/cli/settings.c:2223
+#: ../clients/cli/settings.c:2285
#, c-format
msgid "'%s' is not a valid Ethernet MAC"
msgstr "â€%s†är inte en giltig Ethernet MAC"
-#: ../clients/cli/settings.c:2248 ../libnm-core/nm-setting-connection.c:796
-#: ../libnm-core/nm-setting-infiniband.c:254
-#: ../libnm-util/nm-setting-connection.c:833
-#: ../libnm-util/nm-setting-infiniband.c:268
+#: ../clients/cli/settings.c:2310 ../libnm-core/nm-setting-connection.c:795
+#: ../libnm-core/nm-setting-infiniband.c:256
+#: ../libnm-util/nm-setting-connection.c:835
+#: ../libnm-util/nm-setting-infiniband.c:270
#, c-format
msgid "'%s' is not a valid interface name"
msgstr "'â€%s†är inte ett giltigt gränssnittsnamn"
-#: ../clients/cli/settings.c:2272
+#: ../clients/cli/settings.c:2334
#, c-format
msgid "'%s' is not a valid flag number; use <0-%d>"
msgstr "â€%s†är inte ett giltigt flaggnummer; använd <0-%d>"
-#: ../clients/cli/settings.c:2284
+#: ../clients/cli/settings.c:2346
#, c-format
msgid "Warning: '%s' sum is higher than all flags => all flags set\n"
msgstr "Varning: â€%sâ€-summan är högre än alla flaggor => alla flaggor satta\n"
-#: ../clients/cli/settings.c:2327
+#: ../clients/cli/settings.c:2387
#, c-format
msgid "'%s' is not a valid hex character"
msgstr "â€%s†är inte ett giltigt hextecken"
-#: ../clients/cli/settings.c:2357
+#: ../clients/cli/settings.c:2417
#, c-format
msgid "'%s' is not a valid MAC"
msgstr "â€%s†är inte ett giltigt MAC"
-#: ../clients/cli/settings.c:2394 ../libnm-core/nm-setting-connection.c:785
-#: ../libnm-util/nm-setting-connection.c:790
+#: ../clients/cli/settings.c:2454 ../libnm-core/nm-setting-connection.c:784
+#: ../libnm-util/nm-setting-connection.c:792
#, c-format
msgid "'%s' is not a valid UUID"
msgstr "â€%s†är inte ett giltigt UUID"
-#: ../clients/cli/settings.c:2461
+#: ../clients/cli/settings.c:2521
#, c-format
msgid "the property doesn't contain permission '%s'"
msgstr "egenskapen innehÃ¥ller inte rättigheten â€%sâ€"
-#: ../clients/cli/settings.c:2473
+#: ../clients/cli/settings.c:2533
msgid ""
-"Enter a list of user permissions. This is a list of user names formatted "
-"as:\n"
+"Enter a list of user permissions. This is a list of user names formatted as:\n"
" [user:]<user name 1>, [user:]<user name 2>,...\n"
"The items can be separated by commas or spaces.\n"
"\n"
"Example: alice bob charlie\n"
msgstr ""
-"Mata in en lista av användarrättigheter. Det är en lista av användarnamn "
-"formaterade som:\n"
+"Mata in en lista av användarrättigheter. Det är en lista av användarnamn formaterade som:\n"
" [user:]<användarnamn 1>, [user:]<användarnamn 2>,…\n"
"Objekten kan separeras med komman eller blanksteg.\n"
"\n"
"Exempel: Anders Sebastian Göran\n"
-#: ../clients/cli/settings.c:2492
+#: ../clients/cli/settings.c:2552
#, c-format
msgid "'%s' is not valid master; use ifname or connection UUID"
msgstr "â€%s†är inte en giltig master; använd ifnamn eller anslutnings-UUID"
-#: ../clients/cli/settings.c:2536
+#: ../clients/cli/settings.c:2596
#, c-format
msgid "Warning: %s is not an UUID of any existing connection profile\n"
msgstr "Varning: %s är inte ett UUID på någon befintlig anslutningsprofil\n"
-#: ../clients/cli/settings.c:2540 ../clients/cli/settings.c:2556
+#: ../clients/cli/settings.c:2600 ../clients/cli/settings.c:2616
#, c-format
msgid "'%s' is not a VPN connection profile"
msgstr "â€%s†är inte en giltig VPN-anslutningsprofil"
-#: ../clients/cli/settings.c:2549
+#: ../clients/cli/settings.c:2609
#, c-format
msgid "'%s' is not a name of any exiting profile"
msgstr "â€%s†är inte ett namn pÃ¥ nÃ¥gon befintlig profil"
-#: ../clients/cli/settings.c:2583
+#: ../clients/cli/settings.c:2643
#, c-format
msgid "the value '%s' is not a valid UUID"
msgstr "värdet â€%s†är inte ett giltigt UUID"
-#: ../clients/cli/settings.c:2590
+#: ../clients/cli/settings.c:2650
#, c-format
msgid "the property doesn't contain UUID '%s'"
msgstr "egenskapen innehÃ¥ller inte UUID â€%sâ€"
-#: ../clients/cli/settings.c:2602
+#: ../clients/cli/settings.c:2662
msgid ""
-"Enter secondary connections that should be activated when this connection "
-"is\n"
+"Enter secondary connections that should be activated when this connection is\n"
"activated. Connections can be specified either by UUID or ID (name). nmcli\n"
-"transparently translates names to UUIDs. Note that NetworkManager only "
-"supports\n"
+"transparently translates names to UUIDs. Note that NetworkManager only supports\n"
"VPNs as secondary connections at the moment.\n"
"The items can be separated by commas or spaces.\n"
"\n"
@@ -4673,66 +4754,114 @@ msgid ""
msgstr ""
"Mata in sekundära anslutningar som ska aktiveras när denna anslutning\n"
"aktiveras. Anslutningar kan anges antingen med UUID eller ID (namn). nmcli\n"
-"översätter transparent namn till UUIDn. Observera att Nätverkshanteraren "
-"bara stöder\n"
+"översätter transparent namn till UUIDn. Observera att Nätverkshanteraren bara stöder\n"
"VPN som sekundära anslutningar för tillfället.\n"
"Objekten kan separeras med komman eller blanksteg.\n"
"\n"
"Exempel: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"
-#: ../clients/cli/settings.c:2679
+#: ../clients/cli/settings.c:2739
msgid "private key password not provided"
msgstr "lösenord för privat nyckel inte angivet"
-#: ../clients/cli/settings.c:2706
+#: ../clients/cli/settings.c:2766
#, c-format
msgid "the property doesn't contain EAP method '%s'"
msgstr "egenskapen innehÃ¥ller inte EAP-metoden â€%sâ€"
-#: ../clients/cli/settings.c:2731
+#: ../clients/cli/settings.c:2781
+msgid ""
+"Enter file path to CA certificate (optionally prefixed with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/cacert.crt\n"
+msgstr ""
+"Ange filsökväg till CA-certifikat (valfritt med prefixet file://).\n"
+" [file://]<filsökväg>\n"
+"Observera att nmcli inte stödjer att ange certifikat som rå blob-data.\n"
+"Exempel: /home/cimrman/cacert.crt\n"
+
+#: ../clients/cli/settings.c:2800
#, c-format
msgid "the property doesn't contain alternative subject match '%s'"
msgstr "egenskapen innehÃ¥ller inte alternativa ämnesmatchningen â€%sâ€"
-#: ../clients/cli/settings.c:2760
+#: ../clients/cli/settings.c:2816
+msgid ""
+"Enter file path to client certificate (optionally prefixed with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/jara.crt\n"
+msgstr ""
+"Ange filsökväg till klientcertifikat (valfritt prefixad med file://).\n"
+" [file://]<filsökväg>\n"
+"Observera att nmcli inte stödjer att ange certifikat som rå blob-data.\n"
+"Exempel: /home/cimrman/jara.crt\n"
+
+#: ../clients/cli/settings.c:2828
+msgid ""
+"Enter file path to CA certificate for inner authentication (optionally prefixed\n"
+"with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/ca-zweite-phase.crt\n"
+msgstr ""
+"Ange filsökväg till CA-certifikat för inre autentisering (valfritt med prefixet\n"
+"file://).\n"
+" [file://]<filsökväg>\n"
+"Observera att nmcli inte stödjer att ange certifikat som rå blob-data.\n"
+"Exempel: /home/cimrman/cacert.crt\n"
+
+#: ../clients/cli/settings.c:2848
#, c-format
msgid "the property doesn't contain \"phase2\" alternative subject match '%s'"
msgstr "egenskapen innehÃ¥ller inte â€phase2â€-alternativa ämnesmatchningen â€%sâ€"
-#: ../clients/cli/settings.c:2786
+#: ../clients/cli/settings.c:2864
+msgid ""
+"Enter file path to client certificate for inner authentication (optionally prefixed\n"
+"with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/jara-zweite-phase.crt\n"
+msgstr ""
+"Ange filsökväg till CA-certifikat för inre autentisering (valfritt med prefixet\n"
+"file://).\n"
+" [file://]<filsökväg>\n"
+"Observera att nmcli inte stödjer att ange certifikat som rå blob-data.\n"
+"Exempel: /home/cimrman/jara-zweite-phase.crt\n"
+
+#: ../clients/cli/settings.c:2884
msgid ""
"Enter path to a private key and the key password (if not set yet):\n"
-" <file path> [<password>]\n"
+" [file://]<file path> [<password>]\n"
+"Note that nmcli does not support specifying private key as raw blob data.\n"
"Example: /home/cimrman/jara-priv-key Dardanely\n"
msgstr ""
-"Mata in sökväg till en privat nyckel och nyckellösenordet (om inte angivet "
-"än):\n"
-" <filsökväg> [<lösenord>]\n"
+"Mata in sökväg till en privat nyckel och nyckellösenordet (om inte angivet än):\n"
+" [file://]<filsökväg> [<lösenord>]\n"
+"Observera att nmcli inte stödjer att ange privat nyckel som rå blob-data.\n"
"Exempel: /home/cimrman/jara-priv-key Dardanely\n"
-#: ../clients/cli/settings.c:2856
+#: ../clients/cli/settings.c:2955
msgid ""
"Enter bytes as a list of hexadecimal values.\n"
"Two formats are accepted:\n"
-"(a) a string of hexadecimal digits, where each two digits represent one "
-"byte\n"
-"(b) space-separated list of bytes written as hexadecimal digits (with "
-"optional 0x/0X prefix, and optional leading 0).\n"
+"(a) a string of hexadecimal digits, where each two digits represent one byte\n"
+"(b) space-separated list of bytes written as hexadecimal digits (with optional 0x/0X prefix, and optional leading 0).\n"
"\n"
"Examples: ab0455a6ea3a74C2\n"
" ab 4 55 0xa6 ea 3a 74 C2\n"
msgstr ""
"Ange byte som en lista av hexadecimala värden.\n"
"Två format accepteras:\n"
-"(a) en sträng av hexadecimala siffror där varje siffra representerar en "
-"byte\n"
-"(b) blankstegseparerad lista över byte skriven som hexadecimala siffror (med "
-"valfri 0x/0X prefix, och valfri inledande 0).\n"
+"(a) en sträng av hexadecimala siffror där varje siffra representerar en byte\n"
+"(b) blankstegseparerad lista över byte skriven som hexadecimala siffror (med valfri 0x/0X prefix, och valfri inledande 0).\n"
"\n"
"Exempel: ab0455a6ea3a74C2\n"
" ab 4 55 0xa6 ea 3a 74 C2\n"
-#: ../clients/cli/settings.c:2959
+#: ../clients/cli/settings.c:3058
#, c-format
msgid ""
"Enter a list of bonding options formatted as:\n"
@@ -4763,22 +4892,32 @@ msgstr ""
"\n"
"Exempel: mode=2,miimon=120\n"
-#: ../clients/cli/settings.c:2997
+#: ../clients/cli/settings.c:3096
#, c-format
msgid "'%s' is not a valid InfiniBand MAC"
msgstr "â€%s†är inte en giltig InfiniBand MAC"
-#: ../clients/cli/settings.c:3034
+#: ../clients/cli/settings.c:3133
#, c-format
msgid "'%s' is not a valid IBoIP P_Key"
msgstr "â€%s†är inte en giltig IBoIP P_Key"
-#: ../clients/cli/settings.c:3103 ../clients/cli/settings.c:3449
+#: ../clients/cli/settings.c:3164
+#, c-format
+msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
+msgstr "â€%s†är inte giltigt (formatet är: ip[/prefix] [next-hop] [metric])"
+
+#: ../clients/cli/settings.c:3212 ../clients/cli/settings.c:3231
+#, c-format
+msgid "invalid IPv4 address '%s'"
+msgstr "ogiltig IPv4-adress â€%sâ€"
+
+#: ../clients/cli/settings.c:3237 ../clients/cli/settings.c:3538
#, c-format
msgid "the property doesn't contain DNS server '%s'"
msgstr "egenskapen innehÃ¥ller inte DNS-servern â€%sâ€"
-#: ../clients/cli/settings.c:3115
+#: ../clients/cli/settings.c:3249
msgid ""
"Enter a list of IPv4 addresses of DNS servers.\n"
"\n"
@@ -4788,54 +4927,48 @@ msgstr ""
"\n"
"Exempel: 8.8.8.8, 8.8.4.4\n"
-#: ../clients/cli/settings.c:3151 ../clients/cli/settings.c:3503
+#: ../clients/cli/settings.c:3285 ../clients/cli/settings.c:3592
#, c-format
msgid "the property doesn't contain DNS search domain '%s'"
msgstr "egenskapen innehÃ¥ller inte DNS-sökdomänen â€%sâ€"
-#: ../clients/cli/settings.c:3171 ../clients/cli/settings.c:3523
-#, c-format
-msgid "'%s' is not valid (use ip[/prefix] [gateway])"
-msgstr "â€%s†är inte giltig (använd ip[/prefix] [gateway])"
-
-#: ../clients/cli/settings.c:3220 ../clients/cli/settings.c:3571
+#: ../clients/cli/settings.c:3339 ../clients/cli/settings.c:3645
#, c-format
msgid "the property doesn't contain IP address '%s'"
msgstr "egenskapen innehÃ¥ller inte IP-adressen â€%sâ€"
-#: ../clients/cli/settings.c:3233
+#: ../clients/cli/settings.c:3352
msgid ""
"Enter a list of IPv4 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 32.\n"
"\n"
-"Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+"Example: 192.168.1.5/24, 10.0.0.11/24\n"
msgstr ""
"Ange en lista av IPv4-adresser formaterade som:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Saknade prefix räknas som prefix av 32.\n"
"\n"
"Exempel: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
-#: ../clients/cli/settings.c:3286 ../clients/cli/settings.c:3602
+#: ../clients/cli/settings.c:3368 ../clients/cli/settings.c:3674
#, c-format
-msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
-msgstr "â€%s†är inte giltigt (formatet är: ip[/prefix] [next-hop] [metric])"
+msgid "invalid gateway address '%s'"
+msgstr "ogiltig gateway-adress â€%sâ€"
-#: ../clients/cli/settings.c:3334 ../clients/cli/settings.c:3650
+#: ../clients/cli/settings.c:3423 ../clients/cli/settings.c:3729
#, c-format
msgid "the property doesn't contain route '%s'"
msgstr "egenskapen innehÃ¥ller inte rutten â€%sâ€"
-#: ../clients/cli/settings.c:3347
+#: ../clients/cli/settings.c:3436
msgid ""
"Enter a list of IPv4 routes formatted as:\n"
" ip[/prefix] [next-hop] [metric],...\n"
"\n"
"Missing prefix is regarded as a prefix of 32.\n"
"Missing next-hop is regarded as 0.0.0.0.\n"
-"Missing metric or 0 means a default metric (NM/kernel will set a default "
-"value).\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
"Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
" 10.1.2.0/24\n"
@@ -4845,60 +4978,50 @@ msgstr ""
"\n"
"Saknat prefix ses som ett prefix på 32.\n"
"Saknat nästa-hopp ses som 0.0.0.0.\n"
-"Saknat mätvärde eller 0 ses som standard metric (NM/kärnan kommer att sätta "
-"ett standardvärde).\n"
+"Saknat mätvärde ses som standard metric (NM/kärnan kommer att sätta ett standardvärde).\n"
"\n"
"Exempel: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
" 10.1.2.0/24\n"
-#: ../clients/cli/settings.c:3461
+#: ../clients/cli/settings.c:3513 ../clients/cli/settings.c:3532
+#, c-format
+msgid "invalid IPv6 address '%s'"
+msgstr "ogiltig IPv6-adress â€%sâ€"
+
+#: ../clients/cli/settings.c:3550
msgid ""
-"Enter a list of IPv6 addresses of DNS servers. If the IPv6 configuration "
-"method is 'auto' these DNS servers are appended to those (if any) returned "
-"by automatic configuration. DNS servers cannot be used with the 'shared' or "
-"'link-local' IPv6 configuration methods, as there is no upstream network. In "
-"all other IPv6 configuration methods, these DNS servers are used as the only "
-"DNS servers for this connection.\n"
+"Enter a list of IPv6 addresses of DNS servers. If the IPv6 configuration method is 'auto' these DNS servers are appended to those (if any) returned by automatic configuration. DNS servers cannot be used with the 'shared' or 'link-local' IPv6 configuration methods, as there is no upstream network. In all other IPv6 configuration methods, these DNS servers are used as the only DNS servers for this connection.\n"
"\n"
"Example: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
msgstr ""
-"Ange en lista av IPv6-adresser för DNS-servrar. Om konfigurationsmetoden för "
-"IPv6 är â€auto†läggs dessa DNS-servrar till de (om nÃ¥gra) som returneras "
-"genom automatisk konfiguration. DNS-servrar kan inte användas med IPv6-"
-"konfigurationsmetoderna för â€shared†eller â€link-local†eftersom det inte "
-"finns något uppströms nätverk. I alla andra IPv6-konfigurationsmetoder "
-"används dessa DNS-servrar som de enda DNS-servrarna för denna anslutning.\n"
+"Ange en lista av IPv6-adresser för DNS-servrar. Om konfigurationsmetoden för IPv6 är â€auto†läggs dessa DNS-servrar till de (om nÃ¥gra) som returneras genom automatisk konfiguration. DNS-servrar kan inte användas med IPv6-konfigurationsmetoderna för â€shared†eller â€link-local†eftersom det inte finns nÃ¥got uppströms nätverk. I alla andra IPv6-konfigurationsmetoder används dessa DNS-servrar som de enda DNS-servrarna för denna anslutning.\n"
"\n"
"Exempel: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
-#: ../clients/cli/settings.c:3584
+#: ../clients/cli/settings.c:3658
msgid ""
"Enter a list of IPv6 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 128.\n"
"\n"
-"Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
-"1050:0:0:0:5:600:300c:326b\n"
+"Example: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"
msgstr ""
"Ange en lista med IPv6-adresser formaterade som:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],…\n"
+" ip[/prefix], ip[/prefix],…\n"
"Saknat prefix ses som ett prefix på 128.\n"
"\n"
-"Exempel: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
-"1050:0:0:0:5:600:300c:326b\n"
+"Exempel: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, 1050:0:0:0:5:600:300c:326b\n"
-#: ../clients/cli/settings.c:3663
+#: ../clients/cli/settings.c:3742
msgid ""
"Enter a list of IPv6 routes formatted as:\n"
" ip[/prefix] [next-hop] [metric],...\n"
"\n"
"Missing prefix is regarded as a prefix of 128.\n"
"Missing next-hop is regarded as \"::\".\n"
-"Missing metric or 0 means a default metric (NM/kernel will set a default "
-"value).\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
-"Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
-"db8:beef::3 2\n"
+"Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:db8:beef::3 2\n"
" abbe::/64 55\n"
msgstr ""
"Ange en lista över IPv6-rutter formaterade som:\n"
@@ -4906,104 +5029,95 @@ msgstr ""
"\n"
"Saknat prefix tolkas som ett prefix på 128.\n"
"Saknat nästa-hopp ses som â€::â€.\n"
-"Saknad mätvärde eller 0 ses standard metric (NM/kärnan sätter ett "
-"standardvärde).\n"
+"Saknad mätvärde ses standard metric (NM/kärnan sätter ett standardvärde).\n"
"\n"
-"Exempel: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
-"db8:beef::3 2\n"
+"Exempel: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:db8:beef::3 2\n"
" abbe::/64 55\n"
-#: ../clients/cli/settings.c:3680 ../libnm-core/nm-setting-gsm.c:315
-#: ../libnm-util/nm-setting-gsm.c:372
+#: ../clients/cli/settings.c:3759 ../libnm-core/nm-setting-gsm.c:317
+#: ../libnm-util/nm-setting-gsm.c:374
#, c-format
msgid "'%s' is not a number"
msgstr "â€%s†är inte ett nummer"
-#: ../clients/cli/settings.c:3687
+#: ../clients/cli/settings.c:3766
#, c-format
msgid "'%s' is not valid; use 0, 1, or 2"
msgstr "â€%s†är inte giltig; använd 0, 1 eller 2"
-#: ../clients/cli/settings.c:3704
+#: ../clients/cli/settings.c:3783
#, c-format
msgid "'%s' is not a valid channel; use <1-13>"
msgstr "â€%s†är inte en giltig kanal; använd <1-13>"
-#: ../clients/cli/settings.c:3741
+#: ../clients/cli/settings.c:3820
#, c-format
msgid "'%s' is not valid; use [e, o, n]"
msgstr "â€%s†är inte giltig; använd [e, o, n]"
-#: ../clients/cli/settings.c:3769
+#: ../clients/cli/settings.c:3848
msgid ""
-"nmcli can accepts both direct JSON configuration data and a file name "
-"containing the configuration. In the latter case the file is read and the "
-"contents is put into this property.\n"
+"nmcli can accepts both direct JSON configuration data and a file name containing the configuration. In the latter case the file is read and the contents is put into this property.\n"
"\n"
-"Examples: set team.config { \"device\": \"team0\", \"runner\": {\"name\": "
-"\"roundrobin\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }\n"
+"Examples: set team.config { \"device\": \"team0\", \"runner\": {\"name\": \"roundrobin\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }\n"
" set team.config /etc/my-team.conf\n"
msgstr ""
-"nmcli kan acceptera både direkt JSON-konfigurationsdata och ett filnamn "
-"innehållandes konfigurationen. I det senare fallet läses filen in och "
-"innehållet läggs i denna egenskap.\n"
+"nmcli kan acceptera både direkt JSON-konfigurationsdata och ett filnamn innehållandes konfigurationen. I det senare fallet läses filen in och innehållet läggs i denna egenskap.\n"
"\n"
-"Exempel: set team.config { â€deviceâ€: â€team0â€, â€runnerâ€: {â€nameâ€: "
-"â€roundrobinâ€}, â€portsâ€: {â€eth1â€: {}, â€eth2â€: {}} }\n"
+"Exempel: set team.config { â€deviceâ€: â€team0â€, â€runnerâ€: {â€nameâ€: â€roundrobinâ€}, â€portsâ€: {â€eth1â€: {}, â€eth2â€: {}} }\n"
" set team.config /etc/my-team.conf\n"
-#: ../clients/cli/settings.c:3809
+#: ../clients/cli/settings.c:3888
msgid "no priority to remove"
msgstr "ingen prioritet att ta bort"
-#: ../clients/cli/settings.c:3813
+#: ../clients/cli/settings.c:3892
#, c-format
msgid "index '%d' is not in the range of <0-%d>"
msgstr "index â€%d†är inte i intervallet för <0-%d>"
-#: ../clients/cli/settings.c:3852
+#: ../clients/cli/settings.c:3931
#, c-format
-msgid ""
-"Warning: only one mapping at a time is supported; taking the first one (%s)\n"
+msgid "Warning: only one mapping at a time is supported; taking the first one (%s)\n"
msgstr "Varning: endast en mappning åt gången stöds; tar den första (%s)\n"
-#: ../clients/cli/settings.c:3859
+#: ../clients/cli/settings.c:3938
#, c-format
msgid "the property doesn't contain mapping '%s'"
msgstr "egenskapen stöder inte mappningen â€%sâ€"
-#: ../clients/cli/settings.c:3968 ../clients/cli/settings.c:4136
+#: ../clients/cli/settings.c:4047 ../clients/cli/settings.c:4210
#: ../libnm-core/nm-setting-wired.c:604
-#: ../libnm-core/nm-setting-wireless.c:781
-#: ../libnm-core/nm-setting-wireless.c:793
-#: ../libnm-util/nm-setting-wired.c:648
-#: ../libnm-util/nm-setting-wireless.c:840
-#: ../libnm-util/nm-setting-wireless.c:854
+#: ../libnm-core/nm-setting-wireless.c:803
+#: ../libnm-core/nm-setting-wireless.c:815
+#: ../libnm-util/nm-setting-wired.c:647
+#: ../libnm-util/nm-setting-wireless.c:860
+#: ../libnm-util/nm-setting-wireless.c:874
#, c-format
msgid "'%s' is not a valid MAC address"
msgstr "â€%s†är inte en giltig MAC-adress"
-#: ../clients/cli/settings.c:3974 ../clients/cli/settings.c:4142
+#: ../clients/cli/settings.c:4053 ../clients/cli/settings.c:4216
#, c-format
msgid "the property doesn't contain MAC address '%s'"
msgstr "egenskapen innehÃ¥ller inte MAC-adress â€%sâ€"
-#: ../clients/cli/settings.c:3993
+#: ../clients/cli/settings.c:4072
#, c-format
-msgid "'%s' is not valid; 3 strings should be provided"
-msgstr "â€%s†är ogiltig; Tre strängar ska ges"
+msgid "'%s' is not valid; 2 or 3 strings should be provided"
+msgstr "â€%s†är ogiltig; TvÃ¥ eller tre strängar ska ges"
-#: ../clients/cli/settings.c:4012
+#: ../clients/cli/settings.c:4086
msgid ""
-"Enter a list of three channels (comma or space separated).\n"
+"Enter a list of subchannels (comma or space separated).\n"
"\n"
"Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
msgstr ""
-"Ange en lista på tre kanaler (komma eller blankstegsseparerad).\n"
+"Ange en lista på underkanaler (komma- eller blankstegsseparerad).\n"
"\n"
"Exempel: 0.0.0e20 0.0.0e21 0.0.0e22\n"
-#: ../clients/cli/settings.c:4062
+#: ../clients/cli/settings.c:4136
#, c-format
msgid ""
"Enter a list of S/390 options formatted as:\n"
@@ -5014,127 +5128,126 @@ msgstr ""
" option = <värde>, option = <värde>,…\n"
"Giltiga val är: %s\n"
-#: ../clients/cli/settings.c:4108
+#: ../clients/cli/settings.c:4182
#, c-format
msgid "'%s' is not a valid channel"
-msgstr "â€%s†är inte en giltig kanal."
+msgstr "â€%s†är inte en giltig kanal"
-#: ../clients/cli/settings.c:4114
+#: ../clients/cli/settings.c:4188
#, c-format
msgid "'%ld' is not a valid channel"
msgstr "â€%ld†är en ogiltig kanal"
-#: ../clients/cli/settings.c:4201 ../clients/cli/settings.c:4239
-#: ../clients/cli/settings.c:4277
+#: ../clients/cli/settings.c:4236
+#, c-format
+msgid "'%s' is not a valid powersave value"
+msgstr "â€%s†är inte ett giltigt värde för powersave"
+
+#: ../clients/cli/settings.c:4296 ../clients/cli/settings.c:4334
+#: ../clients/cli/settings.c:4372
#, c-format
msgid "the property doesn't contain protocol '%s'"
msgstr "egenskapen innehÃ¥ller inte protokollet â€%sâ€"
-#: ../clients/cli/settings.c:4316
+#: ../clients/cli/settings.c:4411
#, c-format
-msgid ""
-"'%s' not compatible with %s '%s', please change the key or set the right %s "
-"first."
-msgstr ""
-"â€%s†är inte kompatibel med %s â€%sâ€, ändra nyckeln eller sätt rätt %s först."
+msgid "'%s' not compatible with %s '%s', please change the key or set the right %s first."
+msgstr "â€%s†är inte kompatibel med %s â€%sâ€, ändra nyckeln eller sätt rätt %s först."
-#: ../clients/cli/settings.c:4324
+#: ../clients/cli/settings.c:4419
#, c-format
msgid "WEP key is guessed to be of '%s'\n"
msgstr "WEP-nyckel antas vara â€%sâ€\n"
-#: ../clients/cli/settings.c:4326
+#: ../clients/cli/settings.c:4421
#, c-format
msgid "WEP key index set to '%d'\n"
msgstr "index för WEP-nyckel satt till â€%dâ€\n"
-#: ../clients/cli/settings.c:4349
+#: ../clients/cli/settings.c:4444
#, c-format
msgid "'%s' not among [0 (unknown), 1 (key), 2 (passphrase)]"
msgstr "â€%s†inte bland [0 (okänd), 1 (nyckel), 2 (lösenfras)]"
-#: ../clients/cli/settings.c:4365 ../clients/cli/settings.c:4368
-#: ../clients/cli/settings.c:4371 ../clients/cli/settings.c:4374
+#: ../clients/cli/settings.c:4460 ../clients/cli/settings.c:4463
+#: ../clients/cli/settings.c:4466 ../clients/cli/settings.c:4469
#, c-format
-msgid ""
-"Warning: '%s' is not compatible with '%s' type, please change or delete the "
-"key.\n"
-msgstr ""
-"Varning:â€%s†är inte kompatibel med â€%sâ€-typ, ändra eller ta bort nyckeln.\n"
+msgid "Warning: '%s' is not compatible with '%s' type, please change or delete the key.\n"
+msgstr "Varning:â€%s†är inte kompatibel med â€%sâ€-typ, ändra eller ta bort nyckeln.\n"
-#: ../clients/cli/settings.c:4387
+#: ../clients/cli/settings.c:4482
#, c-format
-msgid ""
-"Enter the type of WEP keys. The accepted values are: 0 or unknown, 1 or key, "
-"and 2 or passphrase.\n"
-msgstr ""
-"Ange typ på WEP-nycklarna. Accepterade värden är: 0 eller okänd, 1 eller "
-"nyckel, 2 eller lösenfras.\n"
+msgid "Enter the type of WEP keys. The accepted values are: 0 or unknown, 1 or key, and 2 or passphrase.\n"
+msgstr "Ange typ på WEP-nycklarna. Accepterade värden är: 0 eller okänd, 1 eller nyckel, 2 eller lösenfras.\n"
-#: ../clients/cli/settings.c:4400
+#: ../clients/cli/settings.c:4495
#, c-format
msgid "'%s' is not a valid PSK"
msgstr "â€%s†inte en giltig PSK"
-#: ../clients/cli/settings.c:4444
+#: ../clients/cli/settings.c:4539
#, c-format
msgid "'%s' is not a valid DCB flag"
msgstr "â€%s†är inte en giltig DCB-flagga"
-#: ../clients/cli/settings.c:4467
+#: ../clients/cli/settings.c:4562
#, c-format
msgid "'%s' is not a DCB app priority"
msgstr "â€%s†är inte en giltig DCB-programprioritet"
-#: ../clients/cli/settings.c:4493
+#: ../clients/cli/settings.c:4588
msgid "must contain 8 comma-separated numbers"
msgstr "måste innehålla 8 kommaseparerade siffror"
-#: ../clients/cli/settings.c:4510
+#: ../clients/cli/settings.c:4605
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive) or %u"
msgstr "â€%s†inte en siffra mellan 0 och %u (inklusive) eller %u"
-#: ../clients/cli/settings.c:4513
+#: ../clients/cli/settings.c:4608
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive)"
msgstr "â€%s†inte en siffra mellan 0 och %u (inklusive)"
-#: ../clients/cli/settings.c:4535
+#: ../clients/cli/settings.c:4630
#, c-format
msgid ""
"Warning: changes will have no effect until '%s' includes 1 (enabled)\n"
"\n"
msgstr ""
-"Varning: ändringar kommer inte att slÃ¥ igenom förrän â€%s†inkluderar 1 "
-"(aktiverad)\n"
+"Varning: ändringar kommer inte att slÃ¥ igenom förrän â€%s†inkluderar 1 (aktiverad)\n"
"\n"
-#: ../clients/cli/settings.c:4588
+#: ../clients/cli/settings.c:4683
#, c-format
msgid "bandwidth percentages must total 100%%"
msgstr "summan för bandbreddsprocenten måste vara 100%%"
-#: ../clients/cli/settings.c:6238
+#: ../clients/cli/settings.c:6384
msgid "don't know how to get the property value"
msgstr "vet inte hur egenskapsvärdet ska hämtas"
-#: ../clients/cli/settings.c:6291 ../clients/cli/settings.c:6331
+#: ../clients/cli/settings.c:6437 ../clients/cli/settings.c:6477
msgid "the property can't be changed"
msgstr "egenskapen kan inte ändras"
-#: ../clients/cli/settings.c:6414
+#: ../clients/cli/settings.c:6561
msgid "(not available)"
msgstr "(ej tillgänglig)"
-#: ../clients/cli/settings.c:6439
+#: ../clients/cli/settings.c:6586
msgid "[NM property description]"
msgstr "[NM egenskapsbeskrivning]"
-#: ../clients/cli/settings.c:6444
+#: ../clients/cli/settings.c:6591
msgid "[nmcli specific description]"
msgstr "[nmcli specifik beskrivning]"
+#. ----------------------------------------------------------------------------
+#: ../clients/cli/settings.c:6640
+msgid "<hidden>"
+msgstr "<dold>"
+
#: ../clients/cli/utils.c:127
#, c-format
msgid "Error: value for '%s' argument is required."
@@ -5180,43 +5293,124 @@ msgstr "â€%s†är dubbeltydig (%s x %s)"
msgid "missing name, try one of [%s]"
msgstr "saknat namn, prova en av [%s]"
-#: ../clients/cli/utils.c:731
+#: ../clients/cli/utils.c:753
#, c-format
msgid "field '%s' has to be alone"
msgstr "fältet â€%s†mÃ¥ste vara ensamt"
-#: ../clients/cli/utils.c:734
+#: ../clients/cli/utils.c:756
#, c-format
msgid "invalid field '%s'; allowed fields: %s"
msgstr "ogiltigt fält â€%sâ€; tillÃ¥tna fält: %s"
-#: ../clients/cli/utils.c:791
+#: ../clients/cli/utils.c:813
msgid "Option '--terse' requires specifying '--fields'"
msgstr "Flaggan â€--terse†kräver att â€--fields†anges"
-#: ../clients/cli/utils.c:795
+#: ../clients/cli/utils.c:817
#, c-format
msgid "Option '--terse' requires specific '--fields' option values , not '%s'"
-msgstr ""
-"Flaggan â€--terse†kräver angivna värden för â€--fieldsâ€-flaggan , inte â€%sâ€"
+msgstr "Flaggan â€--terse†kräver angivna värden för â€--fieldsâ€-flaggan , inte â€%sâ€"
-#: ../clients/cli/utils.c:1113
+#: ../clients/cli/utils.c:1135
#, c-format
-msgid ""
-"Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --"
-"nocheck to suppress the warning.\n"
-msgstr ""
-"Varning: versionerna för nmcli (%s) och NetworkManager (%s) stämmer inte "
-"överens. Använd --nocheck för att inte visa varningen.\n"
+msgid "Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --nocheck to suppress the warning.\n"
+msgstr "Varning: versionerna för nmcli (%s) och NetworkManager (%s) stämmer inte överens. Använd --nocheck för att inte visa varningen.\n"
-#: ../clients/cli/utils.c:1122
+#: ../clients/cli/utils.c:1144
#, c-format
-msgid ""
-"Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force "
-"execution using --nocheck, but the results are unpredictable."
-msgstr ""
-"Fel: versionerna för nmcli (%s) och NetworkManager (%s) matchar inte. Tvinga "
-"körning med --nocheck, men resultatet är inte förutsägbart."
+msgid "Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force execution using --nocheck, but the results are unpredictable."
+msgstr "Fel: versionerna för nmcli (%s) och NetworkManager (%s) matchar inte. Tvinga körning med --nocheck, men resultatet är inte förutsägbart."
+
+#: ../clients/common/nm-polkit-listener.c:215
+msgid "An authentication session is already underway."
+msgstr "En autentiseringssession är redan igång."
+
+#. TTLS and PEAP are actually much more complicated, but this complication
+#. * is not visible here since we only care about phase2 authentication
+#. * (and don't even care of which one)
+#.
+#: ../clients/common/nm-secret-agent-simple.c:209
+#: ../clients/common/nm-secret-agent-simple.c:300
+#: ../clients/tui/nmt-page-dsl.c:69 ../clients/tui/nmt-page-wifi.c:335
+msgid "Username"
+msgstr "Användarnamn"
+
+#: ../clients/common/nm-secret-agent-simple.c:214
+#: ../clients/common/nm-secret-agent-simple.c:251
+#: ../clients/common/nm-secret-agent-simple.c:277
+#: ../clients/common/nm-secret-agent-simple.c:310
+#: ../clients/common/nm-secret-agent-simple.c:379
+#: ../clients/common/nm-secret-agent-simple.c:392
+#: ../clients/common/nm-secret-agent-simple.c:408
+#: ../clients/tui/nmt-page-dsl.c:78 ../clients/tui/nmt-page-wifi.c:280
+#: ../clients/tui/nmt-page-wifi.c:311 ../clients/tui/nmt-page-wifi.c:344
+msgid "Password"
+msgstr "Lösenord"
+
+#: ../clients/common/nm-secret-agent-simple.c:223
+msgid "Identity"
+msgstr "Identitet"
+
+#: ../clients/common/nm-secret-agent-simple.c:228
+msgid "Private key password"
+msgstr "Lösenord för privat nyckel"
+
+#: ../clients/common/nm-secret-agent-simple.c:265
+#: ../clients/tui/nmt-page-wifi.c:292
+msgid "Key"
+msgstr "Nyckel"
+
+#: ../clients/common/nm-secret-agent-simple.c:305
+#: ../clients/tui/nmt-page-dsl.c:81
+msgid "Service"
+msgstr "Tjänst"
+
+#: ../clients/common/nm-secret-agent-simple.c:339
+msgid "Authentication required by wireless network"
+msgstr "Autentisering krävs av trådlösa nätverket"
+
+#: ../clients/common/nm-secret-agent-simple.c:340
+#, c-format
+msgid "Passwords or encryption keys are required to access the wireless network '%s'."
+msgstr "Lösenord eller krypteringsnycklar krävs för Ã¥tkomst till trÃ¥dlösa nätverket â€%sâ€."
+
+#: ../clients/common/nm-secret-agent-simple.c:348
+msgid "Wired 802.1X authentication"
+msgstr "Trådbunden 802.1X-autentisering"
+
+#: ../clients/common/nm-secret-agent-simple.c:351
+msgid "Network name"
+msgstr "Nätverksnamn"
+
+#: ../clients/common/nm-secret-agent-simple.c:358
+msgid "DSL authentication"
+msgstr "DSL-autentisering"
+
+#: ../clients/common/nm-secret-agent-simple.c:366
+msgid "PIN code required"
+msgstr "PIN-kod krävs"
+
+#: ../clients/common/nm-secret-agent-simple.c:367
+msgid "PIN code is needed for the mobile broadband device"
+msgstr "Det krävs PIN-kod för den mobila bredbandsenheten"
+
+#: ../clients/common/nm-secret-agent-simple.c:369
+msgid "PIN"
+msgstr "PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:375
+#: ../clients/common/nm-secret-agent-simple.c:388
+#: ../clients/common/nm-secret-agent-simple.c:404
+msgid "Mobile broadband network password"
+msgstr "Nätverkslösenord för mobilt bredband"
+
+#: ../clients/common/nm-secret-agent-simple.c:376
+#: ../clients/common/nm-secret-agent-simple.c:389
+#: ../clients/common/nm-secret-agent-simple.c:405
+#, c-format
+msgid "A password is required to connect to '%s'."
+msgstr "Ett lösenord krävs för att ansluta till â€%sâ€."
#: ../clients/nm-online.c:96
#, c-format
@@ -5224,9 +5418,7 @@ msgid "\rConnecting"
msgstr "\rAnsluter"
#: ../clients/nm-online.c:149
-msgid ""
-"Time to wait for a connection, in seconds (without the option, default value "
-"is 30)"
+msgid "Time to wait for a connection, in seconds (without the option, default value is 30)"
msgstr "Tid att vänta på anslutning i sekunder (utan val är standardvärdet 30)"
#: ../clients/nm-online.c:150
@@ -5242,20 +5434,16 @@ msgid "Wait for NetworkManager startup instead of a connection"
msgstr "Vänta på att Nätverkshanteraren ska starta istället för en anslutning"
#: ../clients/nm-online.c:173
-msgid ""
-"Waits for NetworkManager to finish activating startup network connections."
-msgstr ""
-"Väntar på att Nätverkshanteraren ska blir klar med att aktivera startande "
-"nätverksanslutningar."
+msgid "Waits for NetworkManager to finish activating startup network connections."
+msgstr "Väntar på att Nätverkshanteraren ska blir klar med att aktivera startande nätverksanslutningar."
#: ../clients/nm-online.c:180 ../clients/nm-online.c:186
msgid "Invalid option. Please use --help to see a list of valid options."
-msgstr ""
-"Ogiltig flagga. Använd --help för att se en lista över giltiga flaggor."
+msgstr "Ogiltig flagga. Använd --help för att se en lista över giltiga flaggor."
-#: ../clients/tui/newt/nmt-newt-utils.c:180 ../clients/tui/nmt-editor.c:244
+#: ../clients/tui/newt/nmt-newt-utils.c:180 ../clients/tui/nmt-editor.c:417
#: ../clients/tui/nmt-password-dialog.c:174
-#: ../clients/tui/nmt-route-editor.c:135 ../clients/tui/nmtui-hostname.c:71
+#: ../clients/tui/nmt-route-editor.c:125 ../clients/tui/nmtui-hostname.c:71
#: ../clients/tui/nmtui.c:117
msgid "OK"
msgstr "OK"
@@ -5301,8 +5489,8 @@ msgstr "Trådlös anslutning %d"
msgid "InfiniBand connection %d"
msgstr "InfiniBand-anslutning %d"
-#: ../clients/tui/nm-editor-utils.c:173 ../libnm-glib/nm-device.c:1798
-#: ../libnm/nm-device.c:1608
+#: ../clients/tui/nm-editor-utils.c:173 ../libnm-glib/nm-device.c:1799
+#: ../libnm/nm-device.c:1621
msgid "Mobile Broadband"
msgstr "Mobilt bredband"
@@ -5311,7 +5499,7 @@ msgstr "Mobilt bredband"
msgid "Mobile broadband connection %d"
msgstr "Mobil bredbandsanslutning %d"
-#: ../clients/tui/nm-editor-utils.c:182 ../clients/tui/nmt-page-dsl.c:39
+#: ../clients/tui/nm-editor-utils.c:182 ../clients/tui/nmt-page-dsl.c:65
msgid "DSL"
msgstr "DSL"
@@ -5320,9 +5508,9 @@ msgstr "DSL"
msgid "DSL connection %d"
msgstr "DSL-anslutning %d"
-#: ../clients/tui/nm-editor-utils.c:191 ../libnm-core/nm-connection.c:1482
-#: ../libnm-glib/nm-device.c:1802 ../libnm-util/nm-connection.c:1606
-#: ../libnm/nm-device.c:1612 ../src/settings/plugins/ifcfg-rh/reader.c:3973
+#: ../clients/tui/nm-editor-utils.c:191 ../libnm-core/nm-connection.c:1567
+#: ../libnm-glib/nm-device.c:1803 ../libnm-util/nm-connection.c:1608
+#: ../libnm/nm-device.c:1625 ../src/settings/plugins/ifcfg-rh/reader.c:3921
msgid "Bond"
msgstr "Kombinera"
@@ -5331,9 +5519,9 @@ msgstr "Kombinera"
msgid "Bond connection %d"
msgstr "Kombinationsanslutning %d"
-#: ../clients/tui/nm-editor-utils.c:200 ../libnm-core/nm-connection.c:1486
-#: ../libnm-glib/nm-device.c:1806 ../libnm-util/nm-connection.c:1610
-#: ../libnm/nm-device.c:1616 ../src/settings/plugins/ifcfg-rh/reader.c:4264
+#: ../clients/tui/nm-editor-utils.c:200 ../libnm-core/nm-connection.c:1571
+#: ../libnm-glib/nm-device.c:1807 ../libnm-util/nm-connection.c:1612
+#: ../libnm/nm-device.c:1629 ../src/settings/plugins/ifcfg-rh/reader.c:4212
msgid "Bridge"
msgstr "Brygga"
@@ -5342,9 +5530,9 @@ msgstr "Brygga"
msgid "Bridge connection %d"
msgstr "Brygganslutning %d"
-#: ../clients/tui/nm-editor-utils.c:209 ../libnm-core/nm-connection.c:1484
-#: ../libnm-glib/nm-device.c:1804 ../libnm-util/nm-connection.c:1608
-#: ../libnm/nm-device.c:1614 ../src/settings/plugins/ifcfg-rh/reader.c:4079
+#: ../clients/tui/nm-editor-utils.c:209 ../libnm-core/nm-connection.c:1569
+#: ../libnm-glib/nm-device.c:1805 ../libnm-util/nm-connection.c:1610
+#: ../libnm/nm-device.c:1627 ../src/settings/plugins/ifcfg-rh/reader.c:4027
msgid "Team"
msgstr "Grupp"
@@ -5367,48 +5555,77 @@ msgstr "VPN-anslutning %d"
msgid "Select..."
msgstr "Markera…"
-#: ../clients/tui/nmt-edit-connection-list.c:129
+#: ../clients/tui/nmt-edit-connection-list.c:112
msgid "Add"
msgstr "Lägg till"
-#: ../clients/tui/nmt-edit-connection-list.c:132
-#: ../clients/tui/nmt-page-ip4.c:175 ../clients/tui/nmt-page-ip6.c:173
-#: ../clients/tui/nmt-page-team-port.c:110 ../clients/tui/nmt-page-team.c:174
+#: ../clients/tui/nmt-edit-connection-list.c:115
+#: ../clients/tui/nmt-page-ip4.c:172 ../clients/tui/nmt-page-ip6.c:170
+#: ../clients/tui/nmt-page-team-port.c:112 ../clients/tui/nmt-page-team.c:176
msgid "Edit..."
msgstr "Redigera…"
-#: ../clients/tui/nmt-edit-connection-list.c:135
-#: ../clients/tui/nmtui-edit.c:523
+#: ../clients/tui/nmt-edit-connection-list.c:118
+#: ../clients/tui/nmtui-edit.c:527
msgid "Delete"
msgstr "Ta bort"
-#: ../clients/tui/nmt-editor.c:81
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Hide"
+msgstr "Dölj"
+
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Show"
+msgstr "Visa"
+
+#: ../clients/tui/nmt-editor.c:99
#, c-format
msgid "Could not create editor for connection '%s' of type '%s'."
msgstr "Kunde inte skapa redigerare för anslutning â€%s†av typen â€%sâ€."
-#: ../clients/tui/nmt-editor.c:85
+#: ../clients/tui/nmt-editor.c:103
#, c-format
msgid "Could not create editor for invalid connection '%s'."
msgstr "Kunde inte skapa redigerare för ogiltig anslutning â€%sâ€."
-#: ../clients/tui/nmt-editor.c:95
+#: ../clients/tui/nmt-editor.c:113
msgid "Edit Connection"
msgstr "Redigera anslutning"
-#: ../clients/tui/nmt-editor.c:148
+#: ../clients/tui/nmt-editor.c:166
#, c-format
msgid "Unable to save connection: %s"
msgstr "Kunde inte spara anslutning: %s"
-#: ../clients/tui/nmt-editor.c:162
+#: ../clients/tui/nmt-editor.c:180
#, c-format
msgid "Unable to add new connection: %s"
msgstr "Kunde inte lägga till ny anslutning: %s"
-#: ../clients/tui/nmt-editor.c:241 ../clients/tui/nmt-password-dialog.c:171
-#: ../clients/tui/nmt-route-editor.c:128 ../clients/tui/nmtui-edit.c:216
-#: ../clients/tui/nmtui-edit.c:522 ../clients/tui/nmtui-hostname.c:69
+#: ../clients/tui/nmt-editor.c:322
+msgid "Profile name"
+msgstr "Profilnamn"
+
+#: ../clients/tui/nmt-editor.c:333
+msgid "Ethernet device"
+msgstr "Ethernet-enhet"
+
+#: ../clients/tui/nmt-editor.c:335
+msgid "Device"
+msgstr "Enhet"
+
+#. And finally the bottom widgets
+#: ../clients/tui/nmt-editor.c:393
+msgid "Automatically connect"
+msgstr "Anslut automatiskt"
+
+#: ../clients/tui/nmt-editor.c:399
+msgid "Available to all users"
+msgstr "Tillgänglig för alla användare"
+
+#: ../clients/tui/nmt-editor.c:414 ../clients/tui/nmt-password-dialog.c:171
+#: ../clients/tui/nmt-route-editor.c:118 ../clients/tui/nmtui-edit.c:218
+#: ../clients/tui/nmtui-edit.c:526 ../clients/tui/nmtui-hostname.c:69
msgid "Cancel"
msgstr "Avbryt"
@@ -5420,167 +5637,145 @@ msgstr "(standard)"
msgid "bytes"
msgstr "byte"
-#: ../clients/tui/nmt-page-bond.c:88
+#: ../clients/tui/nmt-page-bond.c:87
msgid "Round-robin"
msgstr "Round-robin"
-#: ../clients/tui/nmt-page-bond.c:89
+#: ../clients/tui/nmt-page-bond.c:88
msgid "Active Backup"
msgstr "Aktiv säkerhetskopia"
-#: ../clients/tui/nmt-page-bond.c:90
+#: ../clients/tui/nmt-page-bond.c:89
msgid "XOR"
msgstr "XOR"
-#: ../clients/tui/nmt-page-bond.c:91
+#: ../clients/tui/nmt-page-bond.c:90
msgid "Broadcast"
msgstr "Broadcast"
-#: ../clients/tui/nmt-page-bond.c:92
+#: ../clients/tui/nmt-page-bond.c:91
msgid "802.3ad"
msgstr "802.3ad"
-#: ../clients/tui/nmt-page-bond.c:93
+#: ../clients/tui/nmt-page-bond.c:92
msgid "Adaptive Transmit Load Balancing (tlb)"
msgstr "Adaptive Transmit Load Balancing (tlb)"
-#: ../clients/tui/nmt-page-bond.c:94
+#: ../clients/tui/nmt-page-bond.c:93
msgid "Adaptive Load Balancing (alb)"
msgstr "Adaptive Load Balancing (alb)"
-#: ../clients/tui/nmt-page-bond.c:100
+#: ../clients/tui/nmt-page-bond.c:99
msgid "MII (recommended)"
msgstr "MII (rekommenderad)"
-#: ../clients/tui/nmt-page-bond.c:101
+#: ../clients/tui/nmt-page-bond.c:100
msgid "ARP"
msgstr "ARP"
-#: ../clients/tui/nmt-page-bond.c:357 ../clients/tui/nmt-page-bridge.c:80
-#: ../clients/tui/nmt-page-team.c:153
+#: ../clients/tui/nmt-page-bond.c:358 ../clients/tui/nmt-page-bridge.c:81
+#: ../clients/tui/nmt-page-team.c:155
msgid "Slaves"
msgstr "Slavar"
-#: ../clients/tui/nmt-page-bond.c:369 ../clients/tui/nmt-page-wifi.c:232
+#: ../clients/tui/nmt-page-bond.c:370 ../clients/tui/nmt-page-wifi.c:233
msgid "Mode"
msgstr "Läge"
-#: ../clients/tui/nmt-page-bond.c:375
+#: ../clients/tui/nmt-page-bond.c:376
msgid "Primary"
msgstr "Primär"
-#: ../clients/tui/nmt-page-bond.c:381
+#: ../clients/tui/nmt-page-bond.c:382
msgid "Link monitoring"
msgstr "Länkövervakning"
-#: ../clients/tui/nmt-page-bond.c:387 ../clients/tui/nmt-page-bond.c:394
-#: ../clients/tui/nmt-page-bond.c:401 ../clients/tui/nmt-page-bond.c:408
+#: ../clients/tui/nmt-page-bond.c:388 ../clients/tui/nmt-page-bond.c:395
+#: ../clients/tui/nmt-page-bond.c:402 ../clients/tui/nmt-page-bond.c:409
msgctxt "milliseconds"
msgid "ms"
msgstr "ms"
-#: ../clients/tui/nmt-page-bond.c:388 ../clients/tui/nmt-page-bond.c:409
+#: ../clients/tui/nmt-page-bond.c:389 ../clients/tui/nmt-page-bond.c:410
msgid "Monitoring frequency"
msgstr "Övervakningsfrekvens"
-#: ../clients/tui/nmt-page-bond.c:395
+#: ../clients/tui/nmt-page-bond.c:396
msgid "Link up delay"
msgstr "Fördröjning för länk upp"
-#: ../clients/tui/nmt-page-bond.c:402
+#: ../clients/tui/nmt-page-bond.c:403
msgid "Link down delay"
msgstr "Fördröjning för länk ned"
-#: ../clients/tui/nmt-page-bond.c:415
+#: ../clients/tui/nmt-page-bond.c:416
msgid "ARP targets"
msgstr "ARP-mål"
-#: ../clients/tui/nmt-page-bridge-port.c:38
+#: ../clients/tui/nmt-page-bridge-port.c:63
msgid "BRIDGE PORT"
msgstr "BRYGGPORT"
-#: ../clients/tui/nmt-page-bridge-port.c:69
-#: ../clients/tui/nmt-page-bridge.c:106
+#: ../clients/tui/nmt-page-bridge-port.c:70
+#: ../clients/tui/nmt-page-bridge.c:107
msgid "Priority"
msgstr "Prioritet"
-#: ../clients/tui/nmt-page-bridge-port.c:75
+#: ../clients/tui/nmt-page-bridge-port.c:76
msgid "Path cost"
msgstr "Sökvägskostnad"
-#: ../clients/tui/nmt-page-bridge-port.c:77
+#: ../clients/tui/nmt-page-bridge-port.c:78
msgid "Hairpin mode"
msgstr "Hårnålsläge"
-#: ../clients/tui/nmt-page-bridge.c:90 ../clients/tui/nmt-page-bridge.c:115
-#: ../clients/tui/nmt-page-bridge.c:125 ../clients/tui/nmt-page-bridge.c:135
+#: ../clients/tui/nmt-page-bridge.c:91 ../clients/tui/nmt-page-bridge.c:116
+#: ../clients/tui/nmt-page-bridge.c:126 ../clients/tui/nmt-page-bridge.c:136
msgid "seconds"
msgstr "sekunder"
-#: ../clients/tui/nmt-page-bridge.c:91
+#: ../clients/tui/nmt-page-bridge.c:92
msgid "Aging time"
msgstr "Ã…lder"
-#: ../clients/tui/nmt-page-bridge.c:93
+#: ../clients/tui/nmt-page-bridge.c:94
msgid "Enable STP (Spanning Tree Protocol)"
msgstr "Aktivera STP (Spanning Tree Protocol)"
-#: ../clients/tui/nmt-page-bridge.c:116
+#: ../clients/tui/nmt-page-bridge.c:117
msgid "Forward delay"
msgstr "Framåtfördröjning"
-#: ../clients/tui/nmt-page-bridge.c:126
+#: ../clients/tui/nmt-page-bridge.c:127
msgid "Hello time"
msgstr "Hallåtid"
-#: ../clients/tui/nmt-page-bridge.c:136
+#: ../clients/tui/nmt-page-bridge.c:137
msgid "Max age"
msgstr "Max ålder"
-#. TTLS and PEAP are actually much more complicated, but this complication
-#. * is not visible here since we only care about phase2 authentication
-#. * (and don't even care of which one)
-#.
-#: ../clients/tui/nmt-page-dsl.c:67 ../clients/tui/nmt-page-wifi.c:334
-#: ../clients/tui/nmt-secret-agent.c:206 ../clients/tui/nmt-secret-agent.c:301
-msgid "Username"
-msgstr "Användarnamn"
-
-#: ../clients/tui/nmt-page-dsl.c:76 ../clients/tui/nmt-page-wifi.c:279
-#: ../clients/tui/nmt-page-wifi.c:310 ../clients/tui/nmt-page-wifi.c:343
-#: ../clients/tui/nmt-secret-agent.c:211 ../clients/tui/nmt-secret-agent.c:248
-#: ../clients/tui/nmt-secret-agent.c:278 ../clients/tui/nmt-secret-agent.c:311
-#: ../clients/tui/nmt-secret-agent.c:380 ../clients/tui/nmt-secret-agent.c:393
-#: ../clients/tui/nmt-secret-agent.c:409
-msgid "Password"
-msgstr "Lösenord"
-
-#: ../clients/tui/nmt-page-dsl.c:79 ../clients/tui/nmt-secret-agent.c:306
-msgid "Service"
-msgstr "Tjänst"
-
-#: ../clients/tui/nmt-page-ethernet.c:41
+#: ../clients/tui/nmt-page-ethernet.c:73
msgid "ETHERNET"
msgstr "TRÃ…DBUNDET"
-#: ../clients/tui/nmt-page-ethernet.c:80 ../clients/tui/nmt-page-vlan.c:124
-#: ../clients/tui/nmt-page-wifi.c:366
+#: ../clients/tui/nmt-page-ethernet.c:80 ../clients/tui/nmt-page-vlan.c:125
+#: ../clients/tui/nmt-page-wifi.c:367
msgid "Cloned MAC address"
msgstr "Klonade MAC-adress"
-#: ../clients/tui/nmt-page-infiniband.c:40
-msgid "INFINIBAND"
-msgstr "INFINIBAND"
-
-#: ../clients/tui/nmt-page-infiniband.c:51
+#: ../clients/tui/nmt-page-infiniband.c:50
msgid "Datagram"
msgstr "Datagram"
-#: ../clients/tui/nmt-page-infiniband.c:52
+#: ../clients/tui/nmt-page-infiniband.c:51
msgid "Connected"
msgstr "Ansluten"
-#: ../clients/tui/nmt-page-infiniband.c:90
+#: ../clients/tui/nmt-page-infiniband.c:84
+msgid "INFINIBAND"
+msgstr "INFINIBAND"
+
+#: ../clients/tui/nmt-page-infiniband.c:91
msgid "Transport mode"
msgstr "Transportläge"
@@ -5604,46 +5799,46 @@ msgstr "Manuell"
msgid "Shared"
msgstr "Delad"
-#: ../clients/tui/nmt-page-ip4.c:54
-msgid "IPv4 CONFIGURATION"
-msgstr "IPv4-KONFIGURATION"
-
-#: ../clients/tui/nmt-page-ip4.c:100 ../clients/tui/nmt-page-ip6.c:100
+#: ../clients/tui/nmt-page-ip4.c:85 ../clients/tui/nmt-page-ip6.c:85
msgid "(No custom routes)"
msgstr "(Inga anpassade rutter)"
-#: ../clients/tui/nmt-page-ip4.c:103 ../clients/tui/nmt-page-ip6.c:103
+#: ../clients/tui/nmt-page-ip4.c:88 ../clients/tui/nmt-page-ip6.c:88
#, c-format
msgid "One custom route"
msgid_plural "%d custom routes"
msgstr[0] "En anpassad rutt"
msgstr[1] "%d anpassade rutter"
-#: ../clients/tui/nmt-page-ip4.c:144 ../clients/tui/nmt-page-ip6.c:144
+#: ../clients/tui/nmt-page-ip4.c:131
+msgid "IPv4 CONFIGURATION"
+msgstr "IPv4-KONFIGURATION"
+
+#: ../clients/tui/nmt-page-ip4.c:139 ../clients/tui/nmt-page-ip6.c:139
msgid "Addresses"
msgstr "Adresser"
-#: ../clients/tui/nmt-page-ip4.c:150 ../clients/tui/nmt-page-ip6.c:150
+#: ../clients/tui/nmt-page-ip4.c:146 ../clients/tui/nmt-page-ip6.c:146
msgid "Gateway"
msgstr "Gateway"
-#: ../clients/tui/nmt-page-ip4.c:156 ../clients/tui/nmt-page-ip6.c:156
+#: ../clients/tui/nmt-page-ip4.c:153 ../clients/tui/nmt-page-ip6.c:153
msgid "DNS servers"
msgstr "DNS-servrar"
-#: ../clients/tui/nmt-page-ip4.c:162 ../clients/tui/nmt-page-ip6.c:162
+#: ../clients/tui/nmt-page-ip4.c:159 ../clients/tui/nmt-page-ip6.c:159
msgid "Search domains"
msgstr "Sökdomäner"
-#: ../clients/tui/nmt-page-ip4.c:177 ../clients/tui/nmt-page-ip6.c:175
+#: ../clients/tui/nmt-page-ip4.c:174 ../clients/tui/nmt-page-ip6.c:172
msgid "Routing"
msgstr "Routing"
-#: ../clients/tui/nmt-page-ip4.c:179 ../clients/tui/nmt-page-ip6.c:177
+#: ../clients/tui/nmt-page-ip4.c:176 ../clients/tui/nmt-page-ip6.c:174
msgid "Never use this network for default route"
msgstr "Använd aldrig detta nätverk för standardrutten"
-#: ../clients/tui/nmt-page-ip4.c:187
+#: ../clients/tui/nmt-page-ip4.c:184
msgid "Require IPv4 addressing for this connection"
msgstr "Kräv IPv4-adressering för denna anslutning"
@@ -5655,232 +5850,200 @@ msgstr "Ignorera"
msgid "Automatic (DHCP-only)"
msgstr "Automatisk (endast DHCP)"
-#: ../clients/tui/nmt-page-ip6.c:54
+#: ../clients/tui/nmt-page-ip6.c:131
msgid "IPv6 CONFIGURATION"
msgstr "IPv6-KONFIGURATION"
-#: ../clients/tui/nmt-page-ip6.c:185
+#: ../clients/tui/nmt-page-ip6.c:182
msgid "Require IPv6 addressing for this connection"
msgstr "Kräv IPv6-adressering för denna anslutning"
-#: ../clients/tui/nmt-page-main.c:139
-msgid "Hide"
-msgstr "Dölj"
-
-#: ../clients/tui/nmt-page-main.c:139
-msgid "Show"
-msgstr "Visa"
-
-#: ../clients/tui/nmt-page-main.c:188
-msgid "Profile name"
-msgstr "Profilnamn"
-
-#: ../clients/tui/nmt-page-main.c:199
-msgid "Ethernet device"
-msgstr "Ethernet-enhet"
-
-#: ../clients/tui/nmt-page-main.c:201
-msgid "Device"
-msgstr "Enhet"
-
-#: ../clients/tui/nmt-page-main.c:252
-msgid "Automatically connect"
-msgstr "Anslut automatiskt"
-
-#: ../clients/tui/nmt-page-main.c:258
-msgid "Available to all users"
-msgstr "Tillgänglig för alla användare"
-
-#: ../clients/tui/nmt-page-ppp.c:49
+#: ../clients/tui/nmt-page-ppp.c:134
msgid "PPP CONFIGURATION"
msgstr "PPP-KONFIGURATION"
-#: ../clients/tui/nmt-page-ppp.c:142
+#: ../clients/tui/nmt-page-ppp.c:143
msgid "Allowed authentication methods:"
msgstr "Tillåtna autentiseringsmetoder:"
-#: ../clients/tui/nmt-page-ppp.c:149
+#: ../clients/tui/nmt-page-ppp.c:150
msgid "EAP"
msgstr "EAP"
-#: ../clients/tui/nmt-page-ppp.c:157
+#: ../clients/tui/nmt-page-ppp.c:158
msgid "PAP"
msgstr "PAP"
-#: ../clients/tui/nmt-page-ppp.c:165
+#: ../clients/tui/nmt-page-ppp.c:166
msgid "CHAP"
msgstr "CHAP"
-#: ../clients/tui/nmt-page-ppp.c:173
+#: ../clients/tui/nmt-page-ppp.c:174
msgid "MSCHAPv2"
msgstr "MSCHAPv2"
-#: ../clients/tui/nmt-page-ppp.c:181
+#: ../clients/tui/nmt-page-ppp.c:182
msgid "MSCHAP"
msgstr "MSCHAP"
-#: ../clients/tui/nmt-page-ppp.c:197
+#: ../clients/tui/nmt-page-ppp.c:198
msgid "Use point-to-point encryption (MPPE)"
msgstr "Använd punkt-till-punkt-kryptering (MPPE)"
-#: ../clients/tui/nmt-page-ppp.c:209
+#: ../clients/tui/nmt-page-ppp.c:210
msgid "Require 128-bit encryption"
msgstr "Kräv 128-bitars kryptering"
-#: ../clients/tui/nmt-page-ppp.c:219
+#: ../clients/tui/nmt-page-ppp.c:220
msgid "Use stateful MPPE"
msgstr "Använd MPPE med tillstånd"
-#: ../clients/tui/nmt-page-ppp.c:231
+#: ../clients/tui/nmt-page-ppp.c:232
msgid "Allow BSD data compression"
msgstr "Tillåt BSD-datakomprimering"
-#: ../clients/tui/nmt-page-ppp.c:239
+#: ../clients/tui/nmt-page-ppp.c:240
msgid "Allow Deflate data compression"
msgstr "Tillåt Deflate-datakomprimering"
-#: ../clients/tui/nmt-page-ppp.c:247
+#: ../clients/tui/nmt-page-ppp.c:248
msgid "Use TCP header compression"
msgstr "Använd TCP-huvudkomprimering"
-#: ../clients/tui/nmt-page-ppp.c:257
+#: ../clients/tui/nmt-page-ppp.c:258
msgid "Send PPP echo packets"
msgstr "Skicka PPP-ekopaket"
-#: ../clients/tui/nmt-page-team-port.c:45
+#: ../clients/tui/nmt-page-team-port.c:95
msgid "TEAM PORT"
msgstr "GRUPP-PORT"
-#: ../clients/tui/nmt-page-team-port.c:100 ../clients/tui/nmt-page-team.c:164
+#: ../clients/tui/nmt-page-team-port.c:102 ../clients/tui/nmt-page-team.c:166
msgid "JSON configuration"
msgstr "JSON-konfiguration"
-#: ../clients/tui/nmt-page-vlan.c:101
+#: ../clients/tui/nmt-page-vlan.c:102
msgid "Parent"
msgstr "Förälder"
-#: ../clients/tui/nmt-page-vlan.c:116
+#: ../clients/tui/nmt-page-vlan.c:117
msgid "VLAN id"
msgstr "VLAN-ID"
-#: ../clients/tui/nmt-page-wifi.c:57
-msgid "WI-FI"
-msgstr "TRÅDLÖS"
-
-#: ../clients/tui/nmt-page-wifi.c:68
+#: ../clients/tui/nmt-page-wifi.c:67
msgctxt "Wi-Fi"
msgid "Client"
msgstr "Klient"
-#: ../clients/tui/nmt-page-wifi.c:69
+#: ../clients/tui/nmt-page-wifi.c:68
msgid "Access Point"
msgstr "Accesspunkt"
-#: ../clients/tui/nmt-page-wifi.c:70
+#: ../clients/tui/nmt-page-wifi.c:69
msgid "Ad-Hoc Network"
msgstr "Ad-Hoc-nätverk"
-#: ../clients/tui/nmt-page-wifi.c:75
+#: ../clients/tui/nmt-page-wifi.c:74
msgctxt "Wi-Fi"
msgid "Automatic"
msgstr "Automatisk"
#. 802.11a Wi-Fi network
-#: ../clients/tui/nmt-page-wifi.c:77
+#: ../clients/tui/nmt-page-wifi.c:76
msgid "A (5 GHz)"
msgstr "A (5 GHz)"
#. 802.11b / 802.11g Wi-Fi network
-#: ../clients/tui/nmt-page-wifi.c:79
+#: ../clients/tui/nmt-page-wifi.c:78
msgid "B/G (2.4 GHz)"
msgstr "B/G (2.4 GHz)"
-#: ../clients/tui/nmt-page-wifi.c:84
+#: ../clients/tui/nmt-page-wifi.c:83
msgctxt "Wi-Fi security"
msgid "None"
msgstr "Ingen"
-#: ../clients/tui/nmt-page-wifi.c:85
+#: ../clients/tui/nmt-page-wifi.c:84
msgid "WPA & WPA2 Personal"
msgstr "WPA & WPA2 Personal"
-#: ../clients/tui/nmt-page-wifi.c:86
+#: ../clients/tui/nmt-page-wifi.c:85
msgid "WPA & WPA2 Enterprise"
msgstr "WPA & WPA2 Enterprise"
-#: ../clients/tui/nmt-page-wifi.c:87
+#: ../clients/tui/nmt-page-wifi.c:86
msgid "WEP 40/128-bit Key (Hex or ASCII)"
msgstr "WEP 40/128-bit nyckel (Hex eller ASCII)"
-#: ../clients/tui/nmt-page-wifi.c:88
+#: ../clients/tui/nmt-page-wifi.c:87
msgid "WEP 128-bit Passphrase"
msgstr "WEP 128-bit lösenfras"
-#: ../clients/tui/nmt-page-wifi.c:89
+#: ../clients/tui/nmt-page-wifi.c:88
msgid "Dynamic WEP (802.1x)"
msgstr "Dynamisk WEP (802.1x)"
-#: ../clients/tui/nmt-page-wifi.c:90
+#: ../clients/tui/nmt-page-wifi.c:89
msgid "LEAP"
msgstr "LEAP"
-#: ../clients/tui/nmt-page-wifi.c:95
+#: ../clients/tui/nmt-page-wifi.c:94
msgctxt "WEP key index"
msgid "1 (Default)"
-msgstr "1"
+msgstr "1 (Standard)"
-#: ../clients/tui/nmt-page-wifi.c:96
+#: ../clients/tui/nmt-page-wifi.c:95
msgctxt "WEP key index"
msgid "2"
msgstr "2"
-#: ../clients/tui/nmt-page-wifi.c:97
+#: ../clients/tui/nmt-page-wifi.c:96
msgctxt "WEP key index"
msgid "3"
msgstr "3"
-#: ../clients/tui/nmt-page-wifi.c:98
+#: ../clients/tui/nmt-page-wifi.c:97
msgctxt "WEP key index"
msgid "4"
msgstr "4"
-#: ../clients/tui/nmt-page-wifi.c:103
+#: ../clients/tui/nmt-page-wifi.c:102
msgid "Open System"
msgstr "Öppet system"
-#: ../clients/tui/nmt-page-wifi.c:104
+#: ../clients/tui/nmt-page-wifi.c:103
msgid "Shared Key"
msgstr "Delad nyckel"
-#: ../clients/tui/nmt-page-wifi.c:258
+#: ../clients/tui/nmt-page-wifi.c:217
+msgid "WI-FI"
+msgstr "TRÅDLÖS"
+
+#: ../clients/tui/nmt-page-wifi.c:259
msgid "Channel"
msgstr "Kanal"
-#: ../clients/tui/nmt-page-wifi.c:263
+#: ../clients/tui/nmt-page-wifi.c:264
msgid "Security"
msgstr "Säkerhet"
#. "wpa-enterprise"
#. FIXME
-#: ../clients/tui/nmt-page-wifi.c:284
+#: ../clients/tui/nmt-page-wifi.c:285
msgid "(No support for wpa-enterprise yet...)"
msgstr "(Inget stöd för wpa-enterprise än…)"
-#: ../clients/tui/nmt-page-wifi.c:291 ../clients/tui/nmt-secret-agent.c:262
-msgid "Key"
-msgstr "Nyckel"
-
-#: ../clients/tui/nmt-page-wifi.c:294 ../clients/tui/nmt-page-wifi.c:313
+#: ../clients/tui/nmt-page-wifi.c:295 ../clients/tui/nmt-page-wifi.c:314
msgid "WEP index"
msgstr "WEP-index"
-#: ../clients/tui/nmt-page-wifi.c:302 ../clients/tui/nmt-page-wifi.c:321
+#: ../clients/tui/nmt-page-wifi.c:303 ../clients/tui/nmt-page-wifi.c:322
msgid "Authentication"
msgstr "Autentisering"
#. "dynamic-wep"
#. FIXME
-#: ../clients/tui/nmt-page-wifi.c:327
+#: ../clients/tui/nmt-page-wifi.c:328
msgid "(No support for dynamic-wep yet...)"
msgstr "(Inget stöd för dynamic-wep än…)"
@@ -5892,81 +6055,25 @@ msgstr "Fråga alltid efter lösenord"
msgid "Show password"
msgstr "Visa lösenord"
-#: ../clients/tui/nmt-route-table.c:219
+#: ../clients/tui/nmt-route-table.c:192
msgid "Destination"
msgstr "Destination"
-#: ../clients/tui/nmt-route-table.c:219
+#: ../clients/tui/nmt-route-table.c:192
msgid "Prefix"
msgstr "Prefix"
-#: ../clients/tui/nmt-route-table.c:228
+#: ../clients/tui/nmt-route-table.c:201
msgid "Next Hop"
msgstr "Nästa hopp"
-#: ../clients/tui/nmt-route-table.c:236
+#: ../clients/tui/nmt-route-table.c:209
msgid "Metric"
msgstr "Mätvärde"
-#: ../clients/tui/nmt-route-table.c:256
+#: ../clients/tui/nmt-route-table.c:229
msgid "No custom routes are defined."
-msgstr "Inga anpassade rutter är definerade."
-
-#: ../clients/tui/nmt-secret-agent.c:220
-msgid "Identity"
-msgstr "Identitet"
-
-#: ../clients/tui/nmt-secret-agent.c:225
-msgid "Private key password"
-msgstr "Lösenord för privat nyckel"
-
-#: ../clients/tui/nmt-secret-agent.c:340
-msgid "Authentication required by wireless network"
-msgstr "Autentisering krävs av trådlösa nätverket"
-
-#: ../clients/tui/nmt-secret-agent.c:341
-#, c-format
-msgid ""
-"Passwords or encryption keys are required to access the wireless network "
-"'%s'."
-msgstr ""
-"Lösenord eller krypteringsnycklar krävs för åtkomst till trådlösa nätverket "
-"â€%sâ€."
-
-#: ../clients/tui/nmt-secret-agent.c:349
-msgid "Wired 802.1X authentication"
-msgstr "Trådbunden 802.1X-autentisering"
-
-#: ../clients/tui/nmt-secret-agent.c:352
-msgid "Network name"
-msgstr "Nätverksnamn"
-
-#: ../clients/tui/nmt-secret-agent.c:359
-msgid "DSL authentication"
-msgstr "DSL-autentisering"
-
-#: ../clients/tui/nmt-secret-agent.c:367
-msgid "PIN code required"
-msgstr "PIN-kod krävs"
-
-#: ../clients/tui/nmt-secret-agent.c:368
-msgid "PIN code is needed for the mobile broadband device"
-msgstr "Det krävs PIN-kod för den mobila bredbandsenheten"
-
-#: ../clients/tui/nmt-secret-agent.c:370
-msgid "PIN"
-msgstr "PIN"
-
-#: ../clients/tui/nmt-secret-agent.c:376 ../clients/tui/nmt-secret-agent.c:389
-#: ../clients/tui/nmt-secret-agent.c:405
-msgid "Mobile broadband network password"
-msgstr "Nätverkslösenord för mobilt bredband"
-
-#: ../clients/tui/nmt-secret-agent.c:377 ../clients/tui/nmt-secret-agent.c:390
-#: ../clients/tui/nmt-secret-agent.c:406
-#, c-format
-msgid "A password is required to connect to '%s'."
-msgstr "Ett lösenord krävs för att ansluta till â€%sâ€."
+msgstr "Inga anpassade rutter är definierade."
#: ../clients/tui/nmt-slave-list.c:137
msgid "Select the type of slave connection you wish to add."
@@ -5988,64 +6095,60 @@ msgstr "Aktivering misslyckades"
msgid "Connecting..."
msgstr "Ansluter…"
-#: ../clients/tui/nmtui-connect.c:174 ../clients/tui/nmtui-connect.c:197
+#: ../clients/tui/nmtui-connect.c:180 ../clients/tui/nmtui-connect.c:211
#, c-format
msgid "Could not activate connection: %s"
msgstr "Kunde inte aktivera anslutningen: %s"
-#: ../clients/tui/nmtui-connect.c:257 ../clients/tui/nmtui-connect.c:306
+#: ../clients/tui/nmtui-connect.c:271 ../clients/tui/nmtui-connect.c:320
msgid "Activate"
msgstr "Aktivera"
-#: ../clients/tui/nmtui-connect.c:259
+#: ../clients/tui/nmtui-connect.c:273
msgid "Deactivate"
msgstr "Inaktivera"
-#: ../clients/tui/nmtui-connect.c:311 ../clients/tui/nmtui-edit.c:119
+#: ../clients/tui/nmtui-connect.c:325 ../clients/tui/nmtui-edit.c:121
#: ../clients/tui/nmtui.c:111
msgid "Quit"
msgstr "Avsluta"
-#: ../clients/tui/nmtui-connect.c:334
+#: ../clients/tui/nmtui-connect.c:348
#, c-format
msgid "No such connection '%s'"
msgstr "Ingen sÃ¥dan anslutning â€%sâ€"
-#: ../clients/tui/nmtui-connect.c:336
+#: ../clients/tui/nmtui-connect.c:350
msgid "Connection is already active"
msgstr "Anslutningen är redan aktiv"
-#: ../clients/tui/nmtui-edit.c:224
+#: ../clients/tui/nmtui-edit.c:226
msgid "Create"
msgstr "Skapa"
-#: ../clients/tui/nmtui-edit.c:366
+#: ../clients/tui/nmtui-edit.c:368
msgid "Select the type of connection you wish to create."
msgstr "Välj den typ av anslutning du vill skapa."
-#: ../clients/tui/nmtui-edit.c:374
-msgid ""
-"If you are creating a VPN, and the VPN connection you wish to create does "
-"not appear in the list, you may not have the correct VPN plugin installed."
-msgstr ""
-"Om du skapar ett VPN, och VPN-konfigurationen du vill skapa inte visas i "
-"listan kanske du inte har rätt VPN-insticksmodul installerad."
+#: ../clients/tui/nmtui-edit.c:376
+msgid "If you are creating a VPN, and the VPN connection you wish to create does not appear in the list, you may not have the correct VPN plugin installed."
+msgstr "Om du skapar ett VPN, och VPN-konfigurationen du vill skapa inte visas i listan kanske du inte har rätt VPN-insticksmodul installerad."
-#: ../clients/tui/nmtui-edit.c:410 ../clients/tui/nmtui-edit.c:426
+#: ../clients/tui/nmtui-edit.c:412 ../clients/tui/nmtui-edit.c:428
msgid "New Connection"
msgstr "Ny anslutning"
-#: ../clients/tui/nmtui-edit.c:465
+#: ../clients/tui/nmtui-edit.c:467
#, c-format
msgid "Unable to delete connection: %s"
msgstr "Kunde inte ta bort anslutningen: %s"
-#: ../clients/tui/nmtui-edit.c:504
+#: ../clients/tui/nmtui-edit.c:506
#, c-format
msgid "Could not delete connection '%s': %s"
msgstr "Kunde inte ta bort anslutningen â€%sâ€: %s"
-#: ../clients/tui/nmtui-edit.c:524
+#: ../clients/tui/nmtui-edit.c:528
#, c-format
msgid "Are you sure you want to delete the connection '%s'?"
msgstr "Är du säker pÃ¥ att du vill radera anslutningen â€%sâ€?"
@@ -6112,7 +6215,7 @@ msgstr "Kunde inte kontakta Nätverkshanteraren: %s.\n"
#: ../clients/tui/nmtui.c:242
msgid "NetworkManager is not running."
-msgstr "Nätverkshanteraren är inte startad"
+msgstr "Nätverkshanteraren är inte startad."
#: ../libnm-core/crypto.c:120 ../libnm-util/crypto.c:133
#, c-format
@@ -6159,160 +6262,155 @@ msgstr "Felformulerad PEM-fil: okänt chiffer för privat nyckel â€%sâ€."
msgid "Could not decode private key."
msgstr "Kunde inte avkoda privat nyckel."
-#: ../libnm-core/crypto.c:273 ../libnm-util/crypto.c:285
+#: ../libnm-core/crypto.c:274 ../libnm-util/crypto.c:285
msgid "Failed to find expected PKCS#8 start tag."
msgstr "Misslyckades med att hitta förväntad PKCS#8-starttagg."
-#: ../libnm-core/crypto.c:281 ../libnm-util/crypto.c:293
+#: ../libnm-core/crypto.c:282 ../libnm-util/crypto.c:293
#, c-format
msgid "Failed to find expected PKCS#8 end tag '%s'."
msgstr "Misslyckades med att hitta förväntad PKCS#8-sluttagg â€%sâ€."
-#: ../libnm-core/crypto.c:300 ../libnm-util/crypto.c:312
+#: ../libnm-core/crypto.c:301 ../libnm-util/crypto.c:312
msgid "Failed to decode PKCS#8 private key."
msgstr "Misslyckades med att avkoda privat PKCS#8-nyckel."
-#: ../libnm-core/crypto.c:342 ../libnm-util/crypto.c:354
+#: ../libnm-core/crypto.c:343 ../libnm-util/crypto.c:354
#, c-format
msgid "IV must be an even number of bytes in length."
msgstr "IV måste vara ett jämnt antal byte i längd."
-#: ../libnm-core/crypto.c:356 ../libnm-util/crypto.c:368
+#: ../libnm-core/crypto.c:357 ../libnm-util/crypto.c:368
#, c-format
msgid "IV contains non-hexadecimal digits."
msgstr "IV innehåller icke-hexadecimala siffror."
-#: ../libnm-core/crypto.c:396 ../libnm-core/crypto_gnutls.c:151
-#: ../libnm-core/crypto_gnutls.c:269 ../libnm-core/crypto_nss.c:172
-#: ../libnm-core/crypto_nss.c:334 ../libnm-util/crypto.c:408
-#: ../libnm-util/crypto_gnutls.c:150 ../libnm-util/crypto_gnutls.c:267
-#: ../libnm-util/crypto_nss.c:170 ../libnm-util/crypto_nss.c:331
+#: ../libnm-core/crypto.c:397 ../libnm-core/crypto_gnutls.c:93
+#: ../libnm-core/crypto_gnutls.c:214 ../libnm-core/crypto_nss.c:115
+#: ../libnm-core/crypto_nss.c:280 ../libnm-util/crypto.c:408
+#: ../libnm-util/crypto_gnutls.c:146 ../libnm-util/crypto_gnutls.c:263
+#: ../libnm-util/crypto_nss.c:165 ../libnm-util/crypto_nss.c:326
#, c-format
msgid "Private key cipher '%s' was unknown."
msgstr "Privata nyckelchiffret â€%s†var okänt."
-#: ../libnm-core/crypto.c:508 ../libnm-util/crypto.c:518
+#: ../libnm-core/crypto.c:496 ../libnm-util/crypto.c:518
#, c-format
msgid "Unable to determine private key type."
msgstr "Kunde inte bestämma typ av privat nyckel."
-#: ../libnm-core/crypto.c:565 ../libnm-util/crypto.c:573
+#: ../libnm-core/crypto.c:504
+#, c-format
+msgid "Password provided, but key was not encrypted."
+msgstr "Lösenord tillhandahållet, men nyckeln var inte krypterad."
+
+#: ../libnm-core/crypto.c:557 ../libnm-util/crypto.c:573
#, c-format
msgid "PEM certificate had no start tag '%s'."
msgstr "PEM-certifikatet hade ingen starttagg â€%sâ€."
-#: ../libnm-core/crypto.c:574 ../libnm-util/crypto.c:582
+#: ../libnm-core/crypto.c:566 ../libnm-util/crypto.c:582
#, c-format
msgid "PEM certificate had no end tag '%s'."
msgstr "PEM-certifikatet hade ingen sluttagg â€%sâ€."
-#: ../libnm-core/crypto.c:592 ../libnm-util/crypto.c:600
+#: ../libnm-core/crypto.c:584 ../libnm-util/crypto.c:600
#, c-format
msgid "Failed to decode certificate."
msgstr "Misslyckades med att avkoda certifikat."
-#: ../libnm-core/crypto_gnutls.c:50 ../libnm-util/crypto_gnutls.c:50
+#: ../libnm-core/crypto_gnutls.c:51 ../libnm-util/crypto_gnutls.c:51
msgid "Failed to initialize the crypto engine."
msgstr "Misslyckades med att initiera krypteringsmotorn."
-#: ../libnm-core/crypto_gnutls.c:92 ../libnm-util/crypto_gnutls.c:92
-#, c-format
-msgid "Failed to initialize the MD5 engine: %s / %s."
-msgstr "Misslyckades med att initiera MD5-motorn: %s / %s."
-
-#: ../libnm-core/crypto_gnutls.c:159 ../libnm-util/crypto_gnutls.c:158
+#: ../libnm-core/crypto_gnutls.c:101 ../libnm-util/crypto_gnutls.c:154
#, c-format
msgid "Invalid IV length (must be at least %zd)."
msgstr "Ogiltig IV-längd (måste vara minst %zd)."
-#: ../libnm-core/crypto_gnutls.c:170 ../libnm-util/crypto_gnutls.c:169
+#: ../libnm-core/crypto_gnutls.c:112 ../libnm-util/crypto_gnutls.c:165
#, c-format
msgid "Failed to initialize the decryption cipher context: %s / %s."
-msgstr ""
-"Misslyckades med att initiera chifferkontexten för dekryptering: %s / %s."
+msgstr "Misslyckades med att initiera chifferkontexten för dekryptering: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:179 ../libnm-util/crypto_gnutls.c:178
+#: ../libnm-core/crypto_gnutls.c:121 ../libnm-util/crypto_gnutls.c:174
#, c-format
msgid "Failed to set symmetric key for decryption: %s / %s."
-msgstr ""
-"Misslyckades med att ställa in symmetrisk nyckel för dekryptering: %s / %s."
+msgstr "Misslyckades med att ställa in symmetrisk nyckel för dekryptering: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:188 ../libnm-util/crypto_gnutls.c:187
+#: ../libnm-core/crypto_gnutls.c:130 ../libnm-util/crypto_gnutls.c:183
#, c-format
msgid "Failed to set IV for decryption: %s / %s."
msgstr "Misslyckades med att ställa in IV för dekryptering: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:197 ../libnm-util/crypto_gnutls.c:196
+#: ../libnm-core/crypto_gnutls.c:139 ../libnm-util/crypto_gnutls.c:192
#, c-format
msgid "Failed to decrypt the private key: %s / %s."
msgstr "Misslyckades med att dekryptera den privata nyckeln: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:207 ../libnm-core/crypto_nss.c:262
-#: ../libnm-util/crypto_gnutls.c:206 ../libnm-util/crypto_nss.c:260
+#: ../libnm-core/crypto_gnutls.c:149 ../libnm-core/crypto_nss.c:205
+#: ../libnm-util/crypto_gnutls.c:202 ../libnm-util/crypto_nss.c:255
#, c-format
msgid "Failed to decrypt the private key: unexpected padding length."
-msgstr ""
-"Misslyckades med att dekryptera privata nyckeln: oväntad utfyllningslängd."
+msgstr "Misslyckades med att dekryptera privata nyckeln: oväntad utfyllningslängd."
-#: ../libnm-core/crypto_gnutls.c:218 ../libnm-core/crypto_nss.c:273
-#: ../libnm-util/crypto_gnutls.c:217 ../libnm-util/crypto_nss.c:271
+#: ../libnm-core/crypto_gnutls.c:160 ../libnm-core/crypto_nss.c:216
+#: ../libnm-util/crypto_gnutls.c:213 ../libnm-util/crypto_nss.c:266
#, c-format
msgid "Failed to decrypt the private key."
msgstr "Misslyckades med att dekryptera privata nyckeln."
-#: ../libnm-core/crypto_gnutls.c:291 ../libnm-util/crypto_gnutls.c:289
+#: ../libnm-core/crypto_gnutls.c:236 ../libnm-util/crypto_gnutls.c:285
#, c-format
msgid "Failed to initialize the encryption cipher context: %s / %s."
-msgstr ""
-"Misslyckades med att initiera chifferkontexten för kryptering: %s / %s."
+msgstr "Misslyckades med att initiera chifferkontexten för kryptering: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:300 ../libnm-util/crypto_gnutls.c:298
+#: ../libnm-core/crypto_gnutls.c:245 ../libnm-util/crypto_gnutls.c:294
#, c-format
msgid "Failed to set symmetric key for encryption: %s / %s."
-msgstr ""
-"Misslyckades med att ställa in symmetrisk nyckel för kryptering: %s / %s."
+msgstr "Misslyckades med att ställa in symmetrisk nyckel för kryptering: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:310 ../libnm-util/crypto_gnutls.c:308
+#: ../libnm-core/crypto_gnutls.c:255 ../libnm-util/crypto_gnutls.c:304
#, c-format
msgid "Failed to set IV for encryption: %s / %s."
msgstr "Misslyckades med att ställa in IV för kryptering: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:319 ../libnm-util/crypto_gnutls.c:317
+#: ../libnm-core/crypto_gnutls.c:264 ../libnm-util/crypto_gnutls.c:313
#, c-format
msgid "Failed to encrypt the data: %s / %s."
msgstr "Misslyckades med att kryptera datat: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:359 ../libnm-util/crypto_gnutls.c:357
+#: ../libnm-core/crypto_gnutls.c:307 ../libnm-util/crypto_gnutls.c:353
#, c-format
msgid "Error initializing certificate data: %s"
msgstr "Fel vid initiering av certifikatdata: %s"
-#: ../libnm-core/crypto_gnutls.c:381 ../libnm-util/crypto_gnutls.c:379
+#: ../libnm-core/crypto_gnutls.c:329 ../libnm-util/crypto_gnutls.c:375
#, c-format
msgid "Couldn't decode certificate: %s"
msgstr "Kunde inte avkoda certifikat: %s"
-#: ../libnm-core/crypto_gnutls.c:406 ../libnm-util/crypto_gnutls.c:403
+#: ../libnm-core/crypto_gnutls.c:357 ../libnm-util/crypto_gnutls.c:399
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %s"
msgstr "Kunde inte initiera PKCS#12-avkodare: %s"
-#: ../libnm-core/crypto_gnutls.c:419 ../libnm-util/crypto_gnutls.c:416
+#: ../libnm-core/crypto_gnutls.c:370 ../libnm-util/crypto_gnutls.c:412
#, c-format
msgid "Couldn't decode PKCS#12 file: %s"
msgstr "Kunde inte avkoda PKCS#12-fil: %s"
-#: ../libnm-core/crypto_gnutls.c:431 ../libnm-util/crypto_gnutls.c:428
+#: ../libnm-core/crypto_gnutls.c:382 ../libnm-util/crypto_gnutls.c:424
#, c-format
msgid "Couldn't verify PKCS#12 file: %s"
msgstr "Kunde inte verifiera PKCS#12-fil: %s"
-#: ../libnm-core/crypto_gnutls.c:460 ../libnm-util/crypto_gnutls.c:456
+#: ../libnm-core/crypto_gnutls.c:414 ../libnm-util/crypto_gnutls.c:452
#, c-format
msgid "Couldn't initialize PKCS#8 decoder: %s"
msgstr "Kunde inte initiera PKCS#8-avkodare: %s"
-#: ../libnm-core/crypto_gnutls.c:483 ../libnm-util/crypto_gnutls.c:479
+#: ../libnm-core/crypto_gnutls.c:437 ../libnm-util/crypto_gnutls.c:475
#, c-format
msgid "Couldn't decode PKCS#8 file: %s"
msgstr "Kunde inte avkoda PKCS#8-fil: %s"
@@ -6322,768 +6420,791 @@ msgstr "Kunde inte avkoda PKCS#8-fil: %s"
msgid "Failed to initialize the crypto engine: %d."
msgstr "Misslyckades med att initiera krypteringsmotorn: %d."
-#: ../libnm-core/crypto_nss.c:108 ../libnm-util/crypto_nss.c:107
-#, c-format
-msgid "Failed to initialize the MD5 context: %d."
-msgstr "Misslyckades med att initiera MD5-kontexten: %d."
-
-#: ../libnm-core/crypto_nss.c:180 ../libnm-util/crypto_nss.c:178
+#: ../libnm-core/crypto_nss.c:123 ../libnm-util/crypto_nss.c:173
#, c-format
msgid "Invalid IV length (must be at least %d)."
msgstr "Ogiltig IV-längd (måste vara minst %d)."
-#: ../libnm-core/crypto_nss.c:191 ../libnm-util/crypto_nss.c:189
+#: ../libnm-core/crypto_nss.c:134 ../libnm-util/crypto_nss.c:184
#, c-format
msgid "Failed to initialize the decryption cipher slot."
msgstr "Misslyckades med att initiera dekrypteringschifferplatsen."
-#: ../libnm-core/crypto_nss.c:201 ../libnm-util/crypto_nss.c:199
+#: ../libnm-core/crypto_nss.c:144 ../libnm-util/crypto_nss.c:194
#, c-format
msgid "Failed to set symmetric key for decryption."
msgstr "Misslyckades med att ställa in symmetrisk nyckel för dekryptering."
-#: ../libnm-core/crypto_nss.c:211 ../libnm-util/crypto_nss.c:209
+#: ../libnm-core/crypto_nss.c:154 ../libnm-util/crypto_nss.c:204
#, c-format
msgid "Failed to set IV for decryption."
msgstr "Misslyckades med att ställa in IV för dekryptering."
-#: ../libnm-core/crypto_nss.c:219 ../libnm-util/crypto_nss.c:217
+#: ../libnm-core/crypto_nss.c:162 ../libnm-util/crypto_nss.c:212
#, c-format
msgid "Failed to initialize the decryption context."
msgstr "Misslyckades med att initiera dekrypteringskontexten."
-#: ../libnm-core/crypto_nss.c:232 ../libnm-util/crypto_nss.c:230
+#: ../libnm-core/crypto_nss.c:175 ../libnm-util/crypto_nss.c:225
#, c-format
msgid "Failed to decrypt the private key: %d."
msgstr "Misslyckades med att dekryptera privata nyckeln: %d."
-#: ../libnm-core/crypto_nss.c:240 ../libnm-util/crypto_nss.c:238
+#: ../libnm-core/crypto_nss.c:183 ../libnm-util/crypto_nss.c:233
#, c-format
msgid "Failed to decrypt the private key: decrypted data too large."
-msgstr ""
-"Misslyckades med att dekryptera privata nyckeln: dekrypterat data är för "
-"stort."
+msgstr "Misslyckades med att dekryptera privata nyckeln: dekrypterat data är för stort."
-#: ../libnm-core/crypto_nss.c:251 ../libnm-util/crypto_nss.c:249
+#: ../libnm-core/crypto_nss.c:194 ../libnm-util/crypto_nss.c:244
#, c-format
msgid "Failed to finalize decryption of the private key: %d."
-msgstr ""
-"Misslyckades med att färdigställa dekryptering av den privata nyckeln: %d."
+msgstr "Misslyckades med att färdigställa dekryptering av den privata nyckeln: %d."
-#: ../libnm-core/crypto_nss.c:356 ../libnm-util/crypto_nss.c:353
+#: ../libnm-core/crypto_nss.c:302 ../libnm-util/crypto_nss.c:348
#, c-format
msgid "Failed to initialize the encryption cipher slot."
msgstr "Misslyckades med att initiera krypteringschifferplatsen."
-#: ../libnm-core/crypto_nss.c:364 ../libnm-util/crypto_nss.c:361
+#: ../libnm-core/crypto_nss.c:310 ../libnm-util/crypto_nss.c:356
#, c-format
msgid "Failed to set symmetric key for encryption."
msgstr "Misslyckades med att ställa in symmetrisk nyckel för kryptering."
-#: ../libnm-core/crypto_nss.c:372 ../libnm-util/crypto_nss.c:369
+#: ../libnm-core/crypto_nss.c:318 ../libnm-util/crypto_nss.c:364
#, c-format
msgid "Failed to set IV for encryption."
msgstr "Misslyckades med att ställa in IV för kryptering."
-#: ../libnm-core/crypto_nss.c:380 ../libnm-util/crypto_nss.c:377
+#: ../libnm-core/crypto_nss.c:326 ../libnm-util/crypto_nss.c:372
#, c-format
msgid "Failed to initialize the encryption context."
msgstr "Misslyckades med att initiera krypteringskontexten."
-#: ../libnm-core/crypto_nss.c:388 ../libnm-util/crypto_nss.c:385
+#: ../libnm-core/crypto_nss.c:334 ../libnm-util/crypto_nss.c:380
#, c-format
msgid "Failed to encrypt: %d."
msgstr "Misslyckades med att kryptera: %d."
-#: ../libnm-core/crypto_nss.c:396 ../libnm-util/crypto_nss.c:393
+#: ../libnm-core/crypto_nss.c:342 ../libnm-util/crypto_nss.c:388
#, c-format
msgid "Unexpected amount of data after encrypting."
msgstr "Oväntad mängd data efter kryptering."
-#: ../libnm-core/crypto_nss.c:436 ../libnm-util/crypto_nss.c:433
+#: ../libnm-core/crypto_nss.c:385 ../libnm-util/crypto_nss.c:428
#, c-format
msgid "Couldn't decode certificate: %d"
msgstr "Kunde inte avkoda certifikat: %d"
-#: ../libnm-core/crypto_nss.c:471
+#: ../libnm-core/crypto_nss.c:423
#, c-format
msgid "Password must be UTF-8"
msgstr "Lösenord måste vara i UTF-8"
-#: ../libnm-core/crypto_nss.c:501 ../libnm-util/crypto_nss.c:496
+#: ../libnm-core/crypto_nss.c:453 ../libnm-util/crypto_nss.c:491
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %d"
msgstr "Kunde inte initiera PKCS#12-avkodare: %d"
-#: ../libnm-core/crypto_nss.c:510 ../libnm-util/crypto_nss.c:505
+#: ../libnm-core/crypto_nss.c:462 ../libnm-util/crypto_nss.c:500
#, c-format
msgid "Couldn't decode PKCS#12 file: %d"
msgstr "Kunde inte avkoda PKCS#12-fil: %d"
-#: ../libnm-core/crypto_nss.c:519 ../libnm-util/crypto_nss.c:514
+#: ../libnm-core/crypto_nss.c:471 ../libnm-util/crypto_nss.c:509
#, c-format
msgid "Couldn't verify PKCS#12 file: %d"
msgstr "Kunde inte verifiera PKCS#12-fil: %d"
-#: ../libnm-core/crypto_nss.c:564 ../libnm-util/crypto_nss.c:558
+#: ../libnm-core/crypto_nss.c:522 ../libnm-util/crypto_nss.c:553
msgid "Could not generate random data."
msgstr "Kunde inte generera slumpmässigt data."
-#: ../libnm-core/nm-connection.c:247
+#: ../libnm-core/nm-connection.c:225
msgid "wrong type; should be a list of strings."
msgstr "fel typ; borde vara en lista av strängar."
-#: ../libnm-core/nm-connection.c:302
+#: ../libnm-core/nm-connection.c:280
msgid "unknown setting name"
msgstr "okänt inställningsnamn"
-#: ../libnm-core/nm-connection.c:738
+#: ../libnm-core/nm-connection.c:804
msgid "setting not found"
msgstr "inställningen hittades inte"
-#: ../libnm-core/nm-connection.c:803
+#: ../libnm-core/nm-connection.c:868
msgid "setting not allowed in slave connection"
msgstr "inställningen finns inte i slavanslutningen"
-#: ../libnm-core/nm-connection.c:814
+#: ../libnm-core/nm-connection.c:879
msgid "setting is required for non-slave connections"
msgstr "inställning krävs för anslutningar som inte är slavar"
-#: ../libnm-core/nm-connection.c:880
+#: ../libnm-core/nm-connection.c:945
msgid "Unexpected failure to verify the connection"
msgstr "Oväntat misslyckande med att verifiera anslutningen"
-#: ../libnm-core/nm-connection.c:911
+#: ../libnm-core/nm-connection.c:978
msgid "Unexpected failure to normalize the connection"
msgstr "Oväntat misslyckande med att normalisera anslutningen"
-#: ../libnm-core/nm-setting-8021x.c:577 ../libnm-util/nm-setting-8021x.c:596
+#: ../libnm-core/nm-connection.c:1442 ../libnm-core/nm-setting-8021x.c:2275
+#: ../libnm-core/nm-setting-8021x.c:2292 ../libnm-core/nm-setting-8021x.c:2323
+#: ../libnm-core/nm-setting-8021x.c:2340 ../libnm-core/nm-setting-8021x.c:2382
+#: ../libnm-core/nm-setting-8021x.c:2394 ../libnm-core/nm-setting-8021x.c:2412
+#: ../libnm-core/nm-setting-8021x.c:2424 ../libnm-core/nm-setting-8021x.c:2448
+#: ../libnm-core/nm-setting-8021x.c:2630 ../libnm-core/nm-setting-adsl.c:190
+#: ../libnm-core/nm-setting-bluetooth.c:121
+#: ../libnm-core/nm-setting-bluetooth.c:139
+#: ../libnm-core/nm-setting-cdma.c:142
+#: ../libnm-core/nm-setting-connection.c:768
+#: ../libnm-core/nm-setting-connection.c:807
+#: ../libnm-core/nm-setting-connection.c:908
+#: ../libnm-core/nm-setting-ip-config.c:1841
+#: ../libnm-core/nm-setting-olpc-mesh.c:113
+#: ../libnm-core/nm-setting-pppoe.c:143 ../libnm-core/nm-setting-vpn.c:400
+#: ../libnm-core/nm-setting-wimax.c:117
+#: ../libnm-core/nm-setting-wireless-security.c:862
+#: ../libnm-core/nm-setting-wireless.c:712 ../libnm-util/nm-setting.c:1366
+#: ../libnm-util/nm-setting.c:1385 ../libnm-util/nm-setting.c:1403
+#: ../libnm-util/nm-setting-8021x.c:2284 ../libnm-util/nm-setting-8021x.c:2301
+#: ../libnm-util/nm-setting-8021x.c:2342 ../libnm-util/nm-setting-8021x.c:2359
+#: ../libnm-util/nm-setting-8021x.c:2411 ../libnm-util/nm-setting-8021x.c:2423
+#: ../libnm-util/nm-setting-8021x.c:2441 ../libnm-util/nm-setting-8021x.c:2453
+#: ../libnm-util/nm-setting-8021x.c:2477 ../libnm-util/nm-setting-8021x.c:2655
+#: ../libnm-util/nm-setting-adsl.c:210
+#: ../libnm-util/nm-setting-bluetooth.c:143
+#: ../libnm-util/nm-setting-bluetooth.c:161
+#: ../libnm-util/nm-setting-cdma.c:163
+#: ../libnm-util/nm-setting-connection.c:769
+#: ../libnm-util/nm-setting-connection.c:785
+#: ../libnm-util/nm-setting-connection.c:846
+#: ../libnm-util/nm-setting-ip4-config.c:852
+#: ../libnm-util/nm-setting-ip6-config.c:833
+#: ../libnm-util/nm-setting-ip6-config.c:897
+#: ../libnm-util/nm-setting-olpc-mesh.c:124
+#: ../libnm-util/nm-setting-pppoe.c:164 ../libnm-util/nm-setting-vpn.c:424
+#: ../libnm-util/nm-setting-wimax.c:139
+#: ../libnm-util/nm-setting-wireless-security.c:892
+#: ../libnm-util/nm-setting-wireless.c:770
+msgid "property is missing"
+msgstr "egenskapen saknas"
+
+#: ../libnm-core/nm-setting-8021x.c:579 ../libnm-util/nm-setting-8021x.c:598
msgid "CA certificate must be in X.509 format"
msgstr "CA-certifikat måste vara i X.509-format"
-#: ../libnm-core/nm-setting-8021x.c:892 ../libnm-core/nm-setting-8021x.c:1156
-#: ../libnm-core/nm-setting-8021x.c:1476 ../libnm-util/nm-setting-8021x.c:914
-#: ../libnm-util/nm-setting-8021x.c:1177 ../libnm-util/nm-setting-8021x.c:1500
+#: ../libnm-core/nm-setting-8021x.c:894 ../libnm-core/nm-setting-8021x.c:1158
+#: ../libnm-core/nm-setting-8021x.c:1478 ../libnm-util/nm-setting-8021x.c:916
+#: ../libnm-util/nm-setting-8021x.c:1179 ../libnm-util/nm-setting-8021x.c:1502
msgid "invalid certificate format"
msgstr "ogiltigt certifikatformat"
-#: ../libnm-core/nm-setting-8021x.c:1758 ../libnm-util/nm-setting-8021x.c:1769
+#: ../libnm-core/nm-setting-8021x.c:1761 ../libnm-util/nm-setting-8021x.c:1771
msgid "invalid private key"
msgstr "ogiltig privat nyckel"
-#: ../libnm-core/nm-setting-8021x.c:2068 ../libnm-util/nm-setting-8021x.c:2080
+#: ../libnm-core/nm-setting-8021x.c:2072 ../libnm-util/nm-setting-8021x.c:2082
msgid "invalid phase2 private key"
msgstr "ogiltig privat nyckel för phase2"
-#: ../libnm-core/nm-setting-8021x.c:2270 ../libnm-core/nm-setting-8021x.c:2287
-#: ../libnm-core/nm-setting-8021x.c:2317 ../libnm-core/nm-setting-8021x.c:2334
-#: ../libnm-core/nm-setting-8021x.c:2375 ../libnm-core/nm-setting-8021x.c:2387
-#: ../libnm-core/nm-setting-8021x.c:2405 ../libnm-core/nm-setting-8021x.c:2417
-#: ../libnm-core/nm-setting-8021x.c:2441 ../libnm-core/nm-setting-8021x.c:2623
-#: ../libnm-core/nm-setting-adsl.c:188
-#: ../libnm-core/nm-setting-bluetooth.c:118
-#: ../libnm-core/nm-setting-bluetooth.c:136
-#: ../libnm-core/nm-setting-cdma.c:140
-#: ../libnm-core/nm-setting-connection.c:762
-#: ../libnm-core/nm-setting-connection.c:778
-#: ../libnm-core/nm-setting-connection.c:808
-#: ../libnm-core/nm-setting-ip4-config.c:880
-#: ../libnm-core/nm-setting-ip6-config.c:799
-#: ../libnm-core/nm-setting-ip6-config.c:863
-#: ../libnm-core/nm-setting-olpc-mesh.c:106
-#: ../libnm-core/nm-setting-pppoe.c:141 ../libnm-core/nm-setting-vpn.c:378
-#: ../libnm-core/nm-setting-wimax.c:115
-#: ../libnm-core/nm-setting-wireless-security.c:861
-#: ../libnm-core/nm-setting-wireless.c:692 ../libnm-core/nm-setting.c:1764
-#: ../libnm-util/nm-setting.c:1370 ../libnm-util/nm-setting.c:1389
-#: ../libnm-util/nm-setting.c:1407 ../libnm-util/nm-setting-8021x.c:2282
-#: ../libnm-util/nm-setting-8021x.c:2299 ../libnm-util/nm-setting-8021x.c:2340
-#: ../libnm-util/nm-setting-8021x.c:2357 ../libnm-util/nm-setting-8021x.c:2409
-#: ../libnm-util/nm-setting-8021x.c:2421 ../libnm-util/nm-setting-8021x.c:2439
-#: ../libnm-util/nm-setting-8021x.c:2451 ../libnm-util/nm-setting-8021x.c:2475
-#: ../libnm-util/nm-setting-8021x.c:2653 ../libnm-util/nm-setting-adsl.c:208
-#: ../libnm-util/nm-setting-bluetooth.c:140
-#: ../libnm-util/nm-setting-bluetooth.c:158
-#: ../libnm-util/nm-setting-cdma.c:161
-#: ../libnm-util/nm-setting-connection.c:767
-#: ../libnm-util/nm-setting-connection.c:783
-#: ../libnm-util/nm-setting-connection.c:844
-#: ../libnm-util/nm-setting-ip4-config.c:828
-#: ../libnm-util/nm-setting-ip6-config.c:809
-#: ../libnm-util/nm-setting-ip6-config.c:873
-#: ../libnm-util/nm-setting-olpc-mesh.c:122
-#: ../libnm-util/nm-setting-pppoe.c:162 ../libnm-util/nm-setting-vpn.c:402
-#: ../libnm-util/nm-setting-wimax.c:137
-#: ../libnm-util/nm-setting-wireless-security.c:891
-#: ../libnm-util/nm-setting-wireless.c:750
-msgid "property is missing"
-msgstr "egenskapen saknas"
-
-#: ../libnm-core/nm-setting-8021x.c:2277 ../libnm-core/nm-setting-8021x.c:2294
-#: ../libnm-core/nm-setting-8021x.c:2324 ../libnm-core/nm-setting-8021x.c:2341
-#: ../libnm-core/nm-setting-8021x.c:2381 ../libnm-core/nm-setting-8021x.c:2393
-#: ../libnm-core/nm-setting-8021x.c:2411 ../libnm-core/nm-setting-8021x.c:2423
-#: ../libnm-core/nm-setting-8021x.c:2448 ../libnm-core/nm-setting-adsl.c:195
-#: ../libnm-core/nm-setting-adsl.c:204 ../libnm-core/nm-setting-cdma.c:156
-#: ../libnm-core/nm-setting-cdma.c:165
-#: ../libnm-core/nm-setting-connection.c:769
-#: ../libnm-core/nm-setting-connection.c:819
-#: ../libnm-core/nm-setting-gsm.c:224 ../libnm-core/nm-setting-gsm.c:281
-#: ../libnm-core/nm-setting-gsm.c:290
-#: ../libnm-core/nm-setting-ip4-config.c:945
-#: ../libnm-core/nm-setting-ip4-config.c:954
-#: ../libnm-core/nm-setting-pppoe.c:148 ../libnm-core/nm-setting-pppoe.c:157
-#: ../libnm-core/nm-setting-vpn.c:387 ../libnm-core/nm-setting-vpn.c:397
-#: ../libnm-core/nm-setting-wimax.c:124
-#: ../libnm-core/nm-setting-wireless-security.c:891
-#: ../libnm-core/nm-setting-wireless-security.c:899
-#: ../libnm-core/nm-setting-wireless-security.c:923
-#: ../libnm-util/nm-setting-8021x.c:2289 ../libnm-util/nm-setting-8021x.c:2306
-#: ../libnm-util/nm-setting-8021x.c:2347 ../libnm-util/nm-setting-8021x.c:2364
-#: ../libnm-util/nm-setting-8021x.c:2415 ../libnm-util/nm-setting-8021x.c:2427
-#: ../libnm-util/nm-setting-8021x.c:2445 ../libnm-util/nm-setting-8021x.c:2457
-#: ../libnm-util/nm-setting-8021x.c:2482 ../libnm-util/nm-setting-adsl.c:215
-#: ../libnm-util/nm-setting-adsl.c:224 ../libnm-util/nm-setting-cdma.c:177
-#: ../libnm-util/nm-setting-cdma.c:186
-#: ../libnm-util/nm-setting-connection.c:774
-#: ../libnm-util/nm-setting-connection.c:851
-#: ../libnm-util/nm-setting-gsm.c:281 ../libnm-util/nm-setting-gsm.c:338
-#: ../libnm-util/nm-setting-gsm.c:347
-#: ../libnm-util/nm-setting-ip4-config.c:893
-#: ../libnm-util/nm-setting-ip4-config.c:902
-#: ../libnm-util/nm-setting-pppoe.c:169 ../libnm-util/nm-setting-pppoe.c:178
-#: ../libnm-util/nm-setting-vpn.c:411 ../libnm-util/nm-setting-vpn.c:421
-#: ../libnm-util/nm-setting-wimax.c:146
-#: ../libnm-util/nm-setting-wireless-security.c:921
-#: ../libnm-util/nm-setting-wireless-security.c:929
-#: ../libnm-util/nm-setting-wireless-security.c:953
+#: ../libnm-core/nm-setting-8021x.c:2282 ../libnm-core/nm-setting-8021x.c:2299
+#: ../libnm-core/nm-setting-8021x.c:2330 ../libnm-core/nm-setting-8021x.c:2347
+#: ../libnm-core/nm-setting-8021x.c:2388 ../libnm-core/nm-setting-8021x.c:2400
+#: ../libnm-core/nm-setting-8021x.c:2418 ../libnm-core/nm-setting-8021x.c:2430
+#: ../libnm-core/nm-setting-8021x.c:2455 ../libnm-core/nm-setting-adsl.c:197
+#: ../libnm-core/nm-setting-adsl.c:206 ../libnm-core/nm-setting-cdma.c:158
+#: ../libnm-core/nm-setting-cdma.c:167
+#: ../libnm-core/nm-setting-connection.c:775
+#: ../libnm-core/nm-setting-connection.c:818
+#: ../libnm-core/nm-setting-gsm.c:226 ../libnm-core/nm-setting-gsm.c:283
+#: ../libnm-core/nm-setting-gsm.c:292
+#: ../libnm-core/nm-setting-ip-config.c:1848
+#: ../libnm-core/nm-setting-ip4-config.c:178
+#: ../libnm-core/nm-setting-pppoe.c:150 ../libnm-core/nm-setting-pppoe.c:159
+#: ../libnm-core/nm-setting-vpn.c:409 ../libnm-core/nm-setting-vpn.c:419
+#: ../libnm-core/nm-setting-wimax.c:126
+#: ../libnm-core/nm-setting-wireless-security.c:892
+#: ../libnm-core/nm-setting-wireless-security.c:900
+#: ../libnm-core/nm-setting-wireless-security.c:924
+#: ../libnm-util/nm-setting-8021x.c:2291 ../libnm-util/nm-setting-8021x.c:2308
+#: ../libnm-util/nm-setting-8021x.c:2349 ../libnm-util/nm-setting-8021x.c:2366
+#: ../libnm-util/nm-setting-8021x.c:2417 ../libnm-util/nm-setting-8021x.c:2429
+#: ../libnm-util/nm-setting-8021x.c:2447 ../libnm-util/nm-setting-8021x.c:2459
+#: ../libnm-util/nm-setting-8021x.c:2484 ../libnm-util/nm-setting-adsl.c:217
+#: ../libnm-util/nm-setting-adsl.c:226 ../libnm-util/nm-setting-cdma.c:179
+#: ../libnm-util/nm-setting-cdma.c:188
+#: ../libnm-util/nm-setting-connection.c:776
+#: ../libnm-util/nm-setting-connection.c:853
+#: ../libnm-util/nm-setting-gsm.c:283 ../libnm-util/nm-setting-gsm.c:340
+#: ../libnm-util/nm-setting-gsm.c:349
+#: ../libnm-util/nm-setting-ip4-config.c:917
+#: ../libnm-util/nm-setting-ip4-config.c:926
+#: ../libnm-util/nm-setting-pppoe.c:171 ../libnm-util/nm-setting-pppoe.c:180
+#: ../libnm-util/nm-setting-vpn.c:433 ../libnm-util/nm-setting-vpn.c:443
+#: ../libnm-util/nm-setting-wimax.c:148
+#: ../libnm-util/nm-setting-wireless-security.c:922
+#: ../libnm-util/nm-setting-wireless-security.c:930
+#: ../libnm-util/nm-setting-wireless-security.c:954
msgid "property is empty"
msgstr "egenskap är tom"
-#: ../libnm-core/nm-setting-8021x.c:2306 ../libnm-core/nm-setting-8021x.c:2353
-#: ../libnm-util/nm-setting-8021x.c:2317 ../libnm-util/nm-setting-8021x.c:2329
-#: ../libnm-util/nm-setting-8021x.c:2375 ../libnm-util/nm-setting-8021x.c:2387
+#: ../libnm-core/nm-setting-8021x.c:2312 ../libnm-core/nm-setting-8021x.c:2360
+#: ../libnm-util/nm-setting-8021x.c:2319 ../libnm-util/nm-setting-8021x.c:2331
+#: ../libnm-util/nm-setting-8021x.c:2377 ../libnm-util/nm-setting-8021x.c:2389
#, c-format
msgid "has to match '%s' property for PKCS#12"
msgstr "mÃ¥ste matcha â€%sâ€-egenskapen för PKCS#12"
-#: ../libnm-core/nm-setting-8021x.c:2598 ../libnm-core/nm-setting-8021x.c:2632
-#: ../libnm-core/nm-setting-bluetooth.c:127
-#: ../libnm-core/nm-setting-infiniband.c:191
-#: ../libnm-core/nm-setting-infiniband.c:206
-#: ../libnm-core/nm-setting-ip4-config.c:936
-#: ../libnm-core/nm-setting-ip6-config.c:854
-#: ../libnm-core/nm-setting-olpc-mesh.c:135
-#: ../libnm-core/nm-setting-wimax.c:133 ../libnm-core/nm-setting-wired.c:618
+#: ../libnm-core/nm-setting-8021x.c:2605 ../libnm-core/nm-setting-8021x.c:2639
+#: ../libnm-core/nm-setting-bluetooth.c:130
+#: ../libnm-core/nm-setting-infiniband.c:193
+#: ../libnm-core/nm-setting-infiniband.c:208
+#: ../libnm-core/nm-setting-ip4-config.c:169
+#: ../libnm-core/nm-setting-ip6-config.c:166
+#: ../libnm-core/nm-setting-olpc-mesh.c:142
+#: ../libnm-core/nm-setting-wimax.c:135 ../libnm-core/nm-setting-wired.c:618
#: ../libnm-core/nm-setting-wired.c:628
-#: ../libnm-core/nm-setting-wireless-security.c:942
-#: ../libnm-core/nm-setting-wireless-security.c:951
-#: ../libnm-core/nm-setting-wireless-security.c:959
-#: ../libnm-core/nm-setting-wireless-security.c:967
-#: ../libnm-core/nm-setting-wireless-security.c:975
-#: ../libnm-core/nm-setting-wireless-security.c:984
-#: ../libnm-core/nm-setting-wireless-security.c:993
-#: ../libnm-core/nm-setting-wireless-security.c:1002
-#: ../libnm-core/nm-setting-wireless-security.c:1038
-#: ../libnm-core/nm-setting-wireless-security.c:1048
-#: ../libnm-core/nm-setting-wireless.c:753
-#: ../libnm-core/nm-setting-wireless.c:762
-#: ../libnm-core/nm-setting-wireless.c:771 ../libnm-util/nm-setting.c:1380
-#: ../libnm-util/nm-setting.c:1398 ../libnm-util/nm-setting.c:1417
-#: ../libnm-util/nm-setting-8021x.c:2628 ../libnm-util/nm-setting-8021x.c:2662
-#: ../libnm-util/nm-setting-bluetooth.c:149
-#: ../libnm-util/nm-setting-infiniband.c:204
-#: ../libnm-util/nm-setting-infiniband.c:220
-#: ../libnm-util/nm-setting-ip4-config.c:884
-#: ../libnm-util/nm-setting-ip6-config.c:864
-#: ../libnm-util/nm-setting-olpc-mesh.c:150
-#: ../libnm-util/nm-setting-wimax.c:155 ../libnm-util/nm-setting-wired.c:660
-#: ../libnm-util/nm-setting-wired.c:669
-#: ../libnm-util/nm-setting-wireless-security.c:972
-#: ../libnm-util/nm-setting-wireless-security.c:981
-#: ../libnm-util/nm-setting-wireless-security.c:989
-#: ../libnm-util/nm-setting-wireless-security.c:997
-#: ../libnm-util/nm-setting-wireless-security.c:1005
-#: ../libnm-util/nm-setting-wireless-security.c:1014
-#: ../libnm-util/nm-setting-wireless-security.c:1023
-#: ../libnm-util/nm-setting-wireless-security.c:1032
-#: ../libnm-util/nm-setting-wireless-security.c:1068
-#: ../libnm-util/nm-setting-wireless-security.c:1078
-#: ../libnm-util/nm-setting-wireless.c:810
-#: ../libnm-util/nm-setting-wireless.c:819
-#: ../libnm-util/nm-setting-wireless.c:828
+#: ../libnm-core/nm-setting-wireless-security.c:943
+#: ../libnm-core/nm-setting-wireless-security.c:952
+#: ../libnm-core/nm-setting-wireless-security.c:960
+#: ../libnm-core/nm-setting-wireless-security.c:968
+#: ../libnm-core/nm-setting-wireless-security.c:976
+#: ../libnm-core/nm-setting-wireless-security.c:985
+#: ../libnm-core/nm-setting-wireless-security.c:994
+#: ../libnm-core/nm-setting-wireless-security.c:1003
+#: ../libnm-core/nm-setting-wireless-security.c:1039
+#: ../libnm-core/nm-setting-wireless-security.c:1049
+#: ../libnm-core/nm-setting-wireless.c:773
+#: ../libnm-core/nm-setting-wireless.c:782
+#: ../libnm-core/nm-setting-wireless.c:791 ../libnm-util/nm-setting.c:1376
+#: ../libnm-util/nm-setting.c:1394 ../libnm-util/nm-setting.c:1413
+#: ../libnm-util/nm-setting-8021x.c:2630 ../libnm-util/nm-setting-8021x.c:2664
+#: ../libnm-util/nm-setting-bluetooth.c:152
+#: ../libnm-util/nm-setting-infiniband.c:206
+#: ../libnm-util/nm-setting-infiniband.c:222
+#: ../libnm-util/nm-setting-ip4-config.c:908
+#: ../libnm-util/nm-setting-ip6-config.c:888
+#: ../libnm-util/nm-setting-olpc-mesh.c:152
+#: ../libnm-util/nm-setting-wimax.c:157 ../libnm-util/nm-setting-wired.c:659
+#: ../libnm-util/nm-setting-wired.c:668
+#: ../libnm-util/nm-setting-wireless-security.c:973
+#: ../libnm-util/nm-setting-wireless-security.c:982
+#: ../libnm-util/nm-setting-wireless-security.c:990
+#: ../libnm-util/nm-setting-wireless-security.c:998
+#: ../libnm-util/nm-setting-wireless-security.c:1006
+#: ../libnm-util/nm-setting-wireless-security.c:1015
+#: ../libnm-util/nm-setting-wireless-security.c:1024
+#: ../libnm-util/nm-setting-wireless-security.c:1033
+#: ../libnm-util/nm-setting-wireless-security.c:1069
+#: ../libnm-util/nm-setting-wireless-security.c:1079
+#: ../libnm-util/nm-setting-wireless.c:830
+#: ../libnm-util/nm-setting-wireless.c:839
+#: ../libnm-util/nm-setting-wireless.c:848
msgid "property is invalid"
msgstr "ogiltig egenskap"
-#: ../libnm-core/nm-setting-8021x.c:2657 ../libnm-core/nm-setting-8021x.c:2667
-#: ../libnm-core/nm-setting-8021x.c:2677 ../libnm-core/nm-setting-8021x.c:2687
-#: ../libnm-core/nm-setting-8021x.c:2697 ../libnm-core/nm-setting-adsl.c:216
-#: ../libnm-core/nm-setting-adsl.c:228
-#: ../libnm-core/nm-setting-bluetooth.c:144
-#: ../libnm-core/nm-setting-wireless-security.c:870
-#: ../libnm-util/nm-setting-8021x.c:2687 ../libnm-util/nm-setting-8021x.c:2697
-#: ../libnm-util/nm-setting-8021x.c:2707 ../libnm-util/nm-setting-8021x.c:2717
-#: ../libnm-util/nm-setting-8021x.c:2727 ../libnm-util/nm-setting-adsl.c:236
-#: ../libnm-util/nm-setting-adsl.c:248
-#: ../libnm-util/nm-setting-bluetooth.c:166
-#: ../libnm-util/nm-setting-wireless-security.c:900
+#: ../libnm-core/nm-setting-8021x.c:2664 ../libnm-core/nm-setting-8021x.c:2674
+#: ../libnm-core/nm-setting-8021x.c:2684 ../libnm-core/nm-setting-8021x.c:2694
+#: ../libnm-core/nm-setting-8021x.c:2704 ../libnm-core/nm-setting-adsl.c:218
+#: ../libnm-core/nm-setting-adsl.c:230
+#: ../libnm-core/nm-setting-bluetooth.c:147
+#: ../libnm-core/nm-setting-wireless-security.c:871
+#: ../libnm-util/nm-setting-8021x.c:2689 ../libnm-util/nm-setting-8021x.c:2699
+#: ../libnm-util/nm-setting-8021x.c:2709 ../libnm-util/nm-setting-8021x.c:2719
+#: ../libnm-util/nm-setting-8021x.c:2729 ../libnm-util/nm-setting-adsl.c:238
+#: ../libnm-util/nm-setting-adsl.c:250
+#: ../libnm-util/nm-setting-bluetooth.c:169
+#: ../libnm-util/nm-setting-wireless-security.c:901
#, c-format
msgid "'%s' is not a valid value for the property"
msgstr "Fel: â€%s†är inte ett giltigt värde för egenskapen"
-#: ../libnm-core/nm-setting-bluetooth.c:166
+#: ../libnm-core/nm-setting-bluetooth.c:169
#, c-format
msgid "'%s' connection requires '%s' or '%s' setting"
msgstr "â€%sâ€-anslutning kräver â€%s†eller â€%sâ€-inställning"
-#: ../libnm-core/nm-setting-bond.c:458 ../libnm-util/nm-setting-bond.c:501
+#: ../libnm-core/nm-setting-bond.c:455 ../libnm-util/nm-setting-bond.c:503
#, c-format
msgid "invalid option '%s' or its value '%s'"
msgstr "ogiltigt alternativ â€%s†eller dess värde â€%sâ€"
-#: ../libnm-core/nm-setting-bond.c:477 ../libnm-util/nm-setting-bond.c:520
+#: ../libnm-core/nm-setting-bond.c:474 ../libnm-util/nm-setting-bond.c:522
#, c-format
msgid "only one of '%s' and '%s' can be set"
msgstr "endast en av â€%s†och â€%s†kan sättas"
-#: ../libnm-core/nm-setting-bond.c:488 ../libnm-util/nm-setting-bond.c:531
+#: ../libnm-core/nm-setting-bond.c:486 ../libnm-util/nm-setting-bond.c:533
#, c-format
msgid "mandatory option '%s' is missing"
msgstr "obligatoriskt värde â€%s†saknas"
-#: ../libnm-core/nm-setting-bond.c:497 ../libnm-util/nm-setting-bond.c:540
+#: ../libnm-core/nm-setting-bond.c:496 ../libnm-util/nm-setting-bond.c:542
#, c-format
msgid "'%s' is not a valid value for '%s'"
-msgstr "â€%s†är inte ett giltigt värde för â€%sâ€."
+msgstr "â€%s†är inte ett giltigt värde för â€%sâ€"
-#: ../libnm-core/nm-setting-bond.c:510 ../libnm-util/nm-setting-bond.c:553
+#: ../libnm-core/nm-setting-bond.c:510 ../libnm-util/nm-setting-bond.c:555
#, c-format
msgid "'%s=%s' is incompatible with '%s > 0'"
msgstr "â€%s=%s†är inte kompatibel med â€%s†> 0"
-#: ../libnm-core/nm-setting-bond.c:523 ../libnm-util/nm-setting-bond.c:566
+#: ../libnm-core/nm-setting-bond.c:523 ../libnm-util/nm-setting-bond.c:568
#, c-format
msgid "'%s' is not a valid interface name for '%s' option"
-msgstr "â€%s†är inte ett giltigt gränssnittssnamn för flaggan â€%sâ€"
+msgstr "â€%s†är inte ett giltigt gränssnittsnamn för flaggan â€%sâ€"
-#: ../libnm-core/nm-setting-bond.c:533 ../libnm-util/nm-setting-bond.c:576
+#: ../libnm-core/nm-setting-bond.c:533 ../libnm-util/nm-setting-bond.c:578
#, c-format
msgid "'%s' option is only valid for '%s=%s'"
msgstr "â€%sâ€-alternativet är endast giltigt dÃ¥ â€%s=%sâ€"
-#: ../libnm-core/nm-setting-bond.c:546 ../libnm-util/nm-setting-bond.c:589
+#: ../libnm-core/nm-setting-bond.c:546 ../libnm-util/nm-setting-bond.c:591
#, c-format
msgid "'%s=%s' is not a valid configuration for '%s'"
msgstr "â€%s=%s†är inte en giltig konfiguration â€%sâ€"
#: ../libnm-core/nm-setting-bond.c:559 ../libnm-core/nm-setting-bond.c:568
#: ../libnm-core/nm-setting-bond.c:588 ../libnm-core/nm-setting-bond.c:624
-#: ../libnm-util/nm-setting-bond.c:602 ../libnm-util/nm-setting-bond.c:611
-#: ../libnm-util/nm-setting-bond.c:631 ../libnm-util/nm-setting-bond.c:667
+#: ../libnm-util/nm-setting-bond.c:604 ../libnm-util/nm-setting-bond.c:613
+#: ../libnm-util/nm-setting-bond.c:633 ../libnm-util/nm-setting-bond.c:669
#, c-format
msgid "'%s' option requires '%s' option to be set"
msgstr "â€%sâ€-alternativet kräver att â€%sâ€-alternativet är satt"
-#: ../libnm-core/nm-setting-bond.c:599 ../libnm-util/nm-setting-bond.c:642
+#: ../libnm-core/nm-setting-bond.c:599 ../libnm-util/nm-setting-bond.c:644
#, c-format
msgid "'%s' option is empty"
msgstr "â€%sâ€-alternativet är tomt"
-#: ../libnm-core/nm-setting-bond.c:611 ../libnm-util/nm-setting-bond.c:654
+#: ../libnm-core/nm-setting-bond.c:611 ../libnm-util/nm-setting-bond.c:656
#, c-format
msgid "'%s' is not a valid IPv4 address for '%s' option"
-msgstr "â€%s†är inte en giltig IPv4-adress för flaggan â€%sâ€."
+msgstr "â€%s†är inte en giltig IPv4-adress för flaggan â€%sâ€"
-#: ../libnm-core/nm-setting-bond.c:638 ../libnm-util/nm-setting-bond.c:681
+#: ../libnm-core/nm-setting-bond.c:638 ../libnm-util/nm-setting-bond.c:683
#, c-format
msgid "'%s' option is only valid with mode '%s'"
msgstr "â€%sâ€-alternativet är endast giltigt med läget â€%sâ€"
-#: ../libnm-core/nm-setting-bridge-port.c:121
-#: ../libnm-core/nm-setting-bridge-port.c:133
-#: ../libnm-util/nm-setting-bridge-port.c:153
-#: ../libnm-util/nm-setting-bridge-port.c:165
+#: ../libnm-core/nm-setting-bond.c:653
+#, c-format
+msgid "'%s' option should be string"
+msgstr "â€%sâ€-alternativet bör vara en sträng"
+
+#: ../libnm-core/nm-setting-bridge-port.c:125
+#: ../libnm-core/nm-setting-bridge-port.c:137
+#: ../libnm-util/nm-setting-bridge-port.c:155
+#: ../libnm-util/nm-setting-bridge-port.c:167
#, c-format
msgid "'%d' is not a valid value for the property (should be <= %d)"
msgstr "â€%d†är inte ett giltigt värde för egenskapen (ska vara <=%d)"
-#: ../libnm-core/nm-setting-bridge-port.c:158
-#: ../libnm-core/nm-setting-team-port.c:101
+#: ../libnm-core/nm-setting-bridge-port.c:155
+#: ../libnm-core/nm-setting-team-port.c:98
#, c-format
-msgid ""
-"A connection with a '%s' setting must have the slave-type set to '%s'. "
-"Instead it is '%s'"
-msgstr ""
-"En anslutning med â€%sâ€-inställning mÃ¥ste ha slavtypen satt till â€%sâ€. "
-"Istället är den â€%sâ€"
+msgid "missing setting"
+msgstr "saknar inställning"
+
+#: ../libnm-core/nm-setting-bridge-port.c:166
+#: ../libnm-core/nm-setting-team-port.c:109
+#, c-format
+msgid "A connection with a '%s' setting must have the slave-type set to '%s'. Instead it is '%s'"
+msgstr "En anslutning med â€%sâ€-inställning mÃ¥ste ha slavtypen satt till â€%sâ€. Istället är den â€%sâ€"
-#: ../libnm-core/nm-setting-bridge.c:204 ../libnm-util/nm-setting-bridge.c:268
+#: ../libnm-core/nm-setting-bridge.c:210 ../libnm-util/nm-setting-bridge.c:270
#, c-format
msgid "value '%d' is out of range <%d-%d>"
msgstr "värdet â€%d†är utanför intervallet <%d-%d>"
-#: ../libnm-core/nm-setting-bridge.c:221 ../libnm-core/nm-setting-wired.c:593
-#: ../libnm-core/nm-setting-wired.c:652 ../libnm-util/nm-setting-bridge.c:285
-#: ../libnm-util/nm-setting-wired.c:635 ../libnm-util/nm-setting-wired.c:693
+#: ../libnm-core/nm-setting-bridge.c:227 ../libnm-core/nm-setting-wired.c:592
+#: ../libnm-core/nm-setting-wired.c:652 ../libnm-util/nm-setting-bridge.c:287
+#: ../libnm-util/nm-setting-wired.c:634 ../libnm-util/nm-setting-wired.c:692
msgid "is not a valid MAC address"
msgstr "är inte en giltigt MAC-adress"
-#: ../libnm-core/nm-setting-cdma.c:147 ../libnm-util/nm-setting-cdma.c:168
+#: ../libnm-core/nm-setting-cdma.c:149 ../libnm-util/nm-setting-cdma.c:170
msgid "property is empty'"
msgstr "egenskap är tom'"
-#: ../libnm-core/nm-setting-connection.c:741
+#: ../libnm-core/nm-setting-connection.c:747
#, c-format
msgid "setting required for connection of type '%s'"
msgstr "inställning krävs för anslutning av typen â€%sâ€"
-#: ../libnm-core/nm-setting-connection.c:829
+#: ../libnm-core/nm-setting-connection.c:828
#, c-format
msgid "connection type '%s' is not valid"
msgstr "anslutningstypen â€%s†är inte giltig"
-#: ../libnm-core/nm-setting-connection.c:864
-#: ../libnm-util/nm-setting-connection.c:876
+#: ../libnm-core/nm-setting-connection.c:863
+#: ../libnm-util/nm-setting-connection.c:878
#, c-format
msgid "Unknown slave type '%s'"
msgstr "Okänd slavtyp â€%sâ€"
-#: ../libnm-core/nm-setting-connection.c:874
-#: ../libnm-util/nm-setting-connection.c:886
-msgid "Slave connections need a valid '"
-msgstr "Slavanslutningar behöver en giltig"
+#: ../libnm-core/nm-setting-connection.c:873
+#, c-format
+msgid "Slave connections need a valid '%s' property"
+msgstr "Slavanslutningar behöver en giltig â€%sâ€-egenskap"
-#: ../libnm-core/nm-setting-connection.c:895
-#: ../libnm-util/nm-setting-connection.c:895
-msgid "Cannot set '"
-msgstr "kan inte sätta"
+#: ../libnm-core/nm-setting-connection.c:894
+#, c-format
+msgid "Cannot set '%s' without '%s'"
+msgstr "Kan inte sätta â€%s†utan â€%sâ€"
-#: ../libnm-core/nm-setting-connection.c:908
+#: ../libnm-core/nm-setting-connection.c:917
#, c-format
msgid "property type should be set to '%s'"
msgstr "egenskapstypen borde vara satt till â€%sâ€"
-#: ../libnm-core/nm-setting-connection.c:923
+#: ../libnm-core/nm-setting-connection.c:932
#, c-format
msgid "slave-type '%s' requires a '%s' setting in the connection"
msgstr "slavtypen â€%s†kräver en â€%sâ€-inställning i anslutningen"
-#: ../libnm-core/nm-setting-connection.c:933
+#: ../libnm-core/nm-setting-connection.c:942
#, c-format
-msgid "Detect a slave connection with '"
-msgstr "Upptäck en slavanslutning med '"
+msgid "Detect a slave connection with '%s' set and a port type '%s'. '%s' should be set to '%s'"
+msgstr "Upptäck en slavanslutning med â€%s†satt och en porttyp â€%sâ€. â€%s†bör sättas till â€%sâ€"
-#: ../libnm-core/nm-setting-dcb.c:521 ../libnm-util/nm-setting-dcb.c:593
+#: ../libnm-core/nm-setting-dcb.c:523 ../libnm-util/nm-setting-dcb.c:595
msgid "flags invalid"
msgstr "ogiltiga flaggor"
-#: ../libnm-core/nm-setting-dcb.c:530 ../libnm-util/nm-setting-dcb.c:602
+#: ../libnm-core/nm-setting-dcb.c:532 ../libnm-util/nm-setting-dcb.c:604
msgid "flags invalid - disabled"
msgstr "ogiltiga flaggor - inaktiverad"
-#: ../libnm-core/nm-setting-dcb.c:556 ../libnm-core/nm-setting-dcb.c:605
-#: ../libnm-util/nm-setting-dcb.c:628 ../libnm-util/nm-setting-dcb.c:677
+#: ../libnm-core/nm-setting-dcb.c:558 ../libnm-core/nm-setting-dcb.c:607
+#: ../libnm-util/nm-setting-dcb.c:630 ../libnm-util/nm-setting-dcb.c:679
msgid "property invalid (not enabled)"
msgstr "egenskap ogiltig (inaktiverad)"
-#: ../libnm-core/nm-setting-dcb.c:565 ../libnm-util/nm-setting-dcb.c:637
+#: ../libnm-core/nm-setting-dcb.c:567 ../libnm-util/nm-setting-dcb.c:639
msgid "element invalid"
msgstr "ogiltigt element"
-#: ../libnm-core/nm-setting-dcb.c:580 ../libnm-util/nm-setting-dcb.c:652
+#: ../libnm-core/nm-setting-dcb.c:582 ../libnm-util/nm-setting-dcb.c:654
msgid "sum not 100%"
msgstr "summan inte 100%"
-#: ../libnm-core/nm-setting-dcb.c:614 ../libnm-core/nm-setting-dcb.c:646
-#: ../libnm-util/nm-setting-dcb.c:686 ../libnm-util/nm-setting-dcb.c:718
+#: ../libnm-core/nm-setting-dcb.c:616 ../libnm-core/nm-setting-dcb.c:648
+#: ../libnm-util/nm-setting-dcb.c:688 ../libnm-util/nm-setting-dcb.c:720
msgid "property invalid"
msgstr "egenskap ogiltig"
-#: ../libnm-core/nm-setting-dcb.c:636 ../libnm-util/nm-setting-dcb.c:708
+#: ../libnm-core/nm-setting-dcb.c:638 ../libnm-util/nm-setting-dcb.c:710
msgid "property missing"
msgstr "egenskap saknas"
-#: ../libnm-core/nm-setting-gsm.c:237 ../libnm-util/nm-setting-gsm.c:294
+#: ../libnm-core/nm-setting-gsm.c:239 ../libnm-util/nm-setting-gsm.c:296
#, c-format
msgid "property value '%s' is empty or too long (>64)"
msgstr "egenskapsvärde â€%s†är tomt eller för lÃ¥ngt (>64)"
-#: ../libnm-core/nm-setting-gsm.c:269 ../libnm-util/nm-setting-gsm.c:326
+#: ../libnm-core/nm-setting-gsm.c:271 ../libnm-util/nm-setting-gsm.c:328
#, c-format
msgid "'%s' contains invalid char(s) (use [A-Za-z._-])"
msgstr "â€%s†innehÃ¥ller ogiltig(t/a) tecken (använd [A-Za-z._-])"
-#: ../libnm-core/nm-setting-gsm.c:304 ../libnm-util/nm-setting-gsm.c:361
+#: ../libnm-core/nm-setting-gsm.c:306 ../libnm-util/nm-setting-gsm.c:363
#, c-format
msgid "'%s' length is invalid (should be 5 or 6 digits)"
msgstr "â€%sâ€-längden är ogiltig (ska vara 5 eller 6 siffror)"
-#: ../libnm-core/nm-setting-infiniband.c:216
-#: ../libnm-util/nm-setting-infiniband.c:230
+#: ../libnm-core/nm-setting-infiniband.c:218
+#: ../libnm-util/nm-setting-infiniband.c:232
msgid "not a valid interface name"
msgstr "ogiltigt gränssnittsnamn"
-#: ../libnm-core/nm-setting-infiniband.c:224
-#: ../libnm-util/nm-setting-infiniband.c:238
+#: ../libnm-core/nm-setting-infiniband.c:226
+#: ../libnm-util/nm-setting-infiniband.c:240
msgid "Must specify a P_Key if specifying parent"
msgstr "Måste ange en P_key om förälder anges"
-#: ../libnm-core/nm-setting-infiniband.c:234
-#: ../libnm-util/nm-setting-infiniband.c:248
+#: ../libnm-core/nm-setting-infiniband.c:236
+#: ../libnm-util/nm-setting-infiniband.c:250
msgid "InfiniBand P_Key connection did not specify parent interface name"
-msgstr "IfiniBand P_Key-anslutning angav inte ett föräldragränssnittnamn"
+msgstr "IfiniBand P_Key-anslutning angav inte ett föräldragränssnittsnamn"
-#: ../libnm-core/nm-setting-infiniband.c:270
-#: ../libnm-util/nm-setting-infiniband.c:284
+#: ../libnm-core/nm-setting-infiniband.c:272
+#: ../libnm-util/nm-setting-infiniband.c:286
#, c-format
-msgid ""
-"interface name of software infiniband device must be '%s' or unset (instead "
-"it is '%s')"
-msgstr ""
-"gränssnittsnamnet pÃ¥ infiniband-mjukvaruenheten mÃ¥ste vara â€%s†eller inte "
-"sättas (istället är den â€%sâ€)"
+msgid "interface name of software infiniband device must be '%s' or unset (instead it is '%s')"
+msgstr "gränssnittsnamnet pÃ¥ infiniband-mjukvaruenheten mÃ¥ste vara â€%s†eller inte sättas (istället är den â€%sâ€)"
-#: ../libnm-core/nm-setting-infiniband.c:285
+#: ../libnm-core/nm-setting-infiniband.c:287
#, c-format
msgid "mtu for transport mode '%s' can be at most %d but it is %d"
msgstr "mtu för transportläge â€%s†kan som mest vara %d men är %d"
-#: ../libnm-core/nm-setting-ip4-config.c:890
-#: ../libnm-core/nm-setting-ip6-config.c:809
-#: ../libnm-util/nm-setting-ip4-config.c:838
-#: ../libnm-util/nm-setting-ip6-config.c:819
+#: ../libnm-core/nm-setting-ip-config.c:79
#, c-format
-msgid "this property cannot be empty for '%s=%s'"
-msgstr "denna egenskap kan inte vara tom för â€%s=%sâ€"
+msgid "Invalid IPv4 address '%s'"
+msgstr "Ogiltig IPv4-adress â€%sâ€"
-#: ../libnm-core/nm-setting-ip4-config.c:902
-#: ../libnm-core/nm-setting-ip4-config.c:912
-#: ../libnm-core/nm-setting-ip4-config.c:924
-#: ../libnm-core/nm-setting-ip6-config.c:822
-#: ../libnm-core/nm-setting-ip6-config.c:832
-#: ../libnm-core/nm-setting-ip6-config.c:842
-#: ../libnm-util/nm-setting-ip4-config.c:850
-#: ../libnm-util/nm-setting-ip4-config.c:860
-#: ../libnm-util/nm-setting-ip4-config.c:872
-#: ../libnm-util/nm-setting-ip6-config.c:832
-#: ../libnm-util/nm-setting-ip6-config.c:842
-#: ../libnm-util/nm-setting-ip6-config.c:852
+#: ../libnm-core/nm-setting-ip-config.c:79
#, c-format
-msgid "this property is not allowed for '%s=%s'"
-msgstr "denna egenskap är inte tillÃ¥ten för â€%s=%sâ€"
+msgid "Invalid IPv6 address '%s"
+msgstr "Ogiltig IPv6-adress â€%sâ€"
-#: ../libnm-core/nm-setting-ip4-config.c:971
-#: ../libnm-util/nm-setting-ip4-config.c:916
+#: ../libnm-core/nm-setting-ip-config.c:93
#, c-format
-msgid "%d. IPv4 address is invalid"
-msgstr "%d. IPv4-adressen är ogiltig"
+msgid "Invalid IPv4 address prefix '%u'"
+msgstr "Ogiltig IPv4-adressprefix â€%uâ€"
-#: ../libnm-core/nm-setting-ip4-config.c:981
-#: ../libnm-util/nm-setting-ip4-config.c:926
+#: ../libnm-core/nm-setting-ip-config.c:93
#, c-format
-msgid "%d. IPv4 address has invalid prefix"
-msgstr "%d. IPv4-adressen har ogiltigt prefix"
+msgid "Invalid IPv6 address prefix '%u"
+msgstr "Ogiltig IPv6-adressprefix â€%u"
-#: ../libnm-core/nm-setting-ip4-config.c:991
+#: ../libnm-core/nm-setting-ip-config.c:111
#, c-format
-msgid "%d. IPv4 address has invalid label '%s'"
-msgstr "%d. IPv4-adressen har ogiltig etikett â€%sâ€"
+msgid "Invalid routing metric '%s'"
+msgstr "Ogiltigt ruttmätvärde â€%sâ€"
-#: ../libnm-core/nm-setting-ip4-config.c:1002
+#: ../libnm-core/nm-setting-ip-config.c:1861
#, c-format
-msgid "IPv4 address / label count mismatch (%d vs %d)"
-msgstr "IPv4-address / etikettsantal stämmer inte (%d vs %d)"
+msgid "%d. DNS server address is invalid"
+msgstr "%d. DNS-serveradressen är ogiltig"
+
+#: ../libnm-core/nm-setting-ip-config.c:1877
+#, c-format
+msgid "%d. IP address is invalid"
+msgstr "%d. IP-adressen är ogiltig"
-#: ../libnm-core/nm-setting-ip4-config.c:1018
-#: ../libnm-util/nm-setting-ip4-config.c:942
+#: ../libnm-core/nm-setting-ip-config.c:1889
+#, c-format
+msgid "%d. IP address has 'label' property with invalid type"
+msgstr "%d. IP-adressen har â€labelâ€-egenskap med ogiltigt typ"
+
+#: ../libnm-core/nm-setting-ip-config.c:1898
+#, c-format
+msgid "%d. IP address has invalid label '%s'"
+msgstr "%d. IP-adressen har ogiltig etikett â€%sâ€"
+
+#: ../libnm-core/nm-setting-ip-config.c:1912
+msgid "gateway cannot be set if there are no addresses configured"
+msgstr "gateway kan inte bestämmas om det inte finns adresser konfigurerade"
+
+#: ../libnm-core/nm-setting-ip-config.c:1921
+msgid "gateway is invalid"
+msgstr "ogiltig gateway"
+
+#: ../libnm-core/nm-setting-ip-config.c:1935
+#: ../libnm-util/nm-setting-ip4-config.c:966
#, c-format
msgid "%d. route is invalid"
msgstr "%d.-rutt ogiltig"
-#: ../libnm-core/nm-setting-ip4-config.c:1028
-#: ../libnm-util/nm-setting-ip4-config.c:952
+#: ../libnm-core/nm-setting-ip-config.c:1944
#, c-format
-msgid "%d. route has invalid prefix"
-msgstr "%d.-rutten har ett ogiltigt prefix"
+msgid "%d. route cannot be a default route"
+msgstr "%d. rutt kan inte vara en standardrutt"
-#: ../libnm-core/nm-setting-ip4-config.c:1044
-#: ../libnm-core/nm-setting-ip6-config.c:876
+#: ../libnm-core/nm-setting-ip4-config.c:123
+#: ../libnm-core/nm-setting-ip6-config.c:121
+#: ../libnm-util/nm-setting-ip4-config.c:862
+#: ../libnm-util/nm-setting-ip6-config.c:843
#, c-format
-msgid "%d. DNS server address is invalid"
-msgstr "%d. DNS-serveradressen är ogiltig"
+msgid "this property cannot be empty for '%s=%s'"
+msgstr "denna egenskap kan inte vara tom för â€%s=%sâ€"
-#: ../libnm-core/nm-setting-ip6-config.c:821
-#: ../libnm-util/nm-setting-ip6-config.c:831
+#: ../libnm-core/nm-setting-ip4-config.c:135
+#: ../libnm-core/nm-setting-ip4-config.c:145
+#: ../libnm-core/nm-setting-ip4-config.c:157
+#: ../libnm-core/nm-setting-ip6-config.c:134
+#: ../libnm-core/nm-setting-ip6-config.c:144
+#: ../libnm-core/nm-setting-ip6-config.c:154
+#: ../libnm-util/nm-setting-ip4-config.c:874
+#: ../libnm-util/nm-setting-ip4-config.c:884
+#: ../libnm-util/nm-setting-ip4-config.c:896
+#: ../libnm-util/nm-setting-ip6-config.c:856
+#: ../libnm-util/nm-setting-ip6-config.c:866
+#: ../libnm-util/nm-setting-ip6-config.c:876
+#, c-format
+msgid "this property is not allowed for '%s=%s'"
+msgstr "denna egenskap är inte tillÃ¥ten för â€%s=%sâ€"
+
+#: ../libnm-core/nm-setting-ip6-config.c:133
+#: ../libnm-util/nm-setting-ip6-config.c:855
#, c-format
msgid "'%s' not allowed for %s=%s"
msgstr "â€%s†inte tillÃ¥tet för %s=%s"
-#: ../libnm-core/nm-setting-olpc-mesh.c:116
-#: ../libnm-core/nm-setting-wireless.c:702
-#: ../libnm-util/nm-setting-olpc-mesh.c:131
-#: ../libnm-util/nm-setting-wireless.c:759
+#: ../libnm-core/nm-setting-olpc-mesh.c:123
+#: ../libnm-core/nm-setting-wireless.c:722
+#: ../libnm-util/nm-setting-olpc-mesh.c:133
+#: ../libnm-util/nm-setting-wireless.c:779
msgid "SSID length is out of range <1-32> bytes"
msgstr "SSID-längden är utanför intervallet <1-32> byte"
-#: ../libnm-core/nm-setting-olpc-mesh.c:125
-#: ../libnm-core/nm-setting-wireless.c:742
-#: ../libnm-util/nm-setting-olpc-mesh.c:140
-#: ../libnm-util/nm-setting-wireless.c:799
+#: ../libnm-core/nm-setting-olpc-mesh.c:132
+#: ../libnm-core/nm-setting-wireless.c:762
+#: ../libnm-util/nm-setting-olpc-mesh.c:142
+#: ../libnm-util/nm-setting-wireless.c:819
#, c-format
msgid "'%d' is not a valid channel"
msgstr "â€%d†är inte en giltig kanal"
-#: ../libnm-core/nm-setting-ppp.c:365 ../libnm-util/nm-setting-ppp.c:387
+#: ../libnm-core/nm-setting-ppp.c:367 ../libnm-util/nm-setting-ppp.c:389
#, c-format
msgid "'%d' is out of valid range <128-16384>"
msgstr "â€%d†är utanför giltigt intervall <128-16384>"
-#: ../libnm-core/nm-setting-ppp.c:378 ../libnm-util/nm-setting-ppp.c:400
+#: ../libnm-core/nm-setting-ppp.c:380 ../libnm-util/nm-setting-ppp.c:402
#, c-format
msgid "setting this property requires non-zero '%s' property"
-msgstr "att sätta denna egenskap kräver icke-noll för â€%sâ€-egenskapen."
+msgstr "att sätta denna egenskap kräver icke-noll för â€%sâ€-egenskapen"
-#: ../libnm-core/nm-setting-vlan.c:512 ../libnm-util/nm-setting-vlan.c:554
+#: ../libnm-core/nm-setting-vlan.c:516 ../libnm-util/nm-setting-vlan.c:557
#, c-format
msgid "'%s' value doesn't match '%s=%s'"
msgstr "â€%sâ€-värde matchar inte â€%s=%sâ€"
-#: ../libnm-core/nm-setting-vlan.c:523 ../libnm-util/nm-setting-vlan.c:565
+#: ../libnm-core/nm-setting-vlan.c:527 ../libnm-util/nm-setting-vlan.c:568
#, c-format
msgid "'%s' is neither an UUID nor an interface name"
msgstr "â€%s†är varken ett UUID eller ett gränssnittsnamn"
-#: ../libnm-core/nm-setting-vlan.c:537 ../libnm-util/nm-setting-vlan.c:578
+#: ../libnm-core/nm-setting-vlan.c:541 ../libnm-util/nm-setting-vlan.c:581
#, c-format
msgid "property is not specified and neither is '%s:%s'"
msgstr "egenskapen är inte angiven och det är inte heller â€%s:%sâ€"
-#: ../libnm-core/nm-setting-vlan.c:550 ../libnm-util/nm-setting-vlan.c:591
+#: ../libnm-core/nm-setting-vlan.c:554 ../libnm-util/nm-setting-vlan.c:594
msgid "flags are invalid"
msgstr "flaggorna är ogiltiga"
-#: ../libnm-core/nm-setting-vpn.c:419
+#: ../libnm-core/nm-setting-vpn.c:441
#, c-format
msgid "secret was empty"
msgstr "hemlighet är tom"
-#: ../libnm-core/nm-setting-vpn.c:449
+#: ../libnm-core/nm-setting-vpn.c:471
msgid "setting contained a secret with an empty name"
msgstr "inställning innehåller en hemlighet med ett tomt namn"
-#: ../libnm-core/nm-setting-vpn.c:457
+#: ../libnm-core/nm-setting-vpn.c:479
#, c-format
msgid "secret value was empty"
msgstr "hemligt värde var tomt"
-#: ../libnm-core/nm-setting-vpn.c:504 ../libnm-core/nm-setting.c:1567
+#: ../libnm-core/nm-setting-vpn.c:526 ../libnm-core/nm-setting.c:1607
msgid "not a secret property"
msgstr "inte en hemlig egenskap"
-#: ../libnm-core/nm-setting-vpn.c:510
+#: ../libnm-core/nm-setting-vpn.c:532
msgid "secret is not of correct type"
msgstr "hemlighet är inte av korrekt typ"
-#: ../libnm-core/nm-setting-vpn.c:545
+#: ../libnm-core/nm-setting-vpn.c:567
#, c-format
msgid "failed to convert value '%s' to uint"
msgstr "misslyckades med att konvertera värdet â€%s†till uint"
-#: ../libnm-core/nm-setting-vpn.c:553
+#: ../libnm-core/nm-setting-vpn.c:575
msgid "secret flags property not found"
msgstr "hemliga flaggegenskaper hittades inte"
-#: ../libnm-core/nm-setting-wired.c:573 ../libnm-util/nm-setting-wired.c:615
+#: ../libnm-core/nm-setting-wired.c:572 ../libnm-util/nm-setting-wired.c:614
#, c-format
msgid "'%s' is not a valid Ethernet port value"
msgstr "â€%s†är inte ett giltigt portvärde för Ethernet"
-#: ../libnm-core/nm-setting-wired.c:583 ../libnm-util/nm-setting-wired.c:625
+#: ../libnm-core/nm-setting-wired.c:582 ../libnm-util/nm-setting-wired.c:624
#, c-format
msgid "'%s' is not a valid duplex value"
msgstr "â€%s†är inte ett giltigt värde för duplex"
-#: ../libnm-core/nm-setting-wired.c:641 ../libnm-util/nm-setting-wired.c:682
+#: ../libnm-core/nm-setting-wired.c:641 ../libnm-util/nm-setting-wired.c:681
#, c-format
msgid "invalid '%s' or its value '%s'"
msgstr "ogiltig â€%s†eller dess värde â€%s"
-#: ../libnm-core/nm-setting-wireless-security.c:882
-#: ../libnm-util/nm-setting-wireless-security.c:912
+#: ../libnm-core/nm-setting-wireless-security.c:883
+#: ../libnm-util/nm-setting-wireless-security.c:913
#, c-format
msgid "'%s' security requires '%s=%s'"
msgstr "â€%sâ€-säkerhet kräver â€%s=%sâ€"
-#: ../libnm-core/nm-setting-wireless-security.c:911
-#: ../libnm-util/nm-setting-wireless-security.c:941
+#: ../libnm-core/nm-setting-wireless-security.c:912
+#: ../libnm-util/nm-setting-wireless-security.c:942
#, c-format
msgid "'%s' security requires '%s' setting presence"
msgstr "â€%sâ€-säkerhet kräver en â€%sâ€-inställning"
-#: ../libnm-core/nm-setting-wireless-security.c:932
-#: ../libnm-util/nm-setting-wireless-security.c:962
+#: ../libnm-core/nm-setting-wireless-security.c:933
+#: ../libnm-util/nm-setting-wireless-security.c:963
#, c-format
msgid "'%d' value is out of range <0-3>"
msgstr "â€%dâ€-värdet är utanför intervallet <0-3>"
-#: ../libnm-core/nm-setting-wireless-security.c:1029
-#: ../libnm-util/nm-setting-wireless-security.c:1059
+#: ../libnm-core/nm-setting-wireless-security.c:1030
+#: ../libnm-util/nm-setting-wireless-security.c:1060
#, c-format
msgid "'%s' connections require '%s' in this property"
msgstr "â€%sâ€-anslutningar kräver â€%s†i denna egenskap"
-#: ../libnm-core/nm-setting-wireless-security.c:1059
-#: ../libnm-util/nm-setting-wireless-security.c:1089
+#: ../libnm-core/nm-setting-wireless-security.c:1060
+#: ../libnm-util/nm-setting-wireless-security.c:1090
#, c-format
msgid "'%s' can only be used with '%s=%s' (WEP)"
msgstr "â€%s†kan endast användas med â€%s=%s†(WEP)"
-#: ../libnm-core/nm-setting-wireless.c:711
-#: ../libnm-util/nm-setting-wireless.c:768
+#: ../libnm-core/nm-setting-wireless.c:731
+#: ../libnm-util/nm-setting-wireless.c:788
#, c-format
msgid "'%s' is not a valid Wi-Fi mode"
-msgstr "â€%s†är inte ett giltig Wi-Fi-läge."
+msgstr "â€%s†är inte ett giltigt Wi-Fi-läge"
-#: ../libnm-core/nm-setting-wireless.c:721
-#: ../libnm-util/nm-setting-wireless.c:778
+#: ../libnm-core/nm-setting-wireless.c:741
+#: ../libnm-util/nm-setting-wireless.c:798
#, c-format
msgid "'%s' is not a valid band"
msgstr "â€%s†är inte en giltig frekvens"
-#: ../libnm-core/nm-setting-wireless.c:731
+#: ../libnm-core/nm-setting-wireless.c:751
#, c-format
msgid "'%s' requires setting '%s' property"
msgstr "â€%s†kräver en â€%sâ€-inställning"
-#: ../libnm-core/nm-setting.c:1465
+#: ../libnm-core/nm-setting.c:827
+#, c-format
+msgid "can't set property of type '%s' from value of type '%s'"
+msgstr "kan inte sätta egenskap för typen â€%s†frÃ¥n värdet av typen â€%sâ€"
+
+#: ../libnm-core/nm-setting.c:1505
msgid "secret not found"
-msgstr "hemlighet inte funnnen"
+msgstr "hemlighet inte funnen"
-#: ../libnm-core/nm-setting.c:1557
+#: ../libnm-core/nm-setting.c:1597
msgid "secret is not set"
msgstr "hemlighet inte angiven"
-#: ../libnm-core/nm-setting.c:1745
-msgid "missing setting"
-msgstr "saknar inställning"
+#: ../libnm-core/nm-utils.c:2276 ../libnm-util/nm-utils.c:1813
+#, c-format
+msgid "Could not find \"%s\" binary"
+msgstr "Kunde inte hitta binären â€%sâ€"
-#: ../libnm-glib/nm-device.c:1792 ../libnm/nm-device.c:1602
+#: ../libnm-glib/nm-device.c:1793 ../libnm/nm-device.c:1615
msgid "Bluetooth"
msgstr "Bluetooth"
-#: ../libnm-glib/nm-device.c:1810 ../libnm/nm-device.c:1620
+#: ../libnm-glib/nm-device.c:1811 ../libnm/nm-device.c:1633
msgid "ADSL"
msgstr "ADSL"
-#: ../libnm-glib/nm-device.c:1838 ../libnm/nm-device.c:1648
+#: ../libnm-glib/nm-device.c:1839 ../libnm/nm-device.c:1661
msgid "Wired"
msgstr "Trådbunden"
-#: ../libnm-glib/nm-device.c:1869 ../libnm/nm-device.c:1679
+#: ../libnm-glib/nm-device.c:1870 ../libnm/nm-device.c:1692
msgid "PCI"
msgstr "PCI"
-#: ../libnm-glib/nm-device.c:1871 ../libnm/nm-device.c:1681
+#: ../libnm-glib/nm-device.c:1872 ../libnm/nm-device.c:1694
msgid "USB"
msgstr "USB"
@@ -7093,176 +7214,212 @@ msgstr "USB"
#. * "%2$s (%1$s)" if there's no grammatical way to combine
#. * the strings otherwise.
#.
-#: ../libnm-glib/nm-device.c:1967 ../libnm-glib/nm-device.c:1986
-#: ../libnm/nm-device.c:1775 ../libnm/nm-device.c:1794
+#: ../libnm-glib/nm-device.c:1968 ../libnm-glib/nm-device.c:1987
+#: ../libnm/nm-device.c:1788 ../libnm/nm-device.c:1807
#, c-format
msgctxt "long device name"
msgid "%s %s"
msgstr "%s %s"
-#: ../libnm-glib/nm-remote-connection.c:149
+#: ../libnm-glib/nm-remote-connection.c:151
msgid "Disconnected by D-Bus"
msgstr "Frånkopplad av D-Bus"
-#: ../libnm-util/crypto_nss.c:468
+#: ../libnm-util/crypto_gnutls.c:88
+#, c-format
+msgid "Failed to initialize the MD5 engine: %s / %s."
+msgstr "Misslyckades med att initiera MD5-motorn: %s / %s."
+
+#: ../libnm-util/crypto_nss.c:102
+#, c-format
+msgid "Failed to initialize the MD5 context: %d."
+msgstr "Misslyckades med att initiera MD5-kontexten: %d."
+
+#: ../libnm-util/crypto_nss.c:463
#, c-format
msgid "Couldn't convert password to UCS2: %d"
msgstr "Kunde inte konvertera lösenord till UCS2: %d"
-#: ../libnm-util/nm-setting-bluetooth.c:184
+#: ../libnm-util/nm-setting-bluetooth.c:187
#, c-format
msgid "requires '%s' or '%s' setting"
msgstr "kräver â€%s†eller â€%sâ€-inställning"
-#: ../libnm-util/nm-setting-connection.c:861
+#: ../libnm-util/nm-setting-connection.c:863
#, c-format
msgid "requires presence of '%s' setting in the connection"
msgstr "kräver â€%sâ€-inställning i anslutningen"
-#: ../libnm-util/nm-setting-vpn.c:561
+#: ../libnm-util/nm-setting-connection.c:888
+msgid "Slave connections need a valid '"
+msgstr "Slavanslutningar behöver en giltig â€"
+
+#: ../libnm-util/nm-setting-connection.c:897
+msgid "Cannot set '"
+msgstr "Kan inte sätta â€"
+
+#: ../libnm-util/nm-setting-ip4-config.c:940
+#, c-format
+msgid "%d. IPv4 address is invalid"
+msgstr "%d. IPv4-adressen är ogiltig"
+
+#: ../libnm-util/nm-setting-ip4-config.c:950
+#, c-format
+msgid "%d. IPv4 address has invalid prefix"
+msgstr "%d. IPv4-adressen har ogiltigt prefix"
+
+#: ../libnm-util/nm-setting-ip4-config.c:976
+#, c-format
+msgid "%d. route has invalid prefix"
+msgstr "%d.-rutten har ett ogiltigt prefix"
+
+#: ../libnm-util/nm-setting-vpn.c:583
#, c-format
msgid "Failed to convert '%s' value '%s' to uint"
msgstr "Misslyckades med att konvertera â€%sâ€-värdet â€%s†till uint"
-#: ../libnm-util/nm-setting-vpn.c:568
+#: ../libnm-util/nm-setting-vpn.c:590
#, c-format
msgid "Secret flags property '%s' not found"
msgstr "Hemliga flaggegenskapen â€%s†hittades inte"
-#: ../libnm-util/nm-setting-wireless.c:788
+#: ../libnm-util/nm-setting-wireless.c:808
#, c-format
msgid "requires setting '%s' property"
msgstr "kräver en â€%sâ€-inställning"
-#: ../libnm/nm-device-adsl.c:70
+#: ../libnm/nm-device-adsl.c:73
msgid "The connection was not an ADSL connection."
msgstr "Anslutningen var inte en ADSL-anslutning."
-#: ../libnm/nm-device-bond.c:114
+#: ../libnm/nm-device-bond.c:115
msgid "The connection was not a bond connection."
msgstr "Anslutningen var inte en kombinerad anslutning."
-#: ../libnm/nm-device-bridge.c:114
+#: ../libnm/nm-device-bridge.c:115
msgid "The connection was not a bridge connection."
msgstr "Anslutningen var inte en brygganslutning."
-#: ../libnm/nm-device-bt.c:139
+#: ../libnm/nm-device-bt.c:140
#, c-format
msgid "The connection was not a Bluetooth connection."
msgstr "Anslutningen var inte en Bluetooth-anslutning."
-#: ../libnm/nm-device-bt.c:148
+#: ../libnm/nm-device-bt.c:149
msgid "Invalid device Bluetooth address."
msgstr "Ogiltig adress för Bluetooth-enhet."
-#: ../libnm/nm-device-bt.c:155
+#: ../libnm/nm-device-bt.c:156
msgid "The Bluetooth addresses of the device and the connection didn't match."
msgstr "Adresserna för Bluetooth-enheten och anslutningen matchade inte."
-#: ../libnm/nm-device-bt.c:164
-msgid ""
-"The device is lacking Bluetooth capabilities required by the connection."
+#: ../libnm/nm-device-bt.c:165
+msgid "The device is lacking Bluetooth capabilities required by the connection."
msgstr "Enheten saknar Bluetooth-förmågorna som krävs av anslutningen."
-#: ../libnm/nm-device-ethernet.c:137
+#: ../libnm/nm-device-ethernet.c:138
msgid "The connection was not an Ethernet or PPPoE connection."
msgstr "Anslutningen var inte en Ethernet eller PPPoE-anslutning."
-#: ../libnm/nm-device-ethernet.c:153 ../libnm/nm-device-infiniband.c:104
-#: ../libnm/nm-device-wifi.c:491 ../libnm/nm-device-wimax.c:310
+#: ../libnm/nm-device-ethernet.c:154 ../libnm/nm-device-infiniband.c:105
+#: ../libnm/nm-device-wifi.c:492 ../libnm/nm-device-wimax.c:311
msgid "Invalid device MAC address."
msgstr "Ogiltigt MAC-adress för enhet."
-#: ../libnm/nm-device-ethernet.c:159 ../libnm/nm-device-infiniband.c:112
-#: ../libnm/nm-device-wifi.c:498 ../libnm/nm-device-wimax.c:317
+#: ../libnm/nm-device-ethernet.c:160 ../libnm/nm-device-infiniband.c:113
+#: ../libnm/nm-device-wifi.c:499 ../libnm/nm-device-wimax.c:318
msgid "The MACs of the device and the connection didn't match."
msgstr "MAC-adresserna för enheten och anslutningen matchade inte."
-#: ../libnm/nm-device-generic.c:91
+#: ../libnm/nm-device-generic.c:92
msgid "The connection was not a generic connection."
msgstr "Anslutningen var inte en generell anslutning."
-#: ../libnm/nm-device-generic.c:98
+#: ../libnm/nm-device-generic.c:99
msgid "The connection did not specify an interface name."
msgstr "Anslutningen angav inte ett gränssnittsnamn."
-#: ../libnm/nm-device-infiniband.c:96
+#: ../libnm/nm-device-infiniband.c:97
msgid "The connection was not an InfiniBand connection."
msgstr "Anslutningen var inte en InfiniBand-anslutning."
-#: ../libnm/nm-device-modem.c:122
+#: ../libnm/nm-device-modem.c:123
msgid "The connection was not a modem connection."
msgstr "Anslutningen var inte en modemanslutning."
-#: ../libnm/nm-device-modem.c:130
+#: ../libnm/nm-device-modem.c:131
msgid "The connection was not a valid modem connection."
msgstr "Anslutningen var inte en giltig modemanslutning."
-#: ../libnm/nm-device-modem.c:137
+#: ../libnm/nm-device-modem.c:138
msgid "The device is lacking capabilities required by the connection."
msgstr "Enheten saknar förmågorna som krävs av anslutningen."
-#: ../libnm/nm-device-olpc-mesh.c:117
+#: ../libnm/nm-device-olpc-mesh.c:118
msgid "The connection was not an OLPC Mesh connection."
msgstr "Anslutningen var inte en OLPC Mesh-anslutning."
-#: ../libnm/nm-device-team.c:120
+#: ../libnm/nm-device-team.c:121
msgid "The connection was not a team connection."
msgstr "Anslutningen var inte en gruppanslutning."
-#: ../libnm/nm-device-vlan.c:113
+#: ../libnm/nm-device-vlan.c:131
msgid "The connection was not a VLAN connection."
msgstr "Anslutningen var inte en VLAN-anslutning."
-#: ../libnm/nm-device-vlan.c:120
+#: ../libnm/nm-device-vlan.c:138
msgid "The VLAN identifiers of the device and the connection didn't match."
msgstr "VLAN-identifierarna för enheten och anslutningen matchar inte."
-#: ../libnm/nm-device-vlan.c:133
+#: ../libnm/nm-device-vlan.c:151
msgid "The hardware address of the device and the connection didn't match."
msgstr "Hårdvaruadressen för enheten och anslutningen matchar inte."
-#: ../libnm/nm-device-wifi.c:482
+#: ../libnm/nm-device-wifi.c:483
msgid "The connection was not a Wi-Fi connection."
msgstr "Anslutningen var inte en Wi-Fi-anslutning."
-#: ../libnm/nm-device-wifi.c:518
+#: ../libnm/nm-device-wifi.c:519
msgid "The device is lacking WPA capabilities required by the connection."
msgstr "Enheten saknar WPA-förmågorna som krävs av anslutningen."
-#: ../libnm/nm-device-wifi.c:525
+#: ../libnm/nm-device-wifi.c:526
msgid "The device is lacking WPA2/RSN capabilities required by the connection."
msgstr "Enheten saknar WPA2/RSN-förmågorna som krävs av anslutningen."
-#: ../libnm/nm-device-wimax.c:301
+#: ../libnm/nm-device-wimax.c:302
msgid "The connection was not a WiMAX connection."
msgstr "Anslutningen var inte en WiMAX-anslutning."
-#: ../libnm/nm-device.c:2120
+#: ../libnm/nm-device.c:2152
#, c-format
msgid "The connection was not valid: %s"
msgstr "Anslutningen var inte giltig: %s"
-#: ../libnm/nm-device.c:2129
+#: ../libnm/nm-device.c:2161
#, c-format
msgid "The interface names of the device and the connection didn't match."
msgstr "Gränssnittsnamnen på enheten och anslutningen matchar inte."
-#: ../libnm/nm-manager.c:1053
+#: ../libnm/nm-manager.c:858
+msgid "Active connection could not be attached to the device"
+msgstr "Aktiv anslutning kunde inte fästas på enheten"
+
+#: ../libnm/nm-manager.c:1082
msgid "Active connection removed before it was initialized"
msgstr "Aktiv anslutning togs bort innan den blev initialiserad"
-#: ../libnm/nm-object.c:155 ../libnm/nm-object.c:299
+#: ../libnm/nm-object.c:1439 ../libnm/nm-object.c:1585
msgid "Caller did not specify D-Bus path for object"
msgstr "Anroparen angav inte D-Bus-sökvägen för objektet"
-#: ../libnm/nm-remote-settings.c:258
+#: ../libnm/nm-remote-settings.c:261
msgid "Connection removed before it was initialized"
msgstr "Anslutning togs bort innan den blev initialiserad"
-#: ../libnm/nm-vpn-plugin.c:713
+#: ../libnm/nm-vpn-plugin-old.c:885
msgid "No service name specified"
-msgstr "Inget tjänstenamn angivet."
+msgstr "Inget tjänstenamn angivet"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:1
msgid "Enable or disable system networking"
@@ -7270,22 +7427,15 @@ msgstr "Aktivera eller inaktivera systemnätverk"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:2
msgid "System policy prevents enabling or disabling system networking"
-msgstr ""
-"Systemets policy förhindrar aktivering eller inaktivering av systemnätverk"
+msgstr "Systemets policy förhindrar aktivering eller inaktivering av systemnätverk"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:3
-msgid ""
-"Put NetworkManager to sleep or wake it up (should only be used by system "
-"power management)"
-msgstr ""
-"Försätt Nätverkshanterare i vänteläge eller återställ efter det (bör endast "
-"användas av systemets strömhantering)"
+msgid "Put NetworkManager to sleep or wake it up (should only be used by system power management)"
+msgstr "Försätt Nätverkshanterare i vänteläge eller återställ efter det (bör endast användas av systemets strömhantering)"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:4
msgid "System policy prevents putting NetworkManager to sleep or waking it up"
-msgstr ""
-"Systemets policy förhindrar att Nätverkshanterare försätts i vänteläge eller "
-"återställs efter det"
+msgstr "Systemets policy förhindrar att Nätverkshanterare försätts i vänteläge eller återställs efter det"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:5
msgid "Enable or disable WiFi devices"
@@ -7293,8 +7443,7 @@ msgstr "Aktivera eller inaktivera trådlösa enheter"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:6
msgid "System policy prevents enabling or disabling WiFi devices"
-msgstr ""
-"Systemets policy förhindrar aktivering eller inaktivering av trådlösa enheter"
+msgstr "Systemets policy förhindrar aktivering eller inaktivering av trådlösa enheter"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:7
msgid "Enable or disable mobile broadband devices"
@@ -7302,20 +7451,15 @@ msgstr "Aktivera eller inaktivera mobila bredbandsenheter"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:8
msgid "System policy prevents enabling or disabling mobile broadband devices"
-msgstr ""
-"Systemets policy förhindrar aktivering eller inaktivering av mobila "
-"bredbandsenheter"
+msgstr "Systemets policy förhindrar aktivering eller inaktivering av mobila bredbandsenheter"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:9
msgid "Enable or disable WiMAX mobile broadband devices"
msgstr "Aktivera eller inaktivera mobila WiMAX-bredbandsenheter"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:10
-msgid ""
-"System policy prevents enabling or disabling WiMAX mobile broadband devices"
-msgstr ""
-"Systemets policy förhindrar aktivering eller inaktivering av mobila WiMAX-"
-"bredbandsenheter"
+msgid "System policy prevents enabling or disabling WiMAX mobile broadband devices"
+msgstr "Systemets policy förhindrar aktivering eller inaktivering av mobila WiMAX-bredbandsenheter"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:11
msgid "Allow control of network connections"
@@ -7331,9 +7475,7 @@ msgstr "Anslutningsdelning via ett skyddat trådlöst nätverk"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:14
msgid "System policy prevents sharing connections via a protected WiFi network"
-msgstr ""
-"Systemets policy förhindrar delning av anslutningar via ett skyddat trådlöst "
-"nätverk"
+msgstr "Systemets policy förhindrar delning av anslutningar via ett skyddat trådlöst nätverk"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:15
msgid "Connection sharing via an open WiFi network"
@@ -7341,9 +7483,7 @@ msgstr "Anslutningsdelning via ett öppet trådlöst nätverk"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:16
msgid "System policy prevents sharing connections via an open WiFi network"
-msgstr ""
-"Systemets policy förhindrar delning av anslutningar via ett öppet trådlöst "
-"nätverk"
+msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trådlöst nätverk"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:17
msgid "Modify personal network connections"
@@ -7351,8 +7491,7 @@ msgstr "Ändra personliga nätverksanslutningar"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:18
msgid "System policy prevents modification of personal network settings"
-msgstr ""
-"Systemets policy förhindrar ändring av personliga nätverksinställningar"
+msgstr "Systemets policy förhindrar ändring av personliga nätverksinställningar"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:19
msgid "Modify network connections for all users"
@@ -7360,9 +7499,7 @@ msgstr "Ändra nätverksanslutningar för alla användare"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:20
msgid "System policy prevents modification of network settings for all users"
-msgstr ""
-"Systemets policy förhindrar ändring av nätverksinställningar för alla "
-"användare"
+msgstr "Systemets policy förhindrar ändring av nätverksinställningar för alla användare"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:21
msgid "Modify persistent system hostname"
@@ -7376,95 +7513,56 @@ msgstr "Systemets policy förhindrar ändring av bestående värdnamn för syste
#. * as "Wired Connection" or "VPN Connection". The %d is a number
#. * that is combined with the first argument to create a unique
#. * connection id.
-#: ../src/NetworkManagerUtils.c:1154
+#: ../src/NetworkManagerUtils.c:1175
#, c-format
msgctxt "connection id fallback"
msgid "%s %d"
msgstr "%s %d"
-#: ../src/main.c:135
-#, c-format
-msgid "Failed to set signal mask: %d"
-msgstr "Misslyckades med att sätta signalmask: %d."
-
-#: ../src/main.c:144
-#, c-format
-msgid "Failed to create signal handling thread: %d"
-msgstr "Misslyckades med att skapa signalhanteringstråd: %d"
-
-#: ../src/main.c:159
-#, c-format
-msgid "Opening %s failed: %s\n"
-msgstr "Öppnandet av %s misslyckades: %s\n"
-
-#: ../src/main.c:165
-#, c-format
-msgid "Writing to %s failed: %s\n"
-msgstr "Skrivning till %s misslyckades: %s\n"
-
-#: ../src/main.c:170
-#, c-format
-msgid "Closing %s failed: %s\n"
-msgstr "Stängning av %s misslyckades: %s\n"
-
-#: ../src/main.c:213
-#, c-format
-msgid "NetworkManager is already running (pid %ld)\n"
-msgstr "Nätverkshanteraren är redan igång (pid %ld)\n"
-
-#: ../src/main.c:366
+#. Logging/debugging
+#: ../src/main.c:223 ../src/nm-iface-helper.c:300
msgid "Print NetworkManager version and exit"
msgstr "Skriv ut version för Nätverkshanteraren och avsluta"
-#: ../src/main.c:367
+#: ../src/main.c:224 ../src/nm-iface-helper.c:301
msgid "Don't become a daemon"
msgstr "Bli inte en demon"
-#: ../src/main.c:368
+#: ../src/main.c:225 ../src/nm-iface-helper.c:302
msgid "Don't become a daemon, and log to stderr"
msgstr "Bli inte en demon, och logga till stderr"
-#: ../src/main.c:369
+#: ../src/main.c:226 ../src/nm-iface-helper.c:303
#, c-format
msgid "Log level: one of [%s]"
msgstr "Loggnivå: en av [%s]"
-#: ../src/main.c:371
+#: ../src/main.c:228 ../src/nm-iface-helper.c:305
#, c-format
msgid "Log domains separated by ',': any combination of [%s]"
msgstr "Logga domäner separerade med â€,â€: vilken kombination som helst av [%s]"
-#: ../src/main.c:373
+#: ../src/main.c:230 ../src/nm-iface-helper.c:307
msgid "Make all warnings fatal"
msgstr "Gör alla varningar till ödesdigra"
-#: ../src/main.c:374
+#: ../src/main.c:231
msgid "Specify the location of a PID file"
msgstr "Ange platsen för en PID-fil"
-#: ../src/main.c:374
+#: ../src/main.c:231
msgid "filename"
msgstr "filnamn"
-#: ../src/main.c:375
+#: ../src/main.c:232
msgid "State file location"
msgstr "Plats för tillståndsfil"
-#: ../src/main.c:375
+#: ../src/main.c:232
msgid "/path/to/state.file"
msgstr "/sökväg/till/tillstånds.fil"
-#: ../src/main.c:401
-#, c-format
-msgid "GModules are not supported on your platform!\n"
-msgstr "GModules stöds inte på din plattform!\n"
-
-#: ../src/main.c:406
-#, c-format
-msgid "You must be root to run NetworkManager!\n"
-msgstr "Du måste vara root för att köra Nätverkshanteraren!\n"
-
-#: ../src/main.c:429
+#: ../src/main.c:248
msgid ""
"NetworkManager monitors all network connections and automatically\n"
"chooses the best connection to use. It also allows the user to\n"
@@ -7476,46 +7574,71 @@ msgstr ""
"att användaren anger trådlösa accesspunkter som trådlösa nätverks-\n"
"kort i datorn ska associeras med."
-#: ../src/main.c:435 ../src/main.c:451
+#: ../src/main.c:261 ../src/main-utils.c:228 ../src/nm-iface-helper.c:337
#, c-format
msgid "%s. Please use --help to see a list of valid options.\n"
msgstr "%s. Använd --help för att se en lista över giltiga flaggor.\n"
-#: ../src/main.c:456
+#: ../src/main.c:266 ../src/nm-iface-helper.c:342
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' passed on command line.\n"
msgstr "Ignorerar okända loggdomän(en|er) â€%s†given via kommandoraden.\n"
-#: ../src/main.c:507
+#: ../src/main.c:313
#, c-format
msgid "Failed to read configuration: (%d) %s\n"
msgstr "Misslyckades med att läsa konfiguration: (%d) %s\n"
-#: ../src/main.c:521
+#: ../src/main.c:327
#, c-format
msgid "Error in configuration file: %s.\n"
msgstr "Fel i konfigurationsfilen: %s.\n"
-#: ../src/main.c:526
+#: ../src/main.c:332
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' from config files.\n"
msgstr "Ignorerar okända loggdomän(en|er) â€%s†frÃ¥n konfigurationsfiler.\n"
-#: ../src/main.c:534
+#: ../src/main.c:340
#, c-format
msgid "State file %s parsing failed: (%d) %s\n"
msgstr "Tolkning av tillståndsfilen %s misslyckades: (%d) %s\n"
-#: ../src/main.c:547
+#: ../src/main.c:353 ../src/nm-iface-helper.c:359
#, c-format
msgid "Could not daemonize: %s [error %u]\n"
msgstr "Kunde inte bli demon: %s [fel %u]\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:151
+#: ../src/main-utils.c:95
+#, c-format
+msgid "Opening %s failed: %s\n"
+msgstr "Öppnandet av %s misslyckades: %s\n"
+
+#: ../src/main-utils.c:101
+#, c-format
+msgid "Writing to %s failed: %s\n"
+msgstr "Skrivning till %s misslyckades: %s\n"
+
+#: ../src/main-utils.c:106
+#, c-format
+msgid "Closing %s failed: %s\n"
+msgstr "Stängning av %s misslyckades: %s\n"
+
+#: ../src/main-utils.c:162
+#, c-format
+msgid "%s is already running (pid %ld)\n"
+msgstr "%s är redan igång (pid %ld)\n"
+
+#: ../src/main-utils.c:205
+#, c-format
+msgid "You must be root to run %s!\n"
+msgstr "Du måste vara root för att köra %s!\n"
+
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:205
msgid "# Created by NetworkManager\n"
msgstr "# Skapad av Nätverkshanteraren\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:158
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:212
#, c-format
msgid ""
"# Merged from %s\n"
@@ -7524,89 +7647,75 @@ msgstr ""
"# Sammanfogad från %s\n"
"\n"
-#: ../src/dhcp-manager/nm-dhcp-manager.c:291
+#: ../src/dhcp-manager/nm-dhcp-manager.c:130
+#, c-format
+msgid "'%s' support not found or not enabled."
+msgstr "stöd för â€%s†kunde inte hittas eller var inaktiverat."
+
+#: ../src/dhcp-manager/nm-dhcp-manager.c:177
msgid "no usable DHCP client could be found."
msgstr "ingen användbar DHCP-klient hittades."
-#: ../src/dhcp-manager/nm-dhcp-manager.c:300
-msgid "'dhclient' could not be found or was disabled."
-msgstr "â€dhclient†kunde inte hittas eller var inaktiverad."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:310
-msgid "'dhcpcd' could not be found or was disabled."
-msgstr "â€dhcpcd†kunde inte hittas eller var inaktiverad."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:318
-#, c-format
-msgid "unsupported DHCP client '%s'"
-msgstr "DHCP-klienten â€%s†stöds inte"
-
-#: ../src/dns-manager/nm-dns-manager.c:374
+#: ../src/dns-manager/nm-dns-manager.c:361
msgid "NOTE: the libc resolver may not support more than 3 nameservers."
-msgstr ""
-"OBSERVERA: uppslag via glibc kanske inte har stöd för fler än 3 namnservrar."
+msgstr "OBSERVERA: uppslag via glibc kanske inte har stöd för fler än 3 namnservrar."
-#: ../src/dns-manager/nm-dns-manager.c:376
+#: ../src/dns-manager/nm-dns-manager.c:363
msgid "The nameservers listed below may not be recognized."
msgstr "Namnservrarna listade nedan kanske inte kommer att kännas igen."
-#: ../src/devices/adsl/nm-device-adsl.c:127
+#: ../src/devices/adsl/nm-device-adsl.c:129
msgid "ADSL connection"
msgstr "ADSL-anslutning"
-#: ../src/devices/bluetooth/nm-bluez-device.c:195
+#: ../src/devices/bluetooth/nm-bluez-device.c:200
#, c-format
msgid "%s Network"
msgstr "%s Nätverk"
-#: ../src/devices/bluetooth/nm-device-bt.c:248
+#: ../src/devices/bluetooth/nm-device-bt.c:254
msgid "PAN requested, but Bluetooth device does not support NAP"
msgstr "PAN begärd, men Bluetooth-enheten stöder inte NAP"
-#: ../src/devices/bluetooth/nm-device-bt.c:258
+#: ../src/devices/bluetooth/nm-device-bt.c:264
msgid "PAN connections cannot specify GSM, CDMA, or serial settings"
-msgstr ""
-"PAN-anslutningar kan inte specifiera GSM, CDMA eller seriella inställningar"
+msgstr "PAN-anslutningar kan inte specificera GSM, CDMA eller seriella inställningar"
-#: ../src/devices/bluetooth/nm-device-bt.c:271
+#: ../src/devices/bluetooth/nm-device-bt.c:277
msgid "PAN connection"
msgstr "PAN-anslutning"
-#: ../src/devices/bluetooth/nm-device-bt.c:278
+#: ../src/devices/bluetooth/nm-device-bt.c:284
msgid "DUN requested, but Bluetooth device does not support DUN"
msgstr "DUN begärd, men Bluetooth-enheten stödjer inte DUN"
-#: ../src/devices/bluetooth/nm-device-bt.c:288
+#: ../src/devices/bluetooth/nm-device-bt.c:294
msgid "DUN connection must include a GSM or CDMA setting"
msgstr "DUN-anslutning måste innehålla en GSM eller CDMA-inställningar"
-#: ../src/devices/bluetooth/nm-device-bt.c:298
-#: ../src/devices/wwan/nm-modem-broadband.c:484
+#: ../src/devices/bluetooth/nm-device-bt.c:304
+#: ../src/devices/wwan/nm-modem-broadband.c:488
msgid "GSM connection"
msgstr "GSM-anslutning"
-#: ../src/devices/bluetooth/nm-device-bt.c:302
-#: ../src/devices/wwan/nm-modem-broadband.c:507
+#: ../src/devices/bluetooth/nm-device-bt.c:308
+#: ../src/devices/wwan/nm-modem-broadband.c:511
msgid "CDMA connection"
msgstr "CDMA-anslutning"
-#: ../src/devices/bluetooth/nm-device-bt.c:306
-msgid "DUN connection"
-msgstr "DUN-anslutning"
-
-#: ../src/devices/bluetooth/nm-device-bt.c:311
+#: ../src/devices/bluetooth/nm-device-bt.c:316
msgid "Unknown/unhandled Bluetooth connection type"
msgstr "Okänd/ohanterad Bluetooth-anslutningstyp"
-#: ../src/devices/bluetooth/nm-device-bt.c:331
-#: ../src/devices/nm-device-ethernet.c:1443
+#: ../src/devices/bluetooth/nm-device-bt.c:336
+#: ../src/devices/nm-device-ethernet.c:1442
#: ../src/devices/nm-device-infiniband.c:196
-#: ../src/devices/wifi/nm-device-wifi.c:1130
-#: ../src/devices/wimax/nm-device-wimax.c:445
+#: ../src/devices/wifi/nm-device-wifi.c:1124
+#: ../src/devices/wimax/nm-device-wimax.c:450
msgid "connection does not match device"
msgstr "anslutning matchar inte enhet"
-#: ../src/devices/nm-device-bond.c:124
+#: ../src/devices/nm-device-bond.c:125
msgid "Bond connection"
msgstr "Kombinationsanslutning"
@@ -7614,15 +7723,15 @@ msgstr "Kombinationsanslutning"
msgid "Bridge connection"
msgstr "Brygganslutning"
-#: ../src/devices/nm-device-ethernet.c:1426
+#: ../src/devices/nm-device-ethernet.c:1425
msgid "PPPoE connection"
msgstr "PPPoE-anslutning"
-#: ../src/devices/nm-device-ethernet.c:1426
+#: ../src/devices/nm-device-ethernet.c:1425
msgid "Wired connection"
msgstr "Trådbunden anslutning"
-#: ../src/devices/nm-device-ethernet-utils.c:38
+#: ../src/devices/nm-device-ethernet-utils.c:40
#, c-format
msgid "Wired connection %d"
msgstr "Trådbunden anslutning %d"
@@ -7631,257 +7740,334 @@ msgstr "Trådbunden anslutning %d"
msgid "InfiniBand connection"
msgstr "InfiniBand-anslutning"
-#: ../src/devices/nm-device-vlan.c:216
+#: ../src/devices/nm-device-vlan.c:218
msgid "VLAN connection"
msgstr "VLAN-anslutning"
-#: ../src/devices/team/nm-device-team.c:134
+#: ../src/devices/team/nm-device-team.c:131
msgid "Team connection"
msgstr "Gruppanslutning"
-#: ../src/devices/wifi/nm-device-olpc-mesh.c:150
+#: ../src/devices/wifi/nm-device-olpc-mesh.c:151
msgid "Mesh"
msgstr "Mesh"
-#: ../src/devices/wifi/nm-device-wifi.c:1099
+#: ../src/devices/wifi/nm-device-wifi.c:1094
msgid "WPA Ad-Hoc disabled due to kernel bugs"
msgstr "WPA Ad-Hoc inaktiverad på grund av kärnfel"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:43
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:44
#, c-format
msgid "%s is incompatible with static WEP keys"
msgstr "%s är inte kompatibel med statiska WEP-nycklar"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:77
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:78
msgid "LEAP authentication requires a LEAP username"
msgstr "LEAP-autentisering kräver ett LEAP-användarnamn"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:87
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:88
msgid "LEAP username requires 'leap' authentication"
msgstr "LEAP-användarnamn kräver â€leapâ€-autentisering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:100
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:101
msgid "LEAP authentication requires IEEE 802.1x key management"
msgstr "LEAP-autentisering kräver IEEE 802.1x-nyckelhantering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:120
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:121
msgid "LEAP authentication is incompatible with Ad-Hoc mode"
msgstr "LEAP-autentisering är inkompatibelt med Ad-Hoc-läge"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:132
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:133
msgid "LEAP authentication is incompatible with 802.1x setting"
msgstr "LEAP-autentisering är inkompatibelt med 802.1x-inställning"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:154
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:155
#, c-format
msgid "a connection using '%s' authentication cannot use WPA key management"
-msgstr ""
-"en anslutning som använder â€%sâ€-autentisering kan inte använda WPA-"
-"nyckelhantering"
+msgstr "en anslutning som använder â€%sâ€-autentisering kan inte använda WPA-nyckelhantering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:165
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:166
#, c-format
msgid "a connection using '%s' authentication cannot specific WPA protocols"
-msgstr ""
-"en anslutning som använder â€%sâ€-autentisering kan inte specificera WPA-"
-"protokoll"
+msgstr "en anslutning som använder â€%sâ€-autentisering kan inte specificera WPA-protokoll"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:181
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:198
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:182
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:199
#, c-format
msgid "a connection using '%s' authentication cannot specific WPA ciphers"
-msgstr ""
-"en anslutning som använder â€%sâ€-autentisering kan inte specificera WPA-"
-"chiffer"
+msgstr "en anslutning som använder â€%sâ€-autentisering kan inte specificera WPA-chiffer"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:210
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:211
#, c-format
msgid "a connection using '%s' authentication cannot specific a WPA password"
-msgstr ""
-"en anslutning som använder â€%sâ€-autentisering kan inte specificera ett WPA-"
-"lösenord"
+msgstr "en anslutning som använder â€%sâ€-autentisering kan inte specificera ett WPA-lösenord"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:241
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:242
msgid "Dynamic WEP requires an 802.1x setting"
msgstr "Dynamisk WEP kräver en 802.1x-inställning"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:251
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:279
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:252
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:280
msgid "Dynamic WEP requires 'open' authentication"
msgstr "Dynamisk WEP kräver â€openâ€-autentisering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:266
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:267
msgid "Dynamic WEP requires 'ieee8021x' key management"
msgstr "Dynamisk WEP kräver â€ieee8021xâ€-nyckelhantering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:313
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:314
msgid "WPA-PSK authentication is incompatible with 802.1x"
msgstr "WPA-PSK-autentisering är inkompatibelt med 802.1x"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:323
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:324
msgid "WPA-PSK requires 'open' authentication"
msgstr "WPA-PSK kräver â€openâ€-autentisering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:335
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:336
msgid "WPA Ad-Hoc authentication requires an Ad-Hoc mode AP"
msgstr "WPA Ad-Hoc-autentisering kräver en Ad-Hoc-läges-AP"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:348
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:349
msgid "WPA Ad-Hoc authentication requires 'wpa' protocol"
msgstr "WPA Ad-Hoc-autentisering kräver â€wpaâ€-protokoll"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:360
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:361
msgid "WPA Ad-Hoc authentication requires 'none' pairwise cipher"
msgstr "WPA Ad-Hoc-autentisering kräver parvisa chiffret â€noneâ€"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:372
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:373
msgid "WPA Ad-Hoc requires 'tkip' group cipher"
msgstr "WPA Ad-Hoc kräver â€tkipâ€-gruppchiffer"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:386
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:387
msgid "Access point does not support PSK but setting requires it"
msgstr "Accesspunkten stöder inte PSK men inställningen kräver det"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:416
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:417
msgid "WPA-EAP authentication requires an 802.1x setting"
msgstr "WPA-EAP-autentisering kräver en 802.1x-inställning"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:426
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:427
msgid "WPA-EAP requires 'open' authentication"
msgstr "WPA-EAP kräver â€openâ€-autentisering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:437
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:438
msgid "802.1x setting requires 'wpa-eap' key management"
msgstr "802.1x-inställning kräver â€wpa-eapâ€-nyckelhantering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:450
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:451
msgid "Access point does not support 802.1x but setting requires it"
msgstr "Accesspunktsläget stödjer inte 802.1x men inställningen kräver det"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:478
-msgid ""
-"Access point mode is Ad-Hoc but setting requires Infrastructure security"
-msgstr ""
-"Accesspunktsläget är Ad-Hoc men inställningen kräver infrastrukturssäkerhet"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:479
+msgid "Access point mode is Ad-Hoc but setting requires Infrastructure security"
+msgstr "Accesspunktsläget är Ad-Hoc men inställningen kräver infrastrukturssäkerhet"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:488
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:489
msgid "Ad-Hoc mode is incompatible with 802.1x security"
msgstr "Ad-Hoc-läge är inkompatibelt med 802.1x-säkerhet"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:497
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:498
msgid "Ad-Hoc mode is incompatible with LEAP security"
msgstr "Ad-Hoc-läge är inkompatibelt med LEAP-säkerhet"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:507
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:508
msgid "Ad-Hoc mode requires 'open' authentication"
msgstr "Ad-Hoc-läge kräver â€openâ€-autentisering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:517
-msgid ""
-"Access point mode is Infrastructure but setting requires Ad-Hoc security"
-msgstr ""
-"Accesspunktsläge är infrastruktur men inställning kräver Ad-Hoc-säkerhet"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:518
+msgid "Access point mode is Infrastructure but setting requires Ad-Hoc security"
+msgstr "Accesspunktsläge är infrastruktur men inställning kräver Ad-Hoc-säkerhet"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:559
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:589
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:560
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:590
#, c-format
msgid "connection does not match access point"
msgstr "anslutningen matchar inte med accesspunkten"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:613
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:614
msgid "Access point is unencrypted but setting specifies security"
msgstr "Accespunkt är okrypterad men inställning specificerar säkerhet"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:702
-msgid ""
-"WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic "
-"WEP"
-msgstr ""
-"WPA-autentisering är inkompatibel med icke-EAP (original) LEAP eller "
-"dynamisk WEP"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:703
+msgid "WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic WEP"
+msgstr "WPA-autentisering är inkompatibel med icke-EAP (original) LEAP eller dynamisk WEP"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:712
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:713
msgid "WPA authentication is incompatible with Shared Key authentication"
msgstr "WPA-autentisering är inkompatibelt med delad nyckelautentisering"
-#: ../src/devices/wifi/nm-wifi-ap-utils.c:759
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:760
msgid "Failed to determine AP security information"
msgstr "Misslyckades med att bestämma AP-säkerhetsinformation"
-#: ../src/devices/wwan/nm-modem-broadband.c:471
+#: ../src/devices/wwan/nm-modem-broadband.c:475
msgid "GSM mobile broadband connection requires a 'gsm' setting"
msgstr "GSM-mobil bredbandsanslutning kräver en â€gsmâ€-inställning"
-#: ../src/nm-config.c:352
+#: ../src/nm-config.c:412
msgid "Config file location"
msgstr "Plats för konfigurationsfil"
-#: ../src/nm-config.c:352
+#: ../src/nm-config.c:412
msgid "/path/to/config.file"
msgstr "/sökväg/till/konfigurations.fil"
-#: ../src/nm-config.c:353
+#: ../src/nm-config.c:413
msgid "Config directory location"
msgstr "Plats för konfigurationskatalog"
-#: ../src/nm-config.c:353
+#: ../src/nm-config.c:413
msgid "/path/to/config/dir"
msgstr "/sökväg/till/konfiguration/katalog"
-#: ../src/nm-config.c:355
+#: ../src/nm-config.c:415
msgid "List of plugins separated by ','"
msgstr "Lista över insticksmoduler separerade med â€,â€"
-#: ../src/nm-config.c:355
+#: ../src/nm-config.c:415
msgid "plugin1,plugin2"
msgstr "insticksmodul1,insticksmodul2"
+#: ../src/nm-config.c:416
+#| msgid "Current nmcli configuration:\n"
+msgid "Quit after initial configuration"
+msgstr "Avsluta efter initial konfiguration"
+
#. These three are hidden for now, and should eventually just go away.
-#: ../src/nm-config.c:358
+#: ../src/nm-config.c:419
msgid "An http(s) address for checking internet connectivity"
msgstr "En http(s)-adress för att kontrollera internetanslutning"
-#: ../src/nm-config.c:359
+#: ../src/nm-config.c:420
msgid "The interval between connectivity checks (in seconds)"
msgstr "Intervallet mellan anslutningskontroller (i sekunder)"
-#: ../src/nm-config.c:360
+#: ../src/nm-config.c:421
msgid "The expected start of the response"
msgstr "Den förväntade starten på svaret"
-#: ../src/nm-config.c:360
+#: ../src/nm-config.c:421
msgid "Bingo!"
msgstr "Bingo!"
-#: ../src/nm-logging.c:149
+#. Interface/IP config
+#: ../src/nm-iface-helper.c:286
+msgid "The interface to manage"
+msgstr "Gränssnittet att hantera"
+
+#: ../src/nm-iface-helper.c:286
+msgid "eth0"
+msgstr "eth0"
+
+#: ../src/nm-iface-helper.c:287
+msgid "Connection UUID"
+msgstr "UUID för anslutning"
+
+#: ../src/nm-iface-helper.c:287
+msgid "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
+msgstr "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
+
+#: ../src/nm-iface-helper.c:288
+msgid "Whether to manage IPv6 SLAAC"
+msgstr "Huruvida IPv6 SLAAC ska hanteras"
+
+#: ../src/nm-iface-helper.c:289
+msgid "Whether SLAAC must be successful"
+msgstr "Huruvida SLAAC måste lyckas"
+
+#: ../src/nm-iface-helper.c:290
+msgid "Use an IPv6 temporary privacy address"
+msgstr "Använd en temporär IPv6-adress för sekretess"
+
+#: ../src/nm-iface-helper.c:291
+msgid "Current DHCPv4 address"
+msgstr "Aktuell DCHPv4-adress"
+
+#: ../src/nm-iface-helper.c:292
+msgid "Whether DHCPv4 must be successful"
+msgstr "Huruvida DHCPv4 måste lyckas"
+
+#: ../src/nm-iface-helper.c:293
+msgid "Hex-encoded DHCPv4 client ID"
+msgstr "Hexkodat DHCPv4 klient-ID"
+
+#: ../src/nm-iface-helper.c:294
+msgid "Hostname to send to DHCP server"
+msgstr "Värdnamn att skicka till DHCP-server"
+
+#: ../src/nm-iface-helper.c:294
+msgid "barbar"
+msgstr "barbar"
+
+#: ../src/nm-iface-helper.c:295
+msgid "Route priority for IPv4"
+msgstr "Ruttprioritet för IPv4"
+
+#: ../src/nm-iface-helper.c:295
+msgid "0"
+msgstr "0"
+
+#: ../src/nm-iface-helper.c:296
+msgid "Route priority for IPv6"
+msgstr "Ruttprioritet för IPv6"
+
+#: ../src/nm-iface-helper.c:296
+msgid "1024"
+msgstr "1024"
+
+#: ../src/nm-iface-helper.c:297
+msgid "Hex-encoded Interface Identifier"
+msgstr "Hexkodad gränssnittsidentifierare"
+
+#: ../src/nm-iface-helper.c:319
+msgid "nm-iface-helper is a small, standalone process that manages a single network interface."
+msgstr "nm-iface-helper är en liten fristående process som hanterar ett nätverksgränssnitt."
+
+#: ../src/nm-iface-helper.c:328
+#, c-format
+msgid "An interface name and UUID are required\n"
+msgstr "Kräver ett gränssnittsnamn och UUID\n"
+
+#: ../src/nm-iface-helper.c:393
+#, c-format
+msgid "Failed to find interface index for %s\n"
+msgstr "Misslyckades med att hitta gränssnittsindex för â€%sâ€\n"
+
+#: ../src/nm-iface-helper.c:409
+#, c-format
+msgid "(%s): Invalid IID %s\n"
+msgstr "(%s): Ogiltig IID %s\n"
+
+#: ../src/nm-logging.c:140
#, c-format
msgid "Unknown log level '%s'"
msgstr "Okänd loggnivÃ¥ â€%sâ€"
-#: ../src/nm-logging.c:231
+#: ../src/nm-logging.c:222
#, c-format
msgid "Unknown log domain '%s'"
msgstr "Okänd loggdomän â€%sâ€"
-#: ../src/nm-manager.c:3363
+#: ../src/nm-manager.c:3434
msgid "VPN connection"
msgstr "VPN-anslutning"
-#: ../src/nm-sleep-monitor-systemd.c:114
+#: ../src/nm-sleep-monitor-systemd.c:115
msgid "NetworkManager needs to turn off networks"
msgstr "Nätverkshanteraren behöver stänga av nätverk"
-#: ../src/settings/plugins/ibft/plugin.c:65
+#: ../src/settings/plugins/ibft/plugin.c:66
#, c-format
msgid "ibft: failed to read iscsiadm records: %s"
msgstr "ibft: misslyckades med att läsa iscsiadm-poster: %s"
-#: ../src/settings/plugins/ibft/plugin.c:73
+#: ../src/settings/plugins/ibft/plugin.c:74
#, c-format
msgid "ibft: read connection '%s'"
msgstr "ibft: läste anslutning â€%sâ€"
-#: ../src/settings/plugins/ibft/plugin.c:79
+#: ../src/settings/plugins/ibft/plugin.c:80
#, c-format
msgid "ibft: failed to read iscsiadm record: %s"
msgstr "ibft: misslyckades med att läsa iscsiadm-post: %s"
@@ -7889,3 +8075,4 @@ msgstr "ibft: misslyckades med att läsa iscsiadm-post: %s"
#: ../src/settings/plugins/ifcfg-rh/reader.c:112
msgid "System"
msgstr "System"
+
diff --git a/po/ta.po b/po/ta.po
index e1a471329e..9deb92f7fe 100644
--- a/po/ta.po
+++ b/po/ta.po
@@ -3,6 +3,7 @@
# Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER
# This file is distributed under the same license as the NetworkManager package.
#
+#: ../src/nm-iface-helper.c:307
# Felix I <ifelix25@gmail.com>, 2009.
# I. Felix <ifelix@redhat.com>, 2009, 2010.
# I Felix <ifelix@redhat.com>, 2010.
@@ -12,8 +13,8 @@ msgstr ""
"Project-Id-Version: NetworkManager.po.master.ta\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=NetworkManager&keywords=I18N+L10N&component=Translations\n"
-"POT-Creation-Date: 2014-09-26 10:21+0000\n"
-"PO-Revision-Date: 2014-09-26 15:58+0630\n"
+"POT-Creation-Date: 2014-12-16 11:18+0000\n"
+"PO-Revision-Date: 2014-12-19 16:04+0630\n"
"Last-Translator: Shantha kumar <shkumar@redhat.com>\n"
"Language-Team: Tamil <kde-i18n-doc@kde.org>\n"
"Language: ta\n"
@@ -24,85 +25,163 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n!=1);\\n"
"\n"
-#: ../clients/cli/common.c:38 ../clients/cli/common.c:50
-#: ../clients/cli/common.c:58 ../clients/cli/common.c:69
-#: ../clients/cli/connections.c:169 ../clients/cli/connections.c:191
+#: ../clients/cli/agent.c:42
+#, c-format
+msgid ""
+"Usage: nmcli agent { COMMAND | help }\n"
+"\n"
+"COMMAND := { secret | polkit | all }\n"
+"\n"
+msgstr ""
+"பயனà¯à®ªà®¾à®Ÿà¯: nmcli agent { COMMAND | help }\n"
+"\n"
+"கடà¯à®Ÿà®³à¯ˆ := { secret | polkit | all }\n"
+"\n"
+
+#: ../clients/cli/agent.c:50
+#, c-format
+msgid ""
+"Usage: nmcli agent secret { help }\n"
+"\n"
+"Runs nmcli as NetworkManager secret agent. When NetworkManager requires\n"
+"a password it asks registered agents for it. This command keeps nmcli "
+"running\n"
+"and if a password is required asks the user for it.\n"
+"\n"
+msgstr ""
+"பயனà¯à®ªà®¾à®Ÿà¯: nmcli agent secret { help }\n"
+"\n"
+"nmcli à® NetworkManager ரகசிய à®®à¯à®•à®µà®°à®¾à®• இயஙà¯à®•à¯. NetworkManager கà¯à®•à¯ கடவà¯à®šà¯à®šà¯Šà®²à¯ "
+"தேவைபà¯à®ªà®Ÿà¯à®®à¯ போதà¯\n"
+"பதிவà¯à®ªà¯†à®±à¯à®± à®®à¯à®•à®µà®°à¯à®•à®³à®¿à®Ÿà®®à¯ அத௠கடவà¯à®šà¯à®šà¯Šà®²à¯à®²à¯ˆà®•à¯ கேடà¯à®•à¯à®®à¯. இநà¯à®¤à®•à¯ கடà¯à®Ÿà®³à¯ˆ nmcli "
+"தொடரà¯à®¨à¯à®¤à¯ இயஙà¯à®•à¯à®®à¯à®ªà®Ÿà®¿ செயà¯à®¯à¯à®®à¯\n"
+"மேலà¯à®®à¯ கடவà¯à®šà¯à®šà¯Šà®²à¯ தேவைபà¯à®ªà®Ÿà¯à®Ÿà®¾à®²à¯, பயனரைக௠கேடà¯à®•à¯à®®à¯.\n"
+"\n"
+
+#: ../clients/cli/agent.c:60
+#, c-format
+msgid ""
+"Usage: nmcli agent polkit { help }\n"
+"\n"
+"Registers nmcli as a polkit action for the user session.\n"
+"When a polkit daemon requires an authorization, nmcli asks the user and "
+"gives\n"
+"the response back to polkit.\n"
+"\n"
+msgstr ""
+"பயனà¯à®ªà®¾à®Ÿà¯: nmcli agent polkit { help }\n"
+"\n"
+"பயனர௠அமரà¯à®µà¯à®•à¯à®•à®¾à®© polkit செயலாக nmcli à®à®ªà¯ பதிவ௠செயà¯à®•à®¿à®±à®¤à¯.\n"
+"ஒர௠polkit டீமானà¯à®•à¯à®•à¯ à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ தேவைபà¯à®ªà®Ÿà¯à®Ÿà®¾à®²à¯, nmcli பயனரிடம௠கேடà¯à®Ÿà¯,"
+"பதிலை\n"
+"polkit கà¯à®•à¯à®•à¯ கொடà¯à®•à¯à®•à®¿à®±à®¤à¯.\n"
+"\n"
+
+#: ../clients/cli/agent.c:70
+#, c-format
+msgid ""
+"Usage: nmcli agent all { help }\n"
+"\n"
+"Runs nmcli as both NetworkManager secret and a polkit agent.\n"
+"\n"
+msgstr ""
+"பயனà¯à®ªà®¾à®Ÿà¯: nmcli agent all { help }\n"
+"\n"
+"nmcli à® NetworkManager ரகசிய à®®à¯à®•à®µà®°à®¾à®•à®µà¯à®®à¯ polkit à®®à¯à®•à®µà®°à®¾à®•à®µà¯à®®à¯ இயகà¯à®•à¯à®•à®¿à®±à®¤à¯.\n"
+"\n"
+
+#: ../clients/cli/agent.c:152
+#, c-format
+msgid "nmcli successfully registered as a NetworkManager's secret agent.\n"
+msgstr ""
+"nmcli வெறà¯à®±à®¿à®•à®°à®®à®¾à®• NetworkManager -இன௠ரகசிய à®®à¯à®•à®µà®°à®¾à®•à®ªà¯ பதிவ௠செயà¯à®¯à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
+
+#: ../clients/cli/agent.c:154
+#, c-format
+#| msgid "Modem initialization failed"
+msgid "Error: secret agent initialization failed"
+msgstr "பிழை: ரகசிய à®®à¯à®•à®µà®°à¯ தà¯à®µà®•à¯à®•à®®à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯"
+
+#: ../clients/cli/agent.c:169
+#, c-format
+#| msgid "Error: Connection activation failed: %s"
+msgid "Error: polkit agent initialization failed: %s"
+msgstr "பிழை: polkit à®®à¯à®•à®µà®°à¯ தà¯à®µà®•à¯à®•à®®à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s"
+
+#: ../clients/cli/agent.c:177
+#, c-format
+msgid "nmcli successfully registered as a polkit agent.\n"
+msgstr "nmcli வெறà¯à®±à®¿à®•à®°à®®à®¾à®• polkit à®®à¯à®•à®µà®°à®¾à®•à®ªà¯ பதிவ௠செயà¯à®¯à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
+
+#: ../clients/cli/agent.c:209 ../clients/cli/connections.c:8779
+#: ../clients/cli/connections.c:8805 ../clients/cli/connections.c:8943
+#: ../clients/cli/devices.c:2832 ../clients/cli/general.c:325
+#: ../clients/cli/general.c:463
+#, c-format
+msgid "Error: NetworkManager is not running."
+msgstr "பிழை: NetworkManager இயஙà¯à®•à®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../clients/cli/agent.c:245
+#, c-format
+#| msgid "Error: 'general' command '%s' is not valid."
+msgid "Error: 'agent' command '%s' is not valid."
+msgstr "பிழை: 'agent' கடà¯à®Ÿà®³à¯ˆ '%s' சரியலà¯à®²."
+
+#: ../clients/cli/common.c:40 ../clients/cli/common.c:53
+#: ../clients/cli/common.c:61 ../clients/cli/common.c:73
+#: ../clients/cli/connections.c:172 ../clients/cli/connections.c:194
msgid "GROUP"
msgstr "GROUP"
#. 0
-#: ../clients/cli/common.c:39 ../clients/cli/common.c:59
+#: ../clients/cli/common.c:41 ../clients/cli/common.c:62
msgid "ADDRESS"
msgstr "ADDRESS"
#. 1
-#: ../clients/cli/common.c:40 ../clients/cli/common.c:60
+#. 2
+#: ../clients/cli/common.c:42 ../clients/cli/common.c:63
+#: ../clients/cli/connections.c:197
+msgid "GATEWAY"
+msgstr "கேடà¯à®µà¯‡"
+
+#. 2
+#: ../clients/cli/common.c:43 ../clients/cli/common.c:64
msgid "ROUTE"
msgstr "ROUTE"
-#. 2
-#: ../clients/cli/common.c:41 ../clients/cli/common.c:61
+#. 3
+#: ../clients/cli/common.c:44 ../clients/cli/common.c:65
msgid "DNS"
msgstr "DNS"
-#. 3
-#: ../clients/cli/common.c:42 ../clients/cli/common.c:62
+#. 4
+#: ../clients/cli/common.c:45 ../clients/cli/common.c:66
msgid "DOMAIN"
msgstr "DOMAIN"
-#. 4
-#: ../clients/cli/common.c:43
+#. 5
+#: ../clients/cli/common.c:46
msgid "WINS"
msgstr "WINS"
#. 0
-#: ../clients/cli/common.c:51 ../clients/cli/common.c:70
+#: ../clients/cli/common.c:54 ../clients/cli/common.c:74
msgid "OPTION"
msgstr "OPTION"
-#: ../clients/cli/common.c:377 ../clients/cli/settings.c:3049
-#: ../clients/cli/settings.c:3068
-#, c-format
-msgid "invalid IPv4 address '%s'"
-msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ IPv4 à®®à¯à®•à®µà®°à®¿ '%s'"
-
-#: ../clients/cli/common.c:385
-#, c-format
-msgid "invalid prefix '%s'; <1-32> allowed"
-msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ '%s' ; <1-32> அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯"
-
-#: ../clients/cli/common.c:392 ../clients/cli/common.c:445
-#, c-format
-msgid "invalid gateway '%s'"
-msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ கேடà¯à®µà¯‡: '%s'"
-
-#: ../clients/cli/common.c:430 ../clients/cli/settings.c:3395
-#: ../clients/cli/settings.c:3414
-#, c-format
-msgid "invalid IPv6 address '%s'"
-msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ IPv6 à®®à¯à®•à®µà®°à®¿ '%s'"
-
-#: ../clients/cli/common.c:438
-#, c-format
-msgid "invalid prefix '%s'; <1-128> allowed"
-msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ '%s'; <1-128> அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯"
-
-#: ../clients/cli/common.c:521
-#, c-format
-msgid "invalid route destination address '%s'"
-msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ தட இலகà¯à®•à¯ à®®à¯à®•à®µà®°à®¿ '%s'"
-
-#: ../clients/cli/common.c:528
+#: ../clients/cli/common.c:378 ../clients/cli/common.c:438
#, c-format
msgid "invalid prefix '%s'; <1-%d> allowed"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ '%s'; <1-%d> அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯"
-#: ../clients/cli/common.c:538
+#: ../clients/cli/common.c:386
#, c-format
-msgid "invalid next hop address '%s'"
-msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ hop à®®à¯à®•à®µà®°à®¿ '%s'"
+#| msgid "invalid IPv4 address '%s'"
+msgid "invalid IP address: %s"
+msgstr "தவறான IP à®®à¯à®•à®µà®°à®¿: %s"
-#: ../clients/cli/common.c:543
+#: ../clients/cli/common.c:450
#, c-format
msgid ""
"the second component of route ('%s') is neither a next hop address nor a "
@@ -110,391 +189,406 @@ msgid ""
msgstr ""
"தடதà¯à®¤à®¿à®©à¯ இரணà¯à®Ÿà®¾à®µà®¤à¯ கூறானத௠('%s') அடà¯à®¤à¯à®¤ ஹாப௠மà¯à®•à®µà®°à®¿à®¯à¯à®®à®²à¯à®² ஒர௠மெடà¯à®°à®¿à®•à¯à®•à¯à®®à®²à¯à®²"
-#: ../clients/cli/common.c:553
+#: ../clients/cli/common.c:459
#, c-format
msgid "invalid metric '%s'"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ மெடà¯à®°à®¿à®•à¯ '%s'"
-#: ../clients/cli/common.c:562
+#: ../clients/cli/common.c:467
+#, c-format
+#| msgid "invalid IPv4 route '%s'"
+msgid "invalid route: %s"
+msgstr "தவறான தடமà¯: %s"
+
+#: ../clients/cli/common.c:479
msgid "default route cannot be added (NetworkManager handles it by itself)"
msgstr ""
"à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯à®¤à¯ தடதà¯à®¤à¯ˆà®šà¯ சேரà¯à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯ (NetworkManager அதைத௠தானே கையாளà¯à®®à¯)"
-#: ../clients/cli/common.c:650
+#: ../clients/cli/common.c:496
msgid "unmanaged"
msgstr "பராமரிகà¯à®•à®ªà¯à®ªà®Ÿà®¾à®¤"
-#: ../clients/cli/common.c:652
+#: ../clients/cli/common.c:498
msgid "unavailable"
msgstr "கிடைகà¯à®•à®ªà¯à®ªà¯†à®±à®¾à®¤"
-#: ../clients/cli/common.c:654 ../clients/cli/network-manager.c:274
+#: ../clients/cli/common.c:500 ../clients/cli/general.c:260
msgid "disconnected"
msgstr "தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:656
+#: ../clients/cli/common.c:502
msgid "connecting (prepare)"
msgstr "இணைகà¯à®•à®¿à®±à®¤à¯ (தயாராகà¯à®•à¯)"
-#: ../clients/cli/common.c:658
+#: ../clients/cli/common.c:504
msgid "connecting (configuring)"
msgstr "இணைகà¯à®•à®¿à®±à®¤à¯ (கடà¯à®Ÿà®®à¯ˆà®•à¯à®•à®¿à®±à®¤à¯)"
-#: ../clients/cli/common.c:660
+#: ../clients/cli/common.c:506
msgid "connecting (need authentication)"
msgstr "இணைகà¯à®•à®¿à®±à®¤à¯ (à®…à®™à¯à®•à¯€à®•à®¾à®°à®®à¯ தேவை)"
-#: ../clients/cli/common.c:662
+#: ../clients/cli/common.c:508
msgid "connecting (getting IP configuration)"
msgstr "இணைகà¯à®•à®¿à®±à®¤à¯ (IP கடà¯à®Ÿà®®à¯ˆà®ªà¯à®ªà¯ˆ பெறà¯à®•à®¿à®±à®¤à¯)"
-#: ../clients/cli/common.c:664
+#: ../clients/cli/common.c:510
msgid "connecting (checking IP connectivity)"
msgstr "இணைகà¯à®•à®¿à®±à®¤à¯ (IP இணைபà¯à®ªà¯ˆ சோதிகà¯à®•à®¿à®±à®¤à¯)"
-#: ../clients/cli/common.c:666
+#: ../clients/cli/common.c:512
msgid "connecting (starting secondary connections)"
msgstr "இணைகà¯à®•à®¿à®±à®¤à¯ (இரணà¯à®Ÿà®¾à®®à¯ நிலை இணைபà¯à®ªà¯à®•à®³à¯ˆà®¤à¯ தொடஙà¯à®•à¯à®•à®¿à®±à®¤à¯)"
-#: ../clients/cli/common.c:668 ../clients/cli/network-manager.c:270
+#: ../clients/cli/common.c:514 ../clients/cli/general.c:256
msgid "connected"
msgstr "இணைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:670 ../clients/cli/connections.c:542
+#: ../clients/cli/common.c:516 ../clients/cli/connections.c:538
msgid "deactivating"
msgstr "à®®à¯à®Ÿà®•à¯à®•à¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/common.c:672
+#: ../clients/cli/common.c:518
msgid "connection failed"
msgstr "இணைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:674 ../clients/cli/connections.c:547
-#: ../clients/cli/connections.c:570 ../clients/cli/connections.c:1631
-#: ../clients/cli/devices.c:906 ../clients/cli/network-manager.c:277
-#: ../clients/cli/network-manager.c:295 ../clients/cli/network-manager.c:425
-#: ../clients/cli/network-manager.c:441 ../clients/cli/settings.c:703
-#: ../clients/cli/settings.c:765 ../clients/cli/settings.c:1057
-#: ../clients/cli/utils.c:1121 ../src/main.c:504 ../src/main.c:532
+#: ../clients/cli/common.c:520 ../clients/cli/connections.c:543
+#: ../clients/cli/connections.c:566 ../clients/cli/connections.c:1705
+#: ../clients/cli/devices.c:878 ../clients/cli/general.c:263
+#: ../clients/cli/general.c:281 ../clients/cli/general.c:411
+#: ../clients/cli/general.c:427 ../clients/cli/settings.c:717
+#: ../clients/cli/settings.c:779 ../clients/cli/settings.c:1072
+#: ../clients/cli/utils.c:1145 ../src/main.c:309 ../src/main.c:337
msgid "unknown"
msgstr "தெரியாத"
-#: ../clients/cli/common.c:683
+#: ../clients/cli/common.c:529
msgid "No reason given"
msgstr "காரணம௠கொடà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:686 ../clients/cli/connections.c:2399
+#: ../clients/cli/common.c:532 ../clients/cli/connections.c:2705
#, c-format
msgid "Unknown error"
msgstr "தெரியாத பிழை"
-#: ../clients/cli/common.c:689
+#: ../clients/cli/common.c:535
msgid "Device is now managed"
msgstr "சாதனம௠இபà¯à®ªà¯‹à®¤à¯ நிரà¯à®µà®•à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/common.c:692
+#: ../clients/cli/common.c:538
msgid "Device is now unmanaged"
msgstr "சாதனம௠இபà¯à®ªà¯‹à®¤à¯ நிரà¯à®µà®•à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:695
+#: ../clients/cli/common.c:541
msgid "The device could not be readied for configuration"
msgstr "அமைவாகà¯à®•à®®à¯ செயà¯à®µà®¤à®±à¯à®•à¯ சாதனதà¯à®¤à¯ˆ தயாரà¯à®šà¯†à®¯à¯à®¯ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:698
+#: ../clients/cli/common.c:544
msgid ""
"IP configuration could not be reserved (no available address, timeout, etc.)"
msgstr ""
"IP அமைவாகà¯à®•à®¤à¯à®¤à¯ˆ ஒதà¯à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ (à®®à¯à®•à®µà®°à®¿ கிடைகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ, காலாவதியாதல௠"
"போனà¯à®±à®µà¯ˆ)"
-#: ../clients/cli/common.c:701
+#: ../clients/cli/common.c:547
msgid "The IP configuration is no longer valid"
msgstr "IP அமைவாகà¯à®•à®®à¯ இபà¯à®ªà¯‹à®¤à¯ செலà¯à®²à®¾à®¤à¯"
-#: ../clients/cli/common.c:704
+#: ../clients/cli/common.c:550
msgid "Secrets were required, but not provided"
msgstr "ரகசியஙà¯à®•à®³à¯ தேவையாயிரà¯à®¨à¯à®¤à®©, ஆனால௠தரபà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:707
+#: ../clients/cli/common.c:553
msgid "802.1X supplicant disconnected"
msgstr "802.1x சபà¯à®³à®¿à®•à®©à¯à®Ÿà¯ தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:710
+#: ../clients/cli/common.c:556
msgid "802.1X supplicant configuration failed"
msgstr "802.1x சபà¯à®³à®¿à®•à®©à¯à®Ÿà¯ அமைவாகà¯à®•à®®à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:713
+#: ../clients/cli/common.c:559
msgid "802.1X supplicant failed"
msgstr "802.1x சபà¯à®³à®¿à®•à®©à¯à®Ÿà¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:716
+#: ../clients/cli/common.c:562
msgid "802.1X supplicant took too long to authenticate"
msgstr "802.1x சபà¯à®³à®¿à®•à®©à¯à®Ÿà¯ à®…à®™à¯à®•à¯€à®•à®¾à®°à®¤à¯à®¤à®¿à®±à¯à®•à¯ நீணà¯à®Ÿ நேரம௠எடà¯à®¤à¯à®¤à¯à®•à¯à®•à¯Šà®£à¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:719
+#: ../clients/cli/common.c:565
msgid "PPP service failed to start"
msgstr "பிபிபி சேவை தà¯à®µà®•à¯à®•à®®à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:722
+#: ../clients/cli/common.c:568
msgid "PPP service disconnected"
msgstr "பிபிபி சேவை தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:725
+#: ../clients/cli/common.c:571
msgid "PPP failed"
msgstr "பிபிபி தோலà¯à®µà®¿à®¯à¯à®±à¯à®±à®¤à¯"
-#: ../clients/cli/common.c:728
+#: ../clients/cli/common.c:574
msgid "DHCP client failed to start"
msgstr "டிஹெசà¯à®šà®¿à®ªà®¿ கிளையனà¯à®Ÿà¯ தà¯à®µà®•à¯à®•à®®à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:731
+#: ../clients/cli/common.c:577
msgid "DHCP client error"
msgstr "DHCP கிளையனà¯à®Ÿà¯ பிழை"
-#: ../clients/cli/common.c:734
+#: ../clients/cli/common.c:580
msgid "DHCP client failed"
msgstr "DHCP கிளையனà¯à®Ÿà¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:737
+#: ../clients/cli/common.c:583
msgid "Shared connection service failed to start"
msgstr "பகிரà¯à®¨à¯à®¤ இணைபà¯à®ªà¯ சேவை தà¯à®µà®•à¯à®•à®®à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:740
+#: ../clients/cli/common.c:586
msgid "Shared connection service failed"
msgstr "பகிரà¯à®¨à¯à®¤ இணைபà¯à®ªà¯ சேவை தோலà¯à®µà®¿à®¯à¯à®±à¯à®±à®¤à¯"
-#: ../clients/cli/common.c:743
+#: ../clients/cli/common.c:589
msgid "AutoIP service failed to start"
msgstr "AutoIP சேவையைத௠தொடஙà¯à®•à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:746
+#: ../clients/cli/common.c:592
msgid "AutoIP service error"
msgstr "AutoIP சேவை பிழை"
-#: ../clients/cli/common.c:749
+#: ../clients/cli/common.c:595
msgid "AutoIP service failed"
msgstr "AutoIP சேவை தொடஙà¯à®•à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:752
+#: ../clients/cli/common.c:598
msgid "The line is busy"
msgstr "தடம௠பயனà¯à®ªà®¾à®Ÿà¯à®Ÿà®¿à®²à¯ உளà¯à®³à®¤à¯"
-#: ../clients/cli/common.c:755
+#: ../clients/cli/common.c:601
msgid "No dial tone"
msgstr "டயல௠டோன௠இலà¯à®²à¯ˆ"
-#: ../clients/cli/common.c:758
+#: ../clients/cli/common.c:604
msgid "No carrier could be established"
msgstr "கேரியரை அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:761
+#: ../clients/cli/common.c:607
msgid "The dialing request timed out"
msgstr "டயல௠செயà¯à®¯à¯à®®à¯ நேரம௠கடநà¯à®¤à®¤à¯"
-#: ../clients/cli/common.c:764
+#: ../clients/cli/common.c:610
msgid "The dialing attempt failed"
msgstr "டயல௠செயà¯à®¯à¯à®®à¯ à®®à¯à®¯à®±à¯à®šà®¿ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:767
+#: ../clients/cli/common.c:613
msgid "Modem initialization failed"
msgstr "மோடதà¯à®¤à¯ˆà®¤à¯ தொடஙà¯à®•à¯à®¤à®²à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:770
+#: ../clients/cli/common.c:616
msgid "Failed to select the specified APN"
msgstr "கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®Ÿ à®à®ªà®¿à®Žà®©à¯ ஠தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®¤à¯à®¤à®²à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:773
+#: ../clients/cli/common.c:619
msgid "Not searching for networks"
msgstr "நெடà¯à®µà¯Šà®°à¯à®•à¯à®•à¯à®•à®³à¯ˆà®¤à¯ தேடவிலà¯à®²à¯ˆ"
-#: ../clients/cli/common.c:776
+#: ../clients/cli/common.c:622
msgid "Network registration denied"
msgstr "நெடà¯à®µà¯Šà®°à¯à®•à¯à®•à®¿à®²à¯ பதிவà¯à®šà¯†à®¯à¯à®¤à®²à¯ மறà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:779
+#: ../clients/cli/common.c:625
msgid "Network registration timed out"
msgstr "நெடà¯à®µà¯Šà®°à¯à®•à¯à®•à®¿à®²à¯ பதிவà¯à®šà¯†à®¯à¯à®¤à®²à¯ நேரம௠கடநà¯à®¤à®¤à¯"
-#: ../clients/cli/common.c:782
+#: ../clients/cli/common.c:628
msgid "Failed to register with the requested network"
msgstr "வேணà¯à®Ÿà®¿à®¯ நெடà¯à®µà¯Šà®°à¯à®•à¯à®•à®¿à®²à¯ பதிவà¯à®šà¯†à®¯à¯à®¤à®²à¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:785
+#: ../clients/cli/common.c:631
msgid "PIN check failed"
msgstr "PIN சோதனை தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:788
+#: ../clients/cli/common.c:634
msgid "Necessary firmware for the device may be missing"
msgstr "சாதனதà¯à®¤à®¿à®©à¯ தேவையான வரà¯à®¤à¯à®¤à®• மெனà¯à®ªà¯Šà®°à¯à®³à¯ இலà¯à®²à¯ˆ"
-#: ../clients/cli/common.c:791
+#: ../clients/cli/common.c:637
msgid "The device was removed"
msgstr "சாதனம௠நீகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:794
+#: ../clients/cli/common.c:640
msgid "NetworkManager went to sleep"
msgstr "NetworkManager உறஙà¯à®•à®¿à®µà®¿à®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:797
+#: ../clients/cli/common.c:643
msgid "The device's active connection disappeared"
msgstr "சாதனதà¯à®¤à®¿à®©à¯ செயலிலà¯à®³à¯à®³ இணைபà¯à®ªà¯ போயà¯à®µà®¿à®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:800
+#: ../clients/cli/common.c:646
msgid "Device disconnected by user or client"
msgstr "பயனர௠அலà¯à®²à®¤à¯ கிளையனà¯à®Ÿà¯ சாதனதà¯à®¤à¯ˆ இணைபà¯à®ªà¯ தà¯à®£à¯à®Ÿà®¿à®¤à¯à®¤à®¾à®°à¯"
-#: ../clients/cli/common.c:803
+#: ../clients/cli/common.c:649
msgid "Carrier/link changed"
msgstr "கேரியரà¯/இணைபà¯à®ªà¯ மாறிவிடà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:806
+#: ../clients/cli/common.c:652
msgid "The device's existing connection was assumed"
msgstr "சாதனதà¯à®¤à®¿à®©à¯ தறà¯à®ªà¯‹à®¤à¯à®³à¯à®³ இணைபà¯à®ªà¯ இரà¯à®ªà¯à®ªà®¤à®¾à®• கொளà¯à®³à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:809
+#: ../clients/cli/common.c:655
msgid "The supplicant is now available"
msgstr "சபà¯à®³à®¿à®•à®©à¯à®Ÿà¯ உளà¯à®³à®¤à¯"
-#: ../clients/cli/common.c:812
+#: ../clients/cli/common.c:658
msgid "The modem could not be found"
msgstr "மோடதà¯à®¤à¯ˆà®•à¯ கணà¯à®Ÿà®±à®¿à®¯ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:815
+#: ../clients/cli/common.c:661
msgid "The Bluetooth connection failed or timed out"
msgstr "Bluetooth இணைபà¯à®ªà¯ தோலà¯à®µà®¿ அலà¯à®²à®¤à¯ அதறà¯à®•à®¾à®© நேரம௠கடநà¯à®¤à¯à®µà®¿à®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/common.c:818
+#: ../clients/cli/common.c:664
msgid "GSM Modem's SIM card not inserted"
msgstr "GSM மோடதà¯à®¤à®¿à®©à¯ SIM காரà¯à®Ÿà¯ செரà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:821
+#: ../clients/cli/common.c:667
msgid "GSM Modem's SIM PIN required"
msgstr "GSM மோடதà¯à®¤à®¿à®©à¯ SIM PIN தேவை"
-#: ../clients/cli/common.c:824
+#: ../clients/cli/common.c:670
msgid "GSM Modem's SIM PUK required"
msgstr "GSM மோடதà¯à®¤à®¿à®©à¯ SIM PUK தேவை"
-#: ../clients/cli/common.c:827
+#: ../clients/cli/common.c:673
msgid "GSM Modem's SIM wrong"
msgstr "GSM மோடதà¯à®¤à®¿à®©à¯ SIM தவறà¯"
-#: ../clients/cli/common.c:830
+#: ../clients/cli/common.c:676
msgid "InfiniBand device does not support connected mode"
msgstr "இனà¯à®ªà®¿à®©à®¿à®ªà¯‡à®©à¯à®Ÿà¯ சாதனம௠இணைபà¯à®ªà¯ பாஙà¯à®•à¯ˆ ஆதரிகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:833
+#: ../clients/cli/common.c:679
msgid "A dependency of the connection failed"
msgstr "இணைபà¯à®ªà®¿à®©à¯ சாரà¯à®¨à®¿à®²à¯ˆ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:836
+#: ../clients/cli/common.c:682
msgid "A problem with the RFC 2684 Ethernet over ADSL bridge"
msgstr "RFC 2684 ஈதà¯à®¤à®°à¯à®©à¯†à®Ÿà¯ ஓவர௠ADSL பிரிடà¯à®œà®¿à®²à¯ சிகà¯à®•à®²à¯"
-#: ../clients/cli/common.c:839
+#: ../clients/cli/common.c:685
msgid "ModemManager is unavailable"
msgstr "ModemManager இலà¯à®²à¯ˆ"
-#: ../clients/cli/common.c:842
+#: ../clients/cli/common.c:688
msgid "The Wi-Fi network could not be found"
msgstr "Wi-Fi பிணையதà¯à®¤à¯ˆà®•à¯ கணà¯à®Ÿà®±à®¿à®¯ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:845
+#: ../clients/cli/common.c:691
msgid "A secondary connection of the base connection failed"
msgstr "அடிபà¯à®ªà®Ÿà¯ˆ இணைபà¯à®ªà®¿à®©à¯ இரணà¯à®Ÿà®¾à®®à¯ நிலை இணைபà¯à®ªà¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:848
+#: ../clients/cli/common.c:694
msgid "DCB or FCoE setup failed"
msgstr "DCB அலà¯à®²à®¤à¯ FCoE அமைவ௠தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:851
+#: ../clients/cli/common.c:697
msgid "teamd control failed"
msgstr "teamd கடà¯à®Ÿà¯à®ªà¯à®ªà®¾à®Ÿà¯ தோலà¯à®µà®¿"
-#: ../clients/cli/common.c:854
+#: ../clients/cli/common.c:700
msgid "Modem failed or no longer available"
msgstr "மோடம௠தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯ அலà¯à®²à®¤à¯ கிடைகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/common.c:857
+#: ../clients/cli/common.c:703
msgid "Modem now ready and available"
msgstr "இபà¯à®ªà¯‹à®¤à¯ மோடம௠தயாரà¯"
-#: ../clients/cli/common.c:860
+#: ../clients/cli/common.c:706
msgid "SIM PIN was incorrect"
msgstr "SIM PIN தவறà¯"
#. TRANSLATORS: Unknown reason for a device state change (NMDeviceStateReason)
-#: ../clients/cli/common.c:864 ../clients/cli/devices.c:633
-#: ../libnm-glib/nm-device.c:1812
+#: ../clients/cli/common.c:710 ../clients/cli/devices.c:619
+#: ../libnm-glib/nm-device.c:1814 ../libnm/nm-device.c:1635
msgid "Unknown"
msgstr "தெரியாத"
-#: ../clients/cli/common.c:906
+#: ../clients/cli/common.c:752
#, c-format
msgid "invalid priority map '%s'"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ வரைபடம௠'%s'"
-#: ../clients/cli/common.c:913 ../clients/cli/common.c:919
+#: ../clients/cli/common.c:759 ../clients/cli/common.c:765
#, c-format
msgid "priority '%s' is not valid (<0-%ld>)"
msgstr "à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®² (<0-%ld>)"
-#: ../clients/cli/common.c:986
+#: ../clients/cli/common.c:832
#, c-format
msgid "'%s' is not a valid team configuration or file name."
msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© அணி அமைவாகà¯à®•à®®à¯ அலà¯à®²à®¤à¯ கோபà¯à®ªà¯à®ªà¯ பெயரலà¯à®²."
+#: ../clients/cli/common.c:933
+#, c-format
+msgid ""
+"Warning: password for '%s' not given in 'passwd-file' and nmcli cannot ask "
+"without '--ask' option.\n"
+msgstr ""
+"எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: 'passwd-file' இல௠'%s' கà¯à®•à®¾à®© கடவà¯à®šà¯à®šà¯Šà®²à¯ கொடà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ, "
+"'--ask' விரà¯à®ªà¯à®ªà®®à¯ இலà¯à®²à®¾à®®à®²à¯ nmcli ஆல௠கேடà¯à®•à®µà¯à®®à¯ à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯.\n"
+
#. define some prompts for connection editor
-#: ../clients/cli/connections.c:40
+#: ../clients/cli/connections.c:42
msgid "Setting name? "
msgstr "பெயரை அமைகà¯à®•à®¿à®±à¯€à®°à¯à®•à®³à®¾? "
-#: ../clients/cli/connections.c:41
+#: ../clients/cli/connections.c:43
msgid "Property name? "
msgstr "பணà¯à®ªà®¿à®©à¯ பெயரà¯? "
-#: ../clients/cli/connections.c:42
+#: ../clients/cli/connections.c:44
msgid "Enter connection type: "
msgstr "இணைபà¯à®ªà¯ வகையை உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯: "
#. define some other prompts
-#: ../clients/cli/connections.c:45
+#: ../clients/cli/connections.c:47
msgid "Connection type: "
msgstr "இணைபà¯à®ªà¯ வகை: "
-#: ../clients/cli/connections.c:46
+#: ../clients/cli/connections.c:48
msgid "VPN type: "
msgstr "VPN வகை: "
-#: ../clients/cli/connections.c:47
+#: ../clients/cli/connections.c:49
msgid "Bond master: "
msgstr "பிணைபà¯à®ªà¯ பிரதானமà¯: "
-#: ../clients/cli/connections.c:48
+#: ../clients/cli/connections.c:50
msgid "Team master: "
msgstr "கà¯à®´à¯ மாஸà¯à®Ÿà¯à®Ÿà®°à¯: "
-#: ../clients/cli/connections.c:49
+#: ../clients/cli/connections.c:51
msgid "Bridge master: "
msgstr "பிரிடà¯à®œà¯ மாஸà¯à®Ÿà¯à®Ÿà®°à¯: "
-#: ../clients/cli/connections.c:50
+#: ../clients/cli/connections.c:52
msgid "Connection (name, UUID, or path): "
msgstr "இணைபà¯à®ªà¯ (பெயரà¯, UUID அலà¯à®²à®¤à¯ பாதை): "
#. 0
-#: ../clients/cli/connections.c:58 ../clients/cli/connections.c:170
-#: ../clients/cli/devices.c:55 ../clients/cli/devices.c:84
-#: ../clients/cli/devices.c:94 ../clients/cli/devices.c:105
-#: ../clients/cli/devices.c:114 ../clients/cli/devices.c:129
-#: ../clients/cli/devices.c:142 ../clients/cli/devices.c:168
-#: ../clients/cli/devices.c:183 ../clients/cli/devices.c:192
-#: ../clients/cli/devices.c:201
+#: ../clients/cli/connections.c:60 ../clients/cli/connections.c:173
+#: ../clients/cli/devices.c:57 ../clients/cli/devices.c:86
+#: ../clients/cli/devices.c:96 ../clients/cli/devices.c:107
+#: ../clients/cli/devices.c:116 ../clients/cli/devices.c:131
+#: ../clients/cli/devices.c:144 ../clients/cli/devices.c:170
+#: ../clients/cli/devices.c:185 ../clients/cli/devices.c:194
+#: ../clients/cli/devices.c:204
msgid "NAME"
msgstr "பெயரà¯"
#. 0
#. 1
-#: ../clients/cli/connections.c:59 ../clients/cli/connections.c:171
+#: ../clients/cli/connections.c:61 ../clients/cli/connections.c:174
msgid "UUID"
msgstr "UUID"
@@ -502,193 +596,225 @@ msgstr "UUID"
#. 0
#. 1
#. 2
-#: ../clients/cli/connections.c:60 ../clients/cli/connections.c:192
-#: ../clients/cli/devices.c:41 ../clients/cli/devices.c:57
-#: ../clients/cli/devices.c:171
+#: ../clients/cli/connections.c:62 ../clients/cli/connections.c:195
+#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:59
+#: ../clients/cli/devices.c:173
msgid "TYPE"
msgstr "வகை"
#. 2
-#: ../clients/cli/connections.c:61
+#: ../clients/cli/connections.c:63
msgid "TIMESTAMP"
msgstr "நேர à®®à¯à®¤à¯à®¤à®¿à®°à¯ˆ"
#. 3
-#: ../clients/cli/connections.c:62
+#: ../clients/cli/connections.c:64
msgid "TIMESTAMP-REAL"
msgstr "நேர à®®à¯à®¤à¯à®¤à®¿à®°à¯ˆ-மெயà¯"
#. 4
#. 15
-#: ../clients/cli/connections.c:63 ../clients/cli/devices.c:71
+#: ../clients/cli/connections.c:65 ../clients/cli/devices.c:73
msgid "AUTOCONNECT"
msgstr "தானியஙà¯à®•à¯ இணைபà¯à®ªà¯"
#. 5
-#: ../clients/cli/connections.c:64
+#: ../clients/cli/connections.c:66
+#| msgid "AUTOCONNECT"
+msgid "AUTOCONNECT-PRIORITY"
+msgstr "AUTOCONNECT-PRIORITY"
+
+#. 6
+#: ../clients/cli/connections.c:67
msgid "READONLY"
msgstr "வாசிகà¯à®•à®®à®Ÿà¯à®Ÿà¯à®®à¯"
-#. 6
+#. 7
#. 8
#. 2
#. 15
#. 5
-#: ../clients/cli/connections.c:65 ../clients/cli/connections.c:178
-#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:158
-#: ../clients/cli/devices.c:174
+#: ../clients/cli/connections.c:68 ../clients/cli/connections.c:181
+#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:160
+#: ../clients/cli/devices.c:176
msgid "DBUS-PATH"
msgstr "DBUS-பாதை"
-#. 7
+#. 8
#. 13
#. 4
-#: ../clients/cli/connections.c:66 ../clients/cli/devices.c:156
-#: ../clients/cli/devices.c:173
+#: ../clients/cli/connections.c:69 ../clients/cli/devices.c:158
+#: ../clients/cli/devices.c:175
msgid "ACTIVE"
msgstr "செயலிலà¯"
-#. 8
+#. 9
#. 0
#. 12
#. 3
-#: ../clients/cli/connections.c:67 ../clients/cli/devices.c:40
-#: ../clients/cli/devices.c:56 ../clients/cli/devices.c:155
-#: ../clients/cli/devices.c:172
+#: ../clients/cli/connections.c:70 ../clients/cli/devices.c:42
+#: ../clients/cli/devices.c:58 ../clients/cli/devices.c:157
+#: ../clients/cli/devices.c:174
msgid "DEVICE"
msgstr "சாதனமà¯"
-#. 9
+#. 10
#. 3
#. 1
#. 9
#. 1
-#: ../clients/cli/connections.c:68 ../clients/cli/connections.c:173
-#: ../clients/cli/devices.c:42 ../clients/cli/devices.c:65
-#: ../clients/cli/network-manager.c:37
+#: ../clients/cli/connections.c:71 ../clients/cli/connections.c:176
+#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:67
+#: ../clients/cli/general.c:37
msgid "STATE"
msgstr "நிலை"
-#. 10
-#: ../clients/cli/connections.c:69
+#. 11
+#: ../clients/cli/connections.c:72
msgid "ACTIVE-PATH"
msgstr "செயலில௠உளà¯à®³ பாதை"
#. 2
-#: ../clients/cli/connections.c:172
+#: ../clients/cli/connections.c:175
msgid "DEVICES"
msgstr "சாதனஙà¯à®•à®³à¯"
#. 4
-#: ../clients/cli/connections.c:174
+#: ../clients/cli/connections.c:177
msgid "DEFAULT"
msgstr "à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯"
#. 5
-#: ../clients/cli/connections.c:175
+#: ../clients/cli/connections.c:178
msgid "DEFAULT6"
msgstr "à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯6"
#. 6
-#: ../clients/cli/connections.c:176
+#: ../clients/cli/connections.c:179
msgid "SPEC-OBJECT"
msgstr "SPEC-பொரà¯à®³à¯"
#. 7
#. 4
#. Ask for optional 'vpn' arguments.
-#: ../clients/cli/connections.c:177 ../clients/cli/connections.c:215
-#: ../clients/cli/connections.c:3436 ../clients/tui/nm-editor-utils.c:234
-#: ../clients/tui/nmt-connect-connection-list.c:409
+#: ../clients/cli/connections.c:180 ../clients/cli/connections.c:218
+#: ../clients/cli/connections.c:3816 ../clients/tui/nm-editor-utils.c:234
+#: ../clients/tui/nmt-connect-connection-list.c:406
msgid "VPN"
msgstr "VPN"
#. 9
#. 5
#. 19
-#: ../clients/cli/connections.c:179 ../clients/cli/devices.c:46
-#: ../clients/cli/devices.c:75
+#: ../clients/cli/connections.c:182 ../clients/cli/devices.c:48
+#: ../clients/cli/devices.c:77
msgid "CON-PATH"
msgstr "CON-பாதை"
#. 10
-#: ../clients/cli/connections.c:180
+#: ../clients/cli/connections.c:183
msgid "ZONE"
msgstr "மணà¯à®Ÿà®²à®®à¯"
#. 11
-#: ../clients/cli/connections.c:181
+#: ../clients/cli/connections.c:184
msgid "MASTER-PATH"
msgstr "MASTER-பாதை"
#. 1
-#: ../clients/cli/connections.c:193
+#: ../clients/cli/connections.c:196
msgid "USERNAME"
msgstr "பயனரà¯à®ªà¯†à®¯à®°à¯"
-#. 2
-#: ../clients/cli/connections.c:194
-msgid "GATEWAY"
-msgstr "கேடà¯à®µà¯‡"
-
#. 3
-#: ../clients/cli/connections.c:195
+#: ../clients/cli/connections.c:198
msgid "BANNER"
msgstr "பேனரà¯"
#. 4
-#: ../clients/cli/connections.c:196
+#: ../clients/cli/connections.c:199
msgid "VPN-STATE"
msgstr "VPN-நிலை"
#. 5
-#: ../clients/cli/connections.c:197
+#: ../clients/cli/connections.c:200
msgid "CFG"
msgstr "CFG"
-#: ../clients/cli/connections.c:210 ../clients/cli/devices.c:216
+#: ../clients/cli/connections.c:213 ../clients/cli/devices.c:219
msgid "GENERAL"
msgstr "பொதà¯"
#. 0
#. 6
-#: ../clients/cli/connections.c:211 ../clients/cli/devices.c:223
+#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:226
msgid "IP4"
msgstr "IP4"
#. 1
#. 7
-#: ../clients/cli/connections.c:212 ../clients/cli/devices.c:224
+#: ../clients/cli/connections.c:215 ../clients/cli/devices.c:227
msgid "DHCP4"
msgstr "DHCP4"
#. 2
#. 8
-#: ../clients/cli/connections.c:213 ../clients/cli/devices.c:225
+#: ../clients/cli/connections.c:216 ../clients/cli/devices.c:228
msgid "IP6"
msgstr "IP6"
#. 3
#. 9
-#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:226
+#: ../clients/cli/connections.c:217 ../clients/cli/devices.c:229
msgid "DHCP6"
msgstr "DHCP6"
-#: ../clients/cli/connections.c:249
-#, c-format
+#: ../clients/cli/connections.c:251
+#, c-format
+#| msgid ""
+#| "Usage: nmcli connection { COMMAND | help }\n"
+#| "\n"
+#| "COMMAND := { show | up | down | add | modify | edit | delete | reload | "
+#| "load }\n"
+#| "\n"
+#| " show [--active] [[id | uuid | path | apath] <ID>] ...\n"
+#| "\n"
+#| " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp "
+#| "<name>]\n"
+#| "\n"
+#| " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n"
+#| "\n"
+#| " down [id | uuid | path | apath] <ID>\n"
+#| "\n"
+#| " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
+#| "\n"
+#| " modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> "
+#| "<value>)+\n"
+#| "\n"
+#| " edit [id | uuid | path] <ID>\n"
+#| " edit [type <new_con_type>] [con-name <new_con_name>]\n"
+#| "\n"
+#| " delete [id | uuid | path] <ID>\n"
+#| "\n"
+#| " reload\n"
+#| "\n"
+#| " load <filename> [ <filename>... ]\n"
+#| "\n"
msgid ""
"Usage: nmcli connection { COMMAND | help }\n"
"\n"
"COMMAND := { show | up | down | add | modify | edit | delete | reload | "
"load }\n"
"\n"
-" show [--active] [[id | uuid | path | apath] <ID>] ...\n"
+" show [--active] [[--show-secrets] [id | uuid | path | apath] <ID>] ...\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] "
+"[passwd-file <file with passwords>]\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file "
+"<file with passwords>]\n"
"\n"
-" down [id | uuid | path | apath] <ID>\n"
+" down [id | uuid | path | apath] <ID> ...\n"
"\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
"\n"
@@ -710,13 +836,15 @@ msgstr ""
"கடà¯à®Ÿà®³à¯ˆ := { show | up | down | add | modify | edit | delete | reload | "
"load }\n"
"\n"
-" show [--active] [[id | uuid | path | apath] <ID>] ...\n"
+" show [--active] [[--show-secrets] [id | uuid | path | apath] <ID>] ...\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] "
+"[passwd-file <file with passwords>]\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file "
+"<file with passwords>]\n"
"\n"
-" down [id | uuid | path | apath] <ID>\n"
+" down [id | uuid | path | apath] <ID> ...\n"
"\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
"\n"
@@ -733,8 +861,31 @@ msgstr ""
" load <filename> [ <filename>... ]\n"
"\n"
-#: ../clients/cli/connections.c:271
-#, c-format
+#: ../clients/cli/connections.c:272
+#, c-format
+#| msgid ""
+#| "Usage: nmcli connection show { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := [--active]\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"
+#| "\n"
+#| "ARGUMENTS := [--active] [id | uuid | path | apath] <ID> ...\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.\n"
msgid ""
"Usage: nmcli connection show { ARGUMENTS | help }\n"
"\n"
@@ -746,7 +897,8 @@ msgid ""
"profiles are listed. When --active option is specified, only the active\n"
"profiles are shown.\n"
"\n"
-"ARGUMENTS := [--active] [id | uuid | path | apath] <ID> ...\n"
+"ARGUMENTS := [--active] [--show-secrets] [id | uuid | path | apath] "
+"<ID> ...\n"
"\n"
"Show details for specified connections. By default, both static "
"configuration\n"
@@ -755,81 +907,123 @@ 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.\n"
+"account. --show-secrets option will reveal associated secrets as well.\n"
msgstr ""
"பயனà¯à®ªà®¾à®Ÿà¯: nmcli connection show { ARGUMENTS | help }\n"
"\n"
"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := [--active]\n"
"\n"
-"நினைவகதà¯à®¤à®¿à®²à¯ உளà¯à®³ மறà¯à®±à¯à®®à¯ வடà¯à®Ÿà®¿à®²à¯ உளà¯à®³ இணைபà¯à®ªà¯ தனியமைபà¯à®ªà¯à®•à®³à¯ˆà®ªà¯ படà¯à®Ÿà®¿à®¯à®²à®¿à®Ÿà¯,\n"
-"அநà¯à®¤ இணைபà¯à®ªà¯ தனியமைபà¯à®ªà¯ˆ ஒர௠சாதனம௠பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¿à®•à¯ கொணà¯à®Ÿà®¿à®°à¯à®¨à¯à®¤à®¾à®²à¯ அவறà¯à®±à®¿à®²à¯ "
-"சிலவà¯à®®à¯ செயலில௠"
-"இரà¯à®•à¯à®•à®²à®¾à®®à¯. அளவà¯à®°à¯à®µà®¿à®²à¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯, அனைதà¯à®¤à¯\n"
-"தனியமைபà¯à®ªà¯à®•à®³à¯à®®à¯ படà¯à®Ÿà®¿à®¯à®²à®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®®à¯. --active விரà¯à®ªà¯à®ªà®®à¯ கொடà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¾à®²à¯, "
-"செயலிலà¯\n"
-"உளà¯à®³ தனியமைபà¯à®ªà¯à®•à®³à¯ மடà¯à®Ÿà¯à®®à¯ காடà¯à®Ÿà®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
-"\n"
-"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := [--active] [id | uuid | path | apath] <ID> ...\n"
-"\n"
-"கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®Ÿ இணைபà¯à®ªà¯à®•à®³à¯à®•à¯à®•à®¾à®© விவரஙà¯à®•à®³à¯ˆà®•à¯ காணà¯à®ªà®¿. à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà®¾à®•, நிலையான "
-"அமைவாகà¯à®•à®®à¯\n"
-"மறà¯à®±à¯à®®à¯ செயலில௠உளà¯à®³ இணைபà¯à®ªà¯ ஆகிய இரணà¯à®Ÿà®¿à®©à¯ தரவà¯à®®à¯ காடà¯à®Ÿà®ªà¯à®ªà®Ÿà¯à®®à¯. வெளியீடà¯à®Ÿà¯ˆ "
-"வடிகடà¯à®Ÿà®µà¯à®®à¯ "
-"à®®à¯à®Ÿà®¿à®¯à¯à®®à¯\n"
-"அதறà¯à®•à¯ '--fields' விரà¯à®ªà¯à®ªà®¤à¯à®¤à¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤ வேணà¯à®Ÿà¯à®®à¯. மேலà¯à®®à¯ தகவலà¯à®•à¯à®•à¯ "
-"கையேடà¯à®Ÿà¯à®ªà¯ பகà¯à®•à®¤à¯à®¤à¯ˆà®ªà¯ "
-"பாரà¯à®•à¯à®•à®µà¯à®®à¯.\n"
-"--active விரà¯à®ªà¯à®ªà®®à¯ கொடà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¾à®²à¯, செயலில௠உளà¯à®³ தனியமைபà¯à®ªà¯à®•à®³à¯ மடà¯à®Ÿà¯à®®à¯\n"
-"கணகà¯à®•à®¿à®²à¯ எடà¯à®¤à¯à®¤à¯à®•à¯à®•à¯Šà®³à¯à®³à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
+"நினைவகதà¯à®¤à®¿à®²à¯ உளà¯à®³ மறà¯à®±à¯à®®à¯ வடà¯à®Ÿà®¿à®²à¯ உளà¯à®³ இணைபà¯à®ªà¯ தனியமைபà¯à®ªà¯à®•à®³à¯ˆà®ªà¯ படà¯à®Ÿà®¿à®¯à®²à®¿à®Ÿà¯à®®à¯, "
+"சாதனம௠ஒர௠இணைபà¯à®ªà¯ தனியமைபà¯à®ªà¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¿à®•à¯ கொணà¯à®Ÿà®¿à®°à¯à®¨à¯à®¤à®¾à®²à¯, அநà¯à®¤à®¤à¯ "
+"தனியமைபà¯à®ªà¯ \n"
+"செயலில௠இரà¯à®•à¯à®•à®µà¯à®®à¯ கூடà¯à®®à¯. மதிபà¯à®ªà¯à®°à¯ இலà¯à®²à®¾à®®à®²à¯, "
+"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¿à®©à®¾à®²à¯,\n"
+"அனைதà¯à®¤à¯ தனியமைபà¯à®ªà¯à®•à®³à¯à®®à¯ படà¯à®Ÿà®¿à®¯à®²à®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®®à¯. --active விரà¯à®ªà¯à®ªà®®à¯ "
+"கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿà®¾à®²à¯,\n"
+"செயலில௠உளà¯à®³ தனியமைபà¯à®ªà¯à®•à®³à¯ மடà¯à®Ÿà¯à®®à¯ காணà¯à®ªà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
+"\n"
+"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := [--active] [--show-secrets] [id | uuid | path | apath] "
+"<ID> ...\n"
+"\n"
+"கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿ இணைபà¯à®ªà¯à®•à¯à®•à®¾à®© விவரஙà¯à®•à®³à¯ˆà®•à¯ காணà¯à®ªà®¿à®•à¯à®•à¯à®®à¯. à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà®¾à®•, "
+"நிலையான அமைவாகà¯à®•à®®à¯\n"
+"மறà¯à®±à¯à®®à¯ செயலில௠உளà¯à®³ இணைபà¯à®ªà¯ தரவ௠ஆகிய இரணà¯à®Ÿà¯à®®à¯ காணà¯à®ªà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯. '--fields' "
+"எனà¯à®®à¯ ஒடà¯à®Ÿà¯à®®à¯Šà®¤à¯à®¤ விரà¯à®ªà¯à®ªà®¤à¯à®¤à¯ˆà®ªà¯ "
+"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¿,\n"
+"இதன௠வெளியீடà¯à®Ÿà¯ˆ"
+"வடிகடà¯à®Ÿà®µà¯à®®à¯ à®®à¯à®Ÿà®¿à®¯à¯à®®à¯. மேலà¯à®®à¯ தகவலà¯à®•à¯à®•à¯ "
+"கையேடà¯à®Ÿà¯à®ªà¯ பகà¯à®•à®¤à¯à®¤à¯ˆà®ªà¯ பாரà¯à®•à¯à®•à®µà¯à®®à¯.\n"
+"--active விரà¯à®ªà¯à®ªà®®à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿà®¾à®²à¯, செயலில௠உளà¯à®³\n"
+"தனியமைபà¯à®ªà¯à®•à®³à¯ மடà¯à®Ÿà¯à®®à¯‡ கரà¯à®¤à¯à®¤à®¿à®²à¯ கொளà¯à®³à®ªà¯à®ªà®Ÿà¯à®®à¯. --show-secrets விரà¯à®ªà¯à®ªà®®à®¾à®©à®¤à¯ "
+"சமà¯à®ªà®¨à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿ ரகசியஙà¯à®•à®³à¯ˆà®¯à¯à®®à¯ தெரிவிகà¯à®•à¯à®®à¯.\n"
#: ../clients/cli/connections.c:293
#, c-format
+#| msgid ""
+#| "Usage: nmcli connection up { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
+#| "<name>]\n"
+#| "\n"
+#| "Activate a connection on a device. The profile to activate is identified "
+#| "by its\n"
+#| "name, UUID or D-Bus path.\n"
+#| "\n"
+#| "ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+#| "\n"
+#| "Activate a device with a connection. The connection profile is selected\n"
+#| "automatically by NetworkManager.\n"
+#| "\n"
+#| "ifname - specifies the device to active the connection on\n"
+#| "ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+#| "nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+#| "\n"
msgid ""
"Usage: nmcli connection up { ARGUMENTS | help }\n"
"\n"
"ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
-"<name>]\n"
+"<name>] [passwd-file <file with passwords>]\n"
"\n"
"Activate a connection on a device. The profile to activate is identified by "
"its\n"
"name, UUID or D-Bus path.\n"
"\n"
-"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd-file <file "
+"with passwords>]\n"
"\n"
"Activate a device with a connection. The connection profile is selected\n"
"automatically by NetworkManager.\n"
"\n"
-"ifname - specifies the device to active the connection on\n"
-"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
-"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"ifname - specifies the device to active the connection on\n"
+"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"passwd-file - file with password(s) required to activate the connection\n"
"\n"
msgstr ""
"பயனà¯à®ªà®¾à®Ÿà¯: nmcli connection up { ARGUMENTS | help }\n"
"\n"
"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
-"<name>]\n"
+"<name>] [passwd-file <file with passwords>]\n"
"\n"
-"ஒர௠சாதனதà¯à®¤à®¿à®²à¯ ஒர௠இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯. செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ வேணà¯à®Ÿà®¿à®¯ தனியமைபà¯à®ªà®¾à®©à®¤à¯\n"
-"அதன௠பெயரà¯, UUID அலà¯à®²à®¤à¯ D-Bus பாதை மூலம௠அடையாளம௠காணபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯.\n"
+"ஒர௠சாதனதà¯à®¤à®¿à®²à¯ ஒர௠இணைபà¯à®ªà¯ˆà®šà¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à¯. செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ வேணà¯à®Ÿà®¿à®¯ "
+"தனியமைபà¯à®ªà®¾à®©à®¤à¯ "
+"அதனà¯\n"
+"பெயரà¯, UUID அலà¯à®²à®¤à¯ D-Bus பாதையைக௠கொணà¯à®Ÿà¯ அடையாளம௠காணபà¯à®ªà®Ÿà¯à®®à¯.\n"
"\n"
-"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd-file <"
+"file "
+"with passwords>]\n"
"\n"
-"ஒர௠இணைபà¯à®ªà¯à®Ÿà®©à¯ உளà¯à®³ ஒர௠சாதனதà¯à®¤à¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯. இணைபà¯à®ªà¯ தனியமைபà¯à®ªà®¾à®©à®¤à¯\n"
-"NetworkManager ஆல௠தானாக தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯.\n"
+"ஒர௠சாதனதà¯à®¤à®¿à®²à¯ ஒர௠இணைபà¯à®ªà¯ˆà®šà¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à¯. இணைபà¯à®ªà¯ தனியமைபà¯à®ªà®¾à®©à®¤à¯\n"
+"NetworkManager ஆல௠தானாக தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
"\n"
-"ifname - இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ வேணà¯à®Ÿà®¿à®¯ சாதனதà¯à®¤à¯ˆà®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®•à®¿à®±à®¤à¯\n"
-"ap - இணைகà¯à®• வேணà¯à®Ÿà®¿à®¯ AP à®à®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®•à®¿à®±à®¤à¯ (Wi-Fi கà¯à®•à¯ மடà¯à®Ÿà¯à®®à¯‡ "
-"செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à¯à®®à¯)\n"
-"nsp - இணைகà¯à®• வேணà¯à®Ÿà®¿à®¯ NSP à®à®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®•à®¿à®±à®¤à¯ (WiMAX கà¯à®•à¯ மடà¯à®Ÿà¯à®®à¯‡ "
-"செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à¯à®®à¯)\n"
+"ifname - எநà¯à®¤à®šà¯ சாதனதà¯à®¤à®¿à®²à¯ இணைபà¯à®ªà¯ˆà®šà¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ வேணà¯à®Ÿà¯à®®à¯ எனக௠"
+"கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®•à®¿à®±à®¤à¯\n"
+"ap - எநà¯à®¤ AP உடன௠இணைகà¯à®• வேணà¯à®Ÿà¯à®®à¯ எனக௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®•à®¿à®±à®¤à¯ (Wi-Fi கà¯à®•à¯ "
+"மடà¯à®Ÿà¯à®®à¯‡ செயலà¯à®ªà®Ÿà¯à®®à¯)\n"
+"nsp - எநà¯à®¤ NSP உடன௠இணைகà¯à®• வேணà¯à®Ÿà¯à®®à¯ எனக௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®•à®¿à®±à®¤à¯ (WiMAX கà¯à®•à¯ "
+"மடà¯à®Ÿà¯à®®à¯‡ செயலà¯à®ªà®Ÿà¯à®®à¯)\n"
+"passwd-file - இணைபà¯à®ªà¯ˆà®šà¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¤à¯ தேவைபà¯à®ªà®Ÿà¯à®®à¯ கடவà¯à®šà¯à®šà¯Šà®±à¯à®•à®³à¯ˆà®•à¯ கொணà¯à®Ÿà¯à®³à¯à®³ "
+"கோபà¯à®ªà¯\n"
"\n"
#: ../clients/cli/connections.c:314
#, c-format
+#| msgid ""
+#| "Usage: nmcli connection down { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+#| "\n"
+#| "Deactivate a connection from a device (without preventing the device "
+#| "from\n"
+#| "further auto-activation). The profile to deactivate is identified by its "
+#| "name,\n"
+#| "UUID or D-Bus path.\n"
+#| "\n"
msgid ""
"Usage: nmcli connection down { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+"ARGUMENTS := [id | uuid | path | apath] <ID> ...\n"
"\n"
"Deactivate a connection from a device (without preventing the device from\n"
"further auto-activation). The profile to deactivate is identified by its "
@@ -839,16 +1033,115 @@ msgid ""
msgstr ""
"பயனà¯à®ªà®¾à®Ÿà¯: nmcli connection down { ARGUMENTS | help }\n"
"\n"
-"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := [id | uuid | path | apath] <ID>\n"
+"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := [id | uuid | path | apath] <ID> ...\n"
"\n"
-"ஒர௠சாதனதà¯à®¤à®¿à®²à®¿à®°à¯à®¨à¯à®¤à¯ இணைபà¯à®ªà¯ˆ செயலà¯à®®à¯à®Ÿà®•à¯à®•à¯à®¤à®²à¯ (சாதனதà¯à®¤à®¿à®©à¯ மேறà¯à®ªà®Ÿà®¿à®¯à®¾à®© \n"
-"தானியஙà¯à®•à¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®²à¯ˆà®¤à¯ தடà¯à®•à¯à®•à®¾à®®à®²à¯). செயலà¯à®®à¯à®Ÿà®•à¯à®• வேணà¯à®Ÿà®¿à®¯ தனியமைபà¯à®ªà¯à®…தன௠"
+"ஒர௠சாதனதà¯à®¤à®¿à®²à®¿à®°à¯à®¨à¯à®¤à¯ ஒர௠இணைபà¯à®ªà¯ˆ à®®à¯à®Ÿà®•à¯à®•à¯à®®à¯ (சாதனமà¯\n"
+"மேறà¯à®•à¯Šà®£à¯à®Ÿà¯ தானியகà¯à®•à®®à®¾à®• செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à¯ செயலைத௠தடà¯à®•à¯à®•à®¾à®®à®²à¯). à®®à¯à®Ÿà®•à¯à®• வேணà¯à®Ÿà®¿à®¯ "
+"தனியமைபà¯à®ªà®¾à®©à®¤à¯, அதன௠"
"பெயரà¯,\n"
-"UUID அலà¯à®²à®¤à¯ D-Bus பாதையினால௠அடையாளம௠காணபà¯à®ªà®Ÿà¯à®®à¯.\n"
-"\n"
-
-#: ../clients/cli/connections.c:327
-#, c-format
+"UUID அலà¯à®²à®¤à¯ D-Bus பாதையைக௠கொணà¯à®Ÿà¯ அடையாளம௠காணபà¯à®ªà®Ÿà¯à®®à¯.\n"
+"\n"
+
+#: ../clients/cli/connections.c:326
+#, c-format
+#| msgid ""
+#| "Usage: nmcli connection add { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
+#| "\n"
+#| " COMMON_OPTIONS:\n"
+#| " type <type>\n"
+#| " ifname <interface name> | \"*\"\n"
+#| " [con-name <connection name>]\n"
+#| " [autoconnect yes|no]\n"
+#| "\n"
+#| " [save yes|no]\n"
+#| "\n"
+#| " TYPE_SPECIFIC_OPTIONS:\n"
+#| " ethernet: [mac <MAC address>]\n"
+#| " [cloned-mac <cloned MAC address>]\n"
+#| " [mtu <MTU>]\n"
+#| "\n"
+#| " wifi: ssid <SSID>\n"
+#| " [mac <MAC address>]\n"
+#| " [cloned-mac <cloned MAC address>]\n"
+#| " [mtu <MTU>]\n"
+#| "\n"
+#| " wimax: [mac <MAC address>]\n"
+#| " [nsp <NSP>]\n"
+#| "\n"
+#| " pppoe: username <PPPoE username>\n"
+#| " [password <PPPoE password>]\n"
+#| " [service <PPPoE service name>]\n"
+#| " [mtu <MTU>]\n"
+#| " [mac <MAC address>]\n"
+#| "\n"
+#| " gsm: apn <APN>\n"
+#| " [user <username>]\n"
+#| " [password <password>]\n"
+#| "\n"
+#| " cdma: [user <username>]\n"
+#| " [password <password>]\n"
+#| "\n"
+#| " infiniband: [mac <MAC address>]\n"
+#| " [mtu <MTU>]\n"
+#| " [transport-mode datagram | connected]\n"
+#| " [parent <ifname>]\n"
+#| " [p-key <IPoIB P_Key>]\n"
+#| "\n"
+#| " bluetooth: [addr <bluetooth address>]\n"
+#| " [bt-type panu|dun-gsm|dun-cdma]\n"
+#| "\n"
+#| " vlan: dev <parent device (connection UUID, ifname, or MAC)>\n"
+#| " id <VLAN ID>\n"
+#| " [flags <VLAN flags>]\n"
+#| " [ingress <ingress priority mapping>]\n"
+#| " [egress <egress priority mapping>]\n"
+#| " [mtu <MTU>]\n"
+#| "\n"
+#| " bond: [mode balance-rr (0) | active-backup (1) | balance-xor "
+#| "(2) | broadcast (3) |\n"
+#| " 802.3ad (4) | balance-tlb (5) | balance-alb "
+#| "(6)]\n"
+#| " [primary <ifname>]\n"
+#| " [miimon <num>]\n"
+#| " [downdelay <num>]\n"
+#| " [updelay <num>]\n"
+#| " [arp-interval <num>]\n"
+#| " [arp-ip-target <num>]\n"
+#| "\n"
+#| " bond-slave: master <master (ifname, or connection UUID or name)>\n"
+#| "\n"
+#| " team: [config <file>|<raw JSON data>]\n"
+#| "\n"
+#| " team-slave: master <master (ifname, or connection UUID or name)>\n"
+#| " [config <file>|<raw JSON data>]\n"
+#| "\n"
+#| " bridge: [stp yes|no]\n"
+#| " [priority <num>]\n"
+#| " [forward-delay <2-30>]\n"
+#| " [hello-time <1-10>]\n"
+#| " [max-age <6-40>]\n"
+#| " [ageing-time <0-1000000>]\n"
+#| " [mac <MAC address>]\n"
+#| "\n"
+#| " bridge-slave: master <master (ifname, or connection UUID or name)>\n"
+#| " [priority <0-63>]\n"
+#| " [path-cost <1-65535>]\n"
+#| " [hairpin yes|no]\n"
+#| "\n"
+#| " vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|"
+#| "libreswan|ssh|l2tp|iodine|...\n"
+#| " [user <username>]\n"
+#| "\n"
+#| " olpc-mesh: ssid <SSID>\n"
+#| " [channel <1-13>]\n"
+#| " [dhcp-anycast <MAC address>]\n"
+#| "\n"
+#| " IP_OPTIONS:\n"
+#| " [ip4 <IPv4 address>] [gw4 <IPv4 gateway>]\n"
+#| " [ip6 <IPv6 address>] [gw6 <IPv6 gateway>]\n"
+#| "\n"
msgid ""
"Usage: nmcli connection add { ARGUMENTS | help }\n"
"\n"
@@ -871,6 +1164,7 @@ msgid ""
" [mac <MAC address>]\n"
" [cloned-mac <cloned MAC address>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <MAC address>]\n"
" [nsp <NSP>]\n"
@@ -914,6 +1208,7 @@ msgid ""
" [updelay <num>]\n"
" [arp-interval <num>]\n"
" [arp-ip-target <num>]\n"
+" [lacp-rate slow (0) | fast (1)]\n"
"\n"
" bond-slave: master <master (ifname, or connection UUID or name)>\n"
"\n"
@@ -948,9 +1243,9 @@ msgid ""
" [ip6 <IPv6 address>] [gw6 <IPv6 gateway>]\n"
"\n"
msgstr ""
-"Usage: nmcli connection add { ARGUMENTS | help }\n"
+"பயனà¯à®ªà®¾à®Ÿà¯: nmcli connection add { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
+"மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
"\n"
" COMMON_OPTIONS:\n"
" type <type>\n"
@@ -969,6 +1264,7 @@ msgstr ""
" [mac <MAC address>]\n"
" [cloned-mac <cloned MAC address>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <MAC address>]\n"
" [nsp <NSP>]\n"
@@ -1012,6 +1308,7 @@ msgstr ""
" [updelay <num>]\n"
" [arp-interval <num>]\n"
" [arp-ip-target <num>]\n"
+" [lacp-rate slow (0) | fast (1)]\n"
"\n"
" bond-slave: master <master (ifname, or connection UUID or name)>\n"
"\n"
@@ -1098,7 +1395,7 @@ msgstr ""
"nmcli con mod bond0 -bond.options downdelay\n"
"\n"
-#: ../clients/cli/connections.c:430
+#: ../clients/cli/connections.c:429
#, c-format
msgid ""
"Usage: nmcli connection edit { ARGUMENTS | help }\n"
@@ -1127,7 +1424,7 @@ msgstr ""
"ஊடாட௠திரà¯à®¤à¯à®¤à®¿à®¯à®¿à®²à¯ ஒர௠பà¯à®¤à®¿à®¯ இணைபà¯à®ªà¯ தனியமைபà¯à®ªà¯ˆà®šà¯ சேரà¯.\n"
"\n"
-#: ../clients/cli/connections.c:446
+#: ../clients/cli/connections.c:444
#, c-format
msgid ""
"Usage: nmcli connection delete { ARGUMENTS | help }\n"
@@ -1147,7 +1444,7 @@ msgstr ""
"காணபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯\n"
"\n"
-#: ../clients/cli/connections.c:458
+#: ../clients/cli/connections.c:455
#, c-format
msgid ""
"Usage: nmcli connection reload { help }\n"
@@ -1160,7 +1457,7 @@ msgstr ""
"இணைபà¯à®ªà¯ கோபà¯à®ªà¯à®•à®³à¯ அனைதà¯à®¤à¯ˆà®¯à¯à®®à¯ வடà¯à®Ÿà®¿à®²à®¿à®°à¯à®¨à¯à®¤à¯ மீளேறà¯à®±à¯.\n"
"\n"
-#: ../clients/cli/connections.c:467
+#: ../clients/cli/connections.c:463
#, c-format
msgid ""
"Usage: nmcli connection load { ARGUMENTS | help }\n"
@@ -1185,227 +1482,227 @@ msgstr ""
"இதைப௠பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯.\n"
"\n"
-#: ../clients/cli/connections.c:538
+#: ../clients/cli/connections.c:534
msgid "activating"
msgstr "செயலà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/connections.c:540
+#: ../clients/cli/connections.c:536
msgid "activated"
msgstr "செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/connections.c:544
+#: ../clients/cli/connections.c:540
msgid "deactivated"
msgstr "à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/connections.c:556
+#: ../clients/cli/connections.c:552
msgid "VPN connecting (prepare)"
msgstr "VPN இணைகà¯à®•à®¿à®±à®¤à¯ (தயாராகà¯)"
-#: ../clients/cli/connections.c:558
+#: ../clients/cli/connections.c:554
msgid "VPN connecting (need authentication)"
msgstr "VPN இணைகà¯à®•à®¿à®±à®¤à¯ (à®…à®™à¯à®•à¯€à®•à®¾à®°à®®à¯ தேவை)"
-#: ../clients/cli/connections.c:560
+#: ../clients/cli/connections.c:556
msgid "VPN connecting"
msgstr "VPN இணைகà¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/connections.c:562
+#: ../clients/cli/connections.c:558
msgid "VPN connecting (getting IP configuration)"
msgstr "VPN இணைகà¯à®•à®¿à®±à®¤à¯ (IP கடà¯à®Ÿà®®à¯ˆà®ªà¯à®ªà¯ˆ பெறà¯à®•à®¿à®±à®¤à¯)"
-#: ../clients/cli/connections.c:564
+#: ../clients/cli/connections.c:560
msgid "VPN connected"
msgstr "VPN இணைகà¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/connections.c:566
+#: ../clients/cli/connections.c:562
msgid "VPN connection failed"
msgstr "VPN ஠இணைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:568
+#: ../clients/cli/connections.c:564
msgid "VPN disconnected"
msgstr "VPN தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/connections.c:651
+#: ../clients/cli/connections.c:634
+#, c-format
+#| msgid "error updating link cache: %s"
+msgid "Error updating secrets for %s: %s\n"
+msgstr "%s-கà¯à®•à®¾à®© ரகசியஙà¯à®•à®³à¯ˆà®ªà¯ பà¯à®¤à¯à®ªà¯à®ªà®¿à®ªà¯à®ªà®¤à®¿à®²à¯ பிழை: %s\n"
+
+#: ../clients/cli/connections.c:654
msgid "Connection profile details"
msgstr "இணைபà¯à®ªà¯ தனியமைபà¯à®ªà¯ விவரஙà¯à®•à®³à¯"
-#: ../clients/cli/connections.c:663 ../clients/cli/connections.c:1015
+#: ../clients/cli/connections.c:666 ../clients/cli/connections.c:1075
#, c-format
msgid "Error: 'connection show': %s"
msgstr "பிழை: 'connection show': %s"
-#: ../clients/cli/connections.c:807
+#: ../clients/cli/connections.c:812
msgid "never"
msgstr "à®’à®°à¯à®ªà¯‹à®¤à¯à®®à¯ இலà¯à®²à¯ˆ"
#. "CAPABILITIES"
-#: ../clients/cli/connections.c:808 ../clients/cli/connections.c:809
-#: ../clients/cli/connections.c:811 ../clients/cli/connections.c:870
-#: ../clients/cli/connections.c:871 ../clients/cli/connections.c:873
-#: ../clients/cli/connections.c:2772 ../clients/cli/connections.c:6476
-#: ../clients/cli/connections.c:6477 ../clients/cli/devices.c:603
-#: ../clients/cli/devices.c:653 ../clients/cli/devices.c:874
-#: ../clients/cli/devices.c:875 ../clients/cli/devices.c:876
-#: ../clients/cli/devices.c:877 ../clients/cli/devices.c:910
-#: ../clients/cli/devices.c:912 ../clients/cli/devices.c:940
-#: ../clients/cli/devices.c:941 ../clients/cli/devices.c:942
-#: ../clients/cli/devices.c:943 ../clients/cli/devices.c:944
-#: ../clients/cli/devices.c:945 ../clients/cli/devices.c:946
-#: ../clients/cli/network-manager.c:435
+#: ../clients/cli/connections.c:813 ../clients/cli/connections.c:815
+#: ../clients/cli/connections.c:817 ../clients/cli/connections.c:849
+#: ../clients/cli/connections.c:916 ../clients/cli/connections.c:917
+#: ../clients/cli/connections.c:919 ../clients/cli/connections.c:3111
+#: ../clients/cli/connections.c:6949 ../clients/cli/connections.c:6950
+#: ../clients/cli/devices.c:589 ../clients/cli/devices.c:639
+#: ../clients/cli/devices.c:846 ../clients/cli/devices.c:847
+#: ../clients/cli/devices.c:848 ../clients/cli/devices.c:849
+#: ../clients/cli/devices.c:882 ../clients/cli/devices.c:884
+#: ../clients/cli/devices.c:912 ../clients/cli/devices.c:913
+#: ../clients/cli/devices.c:914 ../clients/cli/devices.c:915
+#: ../clients/cli/devices.c:916 ../clients/cli/devices.c:917
+#: ../clients/cli/devices.c:918 ../clients/cli/general.c:421
msgid "yes"
msgstr "ஆமà¯"
-#: ../clients/cli/connections.c:808 ../clients/cli/connections.c:809
-#: ../clients/cli/connections.c:811 ../clients/cli/connections.c:870
-#: ../clients/cli/connections.c:871 ../clients/cli/connections.c:873
-#: ../clients/cli/connections.c:2773 ../clients/cli/connections.c:6476
-#: ../clients/cli/connections.c:6477 ../clients/cli/devices.c:603
-#: ../clients/cli/devices.c:653 ../clients/cli/devices.c:874
-#: ../clients/cli/devices.c:875 ../clients/cli/devices.c:876
-#: ../clients/cli/devices.c:877 ../clients/cli/devices.c:910
-#: ../clients/cli/devices.c:912 ../clients/cli/devices.c:940
-#: ../clients/cli/devices.c:941 ../clients/cli/devices.c:942
-#: ../clients/cli/devices.c:943 ../clients/cli/devices.c:944
-#: ../clients/cli/devices.c:945 ../clients/cli/devices.c:946
-#: ../clients/cli/network-manager.c:437
+#: ../clients/cli/connections.c:813 ../clients/cli/connections.c:815
+#: ../clients/cli/connections.c:817 ../clients/cli/connections.c:916
+#: ../clients/cli/connections.c:917 ../clients/cli/connections.c:919
+#: ../clients/cli/connections.c:3112 ../clients/cli/connections.c:6949
+#: ../clients/cli/connections.c:6950 ../clients/cli/devices.c:589
+#: ../clients/cli/devices.c:639 ../clients/cli/devices.c:846
+#: ../clients/cli/devices.c:847 ../clients/cli/devices.c:848
+#: ../clients/cli/devices.c:849 ../clients/cli/devices.c:882
+#: ../clients/cli/devices.c:884 ../clients/cli/devices.c:912
+#: ../clients/cli/devices.c:913 ../clients/cli/devices.c:914
+#: ../clients/cli/devices.c:915 ../clients/cli/devices.c:916
+#: ../clients/cli/devices.c:917 ../clients/cli/devices.c:918
+#: ../clients/cli/general.c:423
msgid "no"
msgstr "இலà¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:866 ../clients/cli/connections.c:876
-#: ../clients/cli/devices.c:593
-msgid "N/A"
-msgstr "பொரà¯à®¨à¯à®¤à®¾à®¤à¯ "
-
-#: ../clients/cli/connections.c:1003
+#: ../clients/cli/connections.c:1063
msgid "Activate connection details"
msgstr "இணைபà¯à®ªà¯ விவரஙà¯à®•à®³à¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯"
-#: ../clients/cli/connections.c:1236
+#: ../clients/cli/connections.c:1299
#, c-format
msgid "invalid field '%s'; allowed fields: %s and %s, or %s,%s"
msgstr ""
"செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ பà¯à®²à®®à¯ '%s'; அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ பà¯à®²à®™à¯à®•à®³à¯: %s மறà¯à®±à¯à®®à¯ %s, அலà¯à®²à®¤à¯ %"
"s,%s"
-#: ../clients/cli/connections.c:1251 ../clients/cli/connections.c:1259
+#: ../clients/cli/connections.c:1314 ../clients/cli/connections.c:1322
#, c-format
msgid "'%s' has to be alone"
msgstr "'%s' தனியாக இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯"
#. Add headers
-#: ../clients/cli/connections.c:1313
+#: ../clients/cli/connections.c:1377
msgid "NetworkManager active profiles"
msgstr "NetworkManager செயலில௠உளà¯à®³ தனியமைபà¯à®ªà¯à®•à®³à¯"
-#: ../clients/cli/connections.c:1314
+#: ../clients/cli/connections.c:1378
msgid "NetworkManager connection profiles"
msgstr "NetworkManager இணைபà¯à®ªà¯ தனியமைபà¯à®ªà¯à®•à®³à¯"
-#: ../clients/cli/connections.c:1351 ../clients/cli/connections.c:1953
-#: ../clients/cli/connections.c:1969 ../clients/cli/connections.c:1978
-#: ../clients/cli/connections.c:1988 ../clients/cli/connections.c:2067
-#: ../clients/cli/connections.c:7985 ../clients/cli/connections.c:8201
-#: ../clients/cli/devices.c:1900 ../clients/cli/devices.c:1908
-#: ../clients/cli/devices.c:2224 ../clients/cli/devices.c:2231
-#: ../clients/cli/devices.c:2245 ../clients/cli/devices.c:2252
-#: ../clients/cli/devices.c:2269 ../clients/cli/devices.c:2277
-#: ../clients/cli/devices.c:2465 ../clients/cli/devices.c:2561
-#: ../clients/cli/devices.c:2568
+#: ../clients/cli/connections.c:1418 ../clients/cli/connections.c:2145
+#: ../clients/cli/connections.c:2167 ../clients/cli/connections.c:2176
+#: ../clients/cli/connections.c:2186 ../clients/cli/connections.c:2196
+#: ../clients/cli/connections.c:2346 ../clients/cli/connections.c:8499
+#: ../clients/cli/connections.c:8716 ../clients/cli/devices.c:1909
+#: ../clients/cli/devices.c:1917 ../clients/cli/devices.c:2233
+#: ../clients/cli/devices.c:2240 ../clients/cli/devices.c:2254
+#: ../clients/cli/devices.c:2261 ../clients/cli/devices.c:2278
+#: ../clients/cli/devices.c:2286 ../clients/cli/devices.c:2474
+#: ../clients/cli/devices.c:2570 ../clients/cli/devices.c:2577
#, c-format
msgid "Error: %s argument is missing."
msgstr "பிழை: %s விவாதம௠விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯."
-#: ../clients/cli/connections.c:1402
+#: ../clients/cli/connections.c:1433
#, c-format
msgid "Error: %s - no such connection profile."
msgstr "பிழை: %s - இபà¯à®ªà®Ÿà®¿ ஒர௠இணைபà¯à®ªà¯ தனியமைபà¯à®ªà¯ இலà¯à®²à¯ˆ."
-#: ../clients/cli/connections.c:1418 ../clients/cli/connections.c:2012
-#: ../clients/cli/connections.c:8270 ../clients/cli/connections.c:8311
-#: ../clients/cli/connections.c:8509 ../clients/cli/devices.c:2444
-#: ../clients/cli/devices.c:2909 ../clients/cli/network-manager.c:532
-#: ../clients/cli/network-manager.c:578 ../clients/cli/network-manager.c:595
-#: ../clients/cli/network-manager.c:642 ../clients/cli/network-manager.c:656
-#: ../clients/cli/network-manager.c:773 ../clients/cli/network-manager.c:817
-#: ../clients/cli/network-manager.c:837
+#: ../clients/cli/connections.c:1492 ../clients/cli/connections.c:2219
+#: ../clients/cli/connections.c:9016 ../clients/cli/devices.c:2453
+#: ../clients/cli/devices.c:2921 ../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
#, c-format
msgid "Error: %s."
msgstr "பிழை: %s."
-#: ../clients/cli/connections.c:1513
+#: ../clients/cli/connections.c:1587
#, c-format
msgid "no active connection on device '%s'"
msgstr "சாதனம௠'%s' இல௠செயலà¯à®ªà®Ÿà¯à®®à¯ இணைபà¯à®ªà¯ இலà¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:1521
+#: ../clients/cli/connections.c:1595
msgid "no active connection or device"
msgstr "செயலà¯à®ªà®Ÿà¯à®®à¯ இணைபà¯à®ªà¯ அலà¯à®²à®¤à¯ சாதனம௠இலà¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:1592
+#: ../clients/cli/connections.c:1666
#, c-format
msgid "device '%s' not compatible with connection '%s'"
msgstr "சாதனம௠'%s' இணைபà¯à®ªà¯ '%s' உடன௠உகநà¯à®¤à®¤à¯ அலà¯à®²"
-#: ../clients/cli/connections.c:1595
+#: ../clients/cli/connections.c:1669
#, c-format
msgid "no device found for connection '%s'"
msgstr "இணைபà¯à®ªà¯ '%s'கà¯à®•à¯ சாதனம௠எதà¯à®µà¯à®®à¯ இலà¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:1607
+#: ../clients/cli/connections.c:1681
msgid "unknown reason"
msgstr "தெரியாத காரணமà¯"
-#: ../clients/cli/connections.c:1609 ../clients/cli/network-manager.c:286
+#: ../clients/cli/connections.c:1683 ../clients/cli/general.c:272
msgid "none"
msgstr "ஒனà¯à®±à¯à®®à®¿à®²à¯à®²à®¾à®¤"
-#: ../clients/cli/connections.c:1611
+#: ../clients/cli/connections.c:1685
msgid "the user was disconnected"
msgstr "பயனர௠செயலà¯à®¨à¯€à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¾à®°à¯"
-#: ../clients/cli/connections.c:1613
+#: ../clients/cli/connections.c:1687
msgid "the base network connection was interrupted"
msgstr "தளப௠பிணைய இணைபà¯à®ªà®¾à®©à®¤à¯ தடை செயà¯à®¯à®ªà¯à®ªà®Ÿà¯à®Ÿà®¿à®°à¯à®¨à¯à®¤à®¤à¯"
-#: ../clients/cli/connections.c:1615
+#: ../clients/cli/connections.c:1689
msgid "the VPN service stopped unexpectedly"
msgstr "எதிரà¯à®ªà®¾à®°à®¾à®®à®²à¯ VPN சேவை நிறà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/connections.c:1617
+#: ../clients/cli/connections.c:1691
msgid "the VPN service returned invalid configuration"
msgstr "VPN சேவையானத௠தவறான கடà¯à®Ÿà®®à¯ˆà®ªà¯à®ªà®¿à®±à¯à®•à¯ திரà¯à®®à¯à®ªà®¿à®¯à®¤à¯"
-#: ../clients/cli/connections.c:1619
+#: ../clients/cli/connections.c:1693
msgid "the connection attempt timed out"
msgstr "இணைபà¯à®ªà¯ à®®à¯à®¯à®±à¯à®šà®¿à®¯à®¿à®©à¯ நேரம௠மà¯à®Ÿà®¿à®¨à¯à®¤à®¤à¯"
-#: ../clients/cli/connections.c:1621
+#: ../clients/cli/connections.c:1695
msgid "the VPN service did not start in time"
msgstr "VPN சேவை நேரதà¯à®¤à®¿à®±à¯à®•à¯ தà¯à®µà®™à¯à®•à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:1623
+#: ../clients/cli/connections.c:1697
msgid "the VPN service failed to start"
msgstr "VPN சேவையை தà¯à®µà®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:1625
+#: ../clients/cli/connections.c:1699
msgid "no valid VPN secrets"
msgstr "சரியான VPN இரகசியஙà¯à®•à®³à¯ இலà¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:1627
+#: ../clients/cli/connections.c:1701
msgid "invalid VPN secrets"
msgstr "தவறான VPN இரகசியஙà¯à®•à®³à¯"
-#: ../clients/cli/connections.c:1629
+#: ../clients/cli/connections.c:1703
msgid "the connection was removed"
msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ நீகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/connections.c:1651 ../clients/cli/connections.c:1679
-#: ../clients/cli/connections.c:1833 ../clients/cli/connections.c:6367
+#: ../clients/cli/connections.c:1725 ../clients/cli/connections.c:1753
+#: ../clients/cli/connections.c:1914 ../clients/cli/connections.c:6840
#, c-format
msgid "Connection successfully activated (D-Bus active path: %s)\n"
msgstr "இணைபà¯à®ªà¯ வெறà¯à®±à®¿à®•à®°à®®à®¾à®• செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯ (டி-பஸ௠செயல௠பாதை: %s)\n"
-#: ../clients/cli/connections.c:1658
+#: ../clients/cli/connections.c:1732
#, c-format
msgid ""
"Connection successfully activated (master waiting for slaves) (D-Bus active "
@@ -1415,574 +1712,666 @@ msgstr ""
"காதà¯à®¤à®¿à®°à¯à®•à¯à®•à®¿à®±à®¤à¯) (D-Bus "
"செயலà¯à®®à®¿à®•à¯ பாதை: %s)\n"
-#: ../clients/cli/connections.c:1662 ../clients/cli/connections.c:1685
+#: ../clients/cli/connections.c:1736 ../clients/cli/connections.c:1758
#, c-format
msgid "Error: Connection activation failed."
msgstr "பிழை: இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/connections.c:1729
+#: ../clients/cli/connections.c:1809
#, c-format
msgid "VPN connection successfully activated (D-Bus active path: %s)\n"
msgstr "VPN இணைபà¯à®ªà¯ வெறà¯à®±à®¿à®•à®°à®®à®¾à®• செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯ (டி-பஸ௠செயல௠பாதை: %s)\n"
-#: ../clients/cli/connections.c:1737
+#: ../clients/cli/connections.c:1817
#, c-format
msgid "Error: Connection activation failed: %s."
msgstr "பிழை: இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s."
-#: ../clients/cli/connections.c:1756 ../clients/cli/devices.c:1348
+#: ../clients/cli/connections.c:1836 ../clients/cli/devices.c:1322
#, c-format
msgid "Error: Timeout %d sec expired."
msgstr "பிழை: நேரமà¯à®Ÿà®¿à®¨à¯à®¤ %d விநாடி காலாவதியானதà¯."
-#: ../clients/cli/connections.c:1816
+#: ../clients/cli/connections.c:1896
#, c-format
msgid "Error: Connection activation failed: %s"
msgstr "பிழை: இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ:%s"
-#: ../clients/cli/connections.c:1891 ../clients/cli/connections.c:2013
+#: ../clients/cli/connections.c:1981
+#, c-format
+#| msgid "Error: failed to remove value of '%s': %s\n"
+msgid "failed to read passwd-file '%s': %s"
+msgstr "'%s' எனà¯à®®à¯ passwd-file கோபà¯à®ªà¯ˆ வாசிகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
+
+#: ../clients/cli/connections.c:1993
+#, c-format
+msgid "missing colon in 'password' entry '%s'"
+msgstr "'password' உளà¯à®³à¯€à®Ÿà¯ '%s' இல௠மà¯à®•à¯à®•à®¾à®±à¯à®ªà¯à®³à¯à®³à®¿ இலà¯à®²à¯ˆ"
+
+#: ../clients/cli/connections.c:2001
+#, c-format
+msgid "missing dot in 'password' entry '%s'"
+msgstr "'password' உளà¯à®³à¯€à®Ÿà¯ '%s' இல௠பà¯à®³à¯à®³à®¿ இலà¯à®²à¯ˆ"
+
+#: ../clients/cli/connections.c:2014
+#, c-format
+msgid "invalid setting name in 'password' entry '%s'"
+msgstr "'password' உளà¯à®³à¯€à®Ÿà¯ '%s' இல௠தவறான அமைபà¯à®ªà¯à®ªà¯ பெயர௠உளà¯à®³à®¤à¯"
+
+#: ../clients/cli/connections.c:2061 ../clients/cli/connections.c:2220
msgid "unknown error"
msgstr "தெரியாத பிழை"
-#: ../clients/cli/connections.c:1899
+#: ../clients/cli/connections.c:2070
#, c-format
msgid "unknown device '%s'."
msgstr "தெரியாத சாதனம௠'%s'."
-#: ../clients/cli/connections.c:1904
+#: ../clients/cli/connections.c:2075
msgid "neither a valid connection nor device given"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இணைபà¯à®ªà¯ அலà¯à®²à®¤à¯ சாதனம௠எதà¯à®µà¯à®®à¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/connections.c:1997 ../clients/cli/devices.c:1247
-#: ../clients/cli/devices.c:1914 ../clients/cli/devices.c:2288
-#: ../clients/cli/devices.c:2574
+#: ../clients/cli/connections.c:2158
+#, c-format
+#| msgid "Error: connection is not valid: %s\n"
+msgid "Error: Connection '%s' does not exist."
+msgstr "பிழை: '%s' எனà¯à®±à¯ ஒர௠இணைபà¯à®ªà¯ இலà¯à®²à¯ˆ."
+
+#: ../clients/cli/connections.c:2204 ../clients/cli/devices.c:1221
+#: ../clients/cli/devices.c:1923 ../clients/cli/devices.c:2297
+#: ../clients/cli/devices.c:2583
#, c-format
msgid "Unknown parameter: %s\n"
msgstr "தெரியாத அளவà¯à®°à¯: %s\n"
-#: ../clients/cli/connections.c:2021
+#: ../clients/cli/connections.c:2228
msgid "preparing"
msgstr "தயாராகிறதà¯"
-#: ../clients/cli/connections.c:2049 ../clients/cli/connections.c:8182
-#: ../clients/cli/connections.c:8298
+#: ../clients/cli/connections.c:2267
+#, c-format
+#| msgid "Connection successfully activated (D-Bus active path: %s)\n"
+msgid "Connection '%s' successfully deactivated (D-Bus active path: %s)\n"
+msgstr "'%s' எனà¯à®®à¯ இணைபà¯à®ªà¯ வெறà¯à®±à®¿à®•à®°à®®à®¾à®• à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯ (D-Bus செயல௠பாதை: %s)\n"
+
+#: ../clients/cli/connections.c:2325 ../clients/cli/connections.c:8697
+#: ../clients/cli/connections.c:8811
#, c-format
msgid "Error: No connection specified."
msgstr "பிழை: இணைபà¯à®ªà¯ எதà¯à®µà¯à®®à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/connections.c:2077
+#: ../clients/cli/connections.c:2356
+#, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: '%s' is not an active connection.\n"
+msgstr "பிழை: '%s' எனà¯à®ªà®¤à¯ செயலிலà¯à®³à¯à®³ ஒர௠இணைபà¯à®ªà®²à¯à®².\n"
+
+#: ../clients/cli/connections.c:2357
+#, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: not all active connections found."
+msgstr "பிழை: செயலிலà¯à®³à¯à®³ இணைபà¯à®ªà¯à®•à®³à¯ அனைதà¯à®¤à¯à®®à¯ கணà¯à®Ÿà®±à®¿à®¯à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../clients/cli/connections.c:2366
#, c-format
-msgid "Error: '%s' is not an active connection."
-msgstr "பிழை: '%s' எனà¯à®ªà®¤à¯ ஓர௠செயலிலà¯à®³à¯à®³ இணைபà¯à®ªà¯ இலà¯à®²à¯ˆ."
+#| msgid "Error: %s - no such connection profile."
+msgid "Error: no active connection provided."
+msgstr "பிழை: செயலிலà¯à®³à¯à®³ இணைபà¯à®ªà¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/connections.c:2378 ../clients/cli/utils.c:514
+#: ../clients/cli/connections.c:2684 ../clients/cli/utils.c:516
#, c-format
msgid "'%s' not among [%s]"
msgstr "'%s' ஆனத௠இலà¯à®²à¯ˆ [%s]"
-#: ../clients/cli/connections.c:2457
+#: ../clients/cli/connections.c:2763
#, c-format
msgid "Error: '%s': '%s' is not a valid %s MAC address."
msgstr "பிழை: '%s': '%s' எனà¯à®ªà®¤à¯ ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© %s MAC à®®à¯à®•à®µà®°à®¿ அலà¯à®²."
#. Ask for optional arguments
-#: ../clients/cli/connections.c:2458 ../clients/cli/connections.c:2888
-#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1509
-#: ../libnm-glib/nm-device.c:1800
+#: ../clients/cli/connections.c:2764 ../clients/cli/connections.c:3226
+#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1551
+#: ../libnm-glib/nm-device.c:1802 ../libnm/nm-device.c:1623
msgid "InfiniBand"
msgstr "InfiniBand"
-#: ../clients/cli/connections.c:2458 ../clients/tui/nm-editor-utils.c:147
-#: ../libnm-glib/nm-device.c:1788
+#: ../clients/cli/connections.c:2764 ../clients/tui/nm-editor-utils.c:147
+#: ../libnm-glib/nm-device.c:1790 ../libnm/nm-device.c:1611
msgid "Ethernet"
msgstr "ஈதà¯à®¤à®°à¯à®¨à¯†à®Ÿà¯"
-#: ../clients/cli/connections.c:2478
+#: ../clients/cli/connections.c:2784
#, c-format
msgid "Error: 'mtu': '%s' is not a valid MTU."
msgstr "பிழை: 'mtu': '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© MTU அலà¯à®²."
-#: ../clients/cli/connections.c:2494
+#: ../clients/cli/connections.c:2800
#, c-format
msgid "Error: 'parent': '%s' is not a valid interface name."
msgstr "பிழை: 'parent': '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இடைமà¯à®• பெயர௠அலà¯à®²."
-#: ../clients/cli/connections.c:2515
+#: ../clients/cli/connections.c:2821
#, c-format
msgid "Error: 'p-key': '%s' is not a valid InfiniBand P_KEY."
msgstr "பிழை: 'p-key': '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© InfiniBand P_KEY அலà¯à®²."
-#: ../clients/cli/connections.c:2544
+#: ../clients/cli/connections.c:2866
#, c-format
-msgid ""
-"Error: 'mode': '%s' is not a valid InfiniBand transport mode [datagram, "
-"connected]."
-msgstr ""
-"பிழை: 'mode': '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© InfiniBand போகà¯à®•à¯à®µà®°à®¤à¯à®¤à¯à®ªà¯ பயனà¯à®®à¯à®±à¯ˆ "
-"அலà¯à®² "
-"[டேடà¯à®Ÿà®¾à®•à¯à®°à®¾à®®à¯, இணைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯]."
+#| msgid "Error: '%s': '%s' is not valid; %s "
+msgid "Error: '%s': '%s' is not a valid %s %s."
+msgstr "பிழை: '%s': '%s' எனà¯à®ªà®¤à¯ சரியான %s %s அலà¯à®²."
-#: ../clients/cli/connections.c:2558
+#: ../clients/cli/connections.c:2879
+#| msgid "Wi-Fi"
+msgid "Wi-Fi mode"
+msgstr "Wi-Fi à®®à¯à®±à¯ˆ"
+
+#: ../clients/cli/connections.c:2888
+#| msgid "Transport mode"
+msgid "InfiniBand transport mode"
+msgstr "InfiniBand டிரானà¯à®¸à¯à®ªà¯‹à®°à¯à®Ÿà¯ à®®à¯à®±à¯ˆ"
+
+#: ../clients/cli/connections.c:2901
#, c-format
msgid "Error: 'flags': '%s' is not valid; use <0-7>."
msgstr "பிழை: 'flags': '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; <0-7> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯."
-#: ../clients/cli/connections.c:2580
+#: ../clients/cli/connections.c:2923
#, c-format
msgid "Error: '%s': '%s' is not valid; %s "
msgstr "பிழை: '%s': '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; %s "
-#: ../clients/cli/connections.c:2763
+#: ../clients/cli/connections.c:3102
#, c-format
msgid "Error: '%s': '%s' is not valid; use <%u-%u>."
msgstr "பிழை: '%s': '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; <%u-%u> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯."
#. Ask for optional arguments.
-#: ../clients/cli/connections.c:2819
+#: ../clients/cli/connections.c:3158
#, 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"
msgstr[0] "'%2$s' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± %1$d மதிபà¯à®ªà¯à®°à¯ உளà¯à®³à®¤à¯\n"
msgstr[1] "'%2$s' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± %1$d மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ உளà¯à®³à®©.\n"
-#: ../clients/cli/connections.c:2822
+#: ../clients/cli/connections.c:3161
#, c-format
msgid "Do you want to provide it? %s"
msgid_plural "Do you want to provide them? %s"
msgstr[0] "அதை வழஙà¯à®• விரà¯à®®à¯à®ªà¯à®•à®¿à®±à¯€à®°à¯à®•à®³à®¾? %s"
msgstr[1] "அவறà¯à®±à¯ˆ வழஙà¯à®• விரà¯à®®à¯à®ªà¯à®•à®¿à®±à¯€à®°à¯à®•à®³à®¾? %s"
-#: ../clients/cli/connections.c:2837
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3178
msgid "ethernet"
msgstr "ஈதà¯à®¤à®°à¯à®¨à¯†à®Ÿà¯"
-#: ../clients/cli/connections.c:2837 ../clients/tui/nm-editor-utils.c:155
-#: ../libnm-glib/nm-device.c:1790
-msgid "Wi-Fi"
-msgstr "Wi-Fi"
-
-#: ../clients/cli/connections.c:2845 ../clients/cli/connections.c:2893
-#: ../clients/cli/connections.c:3002 ../clients/cli/connections.c:3081
+#: ../clients/cli/connections.c:3183 ../clients/cli/connections.c:3231
+#: ../clients/cli/connections.c:3365 ../clients/cli/connections.c:3444
msgid "MTU [auto]: "
msgstr "MTU [auto]: "
-#: ../clients/cli/connections.c:2856 ../clients/cli/connections.c:2904
-#: ../clients/cli/connections.c:2974 ../clients/cli/connections.c:3013
-#: ../clients/cli/connections.c:3368
+#: ../clients/cli/connections.c:3194 ../clients/cli/connections.c:3242
+#: ../clients/cli/connections.c:3337 ../clients/cli/connections.c:3376
+#: ../clients/cli/connections.c:3748
msgid "MAC [none]: "
msgstr "MAC [none]: "
-#: ../clients/cli/connections.c:2867
+#: ../clients/cli/connections.c:3205
msgid "Cloned MAC [none]: "
msgstr "Cloned MAC [none]: "
-#: ../clients/cli/connections.c:2915
+#: ../clients/cli/connections.c:3253
#, c-format
msgid "Transport mode %s"
msgstr "போகà¯à®•à¯à®µà®°à®¤à¯à®¤à¯ à®®à¯à®±à¯ˆà®®à¯ˆ %s"
-#: ../clients/cli/connections.c:2928
+#: ../clients/cli/connections.c:3266
msgid "Parent interface [none]: "
msgstr "தாய௠இடைமà¯à®•à®®à¯ [none]: "
-#: ../clients/cli/connections.c:2939
+#: ../clients/cli/connections.c:3277
msgid "P_KEY [none]: "
msgstr "P_KEY [none]: "
-#: ../clients/cli/connections.c:2949
+#: ../clients/cli/connections.c:3287
#, c-format
msgid "Error: 'p-key' is mandatory when 'parent' is specified.\n"
msgstr "பிழை:'parent' கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®®à¯ போத௠'p-key' கடà¯à®Ÿà®¾à®¯à®®à¯.\n"
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3304 ../clients/tui/nm-editor-utils.c:155
+#: ../libnm-glib/nm-device.c:1792 ../libnm/nm-device.c:1613
+msgid "Wi-Fi"
+msgstr "Wi-Fi"
+
+#: ../clients/cli/connections.c:3312
+#, c-format
+#| msgid "Mode"
+msgid "Mode %s"
+msgstr "à®®à¯à®±à¯ˆ %s"
+
#. Ask for optional 'wimax' arguments.
-#: ../clients/cli/connections.c:2969 ../libnm-glib/nm-device.c:1796
+#: ../clients/cli/connections.c:3332 ../libnm-glib/nm-device.c:1798
+#: ../libnm/nm-device.c:1619
msgid "WiMAX"
msgstr "WiMAX"
#. Ask for optional 'pppoe' arguments.
-#: ../clients/cli/connections.c:2992
+#: ../clients/cli/connections.c:3355
msgid "PPPoE"
msgstr "PPPoE"
-#: ../clients/cli/connections.c:2996 ../clients/cli/connections.c:3034
+#: ../clients/cli/connections.c:3359 ../clients/cli/connections.c:3397
msgid "Password [none]: "
msgstr "கடவà¯à®šà¯à®šà¯Šà®²à¯ [none]: "
-#: ../clients/cli/connections.c:2998
+#: ../clients/cli/connections.c:3361
msgid "Service [none]: "
msgstr "சேவை [none]: "
#. Ask for optional 'gsm' or 'cdma' arguments.
-#: ../clients/cli/connections.c:3028
+#: ../clients/cli/connections.c:3391
msgid "mobile broadband"
msgstr "மொபல௠பà¯à®°à®¾à®Ÿà¯à®ªà¯‡à®£à¯à®Ÿà¯"
-#: ../clients/cli/connections.c:3032 ../clients/cli/connections.c:3440
+#: ../clients/cli/connections.c:3395 ../clients/cli/connections.c:3820
msgid "Username [none]: "
msgstr "பயனரà¯à®ªà¯†à®¯à®°à¯ [none]: "
#. Ask for optional 'bluetooth' arguments.
-#: ../clients/cli/connections.c:3047
+#: ../clients/cli/connections.c:3410
msgid "bluetooth"
msgstr "bluetooth"
-#: ../clients/cli/connections.c:3054
+#: ../clients/cli/connections.c:3417
#, c-format
msgid "Bluetooth type %s"
msgstr "Bluetooth வகை %s"
-#: ../clients/cli/connections.c:3060
+#: ../clients/cli/connections.c:3423
#, c-format
msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n"
msgstr "பிழை: 'bt-type': '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© bluetooth வகையலà¯à®².\n"
#. Ask for optional 'vlan' arguments.
#. 13
-#: ../clients/cli/connections.c:3076 ../clients/cli/devices.c:230
-#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:51
-#: ../libnm-core/nm-connection.c:1507 ../libnm-glib/nm-device.c:1808
-#: ../libnm-util/nm-connection.c:1612
+#: ../clients/cli/connections.c:3439 ../clients/cli/devices.c:233
+#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:97
+#: ../libnm-core/nm-connection.c:1549 ../libnm-glib/nm-device.c:1810
+#: ../libnm-util/nm-connection.c:1614 ../libnm/nm-device.c:1631
msgid "VLAN"
msgstr "VLAN"
-#: ../clients/cli/connections.c:3092
+#: ../clients/cli/connections.c:3455
msgid "VLAN flags (<0-7>) [none]: "
msgstr "VLAN கொடிகள௠(<0-7>) [none]: "
-#: ../clients/cli/connections.c:3103
+#: ../clients/cli/connections.c:3466
msgid "Ingress priority maps [none]: "
msgstr "இனà¯à®•à®¿à®°à¯†à®¸à¯ à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ வரைபடஙà¯à®•à®³à¯ [none]: "
-#: ../clients/cli/connections.c:3114
+#: ../clients/cli/connections.c:3477
msgid "Egress priority maps [none]: "
msgstr "எனà¯à®•à®¿à®°à¯†à®¸à¯ à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ வரைபடஙà¯à®•à®³à¯ [none]: "
-#: ../clients/cli/connections.c:3125
+#: ../clients/cli/connections.c:3488
msgid "Bonding mode [balance-rr]: "
msgstr "பிணைபà¯à®ªà®¾à®•à¯à®•à®²à¯ பயனà¯à®®à¯à®±à¯ˆ [balance-rr]: "
#. Ask for optional 'bond' arguments.
-#: ../clients/cli/connections.c:3140
+#: ../clients/cli/connections.c:3504
msgid "bond"
msgstr "பிணைபà¯à®ªà¯"
-#: ../clients/cli/connections.c:3162
+#: ../clients/cli/connections.c:3526
msgid "Bonding primary interface [none]: "
msgstr "பிணைபà¯à®ªà®¾à®•à¯à®•à¯à®®à¯ à®®à¯à®¤à®²à¯ நிலை இடைமà¯à®•à®®à¯ [none]: "
-#: ../clients/cli/connections.c:3165
+#: ../clients/cli/connections.c:3529
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name.\n"
msgstr "பிழை: 'primary': '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இடைமà¯à®•à®ªà¯ பெயரலà¯à®².\n"
-#: ../clients/cli/connections.c:3173
+#: ../clients/cli/connections.c:3537
#, c-format
msgid "Bonding monitoring mode %s"
msgstr "பிணைபà¯à®ªà®¾à®•à¯à®•à®²à¯ கணà¯à®•à®¾à®£à®¿à®ªà¯à®ªà¯ à®®à¯à®±à¯ˆà®®à¯ˆ %s"
-#: ../clients/cli/connections.c:3179
+#: ../clients/cli/connections.c:3543
#, c-format
msgid "Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n"
msgstr ""
"பிழை: '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© கணà¯à®•à®¾à®£à®¿à®ªà¯à®ªà¯à®ªà¯ பயனà¯à®®à¯à®±à¯ˆà®¯à®²à¯à®²; '%s' அலà¯à®²à®¤à¯ '%s' à®à®ªà¯ "
"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯.\n"
-#: ../clients/cli/connections.c:3188
+#: ../clients/cli/connections.c:3552
msgid "Bonding miimon [100]: "
msgstr "பிணைபà¯à®ªà®¾à®•à¯à®•à¯à®®à¯ miimon [100]: "
-#: ../clients/cli/connections.c:3191
+#: ../clients/cli/connections.c:3555
#, c-format
msgid "Error: 'miimon': '%s' is not a valid number <0-%u>.\n"
msgstr "பிழை: 'miimon': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <0-%u>.\n"
-#: ../clients/cli/connections.c:3199
+#: ../clients/cli/connections.c:3563
msgid "Bonding downdelay [0]: "
msgstr "பிணைபà¯à®ªà®¾à®•à¯à®•à¯à®®à¯ downdelay [0]: "
-#: ../clients/cli/connections.c:3202
+#: ../clients/cli/connections.c:3566
#, c-format
msgid "Error: 'downdelay': '%s' is not a valid number <0-%u>.\n"
msgstr "பிழை: 'downdelay': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <0-%u>.\n"
-#: ../clients/cli/connections.c:3210
+#: ../clients/cli/connections.c:3574
msgid "Bonding updelay [0]: "
msgstr "பிணைபà¯à®ªà®¾à®•à¯à®•à¯à®®à¯ updelay [0]: "
-#: ../clients/cli/connections.c:3213
+#: ../clients/cli/connections.c:3577
#, c-format
msgid "Error: 'updelay': '%s' is not a valid number <0-%u>.\n"
msgstr "பிழை: 'updelay': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <0-%u>.\n"
-#: ../clients/cli/connections.c:3222
+#: ../clients/cli/connections.c:3586
msgid "Bonding arp-interval [0]: "
msgstr "பிணைபà¯à®ªà®¾à®•à¯à®•à¯à®®à¯ arp-interval [0]: "
-#: ../clients/cli/connections.c:3225
+#: ../clients/cli/connections.c:3589
#, c-format
msgid "Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n"
msgstr "பிழை: 'arp-interval': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <0-%u>.\n"
#. FIXME: verify the string
-#: ../clients/cli/connections.c:3233
+#: ../clients/cli/connections.c:3597
msgid "Bonding arp-ip-target [none]: "
msgstr "பிணைபà¯à®ªà®¾à®•à¯à®•à¯à®®à¯ arp-ip-target [none]: "
-#: ../clients/cli/connections.c:3253
+#: ../clients/cli/connections.c:3604
+msgid "LACP rate ('slow' or 'fast') [slow]: "
+msgstr "LACP விகிதம௠('slow' அலà¯à®²à®¤à¯ 'fast') [slow]: "
+
+#: ../clients/cli/connections.c:3610
+#, c-format
+#| msgid "Error: 'master': '%s' is not valid UUID nor interface."
+msgid "Error: 'lacp_rate': '%s' is invalid ('slow' or 'fast').\n"
+msgstr "பிழை: 'lacp_rate': '%s' எனà¯à®ªà®¤à¯ தவறானத௠('slow' அலà¯à®²à®¤à¯ 'fast').\n"
+
+#: ../clients/cli/connections.c:3633
msgid "Team JSON configuration [none]: "
msgstr "அணி JSON அமைவாகà¯à®•à®®à¯ [none]: "
-#: ../clients/cli/connections.c:3270
+#: ../clients/cli/connections.c:3650
msgid "team"
msgstr "அணி"
-#: ../clients/cli/connections.c:3276
+#: ../clients/cli/connections.c:3656
msgid "team-slave"
msgstr "team-slave"
#. Ask for optional 'bridge' arguments.
-#: ../clients/cli/connections.c:3288
+#: ../clients/cli/connections.c:3668
msgid "bridge"
msgstr "பிரிடà¯à®œà¯"
-#: ../clients/cli/connections.c:3294
+#: ../clients/cli/connections.c:3674
#, c-format
msgid "Enable STP %s"
msgstr "STP %s ஠செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯"
-#: ../clients/cli/connections.c:3299
+#: ../clients/cli/connections.c:3679
#, c-format
msgid "Error: 'stp': %s.\n"
msgstr "பிழை: 'stp': %s.\n"
-#: ../clients/cli/connections.c:3307
+#: ../clients/cli/connections.c:3687
msgid "STP priority [32768]: "
msgstr "STP à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ [32768]: "
-#: ../clients/cli/connections.c:3311
+#: ../clients/cli/connections.c:3691
#, c-format
msgid "Error: 'priority': '%s' is not a valid number <0-%d>.\n"
msgstr "பிழை: 'priority': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <0-%d>.\n"
-#: ../clients/cli/connections.c:3319
+#: ../clients/cli/connections.c:3699
msgid "Forward delay [15]: "
msgstr "பகிரà¯à®¤à®²à¯ தாமதம௠[15]: "
-#: ../clients/cli/connections.c:3323
+#: ../clients/cli/connections.c:3703
#, c-format
msgid "Error: 'forward-delay': '%s' is not a valid number <2-30>.\n"
msgstr "பிழை: 'forward-delay': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <2-30>.\n"
-#: ../clients/cli/connections.c:3332
+#: ../clients/cli/connections.c:3712
msgid "Hello time [2]: "
msgstr "ஹலோ நேரம௠[2]: "
-#: ../clients/cli/connections.c:3336
+#: ../clients/cli/connections.c:3716
#, c-format
msgid "Error: 'hello-time': '%s' is not a valid number <1-10>.\n"
msgstr "பிழை: 'hello-time': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <1-10>.\n"
-#: ../clients/cli/connections.c:3344
+#: ../clients/cli/connections.c:3724
msgid "Max age [20]: "
msgstr "அதிகபடà¯à®š வயத௠[20]: "
-#: ../clients/cli/connections.c:3348
+#: ../clients/cli/connections.c:3728
#, c-format
msgid "Error: 'max-age': '%s' is not a valid number <6-40>.\n"
msgstr "பிழை: 'max-age': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <6-40>.\n"
-#: ../clients/cli/connections.c:3356
+#: ../clients/cli/connections.c:3736
msgid "MAC address ageing time [300]: "
msgstr "MAC à®®à¯à®•à®µà®°à®¿ வயதாகà¯à®®à¯ காலம௠[300]: "
-#: ../clients/cli/connections.c:3360
+#: ../clients/cli/connections.c:3740
#, c-format
msgid "Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n"
msgstr "பிழை: 'ageing-time': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <0-1000000>.\n"
#. Ask for optional 'bridge-slave' arguments.
-#: ../clients/cli/connections.c:3387
+#: ../clients/cli/connections.c:3767
msgid "bridge-slave"
msgstr "பிரிடà¯à®œà¯-ஸà¯à®²à¯‡à®µà¯"
-#: ../clients/cli/connections.c:3392
+#: ../clients/cli/connections.c:3772
msgid "Bridge port priority [32]: "
msgstr "பிரிடà¯à®œà¯ à®®à¯à®©à¯ˆà®¯ à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ [32]: "
-#: ../clients/cli/connections.c:3405
+#: ../clients/cli/connections.c:3785
msgid "Bridge port STP path cost [100]: "
msgstr "பிரிடà¯à®œà¯ à®®à¯à®©à¯ˆà®¯ STP பாதை செலவ௠[100]: "
-#: ../clients/cli/connections.c:3419
+#: ../clients/cli/connections.c:3799
#, c-format
msgid "Hairpin %s"
msgstr "ஹேரà¯à®ªà®¿à®©à¯ %s"
-#: ../clients/cli/connections.c:3424
+#: ../clients/cli/connections.c:3804
#, c-format
msgid "Error: 'hairpin': %s.\n"
msgstr "பிழை: 'hairpin': %s. \n"
#. Ask for optional 'olpc' arguments.
-#: ../clients/cli/connections.c:3451 ../libnm-glib/nm-device.c:1794
+#: ../clients/cli/connections.c:3831 ../libnm-glib/nm-device.c:1796
+#: ../libnm/nm-device.c:1617
msgid "OLPC Mesh"
msgstr "OLPC மெஷà¯"
-#: ../clients/cli/connections.c:3456
+#: ../clients/cli/connections.c:3836
msgid "OLPC Mesh channel [1]: "
msgstr "OLPC Mesh சேனல௠[1]: "
-#: ../clients/cli/connections.c:3459
+#: ../clients/cli/connections.c:3839
#, c-format
msgid "Error: 'channel': '%s' is not a valid number <1-13>.\n"
msgstr "பிழை: 'channel': '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² <1-13>.\n"
-#: ../clients/cli/connections.c:3467
+#: ../clients/cli/connections.c:3847
msgid "DHCP anycast MAC address [none]: "
msgstr "DHCP anycast MAC à®®à¯à®•à®µà®°à®¿ [none]: "
-#: ../clients/cli/connections.c:3512
-msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
-msgstr "IPv4 à®®à¯à®•à®µà®°à®¿ (IP[/plen] [gateway]) [none]: "
+#: ../clients/cli/connections.c:3889
+#| msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
+msgid "IPv4 address (IP[/plen]) [none]: "
+msgstr "IPv4 à®®à¯à®•à®µà®°à®¿ (IP[/plen]) [none]:"
-#: ../clients/cli/connections.c:3514
-msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
-msgstr "IPv6 à®®à¯à®•à®µà®°à®¿ (IP[/plen] [gateway]) [none]: "
+#: ../clients/cli/connections.c:3891
+#| msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
+msgid "IPv6 address (IP[/plen]) [none]: "
+msgstr "IPv6 à®®à¯à®•à®µà®°à®¿ (IP[/plen]) [none]: "
-#: ../clients/cli/connections.c:3532
+#: ../clients/cli/connections.c:3905
#, c-format
-msgid " Address successfully added: %s %s\n"
-msgstr " à®®à¯à®•à®µà®°à®¿ வெறà¯à®±à®¿à®•à®°à®®à®¾à®• சேரà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯: %s %s\n"
+#| msgid " Address successfully added: %s %s\n"
+msgid " Address successfully added: %s\n"
+msgstr " à®®à¯à®•à®µà®°à®¿ வெறà¯à®±à®¿à®•à®°à®®à®¾à®• சேரà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯: %s\n"
-#: ../clients/cli/connections.c:3534
+#: ../clients/cli/connections.c:3907
#, c-format
-msgid " Warning: address already present: %s %s\n"
-msgstr " எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: à®®à¯à®•à®µà®°à®¿ à®à®±à¯à®•à®©à®µà¯‡ உளà¯à®³à®¤à¯: %s %s\n"
+#| msgid " Warning: address already present: %s %s\n"
+msgid " Warning: address already present: %s\n"
+msgstr " எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: à®®à¯à®•à®µà®°à®¿ à®à®±à¯à®•à®©à®µà¯‡ உளà¯à®³à®¤à¯: %s\n"
-#: ../clients/cli/connections.c:3536
+#: ../clients/cli/connections.c:3909
#, c-format
msgid " Warning: ignoring garbage at the end: '%s'\n"
msgstr " எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: கடைசியில௠உளà¯à®³ பà¯à®°à®¿à®¯à®¾à®¤à®µà®±à¯à®±à¯ˆà®ªà¯ பà¯à®±à®•à¯à®•à®£à®¿à®•à¯à®•à®¿à®±à®¤à¯: '%s'\n"
-#: ../clients/cli/connections.c:3538 ../clients/cli/connections.c:4361
-#: ../clients/cli/connections.c:4422 ../clients/cli/connections.c:4824
-#: ../clients/cli/connections.c:4834
+#: ../clients/cli/connections.c:3911 ../clients/cli/connections.c:4791
+#: ../clients/cli/connections.c:4852 ../clients/cli/connections.c:5253
+#: ../clients/cli/connections.c:5286
msgid "Error: "
msgstr "பிழை: "
+#: ../clients/cli/connections.c:3931
+#| msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
+msgid "IPv4 gateway [none]: "
+msgstr "IPv4 நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯ [none]: "
+
+#: ../clients/cli/connections.c:3934
+#| msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
+msgid "IPv6 gateway [none]: "
+msgstr "IPv6 நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯ [none]:"
+
+#: ../clients/cli/connections.c:3954
+#, c-format
+#| msgid "Error: invalid argument '%s'\n"
+msgid "Error: invalid gateway address '%s'\n"
+msgstr "பிழை: '%s' எனà¯à®®à¯ நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯ à®®à¯à®•à®µà®°à®¿ தவறானதà¯\n"
+
#. Ask for IP addresses
-#: ../clients/cli/connections.c:3555
+#: ../clients/cli/connections.c:3967
#, c-format
msgid "Do you want to add IP addresses? %s"
msgstr "IP à®®à¯à®•à®µà®°à®¿à®•à®³à¯ˆà®šà¯ சேரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à®¾? %s"
-#: ../clients/cli/connections.c:3562
+#: ../clients/cli/connections.c:3975
#, c-format
msgid "Press <Enter> to finish adding addresses.\n"
msgstr "à®®à¯à®•à®µà®°à®¿à®•à®³à¯ˆà®šà¯ சேரà¯à®•à¯à®•à¯à®®à¯ செயலை à®®à¯à®Ÿà®¿à®•à¯à®• <Enter> à® à®…à®´à¯à®¤à¯à®¤à®µà¯à®®à¯.\n"
-#: ../clients/cli/connections.c:3701
+#: ../clients/cli/connections.c:4113
#, c-format
msgid "Error: 'parent': not valid without 'p-key'."
msgstr "பிழை: 'p-key' இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ 'parent': செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®¾à®• இலà¯à®²à®¾à®®à®²à¯ போகà¯à®®à¯."
-#: ../clients/cli/connections.c:3753 ../clients/cli/connections.c:4743
+#: ../clients/cli/connections.c:4168 ../clients/cli/connections.c:5173
msgid "SSID: "
msgstr "SSID: "
-#: ../clients/cli/connections.c:3756 ../clients/cli/connections.c:4746
+#: ../clients/cli/connections.c:4171 ../clients/cli/connections.c:5176
msgid "Error: 'ssid' is required."
msgstr "பிழை: 'ssid' தேவை."
-#: ../clients/cli/connections.c:3813
+#: ../clients/cli/connections.c:4235
msgid "WiMAX NSP name: "
msgstr "WiMAX NSP பெயரà¯: "
-#: ../clients/cli/connections.c:3816
+#: ../clients/cli/connections.c:4238
msgid "Error: 'nsp' is required."
msgstr "பிழை: 'nsp' தேவை."
-#: ../clients/cli/connections.c:3868
+#: ../clients/cli/connections.c:4290
msgid "PPPoE username: "
msgstr "PPPoE பயனரà¯à®ªà¯†à®¯à®°à¯: "
-#: ../clients/cli/connections.c:3871
+#: ../clients/cli/connections.c:4293
msgid "Error: 'username' is required."
msgstr "பிழை: 'username' தேவை."
-#: ../clients/cli/connections.c:3940
+#: ../clients/cli/connections.c:4362
msgid "APN: "
msgstr "APN: "
-#: ../clients/cli/connections.c:3943
+#: ../clients/cli/connections.c:4365
msgid "Error: 'apn' is required."
msgstr "பிழை: 'apn' தேவை."
-#: ../clients/cli/connections.c:4001
+#: ../clients/cli/connections.c:4423
msgid "Bluetooth device address: "
msgstr "Bluetooth சாதன à®®à¯à®•à®µà®°à®¿: "
-#: ../clients/cli/connections.c:4004
+#: ../clients/cli/connections.c:4426
msgid "Error: 'addr' is required."
msgstr "பிழை: 'addr' தேவை."
-#: ../clients/cli/connections.c:4045
+#: ../clients/cli/connections.c:4467
#, c-format
msgid "Error: 'bt-type': '%s' not valid; use [%s, %s (%s), %s]."
msgstr ""
"பிழை: 'bt-type': '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; [%s, %s (%s), %s] à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯."
-#: ../clients/cli/connections.c:4089
+#: ../clients/cli/connections.c:4511
msgid "VLAN parent device or connection UUID: "
msgstr "VLAN தாய௠சாதனம௠அலà¯à®²à®¤à¯ இணைபà¯à®ªà¯ UUID: "
-#: ../clients/cli/connections.c:4092
+#: ../clients/cli/connections.c:4514
msgid "Error: 'dev' is required."
msgstr "பிழை: 'dev' தேவை."
-#: ../clients/cli/connections.c:4096
+#: ../clients/cli/connections.c:4518
msgid "VLAN ID <0-4095>: "
msgstr "VLAN ID <0-4095>: "
-#: ../clients/cli/connections.c:4099
+#: ../clients/cli/connections.c:4521
msgid "Error: 'id' is required."
msgstr "பிழை: 'id' தேவை."
-#: ../clients/cli/connections.c:4105
+#: ../clients/cli/connections.c:4527
#, c-format
msgid "Error: 'id': '%s' is not valid; use <0-4095>."
msgstr "பிழை: 'id': '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; <0-4095> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯."
-#: ../clients/cli/connections.c:4115
+#: ../clients/cli/connections.c:4537
#, c-format
msgid "Error: 'dev': '%s' is neither UUID, interface name, nor MAC."
msgstr ""
"பிழை: 'dev': '%s' எனà¯à®ªà®¤à¯ UUID, இடைமà¯à®•à®ªà¯ பெயரà¯, MAC ஆகியவறà¯à®±à®¿à®²à¯ எதà¯à®µà¯à®®à®²à¯à®²."
-#: ../clients/cli/connections.c:4244
+#: ../clients/cli/connections.c:4671
#, c-format
msgid "Error: 'mode': %s."
msgstr "பிழை: 'mode': %s."
-#: ../clients/cli/connections.c:4253
+#: ../clients/cli/connections.c:4680
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name."
msgstr "பிழை: 'primary': '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இடைமà¯à®•à®ªà¯ பெயரலà¯à®²."
-#: ../clients/cli/connections.c:4302 ../clients/cli/connections.c:4400
-#: ../clients/cli/connections.c:4602
+#: ../clients/cli/connections.c:4732 ../clients/cli/connections.c:4830
+#: ../clients/cli/connections.c:5032
msgid "Error: 'master' is required."
msgstr "பிழை: 'master' தேவை."
-#: ../clients/cli/connections.c:4308 ../clients/cli/connections.c:4406
-#: ../clients/cli/connections.c:4608
+#: ../clients/cli/connections.c:4738 ../clients/cli/connections.c:4836
+#: ../clients/cli/connections.c:5038
#, c-format
msgid "Warning: master='%s' doesn't refer to any existing profile.\n"
msgstr ""
"எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: master='%s' தறà¯à®ªà¯‹à®¤à¯à®³à¯à®³ தனியமைபà¯à®ªà¯ எதனையà¯à®®à¯ கà¯à®±à®¿à®•à¯à®•à®µà®¿à®²à¯à®²à¯ˆ.\n"
-#: ../clients/cli/connections.c:4311 ../clients/cli/connections.c:4414
-#: ../clients/cli/connections.c:4611
+#: ../clients/cli/connections.c:4741 ../clients/cli/connections.c:4844
+#: ../clients/cli/connections.c:5041
#, c-format
msgid ""
"Warning: 'type' is currently ignored. We only support ethernet slaves for "
@@ -1992,82 +2381,115 @@ msgstr ""
"ஸà¯à®²à¯‡à®µà¯à®•à®³à¯ˆ "
"மடà¯à®Ÿà¯à®®à¯‡ ஆதரிகà¯à®•à®¿à®±à¯‹à®®à¯.\n"
-#: ../clients/cli/connections.c:4508
+#: ../clients/cli/connections.c:4938
#, c-format
msgid "Error: 'stp': %s."
msgstr "பிழை: 'stp': %s."
-#: ../clients/cli/connections.c:4638
+#: ../clients/cli/connections.c:5068
#, c-format
msgid "Error: 'hairpin': %s."
msgstr "பிழை: 'hairpin': %s."
-#: ../clients/cli/connections.c:4691
+#: ../clients/cli/connections.c:5121
msgid "Error: 'vpn-type' is required."
msgstr "பிழை: 'vpn-type' தேவை."
-#: ../clients/cli/connections.c:4698
+#: ../clients/cli/connections.c:5128
#, c-format
msgid "Warning: 'vpn-type': %s not known.\n"
msgstr "எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: 'vpn-type': %s தெரியாததà¯.\n"
-#: ../clients/cli/connections.c:4759
+#: ../clients/cli/connections.c:5189
#, c-format
msgid "Error: 'channel': '%s' is not valid; use <1-13>."
msgstr "பிழை: 'channel': '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; <1-13> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯."
-#: ../clients/cli/connections.c:4791
+#: ../clients/cli/connections.c:5221
#, c-format
msgid "Error: '%s' is not a valid connection type."
msgstr "பிழை: '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இணைபà¯à®ªà¯ வகையலà¯à®²."
-#: ../clients/cli/connections.c:4892
+#: ../clients/cli/connections.c:5265
+#, c-format
+msgid "Error: IPv4 gateway specified without IPv4 addresses"
+msgstr "பிழை: IPv4 à®®à¯à®•à®µà®°à®¿à®•à®³à¯ இலà¯à®²à®¾à®®à®²à¯, IPv4 நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
+
+#: ../clients/cli/connections.c:5269
+#, c-format
+#| msgid "Error: no valid parameter specified."
+msgid "Error: multiple IPv4 gateways specified"
+msgstr "பிழை: ஒனà¯à®±à¯à®•à¯à®•à¯à®®à¯ அதிக IPv4 நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯à®•à®³à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿà®©"
+
+#: ../clients/cli/connections.c:5273
+#, c-format
+#| msgid "invalid gateway '%s'"
+msgid "Error: Invalid IPv4 gateway '%s'"
+msgstr "பிழை: '%s' எனà¯à®ªà®¤à¯ தவறான IPv4 நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯"
+
+#: ../clients/cli/connections.c:5298
+#, c-format
+msgid "Error: IPv6 gateway specified without IPv6 addresses"
+msgstr "பிழை: IPv6 à®®à¯à®•à®µà®°à®¿à®•à®³à¯ இலà¯à®²à®¾à®®à®²à¯ IPv6 நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
+
+#: ../clients/cli/connections.c:5302
+#, c-format
+#| msgid "Error: no valid parameter specified."
+msgid "Error: multiple IPv6 gateways specified"
+msgstr "பிழை: ஒனà¯à®•à¯à®•à¯à®®à¯ அதிகமான IPv6 நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯à®•à®³à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿà®©"
+
+#: ../clients/cli/connections.c:5306
+#, c-format
+#| msgid "invalid gateway '%s'"
+msgid "Error: Invalid IPv6 gateway '%s'"
+msgstr "பிழை: '%s' எனà¯à®ªà®¤à¯ தவறான IPv6 நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯"
+
+#: ../clients/cli/connections.c:5366
#, c-format
-#| msgid "Error: Failed to add '%s' connection: (%d) %s"
msgid "Error: Failed to add '%s' connection: %s"
msgstr "பிழை: '%s' இணைபà¯à®ªà¯ˆà®šà¯ சேரà¯à®ªà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s"
-#: ../clients/cli/connections.c:4897
+#: ../clients/cli/connections.c:5371
#, c-format
msgid "Connection '%s' (%s) successfully added.\n"
msgstr "இணைபà¯à®ªà¯ '%s' (%s) வெறà¯à®±à®¿à®•à®°à®®à®¾à®•à®šà¯ சேரà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
-#: ../clients/cli/connections.c:5108
+#: ../clients/cli/connections.c:5591
#, c-format
msgid "Error: 'type' argument is required."
msgstr "பிழை: 'type' மதிபà¯à®ªà¯à®°à¯ தேவை."
-#: ../clients/cli/connections.c:5116
+#: ../clients/cli/connections.c:5599
#, c-format
msgid "Error: invalid connection type; %s."
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ இணைபà¯à®ªà¯ வகை; %s."
-#: ../clients/cli/connections.c:5125
+#: ../clients/cli/connections.c:5608
#, c-format
msgid "Error: 'autoconnect': %s."
msgstr "பிழை: 'autoconnect': %s."
-#: ../clients/cli/connections.c:5135
+#: ../clients/cli/connections.c:5618
#, c-format
msgid "Error: 'save': %s."
msgstr "பிழை: 'save': %s."
-#: ../clients/cli/connections.c:5151
+#: ../clients/cli/connections.c:5634
msgid "Interface name [*]: "
msgstr "இடைமà¯à®•à®ªà¯ பெயர௠[*]: "
-#: ../clients/cli/connections.c:5156
+#: ../clients/cli/connections.c:5639
#, c-format
msgid "Error: 'ifname' argument is required."
msgstr "பிழை: 'ifname' மதிபà¯à®ªà¯à®°à¯ தேவை."
-#: ../clients/cli/connections.c:5163
+#: ../clients/cli/connections.c:5646
#, c-format
msgid "Error: 'ifname': '%s' is not a valid interface nor '*'."
msgstr ""
"பிழை: 'ifname': '%s' எனà¯à®ªà®¤à¯ ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இடைமà¯à®•à®®à¯ அலà¯à®² '*' உம௠அலà¯à®²."
-#: ../clients/cli/connections.c:5951
+#: ../clients/cli/connections.c:6422
#, c-format
msgid "['%s' setting values]\n"
msgstr "['%s' அமைவ௠மதிபà¯à®ªà¯à®•à®³à¯]\n"
@@ -2075,8 +2497,23 @@ msgstr "['%s' அமைவ௠மதிபà¯à®ªà¯à®•à®³à¯]\n"
#. TRANSLATORS: do not translate command names and keywords before ::
#. * However, you should translate terms enclosed in <>.
#.
-#: ../clients/cli/connections.c:6033
-#, c-format
+#: ../clients/cli/connections.c:6504
+#, c-format
+#| msgid ""
+#| "---[ Main menu ]---\n"
+#| "goto [<setting> | <prop>] :: go to a setting or property\n"
+#| "remove <setting>[.<prop>] | <prop> :: remove setting or reset property "
+#| "value\n"
+#| "set [<setting>.<prop> <value>] :: set property value\n"
+#| "describe [<setting>.<prop>] :: describe property\n"
+#| "print [all | <setting>[.<prop>]] :: print the connection\n"
+#| "verify [all] :: verify the connection\n"
+#| "save [persistent|temporary] :: save the connection\n"
+#| "activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
+#| "back :: go one level up (back)\n"
+#| "help/? [<command>] :: print this help\n"
+#| "nmcli <conf-option> <value> :: nmcli configuration\n"
+#| "quit :: exit nmcli\n"
msgid ""
"---[ Main menu ]---\n"
"goto [<setting> | <prop>] :: go to a setting or property\n"
@@ -2085,7 +2522,7 @@ msgid ""
"set [<setting>.<prop> <value>] :: set property value\n"
"describe [<setting>.<prop>] :: describe property\n"
"print [all | <setting>[.<prop>]] :: print the connection\n"
-"verify [all] :: verify the connection\n"
+"verify [all | fix] :: verify the connection\n"
"save [persistent|temporary] :: save the connection\n"
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
"back :: go one level up (back)\n"
@@ -2093,22 +2530,23 @@ msgid ""
"nmcli <conf-option> <value> :: nmcli configuration\n"
"quit :: exit nmcli\n"
msgstr ""
-"---[ Main menu ]---\n"
-"goto [<setting> | <prop>] :: ஒர௠அமைவ௠அலà¯à®²à®¤à¯ பணà¯à®ªà¯à®•à¯à®•à¯à®šà¯ செலà¯\n"
-"remove <setting>[.<prop>] | <prop> :: அமைவை நீகà¯à®•à¯ அலà¯à®²à®¤à¯ பணà¯à®ªà¯ˆ மீடà¯à®Ÿà®®à¯ˆ "
-"value\n"
-"set [<setting>.<prop> <value>] :: பணà¯à®ªà¯ மதிபà¯à®ªà¯ˆ அமை\n"
+"---[ பிரதான மென௠]---\n"
+"goto [<setting> | <prop>] :: ஒர௠அமைவ௠அலà¯à®²à®¤à¯ பணà¯à®ªà®¿à®±à¯à®•à¯à®šà¯ செலà¯\n"
+"remove <setting>[.<prop>] | <prop> :: அமைவை நீகà¯à®•à¯ அலà¯à®²à®¤à¯ பணà¯à®ªà®¿à®©à¯ மதிபà¯à®ªà¯ˆ "
+"மீடà¯à®Ÿà®®à¯ˆ "
+"\n"
+"set [<setting>.<prop> <value>] :: பணà¯à®ªà®¿à®©à¯ மதிபà¯à®ªà¯ˆ அமை\n"
"describe [<setting>.<prop>] :: பணà¯à®ªà¯ˆ விவரி\n"
"print [all | <setting>[.<prop>]] :: இணைபà¯à®ªà¯ˆ அசà¯à®šà®¿à®Ÿà¯\n"
-"verify [all] :: இணைபà¯à®ªà¯ˆ சரிபாரà¯\n"
+"verify [all | fix] :: இணைபà¯à®ªà¯ˆà®šà¯ சரிபாரà¯\n"
"save [persistent|temporary] :: இணைபà¯à®ªà¯ˆà®šà¯ சேமி\n"
"activate [<ifname>] [/<ap>|<nsp>] :: இணைபà¯à®ªà¯ˆà®šà¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯\n"
-"back :: ஒர௠நிலை மேலே செல௠(பினà¯)\n"
-"help/? [<command>] :: இநà¯à®¤ உதவியை அசà¯à®šà®¿à®Ÿà¯\n"
+"back :: ஒர௠நிலை மேலே செல௠(திரà¯à®®à¯à®ªà¯)\n"
+"help/? [<command>] :: இநà¯à®¤ உதவித௠தகவலை அசà¯à®šà®¿à®Ÿà¯\n"
"nmcli <conf-option> <value> :: nmcli அமைவாகà¯à®•à®®à¯\n"
"quit :: nmcli இலிரà¯à®¨à¯à®¤à¯ வெளியேறà¯\n"
-#: ../clients/cli/connections.c:6060
+#: ../clients/cli/connections.c:6531
#, c-format
msgid ""
"goto <setting>[.<prop>] | <prop> :: enter setting/property for editing\n"
@@ -2127,7 +2565,7 @@ msgstr ""
" nmcli connection> goto secondaries\n"
" nmcli> goto ipv4.addresses\n"
-#: ../clients/cli/connections.c:6067
+#: ../clients/cli/connections.c:6538
#, c-format
msgid ""
"remove <setting>[.<prop>] :: remove setting or reset property value\n"
@@ -2148,7 +2586,7 @@ msgstr ""
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯à®•à®³à¯: nmcli> remove wifi-sec\n"
" nmcli> remove eth.mtu\n"
-#: ../clients/cli/connections.c:6074
+#: ../clients/cli/connections.c:6545
#, c-format
msgid ""
"set [<setting>.<prop> <value>] :: set property value\n"
@@ -2163,7 +2601,7 @@ msgstr ""
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: nmcli> set con.id My connection\n"
-#: ../clients/cli/connections.c:6079
+#: ../clients/cli/connections.c:6550
#, c-format
msgid ""
"describe [<setting>.<prop>] :: describe property\n"
@@ -2177,7 +2615,7 @@ msgstr ""
"nm-"
"settings(5) கையேடà¯à®Ÿà¯à®ªà¯ பகà¯à®•à®¤à¯à®¤à¯ˆà®ªà¯ பாரà¯à®•à¯à®•à®²à®¾à®®à¯.\n"
-#: ../clients/cli/connections.c:6084
+#: ../clients/cli/connections.c:6555
#, c-format
msgid ""
"print [all] :: print setting or connection values\n"
@@ -2192,27 +2630,42 @@ msgstr ""
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: nmcli ipv4> print all\n"
-#: ../clients/cli/connections.c:6089
+#: ../clients/cli/connections.c:6560
#, c-format
+#| msgid ""
+#| "verify [all] :: verify setting or connection validity\n"
+#| "\n"
+#| "Verifies whether the setting or connection is valid and can be saved "
+#| "later. It indicates invalid values on error.\n"
+#| "\n"
+#| "Examples: nmcli> verify\n"
+#| " nmcli bond> verify\n"
msgid ""
-"verify [all] :: verify setting or connection validity\n"
+"verify [all | fix] :: verify setting or connection validity\n"
"\n"
-"Verifies whether the setting or connection is valid and can be saved later. "
-"It indicates invalid values on error.\n"
+"Verifies whether the setting or connection is valid and can be saved later.\n"
+"It indicates invalid values on error. Some errors may be fixed "
+"automatically\n"
+"by 'fix' option.\n"
"\n"
"Examples: nmcli> verify\n"
+" nmcli> verify fix\n"
" nmcli bond> verify\n"
msgstr ""
-"verify [all] :: அமைவ௠அலà¯à®²à®¤à¯ இணைபà¯à®ªà®¿à®©à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¤à¯à®¤à®©à¯à®®à¯ˆà®¯à¯ˆ சரிபாரà¯\n"
+"verify [all | fix] :: அமைவ௠அலà¯à®²à®¤à¯ இணைபà¯à®ªà¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®¾ எனச௠"
+"சரிபாரà¯à®•à¯à®•à¯à®®à¯\n"
"\n"
-"ஒர௠அமைவ௠அலà¯à®²à®¤à¯ இணைபà¯à®ªà¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®¾ எனà¯à®±à¯à®®à¯ அதை பிறக௠சேமிகà¯à®• à®®à¯à®Ÿà®¿à®¯à¯à®®à®¾ "
-"எனà¯à®±à¯à®®à¯ "
-"சரிபாரà¯à®•à¯à®•à¯à®®à¯. செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ மதிபà¯à®ªà¯à®•à®³à¯ இரà¯à®¨à¯à®¤à®¾à®²à¯ பிழை மூலம௠தெரிவிகà¯à®•à¯à®®à¯.\n"
+"அமைவ௠அலà¯à®²à®¤à¯ இணைபà¯à®ªà¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®¾ எனà¯à®±à¯à®®à¯ பினà¯à®©à®°à¯ அதனைச௠சேமிகà¯à®• à®®à¯à®Ÿà®¿à®¯à¯à®®à®¾ "
+"எனà¯à®±à¯à®®à¯ எனச௠சரிபாரà¯à®•à¯à®•à¯à®®à¯.\n"
+"இத௠பிழையில௠தவறான மதிபà¯à®ªà¯à®•à®³à¯ˆà®•à¯ காணà¯à®ªà®¿à®•à¯à®•à¯à®®à¯. 'fix' விரà¯à®ªà¯à®ªà®¤à¯à®¤à¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¿ "
+"சில பிழைகளை\n"
+"தானாகவே சரிசெயà¯à®¯ à®®à¯à®Ÿà®¿à®¯à¯à®®à¯.\n"
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯à®•à®³à¯: nmcli> verify\n"
+" nmcli> verify fix\n"
" nmcli bond> verify\n"
-#: ../clients/cli/connections.c:6096
+#: ../clients/cli/connections.c:6569
#, c-format
msgid ""
"save [persistent|temporary] :: save the connection\n"
@@ -2242,7 +2695,7 @@ msgstr ""
"செயலில௠இரà¯à®•à¯à®•à®¾à®¤à¯. நிரநà¯à®¤à®°à®®à®¾à®© இணைபà¯à®ªà¯ˆ à®®à¯à®´à¯à®µà®¤à¯à®®à¯ நீகà¯à®•, இணைபà¯à®ªà¯\n"
"தனியமைபà¯à®ªà¯ˆ நீகà¯à®• வேணà¯à®Ÿà¯à®®à¯.\n"
-#: ../clients/cli/connections.c:6107
+#: ../clients/cli/connections.c:6580
#, c-format
msgid ""
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
@@ -2264,7 +2717,7 @@ msgstr ""
"à® "
"à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà®¾à®• சேரà¯à®•à¯à®•à®µà¯à®®à¯)\n"
-#: ../clients/cli/connections.c:6114 ../clients/cli/connections.c:6271
+#: ../clients/cli/connections.c:6587 ../clients/cli/connections.c:6745
#, c-format
msgid ""
"back :: go to upper menu level\n"
@@ -2273,7 +2726,7 @@ msgstr ""
"back :: மெனà¯à®µà®¿à®©à¯ மேல௠நிலைகà¯à®•à¯à®šà¯ செலà¯\n"
"\n"
-#: ../clients/cli/connections.c:6117
+#: ../clients/cli/connections.c:6590
#, c-format
msgid ""
"help/? [<command>] :: help for the nmcli commands\n"
@@ -2282,14 +2735,35 @@ msgstr ""
"help/? [<command>] :: nmcli கடà¯à®Ÿà®³à¯ˆà®•à®³à¯à®•à¯à®•à®¾à®© உதவி\n"
"\n"
-#: ../clients/cli/connections.c:6120
-#, c-format
+#: ../clients/cli/connections.c:6593
+#, c-format
+#| msgid ""
+#| "nmcli [<conf-option> <value>] :: 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"
+#| "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"
+#| "Examples: nmcli> nmcli status-line yes\n"
+#| " nmcli> nmcli save-confirmation no\n"
+#| " nmcli> nmcli prompt-color 3\n"
msgid ""
"nmcli [<conf-option> <value>] :: 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"
@@ -2305,11 +2779,12 @@ msgid ""
" nmcli> nmcli save-confirmation no\n"
" nmcli> nmcli prompt-color 3\n"
msgstr ""
-"nmcli [<conf-option> <value>] :: nmcli அமைவாகà¯à®•à®®à¯\n"
+"nmcli [<conf-option> <value>] :: nmcli configuration\n"
"\n"
"nmcli ஠அமைவாகà¯à®•à®®à¯ செயà¯à®¯à¯à®®à¯. பினà¯à®µà®°à¯à®®à¯ விரà¯à®ªà¯à®ªà®™à¯à®•à®³à¯ உளà¯à®³à®©:\n"
"status-line yes | no [à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯: no]\n"
"save-confirmation yes | no [à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯: yes]\n"
+"show-secrets yes | no [à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯: no]\n"
"prompt-color <0-8> [à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯: 0]\n"
" 0 = normal\n"
" 1 = black\n"
@@ -2325,7 +2800,7 @@ msgstr ""
" nmcli> nmcli save-confirmation no\n"
" nmcli> nmcli prompt-color 3\n"
-#: ../clients/cli/connections.c:6140 ../clients/cli/connections.c:6277
+#: ../clients/cli/connections.c:6614 ../clients/cli/connections.c:6751
#, c-format
msgid ""
"quit :: exit nmcli\n"
@@ -2339,8 +2814,8 @@ msgstr ""
"உளà¯à®³ ஒர௠இணைபà¯à®ªà¯ "
"சேமிகà¯à®•à®ªà¯à®ªà®Ÿà®¾à®¤à®¿à®°à¯à®¨à¯à®¤à®¾à®²à¯, செயலை உறà¯à®¤à®¿à®ªà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à®¾à®±à¯ பயனரிடம௠கேடà¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
-#: ../clients/cli/connections.c:6145 ../clients/cli/connections.c:6282
-#: ../clients/cli/connections.c:6687 ../clients/cli/connections.c:7577
+#: ../clients/cli/connections.c:6619 ../clients/cli/connections.c:6756
+#: ../clients/cli/connections.c:7167 ../clients/cli/connections.c:8083
#, c-format
msgid "Unknown command: '%s'\n"
msgstr "தெரியாத கடà¯à®Ÿà®³à¯ˆ: '%s'\n"
@@ -2348,7 +2823,7 @@ msgstr "தெரியாத கடà¯à®Ÿà®³à¯ˆ: '%s'\n"
#. TRANSLATORS: do not translate command names and keywords before ::
#. * However, you should translate terms enclosed in <>.
#.
-#: ../clients/cli/connections.c:6211
+#: ../clients/cli/connections.c:6685
#, c-format
msgid ""
"---[ Property menu ]---\n"
@@ -2375,7 +2850,7 @@ msgstr ""
"அசà¯à®šà®¿à®Ÿà¯\n"
"quit :: nmcli இலிரà¯à®¨à¯à®¤à¯ வெளியேறà¯\n"
-#: ../clients/cli/connections.c:6236
+#: ../clients/cli/connections.c:6710
#, c-format
msgid ""
"set [<value>] :: set new value\n"
@@ -2386,7 +2861,7 @@ msgstr ""
"\n"
"இநà¯à®¤à®•à¯ கடà¯à®Ÿà®³à¯ˆ இநà¯à®¤ மதிபà¯à®ªà¯à®•à¯à®•à¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ <value> ஠அமைகà¯à®•à¯à®®à¯\n"
-#: ../clients/cli/connections.c:6240
+#: ../clients/cli/connections.c:6714
#, c-format
msgid ""
"add [<value>] :: append new value to the property\n"
@@ -2403,7 +2878,7 @@ msgstr ""
"('set' à®à®ªà¯ "
"போலவே).\n"
-#: ../clients/cli/connections.c:6246
+#: ../clients/cli/connections.c:6720
#, c-format
msgid ""
"change :: change current value\n"
@@ -2414,7 +2889,7 @@ msgstr ""
"\n"
"நடபà¯à®ªà¯ மதிபà¯à®ªà¯ˆà®•à¯ காடà¯à®Ÿà¯à®®à¯, அபà¯à®ªà¯‹à®¤à¯ மதிபà¯à®ªà¯ˆà®¤à¯ திரà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à¯à®®à¯.\n"
-#: ../clients/cli/connections.c:6250
+#: ../clients/cli/connections.c:6724
#, c-format
msgid ""
"remove [<value>|<index>|<option name>] :: delete the value\n"
@@ -2452,7 +2927,7 @@ msgstr ""
" nmcli bond.options> remove downdelay\n"
"\n"
-#: ../clients/cli/connections.c:6261
+#: ../clients/cli/connections.c:6735
#, c-format
msgid ""
"describe :: describe property\n"
@@ -2466,7 +2941,7 @@ msgstr ""
"nm-"
"settings(5) கையேடà¯à®Ÿà¯à®ªà¯ பகà¯à®•à®¤à¯à®¤à¯ˆà®ªà¯ பாரà¯à®•à¯à®•à®²à®¾à®®à¯.\n"
-#: ../clients/cli/connections.c:6266
+#: ../clients/cli/connections.c:6740
#, c-format
msgid ""
"print [property|setting|connection] :: print property (setting, connection) "
@@ -2482,7 +2957,7 @@ msgstr ""
"அமைவ௠அலà¯à®²à®¤à¯ "
"இணைபà¯à®ªà®¿à®©à¯ à®®à¯à®´à¯ மதிபà¯à®ªà¯à®•à®³à¯ˆà®¯à¯à®®à¯ காணà¯à®ªà®¿à®•à¯à®•à®µà¯à®®à¯ à®®à¯à®Ÿà®¿à®¯à¯à®®à¯.\n"
-#: ../clients/cli/connections.c:6274
+#: ../clients/cli/connections.c:6748
#, c-format
msgid ""
"help/? [<command>] :: help for nmcli commands\n"
@@ -2491,28 +2966,28 @@ msgstr ""
"help/? [<command>] :: nmcli கடà¯à®Ÿà®³à¯ˆà®•à®³à¯à®•à¯à®•à®¾à®© உதவி\n"
"\n"
-#: ../clients/cli/connections.c:6373
+#: ../clients/cli/connections.c:6846
#, c-format
msgid "Error: Connection activation failed.\n"
msgstr "பிழை: இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿.\n"
-#: ../clients/cli/connections.c:6456
+#: ../clients/cli/connections.c:6929
#, c-format
msgid "Error: setting '%s' is mandatory and cannot be removed.\n"
msgstr "பிழை: '%s' அமைவ௠மிக அவசியமானதà¯, அதை நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯.\n"
#. TRANSLATORS: status line in nmcli connection editor
-#: ../clients/cli/connections.c:6474
+#: ../clients/cli/connections.c:6947
#, c-format
msgid "[ Type: %s | Name: %s | UUID: %s | Dirty: %s | Temp: %s ]\n"
msgstr "[ Type: %s | Name: %s | UUID: %s | Dirty: %s | Temp: %s ]\n"
-#: ../clients/cli/connections.c:6509
+#: ../clients/cli/connections.c:6983
#, c-format
msgid "The connection is not saved. Do you really want to quit? %s"
msgstr "இணைபà¯à®ªà¯ சேமிகà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ. நிசà¯à®šà®¯à®®à¯ வெளியேற வேணà¯à®Ÿà¯à®®à®¾? %s"
-#: ../clients/cli/connections.c:6554
+#: ../clients/cli/connections.c:7028
#, c-format
msgid ""
"The connection profile has been removed from another client. You may type "
@@ -2522,60 +2997,60 @@ msgstr ""
"பிரதான "
"மெனà¯à®µà®¿à®²à¯ 'save' என தடà¯à®Ÿà®šà¯à®šà¯ செயà¯à®¯à®²à®¾à®®à¯.\n"
-#: ../clients/cli/connections.c:6576 ../clients/cli/connections.c:6991
-#: ../clients/cli/connections.c:7046
+#: ../clients/cli/connections.c:7050 ../clients/cli/connections.c:7471
+#: ../clients/cli/connections.c:7526
#, c-format
msgid "Enter '%s' value: "
msgstr "'%s' மதிபà¯à®ªà¯ˆ உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯: "
-#: ../clients/cli/connections.c:6591 ../clients/cli/connections.c:6609
-#: ../clients/cli/connections.c:6995 ../clients/cli/connections.c:7051
+#: ../clients/cli/connections.c:7065 ../clients/cli/connections.c:7087
+#: ../clients/cli/connections.c:7475 ../clients/cli/connections.c:7531
#, c-format
msgid "Error: failed to set '%s' property: %s\n"
msgstr "பிழை: '%s' பணà¯à®ªà¯ˆ அமைபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s\n"
-#: ../clients/cli/connections.c:6603
+#: ../clients/cli/connections.c:7081
#, c-format
msgid "Edit '%s' value: "
msgstr "'%s' மதிபà¯à®ªà¯ˆà®¤à¯ திரà¯à®¤à¯à®¤à¯: "
-#: ../clients/cli/connections.c:6630
+#: ../clients/cli/connections.c:7110
#, c-format
msgid "Error: %s\n"
msgstr "பிழை: %s\n"
-#: ../clients/cli/connections.c:6636 ../clients/cli/connections.c:7130
-#: ../clients/cli/connections.c:7171
+#: ../clients/cli/connections.c:7116 ../clients/cli/connections.c:7610
+#: ../clients/cli/connections.c:7651
#, c-format
msgid "Error: failed to remove value of '%s': %s\n"
msgstr "பிழை: '%s' இன௠மதிபà¯à®ªà¯ˆ நீகà¯à®•à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %s\n"
-#: ../clients/cli/connections.c:6657
+#: ../clients/cli/connections.c:7137
#, c-format
msgid "Unknown command argument: '%s'\n"
msgstr "தெரியாத கடà¯à®Ÿà®³à¯ˆ மதிபà¯à®ªà¯à®°à¯: '%s'\n"
-#: ../clients/cli/connections.c:6783
+#: ../clients/cli/connections.c:7263
#, c-format
msgid "Available settings: %s\n"
msgstr "கிடைகà¯à®•à¯à®®à¯ அமைவà¯à®•à®³à¯: %s\n"
-#: ../clients/cli/connections.c:6792
+#: ../clients/cli/connections.c:7272
#, c-format
msgid "Error: invalid setting name; %s\n"
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ அமைவ௠பெயரà¯; %s\n"
-#: ../clients/cli/connections.c:6809
+#: ../clients/cli/connections.c:7289
#, c-format
msgid "Available properties: %s\n"
msgstr "கிடைகà¯à®•à¯à®®à¯ பணà¯à®ªà¯à®•à®³à¯: %s\n"
-#: ../clients/cli/connections.c:6817
+#: ../clients/cli/connections.c:7297
#, c-format
msgid "Error: property %s\n"
msgstr "பிழை: பணà¯à®ªà¯ %s\n"
-#: ../clients/cli/connections.c:6858
+#: ../clients/cli/connections.c:7338
#, c-format
msgid ""
"Saving the connection with 'autoconnect=yes'. That might result in an "
@@ -2586,12 +3061,12 @@ msgstr ""
"செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà®•à¯à®•à¯‚டà¯à®®à¯.\n"
"இரà¯à®ªà¯à®ªà®¿à®©à¯à®®à¯ சேமிகà¯à®• வேணà¯à®Ÿà¯à®®à®¾? %s"
-#: ../clients/cli/connections.c:6933
+#: ../clients/cli/connections.c:7413
#, c-format
msgid "You may edit the following settings: %s\n"
msgstr "நீஙà¯à®•à®³à¯ பினà¯à®µà®°à¯à®®à¯ அமைவà¯à®•à®³à¯ˆà®¤à¯ திரà¯à®¤à¯à®¤à®²à®¾à®®à¯: %s\n"
-#: ../clients/cli/connections.c:6960
+#: ../clients/cli/connections.c:7440
#, c-format
msgid ""
"The connection profile has been removed from another client. You may type "
@@ -2601,206 +3076,230 @@ msgstr ""
"'save' என "
"தடà¯à®Ÿà®šà¯à®šà¯ செயà¯à®¯à®²à®¾à®®à¯.\n"
-#: ../clients/cli/connections.c:6989 ../clients/cli/connections.c:7044
+#: ../clients/cli/connections.c:7469 ../clients/cli/connections.c:7524
#, c-format
msgid "Allowed values for '%s' property: %s\n"
msgstr "'%s' பணà¯à®ªà¯à®•à¯à®•à¯ அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ மதிபà¯à®ªà¯à®•à®³à¯: %s\n"
-#: ../clients/cli/connections.c:6999 ../clients/cli/connections.c:7213
+#: ../clients/cli/connections.c:7479 ../clients/cli/connections.c:7693
#, c-format
msgid "Error: no setting selected; valid are [%s]\n"
msgstr "பிழை: அமைவ௠தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ; செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®µà¯ˆ [%s]\n"
-#: ../clients/cli/connections.c:7000
+#: ../clients/cli/connections.c:7480
#, c-format
msgid "use 'goto <setting>' first, or 'set <setting>.<property>'\n"
msgstr ""
"à®®à¯à®¤à®²à®¿à®²à¯ 'goto <setting>' அலà¯à®²à®¤à¯ 'set <setting>.<property>' à®à®ªà¯ "
"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯\n"
-#: ../clients/cli/connections.c:7014 ../clients/cli/connections.c:7150
-#: ../clients/cli/connections.c:7230
+#: ../clients/cli/connections.c:7494 ../clients/cli/connections.c:7630
+#: ../clients/cli/connections.c:7710
#, c-format
msgid "Error: invalid setting argument '%s'; valid are [%s]\n"
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ அமைவ௠மதிபà¯à®ªà¯à®°à¯ '%s'; செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®µà¯ˆ [%s]\n"
-#: ../clients/cli/connections.c:7024
+#: ../clients/cli/connections.c:7504
#, c-format
msgid "Error: missing setting for '%s' property\n"
msgstr "பிழை: '%s' பணà¯à®ªà¯à®•à¯à®•à®¾à®© அமைவ௠விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯\n"
-#: ../clients/cli/connections.c:7031
+#: ../clients/cli/connections.c:7511
#, c-format
msgid "Error: invalid property: %s\n"
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ பணà¯à®ªà¯: %s\n"
-#: ../clients/cli/connections.c:7078
+#: ../clients/cli/connections.c:7558
#, c-format
msgid "Error: unknown setting '%s'\n"
msgstr "பிழை: தெரியாத அமைவ௠'%s'\n"
-#: ../clients/cli/connections.c:7091
+#: ../clients/cli/connections.c:7571
#, c-format
msgid "You may edit the following properties: %s\n"
msgstr "நீஙà¯à®•à®³à¯ பினà¯à®µà®°à¯à®®à¯ அமைவà¯à®•à®³à¯ˆà®¤à¯ திரà¯à®¤à¯à®¤à®²à®¾à®®à¯: %s\n"
-#: ../clients/cli/connections.c:7135
+#: ../clients/cli/connections.c:7615
#, c-format
msgid "Error: no argument given; valid are [%s]\n"
msgstr "பிழை: மதிபà¯à®ªà¯à®°à¯ கொடà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ; செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®µà¯ˆ [%s]\n"
-#: ../clients/cli/connections.c:7148
+#: ../clients/cli/connections.c:7628
#, c-format
msgid "Setting '%s' is not present in the connection.\n"
msgstr "இணைபà¯à®ªà®¿à®²à¯ அமைவ௠'%s' இலà¯à®²à¯ˆ.\n"
-#: ../clients/cli/connections.c:7189
+#: ../clients/cli/connections.c:7669
#, c-format
msgid "Error: %s properties, nor it is a setting name.\n"
msgstr "பிழை: %s பணà¯à®ªà¯à®•à®³à¯, அத௠ஒர௠அமைவ௠பெயரà¯à®®à¯ அலà¯à®².\n"
-#: ../clients/cli/connections.c:7214
+#: ../clients/cli/connections.c:7694
#, c-format
msgid "use 'goto <setting>' first, or 'describe <setting>.<property>'\n"
msgstr ""
"à®®à¯à®¤à®²à®¿à®²à¯ 'goto <setting>'அலà¯à®²à®¤à¯ 'describe <setting>.<property>' à®à®ªà¯ "
"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯\n"
-#: ../clients/cli/connections.c:7255
+#: ../clients/cli/connections.c:7735
#, c-format
msgid "Error: invalid property: %s, neither a valid setting name.\n"
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ பணà¯à®ªà¯: %s, செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© ஒர௠அமைவ௠பெயரà¯à®®à¯ அலà¯à®².\n"
-#: ../clients/cli/connections.c:7284
+#: ../clients/cli/connections.c:7764
#, c-format
msgid "Error: unknown setting: '%s'\n"
msgstr "பிழை: தெரியாத அமைவà¯: '%s'\n"
-#: ../clients/cli/connections.c:7289
+#: ../clients/cli/connections.c:7769
#, c-format
msgid "Error: '%s' setting not present in the connection\n"
msgstr "பிழை: இணைபà¯à®ªà®¿à®²à¯ அமைவ௠'%s' இலà¯à®²à¯ˆ\n"
-#: ../clients/cli/connections.c:7314
+#: ../clients/cli/connections.c:7794
#, c-format
msgid "Error: invalid property: %s%s\n"
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ பணà¯à®ªà¯: %s%s\n"
-#: ../clients/cli/connections.c:7316
+#: ../clients/cli/connections.c:7796
msgid ", neither a valid setting name"
msgstr ", செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© அமைவ௠பெயரà¯à®®à¯ அலà¯à®²"
-#: ../clients/cli/connections.c:7336
+#: ../clients/cli/connections.c:7813
+#, c-format
+#| msgid "invalid option '%s'"
+msgid "Invalid verify option: %s\n"
+msgstr "தவறான verify விரà¯à®ªà¯à®ªà®®à¯: %s\n"
+
+#: ../clients/cli/connections.c:7821
#, c-format
msgid "Verify setting '%s': %s\n"
msgstr "அமைவ௠'%s' à®à®šà¯ சரிபாரà¯: %s\n"
-#: ../clients/cli/connections.c:7343
+#: ../clients/cli/connections.c:7836
#, c-format
msgid "Verify connection: %s\n"
msgstr "இணைபà¯à®ªà¯ˆ சரிபாரà¯: %s\n"
-#: ../clients/cli/connections.c:7361
+#: ../clients/cli/connections.c:7839
+#, c-format
+msgid "The error cannot be fixed automatically.\n"
+msgstr "இநà¯à®¤à®ªà¯ பிழையை தானாக சரிசெயà¯à®¯ à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯.\n"
+
+#: ../clients/cli/connections.c:7856
#, c-format
msgid "Error: invalid argument '%s'\n"
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ மதிபà¯à®ªà¯à®°à¯ '%s'\n"
-#: ../clients/cli/connections.c:7394
+#: ../clients/cli/connections.c:7889
#, c-format
-msgid "Error: Failed to save '%s' (%s) connection: (%d) %s\n"
-msgstr "பிழை: '%s' (%s) இணைபà¯à®ªà¯ˆà®šà¯ சேமிபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: (%d) %s\n"
+#| msgid "Error: Failed to save '%s' (%s) connection: (%d) %s\n"
+msgid "Error: Failed to save '%s' (%s) connection: %s\n"
+msgstr "பிழை: '%s' (%s) இணைபà¯à®ªà¯ˆà®šà¯ சேமிகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯: %s\n"
-#: ../clients/cli/connections.c:7402
+#: ../clients/cli/connections.c:7896
#, c-format
msgid "Connection '%s' (%s) successfully saved.\n"
msgstr "இணைபà¯à®ªà¯ '%s' (%s) வெறà¯à®±à®¿à®•à®°à®®à®¾à®•à®šà¯ சேமிகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯\n"
-#: ../clients/cli/connections.c:7403
+#: ../clients/cli/connections.c:7897
#, c-format
msgid "Connection '%s' (%s) successfully updated.\n"
msgstr "இணைபà¯à®ªà¯ '%s' (%s) வெறà¯à®±à®¿à®•à®°à®®à®¾à®• பà¯à®¤à¯à®ªà¯à®ªà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
-#: ../clients/cli/connections.c:7436
+#: ../clients/cli/connections.c:7930
#, c-format
msgid "Error: connection verification failed: %s\n"
msgstr "பிழை: இணைபà¯à®ªà¯ˆ சரிபாரà¯à®ªà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %s\n"
-#: ../clients/cli/connections.c:7437
+#: ../clients/cli/connections.c:7931
msgid "(unknown error)"
msgstr "(தெரியாத பிழை)"
-#: ../clients/cli/connections.c:7458
+#: ../clients/cli/connections.c:7932
+#, c-format
+msgid "You may try running 'verify fix' to fix errors.\n"
+msgstr "'verify fix' கடà¯à®Ÿà®³à¯ˆà®¯à¯ˆ இயகà¯à®•à®¿ பிழைகளைச௠சரிசெயà¯à®¯ à®®à¯à®¯à®±à¯à®šà®¿à®•à¯à®•à®²à®¾à®®à¯.\n"
+
+#: ../clients/cli/connections.c:7954
#, c-format
msgid "Error: connection is not saved. Type 'save' first.\n"
msgstr ""
"பிழை: இணைபà¯à®ªà¯ சேமிகà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ. à®®à¯à®¤à®²à®¿à®²à¯ 'save' ஠தடà¯à®Ÿà®šà¯à®šà¯ செயà¯à®¯à®µà¯à®®à¯.\n"
-#: ../clients/cli/connections.c:7462
+#: ../clients/cli/connections.c:7958
#, c-format
msgid "Error: connection is not valid: %s\n"
msgstr "பிழை: இணைபà¯à®ªà¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²: %s\n"
-#: ../clients/cli/connections.c:7472
+#: ../clients/cli/connections.c:7968
#, c-format
msgid "Error: Cannot activate connection: %s.\n"
msgstr "பிழை: இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s.\n"
-#: ../clients/cli/connections.c:7482
+#: ../clients/cli/connections.c:7978
#, c-format
-msgid "Error: Failed to activate '%s' (%s) connection: (%d) %s\n"
-msgstr "பிழை: '%s' (%s) இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: (%d) %s\n"
+#| msgid "Error: Failed to activate '%s' (%s) connection: (%d) %s\n"
+msgid "Error: Failed to activate '%s' (%s) connection: %s\n"
+msgstr "பிழை: '%s' (%s) இணைபà¯à®ªà¯ˆà®šà¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯: %s\n"
-#: ../clients/cli/connections.c:7488
+#: ../clients/cli/connections.c:7984
#, c-format
msgid "Monitoring connection activation (press any key to continue)\n"
msgstr ""
"இணைபà¯à®ªà¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®²à¯ˆà®•à¯ கணà¯à®•à®¾à®£à®¿à®•à¯à®•à®¿à®±à®¤à¯ (தொடர à®à®¤à¯‡à®©à¯à®®à¯ ஒர௠விசையை à®…à®´à¯à®¤à¯à®¤à®µà¯à®®à¯)\n"
-#: ../clients/cli/connections.c:7526
+#: ../clients/cli/connections.c:8022
#, c-format
msgid "Error: status-line: %s\n"
msgstr "பிழை: நிலை-வரி: %s\n"
-#: ../clients/cli/connections.c:7534
+#: ../clients/cli/connections.c:8030
#, c-format
msgid "Error: save-confirmation: %s\n"
msgstr "பிழை: சேமிதà¯à®¤à®²à¯-உறà¯à®¤à®¿à®ªà¯à®ªà®Ÿà¯à®¤à¯à®¤à®²à¯: %s\n"
-#: ../clients/cli/connections.c:7542
+#: ../clients/cli/connections.c:8038
+#, c-format
+#| msgid "Error: property %s\n"
+msgid "Error: show-secrets: %s\n"
+msgstr "பிழை: show-secrets: %s\n"
+
+#: ../clients/cli/connections.c:8046
#, c-format
msgid "Error: bad color number: '%s'; use <0-8>\n"
msgstr "பிழை: நிற எண௠தவறà¯: '%s'; <0-8> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯\n"
-#: ../clients/cli/connections.c:7554
+#: ../clients/cli/connections.c:8058
#, c-format
msgid "Current nmcli configuration:\n"
msgstr "நடபà¯à®ªà¯ nmcli அமைவாகà¯à®•à®®à¯:\n"
-#: ../clients/cli/connections.c:7562
+#: ../clients/cli/connections.c:8068
#, c-format
msgid "Invalid configuration option '%s'; allowed [%s]\n"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ அமைவாகà¯à®• விரà¯à®ªà¯à®ªà®®à¯ '%s'; அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®µà®¤à¯ [%s]\n"
-#: ../clients/cli/connections.c:7804
+#: ../clients/cli/connections.c:8315
#, c-format
msgid "Error: only one of 'id', uuid, or 'path' can be provided."
msgstr ""
"பிழை: 'id', uuid அலà¯à®²à®¤à¯ 'path' ஆகியவறà¯à®±à®¿à®²à¯ ஒனà¯à®±à¯ˆ மடà¯à®Ÿà¯à®®à¯‡ வழஙà¯à®• à®®à¯à®Ÿà®¿à®¯à¯à®®à¯."
-#: ../clients/cli/connections.c:7816 ../clients/cli/connections.c:8000
-#: ../clients/cli/connections.c:8007
+#: ../clients/cli/connections.c:8327 ../clients/cli/connections.c:8514
+#: ../clients/cli/connections.c:8521
#, c-format
msgid "Error: Unknown connection '%s'."
msgstr "பிழை: தெரியாத இணைபà¯à®ªà¯: '%s'."
-#: ../clients/cli/connections.c:7831
+#: ../clients/cli/connections.c:8345
#, c-format
msgid "Warning: editing existing connection '%s'; 'type' argument is ignored\n"
msgstr ""
"எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: à®®à¯à®©à¯à®ªà¯‡ உளà¯à®³ இணைபà¯à®ªà¯ '%s' à®à®¤à¯ திரà¯à®¤à¯à®¤à¯à®•à®¿à®±à®¤à¯; 'type' மதிபà¯à®ªà¯à®°à¯ "
"பà¯à®±à®•à¯à®•à®£à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯\n"
-#: ../clients/cli/connections.c:7834
+#: ../clients/cli/connections.c:8348
#, c-format
msgid ""
"Warning: editing existing connection '%s'; 'con-name' argument is ignored\n"
@@ -2808,441 +3307,440 @@ msgstr ""
"எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: à®®à¯à®©à¯à®ªà¯‡ உளà¯à®³ இணைபà¯à®ªà¯ '%s' à®à®¤à¯ திரà¯à®¤à¯à®¤à¯à®•à®¿à®±à®¤à¯; 'con-name' மதிபà¯à®ªà¯à®°à¯ "
"பà¯à®±à®•à¯à®•à®£à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯\n"
-#: ../clients/cli/connections.c:7848
+#: ../clients/cli/connections.c:8362
#, c-format
msgid "Valid connection types: %s\n"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இணைபà¯à®ªà¯ வகைகளà¯: %s\n"
-#: ../clients/cli/connections.c:7850
+#: ../clients/cli/connections.c:8364
#, c-format
msgid "Error: invalid connection type; %s\n"
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ இணைபà¯à®ªà¯ வகை; %s\n"
-#: ../clients/cli/connections.c:7889
+#: ../clients/cli/connections.c:8403
#, c-format
msgid "===| nmcli interactive connection editor |==="
msgstr "===| nmcli தொடரà¯à®ªà¯à®¤à¯à®¤à®¿à®±à®©à¯ கொணà¯à®Ÿ இணைபà¯à®ªà¯à®¤à¯ திரà¯à®¤à¯à®¤à®¿ |==="
-#: ../clients/cli/connections.c:7892
+#: ../clients/cli/connections.c:8406
#, c-format
msgid "Editing existing '%s' connection: '%s'"
msgstr "à®®à¯à®©à¯à®ªà¯‡ உளà¯à®³ '%s' இணைபà¯à®ªà¯ˆà®¤à¯ திரà¯à®¤à¯à®¤à¯à®•à®¿à®±à®¤à¯: '%s'"
-#: ../clients/cli/connections.c:7894
+#: ../clients/cli/connections.c:8408
#, c-format
msgid "Adding a new '%s' connection"
msgstr "பà¯à®¤à®¿à®¯ '%s' இணைபà¯à®ªà¯ˆà®šà¯ சேரà¯à®•à¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/connections.c:7896
+#: ../clients/cli/connections.c:8410
#, c-format
msgid "Type 'help' or '?' for available commands."
msgstr "கிடைகà¯à®•à¯à®®à¯ கடà¯à®Ÿà®³à¯ˆà®•à®³à¯ˆà®•à¯ காண 'help' அலà¯à®²à®¤à¯ '?' எனத௠தடà¯à®Ÿà®šà¯à®šà¯ செயà¯à®¯à®µà¯à®®à¯."
-#: ../clients/cli/connections.c:7898
+#: ../clients/cli/connections.c:8412
#, c-format
msgid "Type 'describe [<setting>.<prop>]' for detailed property description."
msgstr ""
"பணà¯à®ªà®¿à®©à¯ விரிவான விளகà¯à®•à®¤à¯à®¤à¯ˆà®•à¯ காண 'describe [<setting>.<prop>]' எனத௠தடà¯à®Ÿà®šà¯à®šà¯ "
"செயà¯à®¯à®µà¯à®®à¯."
-#: ../clients/cli/connections.c:7936
+#: ../clients/cli/connections.c:8450
#, c-format
-#| msgid "Error: Failed to modify connection '%s': (%d) %s"
msgid "Error: Failed to modify connection '%s': %s"
msgstr "பிழை: இணைபà¯à®ªà¯ '%s' இல௠மாறà¯à®±à®®à¯ செயà¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s"
-#: ../clients/cli/connections.c:7943
+#: ../clients/cli/connections.c:8457
#, c-format
msgid "Connection '%s' (%s) successfully modified.\n"
msgstr "இணைபà¯à®ªà¯ '%s' இல௠(%s) வெறà¯à®±à®¿à®•à®°à®®à®¾à®• மாறà¯à®±à®®à¯ செயà¯à®¯à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
-#: ../clients/cli/connections.c:7975
+#: ../clients/cli/connections.c:8489
#, c-format
msgid "Error: No arguments provided."
msgstr "பிழை: மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/connections.c:7994
+#: ../clients/cli/connections.c:8508
#, c-format
msgid "Error: connection ID is missing."
msgstr "பிழை: இணைபà¯à®ªà¯ ID விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯."
-#: ../clients/cli/connections.c:8016 ../clients/cli/connections.c:8029
+#: ../clients/cli/connections.c:8530 ../clients/cli/connections.c:8543
#, c-format
msgid "Error: <setting>.<property> argument is missing."
msgstr "பிழை: <setting>.<property> மதிபà¯à®ªà¯à®°à¯ விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯."
-#: ../clients/cli/connections.c:8034
+#: ../clients/cli/connections.c:8548
#, c-format
msgid "Error: value for '%s' is missing."
msgstr "பிழை: '%s' கà¯à®•à¯ மதிபà¯à®ªà¯ விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯."
-#: ../clients/cli/connections.c:8052
+#: ../clients/cli/connections.c:8566
#, c-format
msgid "Error: invalid <setting>.<property> '%s'."
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ <setting>.<property> '%s'."
-#: ../clients/cli/connections.c:8060
+#: ../clients/cli/connections.c:8574
#, c-format
msgid "Error: invalid or not allowed setting '%s': %s."
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ அலà¯à®²à®¤à¯ அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà®¾à®¤ அமைவ௠'%s': %s."
-#: ../clients/cli/connections.c:8081
+#: ../clients/cli/connections.c:8595
#, c-format
msgid "Error: invalid property '%s': %s."
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ பணà¯à®ªà¯ '%s': %s."
-#: ../clients/cli/connections.c:8092
+#: ../clients/cli/connections.c:8606
#, c-format
msgid "Error: failed to modify %s.%s: %s."
msgstr "பிழை: %s.%s இல௠மாறà¯à®±à®®à¯ செயà¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s."
-#: ../clients/cli/connections.c:8110
+#: ../clients/cli/connections.c:8624
#, c-format
msgid "Error: failed to remove a value from %s.%s: %s."
msgstr "பிழை: %s.%s இல௠இரà¯à®¨à¯à®¤à¯ மதிபà¯à®ªà¯ˆ நீகà¯à®•à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %s."
-#: ../clients/cli/connections.c:8147
+#: ../clients/cli/connections.c:8661
#, c-format
msgid "Error: Connection deletion failed: %s"
msgstr "பிழை: இணைபà¯à®ªà¯ˆ நீகà¯à®•à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %s"
-#: ../clients/cli/connections.c:8210
+#: ../clients/cli/connections.c:8725
#, c-format
msgid "Error: unknown connection: %s\n"
msgstr "பிழை: தெரியாத இணைபà¯à®ªà¯: %s\n"
#. truncate trailing ", "
-#: ../clients/cli/connections.c:8247
+#: ../clients/cli/connections.c:8762
#, c-format
msgid "Error: cannot delete unknown connection(s): %s."
msgstr "பிழை: தெரியாத இணைபà¯à®ªà¯à®•à®³à¯ˆ நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯: %s."
-#: ../clients/cli/connections.c:8264 ../clients/cli/connections.c:8292
-#: ../clients/cli/connections.c:8427 ../clients/cli/devices.c:2820
-#: ../clients/cli/network-manager.c:339 ../clients/cli/network-manager.c:477
-#, c-format
-msgid "Error: NetworkManager is not running."
-msgstr "பிழை: NetworkManager இயஙà¯à®•à®µà®¿à®²à¯à®²à¯ˆ."
-
-#: ../clients/cli/connections.c:8318
+#: ../clients/cli/connections.c:8785
#, c-format
-msgid "Could not load file '%s'\n"
-msgstr "கோபà¯à®ªà¯ '%s' à® à®à®±à¯à®± à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ\n"
+#| msgid "Error: Failed to add '%s' connection: %s"
+msgid "Error: failed to reload connections: %s."
+msgstr "பிழை: இணைபà¯à®ªà¯à®•à®³à¯ˆ மீணà¯à®Ÿà¯à®®à¯ à®à®±à¯à®± à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯: %s."
-#: ../clients/cli/connections.c:8437 ../clients/cli/network-manager.c:611
+#: ../clients/cli/connections.c:8824
#, c-format
-msgid "Error: Could not get system settings: %s."
-msgstr "பிழை: கணினி அமைவà¯à®•à®³à¯ˆà®ªà¯ பெற à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s."
+#| msgid "Error: Failed to add '%s' connection: %s"
+msgid "Error: failed to load connection: %s."
+msgstr "பிழை: இணைபà¯à®ªà¯ˆ மீணà¯à®Ÿà¯à®®à¯ à®à®±à¯à®± à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯: %s."
-#: ../clients/cli/connections.c:8447
+#: ../clients/cli/connections.c:8832
#, c-format
-msgid "Error: Can't obtain connections: settings service is not running."
-msgstr "பிழை: இணைபà¯à®ªà¯à®•à®³à¯ˆà®ªà¯ பெற à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: அமைவà¯à®•à®³à®¿à®©à¯ சேவை இயஙà¯à®•à®µà®¿à®²à¯à®²à¯ˆ."
+msgid "Could not load file '%s'\n"
+msgstr "கோபà¯à®ªà¯ '%s' à® à®à®±à¯à®± à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ\n"
-#: ../clients/cli/connections.c:8501
+#: ../clients/cli/connections.c:9008
#, c-format
msgid "Error: '%s' is not valid 'connection' command."
msgstr "பிழை: '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© 'connection' கடà¯à®Ÿà®³à¯ˆà®¯à®²à¯à®²."
#. define some prompts
-#: ../clients/cli/devices.c:36
+#: ../clients/cli/devices.c:38
msgid "Interface: "
msgstr "இடைமà¯à®•à®®à¯: "
#. 3
#. 17
-#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:73
+#: ../clients/cli/devices.c:46 ../clients/cli/devices.c:75
msgid "CONNECTION"
msgstr "CONNECTION"
#. 4
#. 18
-#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:74
+#: ../clients/cli/devices.c:47 ../clients/cli/devices.c:76
msgid "CON-UUID"
msgstr "CON-UUID"
#. 2
-#: ../clients/cli/devices.c:58
+#: ../clients/cli/devices.c:60
msgid "VENDOR"
msgstr "VENDOR"
#. 3
-#: ../clients/cli/devices.c:59
+#: ../clients/cli/devices.c:61
msgid "PRODUCT"
msgstr "PRODUCT"
#. 4
-#: ../clients/cli/devices.c:60
+#: ../clients/cli/devices.c:62
msgid "DRIVER"
msgstr "DRIVER"
#. 5
-#: ../clients/cli/devices.c:61
+#: ../clients/cli/devices.c:63
msgid "DRIVER-VERSION"
msgstr "DRIVER-VERSION"
#. 6
-#: ../clients/cli/devices.c:62
+#: ../clients/cli/devices.c:64
msgid "FIRMWARE-VERSION"
msgstr "FIRMWARE-VERSION"
#. 7
-#: ../clients/cli/devices.c:63
+#: ../clients/cli/devices.c:65
msgid "HWADDR"
msgstr "HWADDR"
#. 8
-#: ../clients/cli/devices.c:64 ../clients/tui/nmt-page-ethernet.c:86
-#: ../clients/tui/nmt-page-infiniband.c:96 ../clients/tui/nmt-page-vlan.c:130
-#: ../clients/tui/nmt-page-wifi.c:366
+#: ../clients/cli/devices.c:66 ../clients/tui/nmt-page-ethernet.c:86
+#: ../clients/tui/nmt-page-infiniband.c:97 ../clients/tui/nmt-page-vlan.c:131
+#: ../clients/tui/nmt-page-wifi.c:373
msgid "MTU"
msgstr "MTU"
#. 10
-#: ../clients/cli/devices.c:66
+#: ../clients/cli/devices.c:68
msgid "REASON"
msgstr "REASON"
#. 11
-#: ../clients/cli/devices.c:67
+#: ../clients/cli/devices.c:69
msgid "UDI"
msgstr "UDI"
#. 12
-#: ../clients/cli/devices.c:68
+#: ../clients/cli/devices.c:70
msgid "IP-IFACE"
msgstr "IP-IFACE"
#. 13
#. 2
-#: ../clients/cli/devices.c:69 ../clients/cli/devices.c:97
+#: ../clients/cli/devices.c:71 ../clients/cli/devices.c:99
msgid "IS-SOFTWARE"
msgstr "IS-SOFTWARE"
#. 14
-#: ../clients/cli/devices.c:70
+#: ../clients/cli/devices.c:72
msgid "NM-MANAGED"
msgstr "NM-MANAGED"
#. 16
-#: ../clients/cli/devices.c:72
+#: ../clients/cli/devices.c:74
msgid "FIRMWARE-MISSING"
msgstr "FIRMWARE-MISSING"
#. 0
-#: ../clients/cli/devices.c:85
+#: ../clients/cli/devices.c:87
msgid "AVAILABLE-CONNECTION-PATHS"
msgstr "AVAILABLE-CONNECTION-PATHS"
#. 1
-#: ../clients/cli/devices.c:86
+#: ../clients/cli/devices.c:88
msgid "AVAILABLE-CONNECTIONS"
msgstr "AVAILABLE-CONNECTIONS"
#. 0
-#: ../clients/cli/devices.c:95
+#: ../clients/cli/devices.c:97
msgid "CARRIER-DETECT"
msgstr "CARRIER-DETECT"
#. 1
-#: ../clients/cli/devices.c:96
+#: ../clients/cli/devices.c:98
msgid "SPEED"
msgstr "SPEED"
#. 0
-#: ../clients/cli/devices.c:106
+#: ../clients/cli/devices.c:108
msgid "CARRIER"
msgstr "CARRIER"
#. 0
-#: ../clients/cli/devices.c:115 ../clients/cli/devices.c:562
+#: ../clients/cli/devices.c:117 ../clients/cli/devices.c:548
msgid "WEP"
msgstr "WEP"
#. 1
-#: ../clients/cli/devices.c:116
+#: ../clients/cli/devices.c:118
msgid "WPA"
msgstr "WPA"
#. 2
-#: ../clients/cli/devices.c:117 ../clients/cli/devices.c:570
+#: ../clients/cli/devices.c:119 ../clients/cli/devices.c:556
msgid "WPA2"
msgstr "WPA2"
#. 3
-#: ../clients/cli/devices.c:118
+#: ../clients/cli/devices.c:120
msgid "TKIP"
msgstr "TKIP"
#. 4
-#: ../clients/cli/devices.c:119
+#: ../clients/cli/devices.c:121
msgid "CCMP"
msgstr "CCMP"
#. 5
#. 2
-#: ../clients/cli/devices.c:120 ../clients/cli/devices.c:219
+#: ../clients/cli/devices.c:122 ../clients/cli/devices.c:222
msgid "AP"
msgstr "AP"
#. 6
-#: ../clients/cli/devices.c:121
+#: ../clients/cli/devices.c:123
msgid "ADHOC"
msgstr "ADHOC"
#. 0
-#: ../clients/cli/devices.c:130
+#: ../clients/cli/devices.c:132
msgid "CTR-FREQ"
msgstr "CTR-FREQ"
#. 1
-#: ../clients/cli/devices.c:131
+#: ../clients/cli/devices.c:133
msgid "RSSI"
msgstr "RSSI"
#. 2
-#: ../clients/cli/devices.c:132
+#: ../clients/cli/devices.c:134
msgid "CINR"
msgstr "CINR"
#. 3
-#: ../clients/cli/devices.c:133
+#: ../clients/cli/devices.c:135
msgid "TX-POW"
msgstr "TX-POW"
#. 4
-#: ../clients/cli/devices.c:134
+#: ../clients/cli/devices.c:136
msgid "BSID"
msgstr "BSID"
#. 0
-#: ../clients/cli/devices.c:143 ../clients/tui/nmt-page-wifi.c:220
+#: ../clients/cli/devices.c:145 ../clients/tui/nmt-page-wifi.c:227
msgid "SSID"
msgstr "SSID"
#. 1
-#: ../clients/cli/devices.c:144
+#: ../clients/cli/devices.c:146
msgid "SSID-HEX"
msgstr "SSID-HEX"
#. 2
-#: ../clients/cli/devices.c:145 ../clients/tui/nmt-page-wifi.c:354
+#: ../clients/cli/devices.c:147 ../clients/tui/nmt-page-wifi.c:361
msgid "BSSID"
msgstr "BSSID"
#. 3
-#: ../clients/cli/devices.c:146
+#: ../clients/cli/devices.c:148
msgid "MODE"
msgstr "MODE"
#. 4
-#: ../clients/cli/devices.c:147
+#: ../clients/cli/devices.c:149
msgid "CHAN"
msgstr "CHAN"
#. 5
-#: ../clients/cli/devices.c:148
+#: ../clients/cli/devices.c:150
msgid "FREQ"
msgstr "FREQ"
#. 6
-#: ../clients/cli/devices.c:149
+#: ../clients/cli/devices.c:151
msgid "RATE"
msgstr "RATE"
#. 7
#. 1
-#: ../clients/cli/devices.c:150 ../clients/cli/devices.c:170
+#: ../clients/cli/devices.c:152 ../clients/cli/devices.c:172
msgid "SIGNAL"
msgstr "SIGNAL"
#. 8
-#: ../clients/cli/devices.c:151
+#: ../clients/cli/devices.c:153
msgid "BARS"
msgstr "BARS"
#. 9
-#: ../clients/cli/devices.c:152
+#: ../clients/cli/devices.c:154
msgid "SECURITY"
msgstr "SECURITY"
#. 10
-#: ../clients/cli/devices.c:153
+#: ../clients/cli/devices.c:155
msgid "WPA-FLAGS"
msgstr "WPA-FLAGS"
#. 11
-#: ../clients/cli/devices.c:154
+#: ../clients/cli/devices.c:156
msgid "RSN-FLAGS"
msgstr "RSN-FLAGS"
#. 14
-#: ../clients/cli/devices.c:157
+#: ../clients/cli/devices.c:159
msgid "*"
msgstr "*"
#. 0
#. 5
-#: ../clients/cli/devices.c:169 ../clients/cli/devices.c:222
+#: ../clients/cli/devices.c:171 ../clients/cli/devices.c:225
msgid "NSP"
msgstr "NSP"
#. 0
-#: ../clients/cli/devices.c:184
+#: ../clients/cli/devices.c:186
msgid "SLAVES"
msgstr "SLAVES"
#. 0
-#: ../clients/cli/devices.c:193
+#: ../clients/cli/devices.c:195
+msgid "PARENT"
+msgstr "பெறà¯à®±à¯‹à®°à¯"
+
+#. 1
+#: ../clients/cli/devices.c:196
msgid "ID"
msgstr "ID"
#. 0
-#: ../clients/cli/devices.c:202 ../clients/cli/devices.c:217
+#: ../clients/cli/devices.c:205 ../clients/cli/devices.c:220
msgid "CAPABILITIES"
msgstr "CAPABILITIES"
#. 1
-#: ../clients/cli/devices.c:218
+#: ../clients/cli/devices.c:221
msgid "WIFI-PROPERTIES"
msgstr "WIFI-PROPERTIES"
#. 3
-#: ../clients/cli/devices.c:220
+#: ../clients/cli/devices.c:223
msgid "WIRED-PROPERTIES"
msgstr "WIRED-PROPERTIES"
#. 4
-#: ../clients/cli/devices.c:221
+#: ../clients/cli/devices.c:224
msgid "WIMAX-PROPERTIES"
msgstr "WIMAX-PROPERTIES"
#. 10
-#: ../clients/cli/devices.c:227 ../clients/tui/nmt-page-bond.c:73
+#: ../clients/cli/devices.c:230 ../clients/tui/nmt-page-bond.c:354
msgid "BOND"
msgstr "BOND"
#. 11
-#: ../clients/cli/devices.c:228 ../clients/tui/nmt-page-team.c:51
+#: ../clients/cli/devices.c:231 ../clients/tui/nmt-page-team.c:148
msgid "TEAM"
msgstr "அணி"
#. 12
-#: ../clients/cli/devices.c:229 ../clients/tui/nmt-page-bridge.c:42
+#: ../clients/cli/devices.c:232 ../clients/tui/nmt-page-bridge.c:77
msgid "BRIDGE"
msgstr "பிரிடà¯à®œà¯"
#. 14
-#: ../clients/cli/devices.c:231
+#: ../clients/cli/devices.c:234
msgid "BLUETOOTH"
msgstr "BLUETOOTH"
#. 15
-#: ../clients/cli/devices.c:232
+#: ../clients/cli/devices.c:235
msgid "CONNECTIONS"
msgstr "CONNECTIONS"
-#: ../clients/cli/devices.c:257
+#: ../clients/cli/devices.c:259
#, c-format
msgid ""
"Usage: nmcli device { COMMAND | help }\n"
@@ -3299,7 +3797,7 @@ msgstr ""
" wimax [list [ifname <ifname>] [nsp <name>]]\n"
"\n"
-#: ../clients/cli/devices.c:282
+#: ../clients/cli/devices.c:283
#, c-format
msgid ""
"Usage: nmcli device status { help }\n"
@@ -3352,7 +3850,7 @@ msgstr ""
"படà¯à®Ÿà®¿à®¯à®²à®¿à®Ÿà¯à®•à®¿à®±à®¤à¯.\n"
"\n"
-#: ../clients/cli/devices.c:310
+#: ../clients/cli/devices.c:309
#, c-format
msgid ""
"Usage: nmcli device connect { ARGUMENTS | help }\n"
@@ -3375,7 +3873,7 @@ msgstr ""
"தானாக இணைகà¯à®•à¯à®®à¯à®ªà®Ÿà®¿ அமைகà¯à®•à®ªà¯à®ªà®Ÿà®¾à®¤ இணைபà¯à®ªà¯à®•à®³à¯ˆà®¯à¯à®®à¯ கணகà¯à®•à®¿à®²à¯ எடà¯à®¤à¯à®¤à¯à®•à¯à®•à¯Šà®³à¯à®³à¯à®®à¯.\n"
"\n"
-#: ../clients/cli/devices.c:323
+#: ../clients/cli/devices.c:321
#, c-format
msgid ""
"Usage: nmcli device disconnect { ARGUMENTS | help }\n"
@@ -3396,7 +3894,7 @@ msgstr ""
"இணைபà¯à®ªà¯à®•à®³à¯ தானாக செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®µà®¤à¯ˆà®¯à¯à®®à¯ தடà¯à®•à¯à®•à¯à®®à¯.\n"
"\n"
-#: ../clients/cli/devices.c:336
+#: ../clients/cli/devices.c:333
#, c-format
msgid ""
"Usage: nmcli device delete { ARGUMENTS | help }\n"
@@ -3420,7 +3918,7 @@ msgstr ""
"நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯.\n"
"\n"
-#: ../clients/cli/devices.c:350
+#: ../clients/cli/devices.c:346
#, c-format
msgid ""
"Usage: nmcli device wifi { ARGUMENTS | help }\n"
@@ -3498,7 +3996,7 @@ msgstr ""
"APகளைக௠காடà¯à®Ÿà®¾à®¤à¯, அதறà¯à®•à¯ 'nmcli device wifi list' à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯.\n"
"\n"
-#: ../clients/cli/devices.c:384
+#: ../clients/cli/devices.c:379
#, c-format
msgid ""
"Usage: nmcli device wimax { ARGUMENTS | help }\n"
@@ -3523,214 +4021,219 @@ msgstr ""
"படà¯à®Ÿà®¿à®¯à®²à®¿à®Ÿà®²à®¾à®®à¯.\n"
"\n"
-#: ../clients/cli/devices.c:473 ../clients/cli/devices.c:673
+#: ../clients/cli/devices.c:468 ../clients/cli/devices.c:659
msgid "(none)"
msgstr "(ஒனà¯à®±à¯à®®à®¿à®²à¯à®²à®¾à®¤)"
-#: ../clients/cli/devices.c:546
+#: ../clients/cli/devices.c:536
#, c-format
msgid "%u MHz"
msgstr "%u MHz"
-#: ../clients/cli/devices.c:547
+#: ../clients/cli/devices.c:537
#, c-format
msgid "%u Mbit/s"
msgstr "%u Mbit/s"
-#: ../clients/cli/devices.c:566
+#: ../clients/cli/devices.c:552
msgid "WPA1"
msgstr "WPA1"
-#: ../clients/cli/devices.c:575
+#: ../clients/cli/devices.c:561
msgid "802.1X"
msgstr "802.1X"
-#: ../clients/cli/devices.c:591
+#: ../clients/cli/devices.c:577
msgid "Ad-Hoc"
msgstr "Ad-Hoc"
-#: ../clients/cli/devices.c:592
+#: ../clients/cli/devices.c:578
msgid "Infra"
msgstr "Infra"
-#: ../clients/cli/devices.c:624
+#: ../clients/cli/devices.c:579
+msgid "N/A"
+msgstr "பொரà¯à®¨à¯à®¤à®¾à®¤à¯ "
+
+#: ../clients/cli/devices.c:610
msgid "Home"
msgstr "இலà¯à®²à®®à¯"
-#: ../clients/cli/devices.c:627
+#: ../clients/cli/devices.c:613
msgid "Partner"
msgstr "கூடà¯à®Ÿà®¾à®³à®°à¯"
-#: ../clients/cli/devices.c:630
+#: ../clients/cli/devices.c:616
msgid "Roaming"
msgstr "ரோமிஙà¯"
-#: ../clients/cli/devices.c:802
+#: ../clients/cli/devices.c:774
msgid "Device details"
msgstr "சாதன விவரஙà¯à®•à®³à¯"
-#: ../clients/cli/devices.c:814
+#: ../clients/cli/devices.c:786
#, c-format
msgid "Error: 'device show': %s"
msgstr "பிழை: 'device show': %s"
-#: ../clients/cli/devices.c:865 ../clients/cli/devices.c:868
+#: ../clients/cli/devices.c:837 ../clients/cli/devices.c:840
msgid "(unknown)"
msgstr "(தெரியாத)"
-#: ../clients/cli/devices.c:906
+#: ../clients/cli/devices.c:878
#, c-format
msgid "%u Mb/s"
msgstr "%u Mb/s"
-#: ../clients/cli/devices.c:992
+#: ../clients/cli/devices.c:964
msgid "on"
msgstr "ஆன௠"
-#: ../clients/cli/devices.c:992
+#: ../clients/cli/devices.c:964
msgid "off"
msgstr "ஆஃபà¯"
-#: ../clients/cli/devices.c:1264
+#: ../clients/cli/devices.c:1238
#, c-format
msgid "Error: 'device status': %s"
msgstr "பிழை: 'device status': %s"
#. Add headers
-#: ../clients/cli/devices.c:1271
+#: ../clients/cli/devices.c:1245
msgid "Status of devices"
msgstr "சாதனஙà¯à®•à®³à®¿à®©à¯ நிலை"
-#: ../clients/cli/devices.c:1302
+#: ../clients/cli/devices.c:1276
#, c-format
msgid "Error: invalid extra argument '%s'."
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ கூடà¯à®¤à®²à¯ மதிபà¯à®ªà¯à®°à¯ '%s'."
-#: ../clients/cli/devices.c:1319 ../clients/cli/devices.c:1599
-#: ../clients/cli/devices.c:1732 ../clients/cli/devices.c:1819
-#: ../clients/cli/devices.c:1952 ../clients/cli/devices.c:2613
+#: ../clients/cli/devices.c:1293 ../clients/cli/devices.c:1591
+#: ../clients/cli/devices.c:1741 ../clients/cli/devices.c:1828
+#: ../clients/cli/devices.c:1961 ../clients/cli/devices.c:2622
#, c-format
msgid "Error: Device '%s' not found."
msgstr "பிழை: சாதனம௠'%s' காணபà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:1374
+#: ../clients/cli/devices.c:1371
#, c-format
msgid "Device '%s' successfully activated with '%s'.\n"
msgstr "சாதனம௠'%s' '%s' உடன௠வெறà¯à®±à®¿à®•à®°à®®à®¾à®• செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
-#: ../clients/cli/devices.c:1396 ../clients/cli/devices.c:1447
-#, c-format
-msgid "Connection with UUID '%s' created and activated on device '%s'\n"
-msgstr ""
-"'%s' சாதனதà¯à®¤à®¿à®²à¯ '%s' எனà¯à®®à¯ UUID கொணà¯à®Ÿ இணைபà¯à®ªà¯ உரà¯à®µà®¾à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà¯ "
-"செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯\n"
-
-#: ../clients/cli/devices.c:1401
+#: ../clients/cli/devices.c:1377
#, c-format
-msgid "Error: Connection activation failed: (%d) %s."
-msgstr "பிழை: இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: (%d) %s."
+#| msgid "Error: Connection activation failed: (%d) %s."
+msgid "Error: Connection activation failed: (%d) %s.\n"
+msgstr "பிழை: இணைபà¯à®ªà¯ˆà®šà¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯: (%d) %s.\n"
-#: ../clients/cli/devices.c:1428
+#: ../clients/cli/devices.c:1411
#, c-format
-#| msgid "Error: Failed to add/activate new connection: (%d) %s"
msgid "Error: Failed to add/activate new connection: %s"
msgstr "பிழை: பà¯à®¤à®¿à®¯ இணைபà¯à®ªà¯ˆ சேரà¯à®•à¯à®•/செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../clients/cli/devices.c:1437
+#: ../clients/cli/devices.c:1420
#, c-format
msgid "Error: Failed to add/activate new connection: Unknown error"
msgstr "பிழை: பà¯à®¤à®¿à®¯ இணைபà¯à®ªà¯ˆ சேரà¯à®•à¯à®•/செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: தெரியாத பிழை"
-#: ../clients/cli/devices.c:1514
+#: ../clients/cli/devices.c:1431
+#, c-format
+msgid "Connection with UUID '%s' created and activated on device '%s'\n"
+msgstr ""
+"'%s' சாதனதà¯à®¤à®¿à®²à¯ '%s' எனà¯à®®à¯ UUID கொணà¯à®Ÿ இணைபà¯à®ªà¯ உரà¯à®µà®¾à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà¯ "
+"செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯\n"
+
+#: ../clients/cli/devices.c:1495
#, c-format
msgid "Error: Device activation failed: %s"
msgstr "பிழை: சாதனதà¯à®¤à¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s"
-#: ../clients/cli/devices.c:1523
+#: ../clients/cli/devices.c:1504
#, c-format
msgid "Error: Device activation failed: device was disconnected"
msgstr ""
"பிழை: சாதனதà¯à®¤à¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®¤à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: சாதனம௠இணைபà¯à®ªà¯ "
"தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/devices.c:1537
+#: ../clients/cli/devices.c:1519
#, c-format
msgid "Device '%s' has been connected.\n"
msgstr "சாதனம௠'%s' இணைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯.\n"
-#: ../clients/cli/devices.c:1568 ../clients/cli/devices.c:1577
-#: ../clients/cli/devices.c:1701 ../clients/cli/devices.c:1710
-#: ../clients/cli/devices.c:1789 ../clients/cli/devices.c:1797
+#: ../clients/cli/devices.c:1560 ../clients/cli/devices.c:1569
+#: ../clients/cli/devices.c:1710 ../clients/cli/devices.c:1719
+#: ../clients/cli/devices.c:1798 ../clients/cli/devices.c:1806
#, c-format
msgid "Error: No interface specified."
msgstr "பிழை: இடைமà¯à®•à®™à¯à®•à®³à¯ எதà¯à®µà¯à®®à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:1583 ../clients/cli/devices.c:1716
-#: ../clients/cli/devices.c:1803
+#: ../clients/cli/devices.c:1575 ../clients/cli/devices.c:1725
+#: ../clients/cli/devices.c:1812
#, c-format
msgid "Error: extra argument not allowed: '%s'."
msgstr "பிழை: கூடà¯à®¤à®²à¯ மதிபà¯à®ªà¯à®°à¯à®µà¯à®•à¯à®•à¯ அனà¯à®®à®¤à®¿à®¯à®¿à®²à¯à®²à¯ˆ: '%s'."
-#: ../clients/cli/devices.c:1642
+#: ../clients/cli/devices.c:1639 ../clients/cli/devices.c:1650
#, c-format
-msgid "Success: Device '%s' successfully disconnected."
-msgstr "வெறà¯à®±à®¿: சாதனம௠'%s' வெறà¯à®±à®¿à®•à®°à®®à®¾à®• தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯."
+#| msgid "Success: Device '%s' successfully disconnected."
+msgid "Device '%s' successfully disconnected.\n"
+msgstr "'%s' எனà¯à®®à¯ சாதனம௠வெறà¯à®±à®¿à®•à®°à®®à®¾à®• இணைபà¯à®ªà¯ தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
-#: ../clients/cli/devices.c:1656
+#: ../clients/cli/devices.c:1664
#, c-format
msgid "Error: Device '%s' (%s) disconnecting failed: %s"
msgstr "பிழை: சாதனம௠'%s' (%s) தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../clients/cli/devices.c:1671
+#: ../clients/cli/devices.c:1679
#, c-format
msgid "Device '%s' has been disconnected.\n"
msgstr "சாதனம௠'%s' தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
-#: ../clients/cli/devices.c:1761
+#: ../clients/cli/devices.c:1770
#, c-format
msgid "Error: Device '%s' (%s) deletion failed: %s"
msgstr "பிழை: சாதனம௠'%s' à® (%s) நீகà¯à®•à¯à®¤à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s"
-#: ../clients/cli/devices.c:1825
+#: ../clients/cli/devices.c:1834
#, c-format
msgid "Error: Device '%s' is a hardware device. It can't be deleted."
msgstr "பிழை: சாதனம௠'%s' ஒர௠வனà¯à®ªà¯Šà®°à¯à®³à¯ சாதனமà¯. அதை நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯."
-#: ../clients/cli/devices.c:1895
+#: ../clients/cli/devices.c:1904
msgid "Wi-Fi scan list"
msgstr "Wi-Fi ஸà¯à®•à¯‡à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯"
-#: ../clients/cli/devices.c:1933
+#: ../clients/cli/devices.c:1942
#, c-format
msgid "Error: 'device wifi': %s"
msgstr "பிழை: 'device wifi': %s"
-#: ../clients/cli/devices.c:1975 ../clients/cli/devices.c:2050
+#: ../clients/cli/devices.c:1984 ../clients/cli/devices.c:2059
#, c-format
msgid "Error: Access point with bssid '%s' not found."
msgstr "பிழை: '%s' எனà¯à®± bssis கொணà¯à®Ÿ அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿ காணபà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:1999 ../clients/cli/devices.c:2316
-#: ../clients/cli/devices.c:2480
+#: ../clients/cli/devices.c:2008 ../clients/cli/devices.c:2325
+#: ../clients/cli/devices.c:2489
#, c-format
msgid "Error: Device '%s' is not a Wi-Fi device."
msgstr "பிழை: '%s' சாதனம௠ஒர௠Wi-Fi சாதனமலà¯à®²."
-#: ../clients/cli/devices.c:2209
+#: ../clients/cli/devices.c:2218
msgid "SSID or BSSID: "
msgstr "SSID அலà¯à®²à®¤à¯ BSSID: "
-#: ../clients/cli/devices.c:2214
+#: ../clients/cli/devices.c:2223
#, c-format
msgid "Error: SSID or BSSID are missing."
msgstr "பிழை: SSID அலலà¯à®¤à¯ BSSID இலà¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:2238
+#: ../clients/cli/devices.c:2247
#, c-format
msgid "Error: bssid argument value '%s' is not a valid BSSID."
msgstr "பிழை: bssid அளவà¯à®°à¯ மதிபà¯à®ªà¯ '%s' ஒர௠சரியான BSSID அலà¯à®²."
-#: ../clients/cli/devices.c:2262
+#: ../clients/cli/devices.c:2271
#, c-format
msgid ""
"Error: wep-key-type argument value '%s' is invalid, use 'key' or 'phrase'."
@@ -3738,154 +4241,154 @@ msgstr ""
"பிழை: wep-key-type அளவà¯à®°à¯ மதிபà¯à®ªà¯ '%s' தவறானத௠'key' அலà¯à®²à®¤à¯ 'phrase' à®à®ªà¯ "
"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯."
-#: ../clients/cli/devices.c:2282
+#: ../clients/cli/devices.c:2291
#, c-format
msgid "Error: %s: %s."
msgstr "பிழை: %s: %s."
-#: ../clients/cli/devices.c:2297
+#: ../clients/cli/devices.c:2306
#, c-format
msgid "Error: BSSID to connect to (%s) differs from bssid argument (%s)."
msgstr ""
"பிழை: (%s) கà¯à®•à¯ இணைகà¯à®• வேணà¯à®Ÿà®¿à®¯ BSSID bssid அளவà¯à®°à¯à®µà®¿à®²à®¿à®°à¯à®¨à¯à®¤à¯ (%s) "
"வேறà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯."
-#: ../clients/cli/devices.c:2303
+#: ../clients/cli/devices.c:2312
#, c-format
msgid "Error: Parameter '%s' is neither SSID nor BSSID."
msgstr "பிழை: அளவà¯à®°à¯ '%s' SSID ஆகவà¯à®®à¯ இலà¯à®²à¯ˆ BSSID ஆகவà¯à®®à¯ இலà¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:2318 ../clients/cli/devices.c:2482
+#: ../clients/cli/devices.c:2327 ../clients/cli/devices.c:2491
#, c-format
msgid "Error: No Wi-Fi device found."
msgstr "பிழை: Wi-Fi சாதனம௠இலà¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:2336
+#: ../clients/cli/devices.c:2345
#, c-format
msgid "Error: No network with SSID '%s' found."
msgstr "பிழை: '%s' எனà¯à®± SSID கொணà¯à®Ÿ பிணையம௠இலà¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:2338
+#: ../clients/cli/devices.c:2347
#, c-format
msgid "Error: No access point with BSSID '%s' found."
msgstr "பிழை: '%s' எனà¯à®± BSSID கொணà¯à®Ÿ அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿ காணபà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:2377
+#: ../clients/cli/devices.c:2386
msgid "Password: "
msgstr "கடவà¯à®šà¯à®šà¯Šà®²à¯:"
-#: ../clients/cli/devices.c:2509
+#: ../clients/cli/devices.c:2518
#, c-format
msgid "Error: 'device wifi' command '%s' is not valid."
msgstr "பிழை: 'device wifi' கடà¯à®Ÿà®³à¯ˆ '%s' செலà¯à®²à®¾à®¤à®¤à¯."
-#: ../clients/cli/devices.c:2556
+#: ../clients/cli/devices.c:2565
msgid "WiMAX NSP list"
msgstr "WiMAX NSP படà¯à®Ÿà®¿à®¯à®²à¯"
-#: ../clients/cli/devices.c:2593
+#: ../clients/cli/devices.c:2602
#, c-format
msgid "Error: 'device wimax': %s"
msgstr "பிழை: 'device wimax': %s"
-#: ../clients/cli/devices.c:2636
+#: ../clients/cli/devices.c:2645
#, c-format
msgid "Error: NSP with name '%s' not found."
msgstr "பிழை: '%s' எனà¯à®± பெயர௠கொணà¯à®Ÿ NSP இலà¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:2649
+#: ../clients/cli/devices.c:2658
#, c-format
msgid "Error: Device '%s' is not a WiMAX device."
msgstr "பிழை: சாதனம௠'%s' ஒர௠WiMAX சாதனம௠இலà¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:2693
+#: ../clients/cli/devices.c:2702
#, c-format
msgid "Error: Access point with nsp '%s' not found."
msgstr "பிழை: '%s' எனà¯à®± nsp கொணà¯à®Ÿ அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿ காணபà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/cli/devices.c:2730
+#: ../clients/cli/devices.c:2739
#, c-format
msgid "Error: 'device wimax' command '%s' is not valid."
msgstr "பிழை: 'device wimax' கடà¯à®Ÿà®³à¯ˆ '%s' செலà¯à®²à®¾à®¤à®¤à¯."
-#: ../clients/cli/devices.c:2900
+#: ../clients/cli/devices.c:2912
#, c-format
msgid "Error: 'dev' command '%s' is not valid."
msgstr "பிழை: 'dev' கடà¯à®Ÿà®³à¯ˆ '%s' தவறானதà¯."
-#: ../clients/cli/network-manager.c:35
+#: ../clients/cli/general.c:35
msgid "RUNNING"
msgstr "RUNNING"
#. 0
-#: ../clients/cli/network-manager.c:36
+#: ../clients/cli/general.c:36
msgid "VERSION"
msgstr "VERSION"
#. 2
-#: ../clients/cli/network-manager.c:38
+#: ../clients/cli/general.c:38
msgid "STARTUP"
msgstr "தà¯à®µà®•à¯à®•à®®à¯"
#. 3
-#: ../clients/cli/network-manager.c:39
+#: ../clients/cli/general.c:39
msgid "CONNECTIVITY"
msgstr "இணைபà¯à®ªà¯à®¤à¯à®¤à®¿à®±à®©à¯"
#. 4
-#: ../clients/cli/network-manager.c:40
+#: ../clients/cli/general.c:40
msgid "NETWORKING"
msgstr "NETWORKING"
#. 5
-#: ../clients/cli/network-manager.c:41
+#: ../clients/cli/general.c:41
msgid "WIFI-HW"
msgstr "WIFI-HW"
#. 6
-#: ../clients/cli/network-manager.c:42
+#: ../clients/cli/general.c:42
msgid "WIFI"
msgstr "WIFI"
#. 7
-#: ../clients/cli/network-manager.c:43
+#: ../clients/cli/general.c:43
msgid "WWAN-HW"
msgstr "WWAN-HW"
#. 8
-#: ../clients/cli/network-manager.c:44
+#: ../clients/cli/general.c:44
msgid "WWAN"
msgstr "WWAN"
#. 9
-#: ../clients/cli/network-manager.c:45
+#: ../clients/cli/general.c:45
msgid "WIMAX-HW"
msgstr "WIMAX-HW"
#. 10
-#: ../clients/cli/network-manager.c:46
+#: ../clients/cli/general.c:46
msgid "WIMAX"
msgstr "WIMAX"
-#: ../clients/cli/network-manager.c:68
+#: ../clients/cli/general.c:68
msgid "PERMISSION"
msgstr "PERMISSION"
#. 0
-#: ../clients/cli/network-manager.c:69
+#: ../clients/cli/general.c:69
msgid "VALUE"
msgstr "VALUE"
-#: ../clients/cli/network-manager.c:77
+#: ../clients/cli/general.c:77
msgid "LEVEL"
msgstr "LEVEL"
#. 0
-#: ../clients/cli/network-manager.c:78
+#: ../clients/cli/general.c:78
msgid "DOMAINS"
msgstr "DOMAINS"
-#: ../clients/cli/network-manager.c:93
+#: ../clients/cli/general.c:92
#, c-format
msgid ""
"Usage: nmcli general { COMMAND | help }\n"
@@ -3914,7 +4417,7 @@ msgstr ""
" logging [level <log level>] [domains <log domains>]\n"
"\n"
-#: ../clients/cli/network-manager.c:105
+#: ../clients/cli/general.c:103
#, c-format
msgid ""
"Usage: nmcli general status { help }\n"
@@ -3932,7 +4435,7 @@ msgstr ""
"அழைகà¯à®•à®¿à®±à®¤à¯ எனப௠பொரà¯à®³à¯\n"
"\n"
-#: ../clients/cli/network-manager.c:115
+#: ../clients/cli/general.c:112
#, c-format
msgid ""
"Usage: nmcli general hostname { ARGUMENTS | help }\n"
@@ -3956,7 +4459,7 @@ msgstr ""
"அமைகà¯à®•à¯à®®à¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:128
+#: ../clients/cli/general.c:124
#, c-format
msgid ""
"Usage: nmcli general permissions { help }\n"
@@ -3969,7 +4472,7 @@ msgstr ""
"à®…à®™à¯à®•à¯€à®•à®°à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ செயலà¯à®ªà®¾à®Ÿà¯à®•à®³à¯à®•à¯à®•à®¾à®© காலர௠அனà¯à®®à®¤à®¿à®•à®³à¯ˆà®•à¯ காடà¯à®Ÿà¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:137
+#: ../clients/cli/general.c:132
#, c-format
msgid ""
"Usage: nmcli general logging { ARGUMENTS | help }\n"
@@ -3997,7 +4500,7 @@ msgstr ""
"கையேடà¯à®Ÿà¯à®ªà¯ பகà¯à®•à®¤à¯à®¤à¯ˆà®ªà¯ பாரà¯à®•à¯à®•à®µà¯à®®à¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:151
+#: ../clients/cli/general.c:145
#, c-format
msgid ""
"Usage: nmcli networking { COMMAND | help }\n"
@@ -4022,7 +4525,7 @@ msgstr ""
" connectivity [check]\n"
"\n"
-#: ../clients/cli/network-manager.c:162
+#: ../clients/cli/general.c:155
#, c-format
msgid ""
"Usage: nmcli networking on { help }\n"
@@ -4035,7 +4538,7 @@ msgstr ""
"பிணையதà¯à®¤à¯ˆ ஆன௠செயà¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:171
+#: ../clients/cli/general.c:163
#, c-format
msgid ""
"Usage: nmcli networking off { help }\n"
@@ -4048,7 +4551,7 @@ msgstr ""
"பிணையதà¯à®¤à¯ˆ ஆஃப௠செயà¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:180
+#: ../clients/cli/general.c:171
#, c-format
msgid ""
"Usage: nmcli networking connectivity { ARGUMENTS | help }\n"
@@ -4068,7 +4571,7 @@ msgstr ""
"'check' விரà¯à®ªà¯à®ªà®®à¯ கொடà¯à®¤à¯à®¤à®²à¯ NetworkManager இணைபà¯à®ªà¯ மீணà¯à®Ÿà¯à®®à¯ சோதிகà¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:193
+#: ../clients/cli/general.c:183
#, c-format
msgid ""
"Usage: nmcli radio { COMMAND | help }\n"
@@ -4093,7 +4596,7 @@ msgstr ""
" all | wifi | wwan [ on | off ]\n"
"\n"
-#: ../clients/cli/network-manager.c:208
+#: ../clients/cli/general.c:197
#, c-format
msgid ""
"Usage: nmcli radio all { ARGUMENTS | help }\n"
@@ -4111,7 +4614,7 @@ msgstr ""
"செயà¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:219
+#: ../clients/cli/general.c:207
#, c-format
msgid ""
"Usage: nmcli radio wifi { ARGUMENTS | help }\n"
@@ -4128,7 +4631,7 @@ msgstr ""
"Wi-Fi ரேடியோ ஸà¯à®µà®¿à®Ÿà¯à®šà¯à®šà®¿à®©à¯ நிலையைப௠பெறà¯, அலà¯à®²à®¤à¯ அதை ஆன௠அலà¯à®²à®¤à¯ ஆஃப௠செயà¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:230
+#: ../clients/cli/general.c:217
#, c-format
msgid ""
"Usage: nmcli radio wwan { ARGUMENTS | help }\n"
@@ -4146,7 +4649,7 @@ msgstr ""
"ஆஃப௠செயà¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:242
+#: ../clients/cli/general.c:228
#, c-format
msgid ""
"Usage: nmcli radio wimax { ARGUMENTS | help }\n"
@@ -4163,171 +4666,193 @@ msgstr ""
"WiMAX ரேடியோ ஸà¯à®µà®¿à®Ÿà¯à®šà¯à®šà®¿à®©à¯ நிலையைப௠பெறà¯, அலà¯à®²à®¤à¯ அதை ஆன௠அலà¯à®²à®¤à¯ ஆஃப௠செயà¯.\n"
"\n"
-#: ../clients/cli/network-manager.c:262
+#: ../clients/cli/general.c:248
msgid "asleep"
msgstr "தூஙà¯à®•à®¿à®•à¯ கொணà¯à®Ÿà®¿à®°à¯à®¤à¯à®¤à®²à¯"
-#: ../clients/cli/network-manager.c:264
+#: ../clients/cli/general.c:250
msgid "connecting"
msgstr "இணைகà¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/network-manager.c:266
+#: ../clients/cli/general.c:252
msgid "connected (local only)"
msgstr "இணைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯ (கணினிகà¯à®•à¯à®³à¯ மடà¯à®Ÿà¯à®®à¯)"
-#: ../clients/cli/network-manager.c:268
+#: ../clients/cli/general.c:254
msgid "connected (site only)"
msgstr "இணைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯ (தளம௠மடà¯à®Ÿà¯à®®à¯)"
-#: ../clients/cli/network-manager.c:272
+#: ../clients/cli/general.c:258
msgid "disconnecting"
msgstr "தà¯à®£à¯à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/network-manager.c:288
+#: ../clients/cli/general.c:274
msgid "portal"
msgstr "வலைவாசலà¯"
-#: ../clients/cli/network-manager.c:290
+#: ../clients/cli/general.c:276
msgid "limited"
msgstr "வரமà¯à®ªà¯à®Ÿà¯ˆà®¯à®¤à¯"
-#: ../clients/cli/network-manager.c:292
+#: ../clients/cli/general.c:278
msgid "full"
msgstr "à®®à¯à®´à¯"
-#: ../clients/cli/network-manager.c:330
+#: ../clients/cli/general.c:316
#, c-format
msgid "Error: only these fields are allowed: %s"
msgstr "பிழை: இநà¯à®¤à®ªà¯ பà¯à®²à®™à¯à®•à®³à¯ மடà¯à®Ÿà¯à®®à¯‡ அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯: %s"
-#: ../clients/cli/network-manager.c:350 ../clients/cli/network-manager.c:351
-#: ../clients/cli/network-manager.c:352 ../clients/cli/network-manager.c:353
-#: ../clients/cli/network-manager.c:354 ../clients/cli/network-manager.c:356
-#: ../clients/cli/network-manager.c:357
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "enabled"
msgstr "செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/network-manager.c:350 ../clients/cli/network-manager.c:351
-#: ../clients/cli/network-manager.c:352 ../clients/cli/network-manager.c:353
-#: ../clients/cli/network-manager.c:354 ../clients/cli/network-manager.c:356
-#: ../clients/cli/network-manager.c:357
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "disabled"
msgstr "செயலà¯à®¨à¯€à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/cli/network-manager.c:360
+#: ../clients/cli/general.c:346
msgid "NetworkManager status"
msgstr "பிணைய மேலாளர௠நிலை"
-#: ../clients/cli/network-manager.c:365
+#: ../clients/cli/general.c:351
msgid "running"
msgstr "இயஙà¯à®•à¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/network-manager.c:368
+#: ../clients/cli/general.c:354
msgid "starting"
msgstr "தà¯à®µà®•à¯à®•à¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/network-manager.c:368
+#: ../clients/cli/general.c:354
msgid "started"
msgstr "தொடஙà¯à®•à®¿à®¯à®¤à¯"
-#: ../clients/cli/network-manager.c:439
+#: ../clients/cli/general.c:425
msgid "auth"
msgstr "auth"
-#: ../clients/cli/network-manager.c:468
+#: ../clients/cli/general.c:454
#, c-format
msgid "Error: 'general permissions': %s"
msgstr "பிழை: 'general permissions': %s"
-#: ../clients/cli/network-manager.c:482
+#: ../clients/cli/general.c:468
msgid "NetworkManager permissions"
msgstr "NetworkManager அனà¯à®®à®¤à®¿à®•à®³à¯"
-#: ../clients/cli/network-manager.c:523
+#: ../clients/cli/general.c:509
#, c-format
msgid "Error: 'general logging': %s"
msgstr "பிழை: 'general logging': %s"
-#: ../clients/cli/network-manager.c:538
+#: ../clients/cli/general.c:524
msgid "NetworkManager logging"
msgstr "NetworkManager பதிவிடலà¯"
-#: ../clients/cli/network-manager.c:560
+#: ../clients/cli/general.c:546
#, c-format
-msgid "Error: failed to set hostname: (%d) %s"
-msgstr "பிழை: வழஙà¯à®•à®¿ பெயரை அமைபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: (%d) %s"
+#| msgid "Error: failed to set hostname: (%d) %s"
+msgid "Error: failed to set hostname: %s"
+msgstr "பிழை: வழஙà¯à®•à®¿ பெயரை அமைபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %s"
-#: ../clients/cli/network-manager.c:679
+#: ../clients/cli/general.c:659
#, c-format
-msgid "Error: access denied to set logging; %s"
-msgstr "பிழை: பதிவிடலை அமைகà¯à®• அணà¯à®•à®²à¯ மறà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯; %s"
+#| msgid "Error: access denied to set logging; %s"
+msgid "Error: failed to set logging: %s"
+msgstr "பிழை: பதிவிடலை அமைபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %s"
-#: ../clients/cli/network-manager.c:681
-#, c-format
-msgid "Error: %s"
-msgstr "பிழை: %s"
-
-#: ../clients/cli/network-manager.c:689
+#: ../clients/cli/general.c:668
#, c-format
msgid "Error: 'general' command '%s' is not valid."
msgstr "பிழை: 'general' கடà¯à®Ÿà®³à¯ˆ '%s' செலà¯à®²à®¾à®¤à®¤à¯."
-#: ../clients/cli/network-manager.c:707
+#: ../clients/cli/general.c:686
#, c-format
msgid "Error: '--fields' value '%s' is not valid here (allowed field: %s)"
msgstr ""
"பிழை: '--fields' மதிபà¯à®ªà¯ '%s' இஙà¯à®•à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®² (அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ பà¯à®²à®®à¯: "
"%s)"
-#: ../clients/cli/network-manager.c:732
+#: ../clients/cli/general.c:711
#, c-format
msgid "Error: invalid '%s' argument: '%s' (use on/off)."
msgstr "பிழை: செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ '%s' மதிபà¯à®ªà¯à®°à¯: '%s' (on/off à®à®ªà¯à®ªà®¯à®©à¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯)."
-#: ../clients/cli/network-manager.c:743
+#: ../clients/cli/general.c:722
msgid "Connectivity"
msgstr "இணைபà¯à®ªà¯à®¤à¯à®¤à®¿à®±à®©à¯"
-#: ../clients/cli/network-manager.c:755
+#: ../clients/cli/general.c:737
msgid "Networking"
msgstr "பிணையமாகà¯à®•à®®à¯"
-#: ../clients/cli/network-manager.c:780
+#: ../clients/cli/general.c:762
#, c-format
msgid "Error: 'networking connectivity' command '%s' is not valid."
msgstr "பிழை: 'networking connectivity' கடà¯à®Ÿà®³à¯ˆ '%s' செலà¯à®²à®¾à®¤à®¤à¯."
-#: ../clients/cli/network-manager.c:796
+#: ../clients/cli/general.c:778
#, c-format
msgid "Error: 'networking' command '%s' is not valid."
msgstr "பிழை: 'networking' கடà¯à®Ÿà®³à¯ˆ '%s' செலà¯à®²à®¾à®¤à®¤à¯."
-#: ../clients/cli/network-manager.c:822 ../clients/cli/network-manager.c:842
+#: ../clients/cli/general.c:807 ../clients/cli/general.c:827
msgid "Radio switches"
msgstr "ரேடியோ ஸà¯à®µà®¿à®Ÿà¯à®šà¯à®šà¯à®•à®³à¯"
#. no argument, show current WiFi state
-#: ../clients/cli/network-manager.c:860
+#: ../clients/cli/general.c:845
msgid "Wi-Fi radio switch"
msgstr "Wi-Fi ரேடியோ ஸà¯à®µà®¿à®Ÿà¯à®šà¯"
#. no argument, show current WWAN (mobile broadband) state
-#: ../clients/cli/network-manager.c:876
+#: ../clients/cli/general.c:861
msgid "WWAN radio switch"
msgstr "WWAN ரேடியோ ஸà¯à®µà®¿à®Ÿà¯à®šà¯"
#. no argument, show current WiMAX state
-#: ../clients/cli/network-manager.c:893
+#: ../clients/cli/general.c:878
msgid "WiMAX radio switch"
msgstr "WiMAX ரேடியோ ஸà¯à®µà®¿à®Ÿà¯à®šà¯"
-#: ../clients/cli/network-manager.c:905
+#: ../clients/cli/general.c:890
#, c-format
msgid "Error: 'radio' command '%s' is not valid."
msgstr "பிழை: 'radio' கடà¯à®Ÿà®³à¯ˆ '%s' செலà¯à®²à®¾à®¤à®¤à¯."
-#: ../clients/cli/nmcli.c:82
-#, c-format
+#: ../clients/cli/nmcli.c:86
+#, c-format
+#| msgid ""
+#| "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
+#| "\n"
+#| "OPTIONS\n"
+#| " -t[erse] terse output\n"
+#| " -p[retty] pretty output\n"
+#| " -m[ode] tabular|multiline output mode\n"
+#| " -f[ields] <field1,field2,...>|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"
+#| " -w[ait] <seconds> set timeout waiting for "
+#| "finishing operations\n"
+#| " -v[ersion] show program version\n"
+#| " -h[elp] print this help\n"
+#| "\n"
+#| "OBJECT\n"
+#| " g[eneral] NetworkManager's general status and operations\n"
+#| " n[etworking] overall networking control\n"
+#| " r[adio] NetworkManager radio switches\n"
+#| " c[onnection] NetworkManager's connections\n"
+#| " d[evice] devices managed by NetworkManager\n"
+#| "\n"
msgid ""
"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
"\n"
@@ -4352,19 +4877,21 @@ msgid ""
" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+" a[gent] NetworkManager secret agent or polkit agent\n"
"\n"
msgstr ""
"பயனà¯à®ªà®¾à®Ÿà¯: %s [OPTIONS] OBJECT { COMMAND | help }\n"
"\n"
"விரà¯à®ªà¯à®ªà®™à¯à®•à®³à¯\n"
-" -t[erse] terse output\n"
-" -p[retty] pretty output\n"
-" -m[ode] tabular|multiline output mode\n"
-" -f[ields] <field1,field2,...>|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"
+" -t[erse] சà¯à®°à¯à®•à¯à®•à®®à®¾à®© வெளியீடà¯\n"
+" -p[retty] விரிவான வெளியீடà¯\n"
+" -m[ode] tabular|multiline வெளீயீட௠மà¯à®±à¯ˆ\n"
+" -f[ields] <field1,field2,...>|all|common வெளியீடà¯à®Ÿà®¿à®²à¯ வழஙà¯à®• வேணà¯à®Ÿà®¿à®¯ "
+"பà¯à®²à®™à¯à®•à®³à¯ˆà®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯\n"
+" -e[scape] yes|no மதிபà¯à®ªà¯à®•à®³à®¿à®²à¯ உளà¯à®³ நெடà¯à®µà®°à®¿à®šà¯ˆ "
+"பிரிபà¯à®ªà®¾à®©à¯à®•à®³à¯ˆà®¤à¯ தவிரà¯\n"
+" -n[ocheck] nmcli மறà¯à®±à¯à®®à¯ "
+"NetworkManager பதிபà¯à®ªà¯à®•à®³à¯ˆà®šà¯ சோதிகà¯à®• வேணà¯à®Ÿà¯à®®à¯\n"
" -a[sk] ask for missing parameters\n"
" -w[ait] <seconds> set timeout waiting for "
"finishing operations\n"
@@ -4377,65 +4904,66 @@ msgstr ""
" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+" a[gent] NetworkManager secret agent or polkit agent\n"
"\n"
-#: ../clients/cli/nmcli.c:136
+#: ../clients/cli/nmcli.c:142
#, c-format
msgid "Error: Object '%s' is unknown, try 'nmcli help'."
msgstr "பிழை: பொரà¯à®³à¯ '%s' ஆனத௠தெரியாததà¯, 'nmcli உதவியை' à®®à¯à®¯à®±à¯à®šà®¿à®•à¯à®•à®µà¯à®®à¯."
-#: ../clients/cli/nmcli.c:166
+#: ../clients/cli/nmcli.c:172
#, c-format
msgid "Error: Option '--terse' is specified the second time."
msgstr "பிழை: விரà¯à®ªà¯à®ªà®®à¯ '--terse' இரணà¯à®Ÿà®¾à®µà®¤à¯ à®®à¯à®±à¯ˆ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯."
-#: ../clients/cli/nmcli.c:171
+#: ../clients/cli/nmcli.c:177
#, c-format
msgid "Error: Option '--terse' is mutually exclusive with '--pretty'."
msgstr "பிழை: விரà¯à®ªà¯à®ªà®®à¯ '--terse'ஆனத௠'--pretty' உடன௠ஒனà¯à®±à®¾à®• உளà¯à®³à®¤à¯."
-#: ../clients/cli/nmcli.c:179
+#: ../clients/cli/nmcli.c:185
#, c-format
msgid "Error: Option '--pretty' is specified the second time."
msgstr "பிழை: விரà¯à®ªà¯à®ªà®®à¯ '--pretty' இரணà¯à®Ÿà®¾à®µà®¤à¯ à®®à¯à®±à¯ˆ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®Ÿà®¤à¯."
-#: ../clients/cli/nmcli.c:184
+#: ../clients/cli/nmcli.c:190
#, c-format
msgid "Error: Option '--pretty' is mutually exclusive with '--terse'."
msgstr "பிழை: விரà¯à®ªà¯à®ªà®®à¯ '--pretty'ஆனத௠'--terse' உடன௠ஒனà¯à®±à®¾à®• உளà¯à®³à®¤à¯"
-#: ../clients/cli/nmcli.c:194 ../clients/cli/nmcli.c:210
-#: ../clients/cli/nmcli.c:239
+#: ../clients/cli/nmcli.c:200 ../clients/cli/nmcli.c:216
+#: ../clients/cli/nmcli.c:245
#, c-format
msgid "Error: missing argument for '%s' option."
msgstr "பிழை: '%s' விரà¯à®ªà¯à®ªà®¤à¯à®¤à®¿à®±à¯à®•à¯ விவாதம௠விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯."
-#: ../clients/cli/nmcli.c:203 ../clients/cli/nmcli.c:219
+#: ../clients/cli/nmcli.c:209 ../clients/cli/nmcli.c:225
#, c-format
msgid "Error: '%s' is not valid argument for '%s' option."
msgstr "பிழை: '%s' ஆனத௠'%s' விரà¯à®ªà¯à®ªà®¤à¯à®¤à®¿à®±à¯à®•à¯ சரியான விவாதம௠அலà¯à®²."
-#: ../clients/cli/nmcli.c:226
+#: ../clients/cli/nmcli.c:232
#, c-format
msgid "Error: fields for '%s' options are missing."
msgstr "பிழை: '%s' கà¯à®•à¯ பà¯à®²à®™à¯à®•à®³à¯ விடà¯à®ªà®Ÿà¯à®Ÿà®¤à¯."
-#: ../clients/cli/nmcli.c:244
+#: ../clients/cli/nmcli.c:250
#, c-format
msgid "Error: '%s' is not a valid timeout for '%s' option."
msgstr "பிழை: '%s' விரà¯à®ªà¯à®ªà®¤à¯à®¤à®¿à®±à¯à®•à¯ '%s' ஆனத௠ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© காலமà¯à®Ÿà®¿à®µà®²à¯à®²."
-#: ../clients/cli/nmcli.c:251
+#: ../clients/cli/nmcli.c:257
#, c-format
msgid "nmcli tool, version %s\n"
msgstr "nmcli கரà¯à®µà®¿, பதிபà¯à®ªà¯ %s\n"
-#: ../clients/cli/nmcli.c:257
+#: ../clients/cli/nmcli.c:263
#, c-format
msgid "Error: Option '%s' is unknown, try 'nmcli -help'."
msgstr "பிழை: விரà¯à®ªà¯à®ªà®®à¯ '%s'ஆனத௠தெரியாததà¯, 'nmcli -உதவியை' à®®à¯à®¯à®±à¯à®šà®¿à®•à¯à®•à®µà¯à®®à¯."
-#: ../clients/cli/nmcli.c:337 ../clients/cli/nmcli.c:346
+#: ../clients/cli/nmcli.c:346 ../clients/cli/nmcli.c:356
#, c-format
msgid ""
"\n"
@@ -4444,127 +4972,145 @@ msgstr ""
"\n"
"பிழை: சமிகà¯à®žà¯ˆ %s (%d) மூலம௠nmcli à®®à¯à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯.\n"
-#: ../clients/cli/nmcli.c:377
+#: ../clients/cli/nmcli.c:387
#, c-format
msgid "Failed to set signal mask: %d\n"
msgstr "சிகà¯à®©à®²à¯ மூடà¯à®¤à®²à¯ˆ அமைபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %d\n"
-#: ../clients/cli/nmcli.c:384
+#: ../clients/cli/nmcli.c:394
#, c-format
msgid "Failed to create signal handling thread: %d\n"
msgstr "சிகà¯à®©à®²à¯ˆà®•à¯ கையாளà¯à®®à¯ இழையை உரà¯à®µà®¾à®•à¯à®•à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %d\n"
-#: ../clients/cli/nmcli.c:481 ../clients/nm-online.c:197
+#: ../clients/cli/nmcli.c:491 ../clients/nm-online.c:197
#, c-format
msgid "Error: Could not create NMClient object: %s."
msgstr "பிழை: NMClient பொரà¯à®³à¯ˆ உரà¯à®µà®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../clients/cli/nmcli.c:498
+#: ../clients/cli/nmcli.c:508
msgid "Success"
msgstr "வெறà¯à®±à®¿"
-#: ../clients/cli/settings.c:656
+#: ../clients/cli/polkit-agent.c:82
+#, c-format
+#| msgid "Authentication"
+msgid "Authentication message: %s\n"
+msgstr "à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ செயà¯à®¤à®¿: %s\n"
+
+#: ../clients/cli/polkit-agent.c:88
+#, c-format
+#| msgid "Authentication"
+msgid "Authentication error: %s\n"
+msgstr "à®…à®™à¯à®•à¯€à®•à®¾à®°à®ªà¯ பிழை: %s\n"
+
+#: ../clients/cli/polkit-agent.c:134
+#, c-format
+#| msgid "Modem initialization failed"
+msgid "Warning: polkit agent initialization failed: %s\n"
+msgstr "எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: polkit à®®à¯à®•à®µà®°à¯ˆà®¤à¯ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯: %s\n"
+
+#: ../clients/cli/settings.c:670
#, c-format
msgid "%d (key)"
msgstr "%d (விசை)"
-#: ../clients/cli/settings.c:658
+#: ../clients/cli/settings.c:672
#, c-format
msgid "%d (passphrase)"
msgstr "%d (கடவ௠வாகà¯à®•à®¿à®¯à®®à¯)"
-#: ../clients/cli/settings.c:661 ../clients/cli/settings.c:742
+#: ../clients/cli/settings.c:675 ../clients/cli/settings.c:756
#, c-format
msgid "%d (unknown)"
msgstr "%d (தெரியாத)"
-#: ../clients/cli/settings.c:690
+#: ../clients/cli/settings.c:704
msgid "0 (NONE)"
msgstr "0 (NONE)"
-#: ../clients/cli/settings.c:696
+#: ../clients/cli/settings.c:710
msgid "REORDER_HEADERS, "
msgstr "REORDER_HEADERS, "
-#: ../clients/cli/settings.c:698
+#: ../clients/cli/settings.c:712
msgid "GVRP, "
msgstr "GVRP, "
-#: ../clients/cli/settings.c:700
+#: ../clients/cli/settings.c:714
msgid "LOOSE_BINDING, "
msgstr "LOOSE_BINDING, "
-#: ../clients/cli/settings.c:736
+#: ../clients/cli/settings.c:750
#, c-format
msgid "%d (disabled)"
msgstr "%d (à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯)"
-#: ../clients/cli/settings.c:738
+#: ../clients/cli/settings.c:752
#, c-format
msgid "%d (enabled, prefer public IP)"
msgstr "%d (செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯, பொத௠IP சிறநà¯à®¤à®¤à¯)"
-#: ../clients/cli/settings.c:740
+#: ../clients/cli/settings.c:754
#, c-format
msgid "%d (enabled, prefer temporary IP)"
msgstr "%d (செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯, தறà¯à®•à®¾à®²à®¿à®• IP சிறநà¯à®¤à®¤à¯)"
-#: ../clients/cli/settings.c:752
+#: ../clients/cli/settings.c:766
msgid "0 (none)"
msgstr "0 (எதà¯à®µà¯à®®à®¿à®²à¯à®²à¯ˆ)"
-#: ../clients/cli/settings.c:758
+#: ../clients/cli/settings.c:772
msgid "agent-owned, "
msgstr "à®à®œà®©à¯à®Ÿà¯ உரிமைகொணà¯à®Ÿà®¤à¯, "
-#: ../clients/cli/settings.c:760
+#: ../clients/cli/settings.c:774
msgid "not saved, "
msgstr "சேமிகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ, "
-#: ../clients/cli/settings.c:762
+#: ../clients/cli/settings.c:776
msgid "not required, "
msgstr "தேவைபà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ, "
-#: ../clients/cli/settings.c:1044
+#: ../clients/cli/settings.c:1059
msgid "0 (disabled)"
msgstr "0 (à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯)"
-#: ../clients/cli/settings.c:1050
+#: ../clients/cli/settings.c:1065
msgid "enabled, "
msgstr "செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯, "
-#: ../clients/cli/settings.c:1052
+#: ../clients/cli/settings.c:1067
msgid "advertise, "
msgstr "காடà¯à®Ÿà®¿à®•à¯à®•à¯Šà®³à¯"
-#: ../clients/cli/settings.c:1054
+#: ../clients/cli/settings.c:1069
msgid "willing, "
msgstr "விரà¯à®®à¯à®ªà¯à®µà®¤à¯, "
-#: ../clients/cli/settings.c:1082
+#: ../clients/cli/settings.c:1097
msgid "-1 (unset)"
msgstr "-1 (அமைகà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ)"
-#: ../clients/cli/settings.c:1179 ../clients/cli/settings.c:1511
-#: ../clients/cli/settings.c:1553
+#: ../clients/cli/settings.c:1194 ../clients/cli/settings.c:1481
+#: ../clients/cli/settings.c:1523
msgid "auto"
msgstr "தானே"
-#: ../clients/cli/settings.c:1192
+#: ../clients/cli/settings.c:1207
msgid "default"
msgstr "à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯"
-#: ../clients/cli/settings.c:1681
+#: ../clients/cli/settings.c:1651
#, c-format
msgid "Do you also want to set '%s' to '%s'? [yes]: "
msgstr "'%s' à® '%s' கà¯à®•à¯ அமைகà¯à®•à®µà¯à®®à¯ விரà¯à®®à¯à®ªà¯à®•à®¿à®±à¯€à®°à¯à®•à®³à®¾? [yes]: "
-#: ../clients/cli/settings.c:1683
+#: ../clients/cli/settings.c:1653
#, c-format
msgid "Do you also want to clear '%s'? [yes]: "
msgstr "'%s' à®à®¯à¯à®®à¯ அழிகà¯à®• வேணà¯à®Ÿà¯à®®à®¾? [yes]: "
-#: ../clients/cli/settings.c:1844
+#: ../clients/cli/settings.c:1814
#, c-format
msgid ""
"Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"
@@ -4573,96 +5119,122 @@ msgstr ""
"à®®à¯à®±à¯ˆà®®à¯ˆà®¯à®¿à®²à¯ அத௠"
"பà¯à®±à®•à¯à®•à®£à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà®²à®¾à®®à¯\n"
-#: ../clients/cli/settings.c:1926 ../clients/cli/settings.c:2186
-#: ../clients/cli/settings.c:4262
+#: ../clients/cli/settings.c:1833
+#, c-format
+msgid "Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"
+msgstr ""
+"எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: %s.%s ஠அமைகà¯à®•, ipv4 மறà¯à®±à¯à®®à¯ ipv6 அமைவà¯à®•à®³à¯ˆ அகறà¯à®± வேணà¯à®Ÿà¯à®®à¯\n"
+
+#: ../clients/cli/settings.c:1835
+#| msgid "Do you want to provide them? (yes/no) [yes] "
+msgid "Do you want to remove them? [yes] "
+msgstr "அவறà¯à®±à¯ˆ அகறà¯à®±à®µà®¾? [yes] "
+
+#: ../clients/cli/settings.c:1931 ../clients/cli/settings.c:2253
+#: ../clients/cli/settings.c:4326
#, c-format
msgid "'%s' is not valid"
msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²"
-#: ../clients/cli/settings.c:1949
+#: ../clients/cli/settings.c:1954
#, c-format
msgid "'%d' is not valid; use <%d-%d>"
msgstr "'%d' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; <%d-%d> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/cli/settings.c:1971
+#: ../clients/cli/settings.c:1976
+#, c-format
+#| msgid "'%d' is not valid; use <%d-%d>"
+msgid "'%lld' is not valid; use <%lld-%lld>"
+msgstr "'%lld' எனà¯à®ªà®¤à¯ தவறானதà¯; <%lld-%lld> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
+
+#: ../clients/cli/settings.c:1998
#, c-format
-msgid "'%u' is not valid; use <%d-%d>"
-msgstr "'%u' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; <%d-%d> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
+#| msgid "'%u' is not valid; use <%d-%d>"
+msgid "'%u' is not valid; use <%u-%u>"
+msgstr "'%u' எனà¯à®ªà®¤à¯ தவறானதà¯; <%u-%u> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/cli/settings.c:2037
+#: ../clients/cli/settings.c:2064
#, c-format
msgid "'%s' is not valid; use <option>=<value>"
msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; <option>=<value> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/cli/settings.c:2071
+#: ../clients/cli/settings.c:2098
#, c-format
msgid "index '%s' is not valid"
msgstr "அடà¯à®Ÿà®µà®£à¯ˆ '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²"
-#: ../clients/cli/settings.c:2076 ../clients/cli/settings.c:2101
+#: ../clients/cli/settings.c:2103 ../clients/cli/settings.c:2128
msgid "no item to remove"
msgstr "நீகà¯à®•à¯à®µà®¤à®±à¯à®•à¯ எதà¯à®µà¯à®®à¯ இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2080 ../clients/cli/settings.c:2105
+#: ../clients/cli/settings.c:2107 ../clients/cli/settings.c:2132
#, c-format
msgid "index '%d' is not in range <0-%d>"
msgstr "அடà¯à®Ÿà®µà®£à¯ˆ '%d' ஆனத௠வரமà¯à®ªà¯ <0-%d> இல௠இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2120
+#: ../clients/cli/settings.c:2147
#, c-format
msgid "invalid option '%s'"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ விரà¯à®ªà¯à®ªà®®à¯ '%s'"
-#: ../clients/cli/settings.c:2122
+#: ../clients/cli/settings.c:2149
msgid "missing option"
msgstr "விரà¯à®ªà¯à®ªà®®à¯ விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯"
-#: ../clients/cli/settings.c:2152
+#: ../clients/cli/settings.c:2179 ../clients/cli/settings.c:2199
+#: ../clients/cli/settings.c:2219
#, c-format
msgid "'%s' is not a valid number (or out of range)"
msgstr "'%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© எணà¯à®£à®²à¯à®² (அலà¯à®²à®¤à¯ வரமà¯à®ªà®¿à®±à¯à®•à¯ வெளியே உளà¯à®³à®¤à¯)"
-#: ../clients/cli/settings.c:2203
+#: ../clients/cli/settings.c:2269
#, c-format
msgid "'%s' is not a valid Ethernet MAC"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© ஈதà¯à®¤à®°à¯à®¨à¯†à®Ÿà¯ MAC அலà¯à®²"
-#: ../clients/cli/settings.c:2228 ../libnm-core/nm-setting-connection.c:795
-#: ../libnm-core/nm-setting-infiniband.c:271
-#: ../libnm-util/nm-setting-connection.c:833
-#: ../libnm-util/nm-setting-infiniband.c:268
+#: ../clients/cli/settings.c:2294 ../libnm-core/nm-setting-connection.c:795
+#: ../libnm-core/nm-setting-infiniband.c:256
+#: ../libnm-util/nm-setting-connection.c:835
+#: ../libnm-util/nm-setting-infiniband.c:270
#, c-format
msgid "'%s' is not a valid interface name"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இடைமà¯à®• பெயர௠இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2246 ../clients/cli/settings.c:3651
-#: ../libnm-core/nm-setting-gsm.c:332 ../libnm-util/nm-setting-gsm.c:372
+#: ../clients/cli/settings.c:2318
#, c-format
-msgid "'%s' is not a number"
-msgstr "'%s' எனà¯à®ªà®¤à¯ ஒர௠எணà¯à®£à®²à¯à®²"
+#| msgid "'%s' is not a valid channel; use <1-13>"
+msgid "'%s' is not a valid flag number; use <0-%d>"
+msgstr "'%s' எனà¯à®ªà®¤à¯ தவறான கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®²à¯ எணà¯; <0-%d> à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/cli/settings.c:2298
+#: ../clients/cli/settings.c:2330
+#, c-format
+msgid "Warning: '%s' sum is higher than all flags => all flags set\n"
+msgstr ""
+"எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: '%s' கூடà¯à®¤à®²à®¾à®©à®¤à¯ அனைதà¯à®¤à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®²à¯à®•à®³à¯ˆ விட அதிகமாக உளà¯à®³à®¤à¯ => "
+"அமைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³ அனைதà¯à®¤à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®²à¯à®•à®³à¯\n"
+
+#: ../clients/cli/settings.c:2371
#, c-format
msgid "'%s' is not a valid hex character"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© hex எழà¯à®¤à¯à®¤à®²à¯à®²"
-#: ../clients/cli/settings.c:2328
+#: ../clients/cli/settings.c:2401
#, c-format
msgid "'%s' is not a valid MAC"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© MAC அலà¯à®²"
-#: ../clients/cli/settings.c:2365 ../libnm-core/nm-setting-connection.c:784
-#: ../libnm-util/nm-setting-connection.c:790
+#: ../clients/cli/settings.c:2438 ../libnm-core/nm-setting-connection.c:784
+#: ../libnm-util/nm-setting-connection.c:792
#, c-format
msgid "'%s' is not a valid UUID"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à¯à®®à¯ UUID அலà¯à®²"
-#: ../clients/cli/settings.c:2432
+#: ../clients/cli/settings.c:2505
#, c-format
msgid "the property doesn't contain permission '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ '%s' அனà¯à®®à®¤à®¿ இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2444
+#: ../clients/cli/settings.c:2517
msgid ""
"Enter a list of user permissions. This is a list of user names formatted "
"as:\n"
@@ -4679,39 +5251,39 @@ msgstr ""
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: alice bob charlie\n"
-#: ../clients/cli/settings.c:2463
+#: ../clients/cli/settings.c:2536
#, c-format
msgid "'%s' is not valid master; use ifname or connection UUID"
msgstr ""
"'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© மாஸà¯à®Ÿà¯à®Ÿà®°à®²à¯à®²; ifname அலà¯à®²à®¤à¯ இணைபà¯à®ªà¯ UUID à®à®ªà¯ "
"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/cli/settings.c:2507
+#: ../clients/cli/settings.c:2580
#, c-format
msgid "Warning: %s is not an UUID of any existing connection profile\n"
msgstr "எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: %s எனà¯à®ªà®¤à¯ தறà¯à®ªà¯‹à®¤à¯à®³à¯à®³ எநà¯à®¤à®¤à¯ தனியமைபà¯à®ªà®¿à®©à¯ UUID யà¯à®®à®²à¯à®²\n"
-#: ../clients/cli/settings.c:2511 ../clients/cli/settings.c:2527
+#: ../clients/cli/settings.c:2584 ../clients/cli/settings.c:2600
#, c-format
msgid "'%s' is not a VPN connection profile"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© VPN இணைபà¯à®ªà¯ தனியமைபà¯à®ªà®²à¯à®²."
-#: ../clients/cli/settings.c:2520
+#: ../clients/cli/settings.c:2593
#, c-format
msgid "'%s' is not a name of any exiting profile"
msgstr "'%s' எனà¯à®ªà®¤à¯ தறà¯à®ªà¯‹à®¤à¯à®³à¯à®³ தனியமைபà¯à®ªà®¿à®©à¯ பெயரலà¯à®²"
-#: ../clients/cli/settings.c:2554
+#: ../clients/cli/settings.c:2627
#, c-format
msgid "the value '%s' is not a valid UUID"
msgstr "'%s' எனà¯à®± மதிபà¯à®ªà¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à¯à®®à¯ UUID அலà¯à®²"
-#: ../clients/cli/settings.c:2561
+#: ../clients/cli/settings.c:2634
#, c-format
msgid "the property doesn't contain UUID '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ UUID '%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2573
+#: ../clients/cli/settings.c:2646
msgid ""
"Enter secondary connections that should be activated when this connection "
"is\n"
@@ -4732,26 +5304,26 @@ msgstr ""
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"
-#: ../clients/cli/settings.c:2650
+#: ../clients/cli/settings.c:2723
msgid "private key password not provided"
msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசை கடவà¯à®šà¯à®šà¯Šà®²à¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2677
+#: ../clients/cli/settings.c:2750
#, c-format
msgid "the property doesn't contain EAP method '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ EAP à®®à¯à®±à¯ˆ '%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2702
+#: ../clients/cli/settings.c:2775
#, c-format
msgid "the property doesn't contain alternative subject match '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ மாறà¯à®±à¯à®¤à¯ தலைபà¯à®ªà¯à®ªà¯ பொரà¯à®¤à¯à®¤à®®à¯ '%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2731
+#: ../clients/cli/settings.c:2804
#, c-format
msgid "the property doesn't contain \"phase2\" alternative subject match '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ \"phase2\" மாறà¯à®±à¯à®¤à¯ தலைபà¯à®ªà¯à®ªà¯ பொரà¯à®¤à¯à®¤à®®à¯ '%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:2757
+#: ../clients/cli/settings.c:2830
msgid ""
"Enter path to a private key and the key password (if not set yet):\n"
" <file path> [<password>]\n"
@@ -4762,7 +5334,7 @@ msgstr ""
" <file path> [<password>]\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: /home/cimrman/jara-priv-key Dardanely\n"
-#: ../clients/cli/settings.c:2827
+#: ../clients/cli/settings.c:2900
msgid ""
"Enter bytes as a list of hexadecimal values.\n"
"Two formats are accepted:\n"
@@ -4787,7 +5359,7 @@ msgstr ""
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯à®•à®³à¯: ab0455a6ea3a74C2\n"
" ab 4 55 0xa6 ea 3a 74 C2\n"
-#: ../clients/cli/settings.c:2930
+#: ../clients/cli/settings.c:3003
#, c-format
msgid ""
"Enter a list of bonding options formatted as:\n"
@@ -4818,22 +5390,33 @@ msgstr ""
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: mode=2,miimon=120\n"
-#: ../clients/cli/settings.c:2968
+#: ../clients/cli/settings.c:3041
#, c-format
msgid "'%s' is not a valid InfiniBand MAC"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© InfiniBand MAC அலà¯à®²"
-#: ../clients/cli/settings.c:3005
+#: ../clients/cli/settings.c:3078
#, c-format
msgid "'%s' is not a valid IBoIP P_Key"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© IBoIP P_Key அலà¯à®²"
-#: ../clients/cli/settings.c:3074 ../clients/cli/settings.c:3420
+#: ../clients/cli/settings.c:3109
+#, c-format
+msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
+msgstr ""
+"'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®² (வடிவமைபà¯à®ªà¯: ip[/prefix] [next-hop] [metric])"
+
+#: ../clients/cli/settings.c:3157 ../clients/cli/settings.c:3176
+#, c-format
+msgid "invalid IPv4 address '%s'"
+msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ IPv4 à®®à¯à®•à®µà®°à®¿ '%s'"
+
+#: ../clients/cli/settings.c:3182 ../clients/cli/settings.c:3483
#, c-format
msgid "the property doesn't contain DNS server '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ DNS சேவையகம௠'%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:3086
+#: ../clients/cli/settings.c:3194
msgid ""
"Enter a list of IPv4 addresses of DNS servers.\n"
"\n"
@@ -4843,71 +5426,87 @@ msgstr ""
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: 8.8.8.8, 8.8.4.4\n"
-#: ../clients/cli/settings.c:3122 ../clients/cli/settings.c:3474
+#: ../clients/cli/settings.c:3230 ../clients/cli/settings.c:3537
#, c-format
msgid "the property doesn't contain DNS search domain '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ DNS தேடல௠டொமைன௠'%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:3142 ../clients/cli/settings.c:3494
-#, c-format
-msgid "'%s' is not valid (use ip[/prefix] [gateway])"
-msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®² (ip[/prefix] [gateway] à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯)"
-
-#: ../clients/cli/settings.c:3191 ../clients/cli/settings.c:3542
+#: ../clients/cli/settings.c:3284 ../clients/cli/settings.c:3590
#, c-format
msgid "the property doesn't contain IP address '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ IP à®®à¯à®•à®µà®°à®¿ '%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:3204
+#: ../clients/cli/settings.c:3297
+#| msgid ""
+#| "Enter a list of IPv4 addresses formatted as:\n"
+#| " ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+#| "Missing prefix is regarded as prefix of 32.\n"
+#| "\n"
+#| "Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
msgid ""
"Enter a list of IPv4 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 32.\n"
"\n"
-"Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+"Example: 192.168.1.5/24, 10.0.0.11/24\n"
msgstr ""
-"பினà¯à®µà®°à¯à®®à¯ வடிவதà¯à®¤à®¿à®²à¯ அமைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ IPv4 à®®à¯à®•à®µà®°à®¿à®•à®³à®¿à®©à¯ ஒர௠படà¯à®Ÿà®¿à®¯à®²à¯ˆ உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+"பினà¯à®µà®°à¯à®®à¯ வடிவதà¯à®¤à®¿à®²à¯ IPv4 à®®à¯à®•à®µà®°à®¿à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯ˆ உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯:\n"
+" ip[/prefix], ip[/prefix],...\n"
"à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ 32 எனà¯à®ªà®¤à¯ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà®¾à®•à®•à¯ கரà¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
"\n"
-"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: 192.168.1.5/24, 10.0.0.11/24\n"
-#: ../clients/cli/settings.c:3257 ../clients/cli/settings.c:3573
+#: ../clients/cli/settings.c:3313 ../clients/cli/settings.c:3619
#, c-format
-msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
-msgstr ""
-"'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®² (வடிவமைபà¯à®ªà¯: ip[/prefix] [next-hop] [metric])"
+#| msgid "invalid gateway '%s'"
+msgid "invalid gateway address '%s'"
+msgstr "தவறான நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯: '%s'"
-#: ../clients/cli/settings.c:3305 ../clients/cli/settings.c:3621
+#: ../clients/cli/settings.c:3368 ../clients/cli/settings.c:3674
#, c-format
msgid "the property doesn't contain route '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ தடம௠'%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:3318
+#: ../clients/cli/settings.c:3381
+#| msgid ""
+#| "Enter a list of IPv4 routes formatted as:\n"
+#| " ip[/prefix] [next-hop] [metric],...\n"
+#| "\n"
+#| "Missing prefix is regarded as a prefix of 32.\n"
+#| "Missing next-hop is regarded as 0.0.0.0.\n"
+#| "Missing metric or 0 means a default metric (NM/kernel will set a default "
+#| "value).\n"
+#| "\n"
+#| "Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
+#| " 10.1.2.0/24\n"
msgid ""
"Enter a list of IPv4 routes formatted as:\n"
" ip[/prefix] [next-hop] [metric],...\n"
"\n"
"Missing prefix is regarded as a prefix of 32.\n"
"Missing next-hop is regarded as 0.0.0.0.\n"
-"Missing metric or 0 means a default metric (NM/kernel will set a default "
-"value).\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
"Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
" 10.1.2.0/24\n"
msgstr ""
"பினà¯à®µà®°à¯à®®à¯ வடிவதà¯à®¤à®¿à®²à®®à¯ˆà®¨à¯à®¤ IPv4 தடஙà¯à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯ˆ உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯:\n"
-" ip[/prefix] [next-hop] [metric],...\n"
+" ip[/prefix] [next-hop] [metric],...\n"
"à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ 32 எனà¯à®ªà®¤à¯ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà®¾à®•à®•à¯ கரà¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
"அடà¯à®¤à¯à®¤ ஹாப௠இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ 0.0.0.0. பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯\n"
-"மெடà¯à®°à®¿à®•à¯ அலà¯à®²à®¤à¯ 0 இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ மெடà¯à®°à®¿à®•à¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯ "
+"மெடà¯à®°à®¿à®•à¯ இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ மெடà¯à®°à®¿à®•à¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯ "
"(NM/கெரà¯à®©à®²à¯ ஒர௠"
"à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ மதிபà¯à®ªà¯ˆ அமைகà¯à®•à¯à®®à¯).\n"
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯à®•à®³à¯: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
" 10.1.2.0/24\n"
-#: ../clients/cli/settings.c:3432
+#: ../clients/cli/settings.c:3458 ../clients/cli/settings.c:3477
+#, c-format
+msgid "invalid IPv6 address '%s'"
+msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ IPv6 à®®à¯à®•à®µà®°à®¿ '%s'"
+
+#: ../clients/cli/settings.c:3495
msgid ""
"Enter a list of IPv6 addresses of DNS servers. If the IPv6 configuration "
"method is 'auto' these DNS servers are appended to those (if any) returned "
@@ -4931,31 +5530,47 @@ msgstr ""
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
-#: ../clients/cli/settings.c:3555
+#: ../clients/cli/settings.c:3603
+#| msgid ""
+#| "Enter a list of IPv6 addresses formatted as:\n"
+#| " ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+#| "Missing prefix is regarded as prefix of 128.\n"
+#| "\n"
+#| "Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
+#| "1050:0:0:0:5:600:300c:326b\n"
msgid ""
"Enter a list of IPv6 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 128.\n"
"\n"
-"Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
-"1050:0:0:0:5:600:300c:326b\n"
+"Example: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"
msgstr ""
-"பினà¯à®µà®°à¯à®®à¯ வடிவதà¯à®¤à®¿à®²à¯ அமைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ IPv6 à®®à¯à®•à®µà®°à®¿à®•à®³à®¿à®©à¯ ஒர௠படà¯à®Ÿà®¿à®¯à®²à¯ˆ உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+"பினà¯à®µà®°à¯à®®à¯ வடிவதà¯à®¤à®¿à®²à¯ IPv6 à®®à¯à®•à®µà®°à®¿à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯ˆ உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯:\n"
+" ip[/prefix], ip[/prefix],...\n"
"à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ 128 எனà¯à®ªà®¤à¯ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà®¾à®•à®•à¯ கரà¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
"\n"
-"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
-"1050:0:0:0:5:600:300c:326b\n"
-
-#: ../clients/cli/settings.c:3634
+"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"
+
+#: ../clients/cli/settings.c:3687
+#| msgid ""
+#| "Enter a list of IPv6 routes formatted as:\n"
+#| " ip[/prefix] [next-hop] [metric],...\n"
+#| "\n"
+#| "Missing prefix is regarded as a prefix of 128.\n"
+#| "Missing next-hop is regarded as \"::\".\n"
+#| "Missing metric or 0 means a default metric (NM/kernel will set a default "
+#| "value).\n"
+#| "\n"
+#| "Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 "
+#| "2001:db8:beef::3 2\n"
+#| " abbe::/64 55\n"
msgid ""
"Enter a list of IPv6 routes formatted as:\n"
" ip[/prefix] [next-hop] [metric],...\n"
"\n"
"Missing prefix is regarded as a prefix of 128.\n"
"Missing next-hop is regarded as \"::\".\n"
-"Missing metric or 0 means a default metric (NM/kernel will set a default "
-"value).\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
"Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
"db8:beef::3 2\n"
@@ -4965,32 +5580,38 @@ msgstr ""
" ip[/prefix] [next-hop] [metric],...\n"
"à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ 128 எனà¯à®ªà®¤à¯ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà®¾à®•à®•à¯ கரà¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
"அடà¯à®¤à¯à®¤ ஹாப௠இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ \"::\" பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯\n"
-"மெடà¯à®°à®¿à®•à¯ அலà¯à®²à®¤à¯ 0 இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ மெடà¯à®°à®¿à®•à¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯ "
+"மெடà¯à®°à®¿à®•à¯ இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ மெடà¯à®°à®¿à®•à¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯ "
"(NM/கெரà¯à®©à®²à¯ ஒர௠"
"à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ மதிபà¯à®ªà¯ˆ அமைகà¯à®•à¯à®®à¯).\n"
-"மெடà¯à®°à®¿à®•à¯ இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯ 0 எனà¯à®ªà®¤à¯ மெடà¯à®°à®¿à®•à¯à®•à®¾à®•à®•à¯ கரà¯à®¤à®ªà¯à®ªà®Ÿà¯à®®à¯.\n"
"\n"
-"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯à®•à®³à¯: 2001:db8:beef:2::/64 2001:db8:beef::2, "
-"2001:db8:beef:3::/64 "
-"2001:db8:beef::3 2\n"
+"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯à®•à®³à¯: 2001:db8:beef:2::/64 "
+"2001:db8:beef::2,2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 "
+"2001:"
+"db8:beef::3 2\n"
" abbe::/64 55\n"
-#: ../clients/cli/settings.c:3658
+#: ../clients/cli/settings.c:3704 ../libnm-core/nm-setting-gsm.c:317
+#: ../libnm-util/nm-setting-gsm.c:374
+#, c-format
+msgid "'%s' is not a number"
+msgstr "'%s' எனà¯à®ªà®¤à¯ ஒர௠எணà¯à®£à®²à¯à®²"
+
+#: ../clients/cli/settings.c:3711
#, c-format
msgid "'%s' is not valid; use 0, 1, or 2"
msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; 0, 1 அலà¯à®²à®¤à¯ 2 à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/cli/settings.c:3675
+#: ../clients/cli/settings.c:3728
#, c-format
msgid "'%s' is not a valid channel; use <1-13>"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© சேனல௠அலà¯à®² <1-13>"
-#: ../clients/cli/settings.c:3696
+#: ../clients/cli/settings.c:3765
#, c-format
msgid "'%s' is not valid; use [e, o, n]"
msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; [e, o, n] à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/cli/settings.c:3724
+#: ../clients/cli/settings.c:3793
msgid ""
"nmcli can accepts both direct JSON configuration data and a file name "
"containing the configuration. In the latter case the file is read and the "
@@ -5011,16 +5632,16 @@ msgstr ""
"\": \"roundrobin\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }\n"
" set team.config /etc/my-team.conf\n"
-#: ../clients/cli/settings.c:3764
+#: ../clients/cli/settings.c:3833
msgid "no priority to remove"
msgstr "நீகà¯à®•à¯à®µà®¤à®±à¯à®•à¯ à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ எதà¯à®µà¯à®®à¯ இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:3768
+#: ../clients/cli/settings.c:3837
#, c-format
msgid "index '%d' is not in the range of <0-%d>"
msgstr "அடà¯à®Ÿà®µà®£à¯ˆ '%d' ஆனத௠வரமà¯à®ªà¯ <0-%d> கà¯à®•à¯à®³à¯ இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:3807
+#: ../clients/cli/settings.c:3876
#, c-format
msgid ""
"Warning: only one mapping at a time is supported; taking the first one (%s)\n"
@@ -5029,44 +5650,49 @@ msgstr ""
"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¿à®¯à®¤à¯ "
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à¯Šà®³à¯à®³à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯ (%s)\n"
-#: ../clients/cli/settings.c:3814
+#: ../clients/cli/settings.c:3883
#, c-format
msgid "the property doesn't contain mapping '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ மேபà¯à®ªà®¿à®™à¯ '%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:3923 ../clients/cli/settings.c:4091
-#: ../libnm-core/nm-setting-wired.c:622
-#: ../libnm-core/nm-setting-wireless.c:799
-#: ../libnm-core/nm-setting-wireless.c:811
-#: ../libnm-util/nm-setting-wired.c:648
-#: ../libnm-util/nm-setting-wireless.c:840
-#: ../libnm-util/nm-setting-wireless.c:854
+#: ../clients/cli/settings.c:3992 ../clients/cli/settings.c:4155
+#: ../libnm-core/nm-setting-wired.c:607
+#: ../libnm-core/nm-setting-wireless.c:785
+#: ../libnm-core/nm-setting-wireless.c:797
+#: ../libnm-util/nm-setting-wired.c:650
+#: ../libnm-util/nm-setting-wireless.c:842
+#: ../libnm-util/nm-setting-wireless.c:856
#, c-format
msgid "'%s' is not a valid MAC address"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© MAC à®®à¯à®•à®µà®°à®¿à®¯à®²à¯à®²"
-#: ../clients/cli/settings.c:3929 ../clients/cli/settings.c:4097
+#: ../clients/cli/settings.c:3998 ../clients/cli/settings.c:4161
#, c-format
msgid "the property doesn't contain MAC address '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ MAC à®®à¯à®•à®µà®°à®¿ '%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:3948
+#: ../clients/cli/settings.c:4017
#, c-format
-msgid "'%s' is not valid; 3 strings should be provided"
-msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; 3 சரஙà¯à®•à®³à¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿ வேணà¯à®Ÿà¯à®®à¯"
+#| msgid "'%s' is not valid; 3 strings should be provided"
+msgid "'%s' is not valid; 2 or 3 strings should be provided"
+msgstr "'%s' எனà¯à®ªà®¤à¯ தவறானதà¯; 2 அலà¯à®²à®¤à¯ 3 சரஙà¯à®•à®³à¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿ வேணà¯à®Ÿà¯à®®à¯"
-#: ../clients/cli/settings.c:3967
+#: ../clients/cli/settings.c:4031
+#| msgid ""
+#| "Enter a list of three channels (comma or space separated).\n"
+#| "\n"
+#| "Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
msgid ""
-"Enter a list of three channels (comma or space separated).\n"
+"Enter a list of subchannels (comma or space separated).\n"
"\n"
"Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
msgstr ""
-"சேனலà¯à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯ˆ உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯ (காறà¯à®ªà¯à®³à¯à®³à®¿ அலà¯à®²à®¤à¯ இடைவெளியால௠"
+"உபசேனலà¯à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯ˆ உளà¯à®³à®¿à®Ÿà®µà¯à®®à¯ (காறà¯à®ªà¯à®³à¯à®³à®¿ அலà¯à®²à®¤à¯ இடைவெளியால௠"
"பிரிகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®ªà®Ÿà®¿).\n"
"\n"
"எடà¯à®¤à¯à®¤à¯à®•à¯à®•à®¾à®Ÿà¯à®Ÿà¯: 0.0.0e20 0.0.0e21 0.0.0e22\n"
-#: ../clients/cli/settings.c:4017
+#: ../clients/cli/settings.c:4081
#, c-format
msgid ""
"Enter a list of S/390 options formatted as:\n"
@@ -5077,23 +5703,23 @@ msgstr ""
" option = <value>, option = <value>,... \n"
"செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© விரà¯à®ªà¯à®ªà®™à¯à®•à®³à¯: %s\n"
-#: ../clients/cli/settings.c:4063
+#: ../clients/cli/settings.c:4127
#, c-format
msgid "'%s' is not a valid channel"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© சேனல௠அலà¯à®²"
-#: ../clients/cli/settings.c:4069
+#: ../clients/cli/settings.c:4133
#, c-format
msgid "'%ld' is not a valid channel"
msgstr "'%ld' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© சேனல௠அலà¯à®²"
-#: ../clients/cli/settings.c:4156 ../clients/cli/settings.c:4194
-#: ../clients/cli/settings.c:4232
+#: ../clients/cli/settings.c:4220 ../clients/cli/settings.c:4258
+#: ../clients/cli/settings.c:4296
#, c-format
msgid "the property doesn't contain protocol '%s'"
msgstr "பணà¯à®ªà®¿à®²à¯ நெறிமà¯à®±à¯ˆ '%s' இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:4271
+#: ../clients/cli/settings.c:4335
#, c-format
msgid ""
"'%s' not compatible with %s '%s', please change the key or set the right %s "
@@ -5103,23 +5729,23 @@ msgstr ""
"s à® "
"அமைகà¯à®•à®µà¯à®®à¯."
-#: ../clients/cli/settings.c:4279
+#: ../clients/cli/settings.c:4343
#, c-format
msgid "WEP key is guessed to be of '%s'\n"
msgstr "WEP விசை '%s' இன௠விசையாக இரà¯à®•à¯à®•à¯à®®à¯ என ஊகிகà¯à®•à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯\n"
-#: ../clients/cli/settings.c:4281
+#: ../clients/cli/settings.c:4345
#, c-format
msgid "WEP key index set to '%d'\n"
msgstr "WEP கà¯à®±à®¿à®¯à¯€à®Ÿà¯ '%d' கà¯à®•à¯ அமைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯\n"
-#: ../clients/cli/settings.c:4304
+#: ../clients/cli/settings.c:4368
#, c-format
msgid "'%s' not among [0 (unknown), 1 (key), 2 (passphrase)]"
msgstr "'%s' ஆனத௠[0 (unknown), 1 (key), 2 (passphrase)] கà¯à®•à¯à®³à¯ இலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:4320 ../clients/cli/settings.c:4323
-#: ../clients/cli/settings.c:4326 ../clients/cli/settings.c:4329
+#: ../clients/cli/settings.c:4384 ../clients/cli/settings.c:4387
+#: ../clients/cli/settings.c:4390 ../clients/cli/settings.c:4393
#, c-format
msgid ""
"Warning: '%s' is not compatible with '%s' type, please change or delete the "
@@ -5128,7 +5754,7 @@ msgstr ""
"எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: '%s' ஆனத௠'%s' வகையà¯à®Ÿà®©à¯ இணகà¯à®•à®®à®¾à®©à®¤à®²à¯à®², விசையை மாறà¯à®±à®µà¯à®®à¯ அலà¯à®²à®¤à¯ "
"நீகà¯à®•à®µà¯à®®à¯.\n"
-#: ../clients/cli/settings.c:4342
+#: ../clients/cli/settings.c:4406
#, c-format
msgid ""
"Enter the type of WEP keys. The accepted values are: 0 or unknown, 1 or key, "
@@ -5138,36 +5764,36 @@ msgstr ""
"அலà¯à®²à®¤à¯ "
"விசை, மறà¯à®±à¯à®®à¯ 2 அலà¯à®²à®¤à¯ கடவà¯à®µà®¾à®•à¯à®•à®¿à®¯à®®à¯.\n"
-#: ../clients/cli/settings.c:4355
+#: ../clients/cli/settings.c:4419
#, c-format
msgid "'%s' is not a valid PSK"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© PSK அலà¯à®²"
-#: ../clients/cli/settings.c:4399
+#: ../clients/cli/settings.c:4463
#, c-format
msgid "'%s' is not a valid DCB flag"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© DCB கொடி அலà¯à®²"
-#: ../clients/cli/settings.c:4422
+#: ../clients/cli/settings.c:4486
#, c-format
msgid "'%s' is not a DCB app priority"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© DCB பயனà¯à®ªà®¾à®Ÿà¯ à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ அலà¯à®²"
-#: ../clients/cli/settings.c:4448
+#: ../clients/cli/settings.c:4512
msgid "must contain 8 comma-separated numbers"
msgstr "காறà¯à®ªà¯à®³à¯à®³à®¿à®•à®³à®¾à®²à¯ பிரிகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ 8 எணà¯à®•à®³à¯ˆà®•à¯ கொணà¯à®Ÿà®¿à®°à¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯"
-#: ../clients/cli/settings.c:4465
+#: ../clients/cli/settings.c:4529
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive) or %u"
msgstr "'%s' எனà¯à®ªà®¤à¯ 0 மறà¯à®±à¯à®®à¯ %u (உடà¯à®ªà®Ÿ) அலà¯à®²à®¤à¯ %u கà¯à®•à¯ இடையிலான எணà¯à®£à®²à¯à®²"
-#: ../clients/cli/settings.c:4468
+#: ../clients/cli/settings.c:4532
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive)"
msgstr "'%s' எனà¯à®ªà®¤à¯ 0 மறà¯à®±à¯à®®à¯ %u கà¯à®•à¯ (உடà¯à®ªà®Ÿ) இடையிலான எணà¯à®£à®²à¯à®²"
-#: ../clients/cli/settings.c:4490
+#: ../clients/cli/settings.c:4554
#, c-format
msgid ""
"Warning: changes will have no effect until '%s' includes 1 (enabled)\n"
@@ -5177,31 +5803,36 @@ msgstr ""
"செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà®¾à®¤à¯\n"
"\n"
-#: ../clients/cli/settings.c:4543
+#: ../clients/cli/settings.c:4607
#, c-format
msgid "bandwidth percentages must total 100%%"
msgstr "கறà¯à®±à¯ˆà®¯à®•à®²à®®à¯ சதவீதஙà¯à®•à®³à®¿à®©à¯ கூடà¯à®¤à®²à¯ 100%% ஆக இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯"
-#: ../clients/cli/settings.c:6186
+#: ../clients/cli/settings.c:6301
msgid "don't know how to get the property value"
msgstr "பணà¯à®ªà®¿à®©à¯ மதிபà¯à®ªà¯ˆ எபà¯à®ªà®Ÿà®¿à®ªà¯ பெறà¯à®µà®¤à¯ எனத௠தெரியவிலà¯à®²à¯ˆ"
-#: ../clients/cli/settings.c:6239 ../clients/cli/settings.c:6279
+#: ../clients/cli/settings.c:6354 ../clients/cli/settings.c:6394
msgid "the property can't be changed"
msgstr "பணà¯à®ªà¯ˆ மாறà¯à®± à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯"
-#: ../clients/cli/settings.c:6362
+#: ../clients/cli/settings.c:6477
msgid "(not available)"
msgstr "(கிடைகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ)"
-#: ../clients/cli/settings.c:6387
+#: ../clients/cli/settings.c:6502
msgid "[NM property description]"
msgstr "[NM பணà¯à®ªà®¿à®©à¯ விளகà¯à®•à®®à¯]"
-#: ../clients/cli/settings.c:6392
+#: ../clients/cli/settings.c:6507
msgid "[nmcli specific description]"
msgstr "[nmcli சாரà¯à®¨à¯à®¤ விளகà¯à®•à®®à¯]"
+#. ----------------------------------------------------------------------------
+#: ../clients/cli/settings.c:6556
+msgid "<hidden>"
+msgstr "<hidden>"
+
#: ../clients/cli/utils.c:127
#, c-format
msgid "Error: value for '%s' argument is required."
@@ -5227,48 +5858,48 @@ msgstr "IP4 à®®à¯à®•à®µà®°à®¿ '0x%X' ஠உரை வடிவதà¯à®¤à®¿à®±à
msgid "Error converting IP6 address '%s' to text form"
msgstr "IP6 à®®à¯à®•à®µà®°à®¿ '%s' ஠உரை வடிவதà¯à®¤à®¿à®±à¯à®•à¯ மாறà¯à®±à¯à®µà®¤à®¿à®²à¯ பிழை"
-#: ../clients/cli/utils.c:407
+#: ../clients/cli/utils.c:410
#, c-format
msgid "'%s' is ambiguous (on x off)"
msgstr "'%s' தெளிவாக இலà¯à®²à¯ˆ (ஆன௠x ஆஃபà¯)"
-#: ../clients/cli/utils.c:417
+#: ../clients/cli/utils.c:420
#, c-format
msgid "'%s' is not valid; use [%s] or [%s]"
msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²; [%s] அலà¯à®²à®¤à¯ [%s] à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/cli/utils.c:499
+#: ../clients/cli/utils.c:502
#, c-format
msgid "'%s' is ambiguous (%s x %s)"
msgstr "'%s' தெளிவாக இலà¯à®²à¯ˆ (%s x %s)"
-#: ../clients/cli/utils.c:511
+#: ../clients/cli/utils.c:514
#, c-format
msgid "missing name, try one of [%s]"
msgstr "பெயர௠விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯, [%s] இல௠ஒனà¯à®±à¯ˆ à®®à¯à®¯à®±à¯à®šà®¿à®•à¯à®•à®µà¯à®®à¯"
-#: ../clients/cli/utils.c:728
+#: ../clients/cli/utils.c:753
#, c-format
msgid "field '%s' has to be alone"
msgstr "பà¯à®²à®®à¯ '%s' தனியாக இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯"
-#: ../clients/cli/utils.c:731
+#: ../clients/cli/utils.c:756
#, c-format
msgid "invalid field '%s'; allowed fields: %s"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ பà¯à®²à®®à¯ '%s'; அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ பà¯à®²à®™à¯à®•à®³à¯: %s"
-#: ../clients/cli/utils.c:788
+#: ../clients/cli/utils.c:813
msgid "Option '--terse' requires specifying '--fields'"
msgstr "விரà¯à®ªà¯à®ªà®®à¯ '--terse' '--fields'஠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-#: ../clients/cli/utils.c:792
+#: ../clients/cli/utils.c:817
#, c-format
msgid "Option '--terse' requires specific '--fields' option values , not '%s'"
msgstr ""
"விரà¯à®ªà¯à®ªà®®à¯ '--terse'கà¯à®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®Ÿ '--fields' விரà¯à®ªà¯à®ª மதிபà¯à®ªà¯à®•à®³à¯ தேவை, '%s' "
"அலà¯à®²"
-#: ../clients/cli/utils.c:1111
+#: ../clients/cli/utils.c:1135
#, c-format
msgid ""
"Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --"
@@ -5278,7 +5909,7 @@ msgstr ""
"பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ. "
"எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆà®¯à¯ˆà®¤à¯ தவிரà¯à®•à¯à®• --nocheck கடà¯à®Ÿà®³à¯ˆà®¯à¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯.\n"
-#: ../clients/cli/utils.c:1120
+#: ../clients/cli/utils.c:1144
#, c-format
msgid ""
"Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force "
@@ -5289,6 +5920,100 @@ msgstr ""
"இரà¯à®•à¯à®•à¯à®®à¯ என "
"கணிகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯."
+#: ../clients/common/nm-polkit-listener.c:215
+msgid "An authentication session is already underway."
+msgstr "à®à®±à¯à®•à®©à®µà¯‡ ஒர௠அஙà¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ அமரà¯à®µà¯ நடைபெறà¯à®±à¯à®•à¯à®•à¯Šà®£à¯à®Ÿà¯à®³à¯à®³à®¤à¯."
+
+#. TTLS and PEAP are actually much more complicated, but this complication
+#. * is not visible here since we only care about phase2 authentication
+#. * (and don't even care of which one)
+#.
+#: ../clients/common/nm-secret-agent-simple.c:209
+#: ../clients/common/nm-secret-agent-simple.c:300
+#: ../clients/tui/nmt-page-dsl.c:69 ../clients/tui/nmt-page-wifi.c:335
+msgid "Username"
+msgstr "பயனரà¯à®ªà¯†à®¯à®°à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:214
+#: ../clients/common/nm-secret-agent-simple.c:251
+#: ../clients/common/nm-secret-agent-simple.c:277
+#: ../clients/common/nm-secret-agent-simple.c:310
+#: ../clients/common/nm-secret-agent-simple.c:379
+#: ../clients/common/nm-secret-agent-simple.c:392
+#: ../clients/common/nm-secret-agent-simple.c:408
+#: ../clients/tui/nmt-page-dsl.c:78 ../clients/tui/nmt-page-wifi.c:280
+#: ../clients/tui/nmt-page-wifi.c:311 ../clients/tui/nmt-page-wifi.c:344
+msgid "Password"
+msgstr "கடவà¯à®šà¯à®šà¯Šà®²à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:223
+msgid "Identity"
+msgstr "அடையாளமà¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:228
+msgid "Private key password"
+msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசை கடவà¯à®šà¯à®šà¯Šà®²à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:265
+#: ../clients/tui/nmt-page-wifi.c:292
+msgid "Key"
+msgstr "விசை"
+
+#: ../clients/common/nm-secret-agent-simple.c:305
+#: ../clients/tui/nmt-page-dsl.c:81
+msgid "Service"
+msgstr "சேவை"
+
+#: ../clients/common/nm-secret-agent-simple.c:339
+msgid "Authentication required by wireless network"
+msgstr "வயரà¯à®²à¯†à®¸à¯ பிணையதà¯à®¤à®¿à®±à¯à®•à¯ à®…à®™à¯à®•à¯€à®•à®¾à®°à®®à¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:340
+#, c-format
+msgid ""
+"Passwords or encryption keys are required to access the wireless network "
+"'%s'."
+msgstr ""
+"வயரà¯à®²à¯†à®¸à¯ பிணையம௠'%s' ஠அணà¯à®• கடவà¯à®šà¯à®šà¯Šà®±à¯à®•à®³à¯ அலà¯à®²à®¤à¯ மறைகà¯à®±à®¿à®¯à®¾à®•à®•à¯ விசைகள௠"
+"தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:348
+msgid "Wired 802.1X authentication"
+msgstr "ஒயரà¯à®Ÿà¯ 802.1X à®…à®™à¯à®•à¯€à®•à®¾à®°à®®à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:351
+msgid "Network name"
+msgstr "பிணைய பெயரà¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:358
+msgid "DSL authentication"
+msgstr "DSL à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:366
+msgid "PIN code required"
+msgstr "PIN கà¯à®±à®¿à®¯à¯€à®Ÿà¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:367
+msgid "PIN code is needed for the mobile broadband device"
+msgstr "PIN கà¯à®±à®¿à®¯à¯€à®Ÿà¯ மொபைல௠பிராடà¯à®ªà¯‡à®£à¯à®Ÿà¯ சாதனதà¯à®¤à®¿à®±à¯à®•à¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:369
+msgid "PIN"
+msgstr "PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:375
+#: ../clients/common/nm-secret-agent-simple.c:388
+#: ../clients/common/nm-secret-agent-simple.c:404
+msgid "Mobile broadband network password"
+msgstr "மொபைல௠பிராடà¯à®ªà¯‡à®£à¯à®Ÿà¯ பிணையதà¯à®¤à®¿à®©à¯ கடவà¯à®šà¯à®šà¯Šà®²à¯"
+
+#: ../clients/common/nm-secret-agent-simple.c:376
+#: ../clients/common/nm-secret-agent-simple.c:389
+#: ../clients/common/nm-secret-agent-simple.c:405
+#, c-format
+msgid "A password is required to connect to '%s'."
+msgstr "'%s'஠இணைபà¯à®ªà®¤à®±à¯à®•à¯ ஒர௠கடவà¯à®šà¯à®šà¯Šà®²à¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯."
+
#: ../clients/nm-online.c:96
#, c-format
msgid "\rConnecting"
@@ -5329,10 +6054,10 @@ msgstr ""
"தவறான விரà¯à®ªà¯à®ªà®®à¯. சரியான விரà¯à®ªà¯à®ªà®™à¯à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯ˆà®ªà¯ பாரà¯à®•à¯à®• --help à®à®ªà¯ "
"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯."
-#: ../clients/tui/newt/nmt-newt-utils.c:180 ../clients/tui/nmt-editor.c:245
+#: ../clients/tui/newt/nmt-newt-utils.c:180 ../clients/tui/nmt-editor.c:417
#: ../clients/tui/nmt-password-dialog.c:174
-#: ../clients/tui/nmt-route-editor.c:135 ../clients/tui/nmtui-hostname.c:71
-#: ../clients/tui/nmtui.c:118
+#: ../clients/tui/nmt-route-editor.c:125 ../clients/tui/nmtui-hostname.c:71
+#: ../clients/tui/nmtui.c:117
msgid "OK"
msgstr "சரி"
@@ -5377,7 +6102,8 @@ msgstr "Wi-Fi இணைபà¯à®ªà¯ %d"
msgid "InfiniBand connection %d"
msgstr "InfiniBand இணைபà¯à®ªà¯ %d"
-#: ../clients/tui/nm-editor-utils.c:173 ../libnm-glib/nm-device.c:1798
+#: ../clients/tui/nm-editor-utils.c:173 ../libnm-glib/nm-device.c:1800
+#: ../libnm/nm-device.c:1621
msgid "Mobile Broadband"
msgstr "மொபல௠பà¯à®°à®¾à®Ÿà¯à®ªà¯‡à®£à¯à®Ÿà¯"
@@ -5386,7 +6112,7 @@ msgstr "மொபல௠பà¯à®°à®¾à®Ÿà¯à®ªà¯‡à®£à¯à®Ÿà¯"
msgid "Mobile broadband connection %d"
msgstr "மொபைல௠பிராடà¯à®ªà¯‡à®£à¯à®Ÿà¯ இணைபà¯à®ªà¯ %d"
-#: ../clients/tui/nm-editor-utils.c:182 ../clients/tui/nmt-page-dsl.c:39
+#: ../clients/tui/nm-editor-utils.c:182 ../clients/tui/nmt-page-dsl.c:65
msgid "DSL"
msgstr "DSL"
@@ -5395,9 +6121,9 @@ msgstr "DSL"
msgid "DSL connection %d"
msgstr "DSL இணைபà¯à®ªà¯ %d"
-#: ../clients/tui/nm-editor-utils.c:191 ../libnm-core/nm-connection.c:1501
-#: ../libnm-glib/nm-device.c:1802 ../libnm-util/nm-connection.c:1606
-#: ../src/settings/plugins/ifcfg-rh/reader.c:3931
+#: ../clients/tui/nm-editor-utils.c:191 ../libnm-core/nm-connection.c:1543
+#: ../libnm-glib/nm-device.c:1804 ../libnm-util/nm-connection.c:1608
+#: ../libnm/nm-device.c:1625 ../src/settings/plugins/ifcfg-rh/reader.c:3910
msgid "Bond"
msgstr "பிணைபà¯à®ªà¯"
@@ -5406,9 +6132,9 @@ msgstr "பிணைபà¯à®ªà¯"
msgid "Bond connection %d"
msgstr "பிணைபà¯à®ªà¯ இணைபà¯à®ªà¯ %d"
-#: ../clients/tui/nm-editor-utils.c:200 ../libnm-core/nm-connection.c:1505
-#: ../libnm-glib/nm-device.c:1806 ../libnm-util/nm-connection.c:1610
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4219
+#: ../clients/tui/nm-editor-utils.c:200 ../libnm-core/nm-connection.c:1547
+#: ../libnm-glib/nm-device.c:1808 ../libnm-util/nm-connection.c:1612
+#: ../libnm/nm-device.c:1629 ../src/settings/plugins/ifcfg-rh/reader.c:4201
msgid "Bridge"
msgstr "பிரிடà¯à®œà¯"
@@ -5417,9 +6143,9 @@ msgstr "பிரிடà¯à®œà¯"
msgid "Bridge connection %d"
msgstr "பிணைபà¯à®ªà¯ இணைபà¯à®ªà¯ %d"
-#: ../clients/tui/nm-editor-utils.c:209 ../libnm-core/nm-connection.c:1503
-#: ../libnm-glib/nm-device.c:1804 ../libnm-util/nm-connection.c:1608
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4035
+#: ../clients/tui/nm-editor-utils.c:209 ../libnm-core/nm-connection.c:1545
+#: ../libnm-glib/nm-device.c:1806 ../libnm-util/nm-connection.c:1610
+#: ../libnm/nm-device.c:1627 ../src/settings/plugins/ifcfg-rh/reader.c:4016
msgid "Team"
msgstr "அணி"
@@ -5442,49 +6168,79 @@ msgstr "VPN இணைபà¯à®ªà¯ %d"
msgid "Select..."
msgstr "தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®•à¯à®•à®µà¯à®®à¯..."
-#: ../clients/tui/nmt-edit-connection-list.c:129
+#: ../clients/tui/nmt-edit-connection-list.c:112
msgid "Add"
msgstr "சேரà¯"
-#: ../clients/tui/nmt-edit-connection-list.c:132
-#: ../clients/tui/nmt-page-ip4.c:175 ../clients/tui/nmt-page-ip6.c:173
-#: ../clients/tui/nmt-page-team-port.c:110 ../clients/tui/nmt-page-team.c:174
+#: ../clients/tui/nmt-edit-connection-list.c:115
+#: ../clients/tui/nmt-page-ip4.c:172 ../clients/tui/nmt-page-ip6.c:170
+#: ../clients/tui/nmt-page-team-port.c:112 ../clients/tui/nmt-page-team.c:176
msgid "Edit..."
msgstr "திரà¯à®¤à¯à®¤à¯..."
-#: ../clients/tui/nmt-edit-connection-list.c:135
-#: ../clients/tui/nmtui-edit.c:473
+#: ../clients/tui/nmt-edit-connection-list.c:118
+#: ../clients/tui/nmtui-edit.c:527
msgid "Delete"
msgstr "அழி"
-#: ../clients/tui/nmt-editor.c:81
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Hide"
+msgstr "மறை"
+
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Show"
+msgstr "காடà¯à®Ÿà¯"
+
+#: ../clients/tui/nmt-editor.c:99
#, c-format
msgid "Could not create editor for connection '%s' of type '%s'."
msgstr ""
"'%s' வகையைச௠சேரà¯à®¨à¯à®¤ இணைபà¯à®ªà¯ '%s' கà¯à®•à¯ திரà¯à®¤à¯à®¤à®¿à®¯à¯ˆ உரà¯à®µà®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/tui/nmt-editor.c:85
+#: ../clients/tui/nmt-editor.c:103
#, c-format
msgid "Could not create editor for invalid connection '%s'."
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ இணைபà¯à®ªà¯ '%s' கà¯à®•à¯ திரà¯à®¤à¯à®¤à®¿à®¯à¯ˆ உரà¯à®µà®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/tui/nmt-editor.c:95
+#: ../clients/tui/nmt-editor.c:113
msgid "Edit Connection"
msgstr "இணைபà¯à®ªà¯ˆà®¤à¯ திரà¯à®¤à¯à®¤à¯"
-#: ../clients/tui/nmt-editor.c:149
+#: ../clients/tui/nmt-editor.c:166
#, c-format
msgid "Unable to save connection: %s"
msgstr "இணைபà¯à®ªà¯ˆ சேமிகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../clients/tui/nmt-editor.c:163
+#: ../clients/tui/nmt-editor.c:180
#, c-format
msgid "Unable to add new connection: %s"
msgstr "பà¯à®¤à®¿à®¯ இணைபà¯à®ªà¯ˆà®šà¯ சேரà¯à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../clients/tui/nmt-editor.c:242 ../clients/tui/nmt-password-dialog.c:171
-#: ../clients/tui/nmt-route-editor.c:128 ../clients/tui/nmtui-edit.c:192
-#: ../clients/tui/nmtui-edit.c:472 ../clients/tui/nmtui-hostname.c:69
+#: ../clients/tui/nmt-editor.c:322
+msgid "Profile name"
+msgstr "தனியமைபà¯à®ªà¯ பெயரà¯"
+
+#: ../clients/tui/nmt-editor.c:333
+#| msgid "Ethernet"
+msgid "Ethernet device"
+msgstr "ஈதà¯à®¤à®°à¯à®¨à¯†à®Ÿà¯ சாதனமà¯"
+
+#: ../clients/tui/nmt-editor.c:335
+msgid "Device"
+msgstr "சாதனமà¯"
+
+#. And finally the bottom widgets
+#: ../clients/tui/nmt-editor.c:393
+msgid "Automatically connect"
+msgstr "தானாகவே இணைகà¯à®•à®µà¯à®®à¯"
+
+#: ../clients/tui/nmt-editor.c:399
+msgid "Available to all users"
+msgstr "அனைதà¯à®¤à¯ பயனரà¯à®•à®³à¯à®•à¯à®•à¯à®®à¯ கிடைகà¯à®•à¯à®®à¯"
+
+#: ../clients/tui/nmt-editor.c:414 ../clients/tui/nmt-password-dialog.c:171
+#: ../clients/tui/nmt-route-editor.c:118 ../clients/tui/nmtui-edit.c:218
+#: ../clients/tui/nmtui-edit.c:526 ../clients/tui/nmtui-hostname.c:69
msgid "Cancel"
msgstr "ரதà¯à®¤à¯à®šà¯†à®¯à¯"
@@ -5496,167 +6252,145 @@ msgstr "(à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯)"
msgid "bytes"
msgstr "பைடà¯à®Ÿà¯à®•à®³à¯"
-#: ../clients/tui/nmt-page-bond.c:88
+#: ../clients/tui/nmt-page-bond.c:87
msgid "Round-robin"
msgstr "ரவà¯à®©à¯à®Ÿà¯-ராபினà¯"
-#: ../clients/tui/nmt-page-bond.c:89
+#: ../clients/tui/nmt-page-bond.c:88
msgid "Active Backup"
msgstr "செயலà¯à®®à®¿à®•à¯ மறà¯à®ªà®¿à®°à®¤à®¿"
-#: ../clients/tui/nmt-page-bond.c:90
+#: ../clients/tui/nmt-page-bond.c:89
msgid "XOR"
msgstr "XOR"
-#: ../clients/tui/nmt-page-bond.c:91
+#: ../clients/tui/nmt-page-bond.c:90
msgid "Broadcast"
msgstr "ஒளிபà¯à®ªà®°à®ªà¯à®ªà¯"
-#: ../clients/tui/nmt-page-bond.c:92
+#: ../clients/tui/nmt-page-bond.c:91
msgid "802.3ad"
msgstr "802.3ad"
-#: ../clients/tui/nmt-page-bond.c:93
+#: ../clients/tui/nmt-page-bond.c:92
msgid "Adaptive Transmit Load Balancing (tlb)"
msgstr "சரிசெயà¯à®¤à¯à®•à¯Šà®³à¯à®³à¯à®®à¯ பரபà¯à®ªà®²à¯ சà¯à®®à¯ˆ சமநிலைபà¯à®ªà®Ÿà¯à®¤à¯à®¤à®²à¯ (tlb)"
-#: ../clients/tui/nmt-page-bond.c:94
+#: ../clients/tui/nmt-page-bond.c:93
msgid "Adaptive Load Balancing (alb)"
msgstr "சரிசெயà¯à®¤à¯à®•à¯Šà®³à¯à®³à¯à®®à¯ சà¯à®®à¯ˆ சமநிலைபà¯à®ªà®Ÿà¯à®¤à¯à®¤à®²à¯ (alb)"
-#: ../clients/tui/nmt-page-bond.c:100
+#: ../clients/tui/nmt-page-bond.c:99
msgid "MII (recommended)"
msgstr "MII (பரிநà¯à®¤à¯à®°à¯ˆà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®µà®¤à¯)"
-#: ../clients/tui/nmt-page-bond.c:101
+#: ../clients/tui/nmt-page-bond.c:100
msgid "ARP"
msgstr "ARP"
-#: ../clients/tui/nmt-page-bond.c:357 ../clients/tui/nmt-page-bridge.c:80
-#: ../clients/tui/nmt-page-team.c:153
+#: ../clients/tui/nmt-page-bond.c:358 ../clients/tui/nmt-page-bridge.c:81
+#: ../clients/tui/nmt-page-team.c:155
msgid "Slaves"
msgstr "அடிமைகளà¯"
-#: ../clients/tui/nmt-page-bond.c:369 ../clients/tui/nmt-page-wifi.c:226
+#: ../clients/tui/nmt-page-bond.c:370 ../clients/tui/nmt-page-wifi.c:233
msgid "Mode"
msgstr "à®®à¯à®±à¯ˆ"
-#: ../clients/tui/nmt-page-bond.c:375
+#: ../clients/tui/nmt-page-bond.c:376
msgid "Primary"
msgstr "à®®à¯à®¤à®©à¯à®®à¯ˆ"
-#: ../clients/tui/nmt-page-bond.c:381
+#: ../clients/tui/nmt-page-bond.c:382
msgid "Link monitoring"
msgstr "இணைபà¯à®ªà¯ கணà¯à®•à®¾à®£à®¿à®ªà¯à®ªà¯"
-#: ../clients/tui/nmt-page-bond.c:387 ../clients/tui/nmt-page-bond.c:394
-#: ../clients/tui/nmt-page-bond.c:401 ../clients/tui/nmt-page-bond.c:408
+#: ../clients/tui/nmt-page-bond.c:388 ../clients/tui/nmt-page-bond.c:395
+#: ../clients/tui/nmt-page-bond.c:402 ../clients/tui/nmt-page-bond.c:409
msgctxt "milliseconds"
msgid "ms"
msgstr "ms"
-#: ../clients/tui/nmt-page-bond.c:388 ../clients/tui/nmt-page-bond.c:409
+#: ../clients/tui/nmt-page-bond.c:389 ../clients/tui/nmt-page-bond.c:410
msgid "Monitoring frequency"
msgstr "அதிரà¯à®µà¯†à®£à¯ கணà¯à®•à®¾à®£à®¿à®ªà¯à®ªà¯"
-#: ../clients/tui/nmt-page-bond.c:395
+#: ../clients/tui/nmt-page-bond.c:396
msgid "Link up delay"
msgstr "லிஙà¯à®•à¯ அப௠தாமதமà¯"
-#: ../clients/tui/nmt-page-bond.c:402
+#: ../clients/tui/nmt-page-bond.c:403
msgid "Link down delay"
msgstr "லிஙà¯à®•à¯ டவà¯à®©à¯ தாமதமà¯"
-#: ../clients/tui/nmt-page-bond.c:415
+#: ../clients/tui/nmt-page-bond.c:416
msgid "ARP targets"
msgstr "ARP இலகà¯à®•à¯à®•à®³à¯"
-#: ../clients/tui/nmt-page-bridge-port.c:38
+#: ../clients/tui/nmt-page-bridge-port.c:63
msgid "BRIDGE PORT"
msgstr "பிரிடà¯à®œà¯ போரà¯à®Ÿà¯"
-#: ../clients/tui/nmt-page-bridge-port.c:69
-#: ../clients/tui/nmt-page-bridge.c:106
+#: ../clients/tui/nmt-page-bridge-port.c:70
+#: ../clients/tui/nmt-page-bridge.c:107
msgid "Priority"
msgstr "à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ"
-#: ../clients/tui/nmt-page-bridge-port.c:75
+#: ../clients/tui/nmt-page-bridge-port.c:76
msgid "Path cost"
msgstr "பாதை செலவà¯"
-#: ../clients/tui/nmt-page-bridge-port.c:77
+#: ../clients/tui/nmt-page-bridge-port.c:78
msgid "Hairpin mode"
msgstr "ஹேரà¯à®ªà®¿à®©à¯ à®®à¯à®±à¯ˆà®®à¯ˆ"
-#: ../clients/tui/nmt-page-bridge.c:90 ../clients/tui/nmt-page-bridge.c:115
-#: ../clients/tui/nmt-page-bridge.c:125 ../clients/tui/nmt-page-bridge.c:135
+#: ../clients/tui/nmt-page-bridge.c:91 ../clients/tui/nmt-page-bridge.c:116
+#: ../clients/tui/nmt-page-bridge.c:126 ../clients/tui/nmt-page-bridge.c:136
msgid "seconds"
msgstr "விநாடிகளà¯"
-#: ../clients/tui/nmt-page-bridge.c:91
+#: ../clients/tui/nmt-page-bridge.c:92
msgid "Aging time"
msgstr "பழையதாகà¯à®®à¯ நேரமà¯"
-#: ../clients/tui/nmt-page-bridge.c:93
+#: ../clients/tui/nmt-page-bridge.c:94
msgid "Enable STP (Spanning Tree Protocol)"
msgstr "STP ஠செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯ (பரவà¯à®®à¯ மரகà¯à®•à®¿à®³à¯ˆ நெறிமà¯à®±à¯ˆ)"
-#: ../clients/tui/nmt-page-bridge.c:116
+#: ../clients/tui/nmt-page-bridge.c:117
msgid "Forward delay"
msgstr "பகிரà¯à®¤à®²à¯ தாமதமà¯"
-#: ../clients/tui/nmt-page-bridge.c:126
+#: ../clients/tui/nmt-page-bridge.c:127
msgid "Hello time"
msgstr "ஹலோ நேரமà¯"
-#: ../clients/tui/nmt-page-bridge.c:136
+#: ../clients/tui/nmt-page-bridge.c:137
msgid "Max age"
msgstr "அதிகபடà¯à®š வயதà¯"
-#. TTLS and PEAP are actually much more complicated, but this complication
-#. * is not visible here since we only care about phase2 authentication
-#. * (and don't even care of which one)
-#.
-#: ../clients/tui/nmt-page-dsl.c:67 ../clients/tui/nmt-page-wifi.c:328
-#: ../clients/tui/nmt-secret-agent.c:206 ../clients/tui/nmt-secret-agent.c:301
-msgid "Username"
-msgstr "பயனரà¯à®ªà¯†à®¯à®°à¯"
-
-#: ../clients/tui/nmt-page-dsl.c:76 ../clients/tui/nmt-page-wifi.c:273
-#: ../clients/tui/nmt-page-wifi.c:304 ../clients/tui/nmt-page-wifi.c:337
-#: ../clients/tui/nmt-secret-agent.c:211 ../clients/tui/nmt-secret-agent.c:248
-#: ../clients/tui/nmt-secret-agent.c:278 ../clients/tui/nmt-secret-agent.c:311
-#: ../clients/tui/nmt-secret-agent.c:380 ../clients/tui/nmt-secret-agent.c:393
-#: ../clients/tui/nmt-secret-agent.c:409
-msgid "Password"
-msgstr "கடவà¯à®šà¯à®šà¯Šà®²à¯"
-
-#: ../clients/tui/nmt-page-dsl.c:79 ../clients/tui/nmt-secret-agent.c:306
-msgid "Service"
-msgstr "சேவை"
-
-#: ../clients/tui/nmt-page-ethernet.c:41
+#: ../clients/tui/nmt-page-ethernet.c:73
msgid "ETHERNET"
msgstr "ஈதà¯à®¤à®°à¯à®¨à¯†à®Ÿà¯"
-#: ../clients/tui/nmt-page-ethernet.c:80 ../clients/tui/nmt-page-vlan.c:124
-#: ../clients/tui/nmt-page-wifi.c:360
+#: ../clients/tui/nmt-page-ethernet.c:80 ../clients/tui/nmt-page-vlan.c:125
+#: ../clients/tui/nmt-page-wifi.c:367
msgid "Cloned MAC address"
msgstr "நகலெடà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ MAC à®®à¯à®•à®µà®°à®¿"
-#: ../clients/tui/nmt-page-infiniband.c:40
-msgid "INFINIBAND"
-msgstr "INFINIBAND"
-
-#: ../clients/tui/nmt-page-infiniband.c:51
+#: ../clients/tui/nmt-page-infiniband.c:50
msgid "Datagram"
msgstr "தரவà¯à®ªà¯à®ªà®Ÿà®®à¯"
-#: ../clients/tui/nmt-page-infiniband.c:52
+#: ../clients/tui/nmt-page-infiniband.c:51
msgid "Connected"
msgstr "இணைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
-#: ../clients/tui/nmt-page-infiniband.c:90
+#: ../clients/tui/nmt-page-infiniband.c:84
+msgid "INFINIBAND"
+msgstr "INFINIBAND"
+
+#: ../clients/tui/nmt-page-infiniband.c:91
msgid "Transport mode"
msgstr "போகà¯à®•à¯à®µà®°à®¤à¯à®¤à¯ à®®à¯à®±à¯ˆà®®à¯ˆ"
@@ -5680,46 +6414,46 @@ msgstr "கைமà¯à®±à¯ˆ"
msgid "Shared"
msgstr "பகிரபà¯à®ªà®Ÿà¯à®Ÿ"
-#: ../clients/tui/nmt-page-ip4.c:54
-msgid "IPv4 CONFIGURATION"
-msgstr "IPv4 அமைவாகà¯à®•à®®à¯"
-
-#: ../clients/tui/nmt-page-ip4.c:100 ../clients/tui/nmt-page-ip6.c:100
+#: ../clients/tui/nmt-page-ip4.c:85 ../clients/tui/nmt-page-ip6.c:85
msgid "(No custom routes)"
msgstr "(தனிபà¯à®ªà®¯à®©à¯ தடஙà¯à®•à®³à¯ இலà¯à®²à¯ˆ)"
-#: ../clients/tui/nmt-page-ip4.c:103 ../clients/tui/nmt-page-ip6.c:103
+#: ../clients/tui/nmt-page-ip4.c:88 ../clients/tui/nmt-page-ip6.c:88
#, c-format
msgid "One custom route"
msgid_plural "%d custom routes"
msgstr[0] "ஒர௠தனிபà¯à®ªà®¯à®©à¯ தடமà¯"
msgstr[1] "%d தனிபà¯à®ªà®¯à®©à¯ தடஙà¯à®•à®³à¯"
-#: ../clients/tui/nmt-page-ip4.c:144 ../clients/tui/nmt-page-ip6.c:144
+#: ../clients/tui/nmt-page-ip4.c:131
+msgid "IPv4 CONFIGURATION"
+msgstr "IPv4 அமைவாகà¯à®•à®®à¯"
+
+#: ../clients/tui/nmt-page-ip4.c:139 ../clients/tui/nmt-page-ip6.c:139
msgid "Addresses"
msgstr "à®®à¯à®•à®µà®°à®¿à®•à®³à¯"
-#: ../clients/tui/nmt-page-ip4.c:150 ../clients/tui/nmt-page-ip6.c:150
+#: ../clients/tui/nmt-page-ip4.c:146 ../clients/tui/nmt-page-ip6.c:146
msgid "Gateway"
msgstr "நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯"
-#: ../clients/tui/nmt-page-ip4.c:156 ../clients/tui/nmt-page-ip6.c:156
+#: ../clients/tui/nmt-page-ip4.c:153 ../clients/tui/nmt-page-ip6.c:153
msgid "DNS servers"
msgstr "DNS சேவையகஙà¯à®•à®³à¯"
-#: ../clients/tui/nmt-page-ip4.c:162 ../clients/tui/nmt-page-ip6.c:162
+#: ../clients/tui/nmt-page-ip4.c:159 ../clients/tui/nmt-page-ip6.c:159
msgid "Search domains"
msgstr "தேடல௠டொமைனà¯à®•à®³à¯"
-#: ../clients/tui/nmt-page-ip4.c:177 ../clients/tui/nmt-page-ip6.c:175
+#: ../clients/tui/nmt-page-ip4.c:174 ../clients/tui/nmt-page-ip6.c:172
msgid "Routing"
msgstr "ரௌடà¯à®Ÿà®¿à®™à¯"
-#: ../clients/tui/nmt-page-ip4.c:179 ../clients/tui/nmt-page-ip6.c:177
+#: ../clients/tui/nmt-page-ip4.c:176 ../clients/tui/nmt-page-ip6.c:174
msgid "Never use this network for default route"
msgstr "à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ தடதà¯à®¤à®¿à®±à¯à®•à¯ இநà¯à®¤ பிணையதà¯à®¤à¯ˆ à®’à®°à¯à®ªà¯‹à®¤à¯à®®à¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤ வேணà¯à®Ÿà®¾à®®à¯"
-#: ../clients/tui/nmt-page-ip4.c:187
+#: ../clients/tui/nmt-page-ip4.c:184
msgid "Require IPv4 addressing for this connection"
msgstr "இநà¯à®¤ இணைபà¯à®ªà¯à®•à¯à®•à¯ IPv4 à®®à¯à®•à®µà®°à®¿ தேவை"
@@ -5731,232 +6465,200 @@ msgstr "தவிரà¯"
msgid "Automatic (DHCP-only)"
msgstr "தானியகà¯à®• (DHCP) மடà¯à®Ÿà¯à®®à¯)"
-#: ../clients/tui/nmt-page-ip6.c:54
+#: ../clients/tui/nmt-page-ip6.c:131
msgid "IPv6 CONFIGURATION"
msgstr "IPv6 அமைவாகà¯à®•à®®à¯"
-#: ../clients/tui/nmt-page-ip6.c:185
+#: ../clients/tui/nmt-page-ip6.c:182
msgid "Require IPv6 addressing for this connection"
msgstr "இநà¯à®¤ இணைபà¯à®ªà¯à®•à¯à®•à¯ IPv6 à®®à¯à®•à®µà®°à®¿ தேவை"
-#: ../clients/tui/nmt-page-main.c:139
-msgid "Hide"
-msgstr "மறை"
-
-#: ../clients/tui/nmt-page-main.c:139
-msgid "Show"
-msgstr "காடà¯à®Ÿà¯"
-
-#: ../clients/tui/nmt-page-main.c:187
-msgid "Profile name"
-msgstr "தனியமைபà¯à®ªà¯ பெயரà¯"
-
-#: ../clients/tui/nmt-page-main.c:194
-msgid "Device"
-msgstr "சாதனமà¯"
-
-#: ../clients/tui/nmt-page-main.c:243
-msgid "Automatically connect"
-msgstr "தானாகவே இணைகà¯à®•à®µà¯à®®à¯"
-
-#: ../clients/tui/nmt-page-main.c:249
-msgid "Available to all users"
-msgstr "அனைதà¯à®¤à¯ பயனரà¯à®•à®³à¯à®•à¯à®•à¯à®®à¯ கிடைகà¯à®•à¯à®®à¯"
-
-#: ../clients/tui/nmt-page-ppp.c:49
-#| msgid "IPv4 CONFIGURATION"
+#: ../clients/tui/nmt-page-ppp.c:134
msgid "PPP CONFIGURATION"
msgstr "PPP அமைவாகà¯à®•à®®à¯"
-#: ../clients/tui/nmt-page-ppp.c:142
-#| msgid "Authentication"
+#: ../clients/tui/nmt-page-ppp.c:143
msgid "Allowed authentication methods:"
msgstr "அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ à®®à¯à®±à¯ˆà®•à®³à¯:"
-#: ../clients/tui/nmt-page-ppp.c:149
-#| msgid "LEAP"
+#: ../clients/tui/nmt-page-ppp.c:150
msgid "EAP"
msgstr "EAP"
-#: ../clients/tui/nmt-page-ppp.c:157
-#| msgid "AP"
+#: ../clients/tui/nmt-page-ppp.c:158
msgid "PAP"
msgstr "PAP"
-#: ../clients/tui/nmt-page-ppp.c:165
+#: ../clients/tui/nmt-page-ppp.c:166
msgid "CHAP"
msgstr "CHAP"
-#: ../clients/tui/nmt-page-ppp.c:173
+#: ../clients/tui/nmt-page-ppp.c:174
msgid "MSCHAPv2"
msgstr "MSCHAPv2"
-#: ../clients/tui/nmt-page-ppp.c:181
+#: ../clients/tui/nmt-page-ppp.c:182
msgid "MSCHAP"
msgstr "MSCHAP"
-#: ../clients/tui/nmt-page-ppp.c:197
+#: ../clients/tui/nmt-page-ppp.c:198
msgid "Use point-to-point encryption (MPPE)"
msgstr "பாயிணà¯à®Ÿà¯ ட௠பாயிணà¯à®Ÿà¯ மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®¤à¯à®¤à¯ˆ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯ (MPPE)"
-#: ../clients/tui/nmt-page-ppp.c:209
+#: ../clients/tui/nmt-page-ppp.c:210
msgid "Require 128-bit encryption"
msgstr "128-பிட௠கà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à®¾à®•à¯à®•à®®à¯ தேவை"
-#: ../clients/tui/nmt-page-ppp.c:219
+#: ../clients/tui/nmt-page-ppp.c:220
msgid "Use stateful MPPE"
msgstr "ஸà¯à®Ÿà¯‡à®Ÿà¯à®ƒà®ªà¯à®²à¯ MPPE à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯"
-#: ../clients/tui/nmt-page-ppp.c:231
+#: ../clients/tui/nmt-page-ppp.c:232
msgid "Allow BSD data compression"
msgstr "BSD தரவ௠அமà¯à®•à¯à®•à®¤à¯à®¤à¯ˆ அனà¯à®®à®¤à®¿"
-#: ../clients/tui/nmt-page-ppp.c:239
+#: ../clients/tui/nmt-page-ppp.c:240
msgid "Allow Deflate data compression"
msgstr "டீஃபà¯à®³à¯‡à®Ÿà¯ தரவ௠அமà¯à®•à¯à®•à®¤à¯à®¤à¯ˆ அனà¯à®®à®¤à®¿"
-#: ../clients/tui/nmt-page-ppp.c:247
+#: ../clients/tui/nmt-page-ppp.c:248
msgid "Use TCP header compression"
msgstr "TCP தலைபà¯à®ªà¯ à®…à®®à¯à®•à¯à®•à®¤à¯à®¤à¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯"
-#: ../clients/tui/nmt-page-ppp.c:257
+#: ../clients/tui/nmt-page-ppp.c:258
msgid "Send PPP echo packets"
msgstr "PPP எகà¯à®•à¯‹ பொதிகளை அனà¯à®ªà¯à®ªà¯"
-#: ../clients/tui/nmt-page-team-port.c:45
+#: ../clients/tui/nmt-page-team-port.c:95
msgid "TEAM PORT"
msgstr "அணி போரà¯à®Ÿà¯"
-#: ../clients/tui/nmt-page-team-port.c:100 ../clients/tui/nmt-page-team.c:164
+#: ../clients/tui/nmt-page-team-port.c:102 ../clients/tui/nmt-page-team.c:166
msgid "JSON configuration"
msgstr "JSON அமைவாகà¯à®•à®®à¯"
-#: ../clients/tui/nmt-page-vlan.c:101
+#: ../clients/tui/nmt-page-vlan.c:102
msgid "Parent"
msgstr "பெறà¯à®±à¯‹à®°à¯"
-#: ../clients/tui/nmt-page-vlan.c:116
+#: ../clients/tui/nmt-page-vlan.c:117
msgid "VLAN id"
msgstr "VLAN id"
-#: ../clients/tui/nmt-page-wifi.c:57
-msgid "WI-FI"
-msgstr "WI-FI"
-
-#: ../clients/tui/nmt-page-wifi.c:68
+#: ../clients/tui/nmt-page-wifi.c:67
msgctxt "Wi-Fi"
msgid "Client"
msgstr "கிளையனà¯à®Ÿà¯"
-#: ../clients/tui/nmt-page-wifi.c:69
+#: ../clients/tui/nmt-page-wifi.c:68
msgid "Access Point"
msgstr "அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿"
-#: ../clients/tui/nmt-page-wifi.c:70
+#: ../clients/tui/nmt-page-wifi.c:69
msgid "Ad-Hoc Network"
msgstr "Ad-Hoc பிணையமà¯"
-#: ../clients/tui/nmt-page-wifi.c:75
+#: ../clients/tui/nmt-page-wifi.c:74
msgctxt "Wi-Fi"
msgid "Automatic"
msgstr "தானியஙà¯à®•à®¿"
#. 802.11a Wi-Fi network
-#: ../clients/tui/nmt-page-wifi.c:77
+#: ../clients/tui/nmt-page-wifi.c:76
msgid "A (5 GHz)"
msgstr "A (5 GHz)"
#. 802.11b / 802.11g Wi-Fi network
-#: ../clients/tui/nmt-page-wifi.c:79
+#: ../clients/tui/nmt-page-wifi.c:78
msgid "B/G (2.4 GHz)"
msgstr "B/G (2.4 GHz)"
-#: ../clients/tui/nmt-page-wifi.c:84
+#: ../clients/tui/nmt-page-wifi.c:83
msgctxt "Wi-Fi security"
msgid "None"
msgstr "எதà¯à®µà¯à®®à®¿à®²à¯à®²à¯ˆ"
-#: ../clients/tui/nmt-page-wifi.c:85
+#: ../clients/tui/nmt-page-wifi.c:84
msgid "WPA & WPA2 Personal"
msgstr "WPA & WPA2 தனிபà¯à®ªà®Ÿà¯à®Ÿ"
-#: ../clients/tui/nmt-page-wifi.c:86
+#: ../clients/tui/nmt-page-wifi.c:85
msgid "WPA & WPA2 Enterprise"
msgstr "WPA & WPA2 கடவà¯à®šà¯à®šà¯Šà®²à¯"
-#: ../clients/tui/nmt-page-wifi.c:87
+#: ../clients/tui/nmt-page-wifi.c:86
msgid "WEP 40/128-bit Key (Hex or ASCII)"
msgstr "WEP 40/128-பிட௠விசை (Hex அலà¯à®²à®¤à¯ ASCII)"
-#: ../clients/tui/nmt-page-wifi.c:88
+#: ../clients/tui/nmt-page-wifi.c:87
msgid "WEP 128-bit Passphrase"
msgstr "WEP 128-பிட௠கடவà¯à®µà®¾à®•à¯à®•à®¿à®¯à®®à¯"
-#: ../clients/tui/nmt-page-wifi.c:89
+#: ../clients/tui/nmt-page-wifi.c:88
msgid "Dynamic WEP (802.1x)"
msgstr "மாறà¯à®®à¯ WEP (802.1x)"
-#: ../clients/tui/nmt-page-wifi.c:90
+#: ../clients/tui/nmt-page-wifi.c:89
msgid "LEAP"
msgstr "LEAP"
-#: ../clients/tui/nmt-page-wifi.c:95
+#: ../clients/tui/nmt-page-wifi.c:94
msgctxt "WEP key index"
msgid "1 (Default)"
msgstr "1 (à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯)"
-#: ../clients/tui/nmt-page-wifi.c:96
+#: ../clients/tui/nmt-page-wifi.c:95
msgctxt "WEP key index"
msgid "2"
msgstr "2"
-#: ../clients/tui/nmt-page-wifi.c:97
+#: ../clients/tui/nmt-page-wifi.c:96
msgctxt "WEP key index"
msgid "3"
msgstr "3"
-#: ../clients/tui/nmt-page-wifi.c:98
+#: ../clients/tui/nmt-page-wifi.c:97
msgctxt "WEP key index"
msgid "4"
msgstr "4"
-#: ../clients/tui/nmt-page-wifi.c:103
+#: ../clients/tui/nmt-page-wifi.c:102
msgid "Open System"
msgstr "Open System"
-#: ../clients/tui/nmt-page-wifi.c:104
+#: ../clients/tui/nmt-page-wifi.c:103
msgid "Shared Key"
msgstr "பகிரபà¯à®ªà®Ÿà¯à®Ÿ விசை"
-#: ../clients/tui/nmt-page-wifi.c:252
+#: ../clients/tui/nmt-page-wifi.c:217
+msgid "WI-FI"
+msgstr "WI-FI"
+
+#: ../clients/tui/nmt-page-wifi.c:259
msgid "Channel"
msgstr "சேனலà¯"
-#: ../clients/tui/nmt-page-wifi.c:257
+#: ../clients/tui/nmt-page-wifi.c:264
msgid "Security"
msgstr "பாதà¯à®•à®¾à®ªà¯à®ªà¯"
#. "wpa-enterprise"
#. FIXME
-#: ../clients/tui/nmt-page-wifi.c:278
+#: ../clients/tui/nmt-page-wifi.c:285
msgid "(No support for wpa-enterprise yet...)"
msgstr "(இபà¯à®ªà¯‹à®¤à¯ wpa-enterprise கà¯à®•à¯ ஆதரவ௠இலà¯à®²à¯ˆ...)"
-#: ../clients/tui/nmt-page-wifi.c:285 ../clients/tui/nmt-secret-agent.c:262
-msgid "Key"
-msgstr "விசை"
-
-#: ../clients/tui/nmt-page-wifi.c:288 ../clients/tui/nmt-page-wifi.c:307
+#: ../clients/tui/nmt-page-wifi.c:295 ../clients/tui/nmt-page-wifi.c:314
msgid "WEP index"
msgstr "WEP அடà¯à®Ÿà®µà®£à¯ˆ"
-#: ../clients/tui/nmt-page-wifi.c:296 ../clients/tui/nmt-page-wifi.c:315
+#: ../clients/tui/nmt-page-wifi.c:303 ../clients/tui/nmt-page-wifi.c:322
msgid "Authentication"
msgstr "à®…à®™à¯à®•à¯€à®•à®¾à®°à®®à¯"
#. "dynamic-wep"
#. FIXME
-#: ../clients/tui/nmt-page-wifi.c:321
+#: ../clients/tui/nmt-page-wifi.c:328
msgid "(No support for dynamic-wep yet...)"
msgstr "(இபà¯à®ªà¯‹à®¤à¯ dynamic-wep கà¯à®•à¯ ஆதரவ௠இலà¯à®²à¯ˆ...)"
@@ -5968,82 +6670,26 @@ msgstr "ஒவà¯à®µà¯Šà®°à¯ à®®à¯à®±à¯ˆà®¯à¯à®®à¯ இநà¯à®¤ கடவà¯
msgid "Show password"
msgstr "கடவà¯à®šà¯à®šà¯Šà®²à¯à®²à¯ˆà®•à¯ காடà¯à®Ÿà¯"
-#: ../clients/tui/nmt-route-table.c:217
+#: ../clients/tui/nmt-route-table.c:192
msgid "Destination"
msgstr "இலகà¯à®•à¯"
-#: ../clients/tui/nmt-route-table.c:217
+#: ../clients/tui/nmt-route-table.c:192
msgid "Prefix"
msgstr "à®®à¯à®©à¯à®ªà¯Šà®°à¯à®¤à¯à®¤à®®à¯"
-#: ../clients/tui/nmt-route-table.c:226
+#: ../clients/tui/nmt-route-table.c:201
msgid "Next Hop"
msgstr "அடà¯à®¤à¯à®¤ ஹாபà¯"
-#: ../clients/tui/nmt-route-table.c:234
+#: ../clients/tui/nmt-route-table.c:209
msgid "Metric"
msgstr "மெடà¯à®°à®¿à®•à¯"
-#: ../clients/tui/nmt-route-table.c:254
+#: ../clients/tui/nmt-route-table.c:229
msgid "No custom routes are defined."
msgstr "தனிபà¯à®ªà®¯à®©à¯ தடஙà¯à®•à®³à¯ à®à®¤à¯à®®à¯ வரையறà¯à®•à¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../clients/tui/nmt-secret-agent.c:220
-msgid "Identity"
-msgstr "அடையாளமà¯"
-
-#: ../clients/tui/nmt-secret-agent.c:225
-msgid "Private key password"
-msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசை கடவà¯à®šà¯à®šà¯Šà®²à¯"
-
-#: ../clients/tui/nmt-secret-agent.c:340
-msgid "Authentication required by wireless network"
-msgstr "வயரà¯à®²à¯†à®¸à¯ பிணையதà¯à®¤à®¿à®±à¯à®•à¯ à®…à®™à¯à®•à¯€à®•à®¾à®°à®®à¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-
-#: ../clients/tui/nmt-secret-agent.c:341
-#, c-format
-msgid ""
-"Passwords or encryption keys are required to access the wireless network "
-"'%s'."
-msgstr ""
-"வயரà¯à®²à¯†à®¸à¯ பிணையம௠'%s' ஠அணà¯à®• கடவà¯à®šà¯à®šà¯Šà®±à¯à®•à®³à¯ அலà¯à®²à®¤à¯ மறைகà¯à®±à®¿à®¯à®¾à®•à®•à¯ விசைகள௠"
-"தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-
-#: ../clients/tui/nmt-secret-agent.c:349
-msgid "Wired 802.1X authentication"
-msgstr "ஒயரà¯à®Ÿà¯ 802.1X à®…à®™à¯à®•à¯€à®•à®¾à®°à®®à¯"
-
-#: ../clients/tui/nmt-secret-agent.c:352
-msgid "Network name"
-msgstr "பிணைய பெயரà¯"
-
-#: ../clients/tui/nmt-secret-agent.c:359
-msgid "DSL authentication"
-msgstr "DSL à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯"
-
-#: ../clients/tui/nmt-secret-agent.c:367
-msgid "PIN code required"
-msgstr "PIN கà¯à®±à®¿à®¯à¯€à®Ÿà¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-
-#: ../clients/tui/nmt-secret-agent.c:368
-msgid "PIN code is needed for the mobile broadband device"
-msgstr "PIN கà¯à®±à®¿à®¯à¯€à®Ÿà¯ மொபைல௠பிராடà¯à®ªà¯‡à®£à¯à®Ÿà¯ சாதனதà¯à®¤à®¿à®±à¯à®•à¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-
-#: ../clients/tui/nmt-secret-agent.c:370
-msgid "PIN"
-msgstr "PIN"
-
-#: ../clients/tui/nmt-secret-agent.c:376 ../clients/tui/nmt-secret-agent.c:389
-#: ../clients/tui/nmt-secret-agent.c:405
-msgid "Mobile broadband network password"
-msgstr "மொபைல௠பிராடà¯à®ªà¯‡à®£à¯à®Ÿà¯ பிணையதà¯à®¤à®¿à®©à¯ கடவà¯à®šà¯à®šà¯Šà®²à¯"
-
-#: ../clients/tui/nmt-secret-agent.c:377 ../clients/tui/nmt-secret-agent.c:390
-#: ../clients/tui/nmt-secret-agent.c:406
-#, c-format
-msgid "A password is required to connect to '%s'."
-msgstr "'%s'஠இணைபà¯à®ªà®¤à®±à¯à®•à¯ ஒர௠கடவà¯à®šà¯à®šà¯Šà®²à¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯."
-
#: ../clients/tui/nmt-slave-list.c:137
msgid "Select the type of slave connection you wish to add."
msgstr "நீஙà¯à®•à®³à¯ சேரà¯à®•à¯à®• விரà¯à®®à¯à®ªà¯à®®à¯ அடிமை இணைபà¯à®ªà¯ வகையைத௠தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®•à¯à®•à®µà¯à®®à¯."
@@ -6064,42 +6710,42 @@ msgstr "செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿à®
msgid "Connecting..."
msgstr "இணைகà¯à®•à®¿à®±à®¤à¯..."
-#: ../clients/tui/nmtui-connect.c:174 ../clients/tui/nmtui-connect.c:197
+#: ../clients/tui/nmtui-connect.c:180 ../clients/tui/nmtui-connect.c:211
#, c-format
msgid "Could not activate connection: %s"
msgstr "இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../clients/tui/nmtui-connect.c:257 ../clients/tui/nmtui-connect.c:306
+#: ../clients/tui/nmtui-connect.c:271 ../clients/tui/nmtui-connect.c:320
msgid "Activate"
msgstr "செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯"
-#: ../clients/tui/nmtui-connect.c:259
+#: ../clients/tui/nmtui-connect.c:273
msgid "Deactivate"
msgstr "செயலà¯à®®à¯à®Ÿà®•à¯à®•à¯"
-#: ../clients/tui/nmtui-connect.c:311 ../clients/tui/nmtui-edit.c:95
-#: ../clients/tui/nmtui.c:112
+#: ../clients/tui/nmtui-connect.c:325 ../clients/tui/nmtui-edit.c:121
+#: ../clients/tui/nmtui.c:111
msgid "Quit"
msgstr "வெளியேறà¯"
-#: ../clients/tui/nmtui-connect.c:334
+#: ../clients/tui/nmtui-connect.c:348
#, c-format
msgid "No such connection '%s'"
msgstr "'%s' என ஒர௠இணைபà¯à®ªà¯ இலà¯à®²à¯ˆ"
-#: ../clients/tui/nmtui-connect.c:336
+#: ../clients/tui/nmtui-connect.c:350
msgid "Connection is already active"
msgstr "இணைபà¯à®ªà¯ à®®à¯à®©à¯à®ªà¯‡ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯"
-#: ../clients/tui/nmtui-edit.c:200
+#: ../clients/tui/nmtui-edit.c:226
msgid "Create"
msgstr "உரà¯à®µà®¾à®•à¯à®•à®µà¯à®®à¯"
-#: ../clients/tui/nmtui-edit.c:342
+#: ../clients/tui/nmtui-edit.c:368
msgid "Select the type of connection you wish to create."
msgstr "உரà¯à®µà®¾à®•à¯à®• விரà¯à®®à¯à®ªà¯à®®à¯ இணைபà¯à®ªà¯ வகையை தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®•à¯à®•à®µà¯à®®à¯."
-#: ../clients/tui/nmtui-edit.c:350
+#: ../clients/tui/nmtui-edit.c:376
msgid ""
"If you are creating a VPN, and the VPN connection you wish to create does "
"not appear in the list, you may not have the correct VPN plugin installed."
@@ -6108,24 +6754,25 @@ msgstr ""
"இலà¯à®²à®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯, சரியான "
"VPN செரà¯à®•à¯à®¨à®¿à®°à®²à¯ நிறà¯à®µà®ªà¯à®ªà®Ÿà®¾à®¤à®¿à®°à¯à®•à¯à®•à®²à®¾à®®à¯."
-#: ../clients/tui/nmtui-edit.c:386 ../clients/tui/nmtui-edit.c:402
+#: ../clients/tui/nmtui-edit.c:412 ../clients/tui/nmtui-edit.c:428
msgid "New Connection"
msgstr "பà¯à®¤à®¿à®¯ இணைபà¯à®ªà¯"
-#: ../clients/tui/nmtui-edit.c:441
+#: ../clients/tui/nmtui-edit.c:467
#, c-format
msgid "Unable to delete connection: %s"
msgstr "இணைபà¯à®ªà¯ˆà®•à¯ கணà¯à®Ÿà®±à®¿à®¯ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../clients/tui/nmtui-edit.c:474
+#: ../clients/tui/nmtui-edit.c:506
#, c-format
-msgid "Are you sure you want to delete the connection '%s'?"
-msgstr "நிசà¯à®šà®¯à®®à¯ இணைபà¯à®ªà¯ '%s' ஠அழிகà¯à®• வேணà¯à®Ÿà¯à®®à®¾?"
+#| msgid "Could not delete connection: %s"
+msgid "Could not delete connection '%s': %s"
+msgstr "இணைபà¯à®ªà¯ˆ நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: '%s': %s"
-#: ../clients/tui/nmtui-edit.c:488
+#: ../clients/tui/nmtui-edit.c:528
#, c-format
-msgid "Could not delete connection: %s"
-msgstr "இணைபà¯à®ªà¯ˆ அழிகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
+msgid "Are you sure you want to delete the connection '%s'?"
+msgstr "நிசà¯à®šà®¯à®®à¯ இணைபà¯à®ªà¯ '%s' ஠அழிகà¯à®• வேணà¯à®Ÿà¯à®®à®¾?"
#: ../clients/tui/nmtui-hostname.c:47
msgid "Set Hostname"
@@ -6146,292 +6793,288 @@ msgstr "வாழஙà¯à®•à®¿ பெயரை '%s' என அமைகà¯à®•à®µ
msgid "Unable to set hostname: %s"
msgstr "வழஙà¯à®•à®¿ பெயரை அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../clients/tui/nmtui.c:57 ../clients/tui/nmtui.c:60
+#: ../clients/tui/nmtui.c:56 ../clients/tui/nmtui.c:59
msgid "connection"
msgstr "இணைபà¯à®ªà¯"
-#: ../clients/tui/nmtui.c:58
+#: ../clients/tui/nmtui.c:57
msgid "Edit a connection"
msgstr "ஒர௠இணைபà¯à®ªà¯ˆà®¤à¯ திரà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/tui/nmtui.c:61
+#: ../clients/tui/nmtui.c:60
msgid "Activate a connection"
msgstr "ஒர௠இணைபà¯à®ªà¯ˆ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
-#: ../clients/tui/nmtui.c:63
+#: ../clients/tui/nmtui.c:62
msgid "new hostname"
msgstr "பà¯à®¤à®¿à®¯ வழஙà¯à®•à®¿ பெயரà¯"
-#: ../clients/tui/nmtui.c:64
+#: ../clients/tui/nmtui.c:63
msgid "Set system hostname"
msgstr "கணினி வழஙà¯à®•à®¿ பெயரை அமைகà¯à®•à®µà¯à®®à¯"
-#: ../clients/tui/nmtui.c:87
+#: ../clients/tui/nmtui.c:86
msgid "NetworkManager TUI"
msgstr "NetworkManager TUI"
-#: ../clients/tui/nmtui.c:95
+#: ../clients/tui/nmtui.c:94
msgid "Please select an option"
msgstr "ஒர௠விரà¯à®ªà¯à®ªà®¤à¯à®¤à¯ˆ தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®•à¯à®•à®µà¯à®®à¯"
-#: ../clients/tui/nmtui.c:147
+#: ../clients/tui/nmtui.c:146
msgid "Usage"
msgstr "பயனà¯à®ªà®¾à®Ÿà¯"
-#: ../clients/tui/nmtui.c:228
+#: ../clients/tui/nmtui.c:227
msgid "Could not parse arguments"
msgstr "மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ˆ பாகà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../clients/tui/nmtui.c:238 ../clients/tui/nmtui.c:249
+#: ../clients/tui/nmtui.c:237
#, c-format
msgid "Could not contact NetworkManager: %s.\n"
msgstr "NetworkManager à®à®¤à¯ தொடரà¯à®ªà¯à®•à¯Šà®³à¯à®³ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s.\n"
-#: ../clients/tui/nmtui.c:243
+#: ../clients/tui/nmtui.c:242
msgid "NetworkManager is not running."
msgstr "NetworkManager இயஙà¯à®•à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:135 ../libnm-util/crypto.c:133
+#: ../libnm-core/crypto.c:120 ../libnm-util/crypto.c:133
#, c-format
msgid "PEM key file had no end tag '%s'."
msgstr "PEM விசைக௠கோபà¯à®ªà®¿à®±à¯à®•à¯ à®®à¯à®Ÿà®¿à®µà¯ ஒடà¯à®Ÿà¯'%s' இலà¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:148 ../libnm-util/crypto.c:146
+#: ../libnm-core/crypto.c:133 ../libnm-util/crypto.c:146
#, c-format
msgid "Doesn't look like a PEM private key file."
msgstr "இதைப௠பாரà¯à®ªà¯à®ªà®¤à®±à¯à®•à¯ ஒர௠PEM தனிபà¯à®ªà®Ÿà¯à®Ÿ விசைக௠கோபà¯à®ªà¯ போல௠இலà¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:165 ../libnm-util/crypto.c:163
+#: ../libnm-core/crypto.c:150 ../libnm-util/crypto.c:163
#, c-format
msgid "Malformed PEM file: Proc-Type was not first tag."
msgstr "à®®à¯à®±à¯ˆà®¯à®±à¯à®± PEM கோபà¯à®ªà¯: Proc-வகையானத௠மà¯à®¤à®²à¯ ஒடà¯à®Ÿà¯ இலà¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:173 ../libnm-util/crypto.c:171
+#: ../libnm-core/crypto.c:158 ../libnm-util/crypto.c:171
#, c-format
msgid "Malformed PEM file: unknown Proc-Type tag '%s'."
msgstr "à®®à¯à®±à¯ˆà®¯à®±à¯à®± PEM கோபà¯à®ªà¯: தெரியாத Proc-வகை ஒடà¯à®Ÿà¯ '%s'."
-#: ../libnm-core/crypto.c:183 ../libnm-util/crypto.c:181
+#: ../libnm-core/crypto.c:168 ../libnm-util/crypto.c:181
#, c-format
msgid "Malformed PEM file: DEK-Info was not the second tag."
msgstr "à®®à¯à®±à¯ˆà®¯à®±à¯à®± PEM கோபà¯à®ªà¯: DEK-தகவலானத௠இரணà¯à®Ÿà®¾à®µà®¤à¯ ஒடà¯à®Ÿà®¾à®• இரà¯à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯."
-#: ../libnm-core/crypto.c:194 ../libnm-util/crypto.c:192
+#: ../libnm-core/crypto.c:179 ../libnm-util/crypto.c:192
#, c-format
msgid "Malformed PEM file: no IV found in DEK-Info tag."
msgstr "à®®à¯à®±à¯ˆà®¯à®±à¯à®± PEM கோபà¯à®ªà¯: IV ஆனத௠DEK-தகவல௠ஒடà¯à®Ÿà®¿à®²à¯ காணபà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:201 ../libnm-util/crypto.c:199
+#: ../libnm-core/crypto.c:186 ../libnm-util/crypto.c:199
#, c-format
msgid "Malformed PEM file: invalid format of IV in DEK-Info tag."
msgstr "à®®à¯à®±à¯ˆà®¯à®±à¯à®± PEM கோபà¯à®ªà¯: DEK-தகவல௠ஒடà¯à®Ÿà®¿à®©à¯à®³à¯ IV ன௠தவறான வடிவமà¯."
-#: ../libnm-core/crypto.c:216 ../libnm-util/crypto.c:214
+#: ../libnm-core/crypto.c:201 ../libnm-util/crypto.c:214
#, c-format
msgid "Malformed PEM file: unknown private key cipher '%s'."
msgstr "à®®à¯à®±à¯ˆà®¯à®±à¯à®± PEM கோபà¯à®ªà¯: தெரியாத தனிபà¯à®ªà®Ÿà¯à®Ÿ விசை cipher '%s'."
-#: ../libnm-core/crypto.c:235 ../libnm-util/crypto.c:233
+#: ../libnm-core/crypto.c:220 ../libnm-util/crypto.c:233
#, c-format
msgid "Could not decode private key."
msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசையை கà¯à®±à®¿à®¯à®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:288 ../libnm-util/crypto.c:285
+#: ../libnm-core/crypto.c:274 ../libnm-util/crypto.c:285
msgid "Failed to find expected PKCS#8 start tag."
msgstr "எதிரà¯à®ªà®¾à®°à¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ PKCS#8 தொடகà¯à®•à®•à¯ கà¯à®±à®¿à®šà¯à®šà¯Šà®²à¯à®²à¯ˆà®•à¯ கணà¯à®Ÿà®±à®¿à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿."
-#: ../libnm-core/crypto.c:296 ../libnm-util/crypto.c:293
+#: ../libnm-core/crypto.c:282 ../libnm-util/crypto.c:293
#, c-format
msgid "Failed to find expected PKCS#8 end tag '%s'."
msgstr ""
"எதிரà¯à®ªà®¾à®°à¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ PKCS#8 à®®à¯à®Ÿà®¿à®µà¯ கà¯à®±à®¿à®šà¯à®šà¯Šà®²à¯ '%s' à®à®•à¯ கணà¯à®Ÿà®±à®¿à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿."
-#: ../libnm-core/crypto.c:315 ../libnm-util/crypto.c:312
+#: ../libnm-core/crypto.c:301 ../libnm-util/crypto.c:312
msgid "Failed to decode PKCS#8 private key."
msgstr "PKCS#8 தனிபà¯à®ªà®Ÿà¯à®Ÿ விசையை கà¯à®±à®¿à®¨à¯€à®•à¯à®•à®®à¯ செயà¯à®¤à®²à¯ தோலà¯à®µà®¿."
-#: ../libnm-core/crypto.c:357 ../libnm-util/crypto.c:354
+#: ../libnm-core/crypto.c:343 ../libnm-util/crypto.c:354
#, c-format
msgid "IV must be an even number of bytes in length."
msgstr "IV ஆனத௠நீளதà¯à®¤à®¿à®²à¯ ஒர௠பைடà¯à®Ÿà®¿à®•à®³à®¿à®©à¯ எணà¯à®©à¯ˆà®ªà¯ பெறà¯à®±à¯à®³à¯à®³à®¤à¯."
-#: ../libnm-core/crypto.c:371 ../libnm-util/crypto.c:368
+#: ../libnm-core/crypto.c:357 ../libnm-util/crypto.c:368
#, c-format
msgid "IV contains non-hexadecimal digits."
msgstr "IV ஆனதà¯-ஹெகà¯à®¸à®¾ தசம எணà¯à®•à®³à¯ˆ பெறà¯à®±à®¿à®°à¯à®•à¯à®•à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:411 ../libnm-core/crypto_gnutls.c:151
-#: ../libnm-core/crypto_gnutls.c:269 ../libnm-core/crypto_nss.c:171
-#: ../libnm-core/crypto_nss.c:333 ../libnm-util/crypto.c:408
-#: ../libnm-util/crypto_gnutls.c:150 ../libnm-util/crypto_gnutls.c:267
-#: ../libnm-util/crypto_nss.c:170 ../libnm-util/crypto_nss.c:331
+#: ../libnm-core/crypto.c:397 ../libnm-core/crypto_gnutls.c:93
+#: ../libnm-core/crypto_gnutls.c:214 ../libnm-core/crypto_nss.c:115
+#: ../libnm-core/crypto_nss.c:280 ../libnm-util/crypto.c:408
+#: ../libnm-util/crypto_gnutls.c:146 ../libnm-util/crypto_gnutls.c:263
+#: ../libnm-util/crypto_nss.c:165 ../libnm-util/crypto_nss.c:326
#, c-format
msgid "Private key cipher '%s' was unknown."
msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசை cipher '%s' ஆனத௠தெரியாததà¯."
-#: ../libnm-core/crypto.c:523 ../libnm-util/crypto.c:518
+#: ../libnm-core/crypto.c:496 ../libnm-util/crypto.c:518
#, c-format
msgid "Unable to determine private key type."
msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசை வகையை வரையறà¯à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:580 ../libnm-util/crypto.c:573
+#: ../libnm-core/crypto.c:504
+#, c-format
+msgid "Password provided, but key was not encrypted."
+msgstr ""
+"கடவà¯à®šà¯à®šà¯Šà®²à¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯, ஆனால௠திறபà¯à®ªà¯ மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®®à¯ செயà¯à®¯à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../libnm-core/crypto.c:557 ../libnm-util/crypto.c:573
#, c-format
msgid "PEM certificate had no start tag '%s'."
msgstr "PEM சானà¯à®±à®¿à®¤à®´à®¿à®²à¯ '%s' எனà¯à®± தொடகà¯à®•à®•à¯ கà¯à®±à®¿à®šà¯à®šà¯Šà®²à¯ இலà¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:589 ../libnm-util/crypto.c:582
+#: ../libnm-core/crypto.c:566 ../libnm-util/crypto.c:582
#, c-format
msgid "PEM certificate had no end tag '%s'."
msgstr "PEM சானà¯à®±à®¿à®¤à®´à®¿à®²à¯ '%s' எனà¯à®± à®®à¯à®Ÿà®¿à®µà¯à®•à¯ கà¯à®±à®¿à®šà¯à®šà¯Šà®²à¯ இலà¯à®²à¯ˆ."
-#: ../libnm-core/crypto.c:607 ../libnm-util/crypto.c:600
+#: ../libnm-core/crypto.c:584 ../libnm-util/crypto.c:600
#, c-format
msgid "Failed to decode certificate."
msgstr "சானà¯à®±à®¿à®¤à®´à¯ˆ கà¯à®±à®¿à®¯à®¾à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_gnutls.c:50 ../libnm-util/crypto_gnutls.c:50
+#: ../libnm-core/crypto_gnutls.c:51 ../libnm-util/crypto_gnutls.c:51
msgid "Failed to initialize the crypto engine."
msgstr "crypto எனà¯à®œà®¿à®©à¯ˆà®¤à¯ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_gnutls.c:92 ../libnm-util/crypto_gnutls.c:92
-#, c-format
-msgid "Failed to initialize the MD5 engine: %s / %s."
-msgstr "MD5 எனà¯à®œà®¿à®©à¯ˆà®¤à¯ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s / %s."
-
-#: ../libnm-core/crypto_gnutls.c:159 ../libnm-util/crypto_gnutls.c:158
+#: ../libnm-core/crypto_gnutls.c:101 ../libnm-util/crypto_gnutls.c:154
#, c-format
msgid "Invalid IV length (must be at least %zd)."
msgstr "தவறான IV நீளம௠( %zdவத௠இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯)."
-#: ../libnm-core/crypto_gnutls.c:170 ../libnm-util/crypto_gnutls.c:169
+#: ../libnm-core/crypto_gnutls.c:112 ../libnm-util/crypto_gnutls.c:165
#, c-format
msgid "Failed to initialize the decryption cipher context: %s / %s."
msgstr "cipher சேரà¯à®¤à¯à®¤à¯ மறைகà¯à®±à®¿à®®à¯à®±à¯ˆ நீகà¯à®•à®¤à¯à®¤à¯ˆ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:179 ../libnm-util/crypto_gnutls.c:178
+#: ../libnm-core/crypto_gnutls.c:121 ../libnm-util/crypto_gnutls.c:174
#, c-format
msgid "Failed to set symmetric key for decryption: %s / %s."
msgstr "மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¨à¯€à®•à¯à®•à®¤à¯à®¤à®¿à®±à¯à®•à®¾à®© ஒதà¯à®¤ விசையை அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ.: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:188 ../libnm-util/crypto_gnutls.c:187
+#: ../libnm-core/crypto_gnutls.c:130 ../libnm-util/crypto_gnutls.c:183
#, c-format
msgid "Failed to set IV for decryption: %s / %s."
msgstr "IV கான மறைகà¯à®±à®¿à®®à¯à®±à¯ˆ நீகà¯à®•à®¤à¯à®¤à¯ˆ அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:197 ../libnm-util/crypto_gnutls.c:196
+#: ../libnm-core/crypto_gnutls.c:139 ../libnm-util/crypto_gnutls.c:192
#, c-format
msgid "Failed to decrypt the private key: %s / %s."
msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசைகà¯à®•à¯ மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à¯ˆ நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:207 ../libnm-core/crypto_nss.c:261
-#: ../libnm-util/crypto_gnutls.c:206 ../libnm-util/crypto_nss.c:260
+#: ../libnm-core/crypto_gnutls.c:149 ../libnm-core/crypto_nss.c:205
+#: ../libnm-util/crypto_gnutls.c:202 ../libnm-util/crypto_nss.c:255
#, c-format
msgid "Failed to decrypt the private key: unexpected padding length."
msgstr ""
"தனிபà¯à®ªà®Ÿà¯à®Ÿ விசைகà¯à®•à¯ மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à¯ˆ நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: எதிரà¯à®ªà®¾à®°à®¾à®¤ பாடிங௠நீளமà¯."
-#: ../libnm-core/crypto_gnutls.c:218 ../libnm-core/crypto_nss.c:272
-#: ../libnm-util/crypto_gnutls.c:217 ../libnm-util/crypto_nss.c:271
+#: ../libnm-core/crypto_gnutls.c:160 ../libnm-core/crypto_nss.c:216
+#: ../libnm-util/crypto_gnutls.c:213 ../libnm-util/crypto_nss.c:266
#, c-format
msgid "Failed to decrypt the private key."
msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசைகà¯à®•à¯ மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à¯ˆ நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_gnutls.c:291 ../libnm-util/crypto_gnutls.c:289
+#: ../libnm-core/crypto_gnutls.c:236 ../libnm-util/crypto_gnutls.c:285
#, c-format
msgid "Failed to initialize the encryption cipher context: %s / %s."
msgstr "cipher சேரà¯à®¤à¯à®¤à¯ மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®¤à¯à®¤à¯ˆ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:300 ../libnm-util/crypto_gnutls.c:298
+#: ../libnm-core/crypto_gnutls.c:245 ../libnm-util/crypto_gnutls.c:294
#, c-format
msgid "Failed to set symmetric key for encryption: %s / %s."
msgstr "மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®¤à¯à®¤à®¿à®±à¯à®•à®¾à®© ஒதà¯à®¤ விசையை அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ.: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:310 ../libnm-util/crypto_gnutls.c:308
+#: ../libnm-core/crypto_gnutls.c:255 ../libnm-util/crypto_gnutls.c:304
#, c-format
msgid "Failed to set IV for encryption: %s / %s."
msgstr "IV கான மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®¤à¯à®¤à¯ˆ அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:319 ../libnm-util/crypto_gnutls.c:317
+#: ../libnm-core/crypto_gnutls.c:264 ../libnm-util/crypto_gnutls.c:313
#, c-format
msgid "Failed to encrypt the data: %s / %s."
msgstr "தரவை மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s / %s."
-#: ../libnm-core/crypto_gnutls.c:359 ../libnm-util/crypto_gnutls.c:357
+#: ../libnm-core/crypto_gnutls.c:307 ../libnm-util/crypto_gnutls.c:353
#, c-format
msgid "Error initializing certificate data: %s"
msgstr "சானà¯à®±à®¿à®¤à®´à¯ தரவை தà¯à®µà®•à¯à®•à¯à®µà®¤à®¿à®²à¯ பிழை: %s"
-#: ../libnm-core/crypto_gnutls.c:381 ../libnm-util/crypto_gnutls.c:379
+#: ../libnm-core/crypto_gnutls.c:329 ../libnm-util/crypto_gnutls.c:375
#, c-format
msgid "Couldn't decode certificate: %s"
msgstr "சானà¯à®±à®¿à®¤à®´à¯ˆ கà¯à®±à®¿à®¯à®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../libnm-core/crypto_gnutls.c:406 ../libnm-util/crypto_gnutls.c:403
+#: ../libnm-core/crypto_gnutls.c:357 ../libnm-util/crypto_gnutls.c:399
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %s"
msgstr "PKCS#12 கà¯à®±à®¿à®¯à®¾à®³à®°à¯ˆ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../libnm-core/crypto_gnutls.c:419 ../libnm-util/crypto_gnutls.c:416
+#: ../libnm-core/crypto_gnutls.c:370 ../libnm-util/crypto_gnutls.c:412
#, c-format
msgid "Couldn't decode PKCS#12 file: %s"
msgstr "PKCS#12 கோபà¯à®ªà¯ˆ கà¯à®±à®¿à®¯à®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../libnm-core/crypto_gnutls.c:431 ../libnm-util/crypto_gnutls.c:428
+#: ../libnm-core/crypto_gnutls.c:382 ../libnm-util/crypto_gnutls.c:424
#, c-format
msgid "Couldn't verify PKCS#12 file: %s"
msgstr "PKCS#12 கோபà¯à®ªà¯ˆ சரிபாரà¯à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../libnm-core/crypto_gnutls.c:460 ../libnm-util/crypto_gnutls.c:456
+#: ../libnm-core/crypto_gnutls.c:414 ../libnm-util/crypto_gnutls.c:452
#, c-format
msgid "Couldn't initialize PKCS#8 decoder: %s"
msgstr "PKCS#8 டீகோடரைத௠தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../libnm-core/crypto_gnutls.c:483 ../libnm-util/crypto_gnutls.c:479
+#: ../libnm-core/crypto_gnutls.c:437 ../libnm-util/crypto_gnutls.c:475
#, c-format
msgid "Couldn't decode PKCS#8 file: %s"
msgstr "PKCS#8 கோபà¯à®ªà¯ˆ கà¯à®±à®¿à®¨à¯€à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#: ../libnm-core/crypto_nss.c:56 ../libnm-util/crypto_nss.c:56
+#: ../libnm-core/crypto_nss.c:57 ../libnm-util/crypto_nss.c:56
#, c-format
msgid "Failed to initialize the crypto engine: %d."
msgstr "crypto எனà¯à®œà®¿à®©à¯ˆà®¤à¯ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d."
-#: ../libnm-core/crypto_nss.c:107 ../libnm-util/crypto_nss.c:107
-#, c-format
-msgid "Failed to initialize the MD5 context: %d."
-msgstr "MD5 உரையை தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d."
-
-#: ../libnm-core/crypto_nss.c:179 ../libnm-util/crypto_nss.c:178
+#: ../libnm-core/crypto_nss.c:123 ../libnm-util/crypto_nss.c:173
#, c-format
msgid "Invalid IV length (must be at least %d)."
msgstr "தவறான IV நீளம௠(%dயாவத௠இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯)."
-#: ../libnm-core/crypto_nss.c:190 ../libnm-util/crypto_nss.c:189
+#: ../libnm-core/crypto_nss.c:134 ../libnm-util/crypto_nss.c:184
#, c-format
msgid "Failed to initialize the decryption cipher slot."
msgstr "மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à¯ˆ நீகà¯à®• cipher வரிசையை தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_nss.c:200 ../libnm-util/crypto_nss.c:199
+#: ../libnm-core/crypto_nss.c:144 ../libnm-util/crypto_nss.c:194
#, c-format
msgid "Failed to set symmetric key for decryption."
msgstr "மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¨à¯€à®•à¯à®•à®¤à¯à®¤à®¿à®±à¯à®•à®¾à®© ஒதà¯à®¤ விசையை அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_nss.c:210 ../libnm-util/crypto_nss.c:209
+#: ../libnm-core/crypto_nss.c:154 ../libnm-util/crypto_nss.c:204
#, c-format
msgid "Failed to set IV for decryption."
msgstr "IV கான மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à¯ˆ அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_nss.c:218 ../libnm-util/crypto_nss.c:217
+#: ../libnm-core/crypto_nss.c:162 ../libnm-util/crypto_nss.c:212
#, c-format
msgid "Failed to initialize the decryption context."
msgstr "மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¨à¯€à®•à¯à®•à®¤à¯à®¤à¯ˆ சேரà¯à®¤à¯à®¤à¯ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_nss.c:231 ../libnm-util/crypto_nss.c:230
+#: ../libnm-core/crypto_nss.c:175 ../libnm-util/crypto_nss.c:225
#, c-format
msgid "Failed to decrypt the private key: %d."
msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசையின௠மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à¯ˆ நீகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d."
-#: ../libnm-core/crypto_nss.c:239 ../libnm-util/crypto_nss.c:238
+#: ../libnm-core/crypto_nss.c:183 ../libnm-util/crypto_nss.c:233
#, c-format
msgid "Failed to decrypt the private key: decrypted data too large."
msgstr ""
@@ -6439,333 +7082,361 @@ msgstr ""
"தரவ௠மிக "
"நீளமானதà¯."
-#: ../libnm-core/crypto_nss.c:250 ../libnm-util/crypto_nss.c:249
+#: ../libnm-core/crypto_nss.c:194 ../libnm-util/crypto_nss.c:244
#, c-format
msgid "Failed to finalize decryption of the private key: %d."
msgstr "தனிபà¯à®ªà®Ÿà¯à®Ÿ விசையின௠மறைகà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à¯ˆ à®®à¯à®Ÿà®¿ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d."
-#: ../libnm-core/crypto_nss.c:355 ../libnm-util/crypto_nss.c:353
+#: ../libnm-core/crypto_nss.c:302 ../libnm-util/crypto_nss.c:348
#, c-format
msgid "Failed to initialize the encryption cipher slot."
msgstr "மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®• cipher வரிசையை தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_nss.c:363 ../libnm-util/crypto_nss.c:361
+#: ../libnm-core/crypto_nss.c:310 ../libnm-util/crypto_nss.c:356
#, c-format
msgid "Failed to set symmetric key for encryption."
msgstr "மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®¤à¯à®¤à®¿à®±à¯à®•à®¾à®© ஒதà¯à®¤ விசையை அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_nss.c:371 ../libnm-util/crypto_nss.c:369
+#: ../libnm-core/crypto_nss.c:318 ../libnm-util/crypto_nss.c:364
#, c-format
msgid "Failed to set IV for encryption."
msgstr "IV கான மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®¤à¯à®¤à¯ˆ அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_nss.c:379 ../libnm-util/crypto_nss.c:377
+#: ../libnm-core/crypto_nss.c:326 ../libnm-util/crypto_nss.c:372
#, c-format
msgid "Failed to initialize the encryption context."
msgstr "மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®• சேரà¯à®¤à¯à®¤à¯ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/crypto_nss.c:387 ../libnm-util/crypto_nss.c:385
+#: ../libnm-core/crypto_nss.c:334 ../libnm-util/crypto_nss.c:380
#, c-format
msgid "Failed to encrypt: %d."
msgstr "மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d."
-#: ../libnm-core/crypto_nss.c:395 ../libnm-util/crypto_nss.c:393
+#: ../libnm-core/crypto_nss.c:342 ../libnm-util/crypto_nss.c:388
#, c-format
msgid "Unexpected amount of data after encrypting."
msgstr "மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®¤à¯à®¤à®¿à®±à¯à®•à¯à®ªà¯ பின௠எதிரà¯à®ªà®¾à®°à®¾à®¤ தரவின௠எணà¯à®£à®¿à®•à¯à®•à¯ˆ."
-#: ../libnm-core/crypto_nss.c:435 ../libnm-util/crypto_nss.c:433
+#: ../libnm-core/crypto_nss.c:385 ../libnm-util/crypto_nss.c:428
#, c-format
msgid "Couldn't decode certificate: %d"
msgstr "சானà¯à®±à®¿à®¤à®´à¯ˆ கà¯à®±à®¿à®¯à®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d"
-#: ../libnm-core/crypto_nss.c:471 ../libnm-util/crypto_nss.c:468
+#: ../libnm-core/crypto_nss.c:423
#, c-format
-msgid "Couldn't convert password to UCS2: %d"
-msgstr "கடவà¯à®šà¯à®šà¯Šà®²à¯à®²à¯ˆ UCS2கà¯à®•à¯ மாறà¯à®± à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d"
+msgid "Password must be UTF-8"
+msgstr "கடவà¯à®šà¯à®šà¯Šà®²à¯à®²à®¾à®©à®¤à¯ UTF-8 கà¯à®±à®¿à®¯à¯€à®Ÿà®¾à®•à¯à®•à®¤à¯à®¤à¯ˆà®•à¯ கொணà¯à®Ÿà®¿à®°à¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯"
-#: ../libnm-core/crypto_nss.c:499 ../libnm-util/crypto_nss.c:496
+#: ../libnm-core/crypto_nss.c:453 ../libnm-util/crypto_nss.c:491
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %d"
msgstr "PKCS#12 கà¯à®±à®¿à®¯à®¾à®•à¯à®•à®¤à¯à®¤à¯ˆ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d"
-#: ../libnm-core/crypto_nss.c:508 ../libnm-util/crypto_nss.c:505
+#: ../libnm-core/crypto_nss.c:462 ../libnm-util/crypto_nss.c:500
#, c-format
msgid "Couldn't decode PKCS#12 file: %d"
msgstr "PKCS#12 கோபà¯à®ªà¯ˆ கà¯à®±à®¿à®¯à®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d"
-#: ../libnm-core/crypto_nss.c:517 ../libnm-util/crypto_nss.c:514
+#: ../libnm-core/crypto_nss.c:471 ../libnm-util/crypto_nss.c:509
#, c-format
msgid "Couldn't verify PKCS#12 file: %d"
msgstr "PKCS#12 கோபà¯à®ªà¯ˆ சரிபாரà¯à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d"
-#: ../libnm-core/crypto_nss.c:562 ../libnm-util/crypto_nss.c:558
+#: ../libnm-core/crypto_nss.c:522 ../libnm-util/crypto_nss.c:553
msgid "Could not generate random data."
msgstr "தறà¯à®šà¯†à®¯à®²à®¾à®© தரவை உரà¯à®µà®¾à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ."
-#: ../libnm-core/nm-connection.c:892
+#: ../libnm-core/nm-connection.c:225
+#| msgid "property type should be set to '%s'"
+msgid "wrong type; should be a list of strings."
+msgstr "தவறான வகை; வகையானத௠சரஙà¯à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à®¾à®•à®µà¯‡ இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯."
+
+#: ../libnm-core/nm-connection.c:280
+#| msgid "Error: unknown setting '%s'\n"
+msgid "unknown setting name"
+msgstr "தெரியாத அமைவà¯à®ªà¯ பெயரà¯"
+
+#: ../libnm-core/nm-connection.c:781
+msgid "setting not found"
+msgstr "அமைவ௠இலà¯à®²à¯ˆ"
+
+#: ../libnm-core/nm-connection.c:845
+#| msgid "Error: '%s' setting not present in the connection\n"
+msgid "setting not allowed in slave connection"
+msgstr "அடிமை இணைபà¯à®ªà®¿à®²à¯ அமைவà¯à®•à¯à®•à¯ அனà¯à®®à®¤à®¿ இலà¯à®²à¯ˆ"
+
+#: ../libnm-core/nm-connection.c:856
+#| msgid "'%s' setting is required for the connection when the property is set"
+msgid "setting is required for non-slave connections"
+msgstr "அடிமையலà¯à®²à®¾à®¤ இணைபà¯à®ªà¯à®•à®³à¯à®•à¯à®•à¯ அமைவ௠தேவை"
+
+#: ../libnm-core/nm-connection.c:922
msgid "Unexpected failure to verify the connection"
msgstr "இணைபà¯à®ªà¯ˆ சரிபாரà¯à®ªà¯à®ªà®¤à®¿à®²à¯ எதிரà¯à®ªà®¾à®°à®¾à®¤ தோலà¯à®µà®¿"
-#: ../libnm-core/nm-connection.c:923
+#: ../libnm-core/nm-connection.c:954
msgid "Unexpected failure to normalize the connection"
msgstr "இணைபà¯à®ªà¯ˆ இயலà¯à®ªà®®à¯ˆà®ªà¯à®ªà®¤à®¿à®²à¯ எதிரà¯à®ªà®¾à®°à®¾à®¤ தோலà¯à®µà®¿"
-#: ../libnm-core/nm-connection.c:1016
-msgid ""
-"Update secrets expects a full connection, instead only a setting is provided."
-msgstr ""
-"இரகசியஙà¯à®•à®³à¯ˆà®ªà¯ பà¯à®¤à¯à®ªà¯à®ªà®¿à®•à¯à®• à®®à¯à®´à¯ இணைபà¯à®ªà¯ எதிரà¯à®ªà®¾à®°à¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯, ஆனால௠ஒர௠"
-"அமைவ௠மடà¯à®Ÿà¯à®®à¯‡ வழஙà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯."
+#: ../libnm-core/nm-connection.c:1418 ../libnm-core/nm-setting-8021x.c:2273
+#: ../libnm-core/nm-setting-8021x.c:2290 ../libnm-core/nm-setting-8021x.c:2321
+#: ../libnm-core/nm-setting-8021x.c:2338 ../libnm-core/nm-setting-8021x.c:2380
+#: ../libnm-core/nm-setting-8021x.c:2392 ../libnm-core/nm-setting-8021x.c:2410
+#: ../libnm-core/nm-setting-8021x.c:2422 ../libnm-core/nm-setting-8021x.c:2446
+#: ../libnm-core/nm-setting-8021x.c:2628 ../libnm-core/nm-setting-adsl.c:190
+#: ../libnm-core/nm-setting-bluetooth.c:121
+#: ../libnm-core/nm-setting-bluetooth.c:139
+#: ../libnm-core/nm-setting-cdma.c:142
+#: ../libnm-core/nm-setting-connection.c:768
+#: ../libnm-core/nm-setting-connection.c:807
+#: ../libnm-core/nm-setting-connection.c:908
+#: ../libnm-core/nm-setting-ip-config.c:1837
+#: ../libnm-core/nm-setting-olpc-mesh.c:113
+#: ../libnm-core/nm-setting-pppoe.c:143 ../libnm-core/nm-setting-vpn.c:400
+#: ../libnm-core/nm-setting-wimax.c:117
+#: ../libnm-core/nm-setting-wireless-security.c:862
+#: ../libnm-core/nm-setting-wireless.c:694 ../libnm-util/nm-setting.c:1366
+#: ../libnm-util/nm-setting.c:1385 ../libnm-util/nm-setting.c:1403
+#: ../libnm-util/nm-setting-8021x.c:2284 ../libnm-util/nm-setting-8021x.c:2301
+#: ../libnm-util/nm-setting-8021x.c:2342 ../libnm-util/nm-setting-8021x.c:2359
+#: ../libnm-util/nm-setting-8021x.c:2411 ../libnm-util/nm-setting-8021x.c:2423
+#: ../libnm-util/nm-setting-8021x.c:2441 ../libnm-util/nm-setting-8021x.c:2453
+#: ../libnm-util/nm-setting-8021x.c:2477 ../libnm-util/nm-setting-8021x.c:2655
+#: ../libnm-util/nm-setting-adsl.c:210
+#: ../libnm-util/nm-setting-bluetooth.c:142
+#: ../libnm-util/nm-setting-bluetooth.c:160
+#: ../libnm-util/nm-setting-cdma.c:163
+#: ../libnm-util/nm-setting-connection.c:769
+#: ../libnm-util/nm-setting-connection.c:785
+#: ../libnm-util/nm-setting-connection.c:846
+#: ../libnm-util/nm-setting-ip4-config.c:852
+#: ../libnm-util/nm-setting-ip6-config.c:833
+#: ../libnm-util/nm-setting-ip6-config.c:897
+#: ../libnm-util/nm-setting-olpc-mesh.c:124
+#: ../libnm-util/nm-setting-pppoe.c:164 ../libnm-util/nm-setting-vpn.c:424
+#: ../libnm-util/nm-setting-wimax.c:139
+#: ../libnm-util/nm-setting-wireless-security.c:892
+#: ../libnm-util/nm-setting-wireless.c:752
+msgid "property is missing"
+msgstr "பணà¯à®ªà¯ விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯"
-#: ../libnm-core/nm-setting-8021x.c:593 ../libnm-util/nm-setting-8021x.c:596
+#: ../libnm-core/nm-setting-8021x.c:579 ../libnm-util/nm-setting-8021x.c:598
msgid "CA certificate must be in X.509 format"
msgstr "CA சானà¯à®±à®¿à®¤à®´à¯ X.509 வடிவமைபà¯à®ªà®¿à®²à¯‡à®¯à¯‡ இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯"
-#: ../libnm-core/nm-setting-8021x.c:908 ../libnm-core/nm-setting-8021x.c:1172
-#: ../libnm-core/nm-setting-8021x.c:1492 ../libnm-util/nm-setting-8021x.c:914
-#: ../libnm-util/nm-setting-8021x.c:1177 ../libnm-util/nm-setting-8021x.c:1500
+#: ../libnm-core/nm-setting-8021x.c:894 ../libnm-core/nm-setting-8021x.c:1158
+#: ../libnm-core/nm-setting-8021x.c:1478 ../libnm-util/nm-setting-8021x.c:916
+#: ../libnm-util/nm-setting-8021x.c:1179 ../libnm-util/nm-setting-8021x.c:1502
msgid "invalid certificate format"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ சானà¯à®±à®¿à®¤à®´à¯ வடிவமைபà¯à®ªà¯"
-#: ../libnm-core/nm-setting-8021x.c:1774 ../libnm-util/nm-setting-8021x.c:1769
+#: ../libnm-core/nm-setting-8021x.c:1761 ../libnm-util/nm-setting-8021x.c:1771
msgid "invalid private key"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ தனிபà¯à®ªà®Ÿà¯à®Ÿ விசை"
-#: ../libnm-core/nm-setting-8021x.c:2084 ../libnm-util/nm-setting-8021x.c:2080
+#: ../libnm-core/nm-setting-8021x.c:2071 ../libnm-util/nm-setting-8021x.c:2082
msgid "invalid phase2 private key"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ phase2 தனிபà¯à®ªà®Ÿà¯à®Ÿ விசை"
-#: ../libnm-core/nm-setting-8021x.c:2286 ../libnm-core/nm-setting-8021x.c:2303
-#: ../libnm-core/nm-setting-8021x.c:2333 ../libnm-core/nm-setting-8021x.c:2350
-#: ../libnm-core/nm-setting-8021x.c:2391 ../libnm-core/nm-setting-8021x.c:2403
-#: ../libnm-core/nm-setting-8021x.c:2421 ../libnm-core/nm-setting-8021x.c:2433
-#: ../libnm-core/nm-setting-8021x.c:2457 ../libnm-core/nm-setting-8021x.c:2639
-#: ../libnm-core/nm-setting-adsl.c:204
-#: ../libnm-core/nm-setting-bluetooth.c:136
-#: ../libnm-core/nm-setting-bluetooth.c:154
-#: ../libnm-core/nm-setting-cdma.c:157
-#: ../libnm-core/nm-setting-connection.c:761
-#: ../libnm-core/nm-setting-connection.c:777
-#: ../libnm-core/nm-setting-connection.c:807
-#: ../libnm-core/nm-setting-ip4-config.c:897
-#: ../libnm-core/nm-setting-ip6-config.c:815
-#: ../libnm-core/nm-setting-ip6-config.c:879
-#: ../libnm-core/nm-setting-olpc-mesh.c:116
-#: ../libnm-core/nm-setting-pppoe.c:158 ../libnm-core/nm-setting-vpn.c:396
-#: ../libnm-core/nm-setting-wimax.c:133
-#: ../libnm-core/nm-setting-wireless-security.c:878
-#: ../libnm-core/nm-setting-wireless.c:710 ../libnm-core/nm-setting.c:1731
-#: ../libnm-util/nm-setting.c:1279 ../libnm-util/nm-setting.c:1298
-#: ../libnm-util/nm-setting.c:1316 ../libnm-util/nm-setting-8021x.c:2282
-#: ../libnm-util/nm-setting-8021x.c:2299 ../libnm-util/nm-setting-8021x.c:2340
-#: ../libnm-util/nm-setting-8021x.c:2357 ../libnm-util/nm-setting-8021x.c:2409
-#: ../libnm-util/nm-setting-8021x.c:2421 ../libnm-util/nm-setting-8021x.c:2439
-#: ../libnm-util/nm-setting-8021x.c:2451 ../libnm-util/nm-setting-8021x.c:2475
-#: ../libnm-util/nm-setting-8021x.c:2653 ../libnm-util/nm-setting-adsl.c:208
-#: ../libnm-util/nm-setting-bluetooth.c:140
-#: ../libnm-util/nm-setting-bluetooth.c:158
-#: ../libnm-util/nm-setting-cdma.c:161
-#: ../libnm-util/nm-setting-connection.c:767
-#: ../libnm-util/nm-setting-connection.c:783
-#: ../libnm-util/nm-setting-connection.c:844
-#: ../libnm-util/nm-setting-ip4-config.c:828
-#: ../libnm-util/nm-setting-ip6-config.c:809
-#: ../libnm-util/nm-setting-ip6-config.c:873
-#: ../libnm-util/nm-setting-olpc-mesh.c:122
-#: ../libnm-util/nm-setting-pppoe.c:162 ../libnm-util/nm-setting-vpn.c:402
-#: ../libnm-util/nm-setting-wimax.c:137
-#: ../libnm-util/nm-setting-wireless-security.c:891
-#: ../libnm-util/nm-setting-wireless.c:750
-msgid "property is missing"
-msgstr "பணà¯à®ªà¯ விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯"
-
-#: ../libnm-core/nm-setting-8021x.c:2293 ../libnm-core/nm-setting-8021x.c:2310
-#: ../libnm-core/nm-setting-8021x.c:2340 ../libnm-core/nm-setting-8021x.c:2357
-#: ../libnm-core/nm-setting-8021x.c:2397 ../libnm-core/nm-setting-8021x.c:2409
-#: ../libnm-core/nm-setting-8021x.c:2427 ../libnm-core/nm-setting-8021x.c:2439
-#: ../libnm-core/nm-setting-8021x.c:2464 ../libnm-core/nm-setting-adsl.c:211
-#: ../libnm-core/nm-setting-adsl.c:220 ../libnm-core/nm-setting-cdma.c:173
-#: ../libnm-core/nm-setting-cdma.c:182
-#: ../libnm-core/nm-setting-connection.c:768
+#: ../libnm-core/nm-setting-8021x.c:2280 ../libnm-core/nm-setting-8021x.c:2297
+#: ../libnm-core/nm-setting-8021x.c:2328 ../libnm-core/nm-setting-8021x.c:2345
+#: ../libnm-core/nm-setting-8021x.c:2386 ../libnm-core/nm-setting-8021x.c:2398
+#: ../libnm-core/nm-setting-8021x.c:2416 ../libnm-core/nm-setting-8021x.c:2428
+#: ../libnm-core/nm-setting-8021x.c:2453 ../libnm-core/nm-setting-adsl.c:197
+#: ../libnm-core/nm-setting-adsl.c:206 ../libnm-core/nm-setting-cdma.c:158
+#: ../libnm-core/nm-setting-cdma.c:167
+#: ../libnm-core/nm-setting-connection.c:775
#: ../libnm-core/nm-setting-connection.c:818
-#: ../libnm-core/nm-setting-gsm.c:241 ../libnm-core/nm-setting-gsm.c:298
-#: ../libnm-core/nm-setting-gsm.c:307
-#: ../libnm-core/nm-setting-ip4-config.c:962
-#: ../libnm-core/nm-setting-ip4-config.c:971
-#: ../libnm-core/nm-setting-pppoe.c:165 ../libnm-core/nm-setting-pppoe.c:174
-#: ../libnm-core/nm-setting-vpn.c:405 ../libnm-core/nm-setting-vpn.c:415
-#: ../libnm-core/nm-setting-wimax.c:142
-#: ../libnm-core/nm-setting-wireless-security.c:908
-#: ../libnm-core/nm-setting-wireless-security.c:916
-#: ../libnm-core/nm-setting-wireless-security.c:940
-#: ../libnm-util/nm-setting-8021x.c:2289 ../libnm-util/nm-setting-8021x.c:2306
-#: ../libnm-util/nm-setting-8021x.c:2347 ../libnm-util/nm-setting-8021x.c:2364
-#: ../libnm-util/nm-setting-8021x.c:2415 ../libnm-util/nm-setting-8021x.c:2427
-#: ../libnm-util/nm-setting-8021x.c:2445 ../libnm-util/nm-setting-8021x.c:2457
-#: ../libnm-util/nm-setting-8021x.c:2482 ../libnm-util/nm-setting-adsl.c:215
-#: ../libnm-util/nm-setting-adsl.c:224 ../libnm-util/nm-setting-cdma.c:177
-#: ../libnm-util/nm-setting-cdma.c:186
-#: ../libnm-util/nm-setting-connection.c:774
-#: ../libnm-util/nm-setting-connection.c:851
-#: ../libnm-util/nm-setting-gsm.c:281 ../libnm-util/nm-setting-gsm.c:338
-#: ../libnm-util/nm-setting-gsm.c:347
-#: ../libnm-util/nm-setting-ip4-config.c:893
-#: ../libnm-util/nm-setting-ip4-config.c:902
-#: ../libnm-util/nm-setting-pppoe.c:169 ../libnm-util/nm-setting-pppoe.c:178
-#: ../libnm-util/nm-setting-vpn.c:411 ../libnm-util/nm-setting-vpn.c:421
-#: ../libnm-util/nm-setting-wimax.c:146
-#: ../libnm-util/nm-setting-wireless-security.c:921
-#: ../libnm-util/nm-setting-wireless-security.c:929
-#: ../libnm-util/nm-setting-wireless-security.c:953
+#: ../libnm-core/nm-setting-gsm.c:226 ../libnm-core/nm-setting-gsm.c:283
+#: ../libnm-core/nm-setting-gsm.c:292
+#: ../libnm-core/nm-setting-ip-config.c:1844
+#: ../libnm-core/nm-setting-ip4-config.c:178
+#: ../libnm-core/nm-setting-pppoe.c:150 ../libnm-core/nm-setting-pppoe.c:159
+#: ../libnm-core/nm-setting-vpn.c:409 ../libnm-core/nm-setting-vpn.c:419
+#: ../libnm-core/nm-setting-wimax.c:126
+#: ../libnm-core/nm-setting-wireless-security.c:892
+#: ../libnm-core/nm-setting-wireless-security.c:900
+#: ../libnm-core/nm-setting-wireless-security.c:924
+#: ../libnm-util/nm-setting-8021x.c:2291 ../libnm-util/nm-setting-8021x.c:2308
+#: ../libnm-util/nm-setting-8021x.c:2349 ../libnm-util/nm-setting-8021x.c:2366
+#: ../libnm-util/nm-setting-8021x.c:2417 ../libnm-util/nm-setting-8021x.c:2429
+#: ../libnm-util/nm-setting-8021x.c:2447 ../libnm-util/nm-setting-8021x.c:2459
+#: ../libnm-util/nm-setting-8021x.c:2484 ../libnm-util/nm-setting-adsl.c:217
+#: ../libnm-util/nm-setting-adsl.c:226 ../libnm-util/nm-setting-cdma.c:179
+#: ../libnm-util/nm-setting-cdma.c:188
+#: ../libnm-util/nm-setting-connection.c:776
+#: ../libnm-util/nm-setting-connection.c:853
+#: ../libnm-util/nm-setting-gsm.c:283 ../libnm-util/nm-setting-gsm.c:340
+#: ../libnm-util/nm-setting-gsm.c:349
+#: ../libnm-util/nm-setting-ip4-config.c:917
+#: ../libnm-util/nm-setting-ip4-config.c:926
+#: ../libnm-util/nm-setting-pppoe.c:171 ../libnm-util/nm-setting-pppoe.c:180
+#: ../libnm-util/nm-setting-vpn.c:433 ../libnm-util/nm-setting-vpn.c:443
+#: ../libnm-util/nm-setting-wimax.c:148
+#: ../libnm-util/nm-setting-wireless-security.c:922
+#: ../libnm-util/nm-setting-wireless-security.c:930
+#: ../libnm-util/nm-setting-wireless-security.c:954
msgid "property is empty"
msgstr "பணà¯à®ªà¯ காலியாக உளà¯à®³à®¤à¯"
-#: ../libnm-core/nm-setting-8021x.c:2322 ../libnm-core/nm-setting-8021x.c:2369
-#: ../libnm-util/nm-setting-8021x.c:2317 ../libnm-util/nm-setting-8021x.c:2329
-#: ../libnm-util/nm-setting-8021x.c:2375 ../libnm-util/nm-setting-8021x.c:2387
+#: ../libnm-core/nm-setting-8021x.c:2310 ../libnm-core/nm-setting-8021x.c:2358
+#: ../libnm-util/nm-setting-8021x.c:2319 ../libnm-util/nm-setting-8021x.c:2331
+#: ../libnm-util/nm-setting-8021x.c:2377 ../libnm-util/nm-setting-8021x.c:2389
#, c-format
msgid "has to match '%s' property for PKCS#12"
msgstr "PKCS#12 கà¯à®•à¯ '%s' பணà¯à®ªà¯à®•à¯à®•à¯ பொரà¯à®¨à¯à®¤ வேணà¯à®Ÿà¯à®®à¯"
-#: ../libnm-core/nm-setting-8021x.c:2614 ../libnm-core/nm-setting-8021x.c:2648
-#: ../libnm-core/nm-setting-bluetooth.c:145
+#: ../libnm-core/nm-setting-8021x.c:2603 ../libnm-core/nm-setting-8021x.c:2637
+#: ../libnm-core/nm-setting-bluetooth.c:130
+#: ../libnm-core/nm-setting-infiniband.c:193
#: ../libnm-core/nm-setting-infiniband.c:208
-#: ../libnm-core/nm-setting-infiniband.c:223
-#: ../libnm-core/nm-setting-ip4-config.c:953
-#: ../libnm-core/nm-setting-ip6-config.c:870
-#: ../libnm-core/nm-setting-olpc-mesh.c:145
-#: ../libnm-core/nm-setting-wimax.c:151 ../libnm-core/nm-setting-wired.c:636
-#: ../libnm-core/nm-setting-wired.c:646
-#: ../libnm-core/nm-setting-wireless-security.c:959
+#: ../libnm-core/nm-setting-ip4-config.c:169
+#: ../libnm-core/nm-setting-ip6-config.c:166
+#: ../libnm-core/nm-setting-olpc-mesh.c:142
+#: ../libnm-core/nm-setting-wimax.c:135 ../libnm-core/nm-setting-wired.c:621
+#: ../libnm-core/nm-setting-wired.c:631
+#: ../libnm-core/nm-setting-wireless-security.c:943
+#: ../libnm-core/nm-setting-wireless-security.c:952
+#: ../libnm-core/nm-setting-wireless-security.c:960
#: ../libnm-core/nm-setting-wireless-security.c:968
#: ../libnm-core/nm-setting-wireless-security.c:976
-#: ../libnm-core/nm-setting-wireless-security.c:984
-#: ../libnm-core/nm-setting-wireless-security.c:992
-#: ../libnm-core/nm-setting-wireless-security.c:1001
-#: ../libnm-core/nm-setting-wireless-security.c:1010
-#: ../libnm-core/nm-setting-wireless-security.c:1019
-#: ../libnm-core/nm-setting-wireless-security.c:1055
-#: ../libnm-core/nm-setting-wireless-security.c:1065
-#: ../libnm-core/nm-setting-wireless.c:771
-#: ../libnm-core/nm-setting-wireless.c:780
-#: ../libnm-core/nm-setting-wireless.c:789 ../libnm-util/nm-setting.c:1289
-#: ../libnm-util/nm-setting.c:1307 ../libnm-util/nm-setting.c:1326
-#: ../libnm-util/nm-setting-8021x.c:2628 ../libnm-util/nm-setting-8021x.c:2662
-#: ../libnm-util/nm-setting-bluetooth.c:149
-#: ../libnm-util/nm-setting-infiniband.c:204
-#: ../libnm-util/nm-setting-infiniband.c:220
-#: ../libnm-util/nm-setting-ip4-config.c:884
-#: ../libnm-util/nm-setting-ip6-config.c:864
-#: ../libnm-util/nm-setting-olpc-mesh.c:150
-#: ../libnm-util/nm-setting-wimax.c:155 ../libnm-util/nm-setting-wired.c:660
-#: ../libnm-util/nm-setting-wired.c:669
-#: ../libnm-util/nm-setting-wireless-security.c:972
-#: ../libnm-util/nm-setting-wireless-security.c:981
-#: ../libnm-util/nm-setting-wireless-security.c:989
-#: ../libnm-util/nm-setting-wireless-security.c:997
-#: ../libnm-util/nm-setting-wireless-security.c:1005
-#: ../libnm-util/nm-setting-wireless-security.c:1014
-#: ../libnm-util/nm-setting-wireless-security.c:1023
-#: ../libnm-util/nm-setting-wireless-security.c:1032
-#: ../libnm-util/nm-setting-wireless-security.c:1068
-#: ../libnm-util/nm-setting-wireless-security.c:1078
-#: ../libnm-util/nm-setting-wireless.c:810
-#: ../libnm-util/nm-setting-wireless.c:819
-#: ../libnm-util/nm-setting-wireless.c:828
+#: ../libnm-core/nm-setting-wireless-security.c:985
+#: ../libnm-core/nm-setting-wireless-security.c:994
+#: ../libnm-core/nm-setting-wireless-security.c:1003
+#: ../libnm-core/nm-setting-wireless-security.c:1039
+#: ../libnm-core/nm-setting-wireless-security.c:1049
+#: ../libnm-core/nm-setting-wireless.c:755
+#: ../libnm-core/nm-setting-wireless.c:764
+#: ../libnm-core/nm-setting-wireless.c:773 ../libnm-util/nm-setting.c:1376
+#: ../libnm-util/nm-setting.c:1394 ../libnm-util/nm-setting.c:1413
+#: ../libnm-util/nm-setting-8021x.c:2630 ../libnm-util/nm-setting-8021x.c:2664
+#: ../libnm-util/nm-setting-bluetooth.c:151
+#: ../libnm-util/nm-setting-infiniband.c:206
+#: ../libnm-util/nm-setting-infiniband.c:222
+#: ../libnm-util/nm-setting-ip4-config.c:908
+#: ../libnm-util/nm-setting-ip6-config.c:888
+#: ../libnm-util/nm-setting-olpc-mesh.c:152
+#: ../libnm-util/nm-setting-wimax.c:157 ../libnm-util/nm-setting-wired.c:662
+#: ../libnm-util/nm-setting-wired.c:671
+#: ../libnm-util/nm-setting-wireless-security.c:973
+#: ../libnm-util/nm-setting-wireless-security.c:982
+#: ../libnm-util/nm-setting-wireless-security.c:990
+#: ../libnm-util/nm-setting-wireless-security.c:998
+#: ../libnm-util/nm-setting-wireless-security.c:1006
+#: ../libnm-util/nm-setting-wireless-security.c:1015
+#: ../libnm-util/nm-setting-wireless-security.c:1024
+#: ../libnm-util/nm-setting-wireless-security.c:1033
+#: ../libnm-util/nm-setting-wireless-security.c:1069
+#: ../libnm-util/nm-setting-wireless-security.c:1079
+#: ../libnm-util/nm-setting-wireless.c:812
+#: ../libnm-util/nm-setting-wireless.c:821
+#: ../libnm-util/nm-setting-wireless.c:830
msgid "property is invalid"
msgstr "பணà¯à®ªà¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-8021x.c:2673 ../libnm-core/nm-setting-8021x.c:2683
-#: ../libnm-core/nm-setting-8021x.c:2693 ../libnm-core/nm-setting-8021x.c:2703
-#: ../libnm-core/nm-setting-8021x.c:2713 ../libnm-core/nm-setting-adsl.c:232
-#: ../libnm-core/nm-setting-adsl.c:244
-#: ../libnm-core/nm-setting-bluetooth.c:162
-#: ../libnm-core/nm-setting-wireless-security.c:887
-#: ../libnm-util/nm-setting-8021x.c:2687 ../libnm-util/nm-setting-8021x.c:2697
-#: ../libnm-util/nm-setting-8021x.c:2707 ../libnm-util/nm-setting-8021x.c:2717
-#: ../libnm-util/nm-setting-8021x.c:2727 ../libnm-util/nm-setting-adsl.c:236
-#: ../libnm-util/nm-setting-adsl.c:248
-#: ../libnm-util/nm-setting-bluetooth.c:166
-#: ../libnm-util/nm-setting-wireless-security.c:900
+#: ../libnm-core/nm-setting-8021x.c:2662 ../libnm-core/nm-setting-8021x.c:2672
+#: ../libnm-core/nm-setting-8021x.c:2682 ../libnm-core/nm-setting-8021x.c:2692
+#: ../libnm-core/nm-setting-8021x.c:2702 ../libnm-core/nm-setting-adsl.c:218
+#: ../libnm-core/nm-setting-adsl.c:230
+#: ../libnm-core/nm-setting-bluetooth.c:147
+#: ../libnm-core/nm-setting-wireless-security.c:871
+#: ../libnm-util/nm-setting-8021x.c:2689 ../libnm-util/nm-setting-8021x.c:2699
+#: ../libnm-util/nm-setting-8021x.c:2709 ../libnm-util/nm-setting-8021x.c:2719
+#: ../libnm-util/nm-setting-8021x.c:2729 ../libnm-util/nm-setting-adsl.c:238
+#: ../libnm-util/nm-setting-adsl.c:250
+#: ../libnm-util/nm-setting-bluetooth.c:168
+#: ../libnm-util/nm-setting-wireless-security.c:901
#, c-format
msgid "'%s' is not a valid value for the property"
msgstr "பணà¯à®ªà¯à®•à¯à®•à¯ '%s' ஆனத௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© மதிபà¯à®ªà®²à¯à®²"
-#: ../libnm-core/nm-setting-bluetooth.c:180
-#: ../libnm-util/nm-setting-bluetooth.c:184
+#: ../libnm-core/nm-setting-bluetooth.c:169
#, c-format
-msgid "requires '%s' or '%s' setting"
-msgstr "'%s' அலà¯à®²à®¤à¯ '%s' அமைவ௠தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+#| msgid "requires '%s' or '%s' setting"
+msgid "'%s' connection requires '%s' or '%s' setting"
+msgstr "'%s' இணைபà¯à®ªà¯à®•à¯à®•à¯ '%s' அலà¯à®²à®¤à¯ '%s' அமைவ௠தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-#: ../libnm-core/nm-setting-bond.c:473 ../libnm-util/nm-setting-bond.c:498
+#: ../libnm-core/nm-setting-bond.c:462 ../libnm-util/nm-setting-bond.c:503
#, c-format
msgid "invalid option '%s' or its value '%s'"
msgstr "'%s' விரà¯à®ªà¯à®ªà®®à¯ அலà¯à®²à®¤à¯ அதன௠மதிபà¯à®ªà¯ '%s' செலà¯à®²à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-bond.c:492 ../libnm-util/nm-setting-bond.c:517
+#: ../libnm-core/nm-setting-bond.c:481 ../libnm-util/nm-setting-bond.c:522
#, c-format
msgid "only one of '%s' and '%s' can be set"
msgstr "'%s' மறà¯à®±à¯à®®à¯ '%s' இரணà¯à®Ÿà®¿à®²à¯ ஒனà¯à®±à¯ˆ மடà¯à®Ÿà¯à®®à¯‡ அமைகà¯à®•à®²à®¾à®®à¯"
-#: ../libnm-core/nm-setting-bond.c:503 ../libnm-util/nm-setting-bond.c:528
+#: ../libnm-core/nm-setting-bond.c:492 ../libnm-util/nm-setting-bond.c:533
#, c-format
msgid "mandatory option '%s' is missing"
msgstr "அவசியமான விரà¯à®ªà¯à®ªà®®à¯ '%s' விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯"
-#: ../libnm-core/nm-setting-bond.c:512 ../libnm-util/nm-setting-bond.c:537
+#: ../libnm-core/nm-setting-bond.c:501 ../libnm-util/nm-setting-bond.c:542
#, c-format
msgid "'%s' is not a valid value for '%s'"
msgstr "'%s' கà¯à®•à¯ '%s' ஒர௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© மதிபà¯à®ªà®²à¯à®²"
-#: ../libnm-core/nm-setting-bond.c:525 ../libnm-util/nm-setting-bond.c:550
+#: ../libnm-core/nm-setting-bond.c:514 ../libnm-util/nm-setting-bond.c:555
#, c-format
msgid "'%s=%s' is incompatible with '%s > 0'"
msgstr "'%s=%s' ஆனத௠'%s > 0' உடன௠இணகà¯à®•à®®à®¾à®©à®¤à®²à¯à®²"
-#: ../libnm-core/nm-setting-bond.c:538 ../libnm-util/nm-setting-bond.c:563
+#: ../libnm-core/nm-setting-bond.c:527 ../libnm-util/nm-setting-bond.c:568
#, c-format
msgid "'%s' is not a valid interface name for '%s' option"
msgstr "'%s' எனà¯à®ªà®¤à¯ '%s' விரà¯à®ªà¯à®ªà®¤à¯à®¤à®¿à®±à¯à®•à®¾à®© செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இடைமà¯à®•à®ªà¯ பெயரலà¯à®²"
-#: ../libnm-core/nm-setting-bond.c:548 ../libnm-util/nm-setting-bond.c:573
+#: ../libnm-core/nm-setting-bond.c:537 ../libnm-util/nm-setting-bond.c:578
#, c-format
msgid "'%s' option is only valid for '%s=%s'"
msgstr "'%s' விரà¯à®ªà¯à®ªà®®à¯ '%s=%s' கà¯à®•à¯ மடà¯à®Ÿà¯à®®à¯‡ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à¯"
-#: ../libnm-core/nm-setting-bond.c:561 ../libnm-util/nm-setting-bond.c:586
+#: ../libnm-core/nm-setting-bond.c:550 ../libnm-util/nm-setting-bond.c:591
#, c-format
msgid "'%s=%s' is not a valid configuration for '%s'"
msgstr "'%s=%s' ஆனத௠'%s' கà¯à®•à¯ இணகà¯à®•à®®à®¾à®© அமைவாகà¯à®•à®®à®²à¯à®²"
-#: ../libnm-core/nm-setting-bond.c:574 ../libnm-core/nm-setting-bond.c:583
-#: ../libnm-core/nm-setting-bond.c:603 ../libnm-core/nm-setting-bond.c:639
-#: ../libnm-util/nm-setting-bond.c:599 ../libnm-util/nm-setting-bond.c:608
-#: ../libnm-util/nm-setting-bond.c:628 ../libnm-util/nm-setting-bond.c:664
+#: ../libnm-core/nm-setting-bond.c:563 ../libnm-core/nm-setting-bond.c:572
+#: ../libnm-core/nm-setting-bond.c:592 ../libnm-core/nm-setting-bond.c:628
+#: ../libnm-util/nm-setting-bond.c:604 ../libnm-util/nm-setting-bond.c:613
+#: ../libnm-util/nm-setting-bond.c:633 ../libnm-util/nm-setting-bond.c:669
#, c-format
msgid "'%s' option requires '%s' option to be set"
msgstr "'%s' விரà¯à®ªà¯à®ªà®¤à¯à®¤à®¿à®±à¯à®•à¯ '%s' விரà¯à®ªà¯à®ªà®¤à¯à®¤à¯ˆ அமைகà¯à®• வேணà¯à®Ÿà®¿à®¯à®¤à¯ அவசியமà¯"
-#: ../libnm-core/nm-setting-bond.c:614 ../libnm-util/nm-setting-bond.c:639
+#: ../libnm-core/nm-setting-bond.c:603 ../libnm-util/nm-setting-bond.c:644
#, c-format
msgid "'%s' option is empty"
msgstr "'%s' விரà¯à®ªà¯à®ªà®®à¯ காலியாக உளà¯à®³à®¤à¯"
-#: ../libnm-core/nm-setting-bond.c:626 ../libnm-util/nm-setting-bond.c:651
+#: ../libnm-core/nm-setting-bond.c:615 ../libnm-util/nm-setting-bond.c:656
#, c-format
msgid "'%s' is not a valid IPv4 address for '%s' option"
msgstr "'%s' ஆனத௠'%s' விரà¯à®ªà¯à®ªà®¤à¯à®¤à®¿à®±à¯à®•à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© IPv4 à®®à¯à®•à®µà®°à®¿à®¯à®²à¯à®²"
-#: ../libnm-core/nm-setting-bridge-port.c:138
-#: ../libnm-core/nm-setting-bridge-port.c:150
-#: ../libnm-util/nm-setting-bridge-port.c:153
-#: ../libnm-util/nm-setting-bridge-port.c:165
+#: ../libnm-core/nm-setting-bond.c:642 ../libnm-util/nm-setting-bond.c:683
+#, c-format
+#| msgid "'%s' option is only valid for '%s=%s'"
+msgid "'%s' option is only valid with mode '%s'"
+msgstr "'%s' விரà¯à®ªà¯à®ªà®®à¯ '%s' உடன௠பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¿à®©à®¾à®²à¯ மடà¯à®Ÿà¯à®®à¯‡ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à¯à®®à¯"
+
+#: ../libnm-core/nm-setting-bridge-port.c:125
+#: ../libnm-core/nm-setting-bridge-port.c:137
+#: ../libnm-util/nm-setting-bridge-port.c:155
+#: ../libnm-util/nm-setting-bridge-port.c:167
#, c-format
msgid "'%d' is not a valid value for the property (should be <= %d)"
msgstr "'%d' ஆனத௠பணà¯à®ªà¯à®•à¯à®•à®¾à®© செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© மதிபà¯à®ªà®²à¯à®² (<= %d ஆக இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯)"
-#: ../libnm-core/nm-setting-bridge-port.c:175
-#: ../libnm-core/nm-setting-team-port.c:118
+#: ../libnm-core/nm-setting-bridge-port.c:155
+#: ../libnm-core/nm-setting-team-port.c:98
+#, c-format
+#| msgid "Missing '%s' setting"
+msgid "missing setting"
+msgstr "அமைவ௠இலà¯à®²à¯ˆ"
+
+#: ../libnm-core/nm-setting-bridge-port.c:166
+#: ../libnm-core/nm-setting-team-port.c:109
#, c-format
msgid ""
"A connection with a '%s' setting must have the slave-type set to '%s'. "
@@ -6775,52 +7446,49 @@ msgstr ""
"s' என "
"உளà¯à®³à®¤à¯"
-#: ../libnm-core/nm-setting-bridge.c:222 ../libnm-util/nm-setting-bridge.c:268
+#: ../libnm-core/nm-setting-bridge.c:206 ../libnm-util/nm-setting-bridge.c:270
#, c-format
msgid "value '%d' is out of range <%d-%d>"
msgstr "மதிபà¯à®ªà¯ '%d' ஆனத௠வரமà¯à®ªà®¿à®±à¯à®•à¯ வெளியே உளà¯à®³à®¤à¯ <%d-%d>"
-#: ../libnm-core/nm-setting-bridge.c:239 ../libnm-core/nm-setting-wired.c:611
-#: ../libnm-core/nm-setting-wired.c:670 ../libnm-util/nm-setting-bridge.c:285
-#: ../libnm-util/nm-setting-wired.c:635 ../libnm-util/nm-setting-wired.c:693
+#: ../libnm-core/nm-setting-bridge.c:223 ../libnm-core/nm-setting-wired.c:595
+#: ../libnm-core/nm-setting-wired.c:655 ../libnm-util/nm-setting-bridge.c:287
+#: ../libnm-util/nm-setting-wired.c:637 ../libnm-util/nm-setting-wired.c:695
msgid "is not a valid MAC address"
msgstr "எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© MAC à®®à¯à®•à®µà®°à®¿à®¯à®²à¯à®²"
-#: ../libnm-core/nm-setting-cdma.c:164 ../libnm-util/nm-setting-cdma.c:168
+#: ../libnm-core/nm-setting-cdma.c:149 ../libnm-util/nm-setting-cdma.c:170
msgid "property is empty'"
msgstr "பணà¯à®ªà¯ காலியாக உளà¯à®³à®¤à¯'"
-#: ../libnm-core/nm-setting-connection.c:740
-#: ../libnm-util/nm-setting-connection.c:861
+#: ../libnm-core/nm-setting-connection.c:747
#, c-format
-msgid "requires presence of '%s' setting in the connection"
-msgstr "இணைபà¯à®ªà®¿à®²à¯ '%s' அமைபà¯à®ªà¯ இரà¯à®•à¯à®• வேணà¯à®Ÿà®¿à®¯à®¤à¯ அவசியமà¯"
+#| msgid "'%s' setting is required for the connection when the property is set"
+msgid "setting required for connection of type '%s'"
+msgstr "'%s' வகை இணைபà¯à®ªà¯à®•à¯à®•à¯ அமைவ௠தேவை"
#: ../libnm-core/nm-setting-connection.c:828
#, c-format
msgid "connection type '%s' is not valid"
msgstr "இணைபà¯à®ªà¯ வகை '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²"
-#: ../libnm-core/nm-setting-connection.c:838
-#, c-format
-msgid "connection type '%s' is not a valid base type"
-msgstr "இணைபà¯à®ªà¯ வகை '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© அடிபà¯à®ªà®Ÿà¯ˆ வகையலà¯à®²"
-
-#: ../libnm-core/nm-setting-connection.c:873
-#: ../libnm-util/nm-setting-connection.c:876
+#: ../libnm-core/nm-setting-connection.c:863
+#: ../libnm-util/nm-setting-connection.c:878
#, c-format
msgid "Unknown slave type '%s'"
msgstr "தெரியாத ஸà¯à®²à¯‡à®µà¯ வகை '%s'"
-#: ../libnm-core/nm-setting-connection.c:883
-#: ../libnm-util/nm-setting-connection.c:886
-msgid "Slave connections need a valid '"
-msgstr "ஸà¯à®²à¯‡à®µà¯ இணைபà¯à®ªà¯à®•à®³à¯à®•à¯à®•à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இவை தேவை: '"
+#: ../libnm-core/nm-setting-connection.c:873
+#, c-format
+#| msgid "Slave connections need a valid '"
+msgid "Slave connections need a valid '%s' property"
+msgstr "அடிமை இணைபà¯à®ªà¯à®•à®³à¯à®•à¯à®•à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© '%s' பணà¯à®ªà¯ தேவை"
-#: ../libnm-core/nm-setting-connection.c:904
-#: ../libnm-util/nm-setting-connection.c:895
-msgid "Cannot set '"
-msgstr "இதை அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: '"
+#: ../libnm-core/nm-setting-connection.c:894
+#, c-format
+#| msgid "Cannot set '"
+msgid "Cannot set '%s' without '%s'"
+msgstr "'%s' இலà¯à®²à®¾à®®à®²à¯ '%s' ஠அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯"
#: ../libnm-core/nm-setting-connection.c:917
#, c-format
@@ -6834,72 +7502,76 @@ msgstr "ஸà¯à®²à¯‡à®µà¯ வகை '%s' கà¯à®•à¯ இணைபà¯à®ªà®¿à®²à
#: ../libnm-core/nm-setting-connection.c:942
#, c-format
-msgid "Detect a slave connection with '"
-msgstr "இதைக௠கொணà¯à®Ÿ ஒர௠ஸà¯à®²à¯‡à®µà¯ இணைபà¯à®ªà¯ˆà®•à¯ கணà¯à®Ÿà¯à®ªà®¿à®Ÿà®¿: '"
+msgid ""
+"Detect a slave connection with '%s' set and a port type '%s'. '%s' should be "
+"set to '%s'"
+msgstr ""
+"'%s' அமைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³ மறà¯à®±à¯à®®à¯ '%s' வகை தà¯à®±à¯ˆ வகையைக௠கொணà¯à®Ÿà¯à®³à¯à®³ அடிமை இணைபà¯à®ªà¯ˆà®•à¯ "
+"கணà¯à®Ÿà®±à®¿à®¯à®µà¯à®®à¯. '%s' ஆனத௠'%s' கà¯à®•à¯ அமைகà¯à®•à®ªà¯à®ªà®Ÿ வேணà¯à®Ÿà¯à®®à¯."
-#: ../libnm-core/nm-setting-dcb.c:538 ../libnm-util/nm-setting-dcb.c:593
+#: ../libnm-core/nm-setting-dcb.c:523 ../libnm-util/nm-setting-dcb.c:595
msgid "flags invalid"
msgstr "கொடிகள௠செலà¯à®²à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-dcb.c:547 ../libnm-util/nm-setting-dcb.c:602
+#: ../libnm-core/nm-setting-dcb.c:532 ../libnm-util/nm-setting-dcb.c:604
msgid "flags invalid - disabled"
msgstr "கொடிகள௠செலà¯à®²à®¾à®¤à®¤à¯ - à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯"
-#: ../libnm-core/nm-setting-dcb.c:573 ../libnm-core/nm-setting-dcb.c:622
-#: ../libnm-util/nm-setting-dcb.c:628 ../libnm-util/nm-setting-dcb.c:677
+#: ../libnm-core/nm-setting-dcb.c:558 ../libnm-core/nm-setting-dcb.c:607
+#: ../libnm-util/nm-setting-dcb.c:630 ../libnm-util/nm-setting-dcb.c:679
msgid "property invalid (not enabled)"
msgstr "பணà¯à®ªà¯ செலà¯à®²à®¾à®¤à®¤à¯ (செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ)"
-#: ../libnm-core/nm-setting-dcb.c:582 ../libnm-util/nm-setting-dcb.c:637
+#: ../libnm-core/nm-setting-dcb.c:567 ../libnm-util/nm-setting-dcb.c:639
msgid "element invalid"
msgstr "கூற௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®²"
-#: ../libnm-core/nm-setting-dcb.c:597 ../libnm-util/nm-setting-dcb.c:652
+#: ../libnm-core/nm-setting-dcb.c:582 ../libnm-util/nm-setting-dcb.c:654
msgid "sum not 100%"
msgstr "கூடà¯à®¤à®²à¯ 100% அலà¯à®²"
-#: ../libnm-core/nm-setting-dcb.c:631 ../libnm-core/nm-setting-dcb.c:663
-#: ../libnm-util/nm-setting-dcb.c:686 ../libnm-util/nm-setting-dcb.c:718
+#: ../libnm-core/nm-setting-dcb.c:616 ../libnm-core/nm-setting-dcb.c:648
+#: ../libnm-util/nm-setting-dcb.c:688 ../libnm-util/nm-setting-dcb.c:720
msgid "property invalid"
msgstr "பணà¯à®ªà¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-dcb.c:653 ../libnm-util/nm-setting-dcb.c:708
+#: ../libnm-core/nm-setting-dcb.c:638 ../libnm-util/nm-setting-dcb.c:710
msgid "property missing"
msgstr "பணà¯à®ªà¯ விடà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯"
-#: ../libnm-core/nm-setting-gsm.c:254 ../libnm-util/nm-setting-gsm.c:294
+#: ../libnm-core/nm-setting-gsm.c:239 ../libnm-util/nm-setting-gsm.c:296
#, c-format
msgid "property value '%s' is empty or too long (>64)"
msgstr "பணà¯à®ªà¯ மதிபà¯à®ªà¯ '%s' காலியாக உளà¯à®³à®¤à¯ அலà¯à®²à®¤à¯ மிக நீளமாக உளà¯à®³à®¤à¯ (>64)"
-#: ../libnm-core/nm-setting-gsm.c:286 ../libnm-util/nm-setting-gsm.c:326
+#: ../libnm-core/nm-setting-gsm.c:271 ../libnm-util/nm-setting-gsm.c:328
#, c-format
msgid "'%s' contains invalid char(s) (use [A-Za-z._-])"
msgstr ""
"'%s' இல௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ எழà¯à®¤à¯à®¤à¯à®•à®³à¯ உளà¯à®³à®© ([A-Za-z._-] à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯)"
-#: ../libnm-core/nm-setting-gsm.c:321 ../libnm-util/nm-setting-gsm.c:361
+#: ../libnm-core/nm-setting-gsm.c:306 ../libnm-util/nm-setting-gsm.c:363
#, c-format
msgid "'%s' length is invalid (should be 5 or 6 digits)"
msgstr "'%s' நீளம௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤à®¤à¯ (5 அலà¯à®²à®¤à¯ 6 இலகà¯à®•à®™à¯à®•à®³à¯ இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯)"
-#: ../libnm-core/nm-setting-infiniband.c:233
-#: ../libnm-util/nm-setting-infiniband.c:230
+#: ../libnm-core/nm-setting-infiniband.c:218
+#: ../libnm-util/nm-setting-infiniband.c:232
msgid "not a valid interface name"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இடைமà¯à®• பெயர௠இலà¯à®²à¯ˆ"
-#: ../libnm-core/nm-setting-infiniband.c:241
-#: ../libnm-util/nm-setting-infiniband.c:238
+#: ../libnm-core/nm-setting-infiniband.c:226
+#: ../libnm-util/nm-setting-infiniband.c:240
msgid "Must specify a P_Key if specifying parent"
msgstr "தாயைக௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®Ÿà®¾à®²à¯, ஒர௠P_Key à®à®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿ வேணà¯à®Ÿà¯à®®à¯"
-#: ../libnm-core/nm-setting-infiniband.c:251
-#: ../libnm-util/nm-setting-infiniband.c:248
+#: ../libnm-core/nm-setting-infiniband.c:236
+#: ../libnm-util/nm-setting-infiniband.c:250
msgid "InfiniBand P_Key connection did not specify parent interface name"
msgstr "InfiniBand P_Key இணைபà¯à®ªà¯ தாய௠இடைமà¯à®•à®ªà¯ பெயரைக௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../libnm-core/nm-setting-infiniband.c:287
-#: ../libnm-util/nm-setting-infiniband.c:284
+#: ../libnm-core/nm-setting-infiniband.c:272
+#: ../libnm-util/nm-setting-infiniband.c:286
#, c-format
msgid ""
"interface name of software infiniband device must be '%s' or unset (instead "
@@ -6909,211 +7581,285 @@ msgstr ""
"வேணà¯à®Ÿà¯à®®à¯ அலà¯à®²à®¤à¯ "
"அமைகà¯à®•à®ªà¯à®ªà®Ÿà®¾à®¤à®¿à®°à¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯ (ஆனால௠'%s' எனà¯à®±à¯ உளà¯à®³à®¤à¯)"
-#: ../libnm-core/nm-setting-infiniband.c:302
+#: ../libnm-core/nm-setting-infiniband.c:287
#, c-format
msgid "mtu for transport mode '%s' can be at most %d but it is %d"
msgstr ""
"போகà¯à®•à¯à®µà®°à®¤à¯à®¤à¯ à®®à¯à®±à¯ˆà®®à¯ˆ '%s' கà¯à®•à®¾à®© mtu அதிகபடà¯à®šà®®à¯ %d இரà¯à®•à¯à®•à®²à®¾à®®à¯, ஆனால௠%d உளà¯à®³à®¤à¯"
-#: ../libnm-core/nm-setting-ip4-config.c:907
-#: ../libnm-core/nm-setting-ip6-config.c:825
-#: ../libnm-util/nm-setting-ip4-config.c:838
-#: ../libnm-util/nm-setting-ip6-config.c:819
+#: ../libnm-core/nm-setting-ip-config.c:79
#, c-format
-msgid "this property cannot be empty for '%s=%s'"
-msgstr "'%s=%s' கà¯à®•à¯ இநà¯à®¤à®ªà¯ பணà¯à®ªà¯ காலியாக இரà¯à®•à¯à®•à®•à¯à®•à¯‚டாதà¯"
+#| msgid "invalid IPv4 address '%s'"
+msgid "Invalid IPv4 address '%s'"
+msgstr "தவறான IPv4 à®®à¯à®•à®µà®°à®¿ '%s'"
-#: ../libnm-core/nm-setting-ip4-config.c:919
-#: ../libnm-core/nm-setting-ip4-config.c:929
-#: ../libnm-core/nm-setting-ip4-config.c:941
-#: ../libnm-core/nm-setting-ip6-config.c:838
-#: ../libnm-core/nm-setting-ip6-config.c:848
-#: ../libnm-core/nm-setting-ip6-config.c:858
-#: ../libnm-util/nm-setting-ip4-config.c:850
-#: ../libnm-util/nm-setting-ip4-config.c:860
-#: ../libnm-util/nm-setting-ip4-config.c:872
-#: ../libnm-util/nm-setting-ip6-config.c:832
-#: ../libnm-util/nm-setting-ip6-config.c:842
-#: ../libnm-util/nm-setting-ip6-config.c:852
+#: ../libnm-core/nm-setting-ip-config.c:79
#, c-format
-msgid "this property is not allowed for '%s=%s'"
-msgstr "'%s=%s' கà¯à®•à¯ இநà¯à®¤ பணà¯à®ªà¯ அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà®¾à®¤à¯"
+#| msgid "invalid IPv6 address '%s'"
+msgid "Invalid IPv6 address '%s"
+msgstr "தவறான IPv6 à®®à¯à®•à®µà®°à®¿ '%s'"
-#: ../libnm-core/nm-setting-ip4-config.c:988
-#: ../libnm-util/nm-setting-ip4-config.c:916
+#: ../libnm-core/nm-setting-ip-config.c:93
#, c-format
-msgid "%d. IPv4 address is invalid"
-msgstr "%d. IPv4 à®®à¯à®•à®µà®°à®¿ செலà¯à®²à®¾à®¤à®¤à¯"
+#| msgid "invalid IPv4 address '%s'"
+msgid "Invalid IPv4 address prefix '%u'"
+msgstr "தவறான IPv4 à®®à¯à®•à®µà®°à®¿ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ '%u'"
-#: ../libnm-core/nm-setting-ip4-config.c:998
-#: ../libnm-util/nm-setting-ip4-config.c:926
+#: ../libnm-core/nm-setting-ip-config.c:93
#, c-format
-msgid "%d. IPv4 address has invalid prefix"
-msgstr "%d. IPv4 à®®à¯à®•à®µà®°à®¿à®¯à®¿à®²à¯ செலà¯à®²à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ உளà¯à®³à®¤à¯"
+#| msgid "invalid IPv6 address '%s'"
+msgid "Invalid IPv6 address prefix '%u"
+msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ IPv6 à®®à¯à®•à®µà®°à®¿ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ '%u"
+
+#: ../libnm-core/nm-setting-ip-config.c:111
+#, c-format
+#| msgid "invalid metric '%s'"
+msgid "Invalid routing metric '%s'"
+msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ தடமாகà¯à®•à®²à¯ மெடà¯à®°à®¿à®•à¯ '%s'"
+
+#: ../libnm-core/nm-setting-ip-config.c:1857
+#, c-format
+msgid "%d. DNS server address is invalid"
+msgstr "%d. DNS சேவையக à®®à¯à®•à®µà®°à®¿ செலà¯à®²à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-ip4-config.c:1008
+#: ../libnm-core/nm-setting-ip-config.c:1873
#, c-format
-msgid "%d. IPv4 address has invalid label '%s'"
-msgstr "%d. IPv4 à®®à¯à®•à®µà®°à®¿à®¯à®¿à®²à¯ செலà¯à®²à®¾à®¤ லேபிள௠'%s' உளà¯à®³à®¤à¯"
+#| msgid "%d. IPv4 address is invalid"
+msgid "%d. IP address is invalid"
+msgstr "%d. IP à®®à¯à®•à®µà®°à®¿ செலà¯à®²à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-ip4-config.c:1019
+#: ../libnm-core/nm-setting-ip-config.c:1885
#, c-format
-msgid "IPv4 address / label count mismatch (%d vs %d)"
-msgstr "IPv4 à®®à¯à®•à®µà®°à®¿ / லேபிள௠எணà¯à®£à®¿à®•à¯à®•à¯ˆ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ (%d மறà¯à®±à¯à®®à¯ %d)"
+#| msgid "%d. IPv4 address has invalid prefix"
+msgid "%d. IP address has 'label' property with invalid type"
+msgstr "%d. IP à®®à¯à®•à®µà®°à®¿à®¯à®¿à®²à¯ உளà¯à®³ 'label' பணà¯à®ªà®¿à®©à¯ வகை செலà¯à®²à®¾à®¤à®¤à¯"
+
+#: ../libnm-core/nm-setting-ip-config.c:1894
+#, c-format
+#| msgid "%d. IPv4 address has invalid label '%s'"
+msgid "%d. IP address has invalid label '%s'"
+msgstr "%d. IP à®®à¯à®•à®µà®°à®¿à®¯à®¿à®²à¯ '%s' எனà¯à®± செலà¯à®²à®¾à®¤ லேபிள௠உளà¯à®³à®¤à¯"
+
+#: ../libnm-core/nm-setting-ip-config.c:1908
+msgid "gateway cannot be set if there are no addresses configured"
+msgstr "à®®à¯à®•à®µà®°à®¿à®•à®³à¯ அமைவாகà¯à®•à®ªà¯à®ªà®Ÿà®¾à®µà®¿à®Ÿà¯à®Ÿà®¾à®²à¯, நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯ˆ அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯"
+
+#: ../libnm-core/nm-setting-ip-config.c:1917
+#| msgid "property is invalid"
+msgid "gateway is invalid"
+msgstr "நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-ip4-config.c:1035
-#: ../libnm-util/nm-setting-ip4-config.c:942
+#: ../libnm-core/nm-setting-ip-config.c:1931
+#: ../libnm-util/nm-setting-ip4-config.c:966
#, c-format
msgid "%d. route is invalid"
msgstr "%d. பாதை செலà¯à®²à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-ip4-config.c:1045
-#: ../libnm-util/nm-setting-ip4-config.c:952
+#: ../libnm-core/nm-setting-ip-config.c:1940
#, c-format
-msgid "%d. route has invalid prefix"
-msgstr "%d. பாதையில௠செலà¯à®²à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ உளà¯à®³à®¤à¯"
+msgid "%d. route cannot be a default route"
+msgstr "%d. தடமà¯, à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯à®¤à¯ தடமாக இரà¯à®•à¯à®•à®•à¯à®•à¯‚டாதà¯"
-#: ../libnm-core/nm-setting-ip4-config.c:1061
-#: ../libnm-core/nm-setting-ip6-config.c:892
+#: ../libnm-core/nm-setting-ip4-config.c:123
+#: ../libnm-core/nm-setting-ip6-config.c:121
+#: ../libnm-util/nm-setting-ip4-config.c:862
+#: ../libnm-util/nm-setting-ip6-config.c:843
#, c-format
-msgid "%d. DNS server address is invalid"
-msgstr "%d. DNS சேவையக à®®à¯à®•à®µà®°à®¿ செலà¯à®²à®¾à®¤à®¤à¯"
+msgid "this property cannot be empty for '%s=%s'"
+msgstr "'%s=%s' கà¯à®•à¯ இநà¯à®¤à®ªà¯ பணà¯à®ªà¯ காலியாக இரà¯à®•à¯à®•à®•à¯à®•à¯‚டாதà¯"
+
+#: ../libnm-core/nm-setting-ip4-config.c:135
+#: ../libnm-core/nm-setting-ip4-config.c:145
+#: ../libnm-core/nm-setting-ip4-config.c:157
+#: ../libnm-core/nm-setting-ip6-config.c:134
+#: ../libnm-core/nm-setting-ip6-config.c:144
+#: ../libnm-core/nm-setting-ip6-config.c:154
+#: ../libnm-util/nm-setting-ip4-config.c:874
+#: ../libnm-util/nm-setting-ip4-config.c:884
+#: ../libnm-util/nm-setting-ip4-config.c:896
+#: ../libnm-util/nm-setting-ip6-config.c:856
+#: ../libnm-util/nm-setting-ip6-config.c:866
+#: ../libnm-util/nm-setting-ip6-config.c:876
+#, c-format
+msgid "this property is not allowed for '%s=%s'"
+msgstr "'%s=%s' கà¯à®•à¯ இநà¯à®¤ பணà¯à®ªà¯ அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà®¾à®¤à¯"
-#: ../libnm-core/nm-setting-ip6-config.c:837
-#: ../libnm-util/nm-setting-ip6-config.c:831
+#: ../libnm-core/nm-setting-ip6-config.c:133
+#: ../libnm-util/nm-setting-ip6-config.c:855
#, c-format
msgid "'%s' not allowed for %s=%s"
msgstr "%s=%s கà¯à®•à¯ '%s' அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà®¾à®¤à¯"
-#: ../libnm-core/nm-setting-olpc-mesh.c:126
-#: ../libnm-core/nm-setting-wireless.c:720
-#: ../libnm-util/nm-setting-olpc-mesh.c:131
-#: ../libnm-util/nm-setting-wireless.c:759
+#: ../libnm-core/nm-setting-olpc-mesh.c:123
+#: ../libnm-core/nm-setting-wireless.c:704
+#: ../libnm-util/nm-setting-olpc-mesh.c:133
+#: ../libnm-util/nm-setting-wireless.c:761
msgid "SSID length is out of range <1-32> bytes"
msgstr "SSID நீளம௠வரமà¯à®ªà¯à®•à¯à®•à¯ வெளியே உளà¯à®³à®¤à¯ <1-32> பைடà¯à®Ÿà¯à®•à®³à¯"
-#: ../libnm-core/nm-setting-olpc-mesh.c:135
-#: ../libnm-core/nm-setting-wireless.c:760
-#: ../libnm-util/nm-setting-olpc-mesh.c:140
-#: ../libnm-util/nm-setting-wireless.c:799
+#: ../libnm-core/nm-setting-olpc-mesh.c:132
+#: ../libnm-core/nm-setting-wireless.c:744
+#: ../libnm-util/nm-setting-olpc-mesh.c:142
+#: ../libnm-util/nm-setting-wireless.c:801
#, c-format
msgid "'%d' is not a valid channel"
msgstr "'%d' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© சேனல௠அலà¯à®²"
-#: ../libnm-core/nm-setting-ppp.c:383 ../libnm-util/nm-setting-ppp.c:387
+#: ../libnm-core/nm-setting-ppp.c:367 ../libnm-util/nm-setting-ppp.c:389
#, c-format
msgid "'%d' is out of valid range <128-16384>"
msgstr "'%d' ஆனத௠செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© வரமà¯à®ªà¯à®•à¯à®•à¯ வெளியே உளà¯à®³à®¤à¯ <128-16384>"
-#: ../libnm-core/nm-setting-ppp.c:396 ../libnm-util/nm-setting-ppp.c:400
+#: ../libnm-core/nm-setting-ppp.c:380 ../libnm-util/nm-setting-ppp.c:402
#, c-format
msgid "setting this property requires non-zero '%s' property"
msgstr "இநà¯à®¤ பணà¯à®ªà¯ˆ அமைகà¯à®• வேணà¯à®Ÿà¯à®®à®¾à®©à®¾à®²à¯ பூசà¯à®šà®¿à®¯à®®à®²à¯à®²à®¾à®¤ '%s' பணà¯à®ªà¯ அவசியமà¯"
-#: ../libnm-core/nm-setting-vlan.c:528 ../libnm-util/nm-setting-vlan.c:554
+#: ../libnm-core/nm-setting-vlan.c:516 ../libnm-util/nm-setting-vlan.c:557
#, c-format
msgid "'%s' value doesn't match '%s=%s'"
msgstr "'%s' மதிபà¯à®ªà®¾à®©à®¤à¯ '%s=%s' கà¯à®•à¯à®ªà¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../libnm-core/nm-setting-vlan.c:539 ../libnm-util/nm-setting-vlan.c:565
+#: ../libnm-core/nm-setting-vlan.c:527 ../libnm-util/nm-setting-vlan.c:568
#, c-format
msgid "'%s' is neither an UUID nor an interface name"
msgstr "'%s' ஆனத௠UUID மறà¯à®±à¯à®®à¯ இடைமà¯à®•à®ªà¯ பெயர௠இரணà¯à®Ÿà¯à®•à¯à®•à¯à®®à¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ"
-#: ../libnm-core/nm-setting-vlan.c:553 ../libnm-util/nm-setting-vlan.c:578
+#: ../libnm-core/nm-setting-vlan.c:541 ../libnm-util/nm-setting-vlan.c:581
#, c-format
msgid "property is not specified and neither is '%s:%s'"
msgstr "பணà¯à®ªà¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà®µà¯à®®à¯ இலà¯à®²à¯ˆ அத௠'%s:%s' ஆகவà¯à®®à¯ இலà¯à®²à¯ˆ"
-#: ../libnm-core/nm-setting-vlan.c:566 ../libnm-util/nm-setting-vlan.c:591
+#: ../libnm-core/nm-setting-vlan.c:554 ../libnm-util/nm-setting-vlan.c:594
msgid "flags are invalid"
msgstr "கொடிகள௠செலà¯à®²à®¾à®¤à®¤à¯"
-#: ../libnm-core/nm-setting-wired.c:591 ../libnm-util/nm-setting-wired.c:615
+#: ../libnm-core/nm-setting-vpn.c:441
+#, c-format
+#| msgid "property is empty"
+msgid "secret was empty"
+msgstr "ரகசியம௠காலியாக இரà¯à®¨à¯à®¤à®¤à¯"
+
+#: ../libnm-core/nm-setting-vpn.c:471
+msgid "setting contained a secret with an empty name"
+msgstr "அமைவில௠காலியான பெயரைக௠கொணà¯à®Ÿà®¿à®°à¯à®¨à¯à®¤ ஒர௠ரகசியம௠இரà¯à®¨à¯à®¤à®¤à¯"
+
+#: ../libnm-core/nm-setting-vpn.c:479
+#, c-format
+msgid "secret value was empty"
+msgstr "ரகசியதà¯à®¤à®¿à®©à¯ மதிபà¯à®ªà¯ காலியாக இரà¯à®¨à¯à®¤à®¤à¯"
+
+#: ../libnm-core/nm-setting-vpn.c:526 ../libnm-core/nm-setting.c:1572
+msgid "not a secret property"
+msgstr "இத௠ஒர௠ரகசியதà¯à®¤à®¿à®©à¯ பணà¯à®ªà®²à¯à®²"
+
+#: ../libnm-core/nm-setting-vpn.c:532
+msgid "secret is not of correct type"
+msgstr "ரகசியதà¯à®¤à®¿à®©à¯ வகை தவறà¯"
+
+#: ../libnm-core/nm-setting-vpn.c:567
+#, c-format
+#| msgid "Error: failed to remove value of '%s': %s\n"
+msgid "failed to convert value '%s' to uint"
+msgstr "'%s' எனà¯à®®à¯ மதிபà¯à®ªà¯ˆ அலகாக மாறà¯à®± à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯"
+
+#: ../libnm-core/nm-setting-vpn.c:575
+msgid "secret flags property not found"
+msgstr "ரகசியக௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®²à¯à®•à®³à¯ பணà¯à®ªà¯ இலà¯à®²à¯ˆ"
+
+#: ../libnm-core/nm-setting-wired.c:575 ../libnm-util/nm-setting-wired.c:617
#, c-format
msgid "'%s' is not a valid Ethernet port value"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© ஈதà¯à®¤à®°à¯à®¨à¯†à®Ÿà¯ à®®à¯à®©à¯ˆà®¯ மதிபà¯à®ªà®²à¯à®²"
-#: ../libnm-core/nm-setting-wired.c:601 ../libnm-util/nm-setting-wired.c:625
+#: ../libnm-core/nm-setting-wired.c:585 ../libnm-util/nm-setting-wired.c:627
#, c-format
msgid "'%s' is not a valid duplex value"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© டியூபà¯à®²à¯†à®•à¯à®¸à¯ மதிபà¯à®ªà®²à¯à®²"
-#: ../libnm-core/nm-setting-wired.c:659 ../libnm-util/nm-setting-wired.c:682
+#: ../libnm-core/nm-setting-wired.c:644 ../libnm-util/nm-setting-wired.c:684
#, c-format
msgid "invalid '%s' or its value '%s'"
msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ '%s' அலà¯à®²à®¤à¯ அதன௠மதிபà¯à®ªà¯ '%s'"
-#: ../libnm-core/nm-setting-wireless-security.c:899
-#: ../libnm-util/nm-setting-wireless-security.c:912
+#: ../libnm-core/nm-setting-wireless-security.c:883
+#: ../libnm-util/nm-setting-wireless-security.c:913
#, c-format
msgid "'%s' security requires '%s=%s'"
msgstr "'%s' பாதà¯à®•à®¾à®ªà¯à®ªà¯à®•à¯à®•à¯ '%s=%s' அவசியமà¯"
-#: ../libnm-core/nm-setting-wireless-security.c:928
-#: ../libnm-util/nm-setting-wireless-security.c:941
+#: ../libnm-core/nm-setting-wireless-security.c:912
+#: ../libnm-util/nm-setting-wireless-security.c:942
#, c-format
msgid "'%s' security requires '%s' setting presence"
msgstr "'%s' பாதà¯à®•à®¾à®ªà¯à®ªà¯à®•à¯à®•à¯ '%s' அமைவ௠இரà¯à®•à¯à®• வேணà¯à®Ÿà®¿à®¯à®¤à¯ அவசியமà¯"
-#: ../libnm-core/nm-setting-wireless-security.c:949
-#: ../libnm-util/nm-setting-wireless-security.c:962
+#: ../libnm-core/nm-setting-wireless-security.c:933
+#: ../libnm-util/nm-setting-wireless-security.c:963
#, c-format
msgid "'%d' value is out of range <0-3>"
msgstr "'%d' மதிபà¯à®ªà¯ வரமà¯à®ªà®¿à®±à¯à®•à¯ வெளியே உளà¯à®³à®¤à¯ <0-3>"
-#: ../libnm-core/nm-setting-wireless-security.c:1046
-#: ../libnm-util/nm-setting-wireless-security.c:1059
+#: ../libnm-core/nm-setting-wireless-security.c:1030
+#: ../libnm-util/nm-setting-wireless-security.c:1060
#, c-format
msgid "'%s' connections require '%s' in this property"
msgstr "'%s' இணைபà¯à®ªà¯à®•à®³à¯à®•à¯à®•à¯ இநà¯à®¤à®ªà¯ பணà¯à®ªà®¿à®²à¯ '%s' இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯"
-#: ../libnm-core/nm-setting-wireless-security.c:1076
-#: ../libnm-util/nm-setting-wireless-security.c:1089
+#: ../libnm-core/nm-setting-wireless-security.c:1060
+#: ../libnm-util/nm-setting-wireless-security.c:1090
#, c-format
msgid "'%s' can only be used with '%s=%s' (WEP)"
msgstr "'%s' à® '%s=%s' (WEP) உடன௠மடà¯à®Ÿà¯à®®à¯‡ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à¯à®®à¯"
-#: ../libnm-core/nm-setting-wireless.c:729
-#: ../libnm-util/nm-setting-wireless.c:768
+#: ../libnm-core/nm-setting-wireless.c:713
+#: ../libnm-util/nm-setting-wireless.c:770
#, c-format
msgid "'%s' is not a valid Wi-Fi mode"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© Wi-Fi பயனà¯à®®à¯à®±à¯ˆà®¯à®²à¯à®²"
-#: ../libnm-core/nm-setting-wireless.c:739
-#: ../libnm-util/nm-setting-wireless.c:778
+#: ../libnm-core/nm-setting-wireless.c:723
+#: ../libnm-util/nm-setting-wireless.c:780
#, c-format
msgid "'%s' is not a valid band"
msgstr "'%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à¯à®®à¯ படà¯à®Ÿà¯ˆà®¯à®²à¯à®²"
-#: ../libnm-core/nm-setting-wireless.c:749
-#: ../libnm-util/nm-setting-wireless.c:788
+#: ../libnm-core/nm-setting-wireless.c:733
#, c-format
-msgid "requires setting '%s' property"
-msgstr "இதறà¯à®•à¯ '%s' பணà¯à®ªà¯ˆ அமைகà¯à®• வேணà¯à®Ÿà¯à®®à¯"
+#| msgid "requires setting '%s' property"
+msgid "'%s' requires setting '%s' property"
+msgstr "'%s' கà¯à®•à¯ '%s' பணà¯à®ªà¯ˆ அமைகà¯à®• வேணà¯à®Ÿà®¿à®¯à®¤à¯ அவசியமà¯"
+
+#: ../libnm-core/nm-setting.c:1470
+msgid "secret not found"
+msgstr "ரகசியதà¯à®¤à¯ˆ காண à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ"
+
+#: ../libnm-core/nm-setting.c:1562
+msgid "secret is not set"
+msgstr "ரகசியம௠அமைகà¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../libnm-core/nm-setting.c:1710
+#: ../libnm-core/nm-utils.c:2269 ../libnm-util/nm-utils.c:1807
#, c-format
-msgid "Missing '%s' setting"
-msgstr "'%s' அமைவ௠இலà¯à®²à¯ˆ"
+msgid "Could not find \"%s\" binary"
+msgstr "\"%s\" பைனரி இலà¯à®²à¯ˆ"
-#: ../libnm-glib/nm-device.c:1792
+#: ../libnm-glib/nm-device.c:1794 ../libnm/nm-device.c:1615
msgid "Bluetooth"
msgstr "Bluetooth"
-#: ../libnm-glib/nm-device.c:1810
+#: ../libnm-glib/nm-device.c:1812 ../libnm/nm-device.c:1633
msgid "ADSL"
msgstr "ADSL"
-#: ../libnm-glib/nm-device.c:1838
+#: ../libnm-glib/nm-device.c:1840 ../libnm/nm-device.c:1661
msgid "Wired"
msgstr "வயரà¯à®Ÿà¯"
-#: ../libnm-glib/nm-device.c:1869
+#: ../libnm-glib/nm-device.c:1871 ../libnm/nm-device.c:1692
msgid "PCI"
msgstr "PCI"
-#: ../libnm-glib/nm-device.c:1871
+#: ../libnm-glib/nm-device.c:1873 ../libnm/nm-device.c:1694
msgid "USB"
msgstr "USB"
@@ -7123,21 +7869,229 @@ msgstr "USB"
#. * "%2$s (%1$s)" if there's no grammatical way to combine
#. * the strings otherwise.
#.
-#: ../libnm-glib/nm-device.c:1967 ../libnm-glib/nm-device.c:1986
+#: ../libnm-glib/nm-device.c:1969 ../libnm-glib/nm-device.c:1988
+#: ../libnm/nm-device.c:1788 ../libnm/nm-device.c:1807
#, c-format
msgctxt "long device name"
msgid "%s %s"
msgstr "%s %s"
-#: ../libnm-glib/nm-remote-connection.c:149
+#: ../libnm-glib/nm-remote-connection.c:151
msgid "Disconnected by D-Bus"
msgstr "D-Bus தà¯à®£à¯à®Ÿà®¿à®¤à¯à®¤à®¤à¯"
-#: ../libnm/nm-object.c:174 ../libnm/nm-object.c:317
+#: ../libnm-util/crypto_gnutls.c:88
+#, c-format
+msgid "Failed to initialize the MD5 engine: %s / %s."
+msgstr "MD5 எனà¯à®œà®¿à®©à¯ˆà®¤à¯ தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s / %s."
+
+#: ../libnm-util/crypto_nss.c:102
+#, c-format
+msgid "Failed to initialize the MD5 context: %d."
+msgstr "MD5 உரையை தà¯à®µà®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d."
+
+#: ../libnm-util/crypto_nss.c:463
+#, c-format
+msgid "Couldn't convert password to UCS2: %d"
+msgstr "கடவà¯à®šà¯à®šà¯Šà®²à¯à®²à¯ˆ UCS2கà¯à®•à¯ மாறà¯à®± à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %d"
+
+#: ../libnm-util/nm-setting-bluetooth.c:186
+#, c-format
+msgid "requires '%s' or '%s' setting"
+msgstr "'%s' அலà¯à®²à®¤à¯ '%s' அமைவ௠தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../libnm-util/nm-setting-connection.c:863
+#, c-format
+msgid "requires presence of '%s' setting in the connection"
+msgstr "இணைபà¯à®ªà®¿à®²à¯ '%s' அமைபà¯à®ªà¯ இரà¯à®•à¯à®• வேணà¯à®Ÿà®¿à®¯à®¤à¯ அவசியமà¯"
+
+#: ../libnm-util/nm-setting-connection.c:888
+msgid "Slave connections need a valid '"
+msgstr "ஸà¯à®²à¯‡à®µà¯ இணைபà¯à®ªà¯à®•à®³à¯à®•à¯à®•à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© இவை தேவை: '"
+
+#: ../libnm-util/nm-setting-connection.c:897
+msgid "Cannot set '"
+msgstr "இதை அமைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: '"
+
+#: ../libnm-util/nm-setting-ip4-config.c:940
+#, c-format
+msgid "%d. IPv4 address is invalid"
+msgstr "%d. IPv4 à®®à¯à®•à®µà®°à®¿ செலà¯à®²à®¾à®¤à®¤à¯"
+
+#: ../libnm-util/nm-setting-ip4-config.c:950
+#, c-format
+msgid "%d. IPv4 address has invalid prefix"
+msgstr "%d. IPv4 à®®à¯à®•à®µà®°à®¿à®¯à®¿à®²à¯ செலà¯à®²à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ உளà¯à®³à®¤à¯"
+
+#: ../libnm-util/nm-setting-ip4-config.c:976
+#, c-format
+msgid "%d. route has invalid prefix"
+msgstr "%d. பாதையில௠செலà¯à®²à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ உளà¯à®³à®¤à¯"
+
+#: ../libnm-util/nm-setting-vpn.c:583
+#, c-format
+msgid "Failed to convert '%s' value '%s' to uint"
+msgstr "'%s' மதிபà¯à®ªà¯ˆ '%s' அலகாக மாறà¯à®± à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯"
+
+#: ../libnm-util/nm-setting-vpn.c:590
+#, c-format
+msgid "Secret flags property '%s' not found"
+msgstr "'%s' எனà¯à®®à¯ ரகசியக௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®²à¯à®•à®³à¯ பணà¯à®ªà¯ இலà¯à®²à¯ˆ"
+
+#: ../libnm-util/nm-setting-wireless.c:790
+#, c-format
+msgid "requires setting '%s' property"
+msgstr "இதறà¯à®•à¯ '%s' பணà¯à®ªà¯ˆ அமைகà¯à®• வேணà¯à®Ÿà¯à®®à¯"
+
+#: ../libnm/nm-device-adsl.c:73
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not an ADSL connection."
+msgstr "இணைபà¯à®ªà¯ ஒர௠ADSL இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-bond.c:115
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a bond connection."
+msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ ஒர௠பிணைபà¯à®ªà¯ இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-bridge.c:115
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a bridge connection."
+msgstr "இணைபà¯à®ªà¯ ஒர௠பிரிடà¯à®œà¯ இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-bt.c:140
+#, c-format
+#| msgid "There is 1 optional argument for 'bluetooth' connection type.\n"
+msgid "The connection was not a Bluetooth connection."
+msgstr "இணைபà¯à®ªà¯ ஒர௠Bluetooth இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-bt.c:149
+msgid "Invalid device Bluetooth address."
+msgstr "தவறான சாதன Bluetooth à®®à¯à®•à®µà®°à®¿."
+
+#: ../libnm/nm-device-bt.c:156
+msgid "The Bluetooth addresses of the device and the connection didn't match."
+msgstr "சாதனம௠மறà¯à®±à¯à®®à¯ இணைபà¯à®ªà®¿à®©à¯ Bluetooth à®®à¯à®•à®µà®°à®¿à®•à®³à¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-bt.c:165
+msgid ""
+"The device is lacking Bluetooth capabilities required by the connection."
+msgstr "இணைபà¯à®ªà¯à®•à¯à®•à¯à®¤à¯ தேவையான Bluetooth à®…à®®à¯à®šà®™à¯à®•à®³à¯ சாதனதà¯à®¤à®¿à®²à¯ இலà¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-ethernet.c:138
+#| msgid "There are 4 optional arguments for 'PPPoE' connection type.\n"
+msgid "The connection was not an Ethernet or PPPoE connection."
+msgstr "இணைபà¯à®ªà¯ ஒர௠ஈதà¯à®¤à®°à¯à®¨à¯†à®Ÿà¯ அலà¯à®²à®¤à¯ PPPoE இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-ethernet.c:154 ../libnm/nm-device-infiniband.c:105
+#: ../libnm/nm-device-wifi.c:492 ../libnm/nm-device-wimax.c:311
+#| msgid "is not a valid MAC address"
+msgid "Invalid device MAC address."
+msgstr "தவறான சாதன MAC à®®à¯à®•à®µà®°à®¿."
+
+#: ../libnm/nm-device-ethernet.c:160 ../libnm/nm-device-infiniband.c:113
+#: ../libnm/nm-device-wifi.c:499 ../libnm/nm-device-wimax.c:318
+msgid "The MACs of the device and the connection didn't match."
+msgstr "சாதனம௠மறà¯à®±à¯à®®à¯ இணைபà¯à®ªà®¿à®©à¯ MAC à®®à¯à®•à®µà®°à®¿à®•à®³à¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-generic.c:92
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a generic connection."
+msgstr "இணைபà¯à®ªà¯ ஒர௠பொதà¯à®µà®¾à®© இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-generic.c:99
+#| msgid "InfiniBand P_Key connection did not specify parent interface name"
+msgid "The connection did not specify an interface name."
+msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ ஒர௠இடைமà¯à®•à®ªà¯ பெயரைக௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®µà®¿à®²à¯à®²à¯ˆ.."
+
+#: ../libnm/nm-device-infiniband.c:97
+#| msgid "There are 5 optional arguments for 'InfiniBand' connection type.\n"
+msgid "The connection was not an InfiniBand connection."
+msgstr "இணைபà¯à®ªà¯ ஒர௠InfiniBand இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-modem.c:123
+#| msgid "the connection was removed"
+msgid "The connection was not a modem connection."
+msgstr "இணைபà¯à®ªà¯ ஒர௠மோடம௠இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-modem.c:131
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a valid modem connection."
+msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ சரியான மோடம௠இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-modem.c:138
+msgid "The device is lacking capabilities required by the connection."
+msgstr "இணைபà¯à®ªà¯à®•à¯à®•à¯à®¤à¯ தேவையான à®…à®®à¯à®šà®™à¯à®•à®³à¯ சாதனதà¯à®¤à®¿à®²à¯ இலà¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-olpc-mesh.c:118
+#| msgid "There are 2 optional arguments for 'OLPC Mesh' connection type.\n"
+msgid "The connection was not an OLPC Mesh connection."
+msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ OLPC மெஷ௠இணைபà¯à®ªà®¿à®²à¯ இலà¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-team.c:121
+#| msgid "the connection was removed"
+msgid "The connection was not a team connection."
+msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ ஒர௠அணி இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-vlan.c:131
+#| msgid "There are 4 optional arguments for 'VLAN' connection type.\n"
+msgid "The connection was not a VLAN connection."
+msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ ஒர௠VLAN இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-vlan.c:138
+msgid "The VLAN identifiers of the device and the connection didn't match."
+msgstr "சாதனம௠மறà¯à®±à¯à®®à¯ இணைபà¯à®ªà®¿à®©à¯ VLAN அடையாளம௠காடà¯à®Ÿà®¿à®•à®³à¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-vlan.c:151
+msgid "The hardware address of the device and the connection didn't match."
+msgstr "சாதனம௠மறà¯à®±à¯à®®à¯ இணைபà¯à®ªà®¿à®©à¯ வனà¯à®ªà¯Šà®°à¯à®³à¯ à®®à¯à®•à®µà®°à®¿à®•à®³à¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-wifi.c:483
+msgid "The connection was not a Wi-Fi connection."
+msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ ஒர௠Wi-Fi இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device-wifi.c:519
+msgid "The device is lacking WPA capabilities required by the connection."
+msgstr "இணைபà¯à®ªà¯à®•à¯à®•à¯à®¤à¯ தேவையான WPA à®…à®®à¯à®šà®™à¯à®•à®³à¯ சாதனதà¯à®¤à®¿à®²à¯ இலà¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-wifi.c:526
+msgid "The device is lacking WPA2/RSN capabilities required by the connection."
+msgstr "இணைபà¯à®ªà¯à®•à¯à®•à¯à®¤à¯ தேவையான WPA2/RSN à®…à®®à¯à®šà®™à¯à®•à®³à¯ சாதனதà¯à®¤à®¿à®²à¯ இலà¯à®²à¯ˆ."
+
+#: ../libnm/nm-device-wimax.c:302
+#| msgid "There is 1 optional argument for 'WiMax' connection type.\n"
+msgid "The connection was not a WiMAX connection."
+msgstr "இணைபà¯à®ªà®¾à®©à®¤à¯ ஒர௠WiMAX இணைபà¯à®ªà®²à¯à®²."
+
+#: ../libnm/nm-device.c:2133
+#, c-format
+#| msgid "Error: connection is not valid: %s\n"
+msgid "The connection was not valid: %s"
+msgstr "இணைபà¯à®ªà¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤à®¤à¯: %s"
+
+#: ../libnm/nm-device.c:2142
+#, c-format
+msgid "The interface names of the device and the connection didn't match."
+msgstr "சாதனம௠மறà¯à®±à¯à®®à¯ இணைபà¯à®ªà®¿à®©à¯ இடைமà¯à®•à®ªà¯ பெயரà¯à®•à®³à¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../libnm/nm-manager.c:858
+#| msgid "no active connection or device"
+msgid "Active connection could not be attached to the device"
+msgstr "செயலிலà¯à®³à¯à®³ இணைபà¯à®ªà¯ˆ சாதனதà¯à®¤à¯à®Ÿà®©à¯ இணைகà¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯"
+
+#: ../libnm/nm-manager.c:1082
+#| msgid "Activate connection details"
+msgid "Active connection removed before it was initialized"
+msgstr "செயலிலà¯à®³à¯à®³ இணைபà¯à®ªà®¾à®©à®¤à¯ தà¯à®µà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ à®®à¯à®©à¯à®ªà¯ அகறà¯à®±à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
+
+#: ../libnm/nm-object.c:1439 ../libnm/nm-object.c:1585
msgid "Caller did not specify D-Bus path for object"
msgstr "அழைபà¯à®ªà®¾à®³à®°à¯ பொரà¯à®³à¯à®•à¯à®•à®¾à®© D-Bus பாதையைக௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../libnm/nm-vpn-plugin.c:726
+#: ../libnm/nm-remote-settings.c:261
+msgid "Connection removed before it was initialized"
+msgstr "இணைபà¯à®ªà¯ தà¯à®µà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ à®®à¯à®©à¯à®ªà¯ அகறà¯à®±à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
+
+#: ../libnm/nm-vpn-plugin-old.c:885
msgid "No service name specified"
msgstr "சேவைப௠பெயர௠கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
@@ -7249,95 +8203,56 @@ msgstr "நிலையான கணினி பà¯à®°à®µà®²à®ªà¯†à®¯à®°à¯ à®®
#. * as "Wired Connection" or "VPN Connection". The %d is a number
#. * that is combined with the first argument to create a unique
#. * connection id.
-#: ../src/NetworkManagerUtils.c:953
+#: ../src/NetworkManagerUtils.c:1138
#, c-format
msgctxt "connection id fallback"
msgid "%s %d"
msgstr "%s %d"
-#: ../src/main.c:130
-#, c-format
-msgid "Failed to set signal mask: %d"
-msgstr "சிகà¯à®©à®²à¯ மூடà¯à®¤à®²à¯ˆ அமைபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %d"
-
-#: ../src/main.c:139
-#, c-format
-msgid "Failed to create signal handling thread: %d"
-msgstr "சிகà¯à®©à®²à¯ˆà®•à¯ கையாளà¯à®®à¯ இழையை உரà¯à®µà®¾à®•à¯à®•à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %d"
-
-#: ../src/main.c:154
-#, c-format
-msgid "Opening %s failed: %s\n"
-msgstr "%s à®à®¤à¯ திறபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %s\n"
-
-#: ../src/main.c:160
-#, c-format
-msgid "Writing to %s failed: %s\n"
-msgstr "%s இல௠எழà¯à®¤à¯à®¤à®²à¯ தோலà¯à®µà®¿: %s\n"
-
-#: ../src/main.c:165
-#, c-format
-msgid "Closing %s failed: %s\n"
-msgstr "%s ஠மூடà¯à®¤à®²à¯ தோலà¯à®µà®¿: %s\n"
-
-#: ../src/main.c:208
-#, c-format
-msgid "NetworkManager is already running (pid %ld)\n"
-msgstr "NetworkManager à®à®±à¯à®•à®©à®µà¯‡ இயஙà¯à®•à®¿à®•à¯à®•à¯Šà®£à¯à®Ÿà¯à®³à¯à®³à®¤à¯ (pid %ld)\n"
-
-#: ../src/main.c:361
+#. Logging/debugging
+#: ../src/main.c:221 ../src/nm-iface-helper.c:310
msgid "Print NetworkManager version and exit"
msgstr "NetworkManager பதிபà¯à®ªà¯ˆ அசà¯à®šà®¿à®Ÿà¯à®Ÿà¯ விடà¯à®Ÿà¯à®µà¯†à®³à®¿à®¯à¯‡à®±à¯"
-#: ../src/main.c:362
+#: ../src/main.c:222 ../src/nm-iface-helper.c:311
msgid "Don't become a daemon"
msgstr "ஒர௠டெமானாக ஆக வேணà¯à®Ÿà®¾à®®à¯"
-#: ../src/main.c:363
+#: ../src/main.c:223 ../src/nm-iface-helper.c:312
msgid "Don't become a daemon, and log to stderr"
msgstr "ஒர௠டெமானாக ஆகி sterr இல௠பதிவிட வேணà¯à®Ÿà®¾à®®à¯"
-#: ../src/main.c:364
+#: ../src/main.c:224 ../src/nm-iface-helper.c:313
#, c-format
msgid "Log level: one of [%s]"
msgstr "பதிவ௠நிலை: [%s] இல௠ஒனà¯à®±à¯"
-#: ../src/main.c:366
+#: ../src/main.c:226 ../src/nm-iface-helper.c:315
#, c-format
msgid "Log domains separated by ',': any combination of [%s]"
msgstr "',' ஆல௠பிரிகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ பதிவ௠டொமைனà¯à®•à®³à¯: [%s] இன௠à®à®¤à¯‡à®©à¯à®®à¯ ஒர௠சேரà¯à®•à¯à®•à¯ˆ"
-#: ../src/main.c:368
+#: ../src/main.c:228 ../src/nm-iface-helper.c:317
msgid "Make all warnings fatal"
msgstr "அனைதà¯à®¤à¯ எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ செயà¯à®¤à®¿à®•à®³à¯ˆà®¯à¯à®®à¯ à®®à¯à®Ÿà®¿à®µà®Ÿà¯ˆà®¯ செயà¯à®¯à®µà¯à®®à¯"
-#: ../src/main.c:369
+#: ../src/main.c:229
msgid "Specify the location of a PID file"
msgstr "ஒர௠PID கோபà¯à®ªà®¿à®©à¯ இரà¯à®ªà¯à®ªà®¿à®Ÿà®¤à¯à®¤à¯ˆà®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®µà¯à®®à¯"
-#: ../src/main.c:369
+#: ../src/main.c:229
msgid "filename"
msgstr "கோபà¯à®ªà¯ பெயரà¯"
-#: ../src/main.c:370
+#: ../src/main.c:230
msgid "State file location"
msgstr "கோபà¯à®ªà®¿à®©à¯ இரà¯à®ªà¯à®ªà®¿à®Ÿà®¤à¯à®¤à¯ˆà®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®µà¯à®®à¯"
-#: ../src/main.c:370
+#: ../src/main.c:230
msgid "/path/to/state.file"
msgstr "/path/to/state.file"
-#: ../src/main.c:396
-#, c-format
-msgid "GModules are not supported on your platform!\n"
-msgstr "உஙà¯à®•à®³à¯ இயகà¯à®•à¯à®¤à®³à®¤à¯à®¤à®¿à®²à¯ GModules கà¯à®•à¯ ஆதரவிலà¯à®²à¯ˆ!\n"
-
-#: ../src/main.c:401
-#, c-format
-msgid "You must be root to run NetworkManager!\n"
-msgstr "NetworkManager ஠இயகà¯à®• நீஙà¯à®•à®³à¯ மூலப௠பயனராக இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯!\n"
-
-#: ../src/main.c:424
+#: ../src/main.c:244
msgid ""
"NetworkManager monitors all network connections and automatically\n"
"chooses the best connection to use. It also allows the user to\n"
@@ -7351,51 +8266,88 @@ msgstr ""
"வயரà¯à®²à¯†à®¸à¯ அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿à®•à®³à¯ˆ பயனரே கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®µà¯à®®à¯ அனà¯à®®à®¤à®¿à®•à¯à®•à®¿à®±à®¤à¯\n"
"."
-#: ../src/main.c:430 ../src/main.c:446
+#: ../src/main.c:257 ../src/main-utils.c:271 ../src/nm-iface-helper.c:346
#, c-format
msgid "%s. Please use --help to see a list of valid options.\n"
msgstr ""
"%s. --help஠பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®¿ சரியான விரà¯à®ªà¯à®ªà®™à¯à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯ˆà®ªà¯ பாரà¯à®•à¯à®•à®µà¯à®®à¯.\n"
-#: ../src/main.c:451
+#: ../src/main.c:262 ../src/nm-iface-helper.c:351
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' passed on command line.\n"
msgstr ""
"கடà¯à®Ÿà®³à¯ˆà®µà®°à®¿à®¯à®¿à®²à¯ வழஙà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ அடையாளம௠காணபà¯à®ªà®Ÿà®¾à®¤ பதிவிடல௠களஙà¯à®•à®³à¯ '%s' "
"பà¯à®±à®•à¯à®•à®ªà¯à®ªà®£à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®©.\n"
-#: ../src/main.c:502
+#: ../src/main.c:307
#, c-format
msgid "Failed to read configuration: (%d) %s\n"
msgstr "அமைவாகà¯à®•à®¤à¯à®¤à¯ˆ வாசிபà¯à®ªà®¤à®¿à®²à¯ பிழை: (%d) %s\n"
-#: ../src/main.c:516
+#: ../src/main.c:321
#, c-format
msgid "Error in configuration file: %s.\n"
msgstr "அமைவாகà¯à®•à®•à¯ கோபà¯à®ªà®¿à®²à¯ பிழை: %s.\n"
-#: ../src/main.c:521
+#: ../src/main.c:326
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' from config files.\n"
msgstr ""
"அமைவாகà¯à®•à®•à¯ கோபà¯à®ªà®¿à®²à¯à®³à¯à®³ அடையாளம௠காணபà¯à®ªà®Ÿà®¾à®¤ பதிவிடல௠களஙà¯à®•à®³à¯ '%s' "
"பà¯à®±à®•à¯à®•à®ªà¯à®ªà®£à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®©.\n"
-#: ../src/main.c:529
+#: ../src/main.c:334
#, c-format
msgid "State file %s parsing failed: (%d) %s\n"
msgstr "நிலைக௠கோபà¯à®ªà¯ %s à®à®ªà¯ பாகà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: (%d) %s\n"
-#: ../src/main.c:542
+#: ../src/main.c:347 ../src/nm-iface-helper.c:368
#, c-format
msgid "Could not daemonize: %s [error %u]\n"
msgstr "டெமானாகà¯à®• à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s [error %u]\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:143
+#: ../src/main-utils.c:115
+#, c-format
+msgid "Failed to set signal mask: %d"
+msgstr "சிகà¯à®©à®²à¯ மூடà¯à®¤à®²à¯ˆ அமைபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %d"
+
+#: ../src/main-utils.c:124
+#, c-format
+msgid "Failed to create signal handling thread: %d"
+msgstr "சிகà¯à®©à®²à¯ˆà®•à¯ கையாளà¯à®®à¯ இழையை உரà¯à®µà®¾à®•à¯à®•à¯à®µà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %d"
+
+#: ../src/main-utils.c:139
+#, c-format
+msgid "Opening %s failed: %s\n"
+msgstr "%s à®à®¤à¯ திறபà¯à®ªà®¤à®¿à®²à¯ தோலà¯à®µà®¿: %s\n"
+
+#: ../src/main-utils.c:145
+#, c-format
+msgid "Writing to %s failed: %s\n"
+msgstr "%s இல௠எழà¯à®¤à¯à®¤à®²à¯ தோலà¯à®µà®¿: %s\n"
+
+#: ../src/main-utils.c:150
+#, c-format
+msgid "Closing %s failed: %s\n"
+msgstr "%s ஠மூடà¯à®¤à®²à¯ தோலà¯à®µà®¿: %s\n"
+
+#: ../src/main-utils.c:206
+#, c-format
+#| msgid "NetworkManager is already running (pid %ld)\n"
+msgid "%s is already running (pid %ld)\n"
+msgstr "%s à®à®±à¯à®•à®©à®µà¯‡ இயஙà¯à®•à®¿à®•à¯à®•à¯Šà®£à¯à®Ÿà¯à®³à¯à®³à®¤à¯ (pid %ld)\n"
+
+#: ../src/main-utils.c:248
+#, c-format
+#| msgid "You must be root to run NetworkManager!\n"
+msgid "You must be root to run %s!\n"
+msgstr "%s ஠இயகà¯à®• நீஙà¯à®•à®³à¯ ரூட௠பயனராக இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à¯!\n"
+
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:204
msgid "# Created by NetworkManager\n"
msgstr "# Created by NetworkManager\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:150
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:211
#, c-format
msgid ""
"# Merged from %s\n"
@@ -7404,23 +8356,16 @@ msgstr ""
"# Merged from %s\n"
"\n"
-#: ../src/dhcp-manager/nm-dhcp-manager.c:302
+#: ../src/dhcp-manager/nm-dhcp-manager.c:130
+#, c-format
+#| msgid "'dhcpcd' could not be found or was disabled."
+msgid "'%s' support not found or not enabled."
+msgstr "'%s' ஆதரவ௠இலà¯à®²à¯ˆ அலà¯à®²à®¤à¯ செயலà¯à®ªà®Ÿà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
+
+#: ../src/dhcp-manager/nm-dhcp-manager.c:177
msgid "no usable DHCP client could be found."
msgstr "பயனà¯à®ªà®Ÿà®•à¯à®•à¯‚டிய DHCP வாடிகà¯à®•à¯ˆà®¯à®¾à®³à®°à¯ காணபà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ"
-#: ../src/dhcp-manager/nm-dhcp-manager.c:311
-msgid "'dhclient' could not be found or was disabled."
-msgstr "'dhclient' à®à®•à¯ கணà¯à®Ÿà¯à®ªà®¿à®Ÿà®¿à®•à¯à®•à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ அலà¯à®²à®¤à¯ à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:321
-msgid "'dhcpcd' could not be found or was disabled."
-msgstr "'dhcpcd' à®à®•à¯ கணà¯à®Ÿà¯à®ªà®¿à®Ÿà®¿à®•à¯à®•à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ அலà¯à®²à®¤à¯ à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:329
-#, c-format
-msgid "unsupported DHCP client '%s'"
-msgstr "தà¯à®£à¯ˆà®ªà¯à®°à®¿à®¯à®¾à®¤ DHCP வாடிகà¯à®•à¯ˆà®¯à®¾à®³à®°à¯ '%s'"
-
#: ../src/dns-manager/nm-dns-manager.c:374
msgid "NOTE: the libc resolver may not support more than 3 nameservers."
msgstr ""
@@ -7430,140 +8375,446 @@ msgstr ""
msgid "The nameservers listed below may not be recognized."
msgstr "கீழே படà¯à®Ÿà®¿à®¯à®²à®¿à®Ÿà¯à®Ÿà®ªà¯à®ªà®Ÿà¯à®³à¯à®³ பெயரà¯à®šà¯‡à®µà¯ˆà®¯à®•à®™à¯à®•à®³à¯ கணà¯à®Ÿà¯à®ªà®¿à®Ÿà®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ."
-#: ../src/devices/adsl/nm-device-adsl.c:127
+#: ../src/devices/adsl/nm-device-adsl.c:129
msgid "ADSL connection"
msgstr "ADSL இணைபà¯à®ªà¯"
-#: ../src/devices/bluetooth/nm-bluez-device.c:189
+#: ../src/devices/bluetooth/nm-bluez-device.c:200
#, c-format
msgid "%s Network"
msgstr "%s பிணையமà¯"
-#: ../src/devices/bluetooth/nm-device-bt.c:274
+#: ../src/devices/bluetooth/nm-device-bt.c:254
+msgid "PAN requested, but Bluetooth device does not support NAP"
+msgstr "PAN கோரபà¯à®ªà®Ÿà¯à®Ÿà®¤à¯, ஆனால௠Bluetooth சாதனமானத௠NAP ஠ஆதரிகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:264
+msgid "PAN connections cannot specify GSM, CDMA, or serial settings"
+msgstr "PAN இணைபà¯à®ªà¯à®•à®³à¯ GSM, CDMA அலà¯à®²à®¤à¯ தொடர௠அமைவà¯à®•à®³à¯ˆà®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®•à¯à®•à¯‚டாதà¯"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:277
msgid "PAN connection"
msgstr "PAN இணைபà¯à®ªà¯"
-#: ../src/devices/bluetooth/nm-device-bt.c:299
-#: ../src/devices/wwan/nm-modem-broadband.c:483
+#: ../src/devices/bluetooth/nm-device-bt.c:284
+msgid "DUN requested, but Bluetooth device does not support DUN"
+msgstr "DUN கோரபà¯à®ªà®Ÿà¯à®Ÿà®¤à¯, ஆனால௠Bluetooth சாதனமானத௠DUN ஠ஆதரிகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:294
+msgid "DUN connection must include a GSM or CDMA setting"
+msgstr "DUN இணைபà¯à®ªà®¿à®²à¯ GSM அலà¯à®²à®¤à¯ CDMA அமைவ௠கடà¯à®Ÿà®¾à®¯à®®à¯ இடமà¯à®ªà¯†à®± வேணà¯à®Ÿà¯à®®à¯"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:304
+#: ../src/devices/wwan/nm-modem-broadband.c:488
msgid "GSM connection"
msgstr "GSM இணைபà¯à®ªà¯"
-#: ../src/devices/bluetooth/nm-device-bt.c:303
-#: ../src/devices/wwan/nm-modem-broadband.c:506
+#: ../src/devices/bluetooth/nm-device-bt.c:308
+#: ../src/devices/wwan/nm-modem-broadband.c:511
msgid "CDMA connection"
msgstr "CDMA இணைபà¯à®ªà¯"
-#: ../src/devices/bluetooth/nm-device-bt.c:307
-msgid "DUN connection"
-msgstr "DUN இணைபà¯à®ªà¯"
+#: ../src/devices/bluetooth/nm-device-bt.c:316
+msgid "Unknown/unhandled Bluetooth connection type"
+msgstr "தெரியாத/கையாளபà¯à®ªà®Ÿà®¾à®¤ Bluetooth இணைபà¯à®ªà¯ வகை"
-#: ../src/devices/nm-device-bond.c:137
+#: ../src/devices/bluetooth/nm-device-bt.c:336
+#: ../src/devices/nm-device-ethernet.c:1442
+#: ../src/devices/nm-device-infiniband.c:196
+#: ../src/devices/wifi/nm-device-wifi.c:1123
+#: ../src/devices/wimax/nm-device-wimax.c:450
+#| msgid "connection type '%s' is not valid"
+msgid "connection does not match device"
+msgstr "இணைபà¯à®ªà¯à®®à¯ சாதனமà¯à®®à¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ"
+
+#: ../src/devices/nm-device-bond.c:124
msgid "Bond connection"
msgstr "பிணைபà¯à®ªà¯ இணைபà¯à®ªà¯"
-#: ../src/devices/nm-device-bridge.c:144
+#: ../src/devices/nm-device-bridge.c:131
msgid "Bridge connection"
msgstr "பிரிடà¯à®œà¯ இணைபà¯à®ªà¯"
-#: ../src/devices/nm-device-ethernet.c:1437
+#: ../src/devices/nm-device-ethernet.c:1425
msgid "PPPoE connection"
msgstr "PPPoE இணைபà¯à®ªà¯"
-#: ../src/devices/nm-device-ethernet.c:1437
+#: ../src/devices/nm-device-ethernet.c:1425
msgid "Wired connection"
msgstr "வயர௠இணைபà¯à®ªà¯"
-#: ../src/devices/nm-device-ethernet-utils.c:38
+#: ../src/devices/nm-device-ethernet-utils.c:40
#, c-format
msgid "Wired connection %d"
msgstr "வயர௠இணைபà¯à®ªà¯ %d"
-#: ../src/devices/nm-device-infiniband.c:189
+#: ../src/devices/nm-device-infiniband.c:178
msgid "InfiniBand connection"
msgstr "InfiniBand இணைபà¯à®ªà¯"
-#: ../src/devices/nm-device-vlan.c:229
+#: ../src/devices/nm-device-vlan.c:218
msgid "VLAN connection"
msgstr "VLAN இணைபà¯à®ªà¯"
-#: ../src/devices/team/nm-device-team.c:147
+#: ../src/devices/team/nm-device-team.c:134
msgid "Team connection"
msgstr "கà¯à®´à¯ இணைபà¯à®ªà¯"
-#: ../src/devices/wifi/nm-device-olpc-mesh.c:163
+#: ../src/devices/wifi/nm-device-olpc-mesh.c:151
msgid "Mesh"
msgstr "மெஷà¯"
-#: ../src/nm-config.c:303
+#: ../src/devices/wifi/nm-device-wifi.c:1093
+msgid "WPA Ad-Hoc disabled due to kernel bugs"
+msgstr "கெரà¯à®©à®²à¯ வழà¯à®•à¯à®•à®³à®¿à®©à¯ காரணமாக WPA Ad-Hoc à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:44
+#, c-format
+#| msgid "'%s=%s' is incompatible with '%s > 0'"
+msgid "%s is incompatible with static WEP keys"
+msgstr "%s ஆனத௠நிலையான WEP திறபà¯à®ªà¯à®•à®³à¯à®Ÿà®©à¯ இணகà¯à®•à®®à®±à¯à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:78
+#| msgid "Authentication required by wireless network"
+msgid "LEAP authentication requires a LEAP username"
+msgstr "LEAP à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯à®•à¯à®•à¯ LEAP பயனர௠பெயர௠அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:88
+msgid "LEAP username requires 'leap' authentication"
+msgstr "LEAP பயனர௠பெயரà¯à®•à¯à®•à¯ 'leap' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:101
+msgid "LEAP authentication requires IEEE 802.1x key management"
+msgstr "LEAP à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯à®•à¯à®•à¯, IEEE 802.1x திறபà¯à®ªà¯ நிரà¯à®µà®¾à®•à®®à¯ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:121
+msgid "LEAP authentication is incompatible with Ad-Hoc mode"
+msgstr "LEAP à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà®¾à®©à®¤à¯ Ad-Hoc à®®à¯à®±à¯ˆà®¯à¯à®Ÿà®©à¯ இணகà¯à®•à®®à®±à¯à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:133
+msgid "LEAP authentication is incompatible with 802.1x setting"
+msgstr "LEAP à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà®¾à®©à®¤à¯ 802.1x அமைவà¯à®Ÿà®©à¯ இணகà¯à®•à®®à®±à¯à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:155
+#, c-format
+msgid "a connection using '%s' authentication cannot use WPA key management"
+msgstr ""
+"'%s' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à¯ இணைபà¯à®ªà®¾à®²à¯ WPA திறபà¯à®ªà¯ நிரà¯à®µà®¾à®•à®¤à¯à®¤à¯ˆà®ªà¯ "
+"பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:166
+#, c-format
+msgid "a connection using '%s' authentication cannot specific WPA protocols"
+msgstr ""
+"'%s' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à¯ இணைபà¯à®ªà®¾à®©à®¤à¯ WPA நெறிமà¯à®±à¯ˆà®•à®³à¯ˆà®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿ "
+"à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:182
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:199
+#, c-format
+msgid "a connection using '%s' authentication cannot specific WPA ciphers"
+msgstr ""
+"'%s' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à¯ இணைபà¯à®ªà®¾à®©à®¤à¯ WPA சிபரà¯à®•à®³à¯ˆà®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿ à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:211
+#, c-format
+msgid "a connection using '%s' authentication cannot specific a WPA password"
+msgstr ""
+"'%s' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à¯ இணைபà¯à®ªà®¾à®©à®¤à¯ WPA கடவà¯à®šà¯à®šà¯Šà®²à¯à®²à¯ˆà®•à¯ கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿ "
+"à®®à¯à®Ÿà®¿à®¯à®¾à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:242
+#| msgid "Dynamic WEP (802.1x)"
+msgid "Dynamic WEP requires an 802.1x setting"
+msgstr "டயனமிக௠WEP கà¯à®•à¯ 802.1x அமைவ௠அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:252
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:280
+msgid "Dynamic WEP requires 'open' authentication"
+msgstr "டயனமிக௠WEP கà¯à®•à¯ 'open' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:267
+msgid "Dynamic WEP requires 'ieee8021x' key management"
+msgstr "டயனமிக௠WEP கà¯à®•à¯ 'ieee8021x' திறபà¯à®ªà¯ நிரà¯à®µà®¾à®•à®®à¯ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:314
+msgid "WPA-PSK authentication is incompatible with 802.1x"
+msgstr "WPA-PSK à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà®¾à®©à®¤à¯ 802.1x உடன௠இணகà¯à®•à®®à®±à¯à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:324
+#| msgid "Wired 802.1X authentication"
+msgid "WPA-PSK requires 'open' authentication"
+msgstr "WPA-PSK கà¯à®•à¯ 'open' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:336
+msgid "WPA Ad-Hoc authentication requires an Ad-Hoc mode AP"
+msgstr "WPA Ad-Hoc à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯à®•à¯à®•à¯ ஒர௠Ad-Hoc à®®à¯à®±à¯ˆ AP அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:349
+msgid "WPA Ad-Hoc authentication requires 'wpa' protocol"
+msgstr "WPA Ad-Hoc à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯à®•à¯à®•à¯ 'wpa' நெறிமà¯à®±à¯ˆ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:361
+#| msgid "Authentication required by wireless network"
+msgid "WPA Ad-Hoc authentication requires 'none' pairwise cipher"
+msgstr "WPA Ad-Hoc à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯à®•à¯à®•à¯ 'none' பேரà¯à®µà¯ˆà®¸à¯ சிபர௠அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:373
+msgid "WPA Ad-Hoc requires 'tkip' group cipher"
+msgstr "WPA Ad-Hoc கà¯à®•à¯ 'tkip' கà¯à®´à¯ சிபர௠அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:387
+msgid "Access point does not support PSK but setting requires it"
+msgstr ""
+"அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿à®¯à®¾à®©à®¤à¯ PSK ஠ஆதரிகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ, ஆனால௠அமைவà¯à®•à¯à®•à¯ அத௠அவசியபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:417
+msgid "WPA-EAP authentication requires an 802.1x setting"
+msgstr "WPA-EAP à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯à®•à¯à®•à¯ ஒர௠802.1x அமைவ௠அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:427
+#| msgid "Wired 802.1X authentication"
+msgid "WPA-EAP requires 'open' authentication"
+msgstr "WPA-EAP கà¯à®•à¯ 'open' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:438
+msgid "802.1x setting requires 'wpa-eap' key management"
+msgstr "802.1x அமைவà¯à®•à¯à®•à¯ 'wpa-eap' திறபà¯à®ªà¯ நிரà¯à®µà®¾à®•à®®à¯ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:451
+msgid "Access point does not support 802.1x but setting requires it"
+msgstr ""
+"அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿à®¯à®¾à®©à®¤à¯ 802.1x ஠ஆதரிகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ, ஆனால௠அமைவà¯à®•à¯à®•à¯ அத௠அவசியபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:479
+msgid ""
+"Access point mode is Ad-Hoc but setting requires Infrastructure security"
+msgstr ""
+"அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿ à®®à¯à®±à¯ˆ Ad-Hoc ஆக உளà¯à®³à®¤à¯, ஆனால௠அமைவà¯à®•à¯à®•à¯ உளà¯à®•à®Ÿà¯à®Ÿà®®à¯ˆà®ªà¯à®ªà¯ பாதà¯à®•à®¾à®ªà¯à®ªà¯ "
+"அவசியபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:489
+msgid "Ad-Hoc mode is incompatible with 802.1x security"
+msgstr "Ad-Hoc à®®à¯à®±à¯ˆà®¯à®¾à®©à®¤à¯ 802.1x பாதà¯à®•à®¾à®ªà¯à®ªà¯à®Ÿà®©à¯ இணகà¯à®•à®®à®±à¯à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:498
+msgid "Ad-Hoc mode is incompatible with LEAP security"
+msgstr "Ad-Hoc à®®à¯à®±à¯ˆà®¯à®¾à®©à®¤à¯ LEAP பாதà¯à®•à®¾à®ªà¯à®ªà¯à®Ÿà®©à¯ இணகà¯à®•à®®à®±à¯à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:508
+msgid "Ad-Hoc mode requires 'open' authentication"
+msgstr "Ad-Hoc à®®à¯à®±à¯ˆà®•à¯à®•à¯ 'open' à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯ அவசியமà¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:518
+msgid ""
+"Access point mode is Infrastructure but setting requires Ad-Hoc security"
+msgstr ""
+"அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿ à®®à¯à®±à¯ˆà®¯à®¾à®©à®¤à¯ உளà¯à®•à®Ÿà¯à®Ÿà®®à¯ˆà®ªà¯à®ªà¯ எனà¯à®±à¯à®³à¯à®³à®¤à¯, ஆனால௠அமைவà¯à®•à¯à®•à¯ Ad-Hoc "
+"பாதà¯à®•à®¾à®ªà¯à®ªà¯ தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:560
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:590
+#, c-format
+msgid "connection does not match access point"
+msgstr "இணைபà¯à®ªà¯ அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿à®¯à¯à®Ÿà®©à¯ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:614
+msgid "Access point is unencrypted but setting specifies security"
+msgstr ""
+"அணà¯à®•à®²à¯ பà¯à®³à¯à®³à®¿à®¯à®¾à®©à®¤à¯ மறைகà¯à®±à®¿à®¯à®¾à®•à¯à®•à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ, ஆனால௠அமைவானத௠பாதà¯à®•à®¾à®ªà¯à®ªà¯ˆà®•à¯ "
+"கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà¯à®•à®¿à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:703
+msgid ""
+"WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic "
+"WEP"
+msgstr ""
+"WPA à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà®¾à®©à®¤à¯ EAP அலà¯à®²à®¾à®¤ (à®®à¯à®¤à®²à¯) LEAP அலà¯à®²à®¤à¯ டயனமிக௠"
+"WEP ஆகியவறà¯à®±à¯à®Ÿà®©à¯ இணகà¯à®•à®®à®±à¯à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:713
+msgid "WPA authentication is incompatible with Shared Key authentication"
+msgstr "WPA à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà®¾à®©à®¤à¯ பகிரபà¯à®ªà®Ÿà¯à®Ÿ திறபà¯à®ªà¯ à®…à®™à¯à®•à¯€à®•à®°à®¿à®ªà¯à®ªà¯à®Ÿà®©à¯ இணகà¯à®•à®®à®±à¯à®±à®¤à¯"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:760
+#| msgid "Failed to set symmetric key for decryption."
+msgid "Failed to determine AP security information"
+msgstr "AP பாதà¯à®•à®¾à®ªà¯à®ªà¯à®¤à¯ தகவலைத௠தீரà¯à®®à®¾à®©à®¿à®•à¯à®• à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯"
+
+#: ../src/devices/wwan/nm-modem-broadband.c:475
+#| msgid "Mobile broadband connection %d"
+msgid "GSM mobile broadband connection requires a 'gsm' setting"
+msgstr "GSM மொபைல௠பிராடà¯à®ªà¯‡à®£à¯à®Ÿà¯ இணைபà¯à®ªà¯à®•à¯à®•à¯ 'gsm' அமைவ௠அவசியமà¯"
+
+#: ../src/nm-config.c:356
msgid "Config file location"
msgstr "அமைவாகà¯à®•à®•à¯ கோபà¯à®ªà®¿à®©à¯ இரà¯à®ªà¯à®ªà®¿à®Ÿà®®à¯"
-#: ../src/nm-config.c:303
+#: ../src/nm-config.c:356
msgid "/path/to/config.file"
msgstr "/path/to/config.file"
-#: ../src/nm-config.c:304
+#: ../src/nm-config.c:357
msgid "Config directory location"
msgstr "அமைவாகà¯à®•à®•à¯ கோபà¯à®ªà®•à®¤à¯à®¤à®¿à®©à¯ இரà¯à®ªà¯à®ªà®¿à®Ÿà®®à¯"
-#: ../src/nm-config.c:304
+#: ../src/nm-config.c:357
msgid "/path/to/config/dir"
msgstr "/அமைவாகà¯à®•/கோபà¯à®ªà®•à®¤à¯à®¤à®¿/à®±à¯à®•à®¾à®©/இரà¯à®ªà¯à®ªà®¿à®Ÿà®®à¯"
-#: ../src/nm-config.c:306
+#: ../src/nm-config.c:359
msgid "List of plugins separated by ','"
msgstr "',' ஆல௠பிரிதà¯à®¤à®ªà®Ÿà®¿ செரà¯à®•à¯à®¨à®¿à®°à®²à¯à®•à®³à®¿à®©à¯ படà¯à®Ÿà®¿à®¯à®²à¯"
-#: ../src/nm-config.c:306
+#: ../src/nm-config.c:359
msgid "plugin1,plugin2"
msgstr "plugin1,plugin2"
#. These three are hidden for now, and should eventually just go away.
-#: ../src/nm-config.c:309
+#: ../src/nm-config.c:362
msgid "An http(s) address for checking internet connectivity"
msgstr "இணைய இணைபà¯à®ªà¯ˆà®šà¯ சோதிகà¯à®• ஒர௠http(s) à®®à¯à®•à®µà®°à®¿"
-#: ../src/nm-config.c:310
+#: ../src/nm-config.c:363
msgid "The interval between connectivity checks (in seconds)"
msgstr "இணைபà¯à®ªà¯ˆ சோதிகà¯à®•à¯à®®à¯ இடைவெளி (வினாடி)"
-#: ../src/nm-config.c:311
+#: ../src/nm-config.c:364
msgid "The expected start of the response"
msgstr "எதிரà¯à®ªà®¾à®°à¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ பதிலளிபà¯à®ªà®¿à®©à¯ தொடகà¯à®•à®®à¯"
-#: ../src/nm-config.c:311
+#: ../src/nm-config.c:364
msgid "Bingo!"
msgstr "Bingo!"
-#: ../src/nm-logging.c:159
+#. Interface/IP config
+#: ../src/nm-iface-helper.c:296
+#| msgid "Parent interface [none]: "
+msgid "The interface to manage"
+msgstr "நிரà¯à®µà®•à®¿à®•à¯à®• வேணà¯à®Ÿà®¿à®¯ இடைமà¯à®•à®®à¯"
+
+#: ../src/nm-iface-helper.c:296
+msgid "eth0"
+msgstr "eth0"
+
+#: ../src/nm-iface-helper.c:297
+#| msgid "connection"
+msgid "Connection UUID"
+msgstr "இணைபà¯à®ªà¯ UUID"
+
+#: ../src/nm-iface-helper.c:297
+msgid "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
+msgstr "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
+
+#: ../src/nm-iface-helper.c:298
+msgid "Whether to manage IPv6 SLAAC"
+msgstr "IPv6 SLAAC ஠நிரà¯à®µà®•à®¿à®•à¯à®• வேணà¯à®Ÿà¯à®®à®¾"
+
+#: ../src/nm-iface-helper.c:299
+msgid "Whether SLAAC must be successful"
+msgstr "SLAAC வெறà¯à®±à®¿à®•à®°à®®à®¾à®• இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à®¾"
+
+#: ../src/nm-iface-helper.c:300
+msgid "Use an IPv6 temporary privacy address"
+msgstr "IPv6 தறà¯à®•à®¾à®²à®¿à®• தனியà¯à®°à®¿à®®à¯ˆ à®®à¯à®•à®µà®°à®¿ ஒனà¯à®±à¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯"
+
+#: ../src/nm-iface-helper.c:301
+#| msgid "Cloned MAC address"
+msgid "Current DHCPv4 address"
+msgstr "தறà¯à®ªà¯‹à®¤à¯ˆà®¯ DHCPv4 à®®à¯à®•à®µà®°à®¿"
+
+#: ../src/nm-iface-helper.c:302
+msgid "Whether DHCPv4 must be successful"
+msgstr "DHCPv4 வெறà¯à®±à®¿à®•à®°à®®à®¾à®• இரà¯à®•à¯à®• வேணà¯à®Ÿà¯à®®à®¾"
+
+#: ../src/nm-iface-helper.c:303
+#| msgid "unsupported DHCP client '%s'"
+msgid "Hex-encoded DHCPv4 client ID"
+msgstr "ஹெகà¯à®¸à¯-கà¯à®±à®¿à®¯à¯€à®Ÿà®¾à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ DHCPv4 கிளையன௠ID"
+
+#: ../src/nm-iface-helper.c:304
+msgid "Hostname to send to DHCP server"
+msgstr "DHCP சேவையகதà¯à®¤à®¿à®±à¯à®•à¯ அனà¯à®ªà¯à®ª வேணà¯à®Ÿà®¿à®¯ வழஙà¯à®•à®¿ பெயரà¯"
+
+#: ../src/nm-iface-helper.c:304
+msgid "barbar"
+msgstr "barbar"
+
+#: ../src/nm-iface-helper.c:305
+#| msgid "no priority to remove"
+msgid "Route priority for IPv4"
+msgstr "IPv4 கà¯à®•à®¾à®© தட à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ"
+
+#: ../src/nm-iface-helper.c:305
+msgid "0"
+msgstr "0"
+
+#: ../src/nm-iface-helper.c:306
+#| msgid "no priority to remove"
+msgid "Route priority for IPv6"
+msgstr "IPv6 கà¯à®•à®¾à®© தட à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯ˆ"
+
+#: ../src/nm-iface-helper.c:306
+msgid "1024"
+msgstr "1024"
+
+#: ../src/nm-iface-helper.c:307
+msgid "Hex-encoded Interface Identifier"
+msgstr "ஹெகà¯à®¸à¯-கà¯à®±à®¿à®¯à¯€à®Ÿà®¾à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ இடைமà¯à®• அடையாளஙà¯à®•à®¾à®Ÿà¯à®Ÿà®¿"
+
+#: ../src/nm-iface-helper.c:328
+msgid ""
+"nm-iface-helper is a small, standalone process that manages a single network "
+"interface."
+msgstr ""
+"nm-iface-helper எனà¯à®ªà®¤à¯ சிறிய, தனிதà¯à®¤à¯ இயஙà¯à®•à¯à®•à®¿à®©à¯à®± ஒர௠செயலாகà¯à®•à®®à®¾à®•à¯à®®à¯. அத௠ஒர௠"
+"பிணைய இடைமà¯à®•à®¤à¯à®¤à¯ˆ நிரà¯à®µà®•à®¿à®•à¯à®•à¯à®®à¯."
+
+#: ../src/nm-iface-helper.c:337
+#, c-format
+msgid "An interface name and UUID are required\n"
+msgstr "இடைமà¯à®•à®ªà¯ பெயர௠மறà¯à®±à¯à®®à¯ UUID தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯\n"
+
+#: ../src/nm-iface-helper.c:402
+#, c-format
+#| msgid "Failed to find expected PKCS#8 end tag '%s'."
+msgid "Failed to find interface index for %s\n"
+msgstr "%s கà¯à®•à®¾à®© இடைமà¯à®• கà¯à®±à®¿à®ªà¯à®ªà¯ˆà®•à¯ கணà¯à®Ÿà®±à®¿à®¯ à®®à¯à®Ÿà®¿à®¯à®¾à®®à®²à¯ போனதà¯\n"
+
+#: ../src/nm-iface-helper.c:418
+#, c-format
+msgid "(%s): Invalid IID %s\n"
+msgstr "(%s): தவறான IID %s\n"
+
+#: ../src/nm-logging.c:137
#, c-format
msgid "Unknown log level '%s'"
msgstr "தெரியாத பதிவ௠நிலை '%s'"
-#: ../src/nm-logging.c:241
+#: ../src/nm-logging.c:219
#, c-format
msgid "Unknown log domain '%s'"
msgstr "தெரியாத பதிவ௠டொமைன௠'%s'"
-#: ../src/nm-manager.c:3371
+#: ../src/nm-manager.c:3369
msgid "VPN connection"
msgstr "VPN இணைபà¯à®ªà¯"
-#: ../src/nm-sleep-monitor-systemd.c:114
+#: ../src/nm-sleep-monitor-systemd.c:115
msgid "NetworkManager needs to turn off networks"
msgstr "NetworkManager பிணையஙà¯à®•à®³à¯ˆ அணைகà¯à®• வேணà¯à®Ÿà®¿à®¯à¯à®³à¯à®³à®¤à¯"
-#: ../src/settings/plugins/ibft/plugin.c:67
+#: ../src/settings/plugins/ibft/plugin.c:66
#, c-format
msgid "ibft: failed to read iscsiadm records: %s"
msgstr "ibft: iscsiadm பதிவà¯à®•à®³à¯ˆ வாசிபà¯à®ªà®¤à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s"
-#: ../src/settings/plugins/ibft/plugin.c:75
+#: ../src/settings/plugins/ibft/plugin.c:74
#, c-format
msgid "ibft: read connection '%s'"
msgstr "ibft: இணைபà¯à®ªà¯ '%s' ஠வாசி"
-#: ../src/settings/plugins/ibft/plugin.c:81
+#: ../src/settings/plugins/ibft/plugin.c:80
#, c-format
msgid "ibft: failed to read iscsiadm record: %s"
msgstr "ibft: iscsiadm பதிவை வாசிதà¯à®¤à®²à¯ தோலà¯à®µà®¿à®¯à®Ÿà¯ˆà®¨à¯à®¤à®¤à¯: %s"
@@ -7572,6 +8823,62 @@ msgstr "ibft: iscsiadm பதிவை வாசிதà¯à®¤à®²à¯ தோலà¯à
msgid "System"
msgstr "கணினி"
+#~ msgid "invalid prefix '%s'; <1-32> allowed"
+#~ msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ '%s' ; <1-32> அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯"
+
+#~ msgid "invalid prefix '%s'; <1-128> allowed"
+#~ msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ '%s'; <1-128> அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯"
+
+#~ msgid "invalid route destination address '%s'"
+#~ msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ தட இலகà¯à®•à¯ à®®à¯à®•à®µà®°à®¿ '%s'"
+
+#~ msgid "invalid next hop address '%s'"
+#~ msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ hop à®®à¯à®•à®µà®°à®¿ '%s'"
+
+#~ msgid ""
+#~ "Error: 'mode': '%s' is not a valid InfiniBand transport mode [datagram, "
+#~ "connected]."
+#~ msgstr ""
+#~ "பிழை: 'mode': '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© InfiniBand போகà¯à®•à¯à®µà®°à®¤à¯à®¤à¯à®ªà¯ பயனà¯à®®à¯à®±à¯ˆ அலà¯à®² "
+#~ "[டேடà¯à®Ÿà®¾à®•à¯à®°à®¾à®®à¯, இணைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯]."
+
+#~ msgid "Error: Could not get system settings: %s."
+#~ msgstr "பிழை: கணினி அமைவà¯à®•à®³à¯ˆà®ªà¯ பெற à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s."
+
+#~ msgid "Error: Can't obtain connections: settings service is not running."
+#~ msgstr "பிழை: இணைபà¯à®ªà¯à®•à®³à¯ˆà®ªà¯ பெற à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: அமைவà¯à®•à®³à®¿à®©à¯ சேவை இயஙà¯à®•à®µà®¿à®²à¯à®²à¯ˆ."
+
+#~ msgid "Error: %s"
+#~ msgstr "பிழை: %s"
+
+#~ msgid "'%s' is not valid (use ip[/prefix] [gateway])"
+#~ msgstr "'%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®©à®¤à®²à¯à®² (ip[/prefix] [gateway] à®à®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤à®µà¯à®®à¯)"
+
+#~ msgid ""
+#~ "Update secrets expects a full connection, instead only a setting is "
+#~ "provided."
+#~ msgstr ""
+#~ "இரகசியஙà¯à®•à®³à¯ˆà®ªà¯ பà¯à®¤à¯à®ªà¯à®ªà®¿à®•à¯à®• à®®à¯à®´à¯ இணைபà¯à®ªà¯ எதிரà¯à®ªà®¾à®°à¯à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯, ஆனால௠ஒர௠அமைவ௠"
+#~ "மடà¯à®Ÿà¯à®®à¯‡ வழஙà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯."
+
+#~ msgid "connection type '%s' is not a valid base type"
+#~ msgstr "இணைபà¯à®ªà¯ வகை '%s' செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© அடிபà¯à®ªà®Ÿà¯ˆ வகையலà¯à®²"
+
+#~ msgid "Detect a slave connection with '"
+#~ msgstr "இதைக௠கொணà¯à®Ÿ ஒர௠ஸà¯à®²à¯‡à®µà¯ இணைபà¯à®ªà¯ˆà®•à¯ கணà¯à®Ÿà¯à®ªà®¿à®Ÿà®¿: '"
+
+#~ msgid "IPv4 address / label count mismatch (%d vs %d)"
+#~ msgstr "IPv4 à®®à¯à®•à®µà®°à®¿ / லேபிள௠எணà¯à®£à®¿à®•à¯à®•à¯ˆ பொரà¯à®¨à¯à®¤à®µà®¿à®²à¯à®²à¯ˆ (%d மறà¯à®±à¯à®®à¯ %d)"
+
+#~ msgid "GModules are not supported on your platform!\n"
+#~ msgstr "உஙà¯à®•à®³à¯ இயகà¯à®•à¯à®¤à®³à®¤à¯à®¤à®¿à®²à¯ GModules கà¯à®•à¯ ஆதரவிலà¯à®²à¯ˆ!\n"
+
+#~ msgid "'dhclient' could not be found or was disabled."
+#~ msgstr "'dhclient' à®à®•à¯ கணà¯à®Ÿà¯à®ªà®¿à®Ÿà®¿à®•à¯à®•à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ அலà¯à®²à®¤à¯ à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯."
+
+#~ msgid "DUN connection"
+#~ msgstr "DUN இணைபà¯à®ªà¯"
+
#~ msgid "not running"
#~ msgstr "இயஙà¯à®•à®µà®¿à®²à¯à®²à¯ˆ"
@@ -7582,10 +8889,6 @@ msgstr "கணினி"
#~ msgid "invalid value in compatibility property"
#~ msgstr "இணகà¯à®•à®¤à¯à®¤à®©à¯à®®à¯ˆ பணà¯à®ªà®¿à®²à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ மதிபà¯à®ªà¯"
-#~| msgid "invalid field '%s'"
-#~ msgid "invalid IPv4 route '%s'"
-#~ msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ IPv4 தடம௠'%s'"
-
#~ msgid "invalid prefix '%s'; <0-32> allowed"
#~ msgstr "செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®•à®¾à®¤ à®®à¯à®©à¯à®©à¯Šà®Ÿà¯à®Ÿà¯ '%s'; <0-32> அனà¯à®®à®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯"
@@ -7625,34 +8928,16 @@ msgstr "கணினி"
#~ msgid "There are 3 optional arguments for '%s' connection type.\n"
#~ msgstr "'%s' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ 3 கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ உளà¯à®³à®©.\n"
-#~ msgid "Do you want to provide them? (yes/no) [yes] "
-#~ msgstr "அவறà¯à®±à¯ˆ வழஙà¯à®• விரà¯à®®à¯à®ªà¯à®•à®¿à®±à¯€à®°à¯à®•à®³à®¾? (yes/no) [yes] "
-
-#~ msgid "There are 5 optional arguments for 'InfiniBand' connection type.\n"
-#~ msgstr "'InfiniBand' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ 5 கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ உளà¯à®³à®©.\n"
-
#~ msgid "Transport mode (datagram or connected) [datagram]: "
#~ msgstr "போகà¯à®•à¯à®µà®°à®¤à¯à®¤à¯à®ªà¯ பயனà¯à®®à¯à®±à¯ˆ (டேடà¯à®Ÿà®¾à®•à¯à®°à®¾à®®à¯ அலà¯à®²à®¤à¯ இணைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯) [datagram]: "
-#~ msgid "There is 1 optional argument for 'WiMax' connection type.\n"
-#~ msgstr "'WiMax' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± 1 மதிபà¯à®ªà¯à®°à¯ உளà¯à®³à®¤à¯.\n"
-
-#~ msgid "There are 4 optional arguments for 'PPPoE' connection type.\n"
-#~ msgstr "'PPPoE' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ 4 கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ உளà¯à®³à®©.\n"
-
#~ msgid ""
#~ "There are 2 optional arguments for 'mobile broadband' connection type.\n"
#~ msgstr "'மொபைல௠பிராடà¯à®ªà¯‡à®©à¯à®Ÿà¯' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ 2 கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ உளà¯à®³à®©.\n"
-#~ msgid "There is 1 optional argument for 'bluetooth' connection type.\n"
-#~ msgstr "'bluetooth' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± 1 மதிபà¯à®ªà¯à®°à¯ உளà¯à®³à®¤à¯.\n"
-
#~ msgid "Bluetooth type (panu, dun-gsm or dun-cdma) [panu]: "
#~ msgstr "Bluetooth வகை (panu, dun-gsm அலà¯à®²à®¤à¯ dun-cdma) [panu]: "
-#~ msgid "There are 4 optional arguments for 'VLAN' connection type.\n"
-#~ msgstr "'VLAN' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ 4 கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ உளà¯à®³à®©.\n"
-
#~ msgid "There are optional arguments for 'bond' connection type.\n"
#~ msgstr "'bond' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ உளà¯à®³à®©.\n"
@@ -7680,13 +8965,6 @@ msgstr "கணினி"
#~ msgid "There is 1 optional argument for 'VPN' connection type.\n"
#~ msgstr "'VPN' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± 1 மதிபà¯à®ªà¯à®°à¯ உளà¯à®³à®¤à¯.\n"
-#~ msgid "There are 2 optional arguments for 'OLPC Mesh' connection type.\n"
-#~ msgstr "'OLPC Mesh' இணைபà¯à®ªà¯ வகைகà¯à®•à¯ 2 கடà¯à®Ÿà®¾à®¯à®®à®±à¯à®± மதிபà¯à®ªà¯à®°à¯à®•à¯à®•à®³à¯ உளà¯à®³à®©.\n"
-
-#~| msgid "'%s' is neither an UUID nor an interface name"
-#~ msgid "Error: 'master': '%s' is not valid UUID nor interface."
-#~ msgstr "பிழை: 'master': '%s' எனà¯à®ªà®¤à¯ செலà¯à®²à¯à®ªà®Ÿà®¿à®¯à®¾à®© UUID அலà¯à®², இடைமà¯à®•à®®à¯à®®à¯ அலà¯à®²."
-
#~ msgid ""
#~ "save :: save the connection\n"
#~ "\n"
@@ -7899,21 +9177,12 @@ msgstr "கணினி"
#~ msgid "setting '%s' is required"
#~ msgstr "அமைவ௠'%s' தேவைபà¯à®ªà®Ÿà¯à®•à®¿à®±à®¤à¯"
-#~ msgid "'%s' setting is required for the connection when the property is set"
-#~ msgstr "பணà¯à®ªà¯ அமைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯ போத௠இணைபà¯à®ªà¯à®•à¯à®•à¯ '%s' அமைபà¯à®ªà¯ தேவை"
-
#~ msgid "unable to allocate netlink link cache for monitoring link status: %s"
#~ msgstr "இணைபà¯à®ªà¯ நிலையை கணà¯à®•à®¾à®©à®¿à®•à¯à®• netlink இணைபà¯à®ªà¯ செகà¯à®•à¯ˆ ஒதà¯à®•à¯à®•à®¿à®Ÿ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s"
-#~ msgid "error updating link cache: %s"
-#~ msgstr "பிழை மேமà¯à®ªà®Ÿà¯à®¤à¯à®¤à¯à®®à¯ இணைபà¯à®ªà¯ செகà¯: %s"
-
#~ msgid "Waits for a successful connection in NetworkManager."
#~ msgstr "இணைபà¯à®ªà¯ வெறà¯à®±à®¿à®•à®°à®®à®¾à®• கிடைகà¯à®•à¯à®®à¯ வரை NetworkManager இல௠காதà¯à®¤à®¿à®°à¯à®•à¯à®•à¯à®®à¯."
-#~ msgid "Error: no valid parameter specified."
-#~ msgstr "பிழை: கà¯à®±à®¿à®ªà¯à®ªà®¿à®Ÿà®ªà¯à®ªà®Ÿà¯à®Ÿ சரியான அளவà¯à®°à¯ இலà¯à®²à¯ˆ."
-
#~ msgid "Error: Can't find out if NetworkManager is running: %s."
#~ msgstr "பிழை: NetworkManager இயஙà¯à®•à¯à®•à®¿à®±à®¤à®¾ எனக௠கணà¯à®Ÿà®±à®¿à®¯ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ: %s."
diff --git a/po/te.po b/po/te.po
index 6b105dbff3..ef7c8608e5 100644
--- a/po/te.po
+++ b/po/te.po
@@ -1655,7 +1655,6 @@ msgstr "దోషం: '%s': '%s' చెలà±à°²à±à°¨à°¦à°¿ కాదà±; <%u-%
#. Ask for optional arguments.
#: ../clients/cli/connections.c:2808
#, c-format
-#| msgid "There is 1 optional argument for '%s' connection type.\n"
msgid "There is %d optional argument for '%s' connection type.\n"
msgid_plural "There are %d optional arguments for '%s' connection type.\n"
msgstr[0] "'%s' à°…à°¨à±à°¸à°‚ధాన à°°à°•à°‚ కొరకౠ%d à°à°šà±à°šà°¿à°• ఆరà±à°—à±à°®à±†à°‚టౠఉంది.\n"
diff --git a/po/tr.po b/po/tr.po
index f15b3c1516..a6e45e30f5 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -4,382 +4,607 @@
#
# Alperen Yusuf Aybar <alperen@aybar.biz>, 2006.
# Muhammet Kara <muhammet.k@gmail.com>, 2012.
+# Necdet Yücel <necdetyucel@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: NetworkManager master\n"
-"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
-"product=NetworkManager&keywords=I18N+L10N&component=general\n"
-"POT-Creation-Date: 2013-03-30 15:29+0000\n"
-"PO-Revision-Date: 2013-04-06 18:00+0200\n"
-"Last-Translator: etc <etcetin@gmail.com>\n"
+"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=Network"
+"Manager&keywords=I18N+L10N&component=Translations\n"
+"POT-Creation-Date: 2014-11-07 11:13+0000\n"
+"PO-Revision-Date: 2014-11-30 21:11+0000\n"
+"Last-Translator: Necdet Yücel <necdetyucel@gmail.com>\n"
"Language-Team: Turkish <gnome-turk@gnome.org>\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Pootle 2.5.1.1\n"
"X-Launchpad-Export-Date: 2012-01-03 09:56+0000\n"
-"X-Generator: Poedit 1.5.4\n"
+"X-POOTLE-MTIME: 1417381917.000000\n"
-#: ../cli/src/common.c:32 ../cli/src/common.c:44 ../cli/src/common.c:52
-#: ../cli/src/common.c:63 ../cli/src/connections.c:133
-#: ../cli/src/connections.c:167
+#: ../clients/cli/agent.c:42
+#, c-format
+msgid ""
+"Usage: nmcli agent { COMMAND | help }\n"
+"\n"
+"COMMAND := { secret | polkit | all }\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli agent { KOMUT | help }\n"
+"\n"
+"KOMUT := { sır | polkit | tümü }\n"
+"\n"
+
+#: ../clients/cli/agent.c:50
+#, c-format
+msgid ""
+"Usage: nmcli agent secret { help }\n"
+"\n"
+"Runs nmcli as NetworkManager secret agent. When NetworkManager requires\n"
+"a password it asks registered agents for it. This command keeps nmcli "
+"running\n"
+"and if a password is required asks the user for it.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli agent secret { help }\n"
+"\n"
+"nmcli'yi NetworkManager gizli ajanı olarak çalıştırır. NetworkManager parola "
+"sorduÄŸunda\n"
+"bunu kayıtlı ajana sorar. Bu komut nmcli'yi çalışır halde tutar\n"
+"ve bir parola sorulduğunda bunu kullanıcıya iletir.\n"
+"\n"
+
+#: ../clients/cli/agent.c:60
+#, c-format
+msgid ""
+"Usage: nmcli agent polkit { help }\n"
+"\n"
+"Registers nmcli as a polkit action for the user session.\n"
+"When a polkit daemon requires an authorization, nmcli asks the user and "
+"gives\n"
+"the reponse back to polkit.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli agent polkit { help }\n"
+"\n"
+"Kullanıcı oturumu için nmcli'yi bir polkit aracı olarak kaydeder.\n"
+"Polkit sürecinin kimlik doğrulamaya ihtiyacı olduğunda nmcli bunu "
+"kullanıcıya\n"
+"sorar ver aldığı cevabı polkit'e iletir.\n"
+"\n"
+
+#: ../clients/cli/agent.c:70
+#, c-format
+msgid ""
+"Usage: nmcli agent all { help }\n"
+"\n"
+"Runs nmcli as both NetworkManager secret and a polkit agent.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli agent all { help }\n"
+"\n"
+"nmcli hem NetworkManager sırrı hem de bir polkit aaracı olarak çalıştırılır."
+"\n"
+"\n"
+
+#: ../clients/cli/agent.c:151
+#, c-format
+msgid "nmcli successfully registered as a NetworkManager's secret agent.\n"
+msgstr "nmcli başarıyla NetworkManager'ın sır aracı olarak kaydettirildi.\n"
+
+#: ../clients/cli/agent.c:153
+#, c-format
+#| msgid "Modem initialization failed"
+msgid "Error: secret agent initialization failed"
+msgstr "Hata: sır aracı başlatılamadı"
+
+#: ../clients/cli/agent.c:168
+#, c-format
+#| msgid "Error: Connection activation failed: %s"
+msgid "Error: polkit agent initialization failed: %s"
+msgstr "Hata: polkit aracı başlatılamadı: %s"
+
+#: ../clients/cli/agent.c:176
+#, c-format
+msgid "nmcli successfully registered as a polkit agent.\n"
+msgstr "nmcli başarıyla bir polkit aracı olarak kaydettirildi.\n"
+
+#: ../clients/cli/agent.c:208 ../clients/cli/connections.c:8657
+#: ../clients/cli/connections.c:8683 ../clients/cli/connections.c:8821
+#: ../clients/cli/devices.c:2790 ../clients/cli/general.c:325
+#: ../clients/cli/general.c:463
+#, c-format
+msgid "Error: NetworkManager is not running."
+msgstr "Hata: Ağ Yöneticisi çalışmıyor."
+
+#: ../clients/cli/agent.c:244
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'agent' command '%s' is not valid."
+msgstr "Hata: ''agent' komutu '%s' geçerli değil."
+
+#: ../clients/cli/common.c:38 ../clients/cli/common.c:50
+#: ../clients/cli/common.c:58 ../clients/cli/common.c:69
+#: ../clients/cli/connections.c:172 ../clients/cli/connections.c:194
msgid "GROUP"
msgstr "GRUP"
#. 0
-#: ../cli/src/common.c:33 ../cli/src/common.c:53
+#: ../clients/cli/common.c:39 ../clients/cli/common.c:59
msgid "ADDRESS"
msgstr "ADRES"
#. 1
-#: ../cli/src/common.c:34 ../cli/src/common.c:54
+#: ../clients/cli/common.c:40 ../clients/cli/common.c:60
msgid "ROUTE"
-msgstr ""
+msgstr "ROTA"
#. 2
-#: ../cli/src/common.c:35 ../cli/src/common.c:55
+#: ../clients/cli/common.c:41 ../clients/cli/common.c:61
msgid "DNS"
msgstr "DNS"
#. 3
-#: ../cli/src/common.c:36 ../cli/src/common.c:56
+#: ../clients/cli/common.c:42 ../clients/cli/common.c:62
msgid "DOMAIN"
-msgstr ""
+msgstr "ALAN"
#. 4
-#: ../cli/src/common.c:37
+#: ../clients/cli/common.c:43
msgid "WINS"
-msgstr ""
+msgstr "WINS"
#. 0
-#: ../cli/src/common.c:45 ../cli/src/common.c:64
-#| msgid "CONNECTION"
+#: ../clients/cli/common.c:51 ../clients/cli/common.c:70
msgid "OPTION"
msgstr "SEÇENEK"
-#: ../cli/src/common.c:366
+#: ../clients/cli/common.c:377 ../clients/cli/settings.c:3113
+#: ../clients/cli/settings.c:3132
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "invalid IPv4 address '%s'"
+msgstr "geçersiz IPv4 adresi '%s'"
+
+#: ../clients/cli/common.c:385
+#, c-format
+msgid "invalid prefix '%s'; <1-32> allowed"
+msgstr "geçersiz önek '%s'; <1-32> izin veriliyor"
+
+#: ../clients/cli/common.c:392 ../clients/cli/common.c:445
+#, c-format
+#| msgid "invalid field '%s'"
+msgid "invalid gateway '%s'"
+msgstr "geçersiz ağ geçidi '%s'"
+
+#: ../clients/cli/common.c:430 ../clients/cli/settings.c:3459
+#: ../clients/cli/settings.c:3478
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "invalid IPv6 address '%s'"
+msgstr "geçersiz IPv6 adresi '%s'"
+
+#: ../clients/cli/common.c:438
+#, c-format
+msgid "invalid prefix '%s'; <1-128> allowed"
+msgstr "geçersiz önek '%s'; <1-128> izin veriliyor"
+
+#: ../clients/cli/common.c:521
+#, c-format
+msgid "invalid route destination address '%s'"
+msgstr "geçersiz rota adresi '%s'"
+
+#: ../clients/cli/common.c:528
+#, c-format
+msgid "invalid prefix '%s'; <1-%d> allowed"
+msgstr "geçersiz önek '%s'; <1-%d> izin veriliyor"
+
+#: ../clients/cli/common.c:538
+#, c-format
+#| msgid "invalid field '%s'"
+msgid "invalid next hop address '%s'"
+msgstr "geçersiz sonraki atlama adresi '%s'"
+
+#: ../clients/cli/common.c:543
+#, c-format
+msgid ""
+"the second component of route ('%s') is neither a next hop address nor a "
+"metric"
+msgstr ""
+"rotanın ikinci atlama adresi ('%s') ne bir atlama adresi ne de bir metrik"
+
+#: ../clients/cli/common.c:553
+#, c-format
+#| msgid "invalid field '%s'"
+msgid "invalid metric '%s'"
+msgstr "geçersiz metrik '%s'"
+
+#: ../clients/cli/common.c:562
+msgid "default route cannot be added (NetworkManager handles it by itself)"
+msgstr "varsayılan rota eklenemedi (NetworkManager yönlendirecek)"
+
+#: ../clients/cli/common.c:650
msgid "unmanaged"
msgstr "yönetilmeyen"
-#: ../cli/src/common.c:368
+#: ../clients/cli/common.c:652
msgid "unavailable"
msgstr "mevcut deÄŸil"
-#: ../cli/src/common.c:370 ../cli/src/network-manager.c:120
+#: ../clients/cli/common.c:654 ../clients/cli/general.c:260
msgid "disconnected"
msgstr "bağlantı kesildi"
-#: ../cli/src/common.c:372
+#: ../clients/cli/common.c:656
msgid "connecting (prepare)"
msgstr "bağlanıyor (hazırlama)"
-#: ../cli/src/common.c:374
+#: ../clients/cli/common.c:658
msgid "connecting (configuring)"
msgstr "bağlanıyor (yapılandırılıyor)"
-#: ../cli/src/common.c:376
+#: ../clients/cli/common.c:660
msgid "connecting (need authentication)"
msgstr "bağlanıyor (kimlik doğrulama gerekiyor)"
-#: ../cli/src/common.c:378
+#: ../clients/cli/common.c:662
msgid "connecting (getting IP configuration)"
msgstr "bağlanıyor (IP yapılandırması alınıyor)"
-#: ../cli/src/common.c:380
+#: ../clients/cli/common.c:664
msgid "connecting (checking IP connectivity)"
msgstr "bağlanılıyor (IP bağlanılırlığı denetleniyor)"
-#: ../cli/src/common.c:382
+#: ../clients/cli/common.c:666
msgid "connecting (starting secondary connections)"
msgstr "bağlanılıyor (ikincil bağlantılar başlatılıyor)"
-#: ../cli/src/common.c:384 ../cli/src/network-manager.c:116
+#: ../clients/cli/common.c:668 ../clients/cli/general.c:256
msgid "connected"
msgstr "bağlandı"
-#: ../cli/src/common.c:386 ../cli/src/connections.c:466
+#: ../clients/cli/common.c:670 ../clients/cli/connections.c:552
msgid "deactivating"
msgstr "etkisizleÅŸtiriliyor"
-#: ../cli/src/common.c:388
+#: ../clients/cli/common.c:672
msgid "connection failed"
msgstr "bağlantı başarısız"
-#: ../cli/src/common.c:390 ../cli/src/connections.c:471
-#: ../cli/src/connections.c:494 ../cli/src/connections.c:1189
-#: ../cli/src/devices.c:664 ../cli/src/network-manager.c:123
-#: ../cli/src/network-manager.c:185 ../cli/src/network-manager.c:188
-#: ../cli/src/network-manager.c:197 ../cli/src/network-manager.c:257
-#: ../cli/src/network-manager.c:273 ../cli/src/network-manager.c:431
-#: ../cli/src/network-manager.c:486 ../cli/src/network-manager.c:524
-#: ../cli/src/network-manager.c:563 ../cli/src/settings.c:670
-#: ../cli/src/settings.c:698 ../cli/src/settings.c:760 ../cli/src/utils.c:549
-#: ../src/main.c:422 ../src/main.c:441
+#: ../clients/cli/common.c:674 ../clients/cli/connections.c:557
+#: ../clients/cli/connections.c:580 ../clients/cli/connections.c:1709
+#: ../clients/cli/devices.c:878 ../clients/cli/general.c:263
+#: ../clients/cli/general.c:281 ../clients/cli/general.c:411
+#: ../clients/cli/general.c:427 ../clients/cli/settings.c:704
+#: ../clients/cli/settings.c:766 ../clients/cli/settings.c:1059
+#: ../clients/cli/utils.c:1148 ../src/main.c:509 ../src/main.c:537
msgid "unknown"
msgstr "bilinmeyen"
-#: ../cli/src/common.c:399
+#: ../clients/cli/common.c:683
msgid "No reason given"
-msgstr ""
+msgstr "Açıklama verilmedi"
-#: ../cli/src/common.c:402
-#| msgid "Unknown"
+#: ../clients/cli/common.c:686 ../clients/cli/connections.c:2660
+#, c-format
msgid "Unknown error"
msgstr "Bilinmeyen hata"
-#: ../cli/src/common.c:405
+#: ../clients/cli/common.c:689
msgid "Device is now managed"
msgstr "Aygıt yönetiliyor"
-#: ../cli/src/common.c:408
+#: ../clients/cli/common.c:692
msgid "Device is now unmanaged"
msgstr "Aygıt yönetilmiyor"
-#: ../cli/src/common.c:411
-#| msgid "the VPN service returned invalid configuration"
+#: ../clients/cli/common.c:695
msgid "The device could not be readied for configuration"
msgstr "Aygıt yapılandırma için hazır değil"
-#: ../cli/src/common.c:414
+#: ../clients/cli/common.c:698
msgid ""
"IP configuration could not be reserved (no available address, timeout, etc.)"
msgstr ""
+"IP yapılandrıması saklanamadı (kullanılabili adres yok veya zaman aşımı gibi "
+"nedenlerle)"
-#: ../cli/src/common.c:417
+#: ../clients/cli/common.c:701
msgid "The IP configuration is no longer valid"
-msgstr ""
+msgstr "IP yapılandırması artık geçerli değil"
-#: ../cli/src/common.c:420
+#: ../clients/cli/common.c:704
msgid "Secrets were required, but not provided"
-msgstr ""
+msgstr "Gizli bilgiler gerekliydi ama girilmedi"
-#: ../cli/src/common.c:423
+#: ../clients/cli/common.c:707
msgid "802.1X supplicant disconnected"
msgstr "802.1X iletiÅŸimi koptu"
-#: ../cli/src/common.c:426
+#: ../clients/cli/common.c:710
msgid "802.1X supplicant configuration failed"
msgstr "802.1X iletişim yapılandırması başarısız"
-#: ../cli/src/common.c:429
+#: ../clients/cli/common.c:713
msgid "802.1X supplicant failed"
msgstr "802.1X iletişimi başarısız"
-#: ../cli/src/common.c:432
+#: ../clients/cli/common.c:716
msgid "802.1X supplicant took too long to authenticate"
msgstr "802.1X iletişim kimlik doğrulaması uzun sürecek gibi"
-#: ../cli/src/common.c:435
-#| msgid "the VPN service failed to start"
+#: ../clients/cli/common.c:719
msgid "PPP service failed to start"
msgstr "PPP hizmeti başlatılamadı"
-#: ../cli/src/common.c:438
-#| msgid "VPN disconnected"
+#: ../clients/cli/common.c:722
msgid "PPP service disconnected"
msgstr "PPP hizmeti koptu"
-#: ../cli/src/common.c:441
+#: ../clients/cli/common.c:725
msgid "PPP failed"
msgstr "PPP başarısız"
-#: ../cli/src/common.c:444
-#| msgid "the VPN service failed to start"
+#: ../clients/cli/common.c:728
msgid "DHCP client failed to start"
msgstr "DHCP istemcisi başlatılamadı"
-#: ../cli/src/common.c:447
+#: ../clients/cli/common.c:731
msgid "DHCP client error"
msgstr "DHCP istemci hatası"
-#: ../cli/src/common.c:450
-#| msgid "VPN connection failed"
+#: ../clients/cli/common.c:734
msgid "DHCP client failed"
msgstr "DHCP istemcisi başarısız"
-#: ../cli/src/common.c:453
-#| msgid "the VPN service failed to start"
+#: ../clients/cli/common.c:737
msgid "Shared connection service failed to start"
msgstr "Paylaşımlı ağ hizmeti başlatılamadı"
-#: ../cli/src/common.c:456
-#| msgid "connection failed"
+#: ../clients/cli/common.c:740
msgid "Shared connection service failed"
msgstr "Paylaşımlı bağlantı hizmeti başarısız"
-#: ../cli/src/common.c:459
-#| msgid "the VPN service failed to start"
+#: ../clients/cli/common.c:743
msgid "AutoIP service failed to start"
msgstr "AutoIP hizmeti başlatılamadı"
-#: ../cli/src/common.c:462
+#: ../clients/cli/common.c:746
msgid "AutoIP service error"
msgstr "AutoIP hizmet hatası"
-#: ../cli/src/common.c:465
-#| msgid "the VPN service failed to start"
+#: ../clients/cli/common.c:749
msgid "AutoIP service failed"
msgstr "AutoIP hizmeti başarısız"
-#: ../cli/src/common.c:468
+#: ../clients/cli/common.c:752
msgid "The line is busy"
msgstr "Hat meÅŸgul"
-#: ../cli/src/common.c:471
+#: ../clients/cli/common.c:755
msgid "No dial tone"
msgstr "Arama tonu yok"
-#: ../cli/src/common.c:474
+#: ../clients/cli/common.c:758
msgid "No carrier could be established"
msgstr "Bir operatöre bağlanılamadı"
-#: ../cli/src/common.c:477
+#: ../clients/cli/common.c:761
msgid "The dialing request timed out"
msgstr "Arama isteği zaman aşımına uğradı"
-#: ../cli/src/common.c:480
+#: ../clients/cli/common.c:764
msgid "The dialing attempt failed"
msgstr "Arama girişimi başarısız"
-#: ../cli/src/common.c:483
-#| msgid "Error: Connection activation failed."
+#: ../clients/cli/common.c:767
msgid "Modem initialization failed"
msgstr "Modem kurulumu başarısız"
-#: ../cli/src/common.c:486
-#| msgid "Failed to decrypt the private key."
+#: ../clients/cli/common.c:770
msgid "Failed to select the specified APN"
msgstr "Belirtilen APN seçimi başarısız"
-#: ../cli/src/common.c:489
+#: ../clients/cli/common.c:773
msgid "Not searching for networks"
msgstr "Ağlar için arama yapılmıyor"
-#: ../cli/src/common.c:492
-#| msgid "Networking enabled"
+#: ../clients/cli/common.c:776
msgid "Network registration denied"
msgstr "Ağa katılım engellendi"
-#: ../cli/src/common.c:495
+#: ../clients/cli/common.c:779
msgid "Network registration timed out"
msgstr "Ağ kaydı zaman aşımına uğradı"
-#: ../cli/src/common.c:498
+#: ../clients/cli/common.c:782
msgid "Failed to register with the requested network"
msgstr "İstenilen ağa kayıt başarısız"
-#: ../cli/src/common.c:501
-#| msgid "VPN connection failed"
+#: ../clients/cli/common.c:785
msgid "PIN check failed"
msgstr "PIN sorgulaması başarısız"
-#: ../cli/src/common.c:504
+#: ../clients/cli/common.c:788
msgid "Necessary firmware for the device may be missing"
msgstr "Aygıt için gerekli ürün yazılımı eksik olabilir"
-#: ../cli/src/common.c:507
-#| msgid "the connection was removed"
+#: ../clients/cli/common.c:791
msgid "The device was removed"
msgstr "Aygıt kaldırıldı"
-#: ../cli/src/common.c:510
-#| msgid "NetworkManager status"
+#: ../clients/cli/common.c:794
msgid "NetworkManager went to sleep"
msgstr "NetworkManager uyudu"
-#: ../cli/src/common.c:513
-#| msgid "no active connection or device"
+#: ../clients/cli/common.c:797
msgid "The device's active connection disappeared"
msgstr "Aygıtın varolan bağlantısı koptu"
-#: ../cli/src/common.c:516
+#: ../clients/cli/common.c:800
msgid "Device disconnected by user or client"
msgstr "Kullanıcı ya da istemci tarafından bağlantı koparıldı"
-#: ../cli/src/common.c:519
+#: ../clients/cli/common.c:803
msgid "Carrier/link changed"
msgstr "Operatör/bağlantı değişti"
-#: ../cli/src/common.c:522
-#| msgid "the connection was removed"
+#: ../clients/cli/common.c:806
msgid "The device's existing connection was assumed"
msgstr "Aygıtın mevcut bağlantısı kabul edildi"
-#: ../cli/src/common.c:525
+#: ../clients/cli/common.c:809
msgid "The supplicant is now available"
msgstr "Ä°letiÅŸim ÅŸimdi uygun"
-#: ../cli/src/common.c:528
-#| msgid "'dhcpcd' could be found."
+#: ../clients/cli/common.c:812
msgid "The modem could not be found"
msgstr "Modem bulunamadı"
-#: ../cli/src/common.c:531
-#| msgid "the connection attempt timed out"
+#: ../clients/cli/common.c:815
msgid "The Bluetooth connection failed or timed out"
msgstr "Bluetooth bağlantısı başarısız ya da zaman aşımına uğradı"
-#: ../cli/src/common.c:534
+#: ../clients/cli/common.c:818
msgid "GSM Modem's SIM card not inserted"
msgstr "GSM Modem'in SIM kartı yerleştirilmemiş"
-#: ../cli/src/common.c:537
+#: ../clients/cli/common.c:821
msgid "GSM Modem's SIM PIN required"
msgstr "GSM Modem'in SIM PIN'i gerekli"
-#: ../cli/src/common.c:540
+#: ../clients/cli/common.c:824
msgid "GSM Modem's SIM PUK required"
msgstr "GSM Modem'in SIM PUK'u gerekli"
-#: ../cli/src/common.c:543
+#: ../clients/cli/common.c:827
msgid "GSM Modem's SIM wrong"
msgstr "GSM Modem'in SIM'i yanlış"
-#: ../cli/src/common.c:546
+#: ../clients/cli/common.c:830
msgid "InfiniBand device does not support connected mode"
-msgstr ""
+msgstr "InfiniBand aygıtı bağlanılan kipi desteklemiyor"
-#: ../cli/src/common.c:549
-#| msgid "connection failed"
+#: ../clients/cli/common.c:833
msgid "A dependency of the connection failed"
msgstr "Bir bağlantı gereksinimi sağlanamadı, başarısız"
-#: ../cli/src/common.c:552
+#: ../clients/cli/common.c:836
msgid "A problem with the RFC 2684 Ethernet over ADSL bridge"
-msgstr ""
+msgstr "ADSL köprüsü üzerinden RFC 2684 Ethernet ile bir sorun oluştu"
-#: ../cli/src/common.c:555
+#: ../clients/cli/common.c:839
msgid "ModemManager is unavailable"
-msgstr ""
+msgstr "ModemManager kullanılabilir değil"
-#: ../cli/src/common.c:558
-#| msgid "'dhclient' could be found."
+#: ../clients/cli/common.c:842
msgid "The Wi-Fi network could not be found"
msgstr "Wi-Fi ağı bulunamadı"
-#: ../cli/src/common.c:561
+#: ../clients/cli/common.c:845
msgid "A secondary connection of the base connection failed"
-msgstr ""
+msgstr "Temel bağlantının ikincil bağlantısı başarısız"
+
+#: ../clients/cli/common.c:848
+msgid "DCB or FCoE setup failed"
+msgstr "DCB veya FCoE kurulumu başarısız"
-#: ../cli/src/common.c:564 ../cli/src/devices.c:310 ../cli/src/devices.c:328
-#: ../cli/src/devices.c:450 ../cli/src/devices.c:494
+#: ../clients/cli/common.c:851
+#| msgid "connection failed"
+msgid "teamd control failed"
+msgstr "teamd kontrolü başarısız"
+
+#: ../clients/cli/common.c:854
+msgid "Modem failed or no longer available"
+msgstr "Modem başarısız oldu veya artık kullanılabilir değil"
+
+#: ../clients/cli/common.c:857
+msgid "Modem now ready and available"
+msgstr "Modem şimdi hazır ve kullanılabilir"
+
+#: ../clients/cli/common.c:860
+msgid "SIM PIN was incorrect"
+msgstr "SIM PIN hatalı"
+
+#. TRANSLATORS: Unknown reason for a device state change (NMDeviceStateReason)
+#: ../clients/cli/common.c:864 ../clients/cli/devices.c:617
+#: ../libnm-glib/nm-device.c:1812 ../libnm/nm-device.c:1624
msgid "Unknown"
msgstr "Bilinmeyen"
+#: ../clients/cli/common.c:906
+#, c-format
+#| msgid "invalid field '%s'"
+msgid "invalid priority map '%s'"
+msgstr "geçersiz öncelik alanı '%s'"
+
+#: ../clients/cli/common.c:913 ../clients/cli/common.c:919
+#, c-format
+#| msgid "Error: timeout value '%s' is not valid."
+msgid "priority '%s' is not valid (<0-%ld>)"
+msgstr "'%s' önceliği geçerli değil (<0-%ld>)"
+
+#: ../clients/cli/common.c:986
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not a valid team configuration or file name."
+msgstr "'%s' geçerli bir takım yapılandırması veya dosya adı değil."
+
+#. define some prompts for connection editor
+#: ../clients/cli/connections.c:42
+msgid "Setting name? "
+msgstr "İsim ayarlansın mı? "
+
+#: ../clients/cli/connections.c:43
+msgid "Property name? "
+msgstr "Özellik ismi? "
+
+#: ../clients/cli/connections.c:44
+#| msgid "Active connection state: %s\n"
+msgid "Enter connection type: "
+msgstr "Bağlantı türünü girin: "
+
+#. define some other prompts
+#: ../clients/cli/connections.c:47
+#| msgid "Connection list"
+msgid "Connection type: "
+msgstr "Bağlantı türü: "
+
+#: ../clients/cli/connections.c:48
+msgid "VPN type: "
+msgstr "VPN türü: "
+
+#: ../clients/cli/connections.c:49
+msgid "Bond master: "
+msgstr "Birincil bağlantı: "
+
+#: ../clients/cli/connections.c:50
+msgid "Team master: "
+msgstr "Birincil takım: "
+
+#: ../clients/cli/connections.c:51
+msgid "Bridge master: "
+msgstr "Birincil köprü: "
+
+#: ../clients/cli/connections.c:52
+msgid "Connection (name, UUID, or path): "
+msgstr "Bağlantı (isim, UUID veya yol): "
+
#. 0
-#. used only for 'GENERAL' group listing
-#: ../cli/src/connections.c:60 ../cli/src/connections.c:134
-#: ../cli/src/devices.c:109 ../cli/src/devices.c:134 ../cli/src/devices.c:144
-#: ../cli/src/devices.c:154 ../cli/src/devices.c:164 ../cli/src/devices.c:180
-#: ../cli/src/devices.c:194 ../cli/src/devices.c:216 ../cli/src/devices.c:232
-#: ../cli/src/devices.c:241
+#: ../clients/cli/connections.c:60 ../clients/cli/connections.c:173
+#: ../clients/cli/devices.c:56 ../clients/cli/devices.c:85
+#: ../clients/cli/devices.c:95 ../clients/cli/devices.c:106
+#: ../clients/cli/devices.c:115 ../clients/cli/devices.c:130
+#: ../clients/cli/devices.c:143 ../clients/cli/devices.c:169
+#: ../clients/cli/devices.c:184 ../clients/cli/devices.c:193
+#: ../clients/cli/devices.c:202
msgid "NAME"
msgstr "Ä°SÄ°M"
#. 0
#. 1
-#: ../cli/src/connections.c:61 ../cli/src/connections.c:135
+#: ../clients/cli/connections.c:61 ../clients/cli/connections.c:174
msgid "UUID"
msgstr "Kullanıcı Kimliği"
@@ -387,796 +612,2893 @@ msgstr "Kullanıcı Kimliği"
#. 0
#. 1
#. 2
-#: ../cli/src/connections.c:62 ../cli/src/connections.c:168
-#: ../cli/src/devices.c:72 ../cli/src/devices.c:111 ../cli/src/devices.c:219
+#: ../clients/cli/connections.c:62 ../clients/cli/connections.c:195
+#: ../clients/cli/devices.c:42 ../clients/cli/devices.c:58
+#: ../clients/cli/devices.c:172
msgid "TYPE"
msgstr "TÃœR"
#. 2
-#: ../cli/src/connections.c:63
+#: ../clients/cli/connections.c:63
msgid "TIMESTAMP"
msgstr "ZAMANDAMGASI"
#. 3
-#: ../cli/src/connections.c:64
+#: ../clients/cli/connections.c:64
msgid "TIMESTAMP-REAL"
msgstr "ZAMANDAMGASI-GERÇEK"
#. 4
-#. 13
-#: ../cli/src/connections.c:65 ../cli/src/devices.c:123
+#. 15
+#: ../clients/cli/connections.c:65 ../clients/cli/devices.c:72
msgid "AUTOCONNECT"
msgstr "OTOMATÄ°K-BAÄžLANTI"
#. 5
-#: ../cli/src/connections.c:66
+#: ../clients/cli/connections.c:66
+#| msgid "AUTOCONNECT"
+msgid "AUTOCONNECT-PRIORITY"
+msgstr "OTOMATİKBAĞLAN-ÖNCELİK"
+
+#. 6
+#: ../clients/cli/connections.c:67
msgid "READONLY"
msgstr "SALT-OKUNUR"
-#. 6
+#. 7
#. 8
#. 2
-#. 11
+#. 15
#. 5
-#: ../cli/src/connections.c:67 ../cli/src/connections.c:142
-#: ../cli/src/devices.c:74 ../cli/src/devices.c:206 ../cli/src/devices.c:222
+#: ../clients/cli/connections.c:68 ../clients/cli/connections.c:181
+#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:159
+#: ../clients/cli/devices.c:175
msgid "DBUS-PATH"
msgstr "DBUS-YOLU"
-#. 2
-#: ../cli/src/connections.c:136
-msgid "DEVICES"
-msgstr "AYGITLAR"
+#. 8
+#. 13
+#. 4
+#: ../clients/cli/connections.c:69 ../clients/cli/devices.c:157
+#: ../clients/cli/devices.c:174
+msgid "ACTIVE"
+msgstr "ETKÄ°N"
+#. 9
+#. 0
+#. 12
+#. 3
+#: ../clients/cli/connections.c:70 ../clients/cli/devices.c:41
+#: ../clients/cli/devices.c:57 ../clients/cli/devices.c:156
+#: ../clients/cli/devices.c:173
+msgid "DEVICE"
+msgstr "AYGIT"
+
+#. 10
#. 3
#. 1
-#. 8
+#. 9
#. 1
-#: ../cli/src/connections.c:137 ../cli/src/devices.c:73
-#: ../cli/src/devices.c:118 ../cli/src/network-manager.c:39
+#: ../clients/cli/connections.c:71 ../clients/cli/connections.c:176
+#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:66
+#: ../clients/cli/general.c:37
msgid "STATE"
msgstr "DURUM"
+#. 11
+#: ../clients/cli/connections.c:72
+#| msgid "MASTER-PATH"
+msgid "ACTIVE-PATH"
+msgstr "ETKÄ°N-YOL"
+
+#. 2
+#: ../clients/cli/connections.c:175
+msgid "DEVICES"
+msgstr "AYGITLAR"
+
#. 4
-#: ../cli/src/connections.c:138
+#: ../clients/cli/connections.c:177
msgid "DEFAULT"
msgstr "ÖNTANIMLI"
#. 5
-#: ../cli/src/connections.c:139
+#: ../clients/cli/connections.c:178
msgid "DEFAULT6"
msgstr "ÖNTANIMLI6"
#. 6
-#: ../cli/src/connections.c:140
+#: ../clients/cli/connections.c:179
msgid "SPEC-OBJECT"
msgstr "BELÄ°RLÄ°-NESNE"
#. 7
-#. 1
-#: ../cli/src/connections.c:141 ../cli/src/connections.c:155
+#. 4
+#. Ask for optional 'vpn' arguments.
+#: ../clients/cli/connections.c:180 ../clients/cli/connections.c:218
+#: ../clients/cli/connections.c:3771 ../clients/tui/nm-editor-utils.c:234
+#: ../clients/tui/nmt-connect-connection-list.c:406
msgid "VPN"
msgstr "VPN"
#. 9
-#: ../cli/src/connections.c:143
+#. 5
+#. 19
+#: ../clients/cli/connections.c:182 ../clients/cli/devices.c:47
+#: ../clients/cli/devices.c:76
msgid "CON-PATH"
-msgstr ""
+msgstr "BAÄž-YOL"
#. 10
-#: ../cli/src/connections.c:144
+#: ../clients/cli/connections.c:183
msgid "ZONE"
msgstr "BÖLGE"
#. 11
-#: ../cli/src/connections.c:145
-#| msgid "DBUS-PATH"
+#: ../clients/cli/connections.c:184
msgid "MASTER-PATH"
msgstr "ANA-YOL"
-#: ../cli/src/connections.c:153 ../cli/src/devices.c:83
-msgid "GENERAL"
-msgstr "GENEL"
-
-#. 0
-#: ../cli/src/connections.c:154
-#| msgid "TKIP"
-msgid "IP"
-msgstr "IP"
-
#. 1
-#: ../cli/src/connections.c:169
-#| msgid "NAME"
+#: ../clients/cli/connections.c:196
msgid "USERNAME"
msgstr "KULLANICI ADI"
#. 2
-#: ../cli/src/connections.c:170
+#: ../clients/cli/connections.c:197
msgid "GATEWAY"
msgstr "AĞ GEÇİDİ"
#. 3
-#: ../cli/src/connections.c:171
+#: ../clients/cli/connections.c:198
msgid "BANNER"
-msgstr ""
+msgstr "SEMBOL"
#. 4
-#: ../cli/src/connections.c:172
-#| msgid "STATE"
+#: ../clients/cli/connections.c:199
msgid "VPN-STATE"
msgstr "VPN DURUMU"
#. 5
-#: ../cli/src/connections.c:173
+#: ../clients/cli/connections.c:200
msgid "CFG"
-msgstr ""
+msgstr "CFG"
-#: ../cli/src/connections.c:195
-#, fuzzy, c-format
-#| msgid ""
-#| "Usage: nmcli con { COMMAND | help }\n"
-#| " COMMAND := { list | status | up | down | delete }\n"
-#| "\n"
-#| " list [id <id> | uuid <id>]\n"
-#| " status\n"
-#| " up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [nsp <name>] [--"
-#| "nowait] [--timeout <timeout>]\n"
-#| " up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--"
-#| "timeout <timeout>]\n"
-#| " down id <id> | uuid <id>\n"
-#| " delete id <id> | uuid <id>\n"
+#: ../clients/cli/connections.c:213 ../clients/cli/devices.c:217
+msgid "GENERAL"
+msgstr "GENEL"
+
+#. 0
+#. 6
+#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:224
+msgid "IP4"
+msgstr "IP4"
+
+#. 1
+#. 7
+#: ../clients/cli/connections.c:215 ../clients/cli/devices.c:225
+msgid "DHCP4"
+msgstr "DHCP4"
+
+#. 2
+#. 8
+#: ../clients/cli/connections.c:216 ../clients/cli/devices.c:226
+msgid "IP6"
+msgstr "IP6"
+
+#. 3
+#. 9
+#: ../clients/cli/connections.c:217 ../clients/cli/devices.c:227
+msgid "DHCP6"
+msgstr "DHCP6"
+
+#: ../clients/cli/connections.c:251
+#, c-format
msgid ""
"Usage: nmcli connection { COMMAND | help }\n"
-" COMMAND := { list | status | up | down | delete }\n"
"\n"
-" list [id <id> | uuid <id>]\n"
-" status [id <id> | uuid <id> | path <path>]\n"
-" up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [nsp <name>] [--"
-"nowait] [--timeout <timeout>]\n"
-" up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--timeout "
-"<timeout>]\n"
-" down id <id> | uuid <id>\n"
-" delete id <id> | uuid <id>\n"
+"COMMAND := { show | up | down | add | modify | edit | delete | reload | "
+"load }\n"
+"\n"
+" show [--active] [[--show-secrets] [id | uuid | path | apath] <ID>] ...\n"
+"\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] "
+"[passwd-file <file with passwords>]\n"
+"\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file "
+"<file with passwords>]\n"
+"\n"
+" down [id | uuid | path | apath] <ID>\n"
+"\n"
+" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
+"\n"
+" modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> "
+"<value>)+\n"
+"\n"
+" edit [id | uuid | path] <ID>\n"
+" edit [type <new_con_type>] [con-name <new_con_name>]\n"
+"\n"
+" delete [id | uuid | path] <ID>\n"
+"\n"
+" reload\n"
+"\n"
+" load <filename> [ <filename>... ]\n"
"\n"
msgstr ""
-"Kullanımı: nmcli con { KOMUT | help }\n"
-" KOMUT := { list | status | up | down | delete }\n"
+"Kullanım: nmcli bağlantı { KOMUT | help }\n"
+"\n"
+"KOMUT := { show | up | down | add | modify | edit | delete | reload | load }"
+"\n"
+"\n"
+" show [--active] [[--show-secrets] [id | uuid | yol | apath] <ID>] ...\n"
+"\n"
+" up [[id | uuid | yol] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <isim>] "
+"[passwd-dosyası <parola dosyası>]\n"
+"\n"
+" up [[id | uuid | yol] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-dosyası "
+"<parola dosyası>]\n"
+"\n"
+" down [id | uuid | path | apath] <ID>\n"
+"\n"
+" add GENEL_SEÇENEKLER TÜRE_ÖZEL_SEÇENEKLER IP_SEÇENEKLERİ\n"
+"\n"
+" modify [--temporary] [id | uuid | yol] <ID> ([+|-]<ayar>.<özellik> "
+"<deÄŸer>)+\n"
+"\n"
+" edit [id | uuid | yol] <ID>\n"
+" edit [tür <yeni_bağlantı_türü>] [bağlantı-adı <yeni_bağlantı_adı>]\n"
+"\n"
+" delete [id | uuid | yol] <ID>\n"
+"\n"
+" reload\n"
+"\n"
+" load <dosyadı> [ <dosyadı>... ]\n"
"\n"
-" list [id <id> | uuid <id>]\n"
-" status\n"
-" up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [nsp <isim>] [--"
-"nowait] [--timeout <zamanaşımı>]\n"
-" up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--timeout "
-"<zamanaşımı>]\n"
-" down id <id> | uuid <id>\n"
-" delete id <id> | uuid <id>\n"
-#: ../cli/src/connections.c:256 ../cli/src/connections.c:442
+#: ../clients/cli/connections.c:272
#, c-format
-msgid "Error: 'con list': %s"
-msgstr "Hata: 'baÄŸ. listesi': %s"
+msgid ""
+"Usage: nmcli connection show { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [--active]\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"
+"\n"
+"ARGUMENTS := [--active] [--show-secrets] [id | uuid | path | apath] "
+"<ID> ...\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"
+msgstr ""
+"Kullanım: nmcli connection show { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [--active]\n"
+"\n"
+"Bellekteki ve diskteki bağlantı profillerini listeler, bu profillerden "
+"bazılarını\n"
+"kullanan aygıtlar olduğunda etkin de olabilirler. Bir parametre olmadan tüm\n"
+"profiller listelenir. Eğer --active seçeneği kullanılırsa sadece\n"
+"etkin bağlantılar görüntülenir.\n"
+"\n"
+"DEĞİŞKENLER := [--active] [--show-secrets] [id | uuid | path | apath] <ID> "
+"...\n"
+"\n"
+"Belirtilen bağlantının ayrıntılarını görüntüler. Varsayılan olarak hem "
+"statik\n"
+"yapılandırmalar hem de etkin bağlantılar görüntülenir. Çıktıyı '--fields'\n"
+"seçeneğini kullanarak filtrelemek mümkündür. Kılavuz sayfasında daha fazla\n"
+"bilgi bulabilirsiniz. --active seçeneği kullanıldığında sadece etkin "
+"profiller\n"
+"hesaba katılır. --show-secrets seçeneği gizli bilgileri de görüntüleyecektir."
+"\n"
-#: ../cli/src/connections.c:258 ../cli/src/connections.c:444
+#: ../clients/cli/connections.c:293
#, c-format
-msgid "Error: 'con list': %s; allowed fields: %s"
-msgstr "Hata: 'bağlantı listesi': %s; izin verilen alanlar :%s"
-
-#: ../cli/src/connections.c:266
-msgid "Connection details"
-msgstr "Bağlantı ayrıntıları"
-
-#: ../cli/src/connections.c:317
-msgid "never"
-msgstr "hiçbir zaman"
+msgid ""
+"Usage: nmcli connection up { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
+"<name>] [passwd-file <file with passwords>]\n"
+"\n"
+"Activate a connection on a device. The profile to activate is identified by "
+"its\n"
+"name, UUID or D-Bus path.\n"
+"\n"
+"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd-file <file "
+"with passwords>]\n"
+"\n"
+"Activate a device with a connection. The connection profile is selected\n"
+"automatically by NetworkManager.\n"
+"\n"
+"ifname - specifies the device to active the connection on\n"
+"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"passwd-file - file with password(s) required to activate the connection\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli connection up { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [id | uuid | yol] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
+"<isim>] [passwd-dosyası <parola dosyası>]\n"
+"\n"
+"Bir aygıtta bir bağlantıyı etkinleştir. Etkinleştirilecek profil isim, UUID "
+"veya\n"
+"D-Bus yolu ile belirtilir.\n"
+"\n"
+"DEĞİŞKENLER := ifname <ifname> [ap <BSSID>] [nsp <isim>] [passwd-dosyası <"
+"parola dosyası>]\n"
+"\n"
+"Bir aygıtı bir bağlantı ile etkinleştirir. Bağlantı profili NetworkManager "
+"tarafından\n"
+"otomatik olarak seçilir.\n"
+"\n"
+"ifname - bağlantının etkin olacağı aygıtı belirtir\n"
+"ap - bağlanılacak erişim noktasını belirtir (sadece kablosuz "
+"bağlantı için)\n"
+"nsp - bağlanılacak NSP'yi belirtir (sadece WiMAX için geçerlidir)\n"
+"passwd-file - bağlantıyı etkinleştirmek için gerekli olan parolaları içeren "
+"dosya\n"
+"\n"
-#. "CAPABILITIES"
-#. Print header
-#. "WIFI-PROPERTIES"
-#: ../cli/src/connections.c:318 ../cli/src/connections.c:319
-#: ../cli/src/connections.c:552 ../cli/src/connections.c:553
-#: ../cli/src/connections.c:555 ../cli/src/devices.c:458
-#: ../cli/src/devices.c:511 ../cli/src/devices.c:629 ../cli/src/devices.c:630
-#: ../cli/src/devices.c:631 ../cli/src/devices.c:663 ../cli/src/devices.c:690
-#: ../cli/src/devices.c:691 ../cli/src/devices.c:692 ../cli/src/devices.c:693
-#: ../cli/src/devices.c:694 ../cli/src/devices.c:695 ../cli/src/devices.c:696
-#: ../cli/src/network-manager.c:267
-msgid "yes"
-msgstr "evet"
+#: ../clients/cli/connections.c:314
+#, c-format
+msgid ""
+"Usage: nmcli connection down { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+"\n"
+"Deactivate a connection from a device (without preventing the device from\n"
+"further auto-activation). The profile to deactivate is identified by its "
+"name,\n"
+"UUID or D-Bus path.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli connection down { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [id | uuid | yol | apath] <ID>\n"
+"\n"
+"Bir aygıtın bağlantısını etkisiz hale getir (aygıtı sonraki otomatik "
+"etkinleÅŸtirme\n"
+"listesinden çıkarmadan). Etkisiz hale getirilecek bağlantı isim, UUID veya\n"
+"D-Bus yolu ile belirlenir.\n"
+"\n"
-#: ../cli/src/connections.c:318 ../cli/src/connections.c:319
-#: ../cli/src/connections.c:552 ../cli/src/connections.c:553
-#: ../cli/src/connections.c:555 ../cli/src/devices.c:458
-#: ../cli/src/devices.c:511 ../cli/src/devices.c:629 ../cli/src/devices.c:630
-#: ../cli/src/devices.c:631 ../cli/src/devices.c:663 ../cli/src/devices.c:690
-#: ../cli/src/devices.c:691 ../cli/src/devices.c:692 ../cli/src/devices.c:693
-#: ../cli/src/devices.c:694 ../cli/src/devices.c:695 ../cli/src/devices.c:696
-#: ../cli/src/network-manager.c:269
-msgid "no"
-msgstr "hayır"
+#: ../clients/cli/connections.c:326
+#, c-format
+msgid ""
+"Usage: nmcli connection add { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
+"\n"
+" COMMON_OPTIONS:\n"
+" type <type>\n"
+" ifname <interface name> | \"*\"\n"
+" [con-name <connection name>]\n"
+" [autoconnect yes|no]\n"
+"\n"
+" [save yes|no]\n"
+"\n"
+" TYPE_SPECIFIC_OPTIONS:\n"
+" ethernet: [mac <MAC address>]\n"
+" [cloned-mac <cloned MAC address>]\n"
+" [mtu <MTU>]\n"
+"\n"
+" wifi: ssid <SSID>\n"
+" [mac <MAC address>]\n"
+" [cloned-mac <cloned MAC address>]\n"
+" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
+"\n"
+" wimax: [mac <MAC address>]\n"
+" [nsp <NSP>]\n"
+"\n"
+" pppoe: username <PPPoE username>\n"
+" [password <PPPoE password>]\n"
+" [service <PPPoE service name>]\n"
+" [mtu <MTU>]\n"
+" [mac <MAC address>]\n"
+"\n"
+" gsm: apn <APN>\n"
+" [user <username>]\n"
+" [password <password>]\n"
+"\n"
+" cdma: [user <username>]\n"
+" [password <password>]\n"
+"\n"
+" infiniband: [mac <MAC address>]\n"
+" [mtu <MTU>]\n"
+" [transport-mode datagram | connected]\n"
+" [parent <ifname>]\n"
+" [p-key <IPoIB P_Key>]\n"
+"\n"
+" bluetooth: [addr <bluetooth address>]\n"
+" [bt-type panu|dun-gsm|dun-cdma]\n"
+"\n"
+" vlan: dev <parent device (connection UUID, ifname, or MAC)>\n"
+" id <VLAN ID>\n"
+" [flags <VLAN flags>]\n"
+" [ingress <ingress priority mapping>]\n"
+" [egress <egress priority mapping>]\n"
+" [mtu <MTU>]\n"
+"\n"
+" bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) "
+"| broadcast (3) |\n"
+" 802.3ad (4) | balance-tlb (5) | balance-alb "
+"(6)]\n"
+" [primary <ifname>]\n"
+" [miimon <num>]\n"
+" [downdelay <num>]\n"
+" [updelay <num>]\n"
+" [arp-interval <num>]\n"
+" [arp-ip-target <num>]\n"
+" [lacp-rate slow (0) | fast (1)]\n"
+"\n"
+" bond-slave: master <master (ifname, or connection UUID or name)>\n"
+"\n"
+" team: [config <file>|<raw JSON data>]\n"
+"\n"
+" team-slave: master <master (ifname, or connection UUID or name)>\n"
+" [config <file>|<raw JSON data>]\n"
+"\n"
+" bridge: [stp yes|no]\n"
+" [priority <num>]\n"
+" [forward-delay <2-30>]\n"
+" [hello-time <1-10>]\n"
+" [max-age <6-40>]\n"
+" [ageing-time <0-1000000>]\n"
+" [mac <MAC address>]\n"
+"\n"
+" bridge-slave: master <master (ifname, or connection UUID or name)>\n"
+" [priority <0-63>]\n"
+" [path-cost <1-65535>]\n"
+" [hairpin yes|no]\n"
+"\n"
+" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|"
+"ssh|l2tp|iodine|...\n"
+" [user <username>]\n"
+"\n"
+" olpc-mesh: ssid <SSID>\n"
+" [channel <1-13>]\n"
+" [dhcp-anycast <MAC address>]\n"
+"\n"
+" IP_OPTIONS:\n"
+" [ip4 <IPv4 address>] [gw4 <IPv4 gateway>]\n"
+" [ip6 <IPv6 address>] [gw6 <IPv6 gateway>]\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli connection add { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := GENEL_SEÇENEKLER TÜRE_BAĞLI_SEÇENEKLER IP_SEÇENEKLERİ\n"
+"\n"
+" GENEL_SEÇENEKLER:\n"
+" type <tür>\n"
+" ifname <arayüz adı> | \"*\"\n"
+" [con-name <bağlantı adı>]\n"
+" [autoconnect yes|no]\n"
+"\n"
+" [save yes|no]\n"
+"\n"
+" TÜRE_BAĞLI_SEÇENEKLER:\n"
+" ethernet: [mac <MAC address>]\n"
+" [cloned-mac <klonlanmış MAC adresi>]\n"
+" [mtu <MTU>]\n"
+"\n"
+" wifi: ssid <SSID>\n"
+" [mac <MAC adresi>]\n"
+" [cloned-mac <klonlanmış MAC adresi>]\n"
+" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
+"\n"
+" wimax: [mac <MAC adresi>]\n"
+" [nsp <NSP>]\n"
+"\n"
+" pppoe: username <PPPoE kullanıcı adı>\n"
+" [password <PPPoE parolası>]\n"
+" [service <PPPoE servis adı>]\n"
+" [mtu <MTU>]\n"
+" [mac <MAC adresi>]\n"
+"\n"
+" gsm: apn <APN>\n"
+" [user <kullanıcı adı>]\n"
+" [password <parola>]\n"
+"\n"
+" cdma: [user <kullanıcı adı>]\n"
+" [password <parola>]\n"
+"\n"
+" infiniband: [mac <MAC adresi>]\n"
+" [mtu <MTU>]\n"
+" [transport-mode datagram | connected]\n"
+" [parent <ifname>]\n"
+" [p-key <IPoIB P_Key>]\n"
+"\n"
+" bluetooth: [addr <bluetooth adresi>]\n"
+" [bt-type panu|dun-gsm|dun-cdma]\n"
+"\n"
+" vlan: dev <üst cihaz (bağlantı UUID, ifname veya MAC)>\n"
+" id <VLAN ID>\n"
+" [flags <VLAN bayrakları>]\n"
+" [ingress <giriş önceliği haritalaması>]\n"
+" [egress <çıkış önceliği haritalaması>]\n"
+" [mtu <MTU>]\n"
+"\n"
+" bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) "
+"| broadcast (3) |\n"
+" 802.3ad (4) | balance-tlb (5) | balance-alb (6)]"
+"\n"
+" [primary <ifname>]\n"
+" [miimon <num>]\n"
+" [downdelay <num>]\n"
+" [updelay <num>]\n"
+" [arp-interval <num>]\n"
+" [arp-ip-target <num>]\n"
+" [lacp-rate slow (0) | fast (1)]\n"
+"\n"
+" bond-slave: master <master (ifname veya UUID veya isim)>\n"
+"\n"
+" team: [config <dosya>|<ham JSON verisi>]\n"
+"\n"
+" team-slave: master <master (ifname veya bağlantı UUID veya isim)>\n"
+" [config <dosya>|<ham JSON verisi>]\n"
+"\n"
+" bridge: [stp yes|no]\n"
+" [priority <num>]\n"
+" [forward-delay <2-30>]\n"
+" [hello-time <1-10>]\n"
+" [max-age <6-40>]\n"
+" [ageing-time <0-1000000>]\n"
+" [mac <MAC adresi>]\n"
+"\n"
+" bridge-slave: master <master (ifname veya bağlantı UUID veya isim)>\n"
+" [priority <0-63>]\n"
+" [path-cost <1-65535>]\n"
+" [hairpin yes|no]\n"
+"\n"
+" vpn: vpn-type "
+"vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n"
+" [user <kullanıcı adı>]\n"
+"\n"
+" olpc-mesh: ssid <SSID>\n"
+" [channel <1-13>]\n"
+" [dhcp-anycast <MAC adresi>]\n"
+"\n"
+" IP_SEÇENEKLERİ:\n"
+" [ip4 <IPv4 adresi>] [gw4 <IPv4 ağ geçidi>]\n"
+" [ip6 <IPv6 adresi>] [gw6 <IPv6 ağ geçidi>]\n"
+"\n"
-#: ../cli/src/connections.c:393
-msgid "Connection list"
-msgstr "Bağlantı listesi"
-
-#: ../cli/src/connections.c:406 ../cli/src/connections.c:948
-#: ../cli/src/connections.c:1486 ../cli/src/connections.c:1501
-#: ../cli/src/connections.c:1510 ../cli/src/connections.c:1520
-#: ../cli/src/connections.c:1532 ../cli/src/connections.c:1641
-#: ../cli/src/connections.c:1743 ../cli/src/devices.c:1192
-#: ../cli/src/devices.c:1202 ../cli/src/devices.c:1320
-#: ../cli/src/devices.c:1328 ../cli/src/devices.c:1692
-#: ../cli/src/devices.c:1699 ../cli/src/devices.c:1713
-#: ../cli/src/devices.c:1720 ../cli/src/devices.c:1737
-#: ../cli/src/devices.c:1748 ../cli/src/devices.c:1969
-#: ../cli/src/devices.c:1976
+#: ../clients/cli/connections.c:406
#, c-format
-msgid "Error: %s argument is missing."
-msgstr "Hata: %s bağımsız değişken eksik."
+msgid ""
+"Usage: nmcli connection modify { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [id | uuid | path] <ID> ([+|-]<setting>.<property> <value>)+\n"
+"\n"
+"Modify one or more properties of the connection profile.\n"
+"The profile is identified by its name, UUID or D-Bus path. For multi-valued\n"
+"properties you can use optional '+' or '-' prefix to the property name.\n"
+"The '+' sign allows appending items instead of overwriting the whole value.\n"
+"The '-' sign allows removing selected items instead of the whole value.\n"
+"\n"
+"Examples:\n"
+"nmcli con mod home-wifi wifi.ssid rakosnicek\n"
+"nmcli con mod em1-1 ipv4.method manual ipv4.addr \"192.168.1.2/24, "
+"10.10.1.5/8\"\n"
+"nmcli con mod em1-1 +ipv4.dns 8.8.4.4\n"
+"nmcli con mod em1-1 -ipv4.dns 1\n"
+"nmcli con mod em1-1 -ipv6.addr \"abbe::cafe/56\"\n"
+"nmcli con mod bond0 +bond.options mii=500\n"
+"nmcli con mod bond0 -bond.options downdelay\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli connection modify { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [id | uuid | yol] <ID> ([+|-]<ayar>.<özellik> <değer>)+\n"
+"\n"
+"Bağlantı profilinin bir veya daha fazla özelliğini değiştir.\n"
+"Profil ismi, UUID veya D-Bus yolu ile belirlenir. Çoklu değerli\n"
+"özellikler için '+' veya '-' öneklerini kullanabilirsiniz.\n"
+"'+' işareti tüm değerin üzerine yazmak yerine ögeleri eklemeye izin verir.\n"
+" '-' işareti tüm değerleri çıkarmadan seçili değerlerin çıkartılmasına izin "
+"verir.\n"
+"\n"
+"Örnekler:\n"
+"nmcli con mod home-wifi wifi.ssid rakosnicek\n"
+"nmcli con mod em1-1 ipv4.method manual ipv4.addr \"192.168.1.2/24, 10.10.1.5/"
+"8\"\n"
+"nmcli con mod em1-1 +ipv4.dns 8.8.4.4\n"
+"nmcli con mod em1-1 -ipv4.dns 1\n"
+"nmcli con mod em1-1 -ipv6.addr \"abbe::cafe/56\"\n"
+"nmcli con mod bond0 +bond.options mii=500\n"
+"nmcli con mod bond0 -bond.options downdelay\n"
+"\n"
-#: ../cli/src/connections.c:419
+#: ../clients/cli/connections.c:429
#, c-format
-msgid "Error: %s - no such connection."
-msgstr "Hata: %s - böyle bir bağlantı yok."
+msgid ""
+"Usage: nmcli connection edit { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [id | uuid | path] <ID>\n"
+"\n"
+"Edit an existing connection profile in an interactive editor.\n"
+"The profile is identified by its name, UUID or D-Bus path\n"
+"\n"
+"ARGUMENTS := [type <new connection type>] [con-name <new connection name>]\n"
+"\n"
+"Add a new connection profile in an interactive editor.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli connection edit { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [id | uuid | yol] <ID>\n"
+"\n"
+"Etkileşimli bir düzenleyicide mevcut bağlantı profilini düzenle.\n"
+"Profil isim, UUID veya D-Bus yolu ile belirlenir\n"
+"\n"
+"DEĞİŞKENLER := [type <yeni bağlantı türü>] [bağlantı-adı <yeni bağlantı adı>]"
+"\n"
+"\n"
+"Etkileşimli bir düzenleyicide yeni bir bağlantı profili ekle.\n"
+"\n"
-#: ../cli/src/connections.c:425 ../cli/src/connections.c:1545
-#: ../cli/src/connections.c:1658 ../cli/src/connections.c:1750
-#: ../cli/src/devices.c:976 ../cli/src/devices.c:1056
-#: ../cli/src/devices.c:1216 ../cli/src/devices.c:1334
-#: ../cli/src/devices.c:1761 ../cli/src/devices.c:1982
+#: ../clients/cli/connections.c:444
#, c-format
-msgid "Unknown parameter: %s\n"
-msgstr "Bilinmeyen deÄŸiÅŸtirge: %s\n"
+msgid ""
+"Usage: nmcli connection delete { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [id | uuid | path] <ID>\n"
+"\n"
+"Delete a connection profile.\n"
+"The profile is identified by its name, UUID or D-Bus path.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli connection delete { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [id | uuid | yol] <ID>\n"
+"\n"
+"Bir bağlantı profilini sil.\n"
+"Profil isim, UUID veya D-Bus yolu ile belirlenir.\n"
+"\n"
-#: ../cli/src/connections.c:434
+#: ../clients/cli/connections.c:455
#, c-format
-msgid "Error: no valid parameter specified."
-msgstr "Hata: geçerli bir değiştirge belirtilmedi."
+msgid ""
+"Usage: nmcli connection reload { help }\n"
+"\n"
+"Reload all connection files from disk.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli connection reload { help }\n"
+"\n"
+"Diskteki tüm bağlantı dosyalarını yeniden yükle.\n"
+"\n"
-#: ../cli/src/connections.c:449 ../cli/src/connections.c:1846
-#: ../cli/src/devices.c:2193 ../cli/src/network-manager.c:599
+#: ../clients/cli/connections.c:463
#, c-format
-msgid "Error: %s."
-msgstr "Hata: %s."
+msgid ""
+"Usage: nmcli connection load { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := <filename> [<filename>...]\n"
+"\n"
+"Load/reload one or more connection files from disk. Use this after manually\n"
+"editing a connection file to ensure that NetworkManager is aware of its "
+"latest\n"
+"state.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli connection load { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := <dosya adı> [<dosya adı>...]\n"
+"\n"
+"Diskteki bir veya daha fazla bağlantı dosyasını yükle/yeniden yükle. Bunu\n"
+"bir bağlantı dosyasında elle değişiklik yaptığınızda NetworkManager'ın\n"
+"son durumdan haberi olması için yapın.\n"
+"\n"
-#: ../cli/src/connections.c:462
+#: ../clients/cli/connections.c:548
msgid "activating"
msgstr "etkinleÅŸtiriliyor"
-#: ../cli/src/connections.c:464
+#: ../clients/cli/connections.c:550
msgid "activated"
msgstr "etkinleÅŸtirildi"
-#: ../cli/src/connections.c:468
-#| msgid "activated"
+#: ../clients/cli/connections.c:554
msgid "deactivated"
msgstr "devre dışı"
-#: ../cli/src/connections.c:480
+#: ../clients/cli/connections.c:566
msgid "VPN connecting (prepare)"
msgstr "VPN bağlantısı (hazırlama)"
-#: ../cli/src/connections.c:482
+#: ../clients/cli/connections.c:568
msgid "VPN connecting (need authentication)"
msgstr "VPN bağlantısı (kimlik doğrulama gerekiyor)"
-#: ../cli/src/connections.c:484
+#: ../clients/cli/connections.c:570
msgid "VPN connecting"
msgstr "VPN bağlantısı"
-#: ../cli/src/connections.c:486
+#: ../clients/cli/connections.c:572
msgid "VPN connecting (getting IP configuration)"
msgstr "VPN bağlantısı (IP yapılandırması alınıyor)"
-#: ../cli/src/connections.c:488
+#: ../clients/cli/connections.c:574
msgid "VPN connected"
msgstr "VPN bağlı"
-#: ../cli/src/connections.c:490
+#: ../clients/cli/connections.c:576
msgid "VPN connection failed"
msgstr "VPN bağlantısı başarısız"
-#: ../cli/src/connections.c:492
+#: ../clients/cli/connections.c:578
msgid "VPN disconnected"
msgstr "VPN bağlı değil"
-#: ../cli/src/connections.c:548 ../cli/src/connections.c:558
-msgid "N/A"
-msgstr ""
+#: ../clients/cli/connections.c:661
+#| msgid "Connection details"
+msgid "Connection profile details"
+msgstr "Bağlantı profili ayrıntıları"
-#: ../cli/src/connections.c:752 ../cli/src/connections.c:976
+#: ../clients/cli/connections.c:673 ../clients/cli/connections.c:1082
#, c-format
-msgid "Error: 'con status': %s"
-msgstr "Hata: 'bağlantı durumu':%s"
+#| msgid "Error: 'con list': %s"
+msgid "Error: 'connection show': %s"
+msgstr "Hata: 'bağlantıyı göster': %s"
+
+#: ../clients/cli/connections.c:819
+msgid "never"
+msgstr "hiçbir zaman"
+
+#. "CAPABILITIES"
+#: ../clients/cli/connections.c:820 ../clients/cli/connections.c:822
+#: ../clients/cli/connections.c:824 ../clients/cli/connections.c:856
+#: ../clients/cli/connections.c:923 ../clients/cli/connections.c:924
+#: ../clients/cli/connections.c:926 ../clients/cli/connections.c:3066
+#: ../clients/cli/connections.c:6827 ../clients/cli/connections.c:6828
+#: ../clients/cli/devices.c:587 ../clients/cli/devices.c:637
+#: ../clients/cli/devices.c:846 ../clients/cli/devices.c:847
+#: ../clients/cli/devices.c:848 ../clients/cli/devices.c:849
+#: ../clients/cli/devices.c:882 ../clients/cli/devices.c:884
+#: ../clients/cli/devices.c:912 ../clients/cli/devices.c:913
+#: ../clients/cli/devices.c:914 ../clients/cli/devices.c:915
+#: ../clients/cli/devices.c:916 ../clients/cli/devices.c:917
+#: ../clients/cli/devices.c:918 ../clients/cli/general.c:421
+msgid "yes"
+msgstr "evet"
-#: ../cli/src/connections.c:754 ../cli/src/connections.c:978
+#: ../clients/cli/connections.c:820 ../clients/cli/connections.c:822
+#: ../clients/cli/connections.c:824 ../clients/cli/connections.c:923
+#: ../clients/cli/connections.c:924 ../clients/cli/connections.c:926
+#: ../clients/cli/connections.c:3067 ../clients/cli/connections.c:6827
+#: ../clients/cli/connections.c:6828 ../clients/cli/devices.c:587
+#: ../clients/cli/devices.c:637 ../clients/cli/devices.c:846
+#: ../clients/cli/devices.c:847 ../clients/cli/devices.c:848
+#: ../clients/cli/devices.c:849 ../clients/cli/devices.c:882
+#: ../clients/cli/devices.c:884 ../clients/cli/devices.c:912
+#: ../clients/cli/devices.c:913 ../clients/cli/devices.c:914
+#: ../clients/cli/devices.c:915 ../clients/cli/devices.c:916
+#: ../clients/cli/devices.c:917 ../clients/cli/devices.c:918
+#: ../clients/cli/general.c:423
+msgid "no"
+msgstr "hayır"
+
+#: ../clients/cli/connections.c:1070
+#| msgid "Active connection details"
+msgid "Activate connection details"
+msgstr "Bağlantı ayrıntılarını etkinleştir"
+
+#: ../clients/cli/connections.c:1303
#, c-format
-msgid "Error: 'con status': %s; allowed fields: %s"
-msgstr "Hata: 'bağlantı durumu': %s; izin verilen alanlar :%s"
+msgid "invalid field '%s'; allowed fields: %s and %s, or %s,%s"
+msgstr "geçersiz alan '%s'; izin verilen alanlar: %s ve %s veya %s,%s"
-#: ../cli/src/connections.c:762
-#| msgid "Active connections"
-msgid "Active connection details"
-msgstr "Etkin bağlantı detayları"
-
-#: ../cli/src/connections.c:898 ../cli/src/connections.c:1560
-#: ../cli/src/connections.c:1673 ../cli/src/connections.c:1764
-#: ../cli/src/devices.c:1003 ../cli/src/devices.c:1065
-#: ../cli/src/devices.c:1231 ../cli/src/devices.c:1364
-#: ../cli/src/devices.c:1783 ../cli/src/devices.c:2011
-#: ../cli/src/network-manager.c:311
-#, c-format
-msgid "Error: Can't find out if NetworkManager is running: %s."
-msgstr "Hata: Ağ Yöneticisi çalışıyorsa bulunamıyor: %s"
-
-#: ../cli/src/connections.c:902 ../cli/src/connections.c:1564
-#: ../cli/src/connections.c:1677 ../cli/src/connections.c:1768
-#: ../cli/src/devices.c:1007 ../cli/src/devices.c:1069
-#: ../cli/src/devices.c:1235 ../cli/src/devices.c:1368
-#: ../cli/src/devices.c:1787 ../cli/src/devices.c:2015
-#: ../cli/src/network-manager.c:315
+#: ../clients/cli/connections.c:1318 ../clients/cli/connections.c:1326
#, c-format
-msgid "Error: NetworkManager is not running."
-msgstr "Hata: Ağ Yöneticisi çalışmıyor."
+#| msgid "field '%s' has to be alone"
+msgid "'%s' has to be alone"
+msgstr "'%s' alanı yanlız olmalı"
-#: ../cli/src/connections.c:934
-msgid "Active connections"
-msgstr "Etkin bağlantılar"
+#. Add headers
+#: ../clients/cli/connections.c:1381
+#| msgid "NetworkManager status"
+msgid "NetworkManager active profiles"
+msgstr "NetworkManager etkin profilleri"
+
+#: ../clients/cli/connections.c:1382
+#| msgid "NetworkManager went to sleep"
+msgid "NetworkManager connection profiles"
+msgstr "NetworkManager bağlantı profilleri"
+
+#: ../clients/cli/connections.c:1422 ../clients/cli/connections.c:2205
+#: ../clients/cli/connections.c:2221 ../clients/cli/connections.c:2230
+#: ../clients/cli/connections.c:2240 ../clients/cli/connections.c:2250
+#: ../clients/cli/connections.c:2328 ../clients/cli/connections.c:8377
+#: ../clients/cli/connections.c:8594 ../clients/cli/devices.c:1867
+#: ../clients/cli/devices.c:1875 ../clients/cli/devices.c:2191
+#: ../clients/cli/devices.c:2198 ../clients/cli/devices.c:2212
+#: ../clients/cli/devices.c:2219 ../clients/cli/devices.c:2236
+#: ../clients/cli/devices.c:2244 ../clients/cli/devices.c:2432
+#: ../clients/cli/devices.c:2528 ../clients/cli/devices.c:2535
+#, c-format
+msgid "Error: %s argument is missing."
+msgstr "Hata: %s bağımsız değişken eksik."
-#: ../cli/src/connections.c:959
+#: ../clients/cli/connections.c:1437
#, c-format
#| msgid "Error: %s - no such connection."
-msgid "Error: '%s' is not an active connection."
-msgstr "Hata: %s etkin bir bağlantı değil."
+msgid "Error: %s - no such connection profile."
+msgstr "Hata: %s - böyle bir bağlantı profili yok."
-#: ../cli/src/connections.c:964
+#: ../clients/cli/connections.c:1496 ../clients/cli/connections.c:2273
+#: ../clients/cli/connections.c:8894 ../clients/cli/devices.c:2411
+#: ../clients/cli/devices.c:2879 ../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
#, c-format
-#| msgid "Unknown parameter: %s\n"
-msgid "Error: unknown parameter: %s"
-msgstr "Hata: bilinmeyen parametre: %s"
+msgid "Error: %s."
+msgstr "Hata: %s."
-#: ../cli/src/connections.c:1071
+#: ../clients/cli/connections.c:1591
#, c-format
msgid "no active connection on device '%s'"
msgstr "'%s' aygıtı üzerinde etkin bir bağlantı yok"
-#: ../cli/src/connections.c:1079
+#: ../clients/cli/connections.c:1599
msgid "no active connection or device"
msgstr "etkin bağlantı veya aygıt yok"
-#: ../cli/src/connections.c:1150
+#: ../clients/cli/connections.c:1670
#, c-format
msgid "device '%s' not compatible with connection '%s'"
msgstr "'%s aygıtı '%s' bağlantısı ile uyumlu değil"
-#: ../cli/src/connections.c:1153
+#: ../clients/cli/connections.c:1673
#, c-format
msgid "no device found for connection '%s'"
msgstr "'%s' bağlantısı için aygıt bulunamadı"
-#: ../cli/src/connections.c:1165
+#: ../clients/cli/connections.c:1685
msgid "unknown reason"
msgstr "bilinmeyen neden"
-#: ../cli/src/connections.c:1167
+#: ../clients/cli/connections.c:1687 ../clients/cli/general.c:272
msgid "none"
msgstr "yok"
-#: ../cli/src/connections.c:1169
+#: ../clients/cli/connections.c:1689
msgid "the user was disconnected"
msgstr "kullanıcı bağlantısı kesildi"
-#: ../cli/src/connections.c:1171
+#: ../clients/cli/connections.c:1691
msgid "the base network connection was interrupted"
msgstr "ana ağ bağlantısı yarıda kesildi"
-#: ../cli/src/connections.c:1173
+#: ../clients/cli/connections.c:1693
msgid "the VPN service stopped unexpectedly"
msgstr "VPN hizmeti beklenmedik bir biçimde durdu"
-#: ../cli/src/connections.c:1175
+#: ../clients/cli/connections.c:1695
msgid "the VPN service returned invalid configuration"
msgstr "VPN hizmeti geçersiz bir yapılandırma döndürdü"
-#: ../cli/src/connections.c:1177
+#: ../clients/cli/connections.c:1697
msgid "the connection attempt timed out"
msgstr "bağlantı denemesi zaman aşımına uğradı"
-#: ../cli/src/connections.c:1179
+#: ../clients/cli/connections.c:1699
msgid "the VPN service did not start in time"
msgstr "VPN hizmeti zamanında başlatılmadı"
-#: ../cli/src/connections.c:1181
+#: ../clients/cli/connections.c:1701
msgid "the VPN service failed to start"
msgstr "VPN hizmeti başlatılamadı"
-#: ../cli/src/connections.c:1183
+#: ../clients/cli/connections.c:1703
msgid "no valid VPN secrets"
msgstr "geçerli bir VPN parolası yok"
-#: ../cli/src/connections.c:1185
+#: ../clients/cli/connections.c:1705
msgid "invalid VPN secrets"
msgstr "geçersiz VPN parolaları"
-#: ../cli/src/connections.c:1187
+#: ../clients/cli/connections.c:1707
msgid "the connection was removed"
msgstr "bağlantı kaldırıldı"
-#: ../cli/src/connections.c:1204 ../cli/src/connections.c:1409
+#: ../clients/cli/connections.c:1729 ../clients/cli/connections.c:1757
+#: ../clients/cli/connections.c:1911 ../clients/cli/connections.c:6718
#, c-format
msgid "Connection successfully activated (D-Bus active path: %s)\n"
+msgstr "Bağlantı başarıyla etkinleştirildi (D-Bus etkin yolu: %s)\n"
+
+#: ../clients/cli/connections.c:1736
+#, c-format
+#| msgid "VPN connection successfully activated (D-Bus active path: %s)\n"
+msgid ""
+"Connection successfully activated (master waiting for slaves) (D-Bus active "
+"path: %s)\n"
msgstr ""
+"Bağlantı başarıyla etkinleştirildi (birincil bağlantı diğerlerini bekliyor) "
+"(D-Bus etkin yolu: %s)\n"
-#. Active connection failed and dissapeared, quit.
-#: ../cli/src/connections.c:1209 ../cli/src/connections.c:1310
+#: ../clients/cli/connections.c:1740 ../clients/cli/connections.c:1762
#, c-format
msgid "Error: Connection activation failed."
msgstr "Hata: Bağlantı etkinleştirilemedi."
-#: ../cli/src/connections.c:1234
+#: ../clients/cli/connections.c:1806
#, c-format
msgid "VPN connection successfully activated (D-Bus active path: %s)\n"
msgstr "VPN bağlantısı başarıyla atkifleştirildi (Etkin D-Bus yolu: %s)\n"
-#: ../cli/src/connections.c:1242
+#: ../clients/cli/connections.c:1814
#, c-format
msgid "Error: Connection activation failed: %s."
msgstr "Hata: Bağlantı etkinleştirilemedi: %s."
-#: ../cli/src/connections.c:1339 ../cli/src/devices.c:1125
+#: ../clients/cli/connections.c:1833 ../clients/cli/devices.c:1320
#, c-format
msgid "Error: Timeout %d sec expired."
msgstr "Hata: %d saniye zaman aşımı sona erdi."
-#: ../cli/src/connections.c:1400
+#: ../clients/cli/connections.c:1893
#, c-format
msgid "Error: Connection activation failed: %s"
msgstr "Hata: Bağlantı etkinleştirilemedi: %s"
-#: ../cli/src/connections.c:1494 ../cli/src/connections.c:1649
-#: ../cli/src/connections.c:1777
+#: ../clients/cli/connections.c:1978
#, c-format
-msgid "Error: Unknown connection: %s."
-msgstr "Hata: Bilinmeyen bağlantı: %s."
+msgid "failed to read passwd-file '%s': %s"
+msgstr "'%s' passwd dosyası okunamadı: %s"
-#: ../cli/src/connections.c:1540 ../cli/src/devices.c:1210
-#: ../cli/src/devices.c:1756
+#: ../clients/cli/connections.c:1990
#, c-format
-msgid "Error: timeout value '%s' is not valid."
-msgstr "Hata: '%s' zaman aşımı değeri geçerli değil."
+msgid "missing colon in 'password' entry '%s'"
+msgstr "'%s' dosyasında 'password' girdi alanı eksik"
-#: ../cli/src/connections.c:1553 ../cli/src/connections.c:1666
-#: ../cli/src/connections.c:1757
+#: ../clients/cli/connections.c:1998
#, c-format
-msgid "Error: id or uuid has to be specified."
-msgstr "Hata: id veya uuid deÄŸeri belirtilmeli."
+msgid "missing dot in 'password' entry '%s'"
+msgstr "'%s' dosyasında 'password' girdisinde nokta eksik"
-#: ../cli/src/connections.c:1586
+#: ../clients/cli/connections.c:2011
#, c-format
-msgid "Error: No suitable device found: %s."
-msgstr "Hata: Uygun bir aygıt bulunamadı: %s."
+msgid "invalid setting name in 'password' entry '%s'"
+msgstr "'%s' dosyasında 'password' girdisinde geçersiz isim"
-#: ../cli/src/connections.c:1588
+#: ../clients/cli/connections.c:2059
#, c-format
-msgid "Error: No suitable device found."
-msgstr "Hata: Uygun bir aygıt bulunamadı."
+msgid ""
+"Warning: password for '%s' not given in 'passwd-file' and nmcli cannot ask "
+"without '--ask' option.\n"
+msgstr ""
+"Uyarı: '%s' kullanıcısı için parola 'passwd-doyasında' verilmemiş ve nmcli '"
+"--ask' seçeneği olmadan parola soramaz.\n"
-#: ../cli/src/connections.c:1702
+#: ../clients/cli/connections.c:2127 ../clients/cli/connections.c:2274
+#| msgid "Unknown error"
+msgid "unknown error"
+msgstr "bilinmeyen hata"
+
+#: ../clients/cli/connections.c:2135
#, c-format
-msgid "Warning: Connection not active\n"
-msgstr "Uyarı: Bağlantı etkin değil\n"
+#| msgid "Unknown log level '%s'"
+msgid "unknown device '%s'."
+msgstr "bilinmeyen aygıt '%s'."
+
+#: ../clients/cli/connections.c:2140
+#| msgid "no active connection or device"
+msgid "neither a valid connection nor device given"
+msgstr "geçerli bağlantı veya aygıt verilmedi"
-#: ../cli/src/connections.c:1716
+#: ../clients/cli/connections.c:2258 ../clients/cli/devices.c:1219
+#: ../clients/cli/devices.c:1881 ../clients/cli/devices.c:2255
+#: ../clients/cli/devices.c:2541
#, c-format
-#| msgid "Error: Connection activation failed: %s"
-msgid "Error: Connection deletion failed: %s"
-msgstr "Hata: Bağlantı silinemedi: %s"
+msgid "Unknown parameter: %s\n"
+msgstr "Bilinmeyen deÄŸiÅŸtirge: %s\n"
+
+#: ../clients/cli/connections.c:2282
+msgid "preparing"
+msgstr "hazırlanıyor"
-#: ../cli/src/connections.c:1837
+#: ../clients/cli/connections.c:2310 ../clients/cli/connections.c:8575
+#: ../clients/cli/connections.c:8689
#, c-format
-msgid "Error: 'con' command '%s' is not valid."
-msgstr "HATA: 'bağlantı' '%s' komutu geçerli değil"
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: No connection specified."
+msgstr "Hata: Bağlantı belirtilmedi."
-#: ../cli/src/connections.c:1905
+#: ../clients/cli/connections.c:2338
#, c-format
-msgid "Error: could not connect to D-Bus."
-msgstr "Hata: D-Bus'a bağlanılamadı."
+msgid "Error: '%s' is not an active connection."
+msgstr "Hata: %s etkin bir bağlantı değil."
-#: ../cli/src/connections.c:1913
+#: ../clients/cli/connections.c:2639 ../clients/cli/utils.c:517
#, c-format
-msgid "Error: Could not get system settings."
-msgstr "Hata: Sistem ayarları alınamadı."
+msgid "'%s' not among [%s]"
+msgstr "'%s' [%s] arasında değil"
-#: ../cli/src/connections.c:1923
+#: ../clients/cli/connections.c:2718
#, c-format
-msgid "Error: Can't obtain connections: settings service is not running."
-msgstr "Hata: Bağlantılar alınamıyor: ayarlar hizmeti çalışmıyor."
+#| msgid "'%s' is not a valid MAC address"
+msgid "Error: '%s': '%s' is not a valid %s MAC address."
+msgstr "Hata: '%s': '%s' geçerli bir %s MAC adresi değildir."
-#. 0
-#. 9
-#. 3
-#: ../cli/src/devices.c:71 ../cli/src/devices.c:110 ../cli/src/devices.c:204
-#: ../cli/src/devices.c:220
-msgid "DEVICE"
-msgstr "AYGIT"
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:2719 ../clients/cli/connections.c:3181
+#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1532
+#: ../libnm-glib/nm-device.c:1800 ../libnm/nm-device.c:1612
+msgid "InfiniBand"
+msgstr "InfiniBand"
-#. 0
-#: ../cli/src/devices.c:84
-msgid "CAPABILITIES"
-msgstr "YETENEKLER"
+#: ../clients/cli/connections.c:2719 ../clients/tui/nm-editor-utils.c:147
+#: ../libnm-glib/nm-device.c:1788 ../libnm/nm-device.c:1600
+msgid "Ethernet"
+msgstr "Ethernet"
-#. 1
-#: ../cli/src/devices.c:85
-msgid "WIFI-PROPERTIES"
-msgstr "WIFI-ÖZELLİKLER"
+#: ../clients/cli/connections.c:2739
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'mtu': '%s' is not a valid MTU."
+msgstr "Hata: 'mtu': '%s' geçerli bir MTU değeri değil."
-#. 2
-#. 5
-#: ../cli/src/devices.c:86 ../cli/src/devices.c:170
-msgid "AP"
-msgstr "AP"
+#: ../clients/cli/connections.c:2755
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'parent': '%s' is not a valid interface name."
+msgstr "Hata: 'parent': '%s' geçerli bir arayüz adı değil."
-#. 3
-#: ../cli/src/devices.c:87
-msgid "WIRED-PROPERTIES"
-msgstr "KABLOLU-ÖZELLİKLER"
+#: ../clients/cli/connections.c:2776
+#, c-format
+#| msgid "Error: 'dev' command '%s' is not valid."
+msgid "Error: 'p-key': '%s' is not a valid InfiniBand P_KEY."
+msgstr "Hata: 'p-key': '%s' geçerli bir InfiniBand P_KEY değeri değil."
-#. 4
-#: ../cli/src/devices.c:88
-msgid "WIMAX-PROPERTIES"
-msgstr "WIMAX-ÖZELLİKLERİ"
+#: ../clients/cli/connections.c:2821
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: '%s': '%s' is not a valid %s %s."
+msgstr "Hata: '%s': '%s' geçerli bir %s %s değeri değil."
-#. 5
-#. 0
-#: ../cli/src/devices.c:89 ../cli/src/devices.c:217
-msgid "NSP"
-msgstr "NSP"
+#: ../clients/cli/connections.c:2834
+msgid "Wi-Fi mode"
+msgstr "Kablosuz kipi"
-#. 6
-#: ../cli/src/devices.c:90
-#| msgid "IP4-DNS"
-msgid "IP4"
-msgstr "IP4"
+#: ../clients/cli/connections.c:2843
+#| msgid "InfiniBand connection %d"
+msgid "InfiniBand transport mode"
+msgstr "InfiniBand taşıma kipi"
-#. 7
-#: ../cli/src/devices.c:91
-msgid "DHCP4"
-msgstr "DHCP4"
+#: ../clients/cli/connections.c:2856
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'flags': '%s' is not valid; use <0-7>."
+msgstr "Hata: 'flags': '%s' geçerli değil; <0-7> kullanın."
-#. 8
-#: ../cli/src/devices.c:92
-#| msgid "IP6-DNS"
-msgid "IP6"
-msgstr "IP6"
+#: ../clients/cli/connections.c:2878
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: '%s': '%s' is not valid; %s "
+msgstr "Hata: '%s': '%s' geçerli değil; %s "
-#. 9
-#: ../cli/src/devices.c:93
-msgid "DHCP6"
-msgstr "DHCP6"
+#: ../clients/cli/connections.c:3057
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: '%s': '%s' is not valid; use <%u-%u>."
+msgstr "Hata: '%s': '%s' geçerli değil; <%u-%u> kullanın."
-#. 10
-#: ../cli/src/devices.c:94
-msgid "BOND"
-msgstr "BOND"
+#. Ask for optional arguments.
+#: ../clients/cli/connections.c:3113
+#, fuzzy, c-format
+#| msgid "Error: missing argument for '%s' option."
+msgid "There is %d optional argument for '%s' connection type.\n"
+msgid_plural "There are %d optional arguments for '%s' connection type.\n"
+msgstr[0] "'%s' bağlantı türü için %d isteğe bağlı seçenek mevcut.\n"
+msgstr[1] "'%s' bağlantı türü için %d isteğe bağlı seçenek mevcut.\n"
-#. 11
-#: ../cli/src/devices.c:95
+#: ../clients/cli/connections.c:3116
+#, fuzzy, c-format
+msgid "Do you want to provide it? %s"
+msgid_plural "Do you want to provide them? %s"
+msgstr[0] "Bunu saÄŸlamak istiyor musunuz? %s"
+msgstr[1] "Bunları sağlamak istiyor musunuz? %s"
+
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3133
+msgid "ethernet"
+msgstr "ethernet"
+
+#: ../clients/cli/connections.c:3138 ../clients/cli/connections.c:3186
+#: ../clients/cli/connections.c:3320 ../clients/cli/connections.c:3399
+msgid "MTU [auto]: "
+msgstr "MTU [otomatik]: "
+
+#: ../clients/cli/connections.c:3149 ../clients/cli/connections.c:3197
+#: ../clients/cli/connections.c:3292 ../clients/cli/connections.c:3331
+#: ../clients/cli/connections.c:3703
+msgid "MAC [none]: "
+msgstr "MAC [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3160
+msgid "Cloned MAC [none]: "
+msgstr "Klonlanmış MAC [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3208
+#, c-format
+msgid "Transport mode %s"
+msgstr "Aktarım kipi %s"
+
+#: ../clients/cli/connections.c:3221
+msgid "Parent interface [none]: "
+msgstr "Üst arayüz [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3232
+msgid "P_KEY [none]: "
+msgstr "P_KEY [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3242
+#, c-format
+msgid "Error: 'p-key' is mandatory when 'parent' is specified.\n"
+msgstr "Hata: 'parent' belirtildiÄŸinde 'p-key' zorunludur.\n"
+
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3259 ../clients/tui/nm-editor-utils.c:155
+#: ../libnm-glib/nm-device.c:1790 ../libnm/nm-device.c:1602
+msgid "Wi-Fi"
+msgstr "Kablosuz"
+
+#: ../clients/cli/connections.c:3267
+#, c-format
+msgid "Mode %s"
+msgstr "Kip %s"
+
+#. Ask for optional 'wimax' arguments.
+#: ../clients/cli/connections.c:3287 ../libnm-glib/nm-device.c:1796
+#: ../libnm/nm-device.c:1608
+msgid "WiMAX"
+msgstr "WiMAX"
+
+#. Ask for optional 'pppoe' arguments.
+#: ../clients/cli/connections.c:3310
+msgid "PPPoE"
+msgstr "PPPoE"
+
+#: ../clients/cli/connections.c:3314 ../clients/cli/connections.c:3352
+msgid "Password [none]: "
+msgstr "Parola [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3316
+msgid "Service [none]: "
+msgstr "Servis [hiçbiri]: "
+
+#. Ask for optional 'gsm' or 'cdma' arguments.
+#: ../clients/cli/connections.c:3346
+msgid "mobile broadband"
+msgstr "mobil geniÅŸ bant"
+
+#: ../clients/cli/connections.c:3350 ../clients/cli/connections.c:3775
+msgid "Username [none]: "
+msgstr "Kullanıcı adı [hiçbiri]: "
+
+#. Ask for optional 'bluetooth' arguments.
+#: ../clients/cli/connections.c:3365
+msgid "bluetooth"
+msgstr "bluetooth"
+
+#: ../clients/cli/connections.c:3372
+#, c-format
+msgid "Bluetooth type %s"
+msgstr "Bluetooth türü %s"
+
+#: ../clients/cli/connections.c:3378
+#, c-format
+#| msgid "Error: 'dev' command '%s' is not valid."
+msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n"
+msgstr "Hata: 'bt-type': '%s' geçerli bir bluetooth türü değil.\n"
+
+#. Ask for optional 'vlan' arguments.
+#. 13
+#: ../clients/cli/connections.c:3394 ../clients/cli/devices.c:231
+#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:51
+#: ../libnm-core/nm-connection.c:1530 ../libnm-glib/nm-device.c:1808
+#: ../libnm-util/nm-connection.c:1612 ../libnm/nm-device.c:1620
msgid "VLAN"
msgstr "VLAN"
-#. 12
-#: ../cli/src/devices.c:96
-#| msgid "CONNECTION"
-msgid "CONNECTIONS"
-msgstr "BAÄžLANTILAR"
+#: ../clients/cli/connections.c:3410
+msgid "VLAN flags (<0-7>) [none]: "
+msgstr "VLAN bayrakları (<0-7>) [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3421
+msgid "Ingress priority maps [none]: "
+msgstr "Giriş öncelikli haritalar [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3432
+msgid "Egress priority maps [none]: "
+msgstr "Çıkış öncelikli haritalar [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3443
+msgid "Bonding mode [balance-rr]: "
+msgstr "BirleÅŸtirme kipi [balance-rr]: "
+
+#. Ask for optional 'bond' arguments.
+#: ../clients/cli/connections.c:3459
+msgid "bond"
+msgstr "bond"
+
+#: ../clients/cli/connections.c:3481
+msgid "Bonding primary interface [none]: "
+msgstr "Birincil arayüz birleştiriliyor [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3484
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'primary': '%s' is not a valid interface name.\n"
+msgstr "Hata: 'birincil': '%s' geçerli bir arayüz adı değil.\n"
+
+#: ../clients/cli/connections.c:3492
+#, c-format
+msgid "Bonding monitoring mode %s"
+msgstr "%s izleme kipi birleÅŸtiriliyor"
+
+#: ../clients/cli/connections.c:3498
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n"
+msgstr "Hata: '%s' geçerli bir izleme kipi değil, '%s' veya '%s' kullanın.\n"
+
+#: ../clients/cli/connections.c:3507
+msgid "Bonding miimon [100]: "
+msgstr "miimon birleÅŸtiriliyor[100]: "
+
+#: ../clients/cli/connections.c:3510
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'miimon': '%s' is not a valid number <0-%u>.\n"
+msgstr "Hata: 'miimon': '%s' geçerli bir sayı değil <0-%u>.\n"
+
+#: ../clients/cli/connections.c:3518
+msgid "Bonding downdelay [0]: "
+msgstr "downdelay birleÅŸtiriliyor [0]: "
+
+#: ../clients/cli/connections.c:3521
+#, c-format
+#| msgid "Error: 'dev' command '%s' is not valid."
+msgid "Error: 'downdelay': '%s' is not a valid number <0-%u>.\n"
+msgstr "Hata: 'downdelay': '%s' geçerli bir sayı değil <0-%u>.\n"
+
+#: ../clients/cli/connections.c:3529
+msgid "Bonding updelay [0]: "
+msgstr "updelay birleÅŸtiriliyor [0]: "
+
+#: ../clients/cli/connections.c:3532
+#, c-format
+#| msgid "Error: 'dev' command '%s' is not valid."
+msgid "Error: 'updelay': '%s' is not a valid number <0-%u>.\n"
+msgstr "Hata: 'updelay': '%s' geçerli bir sayı değil <0-%u>.\n"
+
+#: ../clients/cli/connections.c:3541
+msgid "Bonding arp-interval [0]: "
+msgstr "arp-interval birleÅŸtiriliyor [0]: "
+
+#: ../clients/cli/connections.c:3544
+#, c-format
+#| msgid "Error: bssid argument value '%s' is not a valid BSSID."
+msgid "Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n"
+msgstr "Hata: 'arp-interval': '%s' geçerli bir sayı değil <0-%u>.\n"
+
+#. FIXME: verify the string
+#: ../clients/cli/connections.c:3552
+msgid "Bonding arp-ip-target [none]: "
+msgstr "arp-ip-target birleştiriliyor [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3559
+msgid "LACP rate ('slow' or 'fast') [slow]: "
+msgstr "LACP değeri ('yavaş' veya 'hızlı')[yavaş]: "
+
+#: ../clients/cli/connections.c:3565
+#, c-format
+msgid "Error: 'lacp_rate': '%s' is invalid ('slow' or 'fast').\n"
+msgstr "Hata: 'lacp_rate': '%s' geçerli değil ('yavaş' veya 'hızlı').\n"
+
+#: ../clients/cli/connections.c:3588
+msgid "Team JSON configuration [none]: "
+msgstr "Takım JSON yapılandırması [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3605
+msgid "team"
+msgstr "takım"
+
+#: ../clients/cli/connections.c:3611
+msgid "team-slave"
+msgstr "takım-ikincil"
+
+#. Ask for optional 'bridge' arguments.
+#: ../clients/cli/connections.c:3623
+#| msgid "Bridge"
+msgid "bridge"
+msgstr "köprü"
+
+#: ../clients/cli/connections.c:3629
+#, c-format
+msgid "Enable STP %s"
+msgstr "STP %s etkinleÅŸtir"
+
+#: ../clients/cli/connections.c:3634
+#, c-format
+#| msgid "Error: 'con list': %s"
+msgid "Error: 'stp': %s.\n"
+msgstr "Hata: 'stp': %s.\n"
+
+#: ../clients/cli/connections.c:3642
+msgid "STP priority [32768]: "
+msgstr "STP önceliği [32768]: "
+
+#: ../clients/cli/connections.c:3646
+#, c-format
+#| msgid "Error: 'con' command '%s' is not valid."
+msgid "Error: 'priority': '%s' is not a valid number <0-%d>.\n"
+msgstr "Hata: 'priority': '%s' geçerli bir sayı değil <0-%d>.\n"
+
+#: ../clients/cli/connections.c:3654
+msgid "Forward delay [15]: "
+msgstr "Ä°letim gecikmesi [15]: "
+
+#: ../clients/cli/connections.c:3658
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'forward-delay': '%s' is not a valid number <2-30>.\n"
+msgstr "Hata: 'forward-delay': '%s' geçerli bir sayı değil <2-30>.\n"
+
+#: ../clients/cli/connections.c:3667
+msgid "Hello time [2]: "
+msgstr "Selamlaşma zamanı [2]: "
+
+#: ../clients/cli/connections.c:3671
+#, c-format
+#| msgid "Error: timeout value '%s' is not valid."
+msgid "Error: 'hello-time': '%s' is not a valid number <1-10>.\n"
+msgstr "Hata: 'hello-time': '%s' geçerli bir sayı değil <1-10>.\n"
+
+#: ../clients/cli/connections.c:3679
+msgid "Max age [20]: "
+msgstr "En fazla yaÅŸ [20]: "
+
+#: ../clients/cli/connections.c:3683
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'max-age': '%s' is not a valid number <6-40>.\n"
+msgstr "Hata: 'max-age': '%s' geçerli bir sayı değil <6-40>.\n"
+
+#: ../clients/cli/connections.c:3691
+msgid "MAC address ageing time [300]: "
+msgstr "MAC adresi yaşlanma zamanı [300]: "
+
+#: ../clients/cli/connections.c:3695
+#, c-format
+#| msgid "Error: bssid argument value '%s' is not a valid BSSID."
+msgid "Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n"
+msgstr "Hata: 'ageing-time': '%s' geçerli bir sayı değil <0-1000000>.\n"
+
+#. Ask for optional 'bridge-slave' arguments.
+#: ../clients/cli/connections.c:3722
+msgid "bridge-slave"
+msgstr "bridge-slave"
+
+#: ../clients/cli/connections.c:3727
+msgid "Bridge port priority [32]: "
+msgstr "Köprü bağlantı noktası önceliği [32]: "
+
+#: ../clients/cli/connections.c:3740
+msgid "Bridge port STP path cost [100]: "
+msgstr "Köprü bağlantı noktası STP yol maliyeti [100]: "
+
+#: ../clients/cli/connections.c:3754
+#, c-format
+msgid "Hairpin %s"
+msgstr "Hairpin %s"
+
+#: ../clients/cli/connections.c:3759
+#, c-format
+#| msgid "Error: 'dev wifi': %s"
+msgid "Error: 'hairpin': %s.\n"
+msgstr "Hata: 'hairpin': %s.\n"
+
+#. Ask for optional 'olpc' arguments.
+#: ../clients/cli/connections.c:3786 ../libnm-glib/nm-device.c:1794
+#: ../libnm/nm-device.c:1606
+msgid "OLPC Mesh"
+msgstr "OLPC Mesh"
+
+#: ../clients/cli/connections.c:3791
+msgid "OLPC Mesh channel [1]: "
+msgstr "OLPC Mesh kanalı [1]: "
+
+#: ../clients/cli/connections.c:3794
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'channel': '%s' is not a valid number <1-13>.\n"
+msgstr "Hata: 'channel': '%s' geçerli bir sayı değil <1-13>.\n"
+
+#: ../clients/cli/connections.c:3802
+msgid "DHCP anycast MAC address [none]: "
+msgstr "DHCP anycast MAC adresi [none]: "
+
+#: ../clients/cli/connections.c:3847
+msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
+msgstr "IPv4 adresi (IP[/plen] [ağ geçidi]) [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3849
+msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
+msgstr "IPv6 adresi (IP[/plen] [ağ geçidi]) [hiçbiri]: "
+
+#: ../clients/cli/connections.c:3867
+#, c-format
+msgid " Address successfully added: %s %s\n"
+msgstr " Adres başarıyla eklendi: %s %s\n"
+
+#: ../clients/cli/connections.c:3869
+#, c-format
+msgid " Warning: address already present: %s %s\n"
+msgstr " Uyarı: adres zaten var: %s %s\n"
+
+#: ../clients/cli/connections.c:3871
+#, c-format
+msgid " Warning: ignoring garbage at the end: '%s'\n"
+msgstr " Uyarı: sondaki yanlışlık görmezden geliniyor: '%s'\n"
+
+#: ../clients/cli/connections.c:3873 ../clients/cli/connections.c:4714
+#: ../clients/cli/connections.c:4775 ../clients/cli/connections.c:5177
+#: ../clients/cli/connections.c:5187
+#| msgid "Error: %s."
+msgid "Error: "
+msgstr "Hata: "
+
+#. Ask for IP addresses
+#: ../clients/cli/connections.c:3890
+#, c-format
+msgid "Do you want to add IP addresses? %s"
+msgstr "IP adresleri eklemek istiyor musunuz? %s"
+
+#: ../clients/cli/connections.c:3897
+#, c-format
+msgid "Press <Enter> to finish adding addresses.\n"
+msgstr "Adres eklemeyi tamamlamak için <Enter> tuşuna basın.\n"
+
+#: ../clients/cli/connections.c:4036
+#, c-format
+msgid "Error: 'parent': not valid without 'p-key'."
+msgstr "Hata: 'parent': 'p-key' olmadan geçerli değil."
+
+#: ../clients/cli/connections.c:4091 ../clients/cli/connections.c:5096
+#| msgid "SSID"
+msgid "SSID: "
+msgstr "SSID: "
+
+#: ../clients/cli/connections.c:4094 ../clients/cli/connections.c:5099
+#| msgid "Error: Timeout %d sec expired."
+msgid "Error: 'ssid' is required."
+msgstr "Hata: 'ssid' gerekli."
+
+#: ../clients/cli/connections.c:4158
+#| msgid "WiMAX NSP list"
+msgid "WiMAX NSP name: "
+msgstr "WiMAX NSP adı: "
+
+#: ../clients/cli/connections.c:4161
+msgid "Error: 'nsp' is required."
+msgstr "Hata: 'nsp' gereklidir."
+
+#: ../clients/cli/connections.c:4213
+msgid "PPPoE username: "
+msgstr "PPPoE kullanıcı adı: "
+
+#: ../clients/cli/connections.c:4216
+#| msgid "Error: Timeout %d sec expired."
+msgid "Error: 'username' is required."
+msgstr "Hata: 'kullanıcı adı' gereklidir."
+
+#: ../clients/cli/connections.c:4285
+msgid "APN: "
+msgstr "APN: "
+
+#: ../clients/cli/connections.c:4288
+msgid "Error: 'apn' is required."
+msgstr "Hata: 'apn' gereklidir."
+
+#: ../clients/cli/connections.c:4346
+msgid "Bluetooth device address: "
+msgstr "Bluetooth aygıt adresi: "
+
+#: ../clients/cli/connections.c:4349
+#| msgid "Error: Timeout %d sec expired."
+msgid "Error: 'addr' is required."
+msgstr "Hata: 'addr' gereklidir."
+
+#: ../clients/cli/connections.c:4390
+#, c-format
+msgid "Error: 'bt-type': '%s' not valid; use [%s, %s (%s), %s]."
+msgstr "Hata: 'bt-type': '%s' geçerli değil; [%s, %s (%s), %s] kullanın."
+
+#: ../clients/cli/connections.c:4434
+#| msgid "no device found for connection '%s'"
+msgid "VLAN parent device or connection UUID: "
+msgstr "VLAN üst aygıtı veya bağlantı UUID: "
+
+#: ../clients/cli/connections.c:4437
+#| msgid "Error: 'dev list': %s"
+msgid "Error: 'dev' is required."
+msgstr "Hata: 'dev' gereklidir."
+
+#: ../clients/cli/connections.c:4441
+msgid "VLAN ID <0-4095>: "
+msgstr "VLAN ID <0-4095>: "
+
+#: ../clients/cli/connections.c:4444
+#| msgid "Error: Timeout %d sec expired."
+msgid "Error: 'id' is required."
+msgstr "Hata: 'id' gereklidir."
+
+#: ../clients/cli/connections.c:4450
+#, c-format
+#| msgid "Error: 'dev' command '%s' is not valid."
+msgid "Error: 'id': '%s' is not valid; use <0-4095>."
+msgstr "Hata: 'id': '%s' geçerli değil; <0-4095> kullanın."
+
+#: ../clients/cli/connections.c:4460
+#, c-format
+msgid "Error: 'dev': '%s' is neither UUID, interface name, nor MAC."
+msgstr "Hata: 'dev': '%s', UUID, arayüz adı veya MAC değil."
+
+#: ../clients/cli/connections.c:4594
+#, c-format
+#| msgid "Error: 'dev list': %s"
+msgid "Error: 'mode': %s."
+msgstr "Hata: 'kip': %s."
+
+#: ../clients/cli/connections.c:4603
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'primary': '%s' is not a valid interface name."
+msgstr "Hata: 'primary': '%s' geçerli bir arayüz adı değil."
+
+#: ../clients/cli/connections.c:4655 ../clients/cli/connections.c:4753
+#: ../clients/cli/connections.c:4955
+#| msgid "Error: Timeout %d sec expired."
+msgid "Error: 'master' is required."
+msgstr "Hata: 'master' gereklidir."
+
+#: ../clients/cli/connections.c:4661 ../clients/cli/connections.c:4759
+#: ../clients/cli/connections.c:4961
+#, c-format
+msgid "Warning: master='%s' doesn't refer to any existing profile.\n"
+msgstr "Uyarı: master='%s' mevcut bir profile karşılık gelmiyor.\n"
+
+#: ../clients/cli/connections.c:4664 ../clients/cli/connections.c:4767
+#: ../clients/cli/connections.c:4964
+#, c-format
+msgid ""
+"Warning: 'type' is currently ignored. We only support ethernet slaves for "
+"now.\n"
+msgstr ""
+"Uyarı: 'type' şimdilik yoksayıldı. Şimdi sadece ikincil ethernetleri "
+"destekliyoruz .\n"
+
+#: ../clients/cli/connections.c:4861
+#, c-format
+#| msgid "Error: 'con list': %s"
+msgid "Error: 'stp': %s."
+msgstr "Hata: 'stp': %s."
+
+#: ../clients/cli/connections.c:4991
+#, c-format
+#| msgid "Error: 'dev wifi': %s"
+msgid "Error: 'hairpin': %s."
+msgstr "Hata: 'hairpin': %s."
+
+#: ../clients/cli/connections.c:5044
+msgid "Error: 'vpn-type' is required."
+msgstr "Hata: 'vpn-type' gereklidir."
+
+#: ../clients/cli/connections.c:5051
+#, c-format
+msgid "Warning: 'vpn-type': %s not known.\n"
+msgstr "Uyarı: 'vpn-type': %s bilinmiyor.\n"
+
+#: ../clients/cli/connections.c:5112
+#, c-format
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'channel': '%s' is not valid; use <1-13>."
+msgstr "Hata: 'kanal': '%s' geçerli değil; <1-13> kullanın."
+
+#: ../clients/cli/connections.c:5144
+#, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: '%s' is not a valid connection type."
+msgstr "Hata: '%s' geçerli bir bağlantı türü değil."
+
+#: ../clients/cli/connections.c:5244
+#, c-format
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Error: Failed to add '%s' connection: %s"
+msgstr "Hata: '%s' bağlantısı eklenemedi: %s"
+
+#: ../clients/cli/connections.c:5249
+#, c-format
+msgid "Connection '%s' (%s) successfully added.\n"
+msgstr "'%s' (%s) bağlantısı başarıyla eklendi.\n"
+
+#: ../clients/cli/connections.c:5469
+#, c-format
+#| msgid "Error: '%s' argument is missing."
+msgid "Error: 'type' argument is required."
+msgstr "Hata: 'tür' değişkeni gereklidir."
+
+#: ../clients/cli/connections.c:5477
+#, c-format
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: invalid connection type; %s."
+msgstr "Hata: geçersiz bağlantı türü; %s."
+
+#: ../clients/cli/connections.c:5486
+#, c-format
+#| msgid "Error: 'con list': %s"
+msgid "Error: 'autoconnect': %s."
+msgstr "Hata: 'otomatik baÄŸlan': %s."
+
+#: ../clients/cli/connections.c:5496
+#, c-format
+#| msgid "Error: 'nm status': %s"
+msgid "Error: 'save': %s."
+msgstr "Hata: 'kaydet': %s."
+
+#: ../clients/cli/connections.c:5512
+msgid "Interface name [*]: "
+msgstr "Arayüz adı [*]: "
+
+#: ../clients/cli/connections.c:5517
+#, c-format
+#| msgid "Error: '%s' argument is missing."
+msgid "Error: 'ifname' argument is required."
+msgstr "Hata: 'ifname' deÄŸiÅŸkeni gereklidir."
+
+#: ../clients/cli/connections.c:5524
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "Error: 'ifname': '%s' is not a valid interface nor '*'."
+msgstr "Hata: 'ifname': '%s' geçerli bir arayüz veya '*' değil."
+
+#: ../clients/cli/connections.c:6300
+#, c-format
+msgid "['%s' setting values]\n"
+msgstr "['%s' değerleri ayarlıyor]\n"
+
+#. TRANSLATORS: do not translate command names and keywords before ::
+#. * However, you should translate terms enclosed in <>.
+#.
+#: ../clients/cli/connections.c:6382
+#, c-format
+msgid ""
+"---[ Main menu ]---\n"
+"goto [<setting> | <prop>] :: go to a setting or property\n"
+"remove <setting>[.<prop>] | <prop> :: remove setting or reset property "
+"value\n"
+"set [<setting>.<prop> <value>] :: set property value\n"
+"describe [<setting>.<prop>] :: describe property\n"
+"print [all | <setting>[.<prop>]] :: print the connection\n"
+"verify [all | fix] :: verify the connection\n"
+"save [persistent|temporary] :: save the connection\n"
+"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
+"back :: go one level up (back)\n"
+"help/? [<command>] :: print this help\n"
+"nmcli <conf-option> <value> :: nmcli configuration\n"
+"quit :: exit nmcli\n"
+msgstr ""
+"---[ Ana menü ]---\n"
+"goto [<ayar> | <özellik>] :: bir ayara veya özelliğe git\n"
+"remove <ayar>[.<özellik>] | <prop> :: ayarı kaldır veya özellik değerini "
+"sıfırla\n"
+"set [<ayar>.<özellik> <değer>] :: özellik değerini ayarla\n"
+"describe [<ayar>.<özellik>] :: özelliği tanımla\n"
+"print [tümü | <ayar>[.<özellik>]] :: bağlantıyı yazdır\n"
+"verify [tümü | fix] :: bağlantıyı doğrula\n"
+"save [kalıcı|geçici] :: bağlantıyı kaydet\n"
+"activate [<ifname>] [/<ap>|<nsp>] :: bağlantıyı etkinleştir\n"
+"back :: bir seviye yukarı çık (geri)\n"
+"help/? [<komut>] :: bu yardımı yazdır\n"
+"nmcli <yapılandırma-seçeneği> <değer> :: nmcli yapılandırması\n"
+"quit :: çık nmcli\n"
+
+#: ../clients/cli/connections.c:6409
+#, c-format
+msgid ""
+"goto <setting>[.<prop>] | <prop> :: enter setting/property for editing\n"
+"\n"
+"This command enters into a setting or property for editing it.\n"
+"\n"
+"Examples: nmcli> goto connection\n"
+" nmcli connection> goto secondaries\n"
+" nmcli> goto ipv4.addresses\n"
+msgstr ""
+"goto <ayar>[.<özellik>] | <özellik> :: düzenlemek için ayarı/özelliği "
+"girin\n"
+"\n"
+"Bu komut bir ayar veya özelliği düzenlemek için girer.\n"
+"\n"
+"Örnekler: nmcli> goto connection\n"
+" nmcli connection> goto secondaries\n"
+" nmcli> goto ipv4.addresses\n"
+
+#: ../clients/cli/connections.c:6416
+#, c-format
+msgid ""
+"remove <setting>[.<prop>] :: remove setting or reset property value\n"
+"\n"
+"This command removes an entire setting from the connection, or if a "
+"property\n"
+"is given, resets that property to the default value.\n"
+"\n"
+"Examples: nmcli> remove wifi-sec\n"
+" nmcli> remove eth.mtu\n"
+msgstr ""
+"remove <ayar>[.<özellik>] :: ayarı kaldır veya özellik değerini sıfırla\n"
+"\n"
+"Bu komut bağlantının tüm ayarlarını kaldırır, veya bir özellik verilmişse\n"
+"onu varsayılan değerine sıfırlar.\n"
+"\n"
+"Örnekler: nmcli> remove wifi-sec\n"
+" nmcli> remove eth.mtu\n"
+
+#: ../clients/cli/connections.c:6423
+#, c-format
+msgid ""
+"set [<setting>.<prop> <value>] :: set property value\n"
+"\n"
+"This command sets property value.\n"
+"\n"
+"Example: nmcli> set con.id My connection\n"
+msgstr ""
+"set [<ayar>.<özellik> <değer>] :: özelliğin değerini ayarla\n"
+"\n"
+"Bu komut bir özelliğin değerini ayarlar.\n"
+"\n"
+"Örnek: nmcli> set con.id Bağlantım\n"
+
+#: ../clients/cli/connections.c:6428
+#, c-format
+msgid ""
+"describe [<setting>.<prop>] :: describe property\n"
+"\n"
+"Shows property description. You can consult nm-settings(5) manual page to "
+"see all NM settings and properties.\n"
+msgstr ""
+"describe [<ayar>.<özellik>] :: özellik tanımla\n"
+"\n"
+"Özellik tanımını gösterir. Tüm NM ayarlarını ve özelliklerini görmek için nm-"
+"settings(5) kılavuz sayfasına bakabilirsiniz.\n"
+
+#: ../clients/cli/connections.c:6433
+#, c-format
+msgid ""
+"print [all] :: print setting or connection values\n"
+"\n"
+"Shows current property or the whole connection.\n"
+"\n"
+"Example: nmcli ipv4> print all\n"
+msgstr ""
+"print [all] :: ayarı veya bağlantı değerini yazdır\n"
+"\n"
+"Mevcut özelliği veya tüm bağlantıyı gösterir.\n"
+"\n"
+"Örnek: nmcli ipv4> print all\n"
+
+#: ../clients/cli/connections.c:6438
+#, c-format
+msgid ""
+"verify [all | fix] :: verify setting or connection validity\n"
+"\n"
+"Verifies whether the setting or connection is valid and can be saved later.\n"
+"It indicates invalid values on error. Some errors may be fixed "
+"automatically\n"
+"by 'fix' option.\n"
+"\n"
+"Examples: nmcli> verify\n"
+" nmcli> verify fix\n"
+" nmcli bond> verify\n"
+msgstr ""
+"verify [all | fix] :: ayarların veya bağlantının geçerliliğini onayla\n"
+"\n"
+"Ayarın veya bağlantının geçerli olduğunu ve ileride kaydedilebileceğini "
+"onaylar.\n"
+"Geçersiz değerleri hatalarda gösterir. Bazı hatalar \n"
+"'fix' seçeneği ile düzeltilebilir.\n"
+"\n"
+"Örnekler: nmcli> verify\n"
+" nmcli> verify fix\n"
+" nmcli bond> verify\n"
+
+#: ../clients/cli/connections.c:6447
+#, c-format
+msgid ""
+"save [persistent|temporary] :: save the connection\n"
+"\n"
+"Sends the connection profile to NetworkManager that either will save it\n"
+"persistently, or will only keep it in memory. 'save' without an argument\n"
+"means 'save persistent'.\n"
+"Note that once you save the profile persistently those settings are saved\n"
+"across reboot or restart. Subsequent changes can also be temporary or\n"
+"persistent, but any temporary changes will not persist across reboot or\n"
+"restart. If you want to fully remove the persistent connection, the "
+"connection\n"
+"profile must be deleted.\n"
+msgstr ""
+"save [persistent|temporary] :: bağlantıyı kaydet\n"
+"\n"
+"Bağlantı profilini NetworkManager'a ya kalıcı olarak kaydetmesi için ya da\n"
+"sadece bellekte tutması için gönderir. 'save' seçeneğini parametre olmadan "
+"kullanmak\n"
+"'save persistent'. anlamına gelir.\n"
+"Bir kere profili kalıcı olarak kaydettiğinizde bu ayarlar yeniden başlatma "
+"sonrasında da\n"
+"geçerli olacağını unutmayın. Sonra yapacağınız değişiklikler de kalıcı veya "
+"geçici olabilir\n"
+"ama geçici değişiklikler yeniden başlatma sonrasında silineceklerdir.\n"
+"Kalıcı bir bağlantıyı tamamen kaldırmak isterseniz\n"
+"bağlantı profilini silmeniz gerekir.\n"
+
+#: ../clients/cli/connections.c:6458
+#, c-format
+msgid ""
+"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
+"\n"
+"Activates the connection.\n"
+"\n"
+"Available options:\n"
+"<ifname> - device the connection will be activated on\n"
+"/<ap>|<nsp> - AP (Wi-Fi) or NSP (WiMAX) (prepend with / when <ifname> is not "
+"specified)\n"
+msgstr ""
+"activate [<ifname>] [/<ap>|<nsp>] :: bağlantıyı etkinleştir\n"
+"\n"
+"Bağlantıyı etkinleştirir.\n"
+"\n"
+"Kullanılabilir seçenekler:\n"
+"<ifname> - bağlantısı etkinleştirilecek aygıt\n"
+"/<ap>|<nsp> - AP (Wi-Fi) veya NSP (WiMAX) (<ifname> belirtilmediÄŸinde)\n"
+
+#: ../clients/cli/connections.c:6465 ../clients/cli/connections.c:6623
+#, c-format
+msgid ""
+"back :: go to upper menu level\n"
+"\n"
+msgstr ""
+"back :: bir üst menüye git\n"
+"\n"
+
+#: ../clients/cli/connections.c:6468
+#, c-format
+msgid ""
+"help/? [<command>] :: help for the nmcli commands\n"
+"\n"
+msgstr ""
+"help/? [<komut>] :: nmcli komutları için yardım\n"
+"\n"
+
+#: ../clients/cli/connections.c:6471
+#, c-format
+msgid ""
+"nmcli [<conf-option> <value>] :: 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"
+"Examples: nmcli> nmcli status-line yes\n"
+" nmcli> nmcli save-confirmation no\n"
+" nmcli> nmcli prompt-color 3\n"
+msgstr ""
+"nmcli [<yapılandırma seçeneği> <değer>] :: nmcli yapılandırması\n"
+"\n"
+"nmcli'yi yapılandırır. Aşağıdaki seçenekler kullanılabilir:\n"
+"status-line yes | no [varsayılan: no]\n"
+"save-confirmation yes | no [varsayılan yes]\n"
+"show-secrets yes | no [varsayılan: no]\n"
+"prompt-color <0-8> [varsayılan: 0]\n"
+" 0 = normal\n"
+" 1 = siyah\n"
+" 2 = kırmızı\n"
+" 3 = yeÅŸil\n"
+" 4 = sarı\n"
+" 5 = mavi[0m\n"
+" 6 = eflatun\n"
+" 7 = cam göbeği[0m\n"
+" 8 = beyaz\n"
+"\n"
+"Örnekler: nmcli> nmcli status-line yes\n"
+" nmcli> nmcli save-confirmation no\n"
+" nmcli> nmcli prompt-color 3\n"
+
+#: ../clients/cli/connections.c:6492 ../clients/cli/connections.c:6629
+#, c-format
+msgid ""
+"quit :: exit nmcli\n"
+"\n"
+"This command exits nmcli. When the connection being edited is not saved, the "
+"user is asked to confirm the action.\n"
+msgstr ""
+"quit :: nmcli uygulamasından çık\n"
+"\n"
+"Bu komutla nmcli uygulamasından çıkılır. Düzenlenen bağlantı kaydedilmemişse "
+"çıkışta kullanıcıya ne yapılacağı sorulur.\n"
+
+#: ../clients/cli/connections.c:6497 ../clients/cli/connections.c:6634
+#: ../clients/cli/connections.c:7044 ../clients/cli/connections.c:7960
+#, c-format
+#| msgid "Unknown log domain '%s'"
+msgid "Unknown command: '%s'\n"
+msgstr "Bilinmeyen komut: '%s'\n"
+
+#. TRANSLATORS: do not translate command names and keywords before ::
+#. * However, you should translate terms enclosed in <>.
+#.
+#: ../clients/cli/connections.c:6563
+#, c-format
+msgid ""
+"---[ Property menu ]---\n"
+"set [<value>] :: set new value\n"
+"add [<value>] :: add new option to the property\n"
+"change :: change current value\n"
+"remove [<index> | <option>] :: delete the value\n"
+"describe :: describe property\n"
+"print [setting | connection] :: print property (setting/connection) "
+"value(s)\n"
+"back :: go to upper level\n"
+"help/? [<command>] :: print this help or command description\n"
+"quit :: exit nmcli\n"
+msgstr ""
+"---[ Özelllek menüsü ]---\n"
+"set [<deÄŸer>] :: yeni deÄŸer ata\n"
+"add [<değer>] :: özelliğe yeni seçenek ekle\n"
+"change :: mevcut deÄŸeri deÄŸiÅŸtir\n"
+"remove [<indeks> | <seçenek>] :: değeri sil\n"
+"describe :: özelliği tanımla\n"
+"print [ayar | bağlantı] :: özellik (ayar/bağlantı) değerini yazdır\n"
+"back :: bir üst seviyeye git\n"
+"help/? [<komut>] :: bu yardımı veya komut tanımlamasını "
+"yazdır\n"
+"quit :: nmcli uygulamasından çık\n"
+
+#: ../clients/cli/connections.c:6588
+#, c-format
+msgid ""
+"set [<value>] :: set new value\n"
+"\n"
+"This command sets provided <value> to this property\n"
+msgstr ""
+"set [<deÄŸer>] :: yeni deÄŸer ata\n"
+"\n"
+"Bu komut verilen <değeri> bu özelliğe atar\n"
+
+#: ../clients/cli/connections.c:6592
+#, c-format
+msgid ""
+"add [<value>] :: append new value to the property\n"
+"\n"
+"This command adds provided <value> to this property, if the property is of a "
+"container type. For single-valued properties the property value is replaced "
+"(same as 'set').\n"
+msgstr ""
+"add [<değer>] :: özelliğe yeni bir değer ekler\n"
+"\n"
+"Eğer özellik bir kap çeşidi ise bu komut bu özelliğe verilen <değeri> ekler. "
+"Tek değerli bir özellik ise bu değerin üzerine yazılır ('set' ile aynı "
+"işlevi görür).\n"
+
+#: ../clients/cli/connections.c:6598
+#, c-format
+msgid ""
+"change :: change current value\n"
+"\n"
+"Displays current value and allows editing it.\n"
+msgstr ""
+"change :: mevcut deÄŸeri deÄŸiÅŸtir\n"
+"\n"
+"Mevcut değeri görüntüler ve düzenlenmesine izin verir.\n"
+
+#: ../clients/cli/connections.c:6602
+#, c-format
+msgid ""
+"remove [<value>|<index>|<option name>] :: delete the value\n"
+"\n"
+"Removes the property value. For single-valued properties, this sets the\n"
+"property back to its default value. For container-type properties, this "
+"removes\n"
+"all the values of that property, or you can specify an argument to remove "
+"just\n"
+"a single item or option. The argument is either a value or index of the item "
+"to\n"
+"remove, or an option name (for properties with named options).\n"
+"\n"
+"Examples: nmcli ipv4.dns> remove 8.8.8.8\n"
+" nmcli ipv4.dns> remove 2\n"
+" nmcli bond.options> remove downdelay\n"
+"\n"
+msgstr ""
+"remove [<değer>|<indeks>|<seçenek adı>] :: değeri sil\n"
+"\n"
+"Özelliğin değerini siler. Tek değerli özellikler için özelliğin varsayılan "
+"deÄŸerini\n"
+"geri yükler. Kap türündeki özellikler için özelliğin bütün değerlerini "
+"siler\n"
+"veya tek bir ögeyi ya da seçeneği silmesini sağlayacak parametre de\n"
+"kullanabilirsiniz. Bu parametre bir değer veya silinecek ögenin indeksi\n"
+"veya seçenek adı (seçenek adına sahip özellikler için) olabilir.\n"
+"\n"
+"Örnekler: nmcli ipv4.dns> remove 8.8.8.8\n"
+" nmcli ipv4.dns> remove 2\n"
+" nmcli bond.options> remove downdelay\n"
+"\n"
+
+#: ../clients/cli/connections.c:6613
+#, c-format
+msgid ""
+"describe :: describe property\n"
+"\n"
+"Shows property description. You can consult nm-settings(5) manual page to "
+"see all NM settings and properties.\n"
+msgstr ""
+"describe :: özellik tanımla\n"
+"\n"
+"Özellik tanımını gösterir. Tüm NM ayarlarını ve özelliklerini görmek için nm-"
+"settings(5) kılavuz sayfasına bakabilirsiniz.\n"
+
+#: ../clients/cli/connections.c:6618
+#, c-format
+msgid ""
+"print [property|setting|connection] :: print property (setting, connection) "
+"value(s)\n"
+"\n"
+"Shows property value. Providing an argument you can also display values for "
+"the whole setting or connection.\n"
+msgstr ""
+"print [property|setting|connection] :: print property (setting, connection) "
+"value(s)\n"
+"\n"
+"Özellik değerlerini gösterir. Bir değişken belirterek, tüm ayar ve "
+"bağlantılar için değerleri de gösterebilirsiniz.\n"
+
+#: ../clients/cli/connections.c:6626
+#, c-format
+msgid ""
+"help/? [<command>] :: help for nmcli commands\n"
+"\n"
+msgstr ""
+"help/? [<komut>] :: nmcli komutları için yardım\n"
+"\n"
+
+#: ../clients/cli/connections.c:6724
+#, c-format
+#| msgid "Error: Connection activation failed."
+msgid "Error: Connection activation failed.\n"
+msgstr "Hata: Bağlantı etkinleştirilemedi.\n"
+
+#: ../clients/cli/connections.c:6807
+#, c-format
+msgid "Error: setting '%s' is mandatory and cannot be removed.\n"
+msgstr "Hata: '%s' ayarı zorunludur ve kaldırılamaz.\n"
+
+#. TRANSLATORS: status line in nmcli connection editor
+#: ../clients/cli/connections.c:6825
+#, c-format
+msgid "[ Type: %s | Name: %s | UUID: %s | Dirty: %s | Temp: %s ]\n"
+msgstr "[ Tür: %s | İsim: %s | UUID: %s | Kirli: %s | Geçici: %s ]\n"
+
+#: ../clients/cli/connections.c:6860
+#, c-format
+msgid "The connection is not saved. Do you really want to quit? %s"
+msgstr "Bağlantı kaydedilmedi. Gerçekten çıkmak istiyor musunuz? %s"
+
+#: ../clients/cli/connections.c:6905
+#, c-format
+msgid ""
+"The connection profile has been removed from another client. You may type "
+"'save' in the main menu to restore it.\n"
+msgstr ""
+"Bağlantı profili başka bir istemciden kaldırıldı. Ama menüden 'kaydet'e "
+"tıklayarak geri yükleyebilirsiniz.\n"
+
+#: ../clients/cli/connections.c:6927 ../clients/cli/connections.c:7348
+#: ../clients/cli/connections.c:7403
+#, c-format
+msgid "Enter '%s' value: "
+msgstr "'%s' deÄŸerini girin: "
+
+#: ../clients/cli/connections.c:6942 ../clients/cli/connections.c:6964
+#: ../clients/cli/connections.c:7352 ../clients/cli/connections.c:7408
+#, c-format
+msgid "Error: failed to set '%s' property: %s\n"
+msgstr "Hata: '%s' özelliği ayarlanamadı: %s\n"
+
+#: ../clients/cli/connections.c:6958
+#, c-format
+msgid "Edit '%s' value: "
+msgstr "'%s' değerini düzenle: "
+
+#: ../clients/cli/connections.c:6987
+#, c-format
+#| msgid "Error: %s."
+msgid "Error: %s\n"
+msgstr "Hata: %s\n"
+
+#: ../clients/cli/connections.c:6993 ../clients/cli/connections.c:7487
+#: ../clients/cli/connections.c:7528
+#, c-format
+msgid "Error: failed to remove value of '%s': %s\n"
+msgstr "Hata: '%s' değeri kaldırılamadı: %s\n"
+
+#: ../clients/cli/connections.c:7014
+#, c-format
+#| msgid "Unknown parameter: %s\n"
+msgid "Unknown command argument: '%s'\n"
+msgstr "Bilinmeyen komut deÄŸiÅŸkeni: '%s'\n"
+
+#: ../clients/cli/connections.c:7140
+#, c-format
+msgid "Available settings: %s\n"
+msgstr "Kullanılabilir ayarlar: %s\n"
+
+#: ../clients/cli/connections.c:7149
+#, c-format
+#| msgid "Error: invalid 'wifi' parameter: '%s'."
+msgid "Error: invalid setting name; %s\n"
+msgstr "Hata: geçersiz ayar adı: '%s'\n"
+
+#: ../clients/cli/connections.c:7166
+#, c-format
+msgid "Available properties: %s\n"
+msgstr "Kullanılabilir özellikler: %s\n"
+
+#: ../clients/cli/connections.c:7174
+#, c-format
+#| msgid "Error: %s."
+msgid "Error: property %s\n"
+msgstr "Hata: özellik %s\n"
+
+#: ../clients/cli/connections.c:7215
+#, c-format
+msgid ""
+"Saving the connection with 'autoconnect=yes'. That might result in an "
+"immediate activation of the connection.\n"
+"Do you still want to save? %s"
+msgstr ""
+"Bağlantı 'autoconnect=yes' ile kaydediliyor. Bu bağlantının hemen "
+"etkinleÅŸtirilmesine neden olur.\n"
+"Yine de kaydetmek istiyor musunuz? %s"
+
+#: ../clients/cli/connections.c:7290
+#, c-format
+msgid "You may edit the following settings: %s\n"
+msgstr "Bu ayarları değiştirebilirsiniz: %s\n"
+
+#: ../clients/cli/connections.c:7317
+#, c-format
+msgid ""
+"The connection profile has been removed from another client. You may type "
+"'save' to restore it.\n"
+msgstr ""
+"Bağlantı profili başka bir istemciden kaldırıldı. 'Kaydet' ile geri "
+"yükleyebilirsiniz.\n"
+
+#: ../clients/cli/connections.c:7346 ../clients/cli/connections.c:7401
+#, c-format
+msgid "Allowed values for '%s' property: %s\n"
+msgstr "'%s' özelliği için izin verilen değerler: %s\n"
+
+#: ../clients/cli/connections.c:7356 ../clients/cli/connections.c:7570
+#, c-format
+#| msgid "Error: Connection deletion failed: %s"
+msgid "Error: no setting selected; valid are [%s]\n"
+msgstr "Hata: hiç ayar seçilmedi; geçerli olanlar [%s]\n"
+
+#: ../clients/cli/connections.c:7357
+#, c-format
+msgid "use 'goto <setting>' first, or 'set <setting>.<property>'\n"
+msgstr "önce 'goto <ayar>'ı kullanın, veya 'set <ayar>.<özellik>'\n"
+
+#: ../clients/cli/connections.c:7371 ../clients/cli/connections.c:7507
+#: ../clients/cli/connections.c:7587
+#, c-format
+#| msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'."
+msgid "Error: invalid setting argument '%s'; valid are [%s]\n"
+msgstr "Hata: geçersiz ayar değişkeni '%s'; geçerli olanlar [%s]\n"
+
+#: ../clients/cli/connections.c:7381
+#, c-format
+#| msgid "Error: missing argument for '%s' option."
+msgid "Error: missing setting for '%s' property\n"
+msgstr "Hata: '%s' özelliği için eksik ayar.\n"
+
+#: ../clients/cli/connections.c:7388
+#, c-format
+#| msgid "Error: invalid 'wifi' parameter: '%s'."
+msgid "Error: invalid property: %s\n"
+msgstr "Hata: geçersiz özellik: %s\n"
+
+#: ../clients/cli/connections.c:7435
+#, c-format
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: unknown setting '%s'\n"
+msgstr "Hata: bilinmeyen ayar '%s'\n"
+
+#: ../clients/cli/connections.c:7448
+#, c-format
+msgid "You may edit the following properties: %s\n"
+msgstr "Aşağıdaki özellikleri düzenleyebilirsiniz: %s\n"
+
+#: ../clients/cli/connections.c:7492
+#, c-format
+msgid "Error: no argument given; valid are [%s]\n"
+msgstr "Hata: hiç değişken verilmedi; geçerli olanlar [%s]\n"
+
+#: ../clients/cli/connections.c:7505
+#, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Setting '%s' is not present in the connection.\n"
+msgstr "'%s' ayarı bağlantıda bulunmuyor.\n"
+
+#: ../clients/cli/connections.c:7546
+#, c-format
+msgid "Error: %s properties, nor it is a setting name.\n"
+msgstr "Hata: %s özellikleri veya bu bir ayar adı.\n"
+
+#: ../clients/cli/connections.c:7571
+#, c-format
+msgid "use 'goto <setting>' first, or 'describe <setting>.<property>'\n"
+msgstr "ilk olarak 'goto <ayar>' kullan ya da 'describe <ayar>.<özellik>'\n"
+
+#: ../clients/cli/connections.c:7612
+#, c-format
+msgid "Error: invalid property: %s, neither a valid setting name.\n"
+msgstr "Hata: geçersiz özellik: %s geçerli bir ayar adı değil.\n"
+
+#: ../clients/cli/connections.c:7641
+#, c-format
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: unknown setting: '%s'\n"
+msgstr "Hata: bilinmeyen ayar: '%s'\n"
+
+#: ../clients/cli/connections.c:7646
+#, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: '%s' setting not present in the connection\n"
+msgstr "Hata: '%s' ayarı bağlantıda bulunmuyor\n"
+
+#: ../clients/cli/connections.c:7671
+#, c-format
+#| msgid "Error: invalid 'wifi' parameter: '%s'."
+msgid "Error: invalid property: %s%s\n"
+msgstr "Hata: geçersiz özellik: %s%s\n"
+
+#: ../clients/cli/connections.c:7673
+msgid ", neither a valid setting name"
+msgstr ", ya da geçersiz ayar adı"
+
+#: ../clients/cli/connections.c:7690
+#, c-format
+msgid "Invalid verify option: %s\n"
+msgstr "Geçersiz onaylama seçeneği: %s\n"
+
+#: ../clients/cli/connections.c:7698
+#, c-format
+msgid "Verify setting '%s': %s\n"
+msgstr "'%s' ayarını onaylayın: %s\n"
+
+#: ../clients/cli/connections.c:7713
+#, c-format
+#| msgid "VPN connection %d"
+msgid "Verify connection: %s\n"
+msgstr "Bağlantıyı onayla: %s\n"
+
+#: ../clients/cli/connections.c:7716
+#, c-format
+msgid "The error cannot be fixed automatically.\n"
+msgstr "Hata otomatik olarak onarılamadı.\n"
+
+#: ../clients/cli/connections.c:7733
+#, c-format
+#| msgid "Error: invalid 'wifi' parameter: '%s'."
+msgid "Error: invalid argument '%s'\n"
+msgstr "Hata: geçersiz parametre '%s'\n"
+
+#: ../clients/cli/connections.c:7766
+#, c-format
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Error: Failed to save '%s' (%s) connection: %s\n"
+msgstr "Hata: '%s' (%s) bağlantısı kaydedilemedi: %s\n"
+
+#: ../clients/cli/connections.c:7773
+#, c-format
+msgid "Connection '%s' (%s) successfully saved.\n"
+msgstr "'%s' (%s) bağlantısı başarıyla kaydedildi.\n"
+
+#: ../clients/cli/connections.c:7774
+#, c-format
+msgid "Connection '%s' (%s) successfully updated.\n"
+msgstr "'%s' (%s) bağlantısı başarıyla güncellendi.\n"
+
+#: ../clients/cli/connections.c:7807
+#, c-format
+#| msgid "Error: Connection activation failed: %s"
+msgid "Error: connection verification failed: %s\n"
+msgstr "Hata: bağlantı doğrulaması başarısız oldu: %s\n"
+
+#: ../clients/cli/connections.c:7808
+#| msgid "Unknown error"
+msgid "(unknown error)"
+msgstr "(bilinmeyen hata)"
+
+#: ../clients/cli/connections.c:7809
+#, c-format
+msgid "You may try running 'verify fix' to fix errors.\n"
+msgstr "Hataları düzeltmek için 'onarmayı doğrula' 'yı çalıştırabilirsiniz.\n"
+
+#: ../clients/cli/connections.c:7831
+#, c-format
+msgid "Error: connection is not saved. Type 'save' first.\n"
+msgstr "Hata: bağlantı kaydedilmedi. İlk olarak 'kaydet' yazın.\n"
+
+#: ../clients/cli/connections.c:7835
+#, c-format
+#| msgid "Error: Connection deletion failed: %s"
+msgid "Error: connection is not valid: %s\n"
+msgstr "Hata: bağlantı geçerli değil: %s\n"
+
+#: ../clients/cli/connections.c:7845
+#, c-format
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: Cannot activate connection: %s.\n"
+msgstr "Hata: Bağlantı etkinleştirilemedi: %s.\n"
+
+#: ../clients/cli/connections.c:7855
+#, c-format
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Error: Failed to activate '%s' (%s) connection: %s\n"
+msgstr "Hata: Yeni bağlantı '%s' (%s) etkinleştirme başarısız: %s\n"
+
+#: ../clients/cli/connections.c:7861
+#, c-format
+msgid "Monitoring connection activation (press any key to continue)\n"
+msgstr ""
+"Bağlantı izleme etkinleştirme (devam etmek için herhangi bir tuşa basın)\n"
+
+#: ../clients/cli/connections.c:7899
+#, c-format
+#| msgid "Error: 'nm status': %s"
+msgid "Error: status-line: %s\n"
+msgstr "Hata: durum-çizgisi: %s\n"
+
+#: ../clients/cli/connections.c:7907
+#, c-format
+#| msgid "Error: 'con list': %s"
+msgid "Error: save-confirmation: %s\n"
+msgstr "Hata: kayıt onaylaması: %s\n"
+
+#: ../clients/cli/connections.c:7915
+#, c-format
+#| msgid "Error: 'con status': %s"
+msgid "Error: show-secrets: %s\n"
+msgstr "Hata: 'gizi bilgi gösterimi':%s\n"
+
+#: ../clients/cli/connections.c:7923
+#, c-format
+msgid "Error: bad color number: '%s'; use <0-8>\n"
+msgstr "Hata: hatalı renk numarası: '%s'; <0-8> kullanın\n"
+
+#: ../clients/cli/connections.c:7935
+#, c-format
+msgid "Current nmcli configuration:\n"
+msgstr "Geçerli nmcli yapılandırması:\n"
+
+#: ../clients/cli/connections.c:7945
+#, c-format
+msgid "Invalid configuration option '%s'; allowed [%s]\n"
+msgstr "Geçersiz yapılandırma seçeneği '%s'; izin verilenler [%s]\n"
+
+#: ../clients/cli/connections.c:8193
+#, c-format
+msgid "Error: only one of 'id', uuid, or 'path' can be provided."
+msgstr "Hata: 'id', uuid ya da 'path' bunlardan biri saÄŸlanabilir."
+
+#: ../clients/cli/connections.c:8205 ../clients/cli/connections.c:8392
+#: ../clients/cli/connections.c:8399
+#, c-format
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: Unknown connection '%s'."
+msgstr "Hata: Bilinmeyen bağlantı '%s'."
+
+#: ../clients/cli/connections.c:8223
+#, c-format
+msgid "Warning: editing existing connection '%s'; 'type' argument is ignored\n"
+msgstr ""
+"Uyarı: mevcut '%s' bağlantısını düzenleme; 'type' değişkeni yoksayıldı\n"
+
+#: ../clients/cli/connections.c:8226
+#, c-format
+msgid ""
+"Warning: editing existing connection '%s'; 'con-name' argument is ignored\n"
+msgstr ""
+"Uyarı: mevcut '%s' bağlantısını düzenleme; 'con-name' değişkeni yoksayıldı\n"
+
+#: ../clients/cli/connections.c:8240
+#, c-format
+#| msgid "Active connection state: %s\n"
+msgid "Valid connection types: %s\n"
+msgstr "Geçerli bağlantı türleri: %s\n"
+
+#: ../clients/cli/connections.c:8242
+#, c-format
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: invalid connection type; %s\n"
+msgstr "Hata: geçersiz bağlantı türü: %s\n"
+
+#: ../clients/cli/connections.c:8281
+#, c-format
+#| msgid "no active connection or device"
+msgid "===| nmcli interactive connection editor |==="
+msgstr "===| nmcli etkileşimli bağlantı düzenleyicisi |==="
+
+#: ../clients/cli/connections.c:8284
+#, c-format
+#| msgid "no device found for connection '%s'"
+msgid "Editing existing '%s' connection: '%s'"
+msgstr "Mevcut '%s' bağlantısı düzenleme: '%s'"
+
+#: ../clients/cli/connections.c:8286
+#, c-format
+#| msgid "Active connections"
+msgid "Adding a new '%s' connection"
+msgstr "Bir yeni '%s' bağlantı ekleniyor"
+
+#: ../clients/cli/connections.c:8288
+#, c-format
+msgid "Type 'help' or '?' for available commands."
+msgstr "Kullanılabilir komutlar için 'help' veya '?' kullanmayı deneyin."
+
+#: ../clients/cli/connections.c:8290
+#, c-format
+msgid "Type 'describe [<setting>.<prop>]' for detailed property description."
+msgstr "Detaylı özellik tanımlaması için 'describe [<ayar>.<özellik>]' yazın."
+
+#: ../clients/cli/connections.c:8328
+#, c-format
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Error: Failed to modify connection '%s': %s"
+msgstr "Hata: Bağlantı düzenleme başarısız '%s': %s"
+
+#: ../clients/cli/connections.c:8335
+#, c-format
+msgid "Connection '%s' (%s) successfully modified.\n"
+msgstr "'%s' (%s) bağlantısı başarıyla düzenlendi.\n"
+
+#: ../clients/cli/connections.c:8367
+#, c-format
+#| msgid "Error: %s argument is missing."
+msgid "Error: No arguments provided."
+msgstr "Hata: Değişken sağlanamadı."
+
+#: ../clients/cli/connections.c:8386
+#, c-format
+#| msgid "Error: %s argument is missing."
+msgid "Error: connection ID is missing."
+msgstr "Hata: bağlantı ID 'si eksik."
+
+#: ../clients/cli/connections.c:8408 ../clients/cli/connections.c:8421
+#, c-format
+#| msgid "Error: %s argument is missing."
+msgid "Error: <setting>.<property> argument is missing."
+msgstr "Hata: <ayar>.<özellik> değişkeni eksik."
+
+#: ../clients/cli/connections.c:8426
+#, c-format
+#| msgid "Error: fields for '%s' options are missing."
+msgid "Error: value for '%s' is missing."
+msgstr "Hata: '%s' için değer eksik."
+
+#: ../clients/cli/connections.c:8444
+#, c-format
+#| msgid "Error: invalid 'wifi' parameter: '%s'."
+msgid "Error: invalid <setting>.<property> '%s'."
+msgstr "Hata: geçersiz <ayar>.<özellik> '%s'."
+
+#: ../clients/cli/connections.c:8452
+#, c-format
+#| msgid "Error: invalid 'wwan' parameter: '%s'."
+msgid "Error: invalid or not allowed setting '%s': %s."
+msgstr "Hata: geçersiz ya da izinsiz ayar '%s': %s."
+
+#: ../clients/cli/connections.c:8473
+#, c-format
+#| msgid "Error: invalid 'wifi' parameter: '%s'."
+msgid "Error: invalid property '%s': %s."
+msgstr "Hata: geçersiz özellik '%s': %s."
+
+#: ../clients/cli/connections.c:8484
+#, c-format
+msgid "Error: failed to modify %s.%s: %s."
+msgstr "Hata: düzenleme başarısız %s.%s: %s."
+
+#: ../clients/cli/connections.c:8502
+#, c-format
+msgid "Error: failed to remove a value from %s.%s: %s."
+msgstr "Hata: şuradan bir değer silme başarısız %s.%s: %s."
+
+#: ../clients/cli/connections.c:8539
+#, c-format
+msgid "Error: Connection deletion failed: %s"
+msgstr "Hata: Bağlantı silinemedi: %s"
+
+#: ../clients/cli/connections.c:8603
+#, c-format
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: unknown connection: %s\n"
+msgstr "Hata: bilinmeyen bağlantı: %s\n"
+
+#. truncate trailing ", "
+#: ../clients/cli/connections.c:8640
+#, c-format
+#| msgid "Error: Unknown connection: %s."
+msgid "Error: cannot delete unknown connection(s): %s."
+msgstr "Hata: Bilinmeyen bağlantı(lar) silinemedi: %s."
+
+#: ../clients/cli/connections.c:8663
+#, c-format
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Error: failed to reload connections: %s."
+msgstr "Hata: bağlantılar yeniden yüklenemedi: %s."
+
+#: ../clients/cli/connections.c:8702
+#, c-format
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Error: failed to load connection: %s."
+msgstr "Hata: bağlantı yüklenemedi: %s."
+
+#: ../clients/cli/connections.c:8710
+#, c-format
+#| msgid "Couldn't decode PKCS#8 file: %s"
+msgid "Could not load file '%s'\n"
+msgstr "'%s' dosyası yüklenemedi\n"
+
+#: ../clients/cli/connections.c:8886
+#, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: '%s' is not valid 'connection' command."
+msgstr "Hata: '%s' geçerli bir 'bağlantı' komutu değil."
+
+#. define some prompts
+#: ../clients/cli/devices.c:37
+msgid "Interface: "
+msgstr "Arayüz: "
+
+#. 3
+#. 17
+#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:74
+msgid "CONNECTION"
+msgstr "BAÄžLANTI"
+
+#. 4
+#. 18
+#: ../clients/cli/devices.c:46 ../clients/cli/devices.c:75
+#| msgid "UUID"
+msgid "CON-UUID"
+msgstr "CON-UUID"
#. 2
-#: ../cli/src/devices.c:112
+#: ../clients/cli/devices.c:59
msgid "VENDOR"
-msgstr "SATICI"
+msgstr "ÃœRETÄ°CÄ°"
#. 3
-#: ../cli/src/devices.c:113
+#: ../clients/cli/devices.c:60
msgid "PRODUCT"
msgstr "ÃœRÃœN"
#. 4
-#: ../cli/src/devices.c:114
+#: ../clients/cli/devices.c:61
msgid "DRIVER"
msgstr "SÜRÜCÜ"
#. 5
-#: ../cli/src/devices.c:115
-#| msgid "VERSION"
+#: ../clients/cli/devices.c:62
msgid "DRIVER-VERSION"
msgstr "SÃœRÃœM"
#. 6
-#: ../cli/src/devices.c:116
-#| msgid "FIRMWARE-MISSING"
+#: ../clients/cli/devices.c:63
msgid "FIRMWARE-VERSION"
msgstr "AYGIT-YAZILIMI"
#. 7
-#: ../cli/src/devices.c:117
+#: ../clients/cli/devices.c:64
msgid "HWADDR"
msgstr "HWADDR"
-#. 9
-#: ../cli/src/devices.c:119
-msgid "REASON"
-msgstr ""
+#. 8
+#: ../clients/cli/devices.c:65 ../clients/tui/nmt-page-ethernet.c:86
+#: ../clients/tui/nmt-page-infiniband.c:96 ../clients/tui/nmt-page-vlan.c:130
+#: ../clients/tui/nmt-page-wifi.c:372
+msgid "MTU"
+msgstr "MTU"
#. 10
-#: ../cli/src/devices.c:120
+#: ../clients/cli/devices.c:67
+msgid "REASON"
+msgstr "NEDEN"
+
+#. 11
+#: ../clients/cli/devices.c:68
msgid "UDI"
msgstr "UDI"
-#. 11
-#: ../cli/src/devices.c:121
+#. 12
+#: ../clients/cli/devices.c:69
msgid "IP-IFACE"
msgstr "IP-IFACE"
-#. 12
-#: ../cli/src/devices.c:122
+#. 13
+#. 2
+#: ../clients/cli/devices.c:70 ../clients/cli/devices.c:98
+msgid "IS-SOFTWARE"
+msgstr "IS-YAZILIM"
+
+#. 14
+#: ../clients/cli/devices.c:71
msgid "NM-MANAGED"
msgstr "AY-YÖNETİMLİ"
-#. 14
-#: ../cli/src/devices.c:124
+#. 16
+#: ../clients/cli/devices.c:73
msgid "FIRMWARE-MISSING"
msgstr "AYGIT-YAZILIMI-EKSÄ°K"
-#. 15
-#: ../cli/src/devices.c:125
-msgid "CONNECTION"
-msgstr "BAÄžLANTI"
-
#. 0
-#: ../cli/src/devices.c:135
+#: ../clients/cli/devices.c:86
msgid "AVAILABLE-CONNECTION-PATHS"
msgstr "UYGUN-BAÄžLANTI-YOLLARI"
#. 1
-#: ../cli/src/devices.c:136
-#| msgid "CONNECTION"
+#: ../clients/cli/devices.c:87
msgid "AVAILABLE-CONNECTIONS"
msgstr "UYGUN-BAÄžLANTILAR"
#. 0
-#: ../cli/src/devices.c:145
+#: ../clients/cli/devices.c:96
msgid "CARRIER-DETECT"
msgstr "TAÅžIYICI-ALGILAMA"
#. 1
-#: ../cli/src/devices.c:146
+#: ../clients/cli/devices.c:97
msgid "SPEED"
msgstr "HIZ"
#. 0
-#: ../cli/src/devices.c:155
+#: ../clients/cli/devices.c:107
msgid "CARRIER"
msgstr "TAÅžIYICI"
#. 0
-#: ../cli/src/devices.c:165
+#: ../clients/cli/devices.c:116 ../clients/cli/devices.c:546
msgid "WEP"
msgstr "WEP"
#. 1
-#: ../cli/src/devices.c:166
+#: ../clients/cli/devices.c:117
msgid "WPA"
msgstr "WPA"
#. 2
-#: ../cli/src/devices.c:167
+#: ../clients/cli/devices.c:118 ../clients/cli/devices.c:554
msgid "WPA2"
msgstr "WPA2"
#. 3
-#: ../cli/src/devices.c:168
+#: ../clients/cli/devices.c:119
msgid "TKIP"
msgstr "TKIP"
#. 4
-#: ../cli/src/devices.c:169
+#: ../clients/cli/devices.c:120
msgid "CCMP"
msgstr "CCMP"
+#. 5
+#. 2
+#: ../clients/cli/devices.c:121 ../clients/cli/devices.c:220
+msgid "AP"
+msgstr "AP"
+
#. 6
-#: ../cli/src/devices.c:171
+#: ../clients/cli/devices.c:122
msgid "ADHOC"
msgstr "ADHOC"
#. 0
-#: ../cli/src/devices.c:181
+#: ../clients/cli/devices.c:131
msgid "CTR-FREQ"
msgstr "CTR-FREK"
#. 1
-#: ../cli/src/devices.c:182
+#: ../clients/cli/devices.c:132
msgid "RSSI"
msgstr "RSSI"
#. 2
-#: ../cli/src/devices.c:183
+#: ../clients/cli/devices.c:133
msgid "CINR"
msgstr "CINR"
#. 3
-#: ../cli/src/devices.c:184
+#: ../clients/cli/devices.c:134
msgid "TX-POW"
msgstr "TX-POW"
#. 4
-#: ../cli/src/devices.c:185
+#: ../clients/cli/devices.c:135
msgid "BSID"
msgstr "BSID"
#. 0
-#: ../cli/src/devices.c:195
+#: ../clients/cli/devices.c:144 ../clients/tui/nmt-page-wifi.c:226
msgid "SSID"
msgstr "SSID"
#. 1
-#: ../cli/src/devices.c:196
+#: ../clients/cli/devices.c:145
+#| msgid "SSID"
+msgid "SSID-HEX"
+msgstr "SSID-HEX"
+
+#. 2
+#: ../clients/cli/devices.c:146 ../clients/tui/nmt-page-wifi.c:360
msgid "BSSID"
msgstr "BSSID"
-#. 2
-#: ../cli/src/devices.c:197
+#. 3
+#: ../clients/cli/devices.c:147
msgid "MODE"
msgstr "KÄ°P"
-#. 3
-#: ../cli/src/devices.c:198
+#. 4
+#: ../clients/cli/devices.c:148
+msgid "CHAN"
+msgstr "CHAN"
+
+#. 5
+#: ../clients/cli/devices.c:149
msgid "FREQ"
msgstr "FREKANS"
-#. 4
-#: ../cli/src/devices.c:199
+#. 6
+#: ../clients/cli/devices.c:150
msgid "RATE"
msgstr "ORAN"
-#. 5
+#. 7
#. 1
-#: ../cli/src/devices.c:200 ../cli/src/devices.c:218
+#: ../clients/cli/devices.c:151 ../clients/cli/devices.c:171
msgid "SIGNAL"
msgstr "SiNYAL"
-#. 6
-#: ../cli/src/devices.c:201
+#. 8
+#: ../clients/cli/devices.c:152
+msgid "BARS"
+msgstr "BARS"
+
+#. 9
+#: ../clients/cli/devices.c:153
msgid "SECURITY"
msgstr "GÃœVENLÄ°K"
-#. 7
-#: ../cli/src/devices.c:202
+#. 10
+#: ../clients/cli/devices.c:154
msgid "WPA-FLAGS"
msgstr "WPA-BAYRAKLAR"
-#. 8
-#: ../cli/src/devices.c:203
+#. 11
+#: ../clients/cli/devices.c:155
msgid "RSN-FLAGS"
msgstr "RSN-BAYRAKLAR"
-#. 10
-#. 4
-#: ../cli/src/devices.c:205 ../cli/src/devices.c:221
-msgid "ACTIVE"
-msgstr "ETKÄ°N"
+#. 14
+#: ../clients/cli/devices.c:158
+msgid "*"
+msgstr "*"
+
+#. 0
+#. 5
+#: ../clients/cli/devices.c:170 ../clients/cli/devices.c:223
+msgid "NSP"
+msgstr "NSP"
#. 0
-#: ../cli/src/devices.c:233
+#: ../clients/cli/devices.c:185
msgid "SLAVES"
-msgstr ""
+msgstr "Ä°KÄ°NCÄ°LLER"
#. 0
-#: ../cli/src/devices.c:242
-#| msgid "UUID"
+#: ../clients/cli/devices.c:194
msgid "ID"
msgstr "ID"
-#: ../cli/src/devices.c:258
-#, fuzzy, c-format
+#. 0
+#: ../clients/cli/devices.c:203 ../clients/cli/devices.c:218
+msgid "CAPABILITIES"
+msgstr "YETENEKLER"
+
+#. 1
+#: ../clients/cli/devices.c:219
+msgid "WIFI-PROPERTIES"
+msgstr "WIFI-ÖZELLİKLER"
+
+#. 3
+#: ../clients/cli/devices.c:221
+msgid "WIRED-PROPERTIES"
+msgstr "KABLOLU-ÖZELLİKLER"
+
+#. 4
+#: ../clients/cli/devices.c:222
+msgid "WIMAX-PROPERTIES"
+msgstr "WIMAX-ÖZELLİKLERİ"
+
+#. 10
+#: ../clients/cli/devices.c:228 ../clients/tui/nmt-page-bond.c:73
+msgid "BOND"
+msgstr "BOND"
+
+#. 11
+#: ../clients/cli/devices.c:229 ../clients/tui/nmt-page-team.c:51
+msgid "TEAM"
+msgstr "TAKIM"
+
+#. 12
+#: ../clients/cli/devices.c:230 ../clients/tui/nmt-page-bridge.c:42
+msgid "BRIDGE"
+msgstr "KÖPRÜ"
+
+#. 14
+#: ../clients/cli/devices.c:232
+msgid "BLUETOOTH"
+msgstr "BLUETOOTH"
+
+#. 15
+#: ../clients/cli/devices.c:233
+msgid "CONNECTIONS"
+msgstr "BAÄžLANTILAR"
+
+#: ../clients/cli/devices.c:257
+#, c-format
#| msgid ""
#| "Usage: nmcli dev { COMMAND | help }\n"
#| "\n"
@@ -1193,370 +3515,831 @@ msgstr "ID"
msgid ""
"Usage: nmcli device { COMMAND | help }\n"
"\n"
-" COMMAND := { status | list | disconnect | wifi | wimax }\n"
+"COMMAND := { status | show | connect | disconnect | delete | wifi | wimax }\n"
"\n"
-" COMMAND := { status | list | disconnect | wifi }\n"
+"COMMAND := { status | show | connect | disconnect | delete | wifi }\n"
"\n"
" status\n"
-" list [iface <iface>]\n"
-" disconnect iface <iface> [--nowait] [--timeout <timeout>]\n"
-" wifi [list [iface <iface>] [bssid <BSSID>]]\n"
+"\n"
+" show [<ifname>]\n"
+"\n"
+" connect <ifname>\n"
+"\n"
+" disconnect <ifname>\n"
+"\n"
+" delete <ifname>\n"
+"\n"
+" wifi [list [ifname <ifname>] [bssid <BSSID>]]\n"
+"\n"
" wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] "
-"[iface <iface>] [bssid <BSSID>] [name <name>]\n"
-" [--private] [--nowait] [--timeout <timeout>]\n"
-" wimax [list [iface <iface>] [nsp <name>]]\n"
+"[ifname <ifname>]\n"
+" [bssid <BSSID>] [name <name>] [private yes|no]\n"
+"\n"
+" wifi rescan [[ifname] <ifname>]\n"
+"\n"
+" wimax [list [ifname <ifname>] [nsp <name>]]\n"
"\n"
msgstr ""
-"Kullanımı: nmcli dev { KOMUT | help }\n"
+"Kullanım: nmcli device { KOMUT | help }\n"
"\n"
-" KOMUT := { status | list | disconnect | wifi | wimax }\n"
+"KOMUT := { status | show | connect | disconnect | delete | wifi | wimax }\n"
"\n"
-" KOMUT := { status | list | disconnect | wifi }\n"
+"KOMUT := { status | show | connect | disconnect | delete | wifi }\n"
"\n"
" status\n"
-" list [iface <iface>]\n"
-" disconnect iface <iface> [--nowait] [--timeout <zamanaşımı>]\n"
-" wifi [list [iface <iface>] [bssid <BSSID>]]\n"
-" wimax [list [iface <iface>] [nsp <isim>]]\n"
+"\n"
+" show [<ifname>]\n"
+"\n"
+" connect <ifname>\n"
+"\n"
+" disconnect <ifname>\n"
+"\n"
+" delete <ifname>\n"
+"\n"
+" wifi [list [ifname <ifname>] [bssid <BSSID>]]\n"
+"\n"
+" wifi connect <(B)SSID> [password <parola>] [wep-key-type key|phrase] ["
+"ifname <ifname>]\n"
+" [bssid <BSSID>] [name <isim>] [private yes|no]\n"
+"\n"
+" wifi rescan [[ifname] <ifname>]\n"
+"\n"
+" wimax [list [ifname <ifname>] [nsp <isim>]]\n"
+"\n"
+
+#: ../clients/cli/devices.c:281
+#, c-format
+msgid ""
+"Usage: nmcli device status { help }\n"
+"\n"
+"Show status for all devices.\n"
+"By default, the following columns are shown:\n"
+" DEVICE - interface name\n"
+" TYPE - device type\n"
+" STATE - device state\n"
+" CONNECTION - connection activated on device (if any)\n"
+"Displayed columns can be changed using '--fields' global option. 'status' "
+"is\n"
+"the default command, which means 'nmcli device' calls 'nmcli device "
+"status'.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli aygıt durumu { yardımı }\n"
+"\n"
+"Tüm aygıtlar için durumları göster\n"
+"Varsayılan olarak aşağıdaki sütınlar gösterilecektir:\n"
+" AYGIT - arayüz adı\n"
+" TİP - aygıt tipi\n"
+" DURUM - aygıt durumu\n"
+" BAĞLANTI - aygıttaki etkin bağlantılar (eğer varsa)\n"
+"Gösterilen kolonlar '--fields' genel seçeneği kullanılarak değiştirilebilir. "
+"'status' is\n"
+"varsayılan komut, 'nmcli device' çağrıları 'nmcli device status'.\n"
+"\n"
+
+#: ../clients/cli/devices.c:296
+#, c-format
+msgid ""
+"Usage: nmcli device show { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [<ifname>]\n"
+"\n"
+"Show details of device(s).\n"
+"The command lists details for all devices, or for a given device.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli device show { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [<ifname>]\n"
+"\n"
+"Aygıt(lar)ın ayrıntılarını göster.\n"
+"Bu komut tüm aygıtların ya da verilen aygıt için detayları listeler\n"
+"\n"
+
+#: ../clients/cli/devices.c:307
+#, c-format
+msgid ""
+"Usage: nmcli device connect { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := <ifname>\n"
+"\n"
+"Connect the device.\n"
+"NetworkManager will try to find a suitable connection that will be "
+"activated.\n"
+"It will also consider connections that are not set to auto-connect.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli device connect { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := <ifname>\n"
+"\n"
+"Aygıta bağlan.\n"
+"NetworkManager etkinleştirmek için uygun bir bağlantı arıyacaktır.\n"
+"Ayrıca otomatik bağlanma ayarlarınıda göz önünde bulunduracaktır.\n"
"\n"
-#: ../cli/src/devices.c:361
+#: ../clients/cli/devices.c:319
+#, c-format
+msgid ""
+"Usage: nmcli device disconnect { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := <ifname>\n"
+"\n"
+"Disconnect the device.\n"
+"The command disconnects the device and prevents it from auto-activating\n"
+"further connections without user/manual intervention.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli device disconnect { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := <ifname>\n"
+"\n"
+"Aygıtı ayır.\n"
+"Bu komut cihazı ayırır ve otomatik bağlanmaları önler\n"
+"el ile bağlantıları hariç.\n"
+"\n"
+
+#: ../clients/cli/devices.c:331
+#, c-format
+msgid ""
+"Usage: nmcli device delete { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := <ifname>\n"
+"\n"
+"Deletes the software device.\n"
+"The command removes the interface. It only works for software devices\n"
+"(like bonds, bridges, etc.). Hardware devices cannot be deleted by the\n"
+"command.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli device delete { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := <ifname>\n"
+"\n"
+"Yazılımsal aygıtları siler.\n"
+"Bu komut arayüzleri siler. Sadece yazılımsal aygıtlar için çalışır\n"
+"(köprüler, atlamalar). Donanımsal aygıtlar bu komut kullanılarak\n"
+"silinemezler.\n"
+"\n"
+
+#: ../clients/cli/devices.c:344
+#, c-format
+msgid ""
+"Usage: nmcli device wifi { ARGUMENTS | help }\n"
+"\n"
+"Perform operation on Wi-Fi devices.\n"
+"\n"
+"ARGUMENTS := [list [ifname <ifname>] [bssid <BSSID>]]\n"
+"\n"
+"List available Wi-Fi access points. The 'ifname' and 'bssid' options can be\n"
+"used to list APs for a particular interface, or with a specific BSSID.\n"
+"\n"
+"ARGUMENTS := connect <(B)SSID> [password <password>] [wep-key-type key|"
+"phrase] [ifname <ifname>]\n"
+" [bssid <BSSID>] [name <name>] [private yes|no]\n"
+"\n"
+"Connect to a Wi-Fi network specified by SSID or BSSID. The command creates\n"
+"a new connection and then activates it on a device. This is a command-line\n"
+"counterpart of clicking an SSID in a GUI client. The command always creates\n"
+"a new connection and thus it is mainly useful for connecting to new Wi-Fi\n"
+"networks. If a connection for the network already exists, it is better to\n"
+"bring up the existing profile as follows: nmcli con up id <name>. Note that\n"
+"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 := rescan [[ifname] <ifname>]\n"
+"\n"
+"Request that NetworkManager immediately re-scan for available access "
+"points.\n"
+"NetworkManager scans Wi-Fi networks periodically, but in some cases it "
+"might\n"
+"be useful to start scanning manually. Note that this command does not show\n"
+"the APs, use 'nmcli device wifi list' for that.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli device wifi { DEĞİŞKENLER | help }\n"
+"\n"
+"İşlemleri Wi-Fi aygıtlar üzerinde yapın.\n"
+"\n"
+"DEĞİŞKENLER := [list [ifname <ifname>] [bssid <BSSID>]]\n"
+"\n"
+"Kullanılabilir Wi-Fi erişim noktalarını listeler. 'ifname' ve 'bssid' "
+"seçenekleri\n"
+"belirli erişim noktalarını ve ya belirtilmiş BSSID için kullanılır.\n"
+"\n"
+"DEĞİŞKENLER := connect <(B)SSID> [password <parola>] [wep-key-type "
+"key|phrase] [ifname <ifname>]\n"
+" [bssid <BSSID>] [name <name>] [private yes|no]\n"
+"\n"
+"SSID ya da BSSID ile belirtilmiş Wi-Fi ağlarına bağlanır. Bu komut yeni bir\n"
+"bağlantı oluşturur ve o aygıt üzerinde etkinleştirir. Bu GUI istemcide SSID\n"
+"üzerine tıklama olayının komut satırı karşılığıdır. Bu komut her zaman\n"
+"yeni bir bağlantı yaratır ve bunu kolaylaştırır.\n"
+"Eğer ağa bir bağlantı zaten mevcut ise, mevcut profil şöyle\n"
+"ayaÄŸa kalkabilir: nmcli con up id <isim>.Dikkat\n"
+"Şu anda sadece açık WEP ve WPA-PSK ağları desteklenmektedirler.\n"
+"IP yapılandırmalırını DHCP üzerinden alırlar.\n"
+"\n"
+"DEĞİŞKENLER := rescan [[ifname] <ifname>]\n"
+"\n"
+"NetworkManager için kullanılabilir erişim noktalarını yeniden taratır.\n"
+"NetworkManage Wi-Fi ağlarını belli periyodlarda taratır, ancak bu "
+"taratmanın\n"
+"elle yapılması daha iyidir. Dikkat edin bu komut erişim noktalarını "
+"göstermez.\n"
+"Onun için 'nmcli device wifi list komutunu kullanın.\n"
+"\n"
+
+#: ../clients/cli/devices.c:377
+#, c-format
+msgid ""
+"Usage: nmcli device wimax { ARGUMENTS | help }\n"
+"\n"
+"Perform operation on WiMAX devices.\n"
+"\n"
+"ARGUMENTS := [list [ifname <ifname>] [nsp <name>]]\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"
+msgstr ""
+"Kullanım: nmcli device wimax { DEĞİŞKENLER | help }\n"
+"\n"
+"WiMAX aygıtları üzerinde işlemler yürütür.\n"
+"\n"
+"DEĞİŞKENLER := [list [ifname <ifname>] [nsp <isim>]]\n"
+"\n"
+"Kullanılabilir WiMAX NSP leri listeler. 'ifname' ve 'nsp' seçenekleri "
+"belirli bir arayüz\n"
+"ya da NSP için ağları listeler.\n"
+"\n"
+
+#: ../clients/cli/devices.c:466 ../clients/cli/devices.c:657
msgid "(none)"
msgstr "(hiçbiri)"
-#: ../cli/src/devices.c:417
+#: ../clients/cli/devices.c:534
#, c-format
msgid "%u MHz"
msgstr "%u MHz"
-#: ../cli/src/devices.c:418
+#: ../clients/cli/devices.c:535
#, c-format
msgid "%u Mbit/s"
msgstr "%u Mbit/s"
-#: ../cli/src/devices.c:427
-msgid "Encrypted: "
-msgstr "Åžifreli: "
-
-#: ../cli/src/devices.c:432
-msgid "WEP "
-msgstr "WEP "
-
-#: ../cli/src/devices.c:434
-msgid "WPA "
-msgstr "WPA "
-
-#: ../cli/src/devices.c:436
-msgid "WPA2 "
-msgstr "WPA2 "
+#: ../clients/cli/devices.c:550
+msgid "WPA1"
+msgstr "WPA1"
-#: ../cli/src/devices.c:439
-msgid "Enterprise "
-msgstr "Kurumsal "
+#: ../clients/cli/devices.c:559
+msgid "802.1X"
+msgstr "802.1X"
-#: ../cli/src/devices.c:448
+#: ../clients/cli/devices.c:575
msgid "Ad-Hoc"
msgstr "Ad-Hoc"
-#: ../cli/src/devices.c:449
-msgid "Infrastructure"
-msgstr "Altyapı"
+#: ../clients/cli/devices.c:576
+msgid "Infra"
+msgstr "Infra"
-#: ../cli/src/devices.c:485
+#: ../clients/cli/devices.c:577
+msgid "N/A"
+msgstr "N/A"
+
+#: ../clients/cli/devices.c:608
msgid "Home"
msgstr "Ev"
-#: ../cli/src/devices.c:488
+#: ../clients/cli/devices.c:611
msgid "Partner"
msgstr "Ortak"
-#: ../cli/src/devices.c:491
+#: ../clients/cli/devices.c:614
msgid "Roaming"
msgstr "Dolaşım"
-#: ../cli/src/devices.c:563
-#, c-format
-msgid "Error: 'dev list': %s"
-msgstr "Hata: 'dev list':%s"
-
-#: ../cli/src/devices.c:565
-#, c-format
-msgid "Error: 'dev list': %s; allowed fields: %s"
-msgstr "Hata: 'dev list':%s; izin verilen alanlar :%s"
-
-#: ../cli/src/devices.c:574
+#: ../clients/cli/devices.c:774
msgid "Device details"
msgstr "Aygıt ayrıntıları"
-#: ../cli/src/devices.c:621 ../cli/src/devices.c:624 ../cli/src/devices.c:1151
-#: ../cli/src/utils.c:495
+#: ../clients/cli/devices.c:786
+#, c-format
+#| msgid "Error: 'dev list': %s"
+msgid "Error: 'device show': %s"
+msgstr "Hata: 'device show': %s"
+
+#: ../clients/cli/devices.c:837 ../clients/cli/devices.c:840
msgid "(unknown)"
msgstr "(bilinmeyen)"
-#: ../cli/src/devices.c:633
-msgid "not connected"
-msgstr "bağlı değil"
-
-#: ../cli/src/devices.c:660
+#: ../clients/cli/devices.c:878
#, c-format
msgid "%u Mb/s"
msgstr "%u Mb/s"
-#. Print header
-#. "WIRED-PROPERTIES"
-#: ../cli/src/devices.c:736
+#: ../clients/cli/devices.c:964
msgid "on"
msgstr "açık"
-#: ../cli/src/devices.c:736
+#: ../clients/cli/devices.c:964
msgid "off"
msgstr "kapalı"
-#: ../cli/src/devices.c:993
+#: ../clients/cli/devices.c:1236
#, c-format
-msgid "Error: 'dev status': %s"
-msgstr "Hata: 'dev status':%s"
+#| msgid "Error: 'dev status': %s"
+msgid "Error: 'device status': %s"
+msgstr "Hata: 'aygıt durumu': %s"
-#: ../cli/src/devices.c:995
-#, c-format
-msgid "Error: 'dev status': %s; allowed fields: %s"
-msgstr "Hata: 'dev status': %s; izin verilen alanlar: %s"
-
-#: ../cli/src/devices.c:1018
+#. Add headers
+#: ../clients/cli/devices.c:1243
msgid "Status of devices"
msgstr "Aygıtların durumu"
-#: ../cli/src/devices.c:1049
+#: ../clients/cli/devices.c:1274
#, c-format
-msgid "Error: '%s' argument is missing."
-msgstr "Hata: '%s' değişkeni bulunamadı."
+#| msgid "Error: invalid 'wwan' parameter: '%s'."
+msgid "Error: invalid extra argument '%s'."
+msgstr "Hata: geçersiz fazladan değişken '%s'."
-#: ../cli/src/devices.c:1090 ../cli/src/devices.c:1255
-#: ../cli/src/devices.c:1396 ../cli/src/devices.c:2043
+#: ../clients/cli/devices.c:1291 ../clients/cli/devices.c:1566
+#: ../clients/cli/devices.c:1699 ../clients/cli/devices.c:1786
+#: ../clients/cli/devices.c:1919 ../clients/cli/devices.c:2580
#, c-format
msgid "Error: Device '%s' not found."
msgstr "Hata: '%s' aygıtı bulunamadı."
-#: ../cli/src/devices.c:1113
+#: ../clients/cli/devices.c:1346
#, c-format
-msgid "Success: Device '%s' successfully disconnected."
-msgstr "Başarılı: '%s' aygıtının bağlantısı başarıyla kesildi."
+#| msgid "Success: Device '%s' successfully disconnected."
+msgid "Device '%s' successfully activated with '%s'.\n"
+msgstr "'%s' aygıtı '%s' ile başarıyla etkinleştirildi.\n"
-#: ../cli/src/devices.c:1148
+#: ../clients/cli/devices.c:1368 ../clients/cli/devices.c:1419
#, c-format
-msgid "Error: Device '%s' (%s) disconnecting failed: %s"
-msgstr "Hata: '%s' aygıtının (%s) bağlantısı kesilemedi: %s"
+msgid "Connection with UUID '%s' created and activated on device '%s'\n"
+msgstr ""
+"'%s' UUID ile bğlantı oluşturuldu ve '%s' aygıtı üzerinde etkinleştirildi\n"
-#: ../cli/src/devices.c:1161
+#: ../clients/cli/devices.c:1373
#, c-format
-#| msgid "Success: Device '%s' successfully disconnected."
-msgid "Device '%s' has been disconnected.\n"
-msgstr "'%s' aygıtının bağlantısı başarıyla kesildi.\n"
+msgid "Error: Connection activation failed: (%d) %s."
+msgstr "Hata: Bağlantı etkinleştirilemedi: (%d) %s."
-#: ../cli/src/devices.c:1224
+#: ../clients/cli/devices.c:1400
#, c-format
-msgid "Error: iface has to be specified."
-msgstr "Hata: iface belirtilmeli."
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Error: Failed to add/activate new connection: %s"
+msgstr "Hata: Yeni bir bağlantı ekleme/etkinleştirme başarısız: %s"
-#: ../cli/src/devices.c:1354
+#: ../clients/cli/devices.c:1409
#, c-format
-msgid "Error: 'dev wifi': %s"
-msgstr "Hata: 'dev wifi': %s"
+msgid "Error: Failed to add/activate new connection: Unknown error"
+msgstr ""
+"Hata: Yeni bir bağlantı oluşturma/etkinleştirme başarısız: Bilinmeyen hata"
-#: ../cli/src/devices.c:1356
+#: ../clients/cli/devices.c:1481
#, c-format
-msgid "Error: 'dev wifi': %s; allowed fields: %s"
-msgstr "Hata: 'dev wifi': %s; izin verilen alanlar: %s"
+#| msgid "Error: Connection activation failed: %s"
+msgid "Error: Device activation failed: %s"
+msgstr "Hata: Aygıt etkinleştirilemedi: %s"
-#: ../cli/src/devices.c:1379
-msgid "WiFi scan list"
-msgstr "WiFi tarama listesi"
+#: ../clients/cli/devices.c:1490
+#, c-format
+#| msgid "Error: Connection activation failed: (%d) %s."
+msgid "Error: Device activation failed: device was disconnected"
+msgstr "Hata: Bağlantı etkinleştirilemedi: aygıt bağlantısı kesilmiş"
-#: ../cli/src/devices.c:1416 ../cli/src/devices.c:1470
+#: ../clients/cli/devices.c:1504
#, c-format
-msgid "Error: Access point with bssid '%s' not found."
-msgstr "Hata: '%s' bssid'li erişim noktası bulunamadı."
+#| msgid "Device '%s' has been disconnected.\n"
+msgid "Device '%s' has been connected.\n"
+msgstr "'%s' aygıtı başarıyla bağlandı.\n"
-#: ../cli/src/devices.c:1433
+#: ../clients/cli/devices.c:1535 ../clients/cli/devices.c:1544
+#: ../clients/cli/devices.c:1668 ../clients/cli/devices.c:1677
+#: ../clients/cli/devices.c:1756 ../clients/cli/devices.c:1764
#, c-format
-msgid "Error: Device '%s' is not a WiFi device."
-msgstr "Hata: '%s' aygıtı bir WiFi aygıtı değil."
+#| msgid "Error: iface has to be specified."
+msgid "Error: No interface specified."
+msgstr "Hata: Belirtilen bir arayüz yok."
-#: ../cli/src/devices.c:1501 ../cli/src/devices.c:1547
+#: ../clients/cli/devices.c:1550 ../clients/cli/devices.c:1683
+#: ../clients/cli/devices.c:1770
#, c-format
-msgid "Connection with UUID '%s' created and activated on device '%s'\n"
-msgstr ""
-"'%s' UUID ile bğlantı oluşturuldu ve '%s' aygıtı üzerinde etkinleştirildi\n"
+#| msgid "Error: missing argument for '%s' option."
+msgid "Error: extra argument not allowed: '%s'."
+msgstr "Hata: fazladan deÄŸiÅŸken olamaz: '%s'."
-#: ../cli/src/devices.c:1506
+#: ../clients/cli/devices.c:1609
#, c-format
-#| msgid "Error: Connection activation failed: %s."
-msgid "Error: Connection activation failed: (%d) %s."
-msgstr "Hata: Bağlantı etkinleştirilemedi: (%d) %s."
+msgid "Success: Device '%s' successfully disconnected."
+msgstr "Başarılı: '%s' aygıtının bağlantısı başarıyla kesildi."
-#: ../cli/src/devices.c:1531
+#: ../clients/cli/devices.c:1623
#, c-format
-msgid "Error: Failed to add/activate new connection: (%d) %s"
-msgstr "Hata: Yeni bir bağlantı ekleme/etkinleştirme başarısız: (%d) %s"
+msgid "Error: Device '%s' (%s) disconnecting failed: %s"
+msgstr "Hata: '%s' aygıtının (%s) bağlantısı kesilemedi: %s"
-#: ../cli/src/devices.c:1539
+#: ../clients/cli/devices.c:1638
#, c-format
-msgid "Error: Failed to add/activate new connection: Unknown error"
-msgstr ""
-"Hata: Yeni bir bağlantı oluşturma/etkinleştirme başarısız: Bilinmeyen hata"
+msgid "Device '%s' has been disconnected.\n"
+msgstr "'%s' aygıtının bağlantısı başarıyla kesildi.\n"
-#: ../cli/src/devices.c:1683
+#: ../clients/cli/devices.c:1728
+#, c-format
+#| msgid "Error: Device '%s' (%s) disconnecting failed: %s"
+msgid "Error: Device '%s' (%s) deletion failed: %s"
+msgstr "Hata: '%s' aygıtının (%s) silinmesi başarısız: %s"
+
+#: ../clients/cli/devices.c:1792
+#, c-format
+#| msgid "Error: Device '%s' is not a WiFi device."
+msgid "Error: Device '%s' is a hardware device. It can't be deleted."
+msgstr "Hata: '%s' aygıtı bir donanımsay aygıt. Silinemedi."
+
+#: ../clients/cli/devices.c:1862
+#| msgid "WiFi scan list"
+msgid "Wi-Fi scan list"
+msgstr "Wi-Fi tarama listesi"
+
+#: ../clients/cli/devices.c:1900
+#, c-format
+#| msgid "Error: 'dev wifi': %s"
+msgid "Error: 'device wifi': %s"
+msgstr "Hata: 'wifi aygıtı': %s"
+
+#: ../clients/cli/devices.c:1942 ../clients/cli/devices.c:2017
+#, c-format
+msgid "Error: Access point with bssid '%s' not found."
+msgstr "Hata: '%s' bssid'li erişim noktası bulunamadı."
+
+#: ../clients/cli/devices.c:1966 ../clients/cli/devices.c:2283
+#: ../clients/cli/devices.c:2447
+#, c-format
+msgid "Error: Device '%s' is not a Wi-Fi device."
+msgstr "Hata: '%s' aygıtı bir Wi-Fi aygıtı değil."
+
+#: ../clients/cli/devices.c:2176
+msgid "SSID or BSSID: "
+msgstr "SSID veya BSSID: "
+
+#: ../clients/cli/devices.c:2181
#, c-format
-#| msgid "Error: %s argument is missing."
msgid "Error: SSID or BSSID are missing."
msgstr "Hata: SSID veya BSSID bilgileri eksik."
-#: ../cli/src/devices.c:1706
+#: ../clients/cli/devices.c:2205
#, c-format
-#| msgid "Error: timeout value '%s' is not valid."
msgid "Error: bssid argument value '%s' is not a valid BSSID."
msgstr "Hata: '%s' geçerli bir BSSID değildir."
-#: ../cli/src/devices.c:1730
+#: ../clients/cli/devices.c:2229
#, c-format
msgid ""
"Error: wep-key-type argument value '%s' is invalid, use 'key' or 'phrase'."
msgstr ""
+"Hata: wep-key-type değişkeni için '%s' değeri geçersiz, 'key' ya da 'phrase' "
+"kullanın."
-#: ../cli/src/devices.c:1770
+#: ../clients/cli/devices.c:2249
#, c-format
-msgid "Error: BSSID to connect to (%s) differs from bssid argument (%s)."
-msgstr ""
+#| msgid "Error: %s."
+msgid "Error: %s: %s."
+msgstr "Error: %s: %s."
-#: ../cli/src/devices.c:1776
+#: ../clients/cli/devices.c:2264
#, c-format
-msgid "Error: Parameter '%s' is neither SSID nor BSSID."
-msgstr ""
+msgid "Error: BSSID to connect to (%s) differs from bssid argument (%s)."
+msgstr "Hata: (%s) bağlantı için verilen BSSID değişkenden (%s) farklı."
-#: ../cli/src/devices.c:1805
+#: ../clients/cli/devices.c:2270
#, c-format
-#| msgid "Error: Device '%s' is not a WiFi device."
-msgid "Error: Device '%s' is not a Wi-Fi device."
-msgstr "Hata: '%s' aygıtı bir Wi-Fi aygıtı değil."
+msgid "Error: Parameter '%s' is neither SSID nor BSSID."
+msgstr "Hata: '%s' parametresi SSID ya da BSSID deÄŸil."
-#: ../cli/src/devices.c:1807
+#: ../clients/cli/devices.c:2285 ../clients/cli/devices.c:2449
#, c-format
-#| msgid "Error: No suitable device found."
msgid "Error: No Wi-Fi device found."
msgstr "Hata: Wi-Fi aygıtı bulunamadı."
-#: ../cli/src/devices.c:1825
+#: ../clients/cli/devices.c:2303
#, c-format
-#| msgid "Error: NSP with name '%s' not found."
msgid "Error: No network with SSID '%s' found."
msgstr "Hata: '%s' adlı SSID bulunamadı."
-#: ../cli/src/devices.c:1827
+#: ../clients/cli/devices.c:2305
#, c-format
-#| msgid "Error: Access point with nsp '%s' not found."
msgid "Error: No access point with BSSID '%s' found."
msgstr "Hata: '%s' adlı BSSID ile erişim noktası bulunamadı."
-#: ../cli/src/devices.c:1925
-#, c-format
-msgid "Error: 'dev wifi' command '%s' is not valid."
-msgstr "Hata: 'dev wifi' komut '%s' tanımlı değil."
+#: ../clients/cli/devices.c:2344
+msgid "Password: "
+msgstr "Parola: "
-#: ../cli/src/devices.c:2001
+#: ../clients/cli/devices.c:2476
#, c-format
-msgid "Error: 'dev wimax': %s"
-msgstr "Hata: 'dev wimax': %s"
+#| msgid "Error: 'dev wifi' command '%s' is not valid."
+msgid "Error: 'device wifi' command '%s' is not valid."
+msgstr "Hata: 'device wifi' komut '%s' tanımlı değil."
-#: ../cli/src/devices.c:2003
-#, c-format
-msgid "Error: 'dev wimax': %s; allowed fields: %s"
-msgstr "Hara: 'dev wimax': %s; izin verilen alanlar: %s"
-
-#: ../cli/src/devices.c:2026
+#: ../clients/cli/devices.c:2523
msgid "WiMAX NSP list"
msgstr "WiMAX NSP listesi"
-#: ../cli/src/devices.c:2063
+#: ../clients/cli/devices.c:2560
+#, c-format
+#| msgid "Error: 'dev wimax': %s"
+msgid "Error: 'device wimax': %s"
+msgstr "Hata: 'device wimax': %s"
+
+#: ../clients/cli/devices.c:2603
#, c-format
msgid "Error: NSP with name '%s' not found."
msgstr "Hata: '%s' adlı NSP bulunamadı."
-#: ../cli/src/devices.c:2074
+#: ../clients/cli/devices.c:2616
#, c-format
msgid "Error: Device '%s' is not a WiMAX device."
msgstr "Hata: '%s' aygıtı bir WiMAX aygıtı değil."
-#: ../cli/src/devices.c:2105
+#: ../clients/cli/devices.c:2660
#, c-format
msgid "Error: Access point with nsp '%s' not found."
msgstr "Hata: '%s' nsp'li erişim noktası bulunamadı."
-#: ../cli/src/devices.c:2132
+#: ../clients/cli/devices.c:2697
#, c-format
-msgid "Error: 'dev wimax' command '%s' is not valid."
-msgstr "Hata: 'dev wimax' komutu '%s' geçerli değil."
+#| msgid "Error: 'dev wimax' command '%s' is not valid."
+msgid "Error: 'device wimax' command '%s' is not valid."
+msgstr "Hata: 'device wimax' komutu '%s' geçerli değil."
-#: ../cli/src/devices.c:2185
+#: ../clients/cli/devices.c:2870
#, c-format
msgid "Error: 'dev' command '%s' is not valid."
msgstr "Hata: 'dev' komut '%s' tanımlı değil."
-#: ../cli/src/network-manager.c:37
+#: ../clients/cli/general.c:35
msgid "RUNNING"
msgstr "ÇALIŞIYOR"
#. 0
-#: ../cli/src/network-manager.c:38
+#: ../clients/cli/general.c:36
msgid "VERSION"
msgstr "SÃœRÃœM"
#. 2
-#: ../cli/src/network-manager.c:40
-msgid "NET-ENABLED"
-msgstr "NET-ENABLED"
+#: ../clients/cli/general.c:38
+msgid "STARTUP"
+msgstr "BAŞLANGIÇ"
#. 3
-#: ../cli/src/network-manager.c:41
-msgid "WIFI-HARDWARE"
-msgstr "WIFI-DONANIM"
+#: ../clients/cli/general.c:39
+#| msgid "CONNECTION"
+msgid "CONNECTIVITY"
+msgstr "BAÄžLANTI"
#. 4
-#: ../cli/src/network-manager.c:42
-msgid "WIFI"
-msgstr "WIFI"
+#: ../clients/cli/general.c:40
+msgid "NETWORKING"
+msgstr "AÄž"
#. 5
-#: ../cli/src/network-manager.c:43
-msgid "WWAN-HARDWARE"
-msgstr "WWAN-DONANIM"
+#: ../clients/cli/general.c:41
+#| msgid "WIFI"
+msgid "WIFI-HW"
+msgstr "WIFI-HW"
#. 6
-#: ../cli/src/network-manager.c:44
-msgid "WWAN"
-msgstr "WWAN"
+#: ../clients/cli/general.c:42
+msgid "WIFI"
+msgstr "KABLOSUZ"
#. 7
-#: ../cli/src/network-manager.c:45
-msgid "WIMAX-HARDWARE"
-msgstr "WIMAX-DONANIMI"
+#: ../clients/cli/general.c:43
+#| msgid "WWAN"
+msgid "WWAN-HW"
+msgstr "WWAN-HW"
#. 8
-#: ../cli/src/network-manager.c:46
+#: ../clients/cli/general.c:44
+msgid "WWAN"
+msgstr "WWAN"
+
+#. 9
+#: ../clients/cli/general.c:45
+#| msgid "WIMAX"
+msgid "WIMAX-HW"
+msgstr "WIMAX-HW"
+
+#. 10
+#: ../clients/cli/general.c:46
msgid "WIMAX"
msgstr "WIMAX"
-#: ../cli/src/network-manager.c:62
-#| msgid "VERSION"
+#: ../clients/cli/general.c:68
msgid "PERMISSION"
msgstr "Ä°ZÄ°N"
#. 0
-#: ../cli/src/network-manager.c:63
+#: ../clients/cli/general.c:69
msgid "VALUE"
msgstr "DEÄžER"
-#: ../cli/src/network-manager.c:77
-#, fuzzy, c-format
+#: ../clients/cli/general.c:77
+msgid "LEVEL"
+msgstr "SEVÄ°YE"
+
+#. 0
+#: ../clients/cli/general.c:78
+msgid "DOMAINS"
+msgstr "ALANLAR"
+
+#: ../clients/cli/general.c:92
+#, c-format
+msgid ""
+"Usage: nmcli general { COMMAND | help }\n"
+"\n"
+"COMMAND := { status | hostname | permissions | logging }\n"
+"\n"
+" status\n"
+"\n"
+" hostname [<hostname>]\n"
+"\n"
+" permissions\n"
+"\n"
+" logging [level <log level>] [domains <log domains>]\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli general { KOMUT | help }\n"
+"\n"
+"KOMUT := { status | hostname | permissions | logging }\n"
+"\n"
+" status\n"
+"\n"
+" hostname [<makine_adi>]\n"
+"\n"
+" permissions\n"
+"\n"
+" logging [level <log seviyesi>] [domains <log alanları>]\n"
+"\n"
+
+#: ../clients/cli/general.c:103
+#, c-format
+msgid ""
+"Usage: nmcli general status { help }\n"
+"\n"
+"Show overall status of NetworkManager.\n"
+"'status' is the default action, which means 'nmcli gen' calls 'nmcli gen "
+"status'\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli general status { help }\n"
+"\n"
+"NetworkManager için genel durumları gösterir.\n"
+"'status' varsayılan eylemdir, yani 'nmcli gen' aslında 'nmcli gen status' "
+"komutunu çağırır\n"
+"\n"
+
+#: ../clients/cli/general.c:112
+#, c-format
+msgid ""
+"Usage: nmcli general hostname { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [<hostname>]\n"
+"\n"
+"Get or change persistent system hostname.\n"
+"With no arguments, this prints currently configured hostname. When you pass\n"
+"a hostname, NetworkManager will set it as the new persistent system "
+"hostname.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli general hostname { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [<makine_adi>]\n"
+"\n"
+"Sistem makine adını getirir ya da değiştirir.\n"
+"Hiç değişken verilmez ise sistemde kayıtlı makine adını döndürür. Bir makine "
+"adı girerseniz\n"
+"NetworkManager yeni makine adını ayarlayacaktır.\n"
+"\n"
+
+#: ../clients/cli/general.c:124
+#, c-format
+msgid ""
+"Usage: nmcli general permissions { help }\n"
+"\n"
+"Show caller permissions for authenticated operations.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli general permissions { help }\n"
+"\n"
+"Doğrulanmış işlemler için çağrıcı izinlerini gösterir.\n"
+"\n"
+
+#: ../clients/cli/general.c:132
+#, c-format
+msgid ""
+"Usage: nmcli general logging { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [level <log level>] [domains <log domains>]\n"
+"\n"
+"Get or change NetworkManager logging level and domains.\n"
+"Without any argument current logging level and domains are shown. In order "
+"to\n"
+"change logging state, provide level and/or domain. Please refer to the man "
+"page\n"
+"for the list of possible logging domains.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli general logging { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [level <log seviyesi>] [domains <log alanları>]\n"
+"\n"
+"NetworkManager için loglama seviyesini ve alanlarını getirir ya da "
+"deÄŸiÅŸtirir.\n"
+"Bir değişken kullanılmaz ise log durumunu değiştirmek, seviye ve/veya alan\n"
+"ayarlamak yerine mevcut loglama seviyesi ve alanları gösterilir. Uygun "
+"loglama\n"
+"alanlarını listeletmek için, lütfen kılavuz sayfasına göz atın.\n"
+"\n"
+
+#: ../clients/cli/general.c:145
+#, c-format
+msgid ""
+"Usage: nmcli networking { COMMAND | help }\n"
+"\n"
+"COMMAND := { [ on | off | connectivity ] }\n"
+"\n"
+" on\n"
+"\n"
+" off\n"
+"\n"
+" connectivity [check]\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli networking { KOMUT | help }\n"
+"\n"
+"KOMUT := { [ on | off | connectivity ] }\n"
+"\n"
+" on\n"
+"\n"
+" off\n"
+"\n"
+" connectivity [check]\n"
+"\n"
+
+#: ../clients/cli/general.c:155
+#, c-format
+msgid ""
+"Usage: nmcli networking on { help }\n"
+"\n"
+"Switch networking on.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli networking on { help }\n"
+"\n"
+"Ağı etkinleştirir.\n"
+"\n"
+
+#: ../clients/cli/general.c:163
+#, c-format
+msgid ""
+"Usage: nmcli networking off { help }\n"
+"\n"
+"Switch networking off.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli networking off { help }\n"
+"\n"
+"Ağı etkinsizleştirir.\n"
+"\n"
+
+#: ../clients/cli/general.c:171
+#, c-format
+msgid ""
+"Usage: nmcli networking connectivity { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [check]\n"
+"\n"
+"Get network connectivity state.\n"
+"The optional 'check' argument makes NetworkManager re-check the "
+"connectivity.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli networking connectivity { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [check]\n"
+"\n"
+"Ağın bağlantı durumunu gösterir.\n"
+"İsteğe bağlı değişken 'check' ile NetworkManager bağlantıyı yeniden kontrol "
+"eder.\n"
+"\n"
+
+#: ../clients/cli/general.c:183
+#, c-format
#| msgid ""
#| "Usage: nmcli nm { COMMAND | help }\n"
#| "\n"
@@ -1572,196 +4355,269 @@ msgstr "DEÄžER"
#| " wimax [on|off]\n"
#| "\n"
msgid ""
-"Usage: nmcli nm { COMMAND | help }\n"
+"Usage: nmcli radio { COMMAND | help }\n"
"\n"
-" COMMAND := { status | permissions | enable | sleep | wifi | wwan | "
-"wimax }\n"
+"COMMAND := { all | wifi | wwan | wimax }\n"
"\n"
-" COMMAND := { status | permissions | enable | sleep | wifi | wwan }\n"
+" all | wifi | wwan | wimax [ on | off ]\n"
"\n"
-" status\n"
-" permissions\n"
-" enable [true|false]\n"
-" sleep [true|false]\n"
-" wifi [on|off]\n"
-" wwan [on|off]\n"
-" wimax [on|off]\n"
+"COMMAND := { all | wifi | wwan }\n"
+"\n"
+" all | wifi | wwan [ on | off ]\n"
"\n"
msgstr ""
-"Kullanımı: nmcli nm { KOMUT | help }\n"
+"Kullanım: nmcli radio { KOMUT | help }\n"
"\n"
-" KOMUT := { status | enable | sleep | wifi | wwan | wimax }\n"
+"KOMUT := { all | wifi | wwan | wimax }\n"
"\n"
-" KOMUT := { status | enable | sleep | wifi | wwan }\n"
+" all | wifi | wwan | wimax [ on | off ]\n"
"\n"
-" status\n"
-" enable [true|false]\n"
-" sleep [true|false]\n"
-" wifi [on|off]\n"
-" wwan [on|off]\n"
-" wimax [on|off]\n"
+"KOMUT := { all | wifi | wwan }\n"
+"\n"
+" all | wifi | wwan [ on | off ]\n"
+"\n"
+
+#: ../clients/cli/general.c:197
+#, c-format
+msgid ""
+"Usage: nmcli radio all { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [on | off]\n"
+"\n"
+"Get status of all radio switches, or turn them on/off.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli radio all { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [on | off]\n"
+"\n"
+"Tüm radyo anahtarlarının durumunu gösterir, ya da açar/kapatır.\n"
+"\n"
+
+#: ../clients/cli/general.c:207
+#, c-format
+msgid ""
+"Usage: nmcli radio wifi { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [on | off]\n"
+"\n"
+"Get status of Wi-Fi radio switch, or turn it on/off.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli radio wifi { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [on | off]\n"
+"\n"
+"Wi-Fi radyo anahtarının durumunu gösterir, ya da açar/kapar.\n"
+"\n"
+
+#: ../clients/cli/general.c:217
+#, c-format
+msgid ""
+"Usage: nmcli radio wwan { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [on | off]\n"
+"\n"
+"Get status of mobile broadband radio switch, or turn it on/off.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli radio wwan { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [on | off]\n"
+"\n"
+"Mobil geniş bant radyo anahtarınının durumunu gösterir, ya da açar/kapatır.\n"
+"\n"
+
+#: ../clients/cli/general.c:228
+#, c-format
+msgid ""
+"Usage: nmcli radio wimax { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := [on | off]\n"
+"\n"
+"Get status of WiMAX radio switch, or turn it on/off.\n"
+"\n"
+msgstr ""
+"Kullanım: nmcli radio wimax { DEĞİŞKENLER | help }\n"
+"\n"
+"DEĞİŞKENLER := [on | off]\n"
+"\n"
+"WiMAX radyo anahtarının durumunu gösterir, ya da açar/kapatır.\n"
"\n"
-#: ../cli/src/network-manager.c:108
+#: ../clients/cli/general.c:248
msgid "asleep"
msgstr "uykuda"
-#: ../cli/src/network-manager.c:110
+#: ../clients/cli/general.c:250
msgid "connecting"
msgstr "bağlanıyor"
-#: ../cli/src/network-manager.c:112
+#: ../clients/cli/general.c:252
msgid "connected (local only)"
msgstr "bağlandı (sadece yerel)"
-#: ../cli/src/network-manager.c:114
+#: ../clients/cli/general.c:254
msgid "connected (site only)"
msgstr "bağlandı (sadece siteye)"
-#: ../cli/src/network-manager.c:118
+#: ../clients/cli/general.c:258
msgid "disconnecting"
msgstr "bağlantı kesiliyor"
-#: ../cli/src/network-manager.c:158
-#, c-format
-msgid "Error: 'nm status': %s"
-msgstr "Hata: 'nm durumu': %s"
+#: ../clients/cli/general.c:274
+msgid "portal"
+msgstr "kapı"
+
+#: ../clients/cli/general.c:276
+msgid "limited"
+msgstr "sınırlı"
+
+#: ../clients/cli/general.c:278
+msgid "full"
+msgstr "tam"
-#: ../cli/src/network-manager.c:160
+#: ../clients/cli/general.c:316
#, c-format
-msgid "Error: 'nm status': %s; allowed fields: %s"
-msgstr "Hata: 'nm status': %s; izin verilen alanlar: %s"
+#| msgid "Error: 'con status': %s; allowed fields: %s"
+msgid "Error: only these fields are allowed: %s"
+msgstr "Hata: sadece bu alanlar kullanılabilir: %s"
-#. create NMClient
-#: ../cli/src/network-manager.c:173 ../cli/src/network-manager.c:174
-#: ../cli/src/network-manager.c:175 ../cli/src/network-manager.c:176
-#: ../cli/src/network-manager.c:177 ../cli/src/network-manager.c:179
-#: ../cli/src/network-manager.c:180 ../cli/src/network-manager.c:429
-#: ../cli/src/network-manager.c:484 ../cli/src/network-manager.c:522
-#: ../cli/src/network-manager.c:561
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "enabled"
msgstr "etkin"
-#: ../cli/src/network-manager.c:173 ../cli/src/network-manager.c:174
-#: ../cli/src/network-manager.c:175 ../cli/src/network-manager.c:176
-#: ../cli/src/network-manager.c:177 ../cli/src/network-manager.c:179
-#: ../cli/src/network-manager.c:180 ../cli/src/network-manager.c:429
-#: ../cli/src/network-manager.c:484 ../cli/src/network-manager.c:522
-#: ../cli/src/network-manager.c:561
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "disabled"
msgstr "etkin deÄŸil"
-#: ../cli/src/network-manager.c:193
+#: ../clients/cli/general.c:346
msgid "NetworkManager status"
msgstr "NetworkManager durumu"
-#. Print header
-#: ../cli/src/network-manager.c:196
+#: ../clients/cli/general.c:351
msgid "running"
msgstr "çalışıyor"
-#: ../cli/src/network-manager.c:196
-msgid "not running"
-msgstr "çalışmıyor"
+#: ../clients/cli/general.c:354
+#| msgid "activating"
+msgid "starting"
+msgstr "başlatılıyor"
-#: ../cli/src/network-manager.c:271
-msgid "auth"
-msgstr ""
+#: ../clients/cli/general.c:354
+msgid "started"
+msgstr "başlatıldı"
-#: ../cli/src/network-manager.c:301
-#, c-format
-#| msgid "Error: 'nm status': %s"
-msgid "Error: 'nm permissions': %s"
-msgstr "Hata: 'nm izinleri': %s"
+#: ../clients/cli/general.c:425
+msgid "auth"
+msgstr "yetkilendirme"
-#: ../cli/src/network-manager.c:303
+#: ../clients/cli/general.c:454
#, c-format
-#| msgid "Error: 'nm status': %s; allowed fields: %s"
-msgid "Error: 'nm permissions': %s; allowed fields: %s"
-msgstr "Hata: 'nm izinleri': %s; izin verilen alanlar: %s"
+#| msgid "Error: 'nm permissions': %s"
+msgid "Error: 'general permissions': %s"
+msgstr "Hata: 'genel izinler': %s"
-#: ../cli/src/network-manager.c:324
-#| msgid "NetworkManager status"
+#: ../clients/cli/general.c:468
msgid "NetworkManager permissions"
msgstr "NetworkManager izinleri"
-#: ../cli/src/network-manager.c:350 ../cli/src/utils.c:475
+#: ../clients/cli/general.c:509
#, c-format
-msgid "Error: Couldn't connect to system bus: %s"
-msgstr "Hata: Sistem veri yoluna bağlanamadı: %s"
+#| msgid "Error: 'con list': %s"
+msgid "Error: 'general logging': %s"
+msgstr "Hata: 'genel loglama': %s"
-#: ../cli/src/network-manager.c:361
-#, c-format
-msgid "Error: Couldn't create D-Bus object proxy."
-msgstr "Hata: D-Bus nesnesi proxy oluşturamadı."
+#: ../clients/cli/general.c:524
+#| msgid "NetworkManager permissions"
+msgid "NetworkManager logging"
+msgstr "NetworkManager günlükleme"
-#: ../cli/src/network-manager.c:367
+#: ../clients/cli/general.c:546
#, c-format
-msgid "Error in sleep: %s"
-msgstr "Uyku hatası: %s"
+#| msgid "Failed to set signal mask: %d"
+msgid "Error: failed to set hostname: %s"
+msgstr "Hata: makine adı ayarlama başarısız: %s"
-#: ../cli/src/network-manager.c:416 ../cli/src/network-manager.c:471
-#: ../cli/src/network-manager.c:509 ../cli/src/network-manager.c:548
+#: ../clients/cli/general.c:659
#, c-format
-msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s"
-msgstr ""
-"Hata: '--fields' değeri olan '%s' burada geçerli değil; izin verilen "
-"alanlar: %s"
-
-#: ../cli/src/network-manager.c:424
-msgid "Networking enabled"
-msgstr "AÄŸ oluÅŸturma etkinleÅŸtirildi"
+#| msgid "Error: 'dev list': %s"
+msgid "Error: failed to set logging: %s"
+msgstr "Hata: günlükleme ayarlama başarısız: %s"
-#: ../cli/src/network-manager.c:440
+#: ../clients/cli/general.c:668
#, c-format
-msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'."
-msgstr ""
-"Hata: geçersiz 'enable' parametresi: %s'; kullanım 'true' yada 'false'."
+#| msgid "Error: 'nm' command '%s' is not valid."
+msgid "Error: 'general' command '%s' is not valid."
+msgstr "Hata: 'general' komutu '%s' geçerli değil."
-#: ../cli/src/network-manager.c:450
+#: ../clients/cli/general.c:686
#, c-format
-msgid "Error: Sleeping status is not exported by NetworkManager."
-msgstr "Hata: Uyku durumu Ağ Yöneticisi ile verilemez."
+#| msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s"
+msgid "Error: '--fields' value '%s' is not valid here (allowed field: %s)"
+msgstr "Hata: '--fields' değeri '%s' burada geçerli değil (izinli alan: %s)"
-#: ../cli/src/network-manager.c:458
+#: ../clients/cli/general.c:711
#, c-format
-msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'."
-msgstr "Hata: geçersiz 'sleep' parametresi: %s'; kullanım 'true' yada 'false'."
+#| msgid "Error: invalid 'wifi' parameter: '%s'."
+msgid "Error: invalid '%s' argument: '%s' (use on/off)."
+msgstr "Hata: geçersiz '%s' değişkeni: '%s' (on/off kullanın)"
-#: ../cli/src/network-manager.c:479
-msgid "WiFi enabled"
-msgstr "WiFi etkin"
+#: ../clients/cli/general.c:722
+#| msgid "Connection list"
+msgid "Connectivity"
+msgstr "Bağlanabilirlik"
-#: ../cli/src/network-manager.c:495
-#, c-format
-msgid "Error: invalid 'wifi' parameter: '%s'."
-msgstr "Hata: geçersiz 'wifi' parametresi: '%s'."
+#: ../clients/cli/general.c:737
+#| msgid "Networking enabled"
+msgid "Networking"
+msgstr "AÄŸ"
-#: ../cli/src/network-manager.c:517
-msgid "WWAN enabled"
-msgstr "WWAN etkin"
+#: ../clients/cli/general.c:762
+#, c-format
+#| msgid "Error: 'con' command '%s' is not valid."
+msgid "Error: 'networking connectivity' command '%s' is not valid."
+msgstr "Hata: 'ağ bağlantısı' '%s' komutu geçerli değil."
-#: ../cli/src/network-manager.c:533
+#: ../clients/cli/general.c:778
#, c-format
-msgid "Error: invalid 'wwan' parameter: '%s'."
-msgstr "Hata: geçersiz 'wwan parametresi: '%s'."
+#| msgid "Error: 'con' command '%s' is not valid."
+msgid "Error: 'networking' command '%s' is not valid."
+msgstr "Hata: 'networking' komutu '%s' geçerli değil."
-#: ../cli/src/network-manager.c:556
-msgid "WiMAX enabled"
-msgstr "WiMAX etkin"
+#: ../clients/cli/general.c:807 ../clients/cli/general.c:827
+msgid "Radio switches"
+msgstr "Radyo anahtarları"
-#: ../cli/src/network-manager.c:572
-#, c-format
-msgid "Error: invalid 'wimax' parameter: '%s'."
-msgstr "Hata: geçersiz 'wimax' değiştirgesi: '%s'."
+#. no argument, show current WiFi state
+#: ../clients/cli/general.c:845
+msgid "Wi-Fi radio switch"
+msgstr "Wi-Fi radyo anahtarı"
+
+#. no argument, show current WWAN (mobile broadband) state
+#: ../clients/cli/general.c:861
+msgid "WWAN radio switch"
+msgstr "WWAN radyo anahtarı"
+
+#. no argument, show current WiMAX state
+#: ../clients/cli/general.c:878
+msgid "WiMAX radio switch"
+msgstr "WiMAX radyo anahtarı"
-#: ../cli/src/network-manager.c:588
+#: ../clients/cli/general.c:890
#, c-format
-msgid "Error: 'nm' command '%s' is not valid."
-msgstr "Hata: '%s' nm komutu geçerli değil."
+#| msgid "Error: 'con' command '%s' is not valid."
+msgid "Error: 'radio' command '%s' is not valid."
+msgstr "Hata: 'radyo' '%s' komutu geçerli değil."
-#: ../cli/src/nmcli.c:76
-#, fuzzy, c-format
+#: ../clients/cli/nmcli.c:86
+#, c-format
#| msgid ""
#| "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
#| "\n"
@@ -1794,273 +4650,999 @@ msgid ""
"values\n"
" -n[ocheck] don't check nmcli and "
"NetworkManager versions\n"
+" -a[sk] ask for missing parameters\n"
+" -w[ait] <seconds> set timeout waiting for "
+"finishing operations\n"
" -v[ersion] show program version\n"
" -h[elp] print this help\n"
"\n"
"OBJECT\n"
-" nm NetworkManager's status\n"
+" g[eneral] NetworkManager's general status and operations\n"
+" n[etworking] overall networking control\n"
+" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+" a[gent] NetworkManager secret agent or polkit agent\n"
"\n"
msgstr ""
-"Kullanımı: %s [SEÇENEKLER] NESNE { KOMUT | help }\n"
+"Kullanım: %s [SEÇENEKLER] NESNE { KOMUT | help }\n"
"\n"
"SEÇENEKLER\n"
-" -t[erse] kısa ve öz çıktı\n"
+" -t[erse] kısa çıktı\n"
" -p[retty] güzel çıktı\n"
" -m[ode] tabular|multiline çıktı kipi\n"
-" -f[ields] <field1,field2,...>|all|common çıktıda yer alacak alanları "
-"belirtir\n"
-" -e[scape] yes|no değerler arasındaki sütun "
-"ayraçları\n"
+" -f[ields] <alan1,alan2,...>|all|common çıktısı olacak alanları belirler\n"
+" -e[scape] yes|no değerlerdeki kaçış sütunları "
+"ayırıcıları\n"
" -n[ocheck] nmcli ve NetworkManager "
-"sürümlerini denetleme\n"
-" -v[ersion] program sürümünü göster\n"
-" -h[elp] bu yardımı ekrana yaz\n"
+"sürümlerini kontrol etmez\n"
+" -a[sk] eksik parametreleri sorar\n"
+" -w[ait] <seconds> biten işlemler için zaman aşımı "
+"ayarlar\n"
+" -v[ersion] program sürümünü gösterir\n"
+" -h[elp] bu yardımı ekrana yazdırır\n"
"\n"
"NESNE\n"
-" nm NetworkManager durumu\n"
-" con NetworkManager bağlantıları\n"
-" dev NetworkManager tarafından yönetilen aygıtlar\n"
+" g[eneral] NetworkManager için genel durum ve işlemler\n"
+" n[etworking] Tüm ağ kontrolleri\n"
+" r[adio] NetworkManager radyo anahtarları\n"
+" c[onnection] NetworkManager bağlantıları\n"
+" d[evice] NetworkManager tarafından yönetilen aygıtlar\n"
+" a[gent] NetworkManager gizli araç ya da polkit aracı\n"
"\n"
-#: ../cli/src/nmcli.c:124
+#: ../clients/cli/nmcli.c:142
#, c-format
msgid "Error: Object '%s' is unknown, try 'nmcli help'."
msgstr "Hata: '%s' nesnesi bilinmiyor, 'nmcli help' komutunu deneyin."
-#: ../cli/src/nmcli.c:154
+#: ../clients/cli/nmcli.c:172
#, c-format
msgid "Error: Option '--terse' is specified the second time."
msgstr "Hata: '--terse' seçeneği ikinci zaman için belirlenmiş."
-#: ../cli/src/nmcli.c:159
+#: ../clients/cli/nmcli.c:177
#, c-format
msgid "Error: Option '--terse' is mutually exclusive with '--pretty'."
msgstr "Hata: '--terse' parametresi '--pretty' parametresi ile çakışıyor."
-#: ../cli/src/nmcli.c:167
+#: ../clients/cli/nmcli.c:185
#, c-format
msgid "Error: Option '--pretty' is specified the second time."
msgstr "Hata: '--pretty' seçeneği ikinci zaman için belirlenmiş."
-#: ../cli/src/nmcli.c:172
+#: ../clients/cli/nmcli.c:190
#, c-format
msgid "Error: Option '--pretty' is mutually exclusive with '--terse'."
msgstr "Hata: '--pretty' parametresi '--terse' parametresi ile çakışıyor."
-#: ../cli/src/nmcli.c:182 ../cli/src/nmcli.c:198
+#: ../clients/cli/nmcli.c:200 ../clients/cli/nmcli.c:216
+#: ../clients/cli/nmcli.c:245
#, c-format
msgid "Error: missing argument for '%s' option."
msgstr "Hata: '%s' seçeneği için eksik değişken."
-#: ../cli/src/nmcli.c:191 ../cli/src/nmcli.c:207
+#: ../clients/cli/nmcli.c:209 ../clients/cli/nmcli.c:225
#, c-format
msgid "Error: '%s' is not valid argument for '%s' option."
msgstr "Hata: '%s', '%s' seçeneği için geçerli bir değişken değil."
-#: ../cli/src/nmcli.c:214
+#: ../clients/cli/nmcli.c:232
#, c-format
msgid "Error: fields for '%s' options are missing."
msgstr "Hata: '%s' seçeneği için alanlar eksik."
-#: ../cli/src/nmcli.c:222
+#: ../clients/cli/nmcli.c:250
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "Error: '%s' is not a valid timeout for '%s' option."
+msgstr "Hata: '%s' geçerli bir zaman aşımı süresi değil, '%s' seçeneği için."
+
+#: ../clients/cli/nmcli.c:257
#, c-format
msgid "nmcli tool, version %s\n"
msgstr "nmcli aracı, sürüm %s\n"
-#: ../cli/src/nmcli.c:228
+#: ../clients/cli/nmcli.c:263
#, c-format
msgid "Error: Option '%s' is unknown, try 'nmcli -help'."
msgstr "Hata: '%s' seçeneği bilinmiyor, 'nmcli-help' komutunu deneyin."
-#: ../cli/src/nmcli.c:247
+#: ../clients/cli/nmcli.c:346 ../clients/cli/nmcli.c:356
#, c-format
-msgid "Caught signal %d, shutting down..."
-msgstr "%d sinyali yakalandı, kapatılıyor..."
-
-#: ../cli/src/nmcli.c:272
-msgid "Error: Could not create NMClient object."
-msgstr "Hata: NMClient nesnesi oluşturulamadı."
-
-#: ../cli/src/nmcli.c:288
-msgid "Success"
-msgstr "Başarılı"
+msgid ""
+"\n"
+"Error: nmcli terminated by signal %s (%d)\n"
+msgstr ""
+"\n"
+"Hata: nmcli %s (%d) sinyali tarafından sonlandırıldı\n"
-#: ../cli/src/settings.c:604
+#: ../clients/cli/nmcli.c:387
#, c-format
-msgid "%d (hex-ascii-key)"
-msgstr "%d (hex-ascii-key)"
+#| msgid "Failed to set signal mask: %d"
+msgid "Failed to set signal mask: %d\n"
+msgstr "Sinyal maskeleme başarısız: %d\n"
-#: ../cli/src/settings.c:606
+#: ../clients/cli/nmcli.c:394
#, c-format
-msgid "%d (104/128-bit passphrase)"
-msgstr "%d (104/128-bit parola)"
+#| msgid "Failed to set signal mask: %d"
+msgid "Failed to create signal handling thread: %d\n"
+msgstr "Sinyal yakalama iş parçaçığı oluşturma başarısız: %d\n"
-#: ../cli/src/settings.c:609 ../cli/src/settings.c:737
+#: ../clients/cli/nmcli.c:491 ../clients/nm-online.c:197
#, c-format
-msgid "%d (unknown)"
-msgstr "%d (bilinmeyen)"
-
-#: ../cli/src/settings.c:635
-msgid "0 (unknown)"
-msgstr "0 (bilinmeyen)"
-
-#: ../cli/src/settings.c:641
-msgid "any, "
-msgstr "herhangi, "
-
-#: ../cli/src/settings.c:643
-msgid "900 MHz, "
-msgstr "900 MHz, "
+#| msgid "Error: Could not create NMClient object."
+msgid "Error: Could not create NMClient object: %s."
+msgstr "Hata: NMClient nesnesi oluşturulamadı: %s."
-#: ../cli/src/settings.c:645
-msgid "1800 MHz, "
-msgstr "1800 MHz, "
-
-#: ../cli/src/settings.c:647
-msgid "1900 MHz, "
-msgstr "1900 MHz, "
-
-#: ../cli/src/settings.c:649
-msgid "850 MHz, "
-msgstr "850 MHz, "
-
-#: ../cli/src/settings.c:651
-msgid "WCDMA 3GPP UMTS 2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 2100 MHz, "
-
-#: ../cli/src/settings.c:653
-msgid "WCDMA 3GPP UMTS 1800 MHz, "
-msgstr "WCDMA 3GPP UMTS 1800 MHz, "
-
-#: ../cli/src/settings.c:655
-msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, "
+#: ../clients/cli/nmcli.c:508
+msgid "Success"
+msgstr "Başarılı"
-#: ../cli/src/settings.c:657
-msgid "WCDMA 3GPP UMTS 800 MHz, "
-msgstr "WCDMA 3GPP UMTS 800 MHz, "
+#: ../clients/cli/polkit-agent.c:82
+#, c-format
+#| msgid "Active connection state: %s\n"
+msgid "Authentication message: %s\n"
+msgstr "Kimlik doÄŸrulama iletisi: %s\n"
-#: ../cli/src/settings.c:659
-msgid "WCDMA 3GPP UMTS 850 MHz, "
-msgstr "WCDMA 3GPP UMTS 850 MHz, "
+#: ../clients/cli/polkit-agent.c:88
+#, c-format
+#| msgid "Active connection state: %s\n"
+msgid "Authentication error: %s\n"
+msgstr "Kimlik doğrulama hatası: %s\n"
-#: ../cli/src/settings.c:661
-msgid "WCDMA 3GPP UMTS 900 MHz, "
-msgstr "WCDMA 3GPP UMTS 900 MHz, "
+#: ../clients/cli/polkit-agent.c:134
+#, c-format
+#| msgid "Modem initialization failed"
+msgid "Warning: polkit agent initialization failed: %s\n"
+msgstr "Uyarı: polkit aracı oluşturma başarısız: %s\n"
-#: ../cli/src/settings.c:663
-msgid "WCDMA 3GPP UMTS 1700 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700 MHz, "
+#: ../clients/cli/settings.c:657
+#, c-format
+#| msgid "%d (hex-ascii-key)"
+msgid "%d (key)"
+msgstr "%d (anahtar)"
-#: ../cli/src/settings.c:665
-msgid "WCDMA 3GPP UMTS 1900 MHz, "
-msgstr "WCDMA 3GPP UMTS 1900 MHz, "
+#: ../clients/cli/settings.c:659
+#, c-format
+#| msgid "%d (104/128-bit passphrase)"
+msgid "%d (passphrase)"
+msgstr "%d (parola)"
-#: ../cli/src/settings.c:667
-msgid "WCDMA 3GPP UMTS 2600 MHz, "
-msgstr "WCDMA 3GPP UMTS 2600 MHz, "
+#: ../clients/cli/settings.c:662 ../clients/cli/settings.c:743
+#, c-format
+msgid "%d (unknown)"
+msgstr "%d (bilinmeyen)"
-#: ../cli/src/settings.c:685
+#: ../clients/cli/settings.c:691
msgid "0 (NONE)"
msgstr "0 (YOK)"
-#: ../cli/src/settings.c:691
+#: ../clients/cli/settings.c:697
msgid "REORDER_HEADERS, "
-msgstr ""
+msgstr "BAÅžLIKLARI_YENÄ°DEN_SIRALA, "
-#: ../cli/src/settings.c:693
+#: ../clients/cli/settings.c:699
msgid "GVRP, "
-msgstr ""
+msgstr "GVRP, "
-#: ../cli/src/settings.c:695
+#: ../clients/cli/settings.c:701
msgid "LOOSE_BINDING, "
-msgstr ""
+msgstr "BAÄžLAMAYI_AYIR, "
-#: ../cli/src/settings.c:731
+#: ../clients/cli/settings.c:737
#, c-format
-#| msgid "disabled"
msgid "%d (disabled)"
msgstr "%d (devre dışı)"
-#: ../cli/src/settings.c:733
+#: ../clients/cli/settings.c:739
#, c-format
msgid "%d (enabled, prefer public IP)"
msgstr "%d (etkinleÅŸtirildi, tercih edilen genel IP)"
-#: ../cli/src/settings.c:735
+#: ../clients/cli/settings.c:741
#, c-format
msgid "%d (enabled, prefer temporary IP)"
msgstr "%d (etkinleştirildi, tercih edilen geçici IP)"
-#: ../cli/src/settings.c:747
-#| msgid "(none)"
+#: ../clients/cli/settings.c:753
msgid "0 (none)"
msgstr "0 (hiçbiri)"
-#: ../cli/src/settings.c:753
+#: ../clients/cli/settings.c:759
msgid "agent-owned, "
-msgstr ""
+msgstr "uygulamaya-ait, "
-#: ../cli/src/settings.c:755
-#| msgid "not set"
+#: ../clients/cli/settings.c:761
msgid "not saved, "
-msgstr "kaydedilmemiÅŸ,"
+msgstr "kaydedilmemiÅŸ, "
-#: ../cli/src/settings.c:757
+#: ../clients/cli/settings.c:763
msgid "not required, "
-msgstr "gerekli deÄŸil,"
+msgstr "gerekli deÄŸil, "
+
+#: ../clients/cli/settings.c:1046
+#| msgid "%d (disabled)"
+msgid "0 (disabled)"
+msgstr "0 (devre dışı)"
+
+#: ../clients/cli/settings.c:1052
+#| msgid "enabled"
+msgid "enabled, "
+msgstr "etkin, "
+
+#: ../clients/cli/settings.c:1054
+msgid "advertise, "
+msgstr "duyur, "
-#: ../cli/src/settings.c:1071 ../cli/src/settings.c:1241
-#: ../cli/src/settings.c:1282
+#: ../clients/cli/settings.c:1056
+msgid "willing, "
+msgstr "hazır, "
+
+#: ../clients/cli/settings.c:1084
+msgid "-1 (unset)"
+msgstr "-1 (ayarlanmamış)"
+
+#: ../clients/cli/settings.c:1181 ../clients/cli/settings.c:1512
+#: ../clients/cli/settings.c:1554
msgid "auto"
msgstr "otomatik"
-#: ../cli/src/utils.c:105
-#, fuzzy, c-format
+#: ../clients/cli/settings.c:1194
+msgid "default"
+msgstr "varsayılan"
+
+#: ../clients/cli/settings.c:1682
+#, c-format
+msgid "Do you also want to set '%s' to '%s'? [yes]: "
+msgstr "Ayrıca şunu: '%s' şu şekilde: '%s' ayarlamak istiyor musunuz? [evet]: "
+
+#: ../clients/cli/settings.c:1684
+#, c-format
+msgid "Do you also want to clear '%s'? [yes]: "
+msgstr "Ayrıca '%s' temizlemek istiyor musunuz? [yes]: "
+
+#: ../clients/cli/settings.c:1845
+#, c-format
+msgid ""
+"Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"
+msgstr ""
+"Uyarı: %s.%s şu olarak: '%s' ayarlandı, ancak altyapı kipi tarafından "
+"yoksayılabilir\n"
+
+#: ../clients/cli/settings.c:1864
+#, c-format
+msgid "Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"
+msgstr "Uyarı: %s.%s ayarı, iv4 ve ipv6 ayarlarının silinmesini gerektiriyor.\n"
+
+#: ../clients/cli/settings.c:1866
+msgid "Do you want to remove them? [yes] "
+msgstr "Bunları kaldırmak istiyor musunuz? [evet] "
+
+#: ../clients/cli/settings.c:1962 ../clients/cli/settings.c:2242
+#: ../clients/cli/settings.c:4342
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "'%s' is not valid"
+msgstr "'%s' geçerli değil"
+
+#: ../clients/cli/settings.c:1985
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%d' is not valid; use <%d-%d>"
+msgstr "'%d' geçerli değil, <%d-%d> kullanın"
+
+#: ../clients/cli/settings.c:2007
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%u' is not valid; use <%d-%d>"
+msgstr "'%u' geçerli değil; <%d-%d> kullanın"
+
+#: ../clients/cli/settings.c:2073
+#, c-format
+#| msgid "'%s' is not a valid ethernet port value"
+msgid "'%s' is not valid; use <option>=<value>"
+msgstr "'%s' geçerli değil; <seçenek>=<değer> kullanın"
+
+#: ../clients/cli/settings.c:2107
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "index '%s' is not valid"
+msgstr "'%s' geçerli bir indeks değil"
+
+#: ../clients/cli/settings.c:2112 ../clients/cli/settings.c:2137
+msgid "no item to remove"
+msgstr "silinecek öge yok"
+
+#: ../clients/cli/settings.c:2116 ../clients/cli/settings.c:2141
+#, c-format
+msgid "index '%d' is not in range <0-%d>"
+msgstr "'%d' indeksi <0-%d> aralığında değil"
+
+#: ../clients/cli/settings.c:2156
+#, c-format
+#| msgid "invalid field '%s'"
+msgid "invalid option '%s'"
+msgstr "geçersiz seçenek '%s'"
+
+#: ../clients/cli/settings.c:2158
+msgid "missing option"
+msgstr "eksik seçenek"
+
+#: ../clients/cli/settings.c:2188 ../clients/cli/settings.c:2208
+#, c-format
+#| msgid "'%s' is not a valid ethernet port value"
+msgid "'%s' is not a valid number (or out of range)"
+msgstr "'%s' geçerli bir sayı değil (sınırların dışında)"
+
+#: ../clients/cli/settings.c:2258
+#, c-format
+#| msgid "'%s' is not a valid ethernet port value"
+msgid "'%s' is not a valid Ethernet MAC"
+msgstr "'%s' geçerli bir Ethernet MAC adresi değil"
+
+#: ../clients/cli/settings.c:2283 ../libnm-core/nm-setting-connection.c:800
+#: ../libnm-core/nm-setting-infiniband.c:254
+#: ../libnm-util/nm-setting-connection.c:833
+#: ../libnm-util/nm-setting-infiniband.c:268
+#, c-format
+msgid "'%s' is not a valid interface name"
+msgstr "'%s' geçerli bir arayüz adı değil"
+
+#: ../clients/cli/settings.c:2307
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not a valid flag number; use <0-%d>"
+msgstr "'%s' geçerli bayrak sayısı değil: <0-%d> kullanın"
+
+#: ../clients/cli/settings.c:2319
+#, c-format
+msgid "Warning: '%s' sum is higher than all flags => all flags set\n"
+msgstr "Uyarı: '%s' toplamı tüm bayraklardan büyük => tüm bayraklar ayarlandı\n"
+
+#: ../clients/cli/settings.c:2362
+#, c-format
+#| msgid "'%s' is not a valid MAC address"
+msgid "'%s' is not a valid hex character"
+msgstr "'%s' geçerli bir on altılık karakter değil"
+
+#: ../clients/cli/settings.c:2392
+#, c-format
+#| msgid "'%s' is not a valid MAC address"
+msgid "'%s' is not a valid MAC"
+msgstr "'%s' geçerli bir MAC adresi değil"
+
+#: ../clients/cli/settings.c:2429 ../libnm-core/nm-setting-connection.c:789
+#: ../libnm-util/nm-setting-connection.c:790
+#, c-format
+msgid "'%s' is not a valid UUID"
+msgstr "'%s' geçerli bir UUID değil"
+
+#: ../clients/cli/settings.c:2496
+#, c-format
+msgid "the property doesn't contain permission '%s'"
+msgstr "özellik '%s' izinini içermiyor"
+
+#: ../clients/cli/settings.c:2508
+msgid ""
+"Enter a list of user permissions. This is a list of user names formatted "
+"as:\n"
+" [user:]<user name 1>, [user:]<user name 2>,...\n"
+"The items can be separated by commas or spaces.\n"
+"\n"
+"Example: alice bob charlie\n"
+msgstr ""
+"Kullanıcı izinlerinin listesini girin. Bu listedeki isimler şu şekilde "
+"biçimlendirilmelidir:\n"
+" [user:]<kullanici adi 1>, [user:]<kullanici adi 2>,...\n"
+"Öğeler virgül ve ya boşluk ile birbirinden ayrılabilirler.\n"
+"\n"
+"Örneğin: ali ayşe deniz\n"
+
+#: ../clients/cli/settings.c:2527
+#, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "'%s' is not valid master; use ifname or connection UUID"
+msgstr "'%s' geçerli bir ana bağlantı değil; ifname ya da UUID kullanın"
+
+#: ../clients/cli/settings.c:2571
+#, c-format
+msgid "Warning: %s is not an UUID of any existing connection profile\n"
+msgstr "Uyarı: %s herhangi bir mevcut bağlantı profilinin UUID 'si değil\n"
+
+#: ../clients/cli/settings.c:2575 ../clients/cli/settings.c:2591
+#, c-format
+#| msgid "VPN connection failed"
+msgid "'%s' is not a VPN connection profile"
+msgstr "'%s' bir VPN bağlantı profili değil"
+
+#: ../clients/cli/settings.c:2584
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not a name of any exiting profile"
+msgstr "'%s' mevcut bir profilin adı değil"
+
+#: ../clients/cli/settings.c:2618
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "the value '%s' is not a valid UUID"
+msgstr "'%s' değeri geçerli bir UUID değil"
+
+#: ../clients/cli/settings.c:2625
+#, c-format
+msgid "the property doesn't contain UUID '%s'"
+msgstr "Özellik UUID '%s' barındırmıyor"
+
+#: ../clients/cli/settings.c:2637
+msgid ""
+"Enter secondary connections that should be activated when this connection "
+"is\n"
+"activated. Connections can be specified either by UUID or ID (name). nmcli\n"
+"transparently translates names to UUIDs. Note that NetworkManager only "
+"supports\n"
+"VPNs as secondary connections at the moment.\n"
+"The items can be separated by commas or spaces.\n"
+"\n"
+"Example: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"
+msgstr ""
+"İkincil bağlantıları girin ki bu bağlantı etkinleştiğinde o da etkinleşmiş "
+"olmalıdır.\n"
+"Bağlantılar UUID ya da ID (isim) ile belirtilebilirler. nmcli şeffaf bir "
+"biçimde\n"
+"isimleri UUID olarak çevirir. NetworkManager sadece VPN leri\n"
+"ikincil bağlantı olarak kabul edebilirler.\n"
+"Ögeler virgül veya boşluklar ile birbirinden ayrılabilirler.\n"
+"\n"
+"Örneğin: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"
+
+#: ../clients/cli/settings.c:2714
+msgid "private key password not provided"
+msgstr "özel anahtar parolası girilmedi"
+
+#: ../clients/cli/settings.c:2741
+#, c-format
+msgid "the property doesn't contain EAP method '%s'"
+msgstr "özellik '%s' EAP yönetimi içermiyor"
+
+#: ../clients/cli/settings.c:2766
+#, c-format
+msgid "the property doesn't contain alternative subject match '%s'"
+msgstr "özellik diğer bir başlık eşleşmesi '%s' içermiyor."
+
+#: ../clients/cli/settings.c:2795
+#, c-format
+msgid "the property doesn't contain \"phase2\" alternative subject match '%s'"
+msgstr "özellik diğer bir \"phase2\" başlık eşleşmesi '%s' içermiyor. "
+
+#: ../clients/cli/settings.c:2821
+msgid ""
+"Enter path to a private key and the key password (if not set yet):\n"
+" <file path> [<password>]\n"
+"Example: /home/cimrman/jara-priv-key Dardanely\n"
+msgstr ""
+"Gizli anahtarın yolunu ve parolasını girin (henüz ayarlamadıysanız):\n"
+" <dosya yolu> [<parola>]\n"
+"Örneğin: /home/ali/gizli-anahtar Parolam123\n"
+
+#: ../clients/cli/settings.c:2891
+msgid ""
+"Enter bytes as a list of hexadecimal values.\n"
+"Two formats are accepted:\n"
+"(a) a string of hexadecimal digits, where each two digits represent one "
+"byte\n"
+"(b) space-separated list of bytes written as hexadecimal digits (with "
+"optional 0x/0X prefix, and optional leading 0).\n"
+"\n"
+"Examples: ab0455a6ea3a74C2\n"
+" ab 4 55 0xa6 ea 3a 74 C2\n"
+msgstr ""
+"Onaltılık değerlerin bir listesi olarak baytlar girin\n"
+"İki biçim kabul ediliyor:\n"
+"(a) onaltılık sayılarından bir karakter dizisi, her iki sayı bir bayta denk "
+"gelir\n"
+"(b) boşlık ile ayrılmış onaltılık sayılardan oluşan bir liste (tercihen 0x/"
+"0X öneki ile ve tercihen 0 ile başlayan).\n"
+"\n"
+"Örneğin: ab0455a6ea3a74C2\n"
+" ab 4 55 0xa6 ea 3a 74 C2\n"
+
+#: ../clients/cli/settings.c:2994
+#, c-format
+msgid ""
+"Enter a list of bonding options formatted as:\n"
+" option = <value>, option = <value>,... \n"
+"Valid options are: %s\n"
+"'mode' can be provided as a name or a number:\n"
+"balance-rr = 0\n"
+"active-backup = 1\n"
+"balance-xor = 2\n"
+"broadcast = 3\n"
+"802.3ad = 4\n"
+"balance-tlb = 5\n"
+"balance-alb = 6\n"
+"\n"
+"Example: mode=2,miimon=120\n"
+msgstr ""
+"Bağlama seçeneklerini aşağıdaki biçimde listeleyin:\n"
+" seçenek = <değer>, seçenek = <değer>,... \n"
+"Geçerli seçenekler: %s\n"
+"'kip' ismiyle veya numarasıyla kullanılabilir:\n"
+"balance-rr = 0\n"
+"active-backup = 1\n"
+"balance-xor = 2\n"
+"broadcast = 3\n"
+"802.3ad = 4\n"
+"balance-tlb = 5\n"
+"balance-alb = 6\n"
+"\n"
+"Örnek: mode=2,miimon=120\n"
+
+#: ../clients/cli/settings.c:3032
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "'%s' is not a valid InfiniBand MAC"
+msgstr "'%s' geçerli bir InfiniBand MAC adresi değil"
+
+#: ../clients/cli/settings.c:3069
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "'%s' is not a valid IBoIP P_Key"
+msgstr "'%s' geçerli bir IBoIP P_Key değil"
+
+#: ../clients/cli/settings.c:3138 ../clients/cli/settings.c:3484
+#, c-format
+msgid "the property doesn't contain DNS server '%s'"
+msgstr "özellik '%s' DNS sunucusunu içermiyor"
+
+#: ../clients/cli/settings.c:3150
+msgid ""
+"Enter a list of IPv4 addresses of DNS servers.\n"
+"\n"
+"Example: 8.8.8.8, 8.8.4.4\n"
+msgstr ""
+"DNS sunucuların IPv4 adres listesini girin.\n"
+"\n"
+"Örnek: 8.8.8.8, 8.8.4.4\n"
+
+#: ../clients/cli/settings.c:3186 ../clients/cli/settings.c:3538
+#, c-format
+msgid "the property doesn't contain DNS search domain '%s'"
+msgstr "özellik, DNS arama alanı '%s' içermiyor"
+
+#: ../clients/cli/settings.c:3206 ../clients/cli/settings.c:3558
+#, c-format
+msgid "'%s' is not valid (use ip[/prefix] [gateway])"
+msgstr "'%s' geçerli değil (ip[/prefix] [gateway] kullanın)"
+
+#: ../clients/cli/settings.c:3255 ../clients/cli/settings.c:3606
+#, c-format
+msgid "the property doesn't contain IP address '%s'"
+msgstr "özellik IP adresi '%s' içermiyor"
+
+#: ../clients/cli/settings.c:3268
+msgid ""
+"Enter a list of IPv4 addresses formatted as:\n"
+" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+"Missing prefix is regarded as prefix of 32.\n"
+"\n"
+"Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+msgstr ""
+"IPv4 adresleri listesini şu biçimde girin:\n"
+" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+"Eksik prefix var ise varsayılan olarak 32 kullanılır.\n"
+"\n"
+"Örneğin: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+
+#: ../clients/cli/settings.c:3321 ../clients/cli/settings.c:3637
+#, c-format
+msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
+msgstr ""
+"'%s' geçerli değil (format şöyle olmalı: ip[/önek] [sonraki-atlama-noktası] "
+"[metrik])"
+
+#: ../clients/cli/settings.c:3369 ../clients/cli/settings.c:3685
+#, c-format
+msgid "the property doesn't contain route '%s'"
+msgstr "özellik '%s' yönlendirmesini içermiyor"
+
+#: ../clients/cli/settings.c:3382
+msgid ""
+"Enter a list of IPv4 routes formatted as:\n"
+" ip[/prefix] [next-hop] [metric],...\n"
+"\n"
+"Missing prefix is regarded as a prefix of 32.\n"
+"Missing next-hop is regarded as 0.0.0.0.\n"
+"Missing metric or 0 means a default metric (NM/kernel will set a default "
+"value).\n"
+"\n"
+"Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
+" 10.1.2.0/24\n"
+msgstr ""
+"IPv4 yönlendirmelerinin listesini girin, şu biçimde:\n"
+" ip[/prefix] [next-hop] [metric],...\n"
+"\n"
+"Eksik önek(prefix) 32 olarak kabul edilir.\n"
+"Eksik next-hop(sonraki-atlama) 0.0.0.0. olarak kabul edilir \n"
+"Eksik metric(ölçü) ya da 0 değeri varsayılan olarak kabul edilir (NM/kernel "
+"varsayılan değeri ayarlar).\n"
+"\n"
+"Örneğin: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
+" 10.1.2.0/24\n"
+
+#: ../clients/cli/settings.c:3496
+msgid ""
+"Enter a list of IPv6 addresses of DNS servers. If the IPv6 configuration "
+"method is 'auto' these DNS servers are appended to those (if any) returned "
+"by automatic configuration. DNS servers cannot be used with the 'shared' or "
+"'link-local' IPv6 configuration methods, as there is no upstream network. In "
+"all other IPv6 configuration methods, these DNS servers are used as the only "
+"DNS servers for this connection.\n"
+"\n"
+"Example: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
+msgstr ""
+"DNS sunucunlarının IPv6 adreslerinin listesini girin. Eğer IPv6 "
+"yapılandırma yöntemi 'auto' olarak ayarlanmış ise, DNS sunucları "
+"yapılandırmadan(var ise) otomatik olarak girilir. DNS sunucuları 'shared' "
+"ya da 'link-local' IPv6 ayarlama yöntemlerini bir üst ağ olarak kullanamaz. "
+"Tüm diğer IPv6 yapılandırma yöntemlerinde, bu DNS sunucları bu bağlantı için "
+"sadece DNS sunucusu olarak kullanılırlar.\n"
+"\n"
+"Örneğin: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
+
+#: ../clients/cli/settings.c:3619
+msgid ""
+"Enter a list of IPv6 addresses formatted as:\n"
+" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+"Missing prefix is regarded as prefix of 128.\n"
+"\n"
+"Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
+"1050:0:0:0:5:600:300c:326b\n"
+msgstr ""
+"IPv6 adresleri listesini girin, şu biçimde olmalı:\n"
+" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+"Eksik prefix öğesi varsayılan olarak 128 kabul edilir.\n"
+"\n"
+"Örneğin: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, 1050:0:0:0:5:600:300c:"
+"326b\n"
+
+#: ../clients/cli/settings.c:3698
+msgid ""
+"Enter a list of IPv6 routes formatted as:\n"
+" ip[/prefix] [next-hop] [metric],...\n"
+"\n"
+"Missing prefix is regarded as a prefix of 128.\n"
+"Missing next-hop is regarded as \"::\".\n"
+"Missing metric or 0 means a default metric (NM/kernel will set a default "
+"value).\n"
+"\n"
+"Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
+"db8:beef::3 2\n"
+" abbe::/64 55\n"
+msgstr ""
+"IPv6 yönlendirmelirini listesini girin, şu biçimde olmalı:\n"
+" ip[/prefix] [next-hop] [metric],...\n"
+"\n"
+"Eksik prefix(ön ek) 128 olarak kabul edilir.\n"
+"Eksik next-hop(sonraki atlama) \"::\" olarak kabul edilir.\n"
+"Eksik metric(ölçü) 0 olarak kabul edilir (NM/kernel varsayılan değeri "
+"ayarlar).\n"
+"\n"
+"Örneğin: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 "
+"2001:db8:beef::3 2\n"
+" abbe::/64 55\n"
+
+#: ../clients/cli/settings.c:3715 ../libnm-core/nm-setting-gsm.c:315
+#: ../libnm-util/nm-setting-gsm.c:372
+#, c-format
+msgid "'%s' is not a number"
+msgstr "'%s' bir numara deÄŸil"
+
+#: ../clients/cli/settings.c:3722
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not valid; use 0, 1, or 2"
+msgstr "'%s' geçerli değil; 0,1 ve ya 2 kullanın"
+
+#: ../clients/cli/settings.c:3739
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not a valid channel; use <1-13>"
+msgstr "'%s' geçerli bir kanal değil; <1-13> kullanın"
+
+#: ../clients/cli/settings.c:3776
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not valid; use [e, o, n]"
+msgstr "'%s' geçerli değil: [e, o, n] kullanın"
+
+#: ../clients/cli/settings.c:3804
+msgid ""
+"nmcli can accepts both direct JSON configuration data and a file name "
+"containing the configuration. In the latter case the file is read and the "
+"contents is put into this property.\n"
+"\n"
+"Examples: set team.config { \"device\": \"team0\", \"runner\": {\"name\": "
+"\"roundrobin\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }\n"
+" set team.config /etc/my-team.conf\n"
+msgstr ""
+"nmcli JSON yapılandırma verisi ve yapılandırma içeren bir dosyayı kabul "
+"edebilir. İkinci durumda dosya okunur ve içeriği bu özelliğe konur.\n"
+"\n"
+"Örnekler: set team.config { \"device\": \"team0\", \"runner\": {\"name\": \""
+"roundrobin\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }\n"
+" set team.config /etc/my-team.conf\n"
+
+#: ../clients/cli/settings.c:3844
+msgid "no priority to remove"
+msgstr "silmek için öncelik yok"
+
+#: ../clients/cli/settings.c:3848
+#, c-format
+msgid "index '%d' is not in the range of <0-%d>"
+msgstr "'%d' indeksi <0-%d> aralığı içinde değil"
+
+#: ../clients/cli/settings.c:3887
+#, c-format
+msgid ""
+"Warning: only one mapping at a time is supported; taking the first one (%s)\n"
+msgstr ""
+"Uyarı: aynı anda sadece bir haritalama işlemi destekleniyor; birincisi "
+"seçiliyor (%s)\n"
+
+#: ../clients/cli/settings.c:3894
+#, c-format
+msgid "the property doesn't contain mapping '%s'"
+msgstr "özellik, '%s' haritalamayı içermiyor"
+
+#: ../clients/cli/settings.c:4003 ../clients/cli/settings.c:4171
+#: ../libnm-core/nm-setting-wired.c:604
+#: ../libnm-core/nm-setting-wireless.c:783
+#: ../libnm-core/nm-setting-wireless.c:795
+#: ../libnm-util/nm-setting-wired.c:648
+#: ../libnm-util/nm-setting-wireless.c:840
+#: ../libnm-util/nm-setting-wireless.c:854
+#, c-format
+msgid "'%s' is not a valid MAC address"
+msgstr "'%s' geçerli bir MAC adresi değildir"
+
+#: ../clients/cli/settings.c:4009 ../clients/cli/settings.c:4177
+#, c-format
+msgid "the property doesn't contain MAC address '%s'"
+msgstr "özellik '%s' MAC adresini içermiyor"
+
+#: ../clients/cli/settings.c:4028
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not valid; 3 strings should be provided"
+msgstr "'%s' geçerli değil; 3 karakter dizisi gerekli"
+
+#: ../clients/cli/settings.c:4047
+msgid ""
+"Enter a list of three channels (comma or space separated).\n"
+"\n"
+"Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
+msgstr ""
+"Üç kanalın listesini girin (virgül ya da boşluk ile ayrılmış).\n"
+"\n"
+"Örneğin: 0.0.0e20 0.0.0e21 0.0.0e22\n"
+
+#: ../clients/cli/settings.c:4097
+#, c-format
+msgid ""
+"Enter a list of S/390 options formatted as:\n"
+" option = <value>, option = <value>,...\n"
+"Valid options are: %s\n"
+msgstr ""
+"S/390 seçeneklerinin listesini şu biçimde girin:\n"
+" seçenek = <değer>, seçenek = <değer>,...\n"
+"Geçerli seçenekler: %s\n"
+
+#: ../clients/cli/settings.c:4143
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "'%s' is not a valid channel"
+msgstr "'%s' geçerli bir kanal değil"
+
+#: ../clients/cli/settings.c:4149
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "'%ld' is not a valid channel"
+msgstr "'%ld' geçerli bir kanal değil"
+
+#: ../clients/cli/settings.c:4236 ../clients/cli/settings.c:4274
+#: ../clients/cli/settings.c:4312
+#, c-format
+msgid "the property doesn't contain protocol '%s'"
+msgstr "özellik '%s' protokolünü içermiyor"
+
+#: ../clients/cli/settings.c:4351
+#, c-format
+msgid ""
+"'%s' not compatible with %s '%s', please change the key or set the right %s "
+"first."
+msgstr ""
+"'%s' şunla uyumlu değil %s '%s', lütfen anahtar değişin ya da önce %s "
+"ayarlayın."
+
+#: ../clients/cli/settings.c:4359
+#, c-format
+msgid "WEP key is guessed to be of '%s'\n"
+msgstr "WEP anahtarı '%s' olarak tahmin edildi\n"
+
+#: ../clients/cli/settings.c:4361
+#, c-format
+msgid "WEP key index set to '%d'\n"
+msgstr "WEP key dizini '%d' olarak ayarlandı\n"
+
+#: ../clients/cli/settings.c:4384
+#, c-format
+msgid "'%s' not among [0 (unknown), 1 (key), 2 (passphrase)]"
+msgstr "'%s' ÅŸunlardan biri deÄŸil [0 (bilinmeyen), 1 (anahtar), 2 (parola)]"
+
+#: ../clients/cli/settings.c:4400 ../clients/cli/settings.c:4403
+#: ../clients/cli/settings.c:4406 ../clients/cli/settings.c:4409
+#, c-format
+msgid ""
+"Warning: '%s' is not compatible with '%s' type, please change or delete the "
+"key.\n"
+msgstr ""
+"Uyarı: '%s', '%s' tipi ile uyumlu değil, lütfen anahtarı değiştirin ya da "
+"silin.\n"
+
+#: ../clients/cli/settings.c:4422
+#, c-format
+msgid ""
+"Enter the type of WEP keys. The accepted values are: 0 or unknown, 1 or key, "
+"and 2 or passphrase.\n"
+msgstr ""
+"WEP anahtarları tipinde birşey girin. Kabul edilen değerler: 0 ve ya "
+"bilinmeyen, 1 ve ya anahtar, 2 ve ya parola.\n"
+
+#: ../clients/cli/settings.c:4435
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "'%s' is not a valid PSK"
+msgstr "'%s' geçerli bir PSK değil"
+
+#: ../clients/cli/settings.c:4479
+#, c-format
+#| msgid "'%s' is not a valid UUID"
+msgid "'%s' is not a valid DCB flag"
+msgstr "'%s' geçerli bir DCB bayrağı değil"
+
+#: ../clients/cli/settings.c:4502
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not a DCB app priority"
+msgstr "'%s' bir DCP uygulama önceliği değil"
+
+#: ../clients/cli/settings.c:4528
+msgid "must contain 8 comma-separated numbers"
+msgstr "virgül ile ayrılmış 8 numara bulunmak zorundadır"
+
+#: ../clients/cli/settings.c:4545
+#, c-format
+msgid "'%s' not a number between 0 and %u (inclusive) or %u"
+msgstr "'%s', 0 ile %u (dahil) ya da %u arasında bir sayu değil"
+
+#: ../clients/cli/settings.c:4548
+#, c-format
+msgid "'%s' not a number between 0 and %u (inclusive)"
+msgstr "'%s' 0 ve %u(kendisi dahil) arasında bir sayı değil"
+
+#: ../clients/cli/settings.c:4570
+#, c-format
+msgid ""
+"Warning: changes will have no effect until '%s' includes 1 (enabled)\n"
+"\n"
+msgstr ""
+"Uyarı: değişiklikler '%s' 1 (etkin) içermediği sürece etkili olmayacaktır\n"
+"\n"
+
+#: ../clients/cli/settings.c:4623
+#, c-format
+msgid "bandwidth percentages must total 100%%"
+msgstr "bant genişliği yüzdeleri toplam 100%% olmak zorundadır"
+
+#: ../clients/cli/settings.c:6273
+msgid "don't know how to get the property value"
+msgstr "özellik değerinin nasıl alınacağı bilinmiyor"
+
+#: ../clients/cli/settings.c:6326 ../clients/cli/settings.c:6366
+msgid "the property can't be changed"
+msgstr "özellik değişemedi"
+
+#: ../clients/cli/settings.c:6449
+#| msgid "unavailable"
+msgid "(not available)"
+msgstr "(uygun deÄŸil)"
+
+#: ../clients/cli/settings.c:6474
+msgid "[NM property description]"
+msgstr "[NM özellik açıklaması]"
+
+#: ../clients/cli/settings.c:6479
+msgid "[nmcli specific description]"
+msgstr "[nmcli belirli açıklaması]"
+
+#. ----------------------------------------------------------------------------
+#: ../clients/cli/settings.c:6528
+msgid "<hidden>"
+msgstr "<gizli>"
+
+#: ../clients/cli/utils.c:127
+#, c-format
+#| msgid "Error: '%s' argument is missing."
+msgid "Error: value for '%s' argument is required."
+msgstr "Hata: '%s' değişkeni için değer gerekli."
+
+#: ../clients/cli/utils.c:152
+#, c-format
+msgid "Error: Argument '%s' was expected, but '%s' provided."
+msgstr "Hata: '%s' değeri bekleniyordu, ancak '%s' alındı."
+
+#: ../clients/cli/utils.c:155
+#, c-format
+#| msgid "Error: missing argument for '%s' option."
+msgid "Error: Unexpected argument '%s'"
+msgstr "Hata: Beklenmeyen deÄŸiÅŸken '%s'"
+
+#: ../clients/cli/utils.c:205
+#, c-format
#| msgid "%s: error converting IP4 address 0x%X"
msgid "Error converting IP4 address '0x%X' to text form"
-msgstr "%s: IPv4 adresi dönüştürülürken hata 0x%X"
+msgstr "'0x%X' IP4 adresini metin biçimine çevrilirken hata oluştu"
-#: ../cli/src/utils.c:133
-#, fuzzy, c-format
+#: ../clients/cli/utils.c:233
+#, c-format
#| msgid "%s: error converting IP4 address 0x%X"
msgid "Error converting IP6 address '%s' to text form"
-msgstr "%s: IPv4 adresi dönüştürülürken hata 0x%X"
+msgstr "'%s' IP6 adresini metin biçimine çevirilirken hata oluştu"
+
+#: ../clients/cli/utils.c:410
+#, c-format
+msgid "'%s' is ambiguous (on x off)"
+msgstr "'%s' belirsiz (on x off)"
+
+#: ../clients/cli/utils.c:420
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not valid; use [%s] or [%s]"
+msgstr "'%s' geçerli değil; [%s] ya da [%s] kullanın"
+
+#: ../clients/cli/utils.c:502
+#, c-format
+msgid "'%s' is ambiguous (%s x %s)"
+msgstr "'%s' belirsiz (%s x %s)"
+
+#: ../clients/cli/utils.c:514
+#, c-format
+msgid "missing name, try one of [%s]"
+msgstr "eksik isim, ÅŸunlardan birini deneyin [%s]"
-#: ../cli/src/utils.c:250
+#: ../clients/cli/utils.c:756
#, c-format
msgid "field '%s' has to be alone"
msgstr "'%s' alanı boş olmalı"
-#: ../cli/src/utils.c:253
+#: ../clients/cli/utils.c:759
#, c-format
-msgid "invalid field '%s'"
-msgstr "geçersiz alan '%s'"
+#| msgid "Error: 'dev wifi': %s; allowed fields: %s"
+msgid "invalid field '%s'; allowed fields: %s"
+msgstr "geçersiz alan '%s'; olası alanlar: %s"
-#: ../cli/src/utils.c:272
+#: ../clients/cli/utils.c:816
msgid "Option '--terse' requires specifying '--fields'"
msgstr "'--terse' parametresi özel '--fields' parametresine ihtiyaç duyar"
-#: ../cli/src/utils.c:276
+#: ../clients/cli/utils.c:820
#, c-format
msgid "Option '--terse' requires specific '--fields' option values , not '%s'"
msgstr ""
"'--terse' seçeneği özel '--fields' seçeneği değerlerini gerektirir, '%s' "
"deÄŸil"
-#: ../cli/src/utils.c:486
-#, c-format
-msgid "Error: Couldn't create D-Bus object proxy for org.freedesktop.DBus"
-msgstr "Hata: D-Bus nesnesi proxy için org.freedesktop.DBus oluşturulamadı"
-
-#: ../cli/src/utils.c:494
-#, c-format
-msgid "Error: NameHasOwner request failed: %s"
-msgstr "Hata: NameHasOwner isteği başarısız oldu: %s"
-
-#: ../cli/src/utils.c:539
+#: ../clients/cli/utils.c:1138
#, c-format
msgid ""
"Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --"
@@ -2069,684 +5651,2163 @@ msgstr ""
"Uyarı: nmcli (%s) ve NetworkManager (%s) sürümleri uyuşmuyor. Uyarıyı "
"bastırmak için --nocheck seçeneğini kullanın.\n"
-#: ../cli/src/utils.c:548
+#: ../clients/cli/utils.c:1147
#, c-format
msgid ""
"Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force "
"execution using --nocheck, but the results are unpredictable."
msgstr ""
"Hata: nmcli (%s) ve NetworkManager (%s) sürümleri uyuşmuyor. --nocheck "
-"seçeneğini kullanarak işlemi zorlayabilirsiniz, fakat sonuçlar öngörülemez.\n"
-"."
+"seçeneğini kullanarak işlemi zorlayabilirsiniz, fakat sonuçlar öngörülemez."
+
+#: ../clients/common/nm-polkit-listener.c:215
+msgid "An authentication session is already underway."
+msgstr "Bir kimlik doÄŸrulama oturu zaten var. "
+
+#. TTLS and PEAP are actually much more complicated, but this complication
+#. * is not visible here since we only care about phase2 authentication
+#. * (and don't even care of which one)
+#.
+#: ../clients/common/nm-secret-agent-simple.c:204
+#: ../clients/common/nm-secret-agent-simple.c:295
+#: ../clients/tui/nmt-page-dsl.c:67 ../clients/tui/nmt-page-wifi.c:334
+#| msgid "filename"
+msgid "Username"
+msgstr "Kullanıcı adı"
+
+#: ../clients/common/nm-secret-agent-simple.c:209
+#: ../clients/common/nm-secret-agent-simple.c:246
+#: ../clients/common/nm-secret-agent-simple.c:272
+#: ../clients/common/nm-secret-agent-simple.c:305
+#: ../clients/common/nm-secret-agent-simple.c:374
+#: ../clients/common/nm-secret-agent-simple.c:387
+#: ../clients/common/nm-secret-agent-simple.c:403
+#: ../clients/tui/nmt-page-dsl.c:76 ../clients/tui/nmt-page-wifi.c:279
+#: ../clients/tui/nmt-page-wifi.c:310 ../clients/tui/nmt-page-wifi.c:343
+msgid "Password"
+msgstr "Parola"
+
+#: ../clients/common/nm-secret-agent-simple.c:218
+msgid "Identity"
+msgstr "Kimlik"
+
+#: ../clients/common/nm-secret-agent-simple.c:223
+msgid "Private key password"
+msgstr "Özel anahtar parolası"
+
+#: ../clients/common/nm-secret-agent-simple.c:260
+#: ../clients/tui/nmt-page-wifi.c:291
+msgid "Key"
+msgstr "Anahtar"
+
+#: ../clients/common/nm-secret-agent-simple.c:300
+#: ../clients/tui/nmt-page-dsl.c:79
+msgid "Service"
+msgstr "Servis"
+
+#: ../clients/common/nm-secret-agent-simple.c:334
+msgid "Authentication required by wireless network"
+msgstr "Kablosuz aÄŸ kimlik doÄŸrulama gerektiriyor"
+
+#: ../clients/common/nm-secret-agent-simple.c:335
+#, c-format
+msgid ""
+"Passwords or encryption keys are required to access the wireless network "
+"'%s'."
+msgstr ""
+"'%s' kablosuz ağına bağlanmak için parola veya şifreleme anahtarı gerekiyor."
+
+#: ../clients/common/nm-secret-agent-simple.c:343
+#| msgid "connecting (need authentication)"
+msgid "Wired 802.1X authentication"
+msgstr "Kablolu 802.1X kimlik doğrulaması"
+
+#: ../clients/common/nm-secret-agent-simple.c:346
+#| msgid "Networking enabled"
+msgid "Network name"
+msgstr "Ağ adı"
+
+#: ../clients/common/nm-secret-agent-simple.c:353
+#| msgid "connecting (need authentication)"
+msgid "DSL authentication"
+msgstr "DSL kimlik doğrulaması"
+
+#: ../clients/common/nm-secret-agent-simple.c:361
+#| msgid "not required, "
+msgid "PIN code required"
+msgstr "PIN kodu gerekiyor"
+
+#: ../clients/common/nm-secret-agent-simple.c:362
+#| msgid "Enable or disable mobile broadband devices"
+msgid "PIN code is needed for the mobile broadband device"
+msgstr "Mobil geniş bant aygıtı için PIN kodu gerekli"
+
+#: ../clients/common/nm-secret-agent-simple.c:364
+#| msgid "VPN"
+msgid "PIN"
+msgstr "PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:370
+#: ../clients/common/nm-secret-agent-simple.c:383
+#: ../clients/common/nm-secret-agent-simple.c:399
+msgid "Mobile broadband network password"
+msgstr "Mobil geniş ağ parolası"
+
+#: ../clients/common/nm-secret-agent-simple.c:371
+#: ../clients/common/nm-secret-agent-simple.c:384
+#: ../clients/common/nm-secret-agent-simple.c:400
+#, c-format
+msgid "A password is required to connect to '%s'."
+msgstr "'%s' ağına bağlanmak için parola gerekiyor."
+
+#: ../clients/nm-online.c:96
+#, c-format
+msgid "\rConnecting"
+msgstr "\rBağlanıyor"
+
+#: ../clients/nm-online.c:149
+#| msgid "Time to wait for a connection, in seconds (default is 30)"
+msgid ""
+"Time to wait for a connection, in seconds (without the option, default value "
+"is 30)"
+msgstr ""
+"Bağlantı için bekleme zamanı, saniye cinsinden (seçenek olmadan, varsayılan "
+"30)"
+
+#: ../clients/nm-online.c:150
+msgid "Exit immediately if NetworkManager is not running or connecting"
+msgstr "Eğer Ağ Yöneticisi çalışmıyor ya da bağlanmıyorsa hemen çık"
+
+#: ../clients/nm-online.c:151
+msgid "Don't print anything"
+msgstr "Herhangi bir şey yazdırma"
+
+#: ../clients/nm-online.c:152
+#| msgid "Exit immediately if NetworkManager is not running or connecting"
+msgid "Wait for NetworkManager startup instead of a connection"
+msgstr "Bağlantı yerine NetworkManager başlaması bekleniyor"
+
+#: ../clients/nm-online.c:173
+msgid ""
+"Waits for NetworkManager to finish activating startup network connections."
+msgstr ""
+"NetworkManager 'ın ağ bağlantıları etkinleştirmesinin bitmesi bekleniyor."
+
+#: ../clients/nm-online.c:180 ../clients/nm-online.c:186
+msgid "Invalid option. Please use --help to see a list of valid options."
+msgstr ""
+"Geçersiz seçenek. Lütfen geçerli seçeneklerin listesini görmek için --help "
+"parametresini kullanın."
+
+#: ../clients/tui/newt/nmt-newt-utils.c:180 ../clients/tui/nmt-editor.c:244
+#: ../clients/tui/nmt-password-dialog.c:174
+#: ../clients/tui/nmt-route-editor.c:135 ../clients/tui/nmtui-hostname.c:71
+#: ../clients/tui/nmtui.c:117
+msgid "OK"
+msgstr "Tamam"
-#: ../libnm-util/crypto.c:133
+#: ../clients/tui/newt/nmt-newt-utils.c:328
+#: ../clients/tui/newt/nmt-newt-utils.c:360
+#, c-format
+#| msgid "Could not allocate memory for PEM file data."
+msgid "Could not create temporary file: %s"
+msgstr "Geçici dosya oluşturulamadı: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:368
+#, c-format
+#| msgid "Writing to %s failed: %s\n"
+msgid "Editor failed: %s"
+msgstr "Düzenleyici başarısız: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:376
+#, c-format
+msgid "Editor failed with status %d"
+msgstr "Düzenleyici %d durumu ile sonlandı"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:378
+#, c-format
+msgid "Editor failed with signal %d"
+msgstr "Düzenleyici %d sinyali ile sonlandı"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:382
+#, c-format
+#| msgid "Couldn't decode PKCS#8 file: %s"
+msgid "Could not re-read file: %s"
+msgstr "Dosya yeniden okunamadı: %s"
+
+#: ../clients/tui/nm-editor-utils.c:151
+#, c-format
+#| msgid "Wired connection %d"
+msgid "Ethernet connection %d"
+msgstr "Eternet bağlantısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:159
+#, c-format
+#| msgid "Wired connection %d"
+msgid "Wi-Fi connection %d"
+msgstr "Wi-Fi bağlantısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:168
+#, c-format
+msgid "InfiniBand connection %d"
+msgstr "InfiniBand bağlantısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:173 ../libnm-glib/nm-device.c:1798
+#: ../libnm/nm-device.c:1610
+msgid "Mobile Broadband"
+msgstr "Mobil GeniÅŸ Bant"
+
+#: ../clients/tui/nm-editor-utils.c:176
+#, c-format
+#| msgid "Bond connection %d"
+msgid "Mobile broadband connection %d"
+msgstr "Mobil geniş bant bağlantısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:182 ../clients/tui/nmt-page-dsl.c:39
+#| msgid "DNS"
+msgid "DSL"
+msgstr "DSL"
+
+#: ../clients/tui/nm-editor-utils.c:186
+#, c-format
+#| msgid "ADSL connection %d"
+msgid "DSL connection %d"
+msgstr "DSL bağlantısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:191 ../libnm-core/nm-connection.c:1524
+#: ../libnm-glib/nm-device.c:1802 ../libnm-util/nm-connection.c:1606
+#: ../libnm/nm-device.c:1614 ../src/settings/plugins/ifcfg-rh/reader.c:3975
+msgid "Bond"
+msgstr "BaÄŸ"
+
+#: ../clients/tui/nm-editor-utils.c:195
+#, c-format
+msgid "Bond connection %d"
+msgstr "Bond bağlantısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:200 ../libnm-core/nm-connection.c:1528
+#: ../libnm-glib/nm-device.c:1806 ../libnm-util/nm-connection.c:1610
+#: ../libnm/nm-device.c:1618 ../src/settings/plugins/ifcfg-rh/reader.c:4266
+msgid "Bridge"
+msgstr "Köprü"
+
+#: ../clients/tui/nm-editor-utils.c:205
+#, c-format
+msgid "Bridge connection %d"
+msgstr "Köprü bağlantısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:209 ../libnm-core/nm-connection.c:1526
+#: ../libnm-glib/nm-device.c:1804 ../libnm-util/nm-connection.c:1608
+#: ../libnm/nm-device.c:1616 ../src/settings/plugins/ifcfg-rh/reader.c:4081
+msgid "Team"
+msgstr "Takım"
+
+#: ../clients/tui/nm-editor-utils.c:214
+#, c-format
+#| msgid "Wired connection %d"
+msgid "Team connection %d"
+msgstr "Takım bağlantısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:222
+#, c-format
+msgid "VLAN connection %d"
+msgstr "VLAN bağlatısı %d"
+
+#: ../clients/tui/nm-editor-utils.c:237
+#, c-format
+msgid "VPN connection %d"
+msgstr "VPN bağlantısı %d"
+
+#: ../clients/tui/nmt-device-entry.c:371
+msgid "Select..."
+msgstr "Seç..."
+
+#: ../clients/tui/nmt-edit-connection-list.c:112
+msgid "Add"
+msgstr "Ekle"
+
+#: ../clients/tui/nmt-edit-connection-list.c:115
+#: ../clients/tui/nmt-page-ip4.c:175 ../clients/tui/nmt-page-ip6.c:173
+#: ../clients/tui/nmt-page-team-port.c:110 ../clients/tui/nmt-page-team.c:174
+msgid "Edit..."
+msgstr "Düzenle..."
+
+#: ../clients/tui/nmt-edit-connection-list.c:118
+#: ../clients/tui/nmtui-edit.c:526
+msgid "Delete"
+msgstr "Sil"
+
+#: ../clients/tui/nmt-editor.c:81
+#, c-format
+msgid "Could not create editor for connection '%s' of type '%s'."
+msgstr "'%s' bağlantısı '%s' türünde oluşturulamadı."
+
+#: ../clients/tui/nmt-editor.c:85
+#, c-format
+#| msgid "Could not allocate memory for PEM file creation."
+msgid "Could not create editor for invalid connection '%s'."
+msgstr "Geçersiz bağlantı '%s' için bir düzenleyici oluşturulamadı."
+
+#: ../clients/tui/nmt-editor.c:95
+#| msgid "disconnecting"
+msgid "Edit Connection"
+msgstr "Bağlantıyı Düzenle"
+
+#: ../clients/tui/nmt-editor.c:148
+#, c-format
+#| msgid "unable to join netlink group: %s"
+msgid "Unable to save connection: %s"
+msgstr "Bağlantı kaydedilemedi: %s"
+
+#: ../clients/tui/nmt-editor.c:162
+#, c-format
+#| msgid "Error: Failed to add/activate new connection: (%d) %s"
+msgid "Unable to add new connection: %s"
+msgstr "Yeni bağlantı eklenemedi: %s"
+
+#: ../clients/tui/nmt-editor.c:241 ../clients/tui/nmt-password-dialog.c:171
+#: ../clients/tui/nmt-route-editor.c:128 ../clients/tui/nmtui-edit.c:218
+#: ../clients/tui/nmtui-edit.c:525 ../clients/tui/nmtui-hostname.c:69
+msgid "Cancel"
+msgstr "Ä°ptal"
+
+#: ../clients/tui/nmt-mtu-entry.c:86
+msgid "(default)"
+msgstr "(varsayılan)"
+
+#: ../clients/tui/nmt-mtu-entry.c:88 ../clients/tui/nmt-mtu-entry.c:119
+msgid "bytes"
+msgstr "bayt"
+
+#: ../clients/tui/nmt-page-bond.c:88
+msgid "Round-robin"
+msgstr "Round-robin"
+
+#: ../clients/tui/nmt-page-bond.c:89
+msgid "Active Backup"
+msgstr "Etkin Yedek"
+
+#: ../clients/tui/nmt-page-bond.c:90
+msgid "XOR"
+msgstr "XOR"
+
+#: ../clients/tui/nmt-page-bond.c:91
+msgid "Broadcast"
+msgstr "Çoklu gönderim"
+
+#: ../clients/tui/nmt-page-bond.c:92
+msgid "802.3ad"
+msgstr "802.3ad"
+
+#: ../clients/tui/nmt-page-bond.c:93
+msgid "Adaptive Transmit Load Balancing (tlb)"
+msgstr "Uyarlanabilir İletim Yük Dengelemesi (tlb)"
+
+#: ../clients/tui/nmt-page-bond.c:94
+msgid "Adaptive Load Balancing (alb)"
+msgstr "Uyarlanabilir Yük Dengelemesi (alb)"
+
+#: ../clients/tui/nmt-page-bond.c:100
+msgid "MII (recommended)"
+msgstr "MII (önerilen)"
+
+#: ../clients/tui/nmt-page-bond.c:101
+#| msgid "AP"
+msgid "ARP"
+msgstr "ARP"
+
+#: ../clients/tui/nmt-page-bond.c:357 ../clients/tui/nmt-page-bridge.c:80
+#: ../clients/tui/nmt-page-team.c:153
+msgid "Slaves"
+msgstr "Bağımlılar"
+
+#: ../clients/tui/nmt-page-bond.c:369 ../clients/tui/nmt-page-wifi.c:232
+msgid "Mode"
+msgstr "Kip"
+
+#: ../clients/tui/nmt-page-bond.c:375
+msgid "Primary"
+msgstr "Birincil"
+
+#: ../clients/tui/nmt-page-bond.c:381
+msgid "Link monitoring"
+msgstr "Bağlantı izleme"
+
+#: ../clients/tui/nmt-page-bond.c:387 ../clients/tui/nmt-page-bond.c:394
+#: ../clients/tui/nmt-page-bond.c:401 ../clients/tui/nmt-page-bond.c:408
+msgctxt "milliseconds"
+msgid "ms"
+msgstr "ms"
+
+#: ../clients/tui/nmt-page-bond.c:388 ../clients/tui/nmt-page-bond.c:409
+msgid "Monitoring frequency"
+msgstr "İzleme sıklığı"
+
+#: ../clients/tui/nmt-page-bond.c:395
+msgid "Link up delay"
+msgstr "Giden bağlantı gecikmesi:"
+
+#: ../clients/tui/nmt-page-bond.c:402
+msgid "Link down delay"
+msgstr "Gelen bağlantı gecikmesi"
+
+#: ../clients/tui/nmt-page-bond.c:415
+msgid "ARP targets"
+msgstr "ARP hedefleri"
+
+#: ../clients/tui/nmt-page-bridge-port.c:38
+msgid "BRIDGE PORT"
+msgstr "KÖPRÜ PORTU"
+
+#: ../clients/tui/nmt-page-bridge-port.c:69
+#: ../clients/tui/nmt-page-bridge.c:106
+msgid "Priority"
+msgstr "Öncelik"
+
+#: ../clients/tui/nmt-page-bridge-port.c:75
+msgid "Path cost"
+msgstr "Yol maliyeti"
+
+#: ../clients/tui/nmt-page-bridge-port.c:77
+msgid "Hairpin mode"
+msgstr "Hairpin kipi"
+
+#: ../clients/tui/nmt-page-bridge.c:90 ../clients/tui/nmt-page-bridge.c:115
+#: ../clients/tui/nmt-page-bridge.c:125 ../clients/tui/nmt-page-bridge.c:135
+msgid "seconds"
+msgstr "saniye"
+
+#: ../clients/tui/nmt-page-bridge.c:91
+msgid "Aging time"
+msgstr "Yaşlandırma zamanı"
+
+#: ../clients/tui/nmt-page-bridge.c:93
+msgid "Enable STP (Spanning Tree Protocol)"
+msgstr "STP Etkinleştir (Yayılım Ağacı Protokolü)"
+
+#: ../clients/tui/nmt-page-bridge.c:116
+msgid "Forward delay"
+msgstr "Ä°letme gecikmesi"
+
+#: ../clients/tui/nmt-page-bridge.c:126
+msgid "Hello time"
+msgstr "Merhaba zamanı"
+
+#: ../clients/tui/nmt-page-bridge.c:136
+msgid "Max age"
+msgstr "En fazla yaÅŸ"
+
+#: ../clients/tui/nmt-page-ethernet.c:41
+msgid "ETHERNET"
+msgstr "ETHERNET"
+
+#: ../clients/tui/nmt-page-ethernet.c:80 ../clients/tui/nmt-page-vlan.c:124
+#: ../clients/tui/nmt-page-wifi.c:366
+#| msgid "is not a valid MAC address"
+msgid "Cloned MAC address"
+msgstr "Klonlanmış MAC adresi"
+
+#: ../clients/tui/nmt-page-infiniband.c:40
+msgid "INFINIBAND"
+msgstr "INFINIBAND"
+
+#: ../clients/tui/nmt-page-infiniband.c:51
+msgid "Datagram"
+msgstr "Veri birimi"
+
+#: ../clients/tui/nmt-page-infiniband.c:52
+#| msgid "connected"
+msgid "Connected"
+msgstr "Bağlandı"
+
+#: ../clients/tui/nmt-page-infiniband.c:90
+msgid "Transport mode"
+msgstr "Aktarım kipi"
+
+#: ../clients/tui/nmt-page-ip4.c:41
+#| msgid "disabled"
+msgid "Disabled"
+msgstr "Kapalı"
+
+#: ../clients/tui/nmt-page-ip4.c:42 ../clients/tui/nmt-page-ip6.c:42
+msgid "Automatic"
+msgstr "Otomatik"
+
+#: ../clients/tui/nmt-page-ip4.c:43 ../clients/tui/nmt-page-ip6.c:44
+msgid "Link-Local"
+msgstr "Yerel Bağlantı"
+
+#: ../clients/tui/nmt-page-ip4.c:44 ../clients/tui/nmt-page-ip6.c:45
+msgid "Manual"
+msgstr "Elle"
+
+#: ../clients/tui/nmt-page-ip4.c:45
+msgid "Shared"
+msgstr "Paylaşılmış"
+
+#: ../clients/tui/nmt-page-ip4.c:54
+msgid "IPv4 CONFIGURATION"
+msgstr "IPv4 YAPILANDIRMASI"
+
+#: ../clients/tui/nmt-page-ip4.c:100 ../clients/tui/nmt-page-ip6.c:100
+msgid "(No custom routes)"
+msgstr "(Özel bir yönlendirme yok)"
+
+#: ../clients/tui/nmt-page-ip4.c:103 ../clients/tui/nmt-page-ip6.c:103
+#, fuzzy, c-format
+msgid "One custom route"
+msgid_plural "%d custom routes"
+msgstr[0] "Bir özel yönlendirme"
+msgstr[1] "%d özel yönlendirme"
+
+#: ../clients/tui/nmt-page-ip4.c:144 ../clients/tui/nmt-page-ip6.c:144
+msgid "Addresses"
+msgstr "Adresler"
+
+#: ../clients/tui/nmt-page-ip4.c:150 ../clients/tui/nmt-page-ip6.c:150
+msgid "Gateway"
+msgstr "Geçit"
+
+#: ../clients/tui/nmt-page-ip4.c:156 ../clients/tui/nmt-page-ip6.c:156
+msgid "DNS servers"
+msgstr "DNS sunucuları"
+
+#: ../clients/tui/nmt-page-ip4.c:162 ../clients/tui/nmt-page-ip6.c:162
+msgid "Search domains"
+msgstr "Alan adlarını ara"
+
+#: ../clients/tui/nmt-page-ip4.c:177 ../clients/tui/nmt-page-ip6.c:175
+msgid "Routing"
+msgstr "Yönlendirme"
+
+#: ../clients/tui/nmt-page-ip4.c:179 ../clients/tui/nmt-page-ip6.c:177
+msgid "Never use this network for default route"
+msgstr "Bu ağı varsayılan yönlendirme olarak asla kullanma"
+
+#: ../clients/tui/nmt-page-ip4.c:187
+msgid "Require IPv4 addressing for this connection"
+msgstr "Bu bağlantı için IPv4 adresleme gerekir"
+
+#: ../clients/tui/nmt-page-ip6.c:41
+msgid "Ignore"
+msgstr "Yoksay"
+
+#: ../clients/tui/nmt-page-ip6.c:43
+msgid "Automatic (DHCP-only)"
+msgstr "Otomatik (sadece DHCP)"
+
+#: ../clients/tui/nmt-page-ip6.c:54
+msgid "IPv6 CONFIGURATION"
+msgstr "IPv6 YAPILANDIRMASI"
+
+#: ../clients/tui/nmt-page-ip6.c:185
+msgid "Require IPv6 addressing for this connection"
+msgstr "Bu bağlantı IPv6 adreslemesi gerektiriyor"
+
+#: ../clients/tui/nmt-page-main.c:139
+msgid "Hide"
+msgstr "Gizle"
+
+#: ../clients/tui/nmt-page-main.c:139
+msgid "Show"
+msgstr "Göster"
+
+#: ../clients/tui/nmt-page-main.c:188
+#| msgid "filename"
+msgid "Profile name"
+msgstr "Profil adı"
+
+#: ../clients/tui/nmt-page-main.c:199
+msgid "Ethernet device"
+msgstr "Ethernet aygıtı"
+
+#: ../clients/tui/nmt-page-main.c:201
+#| msgid "Device details"
+msgid "Device"
+msgstr "Aygıt"
+
+#: ../clients/tui/nmt-page-main.c:252
+msgid "Automatically connect"
+msgstr "Otomatik baÄŸlan"
+
+#: ../clients/tui/nmt-page-main.c:258
+msgid "Available to all users"
+msgstr "Tüm kullanıcılar kullanabilir"
+
+#: ../clients/tui/nmt-page-ppp.c:49
+msgid "PPP CONFIGURATION"
+msgstr "PPP YAPILANDIRMASI"
+
+#: ../clients/tui/nmt-page-ppp.c:142
+msgid "Allowed authentication methods:"
+msgstr "İzin verilen kimlik doğrulama yöntemleri:"
+
+#: ../clients/tui/nmt-page-ppp.c:149
+#| msgid "AP"
+msgid "EAP"
+msgstr "EAP"
+
+#: ../clients/tui/nmt-page-ppp.c:157
+#| msgid "AP"
+msgid "PAP"
+msgstr "PAP"
+
+#: ../clients/tui/nmt-page-ppp.c:165
+msgid "CHAP"
+msgstr "CHAP"
+
+#: ../clients/tui/nmt-page-ppp.c:173
+msgid "MSCHAPv2"
+msgstr "MSCHAPv2"
+
+#: ../clients/tui/nmt-page-ppp.c:181
+msgid "MSCHAP"
+msgstr "MSCHAP"
+
+#: ../clients/tui/nmt-page-ppp.c:197
+msgid "Use point-to-point encryption (MPPE)"
+msgstr "Uçtan uca şifreleme kullan (MPPE)"
+
+#: ../clients/tui/nmt-page-ppp.c:209
+msgid "Require 128-bit encryption"
+msgstr "128-bit ÅŸifreleme gerektiriyor"
+
+#: ../clients/tui/nmt-page-ppp.c:219
+msgid "Use stateful MPPE"
+msgstr "Durumlu MPPE kullan"
+
+#: ../clients/tui/nmt-page-ppp.c:231
+msgid "Allow BSD data compression"
+msgstr "BSD veri sıkıştırmasına izin ver"
+
+#: ../clients/tui/nmt-page-ppp.c:239
+msgid "Allow Deflate data compression"
+msgstr "Deflate veri sıkıştırmasına izin ver"
+
+#: ../clients/tui/nmt-page-ppp.c:247
+msgid "Use TCP header compression"
+msgstr "TCP başlık sıkıştırması kullan"
+
+#: ../clients/tui/nmt-page-ppp.c:257
+msgid "Send PPP echo packets"
+msgstr "PPP yankı paketleri gönder"
+
+#: ../clients/tui/nmt-page-team-port.c:45
+msgid "TEAM PORT"
+msgstr "TAKIM PORTU"
+
+#: ../clients/tui/nmt-page-team-port.c:100 ../clients/tui/nmt-page-team.c:164
+msgid "JSON configuration"
+msgstr "JSON yapılandırması"
+
+#: ../clients/tui/nmt-page-vlan.c:101
+msgid "Parent"
+msgstr "Ãœst"
+
+#: ../clients/tui/nmt-page-vlan.c:116
+#| msgid "VLAN"
+msgid "VLAN id"
+msgstr "VLAN kimliÄŸi"
+
+#: ../clients/tui/nmt-page-wifi.c:57
+msgid "WI-FI"
+msgstr "Kablosuz"
+
+#: ../clients/tui/nmt-page-wifi.c:68
+msgctxt "Wi-Fi"
+msgid "Client"
+msgstr "Ä°stemci"
+
+#: ../clients/tui/nmt-page-wifi.c:69
+msgid "Access Point"
+msgstr "Erişim Noktası"
+
+#: ../clients/tui/nmt-page-wifi.c:70
+#| msgid "Ad-Hoc"
+msgid "Ad-Hoc Network"
+msgstr "Ad-Hoc AÄŸ"
+
+#: ../clients/tui/nmt-page-wifi.c:75
+msgctxt "Wi-Fi"
+msgid "Automatic"
+msgstr "Otomatik"
+
+#. 802.11a Wi-Fi network
+#: ../clients/tui/nmt-page-wifi.c:77
+msgid "A (5 GHz)"
+msgstr "A (5 GHz)"
+
+#. 802.11b / 802.11g Wi-Fi network
+#: ../clients/tui/nmt-page-wifi.c:79
+msgid "B/G (2.4 GHz)"
+msgstr "B/G (2.4 GHz)"
+
+#: ../clients/tui/nmt-page-wifi.c:84
+msgctxt "Wi-Fi security"
+msgid "None"
+msgstr "Hiçbiri"
+
+#: ../clients/tui/nmt-page-wifi.c:85
+msgid "WPA & WPA2 Personal"
+msgstr "WPA & WPA2 KiÅŸisel"
+
+#: ../clients/tui/nmt-page-wifi.c:86
+#| msgid "Enterprise "
+msgid "WPA & WPA2 Enterprise"
+msgstr "WPA & WPA2 Kurumsal"
+
+#: ../clients/tui/nmt-page-wifi.c:87
+msgid "WEP 40/128-bit Key (Hex or ASCII)"
+msgstr "WEP 40/128-bit Anahtar (Hex veya ASCII)"
+
+#: ../clients/tui/nmt-page-wifi.c:88
+#| msgid "%d (104/128-bit passphrase)"
+msgid "WEP 128-bit Passphrase"
+msgstr "WEP 128-bit Parola"
+
+#: ../clients/tui/nmt-page-wifi.c:89
+msgid "Dynamic WEP (802.1x)"
+msgstr "Dinamik WEP (802.1x)"
+
+#: ../clients/tui/nmt-page-wifi.c:90
+msgid "LEAP"
+msgstr "LEAP"
+
+#: ../clients/tui/nmt-page-wifi.c:95
+msgctxt "WEP key index"
+msgid "1 (Default)"
+msgstr "1 (Varsayılan)"
+
+#: ../clients/tui/nmt-page-wifi.c:96
+msgctxt "WEP key index"
+msgid "2"
+msgstr "2"
+
+#: ../clients/tui/nmt-page-wifi.c:97
+msgctxt "WEP key index"
+msgid "3"
+msgstr "3"
+
+#: ../clients/tui/nmt-page-wifi.c:98
+msgctxt "WEP key index"
+msgid "4"
+msgstr "4"
+
+#: ../clients/tui/nmt-page-wifi.c:103
+#| msgid "System"
+msgid "Open System"
+msgstr "Açık Sistem"
+
+#: ../clients/tui/nmt-page-wifi.c:104
+msgid "Shared Key"
+msgstr "Paylaşılan Anahtar"
+
+#: ../clients/tui/nmt-page-wifi.c:258
+msgid "Channel"
+msgstr "Kanal"
+
+#: ../clients/tui/nmt-page-wifi.c:263
+msgid "Security"
+msgstr "Güvenlik"
+
+#. "wpa-enterprise"
+#. FIXME
+#: ../clients/tui/nmt-page-wifi.c:284
+msgid "(No support for wpa-enterprise yet...)"
+msgstr "(Henüz wpa-enterprise desteği yok...)"
+
+#: ../clients/tui/nmt-page-wifi.c:294 ../clients/tui/nmt-page-wifi.c:313
+#| msgid "WEP "
+msgid "WEP index"
+msgstr "WEP indeks"
+
+#: ../clients/tui/nmt-page-wifi.c:302 ../clients/tui/nmt-page-wifi.c:321
+msgid "Authentication"
+msgstr "Kimlik doÄŸrulama"
+
+#. "dynamic-wep"
+#. FIXME
+#: ../clients/tui/nmt-page-wifi.c:327
+msgid "(No support for dynamic-wep yet...)"
+msgstr "(Henüz dynamic-wep için destek yok...)"
+
+#: ../clients/tui/nmt-password-fields.c:130
+msgid "Ask for this password every time"
+msgstr "Bu parolayı her zaman sor"
+
+#: ../clients/tui/nmt-password-fields.c:131
+msgid "Show password"
+msgstr "Parolayı göster"
+
+#: ../clients/tui/nmt-route-table.c:219
+msgid "Destination"
+msgstr "Hedef"
+
+#: ../clients/tui/nmt-route-table.c:219
+msgid "Prefix"
+msgstr "Ön ek"
+
+#: ../clients/tui/nmt-route-table.c:228
+msgid "Next Hop"
+msgstr "Sonraki Atlama"
+
+#: ../clients/tui/nmt-route-table.c:236
+msgid "Metric"
+msgstr "Ölçü"
+
+#: ../clients/tui/nmt-route-table.c:256
+msgid "No custom routes are defined."
+msgstr "Tanımlanmış bir özel yönlendirme yok."
+
+#: ../clients/tui/nmt-slave-list.c:137
+msgid "Select the type of slave connection you wish to add."
+msgstr "Eklemek istediğiniz ikincil bağlantının türünü seçin."
+
+#: ../clients/tui/nmt-widget-list.c:141
+msgid "Add..."
+msgstr "Ekle..."
+
+#: ../clients/tui/nmt-widget-list.c:204
+msgid "Remove"
+msgstr "Sil"
+
+#: ../clients/tui/nmtui-connect.c:90
+#| msgid "connection failed"
+msgid "Activation failed"
+msgstr "Etkinleştirme başarısız"
+
+#: ../clients/tui/nmtui-connect.c:145
+#| msgid "\rConnecting"
+msgid "Connecting..."
+msgstr "Bağlanıyor..."
+
+#: ../clients/tui/nmtui-connect.c:174 ../clients/tui/nmtui-connect.c:197
+#, c-format
+#| msgid "no active connection on device '%s'"
+msgid "Could not activate connection: %s"
+msgstr "Bağlantı etkinleştirilemedi: %s"
+
+#: ../clients/tui/nmtui-connect.c:257 ../clients/tui/nmtui-connect.c:306
+#| msgid "activated"
+msgid "Activate"
+msgstr "EtkinleÅŸtir"
+
+#: ../clients/tui/nmtui-connect.c:259
+#| msgid "deactivated"
+msgid "Deactivate"
+msgstr "Devre Dışı Bırak"
+
+#: ../clients/tui/nmtui-connect.c:311 ../clients/tui/nmtui-edit.c:121
+#: ../clients/tui/nmtui.c:111
+msgid "Quit"
+msgstr "Çık"
+
+#: ../clients/tui/nmtui-connect.c:334
+#, c-format
+#| msgid "PAN connection %d"
+msgid "No such connection '%s'"
+msgstr "'%s' gibi bir bağlantı yok"
+
+#: ../clients/tui/nmtui-connect.c:336
+#| msgid "Connection activated\n"
+msgid "Connection is already active"
+msgstr "Bağlantı zaten etkin"
+
+#: ../clients/tui/nmtui-edit.c:226
+msgid "Create"
+msgstr "OluÅŸtur"
+
+#: ../clients/tui/nmtui-edit.c:368
+msgid "Select the type of connection you wish to create."
+msgstr "Oluşturmak istediğiniz bağlantı tipini seçin."
+
+#: ../clients/tui/nmtui-edit.c:376
+msgid ""
+"If you are creating a VPN, and the VPN connection you wish to create does "
+"not appear in the list, you may not have the correct VPN plugin installed."
+msgstr ""
+"Bir VPN oluşturuyorsanız, ve VPN bağlantısı listede gözükmüyor ise, doğru "
+"VPN eklentisini kuramamış olabilirsiniz."
+
+#: ../clients/tui/nmtui-edit.c:412 ../clients/tui/nmtui-edit.c:428
+#| msgid "\rConnecting"
+msgid "New Connection"
+msgstr "Yeni Bağlantı"
+
+#: ../clients/tui/nmtui-edit.c:467
+#, c-format
+#| msgid "unable to join netlink group: %s"
+msgid "Unable to delete connection: %s"
+msgstr "Bağlantı silinemedi: %s"
+
+#: ../clients/tui/nmtui-edit.c:506
+#, c-format
+#| msgid "no device found for connection '%s'"
+msgid "Could not delete connection '%s': %s"
+msgstr "'%s' bağlantısı silinemedi: %s"
+
+#: ../clients/tui/nmtui-edit.c:527
+#, c-format
+msgid "Are you sure you want to delete the connection '%s'?"
+msgstr "'%s' bağlantısını silmek istediğinize emin misiniz?"
+
+#: ../clients/tui/nmtui-hostname.c:47
+msgid "Set Hostname"
+msgstr "Makine Adını Ayarla"
+
+#: ../clients/tui/nmtui-hostname.c:55
+msgid "Hostname"
+msgstr "Makine Adı"
+
+#. Translators: this indicates the result. ie, "I have set the hostname to ..."
+#: ../clients/tui/nmtui-hostname.c:118
+#, c-format
+msgid "Set hostname to '%s'"
+msgstr "Makine adını '%s' olarak ayarla"
+
+#: ../clients/tui/nmtui-hostname.c:120
+#, c-format
+#| msgid "Failed to set signal mask: %d"
+msgid "Unable to set hostname: %s"
+msgstr "Makine adı ayarlanamadı: %s"
+
+#: ../clients/tui/nmtui.c:56 ../clients/tui/nmtui.c:59
+#| msgid "connecting"
+msgid "connection"
+msgstr "bağlantı"
+
+#: ../clients/tui/nmtui.c:57
+#| msgid "disconnecting"
+msgid "Edit a connection"
+msgstr "Bir bağlantıyı düzenle"
+
+#: ../clients/tui/nmtui.c:60
+#| msgid "Active connections"
+msgid "Activate a connection"
+msgstr "Bir bağlantıyı etkinleştir"
+
+#: ../clients/tui/nmtui.c:62
+msgid "new hostname"
+msgstr "yeni makine adı"
+
+#: ../clients/tui/nmtui.c:63
+#| msgid "Modify persistent system hostname"
+msgid "Set system hostname"
+msgstr "Sistem makine adını ayarla"
+
+#: ../clients/tui/nmtui.c:86
+#| msgid "NetworkManager status"
+msgid "NetworkManager TUI"
+msgstr "NetworkManager TUI"
+
+#: ../clients/tui/nmtui.c:94
+msgid "Please select an option"
+msgstr "Lütfen bir seçenek seçin"
+
+#: ../clients/tui/nmtui.c:146
+msgid "Usage"
+msgstr "Kullanım"
+
+#: ../clients/tui/nmtui.c:227
+msgid "Could not parse arguments"
+msgstr "Değişkenler ayrıştırılamadı"
+
+#: ../clients/tui/nmtui.c:237
+#, c-format
+#| msgid "You must be root to run NetworkManager!\n"
+msgid "Could not contact NetworkManager: %s.\n"
+msgstr "NetworkManager ile bağlantı kurulamadı: %s.\n"
+
+#: ../clients/tui/nmtui.c:242
+#| msgid "Error: NetworkManager is not running."
+msgid "NetworkManager is not running."
+msgstr "NetworkManager çalışmıyor."
+
+#: ../libnm-core/crypto.c:120 ../libnm-util/crypto.c:133
#, c-format
msgid "PEM key file had no end tag '%s'."
msgstr "PEM anahtar dosyası '%s' son etiketine sahip değil."
-#: ../libnm-util/crypto.c:146
+#: ../libnm-core/crypto.c:133 ../libnm-util/crypto.c:146
#, c-format
msgid "Doesn't look like a PEM private key file."
msgstr "Bir PEM özel anahtar dosyasına benzemiyor."
-#: ../libnm-util/crypto.c:163
+#: ../libnm-core/crypto.c:150 ../libnm-util/crypto.c:163
#, c-format
msgid "Malformed PEM file: Proc-Type was not first tag."
msgstr "Bozuk PEM dosyası: Proc-Type ilk etiket değildi."
-#: ../libnm-util/crypto.c:171
+#: ../libnm-core/crypto.c:158 ../libnm-util/crypto.c:171
#, c-format
msgid "Malformed PEM file: unknown Proc-Type tag '%s'."
msgstr "Bozuk PEM dosyası: bilinmeyen Proc-Type etiketi '%s'."
-#: ../libnm-util/crypto.c:181
+#: ../libnm-core/crypto.c:168 ../libnm-util/crypto.c:181
#, c-format
msgid "Malformed PEM file: DEK-Info was not the second tag."
msgstr "Bozuk PEM dosyası: DEK-Info ikinci etiket değildi."
-#: ../libnm-util/crypto.c:192
+#: ../libnm-core/crypto.c:179 ../libnm-util/crypto.c:192
#, c-format
msgid "Malformed PEM file: no IV found in DEK-Info tag."
msgstr "Bozuk PEM dosyası: DEK-Info etiketinde IV mevcut değil."
-#: ../libnm-util/crypto.c:199
+#: ../libnm-core/crypto.c:186 ../libnm-util/crypto.c:199
#, c-format
msgid "Malformed PEM file: invalid format of IV in DEK-Info tag."
msgstr "Bozuk PEM dosyası: DEK-Info etiketi içerisinde IV'ün geçersiz biçimi."
-#: ../libnm-util/crypto.c:212
+#: ../libnm-core/crypto.c:201 ../libnm-util/crypto.c:214
#, c-format
msgid "Malformed PEM file: unknown private key cipher '%s'."
msgstr "Bozuk PEM dosyası: bilinmeyen özel anahtar şifresi '%s'."
-#: ../libnm-util/crypto.c:231
+#: ../libnm-core/crypto.c:220 ../libnm-util/crypto.c:233
#, c-format
msgid "Could not decode private key."
msgstr "Özel anahtar çözülemedi."
-#: ../libnm-util/crypto.c:283
+#: ../libnm-core/crypto.c:273 ../libnm-util/crypto.c:285
msgid "Failed to find expected PKCS#8 start tag."
msgstr "Beklenen PKCS#8 başlama etiketi bulunamadı."
-#: ../libnm-util/crypto.c:291
+#: ../libnm-core/crypto.c:281 ../libnm-util/crypto.c:293
#, c-format
msgid "Failed to find expected PKCS#8 end tag '%s'."
msgstr "Beklenen PKCS#8 bitiş etiketi '%s' bulunamadı."
-#: ../libnm-util/crypto.c:310
+#: ../libnm-core/crypto.c:300 ../libnm-util/crypto.c:312
msgid "Failed to decode PKCS#8 private key."
msgstr "PKCS#8 özel anahtarının şifresi çözülemedi."
-#: ../libnm-util/crypto.c:352
+#: ../libnm-core/crypto.c:342 ../libnm-util/crypto.c:354
#, c-format
msgid "IV must be an even number of bytes in length."
msgstr "IV, uzunluk olarak bayt cinsinden bir çift sayı olmalıdır."
-#: ../libnm-util/crypto.c:366
+#: ../libnm-core/crypto.c:356 ../libnm-util/crypto.c:368
#, c-format
msgid "IV contains non-hexadecimal digits."
msgstr "IV, onaltılık olmayan sayılar barınırıyor."
-#: ../libnm-util/crypto.c:404 ../libnm-util/crypto_gnutls.c:147
-#: ../libnm-util/crypto_gnutls.c:259 ../libnm-util/crypto_nss.c:167
-#: ../libnm-util/crypto_nss.c:326
+#: ../libnm-core/crypto.c:396 ../libnm-core/crypto_gnutls.c:151
+#: ../libnm-core/crypto_gnutls.c:269 ../libnm-core/crypto_nss.c:172
+#: ../libnm-core/crypto_nss.c:334 ../libnm-util/crypto.c:408
+#: ../libnm-util/crypto_gnutls.c:150 ../libnm-util/crypto_gnutls.c:267
+#: ../libnm-util/crypto_nss.c:170 ../libnm-util/crypto_nss.c:331
#, c-format
msgid "Private key cipher '%s' was unknown."
msgstr "'%s' özel anahtar şifresi bilinmiyor."
-#: ../libnm-util/crypto.c:511
+#: ../libnm-core/crypto.c:508 ../libnm-util/crypto.c:518
#, c-format
msgid "Unable to determine private key type."
msgstr "Özel anahtar türü belirlenemedi."
-#: ../libnm-util/crypto.c:566
+#: ../libnm-core/crypto.c:565 ../libnm-util/crypto.c:573
#, c-format
msgid "PEM certificate had no start tag '%s'."
msgstr "PEM sertifikasının başlama etiketi '%s' yok."
-#: ../libnm-util/crypto.c:575
+#: ../libnm-core/crypto.c:574 ../libnm-util/crypto.c:582
#, c-format
msgid "PEM certificate had no end tag '%s'."
msgstr "PEM sertifikasının bitiş etiketi '%s' yok."
-#: ../libnm-util/crypto.c:593
+#: ../libnm-core/crypto.c:592 ../libnm-util/crypto.c:600
#, c-format
msgid "Failed to decode certificate."
msgstr "Sertifika çözülemedi."
-#: ../libnm-util/crypto_gnutls.c:50
+#: ../libnm-core/crypto_gnutls.c:50 ../libnm-util/crypto_gnutls.c:50
msgid "Failed to initialize the crypto engine."
msgstr "Kripto cihazını sıfırlama başarısız."
-#: ../libnm-util/crypto_gnutls.c:92
+#: ../libnm-core/crypto_gnutls.c:92 ../libnm-util/crypto_gnutls.c:92
#, c-format
msgid "Failed to initialize the MD5 engine: %s / %s."
msgstr "MD5 cihazını başlatma başarısız oldu: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:155
+#: ../libnm-core/crypto_gnutls.c:159 ../libnm-util/crypto_gnutls.c:158
#, c-format
msgid "Invalid IV length (must be at least %zd)."
msgstr "Geçersiz IV uzunluğu (en az %zd olmalı)."
-#: ../libnm-util/crypto_gnutls.c:166
+#: ../libnm-core/crypto_gnutls.c:170 ../libnm-util/crypto_gnutls.c:169
#, c-format
msgid "Failed to initialize the decryption cipher context: %s / %s."
msgstr "Şifre çözümleme içeriğini başlatma başarısız oldu: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:175
+#: ../libnm-core/crypto_gnutls.c:179 ../libnm-util/crypto_gnutls.c:178
#, c-format
msgid "Failed to set symmetric key for decryption: %s / %s."
msgstr ""
"Şifre çözümleme işlemi için simetrik anahtar oluşturma başarısız oldu: %s / "
"%s."
-#: ../libnm-util/crypto_gnutls.c:184
+#: ../libnm-core/crypto_gnutls.c:188 ../libnm-util/crypto_gnutls.c:187
#, c-format
msgid "Failed to set IV for decryption: %s / %s."
msgstr "Şifre çözümleme için IV ayarlama hatası: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:193
+#: ../libnm-core/crypto_gnutls.c:197 ../libnm-util/crypto_gnutls.c:196
#, c-format
msgid "Failed to decrypt the private key: %s / %s."
msgstr "Özel anahtarın şifresini çözme başarısız oldu: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:203 ../libnm-util/crypto_nss.c:257
+#: ../libnm-core/crypto_gnutls.c:207 ../libnm-core/crypto_nss.c:262
+#: ../libnm-util/crypto_gnutls.c:206 ../libnm-util/crypto_nss.c:260
#, c-format
msgid "Failed to decrypt the private key: unexpected padding length."
msgstr ""
"Özel anahtarın şifresini çözme başarısız oldu: beklenmeyen dolgu uzunluğu."
-#: ../libnm-util/crypto_gnutls.c:214 ../libnm-util/crypto_nss.c:268
+#: ../libnm-core/crypto_gnutls.c:218 ../libnm-core/crypto_nss.c:273
+#: ../libnm-util/crypto_gnutls.c:217 ../libnm-util/crypto_nss.c:271
#, c-format
msgid "Failed to decrypt the private key."
msgstr "Özel anahtarın şifresini çözme başarısız oldu."
-#: ../libnm-util/crypto_gnutls.c:281
+#: ../libnm-core/crypto_gnutls.c:291 ../libnm-util/crypto_gnutls.c:289
#, c-format
msgid "Failed to initialize the encryption cipher context: %s / %s."
msgstr "Şifreleme anahtarı içerik sıfırlama hatası: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:290
+#: ../libnm-core/crypto_gnutls.c:300 ../libnm-util/crypto_gnutls.c:298
#, c-format
msgid "Failed to set symmetric key for encryption: %s / %s."
msgstr "Şifreleme için simetrik anahtar ayarlama hatası: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:300
+#: ../libnm-core/crypto_gnutls.c:310 ../libnm-util/crypto_gnutls.c:308
#, c-format
msgid "Failed to set IV for encryption: %s / %s."
msgstr "Şifreleme için IV ayarlama hatası: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:309
+#: ../libnm-core/crypto_gnutls.c:319 ../libnm-util/crypto_gnutls.c:317
#, c-format
msgid "Failed to encrypt the data: %s / %s."
msgstr "Veri şifreleme başarısız: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:349
+#: ../libnm-core/crypto_gnutls.c:359 ../libnm-util/crypto_gnutls.c:357
#, c-format
msgid "Error initializing certificate data: %s"
msgstr "Sertifika verisi başlatma hatası: %s"
-#: ../libnm-util/crypto_gnutls.c:371
+#: ../libnm-core/crypto_gnutls.c:381 ../libnm-util/crypto_gnutls.c:379
#, c-format
msgid "Couldn't decode certificate: %s"
msgstr "Sertifika çözülemedi: %s"
-#: ../libnm-util/crypto_gnutls.c:395
+#: ../libnm-core/crypto_gnutls.c:406 ../libnm-util/crypto_gnutls.c:403
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %s"
msgstr "PKCS#12 şifre çözücü sıfırlanamadı: %s"
-#: ../libnm-util/crypto_gnutls.c:408
+#: ../libnm-core/crypto_gnutls.c:419 ../libnm-util/crypto_gnutls.c:416
#, c-format
msgid "Couldn't decode PKCS#12 file: %s"
msgstr "PKCS#12 dosya şifresi çözülemedi: %s"
-#: ../libnm-util/crypto_gnutls.c:420
+#: ../libnm-core/crypto_gnutls.c:431 ../libnm-util/crypto_gnutls.c:428
#, c-format
msgid "Couldn't verify PKCS#12 file: %s"
msgstr "PKCS#12 dosyası doğrulanamadı: %s"
-#: ../libnm-util/crypto_gnutls.c:448
+#: ../libnm-core/crypto_gnutls.c:460 ../libnm-util/crypto_gnutls.c:456
#, c-format
msgid "Couldn't initialize PKCS#8 decoder: %s"
msgstr "PKCS#8 şifre çözücü ilklendirilemedi: %s"
-#: ../libnm-util/crypto_gnutls.c:471
+#: ../libnm-core/crypto_gnutls.c:483 ../libnm-util/crypto_gnutls.c:479
#, c-format
msgid "Couldn't decode PKCS#8 file: %s"
msgstr "PKCS#8 dosya şifresi çözülemedi: %s"
-#: ../libnm-util/crypto_nss.c:56
+#: ../libnm-core/crypto_nss.c:57 ../libnm-util/crypto_nss.c:56
#, c-format
msgid "Failed to initialize the crypto engine: %d."
msgstr "Kripto motoru başlatılamadı: %d."
-#: ../libnm-util/crypto_nss.c:107
+#: ../libnm-core/crypto_nss.c:108 ../libnm-util/crypto_nss.c:107
#, c-format
msgid "Failed to initialize the MD5 context: %d."
msgstr "MD5 içeriği sıfırlama başarısız: %d."
-#: ../libnm-util/crypto_nss.c:175
+#: ../libnm-core/crypto_nss.c:180 ../libnm-util/crypto_nss.c:178
#, c-format
msgid "Invalid IV length (must be at least %d)."
msgstr "Geçersiz IV uzunluğu (en azından %d olmalı)."
-#: ../libnm-util/crypto_nss.c:186
+#: ../libnm-core/crypto_nss.c:191 ../libnm-util/crypto_nss.c:189
#, c-format
msgid "Failed to initialize the decryption cipher slot."
msgstr "Şifre çözücü anahtar yuvası sıfırlama hatası."
-#: ../libnm-util/crypto_nss.c:196
+#: ../libnm-core/crypto_nss.c:201 ../libnm-util/crypto_nss.c:199
#, c-format
msgid "Failed to set symmetric key for decryption."
msgstr "Şifre çözümlemesi için simetrik anahtar ayarlama başarısız."
-#: ../libnm-util/crypto_nss.c:206
+#: ../libnm-core/crypto_nss.c:211 ../libnm-util/crypto_nss.c:209
#, c-format
msgid "Failed to set IV for decryption."
msgstr "Şifre çözümlemesi için IV ayarlama başarısız."
-#: ../libnm-util/crypto_nss.c:214
+#: ../libnm-core/crypto_nss.c:219 ../libnm-util/crypto_nss.c:217
#, c-format
msgid "Failed to initialize the decryption context."
msgstr "Şifre çözüm içeriği sıfırlanması başarısız."
-#: ../libnm-util/crypto_nss.c:227
+#: ../libnm-core/crypto_nss.c:232 ../libnm-util/crypto_nss.c:230
#, c-format
msgid "Failed to decrypt the private key: %d."
msgstr "Özel anahtar şifre çözme hatası: %d."
-#: ../libnm-util/crypto_nss.c:235
+#: ../libnm-core/crypto_nss.c:240 ../libnm-util/crypto_nss.c:238
#, c-format
msgid "Failed to decrypt the private key: decrypted data too large."
msgstr "Özel anahtar şifre çözme hatası: şifresi çözülen veri çok uzun."
-#: ../libnm-util/crypto_nss.c:246
+#: ../libnm-core/crypto_nss.c:251 ../libnm-util/crypto_nss.c:249
#, c-format
msgid "Failed to finalize decryption of the private key: %d."
msgstr "Özel anahtar şifre çözümleme bitirme hatası: %d."
-#: ../libnm-util/crypto_nss.c:348
+#: ../libnm-core/crypto_nss.c:356 ../libnm-util/crypto_nss.c:353
#, c-format
msgid "Failed to initialize the encryption cipher slot."
msgstr "Şifreleme anahtar yuvası sıfırlama hatası."
-#: ../libnm-util/crypto_nss.c:356
+#: ../libnm-core/crypto_nss.c:364 ../libnm-util/crypto_nss.c:361
#, c-format
msgid "Failed to set symmetric key for encryption."
msgstr "Şifreleme için simetrik anahtar ayarlama hatası."
-#: ../libnm-util/crypto_nss.c:364
+#: ../libnm-core/crypto_nss.c:372 ../libnm-util/crypto_nss.c:369
#, c-format
msgid "Failed to set IV for encryption."
msgstr "Şifreleme için IV ayarlama hatası."
-#: ../libnm-util/crypto_nss.c:372
+#: ../libnm-core/crypto_nss.c:380 ../libnm-util/crypto_nss.c:377
#, c-format
msgid "Failed to initialize the encryption context."
msgstr "Şifreleme içeriği sıfırlama hatası."
-#: ../libnm-util/crypto_nss.c:380
+#: ../libnm-core/crypto_nss.c:388 ../libnm-util/crypto_nss.c:385
#, c-format
msgid "Failed to encrypt: %d."
msgstr "Åžifrelenemedi: %d."
-#: ../libnm-util/crypto_nss.c:388
+#: ../libnm-core/crypto_nss.c:396 ../libnm-util/crypto_nss.c:393
#, c-format
msgid "Unexpected amount of data after encrypting."
msgstr "Åžifrelemeden sonra beklenmeyen miktarda veri."
-#: ../libnm-util/crypto_nss.c:431
+#: ../libnm-core/crypto_nss.c:436 ../libnm-util/crypto_nss.c:433
#, c-format
msgid "Couldn't decode certificate: %d"
msgstr "Sertifikanın kodu çözülemedi: %d"
-#: ../libnm-util/crypto_nss.c:466
+#: ../libnm-core/crypto_nss.c:471
#, c-format
-msgid "Couldn't convert password to UCS2: %d"
-msgstr "Şifre UCS2'ye dönüştürülemedi: %d"
+msgid "Password must be UTF-8"
+msgstr "Parola UTF-8 olmalı"
-#: ../libnm-util/crypto_nss.c:494
+#: ../libnm-core/crypto_nss.c:501 ../libnm-util/crypto_nss.c:496
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %d"
msgstr "PKCS#12 kod çözücü sıfırlanamadı: %d"
-#: ../libnm-util/crypto_nss.c:503
+#: ../libnm-core/crypto_nss.c:510 ../libnm-util/crypto_nss.c:505
#, c-format
msgid "Couldn't decode PKCS#12 file: %d"
msgstr "PKCS#12 dosyası kodu çözülemedi: %d"
-#: ../libnm-util/crypto_nss.c:512
+#: ../libnm-core/crypto_nss.c:519 ../libnm-util/crypto_nss.c:514
#, c-format
msgid "Couldn't verify PKCS#12 file: %d"
msgstr "PKCS#12 dosyası doğrulanamadı: %d"
-#: ../libnm-util/crypto_nss.c:556
+#: ../libnm-core/crypto_nss.c:564 ../libnm-util/crypto_nss.c:558
msgid "Could not generate random data."
msgstr "Rastgele veri üretilemedi."
-#: ../libnm-util/nm-setting-8021x.c:2119 ../libnm-util/nm-setting-8021x.c:2136
-#: ../libnm-util/nm-setting-8021x.c:2177 ../libnm-util/nm-setting-8021x.c:2194
-#: ../libnm-util/nm-setting-8021x.c:2246 ../libnm-util/nm-setting-8021x.c:2258
-#: ../libnm-util/nm-setting-8021x.c:2276 ../libnm-util/nm-setting-8021x.c:2288
-#: ../libnm-util/nm-setting-8021x.c:2312 ../libnm-util/nm-setting-8021x.c:2487
-#: ../libnm-util/nm-setting-adsl.c:212
-#: ../libnm-util/nm-setting-bluetooth.c:153
-#: ../libnm-util/nm-setting-bluetooth.c:171
-#: ../libnm-util/nm-setting-bond.c:368 ../libnm-util/nm-setting-bridge.c:268
-#: ../libnm-util/nm-setting-cdma.c:163
-#: ../libnm-util/nm-setting-connection.c:674
-#: ../libnm-util/nm-setting-connection.c:690
-#: ../libnm-util/nm-setting-connection.c:743
-#: ../libnm-util/nm-setting-ip4-config.c:693
-#: ../libnm-util/nm-setting-ip4-config.c:703
-#: ../libnm-util/nm-setting-ip6-config.c:675
-#: ../libnm-util/nm-setting-ip6-config.c:685
-#: ../libnm-util/nm-setting-ip6-config.c:738
-#: ../libnm-util/nm-setting-olpc-mesh.c:128
-#: ../libnm-util/nm-setting-pppoe.c:165 ../libnm-util/nm-setting-vpn.c:388
+#: ../libnm-core/nm-connection.c:223
+msgid "wrong type; should be a list of strings."
+msgstr "yanlış tip; karakter dizilerinin listesi olmalı."
+
+#: ../libnm-core/nm-connection.c:278
+msgid "unknown setting name"
+msgstr "bilinmeyen ayar adı"
+
+#: ../libnm-core/nm-connection.c:763
+msgid "setting not found"
+msgstr "ayar bulunamadı"
+
+#: ../libnm-core/nm-connection.c:827
+#| msgid "Error: '%s' is not an active connection."
+msgid "setting not allowed in slave connection"
+msgstr "ikincil bağlantıda ayara izin verilmiyor"
+
+#: ../libnm-core/nm-connection.c:838
+msgid "setting is required for non-slave connections"
+msgstr "ikincil olmayan bağlantılar için ayarlar gerekli"
+
+#: ../libnm-core/nm-connection.c:904
+msgid "Unexpected failure to verify the connection"
+msgstr "Bağlantı doğrulamada beklenmedik hata"
+
+#: ../libnm-core/nm-connection.c:935
+msgid "Unexpected failure to normalize the connection"
+msgstr "Bağlantıyı normalleştirmede beklenmedik hata"
+
+#: ../libnm-core/nm-connection.c:1399 ../libnm-core/nm-setting-8021x.c:2270
+#: ../libnm-core/nm-setting-8021x.c:2287 ../libnm-core/nm-setting-8021x.c:2317
+#: ../libnm-core/nm-setting-8021x.c:2334 ../libnm-core/nm-setting-8021x.c:2375
+#: ../libnm-core/nm-setting-8021x.c:2387 ../libnm-core/nm-setting-8021x.c:2405
+#: ../libnm-core/nm-setting-8021x.c:2417 ../libnm-core/nm-setting-8021x.c:2441
+#: ../libnm-core/nm-setting-8021x.c:2623 ../libnm-core/nm-setting-adsl.c:188
+#: ../libnm-core/nm-setting-bluetooth.c:118
+#: ../libnm-core/nm-setting-bluetooth.c:136
+#: ../libnm-core/nm-setting-cdma.c:140
+#: ../libnm-core/nm-setting-connection.c:766
+#: ../libnm-core/nm-setting-connection.c:782
+#: ../libnm-core/nm-setting-connection.c:812
+#: ../libnm-core/nm-setting-ip4-config.c:881
+#: ../libnm-core/nm-setting-ip6-config.c:799
+#: ../libnm-core/nm-setting-ip6-config.c:863
+#: ../libnm-core/nm-setting-olpc-mesh.c:106
+#: ../libnm-core/nm-setting-pppoe.c:141 ../libnm-core/nm-setting-vpn.c:398
+#: ../libnm-core/nm-setting-wimax.c:115
+#: ../libnm-core/nm-setting-wireless-security.c:861
+#: ../libnm-core/nm-setting-wireless.c:692 ../libnm-util/nm-setting.c:1370
+#: ../libnm-util/nm-setting.c:1389 ../libnm-util/nm-setting.c:1407
+#: ../libnm-util/nm-setting-8021x.c:2282 ../libnm-util/nm-setting-8021x.c:2299
+#: ../libnm-util/nm-setting-8021x.c:2340 ../libnm-util/nm-setting-8021x.c:2357
+#: ../libnm-util/nm-setting-8021x.c:2409 ../libnm-util/nm-setting-8021x.c:2421
+#: ../libnm-util/nm-setting-8021x.c:2439 ../libnm-util/nm-setting-8021x.c:2451
+#: ../libnm-util/nm-setting-8021x.c:2475 ../libnm-util/nm-setting-8021x.c:2653
+#: ../libnm-util/nm-setting-adsl.c:208
+#: ../libnm-util/nm-setting-bluetooth.c:140
+#: ../libnm-util/nm-setting-bluetooth.c:158
+#: ../libnm-util/nm-setting-cdma.c:161
+#: ../libnm-util/nm-setting-connection.c:767
+#: ../libnm-util/nm-setting-connection.c:783
+#: ../libnm-util/nm-setting-connection.c:844
+#: ../libnm-util/nm-setting-ip4-config.c:828
+#: ../libnm-util/nm-setting-ip6-config.c:809
+#: ../libnm-util/nm-setting-ip6-config.c:873
+#: ../libnm-util/nm-setting-olpc-mesh.c:122
+#: ../libnm-util/nm-setting-pppoe.c:162 ../libnm-util/nm-setting-vpn.c:422
#: ../libnm-util/nm-setting-wimax.c:137
-#: ../libnm-util/nm-setting-wireless-security.c:792
-#: ../libnm-util/nm-setting-wireless.c:610
-#, fuzzy
+#: ../libnm-util/nm-setting-wireless-security.c:891
+#: ../libnm-util/nm-setting-wireless.c:750
#| msgid "Error: %s argument is missing."
msgid "property is missing"
-msgstr "Hata: %s bağımsız değişken eksik."
+msgstr "özellik eksik"
+
+#: ../libnm-core/nm-setting-8021x.c:577 ../libnm-util/nm-setting-8021x.c:596
+msgid "CA certificate must be in X.509 format"
+msgstr "CA sertifikası X.509 biçiminde olmalı"
+
+#: ../libnm-core/nm-setting-8021x.c:892 ../libnm-core/nm-setting-8021x.c:1156
+#: ../libnm-core/nm-setting-8021x.c:1476 ../libnm-util/nm-setting-8021x.c:914
+#: ../libnm-util/nm-setting-8021x.c:1177 ../libnm-util/nm-setting-8021x.c:1500
+#| msgid "Error initializing certificate data: %s"
+msgid "invalid certificate format"
+msgstr "geçersiz sertifika biçimi"
-#: ../libnm-util/nm-setting-8021x.c:2126 ../libnm-util/nm-setting-8021x.c:2143
-#: ../libnm-util/nm-setting-8021x.c:2184 ../libnm-util/nm-setting-8021x.c:2201
-#: ../libnm-util/nm-setting-8021x.c:2252 ../libnm-util/nm-setting-8021x.c:2264
-#: ../libnm-util/nm-setting-8021x.c:2282 ../libnm-util/nm-setting-8021x.c:2294
-#: ../libnm-util/nm-setting-8021x.c:2318 ../libnm-util/nm-setting-adsl.c:219
-#: ../libnm-util/nm-setting-adsl.c:228 ../libnm-util/nm-setting-cdma.c:179
-#: ../libnm-util/nm-setting-cdma.c:188
-#: ../libnm-util/nm-setting-connection.c:681
-#: ../libnm-util/nm-setting-connection.c:750
-#: ../libnm-util/nm-setting-gsm.c:280 ../libnm-util/nm-setting-gsm.c:337
-#: ../libnm-util/nm-setting-gsm.c:346
-#: ../libnm-util/nm-setting-ip4-config.c:754
-#: ../libnm-util/nm-setting-ip4-config.c:763
-#: ../libnm-util/nm-setting-pppoe.c:172 ../libnm-util/nm-setting-pppoe.c:181
-#: ../libnm-util/nm-setting-vpn.c:397 ../libnm-util/nm-setting-vpn.c:407
+#: ../libnm-core/nm-setting-8021x.c:1758 ../libnm-util/nm-setting-8021x.c:1769
+msgid "invalid private key"
+msgstr "geçersiz özel anahtar"
+
+#: ../libnm-core/nm-setting-8021x.c:2068 ../libnm-util/nm-setting-8021x.c:2080
+#| msgid "Failed to decrypt the private key."
+msgid "invalid phase2 private key"
+msgstr "geçersiz faz2 özel anahtarı"
+
+#: ../libnm-core/nm-setting-8021x.c:2277 ../libnm-core/nm-setting-8021x.c:2294
+#: ../libnm-core/nm-setting-8021x.c:2324 ../libnm-core/nm-setting-8021x.c:2341
+#: ../libnm-core/nm-setting-8021x.c:2381 ../libnm-core/nm-setting-8021x.c:2393
+#: ../libnm-core/nm-setting-8021x.c:2411 ../libnm-core/nm-setting-8021x.c:2423
+#: ../libnm-core/nm-setting-8021x.c:2448 ../libnm-core/nm-setting-adsl.c:195
+#: ../libnm-core/nm-setting-adsl.c:204 ../libnm-core/nm-setting-cdma.c:156
+#: ../libnm-core/nm-setting-cdma.c:165
+#: ../libnm-core/nm-setting-connection.c:773
+#: ../libnm-core/nm-setting-connection.c:823
+#: ../libnm-core/nm-setting-gsm.c:224 ../libnm-core/nm-setting-gsm.c:281
+#: ../libnm-core/nm-setting-gsm.c:290
+#: ../libnm-core/nm-setting-ip4-config.c:946
+#: ../libnm-core/nm-setting-ip4-config.c:955
+#: ../libnm-core/nm-setting-pppoe.c:148 ../libnm-core/nm-setting-pppoe.c:157
+#: ../libnm-core/nm-setting-vpn.c:407 ../libnm-core/nm-setting-vpn.c:417
+#: ../libnm-core/nm-setting-wimax.c:124
+#: ../libnm-core/nm-setting-wireless-security.c:891
+#: ../libnm-core/nm-setting-wireless-security.c:899
+#: ../libnm-core/nm-setting-wireless-security.c:923
+#: ../libnm-util/nm-setting-8021x.c:2289 ../libnm-util/nm-setting-8021x.c:2306
+#: ../libnm-util/nm-setting-8021x.c:2347 ../libnm-util/nm-setting-8021x.c:2364
+#: ../libnm-util/nm-setting-8021x.c:2415 ../libnm-util/nm-setting-8021x.c:2427
+#: ../libnm-util/nm-setting-8021x.c:2445 ../libnm-util/nm-setting-8021x.c:2457
+#: ../libnm-util/nm-setting-8021x.c:2482 ../libnm-util/nm-setting-adsl.c:215
+#: ../libnm-util/nm-setting-adsl.c:224 ../libnm-util/nm-setting-cdma.c:177
+#: ../libnm-util/nm-setting-cdma.c:186
+#: ../libnm-util/nm-setting-connection.c:774
+#: ../libnm-util/nm-setting-connection.c:851
+#: ../libnm-util/nm-setting-gsm.c:281 ../libnm-util/nm-setting-gsm.c:338
+#: ../libnm-util/nm-setting-gsm.c:347
+#: ../libnm-util/nm-setting-ip4-config.c:893
+#: ../libnm-util/nm-setting-ip4-config.c:902
+#: ../libnm-util/nm-setting-pppoe.c:169 ../libnm-util/nm-setting-pppoe.c:178
+#: ../libnm-util/nm-setting-vpn.c:431 ../libnm-util/nm-setting-vpn.c:441
#: ../libnm-util/nm-setting-wimax.c:146
-#: ../libnm-util/nm-setting-wireless-security.c:822
-#: ../libnm-util/nm-setting-wireless-security.c:830
-#: ../libnm-util/nm-setting-wireless-security.c:854
+#: ../libnm-util/nm-setting-wireless-security.c:921
+#: ../libnm-util/nm-setting-wireless-security.c:929
+#: ../libnm-util/nm-setting-wireless-security.c:953
msgid "property is empty"
-msgstr ""
+msgstr "özellik boş"
-#: ../libnm-util/nm-setting-8021x.c:2154 ../libnm-util/nm-setting-8021x.c:2166
-#: ../libnm-util/nm-setting-8021x.c:2212 ../libnm-util/nm-setting-8021x.c:2224
+#: ../libnm-core/nm-setting-8021x.c:2306 ../libnm-core/nm-setting-8021x.c:2353
+#: ../libnm-util/nm-setting-8021x.c:2317 ../libnm-util/nm-setting-8021x.c:2329
+#: ../libnm-util/nm-setting-8021x.c:2375 ../libnm-util/nm-setting-8021x.c:2387
#, c-format
msgid "has to match '%s' property for PKCS#12"
-msgstr ""
-
-#: ../libnm-util/nm-setting-8021x.c:2462 ../libnm-util/nm-setting-8021x.c:2496
-#: ../libnm-util/nm-setting-bluetooth.c:162
-#: ../libnm-util/nm-setting-bond.c:377
-#: ../libnm-util/nm-setting-infiniband.c:166
-#: ../libnm-util/nm-setting-infiniband.c:181
-#: ../libnm-util/nm-setting-ip4-config.c:745
-#: ../libnm-util/nm-setting-ip6-config.c:729
-#: ../libnm-util/nm-setting-olpc-mesh.c:156
-#: ../libnm-util/nm-setting-wimax.c:155 ../libnm-util/nm-setting-wired.c:518
-#: ../libnm-util/nm-setting-wired.c:527
-#: ../libnm-util/nm-setting-wireless-security.c:873
-#: ../libnm-util/nm-setting-wireless-security.c:882
-#: ../libnm-util/nm-setting-wireless-security.c:890
-#: ../libnm-util/nm-setting-wireless-security.c:898
-#: ../libnm-util/nm-setting-wireless-security.c:906
-#: ../libnm-util/nm-setting-wireless-security.c:915
-#: ../libnm-util/nm-setting-wireless-security.c:924
-#: ../libnm-util/nm-setting-wireless-security.c:933
-#: ../libnm-util/nm-setting-wireless-security.c:969
-#: ../libnm-util/nm-setting-wireless-security.c:979
-#: ../libnm-util/nm-setting-wireless.c:670
-#: ../libnm-util/nm-setting-wireless.c:679
-#: ../libnm-util/nm-setting-wireless.c:688
+msgstr "PKCS#12 için '%s' özelliği eşleşmek zorunda"
+
+#: ../libnm-core/nm-setting-8021x.c:2598 ../libnm-core/nm-setting-8021x.c:2632
+#: ../libnm-core/nm-setting-bluetooth.c:127
+#: ../libnm-core/nm-setting-infiniband.c:191
+#: ../libnm-core/nm-setting-infiniband.c:206
+#: ../libnm-core/nm-setting-ip4-config.c:937
+#: ../libnm-core/nm-setting-ip6-config.c:854
+#: ../libnm-core/nm-setting-olpc-mesh.c:135
+#: ../libnm-core/nm-setting-wimax.c:133 ../libnm-core/nm-setting-wired.c:618
+#: ../libnm-core/nm-setting-wired.c:628
+#: ../libnm-core/nm-setting-wireless-security.c:942
+#: ../libnm-core/nm-setting-wireless-security.c:951
+#: ../libnm-core/nm-setting-wireless-security.c:959
+#: ../libnm-core/nm-setting-wireless-security.c:967
+#: ../libnm-core/nm-setting-wireless-security.c:975
+#: ../libnm-core/nm-setting-wireless-security.c:984
+#: ../libnm-core/nm-setting-wireless-security.c:993
+#: ../libnm-core/nm-setting-wireless-security.c:1002
+#: ../libnm-core/nm-setting-wireless-security.c:1038
+#: ../libnm-core/nm-setting-wireless-security.c:1048
+#: ../libnm-core/nm-setting-wireless.c:753
+#: ../libnm-core/nm-setting-wireless.c:762
+#: ../libnm-core/nm-setting-wireless.c:771 ../libnm-util/nm-setting.c:1380
+#: ../libnm-util/nm-setting.c:1398 ../libnm-util/nm-setting.c:1417
+#: ../libnm-util/nm-setting-8021x.c:2628 ../libnm-util/nm-setting-8021x.c:2662
+#: ../libnm-util/nm-setting-bluetooth.c:149
+#: ../libnm-util/nm-setting-infiniband.c:204
+#: ../libnm-util/nm-setting-infiniband.c:220
+#: ../libnm-util/nm-setting-ip4-config.c:884
+#: ../libnm-util/nm-setting-ip6-config.c:864
+#: ../libnm-util/nm-setting-olpc-mesh.c:150
+#: ../libnm-util/nm-setting-wimax.c:155 ../libnm-util/nm-setting-wired.c:660
+#: ../libnm-util/nm-setting-wired.c:669
+#: ../libnm-util/nm-setting-wireless-security.c:972
+#: ../libnm-util/nm-setting-wireless-security.c:981
+#: ../libnm-util/nm-setting-wireless-security.c:989
+#: ../libnm-util/nm-setting-wireless-security.c:997
+#: ../libnm-util/nm-setting-wireless-security.c:1005
+#: ../libnm-util/nm-setting-wireless-security.c:1014
+#: ../libnm-util/nm-setting-wireless-security.c:1023
+#: ../libnm-util/nm-setting-wireless-security.c:1032
+#: ../libnm-util/nm-setting-wireless-security.c:1068
+#: ../libnm-util/nm-setting-wireless-security.c:1078
+#: ../libnm-util/nm-setting-wireless.c:810
+#: ../libnm-util/nm-setting-wireless.c:819
+#: ../libnm-util/nm-setting-wireless.c:828
msgid "property is invalid"
-msgstr ""
-
-#: ../libnm-util/nm-setting-8021x.c:2521 ../libnm-util/nm-setting-8021x.c:2531
-#: ../libnm-util/nm-setting-8021x.c:2541 ../libnm-util/nm-setting-8021x.c:2551
-#: ../libnm-util/nm-setting-8021x.c:2561 ../libnm-util/nm-setting-adsl.c:239
-#: ../libnm-util/nm-setting-adsl.c:250
-#: ../libnm-util/nm-setting-bluetooth.c:179
-#: ../libnm-util/nm-setting-infiniband.c:190
-#: ../libnm-util/nm-setting-vlan.c:554 ../libnm-util/nm-setting-wired.c:560
-#: ../libnm-util/nm-setting-wireless-security.c:801
-#, fuzzy, c-format
+msgstr "özellik geçersiz"
+
+#: ../libnm-core/nm-setting-8021x.c:2657 ../libnm-core/nm-setting-8021x.c:2667
+#: ../libnm-core/nm-setting-8021x.c:2677 ../libnm-core/nm-setting-8021x.c:2687
+#: ../libnm-core/nm-setting-8021x.c:2697 ../libnm-core/nm-setting-adsl.c:216
+#: ../libnm-core/nm-setting-adsl.c:228
+#: ../libnm-core/nm-setting-bluetooth.c:144
+#: ../libnm-core/nm-setting-wireless-security.c:870
+#: ../libnm-util/nm-setting-8021x.c:2687 ../libnm-util/nm-setting-8021x.c:2697
+#: ../libnm-util/nm-setting-8021x.c:2707 ../libnm-util/nm-setting-8021x.c:2717
+#: ../libnm-util/nm-setting-8021x.c:2727 ../libnm-util/nm-setting-adsl.c:236
+#: ../libnm-util/nm-setting-adsl.c:248
+#: ../libnm-util/nm-setting-bluetooth.c:166
+#: ../libnm-util/nm-setting-wireless-security.c:900
+#, c-format
#| msgid "Error: '%s' is not valid argument for '%s' option."
msgid "'%s' is not a valid value for the property"
-msgstr "Hata: '%s', '%s' seçeneği için geçerli bir değişken değil."
+msgstr "'%s' özellik için geçerli bir değer değil"
-#: ../libnm-util/nm-setting-bluetooth.c:201
+#: ../libnm-core/nm-setting-bluetooth.c:166
#, c-format
-msgid "requires '%s' or '%s' setting"
-msgstr ""
+msgid "'%s' connection requires '%s' or '%s' setting"
+msgstr "'%s' bağlantısı '%s' ya da '%s' ayarı istiyor"
-#: ../libnm-util/nm-setting-bond.c:391
+#: ../libnm-core/nm-setting-bond.c:459 ../libnm-util/nm-setting-bond.c:501
#, c-format
msgid "invalid option '%s' or its value '%s'"
-msgstr ""
+msgstr "geçersiz seçenek '%s' ya da değeri '%s'"
-#: ../libnm-util/nm-setting-bond.c:410
+#: ../libnm-core/nm-setting-bond.c:478 ../libnm-util/nm-setting-bond.c:520
#, c-format
msgid "only one of '%s' and '%s' can be set"
-msgstr ""
+msgstr "sadece ÅŸunlardan biri ayarlanabilir; '%s' ve '%s'"
-#: ../libnm-util/nm-setting-bond.c:421
+#: ../libnm-core/nm-setting-bond.c:489 ../libnm-util/nm-setting-bond.c:531
#, c-format
-msgid "setting '%s' is required"
-msgstr ""
+msgid "mandatory option '%s' is missing"
+msgstr "zorunlu seçenek '%s' eksik"
-#: ../libnm-util/nm-setting-bond.c:430
-#, fuzzy, c-format
+#: ../libnm-core/nm-setting-bond.c:498 ../libnm-util/nm-setting-bond.c:540
+#, c-format
#| msgid "Error: '%s' is not valid argument for '%s' option."
msgid "'%s' is not a valid value for '%s'"
-msgstr "Hata: '%s', '%s' seçeneği için geçerli bir değişken değil."
+msgstr "'%s', '%s' için geçerli bir değer değil"
-#: ../libnm-util/nm-setting-bond.c:443
-#, fuzzy, c-format
+#: ../libnm-core/nm-setting-bond.c:511 ../libnm-util/nm-setting-bond.c:553
+#, c-format
#| msgid "device '%s' not compatible with connection '%s'"
msgid "'%s=%s' is incompatible with '%s > 0'"
-msgstr "'%s aygıtı '%s' bağlantısı ile uyumlu değil"
+msgstr "'%s=%s', '%s > 0' ile uyumlu deÄŸil"
-#: ../libnm-util/nm-setting-bond.c:454
-#, fuzzy, c-format
+#: ../libnm-core/nm-setting-bond.c:524 ../libnm-util/nm-setting-bond.c:566
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' is not a valid interface name for '%s' option"
+msgstr "'%s', '%s' seçeneği için geçerli bir arayüz ismi değil"
+
+#: ../libnm-core/nm-setting-bond.c:534 ../libnm-util/nm-setting-bond.c:576
+#, c-format
+#| msgid "Error: '%s' is not valid argument for '%s' option."
+msgid "'%s' option is only valid for '%s=%s'"
+msgstr "'%s' seçeneği sadece '%s=%s' için geçerli"
+
+#: ../libnm-core/nm-setting-bond.c:547 ../libnm-util/nm-setting-bond.c:589
+#, c-format
#| msgid "Error: '%s' is not valid argument for '%s' option."
msgid "'%s=%s' is not a valid configuration for '%s'"
-msgstr "Hata: '%s', '%s' seçeneği için geçerli bir değişken değil."
+msgstr "'%s=%s', '%s' için geçerli bir yapılandırma değil"
-#: ../libnm-util/nm-setting-bond.c:467 ../libnm-util/nm-setting-bond.c:476
-#: ../libnm-util/nm-setting-bond.c:496 ../libnm-util/nm-setting-bond.c:532
+#: ../libnm-core/nm-setting-bond.c:560 ../libnm-core/nm-setting-bond.c:569
+#: ../libnm-core/nm-setting-bond.c:589 ../libnm-core/nm-setting-bond.c:625
+#: ../libnm-util/nm-setting-bond.c:602 ../libnm-util/nm-setting-bond.c:611
+#: ../libnm-util/nm-setting-bond.c:631 ../libnm-util/nm-setting-bond.c:667
#, c-format
-msgid "'%s' option requires setting '%s' option"
-msgstr ""
+msgid "'%s' option requires '%s' option to be set"
+msgstr "'%s' seçeneği, '%s' seçeneğinin ayarlanması için gerekli"
-#: ../libnm-util/nm-setting-bond.c:508
+#: ../libnm-core/nm-setting-bond.c:600 ../libnm-util/nm-setting-bond.c:642
#, c-format
msgid "'%s' option is empty"
msgstr "'%s' seçeneği boş"
-#: ../libnm-util/nm-setting-bond.c:520
-#, fuzzy, c-format
+#: ../libnm-core/nm-setting-bond.c:612 ../libnm-util/nm-setting-bond.c:654
+#, c-format
#| msgid "Error: '%s' is not valid argument for '%s' option."
msgid "'%s' is not a valid IPv4 address for '%s' option"
-msgstr "Hata: '%s', '%s' seçeneği için geçerli bir değişken değil."
+msgstr "'%s', '%s' seçeneği için geçerli bir IPv4 adresi değil"
-#: ../libnm-util/nm-setting-bridge-port.c:155
+#: ../libnm-core/nm-setting-bond.c:639 ../libnm-util/nm-setting-bond.c:681
+#, c-format
+#| msgid "'%s' is not a valid Wi-Fi mode"
+msgid "'%s' option is only valid with mode '%s'"
+msgstr "'%s' seçeneği sadece '%s' kipi ile geçerli olur"
+
+#: ../libnm-core/nm-setting-bridge-port.c:123
+#: ../libnm-core/nm-setting-bridge-port.c:135
+#: ../libnm-util/nm-setting-bridge-port.c:153
#: ../libnm-util/nm-setting-bridge-port.c:165
#, c-format
msgid "'%d' is not a valid value for the property (should be <= %d)"
-msgstr ""
+msgstr "'%d' özellik için geçerli bir değere değil (<= %d olmalı)"
-#: ../libnm-util/nm-setting-bridge.c:251
+#: ../libnm-core/nm-setting-bridge-port.c:153
+#: ../libnm-core/nm-setting-team-port.c:96
#, c-format
-msgid "value '%d' is out of range <%d-%d>"
-msgstr ""
+msgid "missing setting"
+msgstr "eksik ayar"
-#: ../libnm-util/nm-setting-bridge.c:277
-#: ../libnm-util/nm-setting-connection.c:732
-#: ../libnm-util/nm-setting-vlan.c:486
+#: ../libnm-core/nm-setting-bridge-port.c:164
+#: ../libnm-core/nm-setting-team-port.c:107
#, c-format
-msgid "'%s' is not a valid interface name"
+msgid ""
+"A connection with a '%s' setting must have the slave-type set to '%s'. "
+"Instead it is '%s'"
msgstr ""
+"'%s' ayarını içeren bir bağlantının ikincil tür ayarı '%s' olmalıdır. Bunun "
+"yerine '%s'"
-#: ../libnm-util/nm-setting-cdma.c:170
+#: ../libnm-core/nm-setting-bridge.c:204 ../libnm-util/nm-setting-bridge.c:268
+#, c-format
+msgid "value '%d' is out of range <%d-%d>"
+msgstr "'%d' değeri aralığın dışında <%d-%d>"
+
+#: ../libnm-core/nm-setting-bridge.c:221 ../libnm-core/nm-setting-wired.c:592
+#: ../libnm-core/nm-setting-wired.c:652 ../libnm-util/nm-setting-bridge.c:285
+#: ../libnm-util/nm-setting-wired.c:635 ../libnm-util/nm-setting-wired.c:693
+msgid "is not a valid MAC address"
+msgstr "geçerli bir MAC adresi değildir"
+
+#: ../libnm-core/nm-setting-cdma.c:147 ../libnm-util/nm-setting-cdma.c:168
msgid "property is empty'"
-msgstr ""
+msgstr "özellik boş'"
-#: ../libnm-util/nm-setting-connection.c:697
+#: ../libnm-core/nm-setting-connection.c:745
#, c-format
-msgid "'%s' is not a valid UUID"
-msgstr "'%s' geçerli bir UUID değil"
+#| msgid "no device found for connection '%s'"
+msgid "setting required for connection of type '%s'"
+msgstr "'%s' tipinin bağlantısı için ayar gerekli"
-#: ../libnm-util/nm-setting-connection.c:716
+#: ../libnm-core/nm-setting-connection.c:833
#, c-format
-msgid "'%s' doesn't match the virtual interface name '%s'"
-msgstr ""
+#| msgid "Error: timeout value '%s' is not valid."
+msgid "connection type '%s' is not valid"
+msgstr "bağlantı tipi '%s' geçerli değil"
-#: ../libnm-util/nm-setting-connection.c:760
+#: ../libnm-core/nm-setting-connection.c:868
+#: ../libnm-util/nm-setting-connection.c:876
#, c-format
-msgid "requires presence of '%s' setting in the connection"
-msgstr ""
+#| msgid "Unknown log level '%s'"
+msgid "Unknown slave type '%s'"
+msgstr "Bilinmeyen ikincil tür '%s'"
-#: ../libnm-util/nm-setting-connection.c:784
-msgid "IPv4 configuration is not allowed for bonding slave"
-msgstr ""
+#: ../libnm-core/nm-setting-connection.c:878
+#: ../libnm-util/nm-setting-connection.c:886
+#| msgid "Shared connection service failed"
+msgid "Slave connections need a valid '"
+msgstr "İkincil bağlantının ihtiyacı bir geçerli '"
-#: ../libnm-util/nm-setting-connection.c:801
-msgid "IPv6 configuration is not allowed for bonding slave"
-msgstr ""
+#: ../libnm-core/nm-setting-connection.c:899
+#: ../libnm-util/nm-setting-connection.c:895
+#| msgid "not saved, "
+msgid "Cannot set '"
+msgstr "Ayarlanamadı '"
+
+#: ../libnm-core/nm-setting-connection.c:912
+#, c-format
+msgid "property type should be set to '%s'"
+msgstr "özellik türü '%s' olarak ayarlanmalı"
+
+#: ../libnm-core/nm-setting-connection.c:927
+#, c-format
+msgid "slave-type '%s' requires a '%s' setting in the connection"
+msgstr "ikincil tür '%s' bağlantı ayarı olarak bir '%s' gereksinimi duyuyor"
+
+#: ../libnm-core/nm-setting-connection.c:937
+#, c-format
+#| msgid "Active connection path: %s\n"
+msgid "Detect a slave connection with '"
+msgstr "İkincil bir bağlantıyı algıla '"
+
+#: ../libnm-core/nm-setting-dcb.c:521 ../libnm-util/nm-setting-dcb.c:593
+msgid "flags invalid"
+msgstr "bayraklar geçersiz"
+
+#: ../libnm-core/nm-setting-dcb.c:530 ../libnm-util/nm-setting-dcb.c:602
+msgid "flags invalid - disabled"
+msgstr "bayraklar geçersiz - kapatılmış"
+
+#: ../libnm-core/nm-setting-dcb.c:556 ../libnm-core/nm-setting-dcb.c:605
+#: ../libnm-util/nm-setting-dcb.c:628 ../libnm-util/nm-setting-dcb.c:677
+msgid "property invalid (not enabled)"
+msgstr "özellik geçersiz (etkin değil)"
+
+#: ../libnm-core/nm-setting-dcb.c:565 ../libnm-util/nm-setting-dcb.c:637
+msgid "element invalid"
+msgstr "öğe geçersiz"
+
+#: ../libnm-core/nm-setting-dcb.c:580 ../libnm-util/nm-setting-dcb.c:652
+msgid "sum not 100%"
+msgstr "toplam %100 etmiyor"
+
+#: ../libnm-core/nm-setting-dcb.c:614 ../libnm-core/nm-setting-dcb.c:646
+#: ../libnm-util/nm-setting-dcb.c:686 ../libnm-util/nm-setting-dcb.c:718
+#| msgid "Error: %s argument is missing."
+msgid "property invalid"
+msgstr "özellik geçersiz"
+
+#: ../libnm-core/nm-setting-dcb.c:636 ../libnm-util/nm-setting-dcb.c:708
+#| msgid "Error: %s argument is missing."
+msgid "property missing"
+msgstr "özellik eksik"
-#: ../libnm-util/nm-setting-gsm.c:293
+#: ../libnm-core/nm-setting-gsm.c:237 ../libnm-util/nm-setting-gsm.c:294
#, c-format
msgid "property value '%s' is empty or too long (>64)"
-msgstr ""
+msgstr "özellik değeri '%s' boş ya da çok uzun (>64)"
-#: ../libnm-util/nm-setting-gsm.c:325
+#: ../libnm-core/nm-setting-gsm.c:269 ../libnm-util/nm-setting-gsm.c:326
#, c-format
msgid "'%s' contains invalid char(s) (use [A-Za-z._-])"
-msgstr ""
+msgstr "'%s' geçersiz karakter(ler) içeriyor ([A-Za-z._-] kullanın)"
-#: ../libnm-util/nm-setting-gsm.c:360
+#: ../libnm-core/nm-setting-gsm.c:304 ../libnm-util/nm-setting-gsm.c:361
#, c-format
msgid "'%s' length is invalid (should be 5 or 6 digits)"
-msgstr ""
+msgstr "'%s' uzunluğu geçerli değil (5 ya da 6 basamak olmalı)"
-#: ../libnm-util/nm-setting-gsm.c:371
-#, c-format
-msgid "'%s' is not a number"
-msgstr "'%s' bir numara deÄŸil"
+#: ../libnm-core/nm-setting-infiniband.c:216
+#: ../libnm-util/nm-setting-infiniband.c:230
+msgid "not a valid interface name"
+msgstr "geçerli bir arayüz ismi değil"
+
+#: ../libnm-core/nm-setting-infiniband.c:224
+#: ../libnm-util/nm-setting-infiniband.c:238
+msgid "Must specify a P_Key if specifying parent"
+msgstr "Eğer üst belirtilmiş ise P_Key belirtilmek zorundadır"
+
+#: ../libnm-core/nm-setting-infiniband.c:234
+#: ../libnm-util/nm-setting-infiniband.c:248
+msgid "InfiniBand P_Key connection did not specify parent interface name"
+msgstr "InfiniBand P_Key bağlantısı bir üst arayüz ismi belirtmemiş"
-#: ../libnm-util/nm-setting-ip4-config.c:714
-#: ../libnm-util/nm-setting-ip4-config.c:724
-#: ../libnm-util/nm-setting-ip4-config.c:734
-#: ../libnm-util/nm-setting-ip6-config.c:697
-#: ../libnm-util/nm-setting-ip6-config.c:707
-#: ../libnm-util/nm-setting-ip6-config.c:717
+#: ../libnm-core/nm-setting-infiniband.c:270
+#: ../libnm-util/nm-setting-infiniband.c:284
#, c-format
-msgid "this property is not allowed for '%s=%s'"
+msgid ""
+"interface name of software infiniband device must be '%s' or unset (instead "
+"it is '%s')"
msgstr ""
+"yazılımsal sınırsız bant aygıtının arayüz ismi '%s' ve ya ayarlanmamış olmak "
+"zorundadır ('%s' yerine)"
+
+#: ../libnm-core/nm-setting-infiniband.c:285
+#, c-format
+msgid "mtu for transport mode '%s' can be at most %d but it is %d"
+msgstr "taşıma kipi '%s' için mtu en fazla %d olmalı ancak şu anda %d"
+
+#: ../libnm-core/nm-setting-ip4-config.c:891
+#: ../libnm-core/nm-setting-ip6-config.c:809
+#: ../libnm-util/nm-setting-ip4-config.c:838
+#: ../libnm-util/nm-setting-ip6-config.c:819
+#, c-format
+msgid "this property cannot be empty for '%s=%s'"
+msgstr "özellik '%s=%s' için boş olamaz"
+
+#: ../libnm-core/nm-setting-ip4-config.c:903
+#: ../libnm-core/nm-setting-ip4-config.c:913
+#: ../libnm-core/nm-setting-ip4-config.c:925
+#: ../libnm-core/nm-setting-ip6-config.c:822
+#: ../libnm-core/nm-setting-ip6-config.c:832
+#: ../libnm-core/nm-setting-ip6-config.c:842
+#: ../libnm-util/nm-setting-ip4-config.c:850
+#: ../libnm-util/nm-setting-ip4-config.c:860
+#: ../libnm-util/nm-setting-ip4-config.c:872
+#: ../libnm-util/nm-setting-ip6-config.c:832
+#: ../libnm-util/nm-setting-ip6-config.c:842
+#: ../libnm-util/nm-setting-ip6-config.c:852
+#, c-format
+msgid "this property is not allowed for '%s=%s'"
+msgstr "bu özellik '%s=%s' için kullanılamaz"
-#: ../libnm-util/nm-setting-ip4-config.c:777
+#: ../libnm-core/nm-setting-ip4-config.c:972
+#: ../libnm-util/nm-setting-ip4-config.c:916
#, c-format
msgid "%d. IPv4 address is invalid"
msgstr "%d. IPv4 adresi geçersiz"
-#: ../libnm-util/nm-setting-ip4-config.c:787
+#: ../libnm-core/nm-setting-ip4-config.c:982
+#: ../libnm-util/nm-setting-ip4-config.c:926
#, c-format
msgid "%d. IPv4 address has invalid prefix"
msgstr "%d. IPv4 adresi geçersiz bir ön eke sahip"
-#: ../libnm-util/nm-setting-ip4-config.c:803
+#: ../libnm-core/nm-setting-ip4-config.c:992
+#, c-format
+#| msgid "%d. IPv4 address has invalid prefix"
+msgid "%d. IPv4 address has invalid label '%s'"
+msgstr "%d. IPv4 adresi geçersiz '%s' etiketine sahip"
+
+#: ../libnm-core/nm-setting-ip4-config.c:1003
+#, c-format
+msgid "IPv4 address / label count mismatch (%d vs %d)"
+msgstr "IPv4 adresi / etiket sayısı eşleşmiyor (%d vs %d)"
+
+#: ../libnm-core/nm-setting-ip4-config.c:1019
+#: ../libnm-util/nm-setting-ip4-config.c:942
#, c-format
msgid "%d. route is invalid"
-msgstr ""
+msgstr "%d. yönlendirme geçersiz"
-#: ../libnm-util/nm-setting-ip4-config.c:813
+#: ../libnm-core/nm-setting-ip4-config.c:1029
+#: ../libnm-util/nm-setting-ip4-config.c:952
#, c-format
msgid "%d. route has invalid prefix"
-msgstr ""
+msgstr "%d. yönlendirme geçersiz bir ön eke sahip"
-#: ../libnm-util/nm-setting-ip6-config.c:696
+#: ../libnm-core/nm-setting-ip4-config.c:1045
+#: ../libnm-core/nm-setting-ip6-config.c:876
+#, c-format
+#| msgid "%d. IPv4 address is invalid"
+msgid "%d. DNS server address is invalid"
+msgstr "%d. DNS sunucusu adresi geçersiz"
+
+#: ../libnm-core/nm-setting-ip6-config.c:821
+#: ../libnm-util/nm-setting-ip6-config.c:831
#, c-format
msgid "'%s' not allowed for %s=%s"
-msgstr ""
+msgstr "'%s' şunun için kullanılamaz %s=%s"
-#: ../libnm-util/nm-setting-olpc-mesh.c:137
-#: ../libnm-util/nm-setting-wireless.c:619
+#: ../libnm-core/nm-setting-olpc-mesh.c:116
+#: ../libnm-core/nm-setting-wireless.c:702
+#: ../libnm-util/nm-setting-olpc-mesh.c:131
+#: ../libnm-util/nm-setting-wireless.c:759
msgid "SSID length is out of range <1-32> bytes"
msgstr "SSID uzunluğu aşıldı <1-32> byte"
-#: ../libnm-util/nm-setting-olpc-mesh.c:146
-#: ../libnm-util/nm-setting-wireless.c:659
+#: ../libnm-core/nm-setting-olpc-mesh.c:125
+#: ../libnm-core/nm-setting-wireless.c:742
+#: ../libnm-util/nm-setting-olpc-mesh.c:140
+#: ../libnm-util/nm-setting-wireless.c:799
#, c-format
msgid "'%d' is not a valid channel"
-msgstr ""
+msgstr "'%d' geçerli olmayan bir kanal"
-#: ../libnm-util/nm-setting-ppp.c:390
+#: ../libnm-core/nm-setting-ppp.c:365 ../libnm-util/nm-setting-ppp.c:387
#, c-format
msgid "'%d' is out of valid range <128-16384>"
-msgstr ""
+msgstr "'%d' geçerli aralığın dışında <128-16384>"
-#: ../libnm-util/nm-setting-ppp.c:403
+#: ../libnm-core/nm-setting-ppp.c:378 ../libnm-util/nm-setting-ppp.c:400
#, c-format
msgid "setting this property requires non-zero '%s' property"
-msgstr ""
+msgstr "bu özelllik sıfır olmayan bir '%s' özelliği istiyor"
-#: ../libnm-util/nm-setting-vlan.c:508
+#: ../libnm-core/nm-setting-vlan.c:513 ../libnm-util/nm-setting-vlan.c:554
#, c-format
msgid "'%s' value doesn't match '%s=%s'"
-msgstr ""
+msgstr "'%s' deÄŸer '%s=%s' ile eÅŸleÅŸmiyor"
-#: ../libnm-util/nm-setting-vlan.c:519
+#: ../libnm-core/nm-setting-vlan.c:524 ../libnm-util/nm-setting-vlan.c:565
#, c-format
msgid "'%s' is neither an UUID nor an interface name"
-msgstr ""
+msgstr "'%s' UUID ya da bir arayüz ismi değil"
-#: ../libnm-util/nm-setting-vlan.c:532
+#: ../libnm-core/nm-setting-vlan.c:538 ../libnm-util/nm-setting-vlan.c:578
#, c-format
msgid "property is not specified and neither is '%s:%s'"
-msgstr ""
+msgstr "özellik belirtilmemiş ve '%s:%s' değil"
-#: ../libnm-util/nm-setting-vlan.c:545
+#: ../libnm-core/nm-setting-vlan.c:551 ../libnm-util/nm-setting-vlan.c:591
msgid "flags are invalid"
-msgstr ""
+msgstr "bayraklar geçersiz"
-#: ../libnm-util/nm-setting-wired.c:473
+#: ../libnm-core/nm-setting-vpn.c:439
#, c-format
-msgid "'%s' is not a valid ethernet port value"
-msgstr "'%s' geçerli bir ethernet port numarası değildir"
+msgid "secret was empty"
+msgstr "gizli bilgi boÅŸ"
+
+#: ../libnm-core/nm-setting-vpn.c:469
+msgid "setting contained a secret with an empty name"
+msgstr "ayar ismi olmayan bir gizli bilgi içeriyor"
-#: ../libnm-util/nm-setting-wired.c:483
+#: ../libnm-core/nm-setting-vpn.c:477
#, c-format
-msgid "'%s' is not a valid duplex value"
-msgstr ""
+msgid "secret value was empty"
+msgstr "gizli deÄŸer boÅŸ"
-#: ../libnm-util/nm-setting-wired.c:493 ../libnm-util/nm-setting-wired.c:551
-msgid "is not a valid MAC address"
-msgstr "geçerli bir MAC adresi değildir"
+#: ../libnm-core/nm-setting-vpn.c:524 ../libnm-core/nm-setting.c:1496
+msgid "not a secret property"
+msgstr "gizli bir özellik değil"
-#: ../libnm-util/nm-setting-wired.c:506
-#: ../libnm-util/nm-setting-wireless.c:700
-#: ../libnm-util/nm-setting-wireless.c:714
+#: ../libnm-core/nm-setting-vpn.c:530
+msgid "secret is not of correct type"
+msgstr "gizli bilgi doğru türde değil"
+
+#: ../libnm-core/nm-setting-vpn.c:565
#, c-format
-msgid "'%s' is not a valid MAC address"
-msgstr "'%s' geçerli bir MAC adresi değildir"
+msgid "failed to convert value '%s' to uint"
+msgstr "'%s' değeri uint'e dönüştürülemedi"
-#: ../libnm-util/nm-setting-wired.c:540
-#, fuzzy, c-format
+#: ../libnm-core/nm-setting-vpn.c:573
+msgid "secret flags property not found"
+msgstr "gizli bayrak özelliği bulunamadı"
+
+#: ../libnm-core/nm-setting-wired.c:572 ../libnm-util/nm-setting-wired.c:615
+#, c-format
+#| msgid "'%s' is not a valid ethernet port value"
+msgid "'%s' is not a valid Ethernet port value"
+msgstr "'%s' geçerli bir ethernet port numarası değildir"
+
+#: ../libnm-core/nm-setting-wired.c:582 ../libnm-util/nm-setting-wired.c:625
+#, c-format
+msgid "'%s' is not a valid duplex value"
+msgstr "'%s' geçerli bir dupleks değeri değil"
+
+#: ../libnm-core/nm-setting-wired.c:641 ../libnm-util/nm-setting-wired.c:682
+#, c-format
#| msgid "invalid field '%s'"
msgid "invalid '%s' or its value '%s'"
-msgstr "geçersiz alan '%s'"
+msgstr "geçersiz '%s' ya da değeri '%s'"
-#: ../libnm-util/nm-setting-wireless-security.c:813
+#: ../libnm-core/nm-setting-wireless-security.c:882
+#: ../libnm-util/nm-setting-wireless-security.c:912
#, c-format
msgid "'%s' security requires '%s=%s'"
-msgstr ""
+msgstr "'%s' güvenliği için '%s=%s' gereklidir"
-#: ../libnm-util/nm-setting-wireless-security.c:842
+#: ../libnm-core/nm-setting-wireless-security.c:911
+#: ../libnm-util/nm-setting-wireless-security.c:941
#, c-format
msgid "'%s' security requires '%s' setting presence"
-msgstr ""
+msgstr "'%s' güvenliği için '%s' ayarı gereklidir"
-#: ../libnm-util/nm-setting-wireless-security.c:863
+#: ../libnm-core/nm-setting-wireless-security.c:932
+#: ../libnm-util/nm-setting-wireless-security.c:962
#, c-format
msgid "'%d' value is out of range <0-3>"
-msgstr ""
+msgstr "'%d' değeri geçerli aralığın dışında <0-3>"
-#: ../libnm-util/nm-setting-wireless-security.c:960
+#: ../libnm-core/nm-setting-wireless-security.c:1029
+#: ../libnm-util/nm-setting-wireless-security.c:1059
#, c-format
msgid "'%s' connections require '%s' in this property"
-msgstr ""
+msgstr "'%s' bağlantıları için bu özellikte '%s' gerekli"
-#: ../libnm-util/nm-setting-wireless-security.c:990
+#: ../libnm-core/nm-setting-wireless-security.c:1059
+#: ../libnm-util/nm-setting-wireless-security.c:1089
#, c-format
msgid "'%s' can only be used with '%s=%s' (WEP)"
-msgstr ""
+msgstr "'%s' sadece şunun ile birlikte kullanılabilir '%s=%s' (WEP)"
-#: ../libnm-util/nm-setting-wireless.c:628
+#: ../libnm-core/nm-setting-wireless.c:711
+#: ../libnm-util/nm-setting-wireless.c:768
#, c-format
-#| msgid "Error: Device '%s' is not a WiFi device."
msgid "'%s' is not a valid Wi-Fi mode"
msgstr "'%s' geçerli bir Wi-Fi kipi değil"
-#: ../libnm-util/nm-setting-wireless.c:638
+#: ../libnm-core/nm-setting-wireless.c:721
+#: ../libnm-util/nm-setting-wireless.c:778
#, c-format
msgid "'%s' is not a valid band"
-msgstr ""
+msgstr "'%s' geçerli bir bant değil"
+
+#: ../libnm-core/nm-setting-wireless.c:731
+#, c-format
+msgid "'%s' requires setting '%s' property"
+msgstr "'%s' ayarı '%s' özelliği istiyor"
+
+#: ../libnm-core/nm-setting.c:1394
+msgid "secret not found"
+msgstr "gizli bilgi bulunamadı"
+
+#: ../libnm-core/nm-setting.c:1486
+msgid "secret is not set"
+msgstr "secret ayarlı değil"
+
+#: ../libnm-glib/nm-device.c:1792 ../libnm/nm-device.c:1604
+msgid "Bluetooth"
+msgstr "Bluetooth"
+
+#: ../libnm-glib/nm-device.c:1810 ../libnm/nm-device.c:1622
+msgid "ADSL"
+msgstr "ADSL"
+
+#: ../libnm-glib/nm-device.c:1838 ../libnm/nm-device.c:1650
+msgid "Wired"
+msgstr "Kablolu"
+
+#: ../libnm-glib/nm-device.c:1869 ../libnm/nm-device.c:1681
+msgid "PCI"
+msgstr "PCI"
+
+#: ../libnm-glib/nm-device.c:1871 ../libnm/nm-device.c:1683
+msgid "USB"
+msgstr "USB"
+
+#. Translators: the first %s is a bus name (eg, "USB") or
+#. * product name, the second is a device type (eg,
+#. * "Ethernet"). You can change this to something like
+#. * "%2$s (%1$s)" if there's no grammatical way to combine
+#. * the strings otherwise.
+#.
+#: ../libnm-glib/nm-device.c:1967 ../libnm-glib/nm-device.c:1986
+#: ../libnm/nm-device.c:1777 ../libnm/nm-device.c:1796
+#, c-format
+msgctxt "long device name"
+msgid "%s %s"
+msgstr "%s %s"
+
+#: ../libnm-glib/nm-remote-connection.c:149
+#| msgid "disconnected"
+msgid "Disconnected by D-Bus"
+msgstr "D-Bus tarafından bağlantı kesildi"
+
+#: ../libnm-util/crypto_nss.c:468
+#, c-format
+msgid "Couldn't convert password to UCS2: %d"
+msgstr "Şifre UCS2'ye dönüştürülemedi: %d"
+
+#: ../libnm-util/nm-setting-bluetooth.c:184
+#, c-format
+msgid "requires '%s' or '%s' setting"
+msgstr "'%s' ya da '%s' ayarı gerekli"
-#: ../libnm-util/nm-setting-wireless.c:648
+#: ../libnm-util/nm-setting-connection.c:861
+#, c-format
+msgid "requires presence of '%s' setting in the connection"
+msgstr "bağlantıda var olan '%s' ayarı gerekli"
+
+#: ../libnm-util/nm-setting-vpn.c:581
+#, c-format
+msgid "Failed to convert '%s' value '%s' to uint"
+msgstr "'%s' değerini '%s' uint olarak dönüştürme başarısız"
+
+#: ../libnm-util/nm-setting-vpn.c:588
+#, c-format
+msgid "Secret flags property '%s' not found"
+msgstr "Gizli bayraklar özelliği '%s' bulunamadı"
+
+#: ../libnm-util/nm-setting-wireless.c:788
#, c-format
msgid "requires setting '%s' property"
-msgstr ""
+msgstr "'%s' ayarı özelliği gerekli"
+
+#: ../libnm/nm-device-adsl.c:71
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not an ADSL connection."
+msgstr "Bağlantı bir ADSL bağlantısı değildi."
-#: ../libnm-util/nm-setting-wireless.c:726
+#: ../libnm/nm-device-bond.c:114
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a bond connection."
+msgstr "Bağlantı birleştirilmiş bir bağlantı değildi."
+
+#: ../libnm/nm-device-bridge.c:114
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a bridge connection."
+msgstr "Bağlantı bir köprü bağlantısı değildi."
+
+#: ../libnm/nm-device-bt.c:139
#, c-format
-msgid "'%s' setting is required for the connection when the property is set"
-msgstr ""
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a Bluetooth connection."
+msgstr "Bağlantı bir Bluetooth bağlantısı değildi."
+
+#: ../libnm/nm-device-bt.c:148
+msgid "Invalid device Bluetooth address."
+msgstr "Geçersiz aygıt Bluetooth adresi."
+
+#: ../libnm/nm-device-bt.c:155
+msgid "The Bluetooth addresses of the device and the connection didn't match."
+msgstr "Aygıtın Bluetooth adresi ve bağlantı eşleşmiyor."
+
+#: ../libnm/nm-device-bt.c:164
+msgid ""
+"The device is lacking Bluetooth capabilities required by the connection."
+msgstr "Aygıt bağlantının gerektirdiği Bluetooth yeteneklerini kaybediyor."
+
+#: ../libnm/nm-device-ethernet.c:137
+msgid "The connection was not an Ethernet or PPPoE connection."
+msgstr "Bağlantı bir Ethernet veya PPPoE bağlantısı değil."
+
+#: ../libnm/nm-device-ethernet.c:153 ../libnm/nm-device-infiniband.c:104
+#: ../libnm/nm-device-wifi.c:491 ../libnm/nm-device-wimax.c:310
+#| msgid "is not a valid MAC address"
+msgid "Invalid device MAC address."
+msgstr "Geçersiz aygıt MAC adresi."
+
+#: ../libnm/nm-device-ethernet.c:159 ../libnm/nm-device-infiniband.c:112
+#: ../libnm/nm-device-wifi.c:498 ../libnm/nm-device-wimax.c:317
+msgid "The MACs of the device and the connection didn't match."
+msgstr "Aygıtın MAC adresleri ile bağlantı eşleşmiyor."
+
+#: ../libnm/nm-device-generic.c:92
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a generic connection."
+msgstr "Bağlantı bir genel bağlantı değildi."
+
+#: ../libnm/nm-device-generic.c:99
+msgid "The connection did not specify an interface name."
+msgstr "Bağlantı bir arayüz adı belirtmiyor."
+
+#: ../libnm/nm-device-infiniband.c:96
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not an InfiniBand connection."
+msgstr "Bağlantı bir InfiniBand bağlantısı değildi."
+
+#: ../libnm/nm-device-modem.c:122
+#| msgid "the connection was removed"
+msgid "The connection was not a modem connection."
+msgstr "Bağlantı bir modem bağlantısı değildi."
+
+#: ../libnm/nm-device-modem.c:130
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not a valid modem connection."
+msgstr "Bağlantı geçerli bir modem bağlantısı değildi."
+
+#: ../libnm/nm-device-modem.c:137
+msgid "The device is lacking capabilities required by the connection."
+msgstr "Aygıt bağlantının gerektirdiği yetenekleri kaybediyor."
+
+#: ../libnm/nm-device-olpc-mesh.c:117
+#| msgid "connecting (starting secondary connections)"
+msgid "The connection was not an OLPC Mesh connection."
+msgstr "Bağlantı bir OLPC Mesh bağlantısı değildi."
+
+#: ../libnm/nm-device-team.c:120
+#| msgid "the connection was removed"
+msgid "The connection was not a team connection."
+msgstr "Bağlantı bir takım bağlantısı değildi."
+
+#: ../libnm/nm-device-vlan.c:114
+msgid "The connection was not a VLAN connection."
+msgstr "Bağlantı bir VLAN bağlantısı değildi."
+
+#: ../libnm/nm-device-vlan.c:121
+msgid "The VLAN identifiers of the device and the connection didn't match."
+msgstr "Aygıtın VLAN tanımlayıcıları ile bağlantı eşleşmiyor."
+
+#: ../libnm/nm-device-vlan.c:134
+msgid "The hardware address of the device and the connection didn't match."
+msgstr "Aygıtın donanım adresi ve bağlantı eşleşmiyor."
+
+#: ../libnm/nm-device-wifi.c:482
+msgid "The connection was not a Wi-Fi connection."
+msgstr "Bağlantı bir kablosuz bağlantısı değildi."
+
+#: ../libnm/nm-device-wifi.c:518
+msgid "The device is lacking WPA capabilities required by the connection."
+msgstr "Aygıt bağlantının gerektirdiği WPA yetenekleri kaybediyor."
+
+#: ../libnm/nm-device-wifi.c:525
+msgid "The device is lacking WPA2/RSN capabilities required by the connection."
+msgstr "Aygıt bağlantının gerektirdiği WPA2/RSN yetenekleri kaybediyor."
+
+#: ../libnm/nm-device-wimax.c:301
+msgid "The connection was not a WiMAX connection."
+msgstr "Bağlantı bir WiMAX bağlantısı değildi."
+
+#: ../libnm/nm-device.c:2122
+#, c-format
+#| msgid "the connection was removed"
+msgid "The connection was not valid: %s"
+msgstr "Bağlantı geçerli değildi: %s"
+
+#: ../libnm/nm-device.c:2131
+#, c-format
+msgid "The interface names of the device and the connection didn't match."
+msgstr "Aygıtın arayüz isimleri ve bağlantı eşleşmiyor."
+
+#: ../libnm/nm-manager.c:1054
+#| msgid "Active connection details"
+msgid "Active connection removed before it was initialized"
+msgstr "Etkin bağlantı başlatılmadan kaldırıldı."
+
+#: ../libnm/nm-object.c:1434 ../libnm/nm-object.c:1580
+msgid "Caller did not specify D-Bus path for object"
+msgstr "Arayan nesne için D-Bus yolunu belirtmedi"
+
+#: ../libnm/nm-remote-settings.c:259
+msgid "Connection removed before it was initialized"
+msgstr "Bağlantı başlatılmadan kaldırıldı."
+
+#: ../libnm/nm-vpn-plugin-old.c:883
+#| msgid "Error: iface has to be specified."
+msgid "No service name specified"
+msgstr "Servis adı belirtilmedi"
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:1
msgid "Enable or disable system networking"
@@ -2856,170 +7917,158 @@ msgstr "Direşken sistemin adını değiştir"
msgid "System policy prevents modification of the persistent system hostname"
msgstr "Sistem kuralları, direşken sistemin adının değiştirilmesini önlüyor"
-#: ../src/main.c:130
+#. Translators: the first %s is a prefix for the connection id, such
+#. * as "Wired Connection" or "VPN Connection". The %d is a number
+#. * that is combined with the first argument to create a unique
+#. * connection id.
+#: ../src/NetworkManagerUtils.c:1158
+#, c-format
+msgctxt "connection id fallback"
+msgid "%s %d"
+msgstr "%s %d"
+
+#: ../src/main.c:135
#, c-format
-#| msgid "Failed to encrypt: %d."
msgid "Failed to set signal mask: %d"
msgstr "Sinyal maskeleme başarısız: %d."
-#: ../src/main.c:139
+#: ../src/main.c:144
#, c-format
msgid "Failed to create signal handling thread: %d"
-msgstr ""
+msgstr "Sinyal yakalama iş parçacığı oluşturma başarısız: %d"
-#: ../src/main.c:154
+#: ../src/main.c:159
#, c-format
msgid "Opening %s failed: %s\n"
msgstr "%s açılması başarısız: %s\n"
-#: ../src/main.c:160
+#: ../src/main.c:165
#, c-format
msgid "Writing to %s failed: %s\n"
msgstr "%s yazılması başarısız: %s\n"
-#: ../src/main.c:165
+#: ../src/main.c:170
#, c-format
msgid "Closing %s failed: %s\n"
msgstr "%s kapatılması başarısız: %s\n"
-#: ../src/main.c:208
+#: ../src/main.c:213
#, c-format
-#| msgid "Error: NetworkManager is not running."
msgid "NetworkManager is already running (pid %ld)\n"
msgstr "Hata: Ağ Yöneticisi zaten çalışıyor (pid %ld)\n"
-#: ../src/main.c:328
-#| msgid "NetworkManager status"
+#: ../src/main.c:366
msgid "Print NetworkManager version and exit"
msgstr "Ağ Yöneticisinin sürümünü yazdır ve çık"
-#: ../src/main.c:329
+#: ../src/main.c:367
msgid "Don't become a daemon"
-msgstr ""
+msgstr "Bir servis haline gelme"
-#: ../src/main.c:330
+#: ../src/main.c:368
+msgid "Don't become a daemon, and log to stderr"
+msgstr "Artalan işlemi olma be stderr üstüne günlükle"
+
+#: ../src/main.c:369
+#, c-format
+msgid "Log level: one of [%s]"
+msgstr "Günlükleme seviyesi: bir ['%s']"
+
+#: ../src/main.c:371
+#, c-format
+msgid "Log domains separated by ',': any combination of [%s]"
+msgstr "Günlükleme alanlar ',' ile ayrılmıştır: herhangi bi [%s]"
+
+#: ../src/main.c:373
msgid "Make all warnings fatal"
-msgstr ""
+msgstr "Bütün uyarıları ölümcül yap"
-#: ../src/main.c:331
+#: ../src/main.c:374
msgid "Specify the location of a PID file"
msgstr "PID dosyasının konumunu belirtin"
-#: ../src/main.c:331
+#: ../src/main.c:374
msgid "filename"
msgstr "dosya adı"
-#: ../src/main.c:332
+#: ../src/main.c:375
msgid "State file location"
-msgstr ""
+msgstr "Durum dosyası konumu"
-#: ../src/main.c:332
+#: ../src/main.c:375
msgid "/path/to/state.file"
-msgstr ""
-
-#: ../src/main.c:333
-msgid "Config file location"
-msgstr "Yapılandırma dosyasının konumu"
-
-#: ../src/main.c:333
-msgid "/path/to/config.file"
-msgstr "/yol/altyol/config.file"
-
-#: ../src/main.c:334
-msgid "List of plugins separated by ','"
-msgstr "Eklentilerin listesi (',' ile ayrılmış)"
-
-#: ../src/main.c:334
-msgid "plugin1,plugin2"
-msgstr "eklenti1,eklenti2"
-
-#. Translators: Do not translate the values in the square brackets
-#: ../src/main.c:336
-msgid "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
-msgstr ""
-
-#. Translators: Do not translate the values in the square brackets
-#: ../src/main.c:339
-msgid ""
-"Log domains separated by ',': any combination of\n"
-" [NONE,HW,RFKILL,ETHER,WIFI,"
-"BT,MB,DHCP4,DHCP6,PPP,\n"
-" WIFI_SCAN,IP4,IP6,AUTOIP4,"
-"DNS,VPN,SHARING,SUPPLICANT,\n"
-" AGENTS,SETTINGS,SUSPEND,"
-"CORE,DEVICE,OLPC,WIMAX,\n"
-" INFINIBAND,FIREWALL,ADSL]"
-msgstr ""
-
-#: ../src/main.c:345
-msgid "An http(s) address for checking internet connectivity"
-msgstr "İnternet bağlanılabilirliğini kontrol etmek için bir http(s) adresi"
-
-#: ../src/main.c:346
-msgid "The interval between connectivity checks (in seconds)"
-msgstr ""
-
-#: ../src/main.c:347
-msgid "The expected start of the response"
-msgstr ""
-
-#: ../src/main.c:347
-msgid "Bingo!"
-msgstr "Bingo!"
+msgstr "/dizin/yol/durum.dosyasi"
-#: ../src/main.c:352
+#: ../src/main.c:401
#, c-format
msgid "GModules are not supported on your platform!\n"
-msgstr ""
+msgstr "GModule leri platformunuzu desteklemiyor!\n"
-#: ../src/main.c:371
+#: ../src/main.c:406
+#, c-format
+msgid "You must be root to run NetworkManager!\n"
+msgstr "Ağ Yöneticisini çalıştırmak için kök iznine sahip olmalısınız\n"
+
+#: ../src/main.c:429
msgid ""
"NetworkManager monitors all network connections and automatically\n"
"chooses the best connection to use. It also allows the user to\n"
"specify wireless access points which wireless cards in the computer\n"
"should associate with."
msgstr ""
+"NetworkManager tüm bağlantılarınızı izler ve kullanım için en iyi olanını "
+"otomatik\n"
+"olarak seçer. Ayrıca kullanıcalara, bilgisayarlarındaki kablosuz kartları\n"
+"kullanarak, kablosuz erişim noktalarını belirtmelerine\n"
+"izin verir."
-#: ../src/main.c:377
+#: ../src/main.c:435 ../src/main.c:451
#, c-format
-msgid "Invalid option. Please use --help to see a list of valid options.\n"
+msgid "%s. Please use --help to see a list of valid options.\n"
msgstr ""
-"Geçersiz seçenek. Lütfen geçerli seçeneklerin listesini görmek için --help "
+"%s. Geçerli seçeneklerin bir listesini görmek için lütfen --help komutunu "
"kullanın.\n"
-#: ../src/main.c:387
+#: ../src/main.c:456
#, c-format
-msgid "You must be root to run NetworkManager!\n"
-msgstr "Ağ Yöneticisini çalıştırmak için kök iznine sahip olmalısınız\n"
+msgid "Ignoring unrecognized log domain(s) '%s' passed on command line.\n"
+msgstr ""
+"Komut satırına geçilen tanınmayan '%s' günlük etki alan(lar)ı yok sayılıyor."
+"\n"
-#: ../src/main.c:420
+#: ../src/main.c:507
#, c-format
-#| msgid "Failed to set IV for encryption: %s / %s."
msgid "Failed to read configuration: (%d) %s\n"
msgstr "Yapılandırma okunamıyor: (%d) %s\n"
-#: ../src/main.c:431
+#: ../src/main.c:521
#, c-format
-msgid "%s. Please use --help to see a list of valid options.\n"
+#| msgid "Error: Connection activation failed: %s."
+msgid "Error in configuration file: %s.\n"
+msgstr "Yapılandırma dosyasında hata: %s\n"
+
+#: ../src/main.c:526
+#, c-format
+msgid "Ignoring unrecognized log domain(s) '%s' from config files.\n"
msgstr ""
-"%s. Geçerli seçeneklerin bir listesini görmek için lütfen --help komutunu "
-"kullanın.\n"
+"Yapılandırma dosyalarındaki tanınmayan '%s' günlük etki alan(lar)ı yok "
+"sayılıyor.\n"
-#: ../src/main.c:438
+#: ../src/main.c:534
#, c-format
msgid "State file %s parsing failed: (%d) %s\n"
-msgstr ""
+msgstr "Durum dosyası %s ayrıştırması başarısız: (%d) %s\n"
-#: ../src/main.c:455
+#: ../src/main.c:547
#, c-format
msgid "Could not daemonize: %s [error %u]\n"
-msgstr ""
+msgstr "Artalan işlemi yapılamadı: %s [hata %u]\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:139
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:151
msgid "# Created by NetworkManager\n"
msgstr "# Ağ Yöneticisi Tarafından Oluşturuldu\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:146
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:158
#, c-format
msgid ""
"# Merged from %s\n"
@@ -3028,210 +8077,630 @@ msgstr ""
"# %s'den birleÅŸmiÅŸ\n"
"\n"
-#: ../src/dhcp-manager/nm-dhcp-manager.c:264
+#: ../src/dhcp-manager/nm-dhcp-manager.c:292
msgid "no usable DHCP client could be found."
msgstr "kullanılabilir bir DHCP istemcisi bulunamadı."
-#: ../src/dhcp-manager/nm-dhcp-manager.c:273
-msgid "'dhclient' could be found."
-msgstr "'dhclient' bulunamadı."
+#: ../src/dhcp-manager/nm-dhcp-manager.c:301
+#| msgid "'dhclient' could be found."
+msgid "'dhclient' could not be found or was disabled."
+msgstr "'dhclient' bulunamadı veya kapalı."
-#: ../src/dhcp-manager/nm-dhcp-manager.c:283
-msgid "'dhcpcd' could be found."
-msgstr "'dhcpcd' bulunamadı."
+#: ../src/dhcp-manager/nm-dhcp-manager.c:311
+#| msgid "'dhcpcd' could be found."
+msgid "'dhcpcd' could not be found or was disabled."
+msgstr "'dhcpcd' bulunamadı veya kapalı."
-#: ../src/dhcp-manager/nm-dhcp-manager.c:291
+#: ../src/dhcp-manager/nm-dhcp-manager.c:322
#, c-format
msgid "unsupported DHCP client '%s'"
msgstr "desteklenmeyen DHCP istemcisi '%s'"
-#: ../src/dns-manager/nm-dns-manager.c:376
+#: ../src/dns-manager/nm-dns-manager.c:374
msgid "NOTE: the libc resolver may not support more than 3 nameservers."
msgstr "NOT: libc çözücü 3'den fazla sunucu adını desteklemeyebilir."
-#: ../src/dns-manager/nm-dns-manager.c:378
+#: ../src/dns-manager/nm-dns-manager.c:376
msgid "The nameservers listed below may not be recognized."
msgstr "Aşağıda listelenen sunucu adları tanınmayabilir."
-#: ../src/logging/nm-logging.c:142
-#, c-format
-msgid "Unknown log level '%s'"
-msgstr "Bilinmeyen kayıt seviyesi '%s'"
+#: ../src/devices/adsl/nm-device-adsl.c:127
+#| msgid "ADSL connection %d"
+msgid "ADSL connection"
+msgstr "ADSL bağlantısı"
-#: ../src/logging/nm-logging.c:188
+#: ../src/devices/bluetooth/nm-bluez-device.c:193
#, c-format
-msgid "Unknown log domain '%s'"
-msgstr "Bilinmeyen kayıt etki alanı '%s'"
+msgid "%s Network"
+msgstr "%s Ağı"
-#: ../src/modem-manager/nm-modem-cdma.c:255
-#: ../src/modem-manager/nm-modem-broadband.c:512 ../src/nm-device-bt.c:331
-#, c-format
-msgid "CDMA connection %d"
-msgstr "CDMA bağlantısı %d"
+#: ../src/devices/bluetooth/nm-device-bt.c:248
+msgid "PAN requested, but Bluetooth device does not support NAP"
+msgstr "PAN isteği yapıldı, ancak Bluetooth aygıtı NAP desteklemiyor"
-#: ../src/modem-manager/nm-modem-gsm.c:531
-#: ../src/modem-manager/nm-modem-broadband.c:490 ../src/nm-device-bt.c:327
-#, c-format
-msgid "GSM connection %d"
-msgstr "GSM bağlantısı %d"
+#: ../src/devices/bluetooth/nm-device-bt.c:258
+msgid "PAN connections cannot specify GSM, CDMA, or serial settings"
+msgstr "PAN bağlantıları GSM, CDMA ya da seri ayarlar belirtmiyor"
-#: ../src/nm-device-bond.c:166
-#, c-format
-#| msgid "Wired connection %d"
-msgid "Bond connection %d"
-msgstr "Bond bağlantısı %d"
+#: ../src/devices/bluetooth/nm-device-bt.c:271
+#| msgid "PAN connection %d"
+msgid "PAN connection"
+msgstr "PAN bağlantısı"
-#: ../src/nm-device-adsl.c:196
-#, c-format
+#: ../src/devices/bluetooth/nm-device-bt.c:278
+msgid "DUN requested, but Bluetooth device does not support DUN"
+msgstr "DUN isteği yapıldı, ancak Bluetooth aygıtı DUN desteklemiyor"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:288
+msgid "DUN connection must include a GSM or CDMA setting"
+msgstr "DUN bağlantısı bir GSM ya da CDMA ayarı içermek zorundadır"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:298
+#: ../src/devices/wwan/nm-modem-broadband.c:485
#| msgid "GSM connection %d"
-msgid "ADSL connection %d"
-msgstr "ADSL bağlantısı %d"
+msgid "GSM connection"
+msgstr "GSM bağlantısı"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:302
+#: ../src/devices/wwan/nm-modem-broadband.c:508
+#| msgid "CDMA connection %d"
+msgid "CDMA connection"
+msgstr "CDMA bağlantısı"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:306
+#| msgid "DUN connection %d"
+msgid "DUN connection"
+msgstr "DUN bağlantısı"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:311
+msgid "Unknown/unhandled Bluetooth connection type"
+msgstr "Bilinmeyen/yakalanmamoş Bluetooth bağlantı tipi"
+
+#: ../src/devices/bluetooth/nm-device-bt.c:331
+#: ../src/devices/nm-device-ethernet.c:1438
+#: ../src/devices/nm-device-infiniband.c:196
+#: ../src/devices/wifi/nm-device-wifi.c:1121
+#: ../src/devices/wimax/nm-device-wimax.c:448
+#| msgid "no active connection or device"
+msgid "connection does not match device"
+msgstr "bağlantı aygıtla eşleşmiyor"
-#: ../src/nm-device-bridge.c:164
-#, c-format
-#| msgid "Wired connection %d"
-msgid "Bridge connection %d"
-msgstr "Köprü bağlantısı %d"
+#: ../src/devices/nm-device-bond.c:124
+#| msgid "Bond connection %d"
+msgid "Bond connection"
+msgstr "Bond bağlantısı"
-#: ../src/nm-device-bt.c:302
-#, c-format
-msgid "PAN connection %d"
-msgstr "PAN bağlantısı %d"
+#: ../src/devices/nm-device-bridge.c:131
+#| msgid "Bridge connection %d"
+msgid "Bridge connection"
+msgstr "Köprü bağlantısı"
-#: ../src/nm-device-bt.c:335
-#, c-format
-msgid "DUN connection %d"
-msgstr "DUN bağlantısı %d"
+#: ../src/devices/nm-device-ethernet.c:1421
+#| msgid "PPPoE connection %d"
+msgid "PPPoE connection"
+msgstr "PPPoE bağlantısı"
-#: ../src/nm-device-ethernet.c:1294
-#, c-format
-msgid "PPPoE connection %d"
-msgstr "PPPoE bağlantısı %d"
+#: ../src/devices/nm-device-ethernet.c:1421
+#| msgid "Wired connection %d"
+msgid "Wired connection"
+msgstr "Kablolu bağlantı"
-#: ../src/nm-device-ethernet.c:1294 ../src/settings/nm-settings-utils.c:50
+#: ../src/devices/nm-device-ethernet-utils.c:38
#, c-format
msgid "Wired connection %d"
msgstr "Kablolu bağlantı %d"
-#: ../src/nm-device-infiniband.c:270
+#: ../src/devices/nm-device-infiniband.c:178
+#| msgid "InfiniBand connection %d"
+msgid "InfiniBand connection"
+msgstr "InfiniBand bağlantısı"
+
+#: ../src/devices/nm-device-vlan.c:216
+#| msgid "VLAN connection %d"
+msgid "VLAN connection"
+msgstr "VLAN bağlatısı"
+
+#: ../src/devices/team/nm-device-team.c:134
+#| msgid "Active connections"
+msgid "Team connection"
+msgstr "Takım bağlantı"
+
+#: ../src/devices/wifi/nm-device-olpc-mesh.c:150
+#| msgid "Mesh %d"
+msgid "Mesh"
+msgstr "Mesh"
+
+#: ../src/devices/wifi/nm-device-wifi.c:1091
+msgid "WPA Ad-Hoc disabled due to kernel bugs"
+msgstr "WPA Ad-Hoc çekirdek hataları nedeniyle kapatıldı"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:43
#, c-format
-msgid "InfiniBand connection %d"
-msgstr "InfiniBand bağlantısı %d"
+#| msgid "device '%s' not compatible with connection '%s'"
+msgid "%s is incompatible with static WEP keys"
+msgstr "%s, statik WEP anahtarları ile uyumlu değili"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:77
+msgid "LEAP authentication requires a LEAP username"
+msgstr "LEAP kimlik doğrulaması, LEAP kullanıcı adı istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:87
+msgid "LEAP username requires 'leap' authentication"
+msgstr "LEAP kullanıcı adı 'leap' kimlik doğrulama istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:100
+msgid "LEAP authentication requires IEEE 802.1x key management"
+msgstr "LEAP kimli doğrulaması, IEEE 802.1x anahtar yönetimi istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:120
+msgid "LEAP authentication is incompatible with Ad-Hoc mode"
+msgstr "LEAP kimlik doğrulaması, Ad-Hoc kipi ile uyumlu değil"
-#: ../src/nm-device-olpc-mesh.c:304
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:132
+msgid "LEAP authentication is incompatible with 802.1x setting"
+msgstr "LEAP kimlik doğrulaması 802.1x ayarı ile uyumlu değil"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:154
#, c-format
-msgid "Mesh %d"
-msgstr "Mesh %d"
+msgid "a connection using '%s' authentication cannot use WPA key management"
+msgstr ""
+"'%s' kimlik doğrulamasını kullanan bir bağlantı, WPA anahtar yönetimi "
+"kullanamaz"
-#: ../src/nm-device-vlan.c:310
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:165
#, c-format
-#| msgid "PAN connection %d"
-msgid "VLAN connection %d"
-msgstr "VLAN bağlatısı %d"
+msgid "a connection using '%s' authentication cannot specific WPA protocols"
+msgstr ""
+"'%s' kimlik doğrulamasını kullanan bir bağlantı WPA protokollerini kullanamaz"
-#: ../src/nm-manager.c:751
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:181
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:198
#, c-format
-msgid "VPN connection %d"
-msgstr "VPN bağlantısı %d"
+msgid "a connection using '%s' authentication cannot specific WPA ciphers"
+msgstr "'%s' kimlik doğrulamasını kullanan bir bağlantı WPA şifresi belirtemez"
-#: ../src/nm-netlink-monitor.c:162 ../src/nm-netlink-monitor.c:286
-#: ../src/nm-netlink-monitor.c:671
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:210
#, c-format
-msgid "error processing netlink message: %s"
-msgstr "netlink iletisinin iÅŸlenmesinde hata: %s"
+msgid "a connection using '%s' authentication cannot specific a WPA password"
+msgstr "'%s' kimlik doğrulaması kullanan bir bağlantı WPA parolası belirtemez"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:241
+msgid "Dynamic WEP requires an 802.1x setting"
+msgstr "Devingen WEP için bir 802.1x ayarı gerekli"
-#: ../src/nm-netlink-monitor.c:265
-msgid "error occurred while waiting for data on socket"
-msgstr "yuva üzerinde veri beklenirken hata oluştu"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:251
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:279
+msgid "Dynamic WEP requires 'open' authentication"
+msgstr "Devingen WEP için 'open' kimlik doğrulama gerekli"
-#: ../src/nm-netlink-monitor.c:310
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:266
+msgid "Dynamic WEP requires 'ieee8021x' key management"
+msgstr "Devingen WEP için 'ieee8021x' anahtar yönetimi gerekli"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:313
+msgid "WPA-PSK authentication is incompatible with 802.1x"
+msgstr "WPA-PSK kimlik doğrulaması 802.1x ile uyumlu değil"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:323
+msgid "WPA-PSK requires 'open' authentication"
+msgstr "WPA-PSK için 'open' kimlik doğrulama gerekli"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:335
+msgid "WPA Ad-Hoc authentication requires an Ad-Hoc mode AP"
+msgstr "WPA Ad-Hoc kimli doğrulaması, bir Ad-Hoc kipi AP istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:348
+msgid "WPA Ad-Hoc authentication requires 'wpa' protocol"
+msgstr "WPA Ad-Hoc kimlik doğrulamas 'wpa' protokolü istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:360
+msgid "WPA Ad-Hoc authentication requires 'none' pairwise cipher"
+msgstr "WPA Ad-Hoc kimlik doğrulaması 'none ' ikili şifrelemesi istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:372
+msgid "WPA Ad-Hoc requires 'tkip' group cipher"
+msgstr "WPA Ad-Hoc 'tkip' grup ÅŸifrelemesi istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:386
+msgid "Access point does not support PSK but setting requires it"
+msgstr "Erişim noktası PSK desteklemiyor, ancak ayar onu istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:416
+msgid "WPA-EAP authentication requires an 802.1x setting"
+msgstr "WPA-EAP kimlik doğrulaması 802.1x ayarı istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:426
+msgid "WPA-EAP requires 'open' authentication"
+msgstr "WPA-EAP 'open' kimlik doğrulaması istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:437
+msgid "802.1x setting requires 'wpa-eap' key management"
+msgstr "802.1x ayarı 'wpa-eap' anahtar yönetimi istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:450
+msgid "Access point does not support 802.1x but setting requires it"
+msgstr "Erişim noktası 802.1x desteklemiyor, ancak ayar onu istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:478
+msgid ""
+"Access point mode is Ad-Hoc but setting requires Infrastructure security"
+msgstr "Erişim noktası kipi Ad-Hoc ancak ayar altyapı güvenliği istiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:488
+msgid "Ad-Hoc mode is incompatible with 802.1x security"
+msgstr "Ad-Hoc kipi, 802.1x güvenliği ile uyumlu değil"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:497
+msgid "Ad-Hoc mode is incompatible with LEAP security"
+msgstr "Ad-Hoc kipi, LEAP güvenliği ile uyumlu değil"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:507
+msgid "Ad-Hoc mode requires 'open' authentication"
+msgstr "Ad-Hoc kipi için 'open' kimlik doğrulama gerekli"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:517
+msgid ""
+"Access point mode is Infrastructure but setting requires Ad-Hoc security"
+msgstr ""
+"Erişim noktası kipi bir altyapı ancak ayar için Ad-Hoc güvenliği gerekli"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:559
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:589
#, c-format
-msgid "unable to connect to netlink for monitoring link status: %s"
-msgstr "bağ durumunu izlemek için netlink'e bağlanılamadı: %s"
+msgid "connection does not match access point"
+msgstr "bağlantı, erişim noktası ile eşleşmiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:613
+msgid "Access point is unencrypted but setting specifies security"
+msgstr "Erişim noktası şifresiz ama ayar bir güvenlik belirtiyor"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:702
+msgid ""
+"WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic "
+"WEP"
+msgstr ""
+"WPA kimlik doğrulaması, non-EAP (özgün) LEAP ya da Devingen WEP ile uyumlu "
+"deÄŸil"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:712
+msgid "WPA authentication is incompatible with Shared Key authentication"
+msgstr ""
+"WPA kimlik doğrulama Paylaşımlı Anahtar kimlik doğrulaması ile uyumlu değil"
+
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:759
+#| msgid "Failed to set symmetric key for decryption."
+msgid "Failed to determine AP security information"
+msgstr "Erişim noktası güvenlik bilgisi belirleme başarısız"
+
+#: ../src/devices/wwan/nm-modem-broadband.c:472
+msgid "GSM mobile broadband connection requires a 'gsm' setting"
+msgstr "GSM mobile geniş bant bağlantısı 'gsm' ayarı istiyor"
+
+#: ../src/nm-config.c:352
+msgid "Config file location"
+msgstr "Yapılandırma dosyasının konumu"
+
+#: ../src/nm-config.c:352
+msgid "/path/to/config.file"
+msgstr "/yol/altyol/config.file"
+
+#: ../src/nm-config.c:353
+#| msgid "Config file location"
+msgid "Config directory location"
+msgstr "Yapılandırma dizini konumu"
+
+#: ../src/nm-config.c:353
+#| msgid "/path/to/config.file"
+msgid "/path/to/config/dir"
+msgstr "/yol/dizin/yapilandirma.dosyasi"
-#: ../src/nm-netlink-monitor.c:321
+#: ../src/nm-config.c:355
+msgid "List of plugins separated by ','"
+msgstr "Eklentilerin listesi (',' ile ayrılmış)"
+
+#: ../src/nm-config.c:355
+msgid "plugin1,plugin2"
+msgstr "eklenti1,eklenti2"
+
+#. These three are hidden for now, and should eventually just go away.
+#: ../src/nm-config.c:358
+msgid "An http(s) address for checking internet connectivity"
+msgstr "İnternet bağlanılabilirliğini kontrol etmek için bir http(s) adresi"
+
+#: ../src/nm-config.c:359
+msgid "The interval between connectivity checks (in seconds)"
+msgstr "Bağlantı kontrolleri aralığı süresi (saniye cinsinden)"
+
+#: ../src/nm-config.c:360
+msgid "The expected start of the response"
+msgstr "Yanıtın beklenen başlangıcı"
+
+#: ../src/nm-config.c:360
+msgid "Bingo!"
+msgstr "Bingo!"
+
+#: ../src/nm-logging.c:137
#, c-format
-msgid "unable to enable netlink handle credential passing: %s"
-msgstr "kimlik gönderimi için ağ köprüsü etkinleştirilemiyor: %s"
+msgid "Unknown log level '%s'"
+msgstr "Bilinmeyen kayıt seviyesi '%s'"
-#: ../src/nm-netlink-monitor.c:364 ../src/nm-netlink-monitor.c:424
+#: ../src/nm-logging.c:219
#, c-format
-msgid "unable to allocate netlink handle for monitoring link status: %s"
-msgstr "adres durumunu izlemek için ağ-adresi paylaşımı yapılamadı: %s"
+msgid "Unknown log domain '%s'"
+msgstr "Bilinmeyen kayıt etki alanı '%s'"
-#: ../src/nm-netlink-monitor.c:449
+#: ../src/nm-manager.c:3360
+#| msgid "VPN connecting"
+msgid "VPN connection"
+msgstr "VPN bağlantısı"
+
+#: ../src/nm-sleep-monitor-systemd.c:114
+#| msgid "NetworkManager status"
+msgid "NetworkManager needs to turn off networks"
+msgstr "NetworkManager 'ın ağları kapatması gerekiyor"
+
+#: ../src/settings/plugins/ibft/plugin.c:65
#, c-format
-msgid "unable to allocate netlink link cache for monitoring link status: %s"
-msgstr ""
-"adres durumunu izlemek için ağ-adresi adres belleği paylaşımı yapılamadı: %s"
+msgid "ibft: failed to read iscsiadm records: %s"
+msgstr "ibft: iscsiadm kayıtlarını okuma başarısız: %s"
-#: ../src/nm-netlink-monitor.c:541
+#: ../src/settings/plugins/ibft/plugin.c:73
#, c-format
-msgid "unable to join netlink group: %s"
-msgstr "netlink kümesine girilemedi: %s"
+#| msgid "Wired connection %d"
+msgid "ibft: read connection '%s'"
+msgstr "ibft: okuma bağlantısı '%s'"
-#: ../src/nm-netlink-monitor.c:647 ../src/nm-netlink-monitor.c:660
+#: ../src/settings/plugins/ibft/plugin.c:79
#, c-format
-msgid "error updating link cache: %s"
-msgstr "bağ önbelleğinin güncellenmesinde hata: %s"
+msgid "ibft: failed to read iscsiadm record: %s"
+msgstr "ibft: iscsiadm kaydı okuma başarısız: %s"
-#: ../src/settings/plugins/ifcfg-rh/reader.c:110
+#: ../src/settings/plugins/ifcfg-rh/reader.c:112
msgid "System"
msgstr "Sistem"
-#: ../src/settings/plugins/ifcfg-rh/reader.c:3680
-msgid "Bond"
-msgstr "BaÄŸ"
+#~| msgid "TKIP"
+#~ msgid "IP"
+#~ msgstr "IP"
-#: ../src/settings/plugins/ifcfg-rh/reader.c:3868
-msgid "Bridge"
-msgstr "Köprü"
+#, fuzzy
+#~| msgid ""
+#~| "Usage: nmcli con { COMMAND | help }\n"
+#~| " COMMAND := { list | status | up | down | delete }\n"
+#~| "\n"
+#~| " list [id <id> | uuid <id>]\n"
+#~| " status\n"
+#~| " up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [nsp <name>] [--"
+#~| "nowait] [--timeout <timeout>]\n"
+#~| " up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--"
+#~| "timeout <timeout>]\n"
+#~| " down id <id> | uuid <id>\n"
+#~| " delete id <id> | uuid <id>\n"
+#~ msgid ""
+#~ "Usage: nmcli connection { COMMAND | help }\n"
+#~ " COMMAND := { list | status | up | down | delete }\n"
+#~ "\n"
+#~ " list [id <id> | uuid <id>]\n"
+#~ " status [id <id> | uuid <id> | path <path>]\n"
+#~ " up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [nsp <name>] [--"
+#~ "nowait] [--timeout <timeout>]\n"
+#~ " up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--"
+#~ "timeout <timeout>]\n"
+#~ " down id <id> | uuid <id>\n"
+#~ " delete id <id> | uuid <id>\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Kullanımı: nmcli con { KOMUT | help }\n"
+#~ " KOMUT := { list | status | up | down | delete }\n"
+#~ "\n"
+#~ " list [id <id> | uuid <id>]\n"
+#~ " status\n"
+#~ " up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [nsp <isim>] [--"
+#~ "nowait] [--timeout <zamanaşımı>]\n"
+#~ " up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--"
+#~ "timeout <zamanaşımı>]\n"
+#~ " down id <id> | uuid <id>\n"
+#~ " delete id <id> | uuid <id>\n"
-#: ../test/nm-online.c:111
-#, c-format
-#| msgid "connecting"
-msgid "\rConnecting"
-msgstr "\rBağlanıyor"
+#~ msgid "Error: 'con list': %s; allowed fields: %s"
+#~ msgstr "Hata: 'bağlantı listesi': %s; izin verilen alanlar :%s"
-#: ../test/nm-online.c:142
-msgid "Time to wait for a connection, in seconds (default is 30)"
-msgstr "Bağlantı için bekleme zamanı, saniye cinsinden (varsayılan 30)"
+#~ msgid "Error: no valid parameter specified."
+#~ msgstr "Hata: geçerli bir değiştirge belirtilmedi."
-#: ../test/nm-online.c:143
-#| msgid "Error: NetworkManager is not running."
-msgid "Exit immediately if NetworkManager is not running or connecting"
-msgstr "Eğer Ağ Yöneticisi çalışmıyor ya da bağlanmıyorsa hemen çık"
+#~ msgid "Error: Can't find out if NetworkManager is running: %s."
+#~ msgstr "Hata: Ağ Yöneticisi çalışıyorsa bulunamıyor: %s"
-#: ../test/nm-online.c:144
-msgid "Don't print anything"
-msgstr "Herhangi bir şey yazdırma"
+#~| msgid "Unknown parameter: %s\n"
+#~ msgid "Error: unknown parameter: %s"
+#~ msgstr "Hata: bilinmeyen parametre: %s"
-#: ../test/nm-online.c:162
-msgid "Waits for a successful connection in NetworkManager."
-msgstr "Ağ Yöneticisi başarılı bir bağlantı için bekliyor"
+#~ msgid "Error: id or uuid has to be specified."
+#~ msgstr "Hata: id veya uuid deÄŸeri belirtilmeli."
-#: ../test/nm-online.c:168 ../test/nm-online.c:177
-#| msgid "Invalid option. Please use --help to see a list of valid options.\n"
-msgid "Invalid option. Please use --help to see a list of valid options."
-msgstr ""
-"Geçersiz seçenek. Lütfen geçerli seçeneklerin listesini görmek için --help "
-"parametresini kullanın."
+#~ msgid "Error: No suitable device found: %s."
+#~ msgstr "Hata: Uygun bir aygıt bulunamadı: %s."
+
+#~ msgid "Error: No suitable device found."
+#~ msgstr "Hata: Uygun bir aygıt bulunamadı."
+
+#~ msgid "Warning: Connection not active\n"
+#~ msgstr "Uyarı: Bağlantı etkin değil\n"
+
+#~ msgid "Error: could not connect to D-Bus."
+#~ msgstr "Hata: D-Bus'a bağlanılamadı."
+
+#~ msgid "Error: Could not get system settings."
+#~ msgstr "Hata: Sistem ayarları alınamadı."
+
+#~ msgid "Error: Can't obtain connections: settings service is not running."
+#~ msgstr "Hata: Bağlantılar alınamıyor: ayarlar hizmeti çalışmıyor."
+
+#~ msgid "Encrypted: "
+#~ msgstr "Åžifreli: "
+
+#~ msgid "WPA "
+#~ msgstr "WPA "
+
+#~ msgid "WPA2 "
+#~ msgstr "WPA2 "
+
+#~ msgid "Infrastructure"
+#~ msgstr "Altyapı"
+
+#~ msgid "Error: 'dev list': %s; allowed fields: %s"
+#~ msgstr "Hata: 'dev list':%s; izin verilen alanlar :%s"
+
+#~ msgid "not connected"
+#~ msgstr "bağlı değil"
+
+#~ msgid "Error: 'dev status': %s; allowed fields: %s"
+#~ msgstr "Hata: 'dev status': %s; izin verilen alanlar: %s"
+
+#~ msgid "Error: 'dev wimax': %s; allowed fields: %s"
+#~ msgstr "Hara: 'dev wimax': %s; izin verilen alanlar: %s"
+
+#~ msgid "NET-ENABLED"
+#~ msgstr "NET-ENABLED"
+
+#~ msgid "WIFI-HARDWARE"
+#~ msgstr "WIFI-DONANIM"
+
+#~ msgid "WWAN-HARDWARE"
+#~ msgstr "WWAN-DONANIM"
+
+#~ msgid "WIMAX-HARDWARE"
+#~ msgstr "WIMAX-DONANIMI"
+
+#~ msgid "Error: 'nm status': %s; allowed fields: %s"
+#~ msgstr "Hata: 'nm status': %s; izin verilen alanlar: %s"
+
+#~ msgid "not running"
+#~ msgstr "çalışmıyor"
+
+#~| msgid "Error: 'nm status': %s; allowed fields: %s"
+#~ msgid "Error: 'nm permissions': %s; allowed fields: %s"
+#~ msgstr "Hata: 'nm izinleri': %s; izin verilen alanlar: %s"
+
+#~ msgid "Error: Couldn't connect to system bus: %s"
+#~ msgstr "Hata: Sistem veri yoluna bağlanamadı: %s"
+
+#~ msgid "Error: Couldn't create D-Bus object proxy."
+#~ msgstr "Hata: D-Bus nesnesi proxy oluşturamadı."
+
+#~ msgid "Error in sleep: %s"
+#~ msgstr "Uyku hatası: %s"
+
+#~ msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'."
+#~ msgstr ""
+#~ "Hata: geçersiz 'enable' parametresi: %s'; kullanım 'true' yada 'false'."
+
+#~ msgid "Error: Sleeping status is not exported by NetworkManager."
+#~ msgstr "Hata: Uyku durumu Ağ Yöneticisi ile verilemez."
+
+#~ msgid "WiFi enabled"
+#~ msgstr "WiFi etkin"
+
+#~ msgid "WWAN enabled"
+#~ msgstr "WWAN etkin"
+
+#~ msgid "WiMAX enabled"
+#~ msgstr "WiMAX etkin"
+
+#~ msgid "Error: invalid 'wimax' parameter: '%s'."
+#~ msgstr "Hata: geçersiz 'wimax' değiştirgesi: '%s'."
+
+#~ msgid "Caught signal %d, shutting down..."
+#~ msgstr "%d sinyali yakalandı, kapatılıyor..."
+
+#~ msgid "0 (unknown)"
+#~ msgstr "0 (bilinmeyen)"
+
+#~ msgid "any, "
+#~ msgstr "herhangi, "
+
+#~ msgid "900 MHz, "
+#~ msgstr "900 MHz, "
+
+#~ msgid "1800 MHz, "
+#~ msgstr "1800 MHz, "
+
+#~ msgid "1900 MHz, "
+#~ msgstr "1900 MHz, "
+
+#~ msgid "850 MHz, "
+#~ msgstr "850 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 2100 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 2100 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 1800 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1800 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 800 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 800 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 850 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 850 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 900 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 900 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 1700 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1700 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 1900 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1900 MHz, "
+
+#~ msgid "WCDMA 3GPP UMTS 2600 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 2600 MHz, "
+
+#~ msgid "Error: Couldn't create D-Bus object proxy for org.freedesktop.DBus"
+#~ msgstr "Hata: D-Bus nesnesi proxy için org.freedesktop.DBus oluşturulamadı"
+
+#~ msgid "Error: NameHasOwner request failed: %s"
+#~ msgstr "Hata: NameHasOwner isteği başarısız oldu: %s"
+
+#~ msgid "Invalid option. Please use --help to see a list of valid options.\n"
+#~ msgstr ""
+#~ "Geçersiz seçenek. Lütfen geçerli seçeneklerin listesini görmek için --"
+#~ "help kullanın.\n"
+
+#~ msgid "error processing netlink message: %s"
+#~ msgstr "netlink iletisinin iÅŸlenmesinde hata: %s"
+
+#~ msgid "error occurred while waiting for data on socket"
+#~ msgstr "yuva üzerinde veri beklenirken hata oluştu"
+
+#~ msgid "unable to connect to netlink for monitoring link status: %s"
+#~ msgstr "bağ durumunu izlemek için netlink'e bağlanılamadı: %s"
+
+#~ msgid "unable to enable netlink handle credential passing: %s"
+#~ msgstr "kimlik gönderimi için ağ köprüsü etkinleştirilemiyor: %s"
+
+#~ msgid "unable to allocate netlink handle for monitoring link status: %s"
+#~ msgstr "adres durumunu izlemek için ağ-adresi paylaşımı yapılamadı: %s"
+
+#~ msgid "unable to allocate netlink link cache for monitoring link status: %s"
+#~ msgstr ""
+#~ "adres durumunu izlemek için ağ-adresi adres belleği paylaşımı yapılamadı: "
+#~ "%s"
+
+#~ msgid "error updating link cache: %s"
+#~ msgstr "bağ önbelleğinin güncellenmesinde hata: %s"
+
+#~ msgid "Waits for a successful connection in NetworkManager."
+#~ msgstr "Ağ Yöneticisi başarılı bir bağlantı için bekliyor"
#~ msgid "state: %s\n"
#~ msgstr "durum: %s\n"
-#~ msgid "Connection activated\n"
-#~ msgstr "Bağlantı etkinleştirildi\n"
-
#~ msgid "state: %s (%d)\n"
#~ msgstr "durum: %s (%d)\n"
-#~ msgid "Active connection state: %s\n"
-#~ msgstr "Etkin bağlantı durumu: %s\n"
-
-#~ msgid "Active connection path: %s\n"
-#~ msgstr "Etkin bağlantı yolu: %s\n"
-
#~ msgid "IP4-SETTINGS"
#~ msgstr "IP4-AYARLAR"
@@ -3271,18 +8740,12 @@ msgstr ""
#~ msgid "Not enough memory to make encryption key."
#~ msgstr "Şifreleme anahtarı yapmak için yeterli bellek yok."
-#~ msgid "Could not allocate memory for PEM file creation."
-#~ msgstr "PEM dosya oluşturma için bellek ayrılamadı."
-
#~ msgid "Could not allocate memory for writing IV to PEM file."
#~ msgstr "IV'ü PEM dosyasına yazmak için bellek ayrılamadı."
#~ msgid "Could not allocate memory for writing encrypted key to PEM file."
#~ msgstr "Şifrelenmiş anahtarı PEM dosyasına yazmak için bellek ayrılamadı."
-#~ msgid "Could not allocate memory for PEM file data."
-#~ msgstr "PEM dosyası verisi için bellek ayrılamadı."
-
#~ msgid "Allow use of user-specific connections"
#~ msgstr "Kullanıcı tanımlı bağlantılara izin ver"
diff --git a/po/uk.po b/po/uk.po
index eff91f3ab4..04358d892c 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -1,14 +1,15 @@
# Copyright (C) 2011 Free Software Foundation, Inc.
# This file is distributed under the same license as the NetworkManager package.
#
-# Yuri Chornoivan <yurchor@ukr.net>, 2011, 2012, 2013, 2014.
+#: ../src/nm-iface-helper.c:297
+# Yuri Chornoivan <yurchor@ukr.net>, 2011, 2012, 2013, 2014, 2015.
msgid ""
msgstr ""
-"Project-Id-Version: \n"
+"Project-Id-Version: NetworkManager\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=NetworkManager&keywords=I18N+L10N&component=Translations\n"
-"POT-Creation-Date: 2014-06-24 10:05+0000\n"
-"PO-Revision-Date: 2014-06-24 19:45+0300\n"
+"POT-Creation-Date: 2015-02-02 11:29+0000\n"
+"PO-Revision-Date: 2015-02-02 14:30+0200\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <kde-i18n-uk@kde.org>\n"
"Language: uk\n"
@@ -19,93 +20,159 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n"
"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
-#: ../cli/src/common.c:38 ../cli/src/common.c:50 ../cli/src/common.c:58
-#: ../cli/src/common.c:69 ../cli/src/connections.c:193
-#: ../cli/src/connections.c:215
+#: ../clients/cli/agent.c:42
+#, c-format
+msgid ""
+"Usage: nmcli agent { COMMAND | help }\n"
+"\n"
+"COMMAND := { secret | polkit | all }\n"
+"\n"
+msgstr ""
+"КориÑтуваннÑ: nmcli agent { КОМÐÐДР| help }\n"
+"\n"
+"КОМÐÐДР:= { secret | polkit | all }\n"
+"\n"
+
+#: ../clients/cli/agent.c:50
+#, c-format
+msgid ""
+"Usage: nmcli agent secret { help }\n"
+"\n"
+"Runs nmcli as NetworkManager secret agent. When NetworkManager requires\n"
+"a password it asks registered agents for it. This command keeps nmcli "
+"running\n"
+"and if a password is required asks the user for it.\n"
+"\n"
+msgstr ""
+"КориÑтуваннÑ: nmcli agent secret { help }\n"
+"\n"
+"ЗапуÑкає nmcli у режимі агента реєÑтраційних даних NetworkManager. Якщо\n"
+"NetworkManager потрібен буде пароль, ÑиÑтема проÑитиме агентів надати\n"
+"його. Ð¦Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° підтримуватиме nmcli у запущеному Ñтані Ñ–, Ñкщо\n"
+"знадобитьÑÑ Ð¿Ð°Ñ€Ð¾Ð»ÑŒ, запитуватиме про нього у кориÑтувача.\n"
+"\n"
+
+#: ../clients/cli/agent.c:60
+#, c-format
+msgid ""
+"Usage: nmcli agent polkit { help }\n"
+"\n"
+"Registers nmcli as a polkit action for the user session.\n"
+"When a polkit daemon requires an authorization, nmcli asks the user and "
+"gives\n"
+"the response back to polkit.\n"
+"\n"
+msgstr ""
+"КориÑтуваннÑ: nmcli agent polkit { help }\n"
+"\n"
+"ЗареєÑтрувати nmcli Ñк дію polkit Ð´Ð»Ñ ÑеанÑу кориÑтувача.\n"
+"Коли фоновій Ñлужбі polkit потрібне буде уповноваженнÑ, nmcli надішле "
+"кориÑтувачеві\n"
+"запит Ñ– передаÑÑ‚ÑŒ відповідь на нього polkit.\n"
+"\n"
+
+#: ../clients/cli/agent.c:70
+#, c-format
+msgid ""
+"Usage: nmcli agent all { help }\n"
+"\n"
+"Runs nmcli as both NetworkManager secret and a polkit agent.\n"
+"\n"
+msgstr ""
+"КориÑтуваннÑ: nmcli agent all { help }\n"
+"\n"
+"ЗапуÑтити nmcli Ñк агент паролів NetworkManager та polkit.\n"
+"\n"
+
+#: ../clients/cli/agent.c:152
+#, c-format
+msgid "nmcli successfully registered as a NetworkManager's secret agent.\n"
+msgstr "nmcli уÑпішно зареєÑтровано Ñк агент паролів NetworkManager.\n"
+
+#: ../clients/cli/agent.c:154
+#, c-format
+msgid "Error: secret agent initialization failed"
+msgstr "Помилка: не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ агент обробки паролів"
+
+#: ../clients/cli/agent.c:169
+#, c-format
+msgid "Error: polkit agent initialization failed: %s"
+msgstr "Помилка: не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ агент polkit: %s"
+
+#: ../clients/cli/agent.c:177
+#, c-format
+msgid "nmcli successfully registered as a polkit agent.\n"
+msgstr "nmcli уÑпішно зареєÑтровано Ñк агент polkit.\n"
+
+#: ../clients/cli/agent.c:209 ../clients/cli/connections.c:8779
+#: ../clients/cli/connections.c:8805 ../clients/cli/connections.c:8943
+#: ../clients/cli/devices.c:2832 ../clients/cli/general.c:325
+#: ../clients/cli/general.c:463
+#, c-format
+msgid "Error: NetworkManager is not running."
+msgstr "Помилка: NetworkManager не працює."
+
+#: ../clients/cli/agent.c:245
+#, c-format
+msgid "Error: 'agent' command '%s' is not valid."
+msgstr "Помилка: команда «agent» «%s» є некоректною."
+
+#: ../clients/cli/common.c:40 ../clients/cli/common.c:53
+#: ../clients/cli/common.c:61 ../clients/cli/common.c:73
+#: ../clients/cli/connections.c:172 ../clients/cli/connections.c:194
msgid "GROUP"
msgstr "ГРУПÐ"
#. 0
-#: ../cli/src/common.c:39 ../cli/src/common.c:59
+#: ../clients/cli/common.c:41 ../clients/cli/common.c:62
msgid "ADDRESS"
msgstr "ÐДРЕСÐ"
#. 1
-#: ../cli/src/common.c:40 ../cli/src/common.c:60
+#. 2
+#: ../clients/cli/common.c:42 ../clients/cli/common.c:63
+#: ../clients/cli/connections.c:197
+msgid "GATEWAY"
+msgstr "ШЛЮЗ"
+
+#. 2
+#: ../clients/cli/common.c:43 ../clients/cli/common.c:64
msgid "ROUTE"
msgstr "ÐœÐРШРУТ"
-#. 2
-#: ../cli/src/common.c:41 ../cli/src/common.c:61
+#. 3
+#: ../clients/cli/common.c:44 ../clients/cli/common.c:65
msgid "DNS"
msgstr "DNS"
-#. 3
-#: ../cli/src/common.c:42 ../cli/src/common.c:62
+#. 4
+#: ../clients/cli/common.c:45 ../clients/cli/common.c:66
msgid "DOMAIN"
msgstr "ДОМЕÐ"
-#. 4
-#: ../cli/src/common.c:43
+#. 5
+#: ../clients/cli/common.c:46
msgid "WINS"
msgstr "WINS"
#. 0
-#: ../cli/src/common.c:51 ../cli/src/common.c:70
+#: ../clients/cli/common.c:54 ../clients/cli/common.c:74
msgid "OPTION"
msgstr "ПÐРÐМЕТР"
-#: ../cli/src/common.c:408 ../cli/src/settings.c:3020
-#: ../cli/src/settings.c:3039
-#, c-format
-msgid "invalid IPv4 address '%s'"
-msgstr "некоректна адреÑа IPv4, «%s»"
-
-#: ../cli/src/common.c:416
-#, c-format
-msgid "invalid prefix '%s'; <1-32> allowed"
-msgstr ""
-"некоректний префікÑ, «%s»; можна викориÑтовувати префікÑи лише у діапазоні "
-"<1-32>"
-
-#: ../cli/src/common.c:423 ../cli/src/common.c:476
-#, c-format
-msgid "invalid gateway '%s'"
-msgstr "некоректний шлюз, «%s»"
-
-#: ../cli/src/common.c:461 ../cli/src/settings.c:3365
-#: ../cli/src/settings.c:3384
-#, c-format
-msgid "invalid IPv6 address '%s'"
-msgstr "некоректна адреÑа IPv6, «%s»"
-
-#: ../cli/src/common.c:469
-#, c-format
-msgid "invalid prefix '%s'; <1-128> allowed"
-msgstr ""
-"некоректний префікÑ, «%s»; можна викориÑтовувати префікÑи лише у діапазоні "
-"<1-128>"
-
-#: ../cli/src/common.c:552
+#: ../clients/cli/common.c:378 ../clients/cli/common.c:438
#, c-format
-#| msgid "invalid next hop address '%s'"
-msgid "invalid route destination address '%s'"
-msgstr "некоректна адреÑа Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ€ÑˆÑ€ÑƒÑ‚Ñƒ, «%s»"
-
-#: ../cli/src/common.c:559
-#, c-format
-#| msgid "invalid prefix '%s'; <1-32> allowed"
msgid "invalid prefix '%s'; <1-%d> allowed"
msgstr ""
"некоректний префікÑ, «%s»; можна викориÑтовувати префікÑи лише у діапазоні "
"<1-%d>"
-#: ../cli/src/common.c:569
+#: ../clients/cli/common.c:386
#, c-format
-msgid "invalid next hop address '%s'"
-msgstr "некоректна адреÑа наÑтупного переходу, «%s»"
+msgid "invalid IP address: %s"
+msgstr "некоректна адреÑа IP: %s"
-#: ../cli/src/common.c:574
+#: ../clients/cli/common.c:450
#, c-format
msgid ""
"the second component of route ('%s') is neither a next hop address nor a "
@@ -114,400 +181,411 @@ msgstr ""
"другим компонентом маршруту («%s») не Ñ” ні наÑтупна адреÑа переходу, ні "
"метрика"
-#: ../cli/src/common.c:584
+#: ../clients/cli/common.c:459
#, c-format
msgid "invalid metric '%s'"
msgstr "некоректна метрика, «%s»"
-#: ../cli/src/common.c:593
+#: ../clients/cli/common.c:467
+#, c-format
+msgid "invalid route: %s"
+msgstr "некоректний маршрут: %s"
+
+#: ../clients/cli/common.c:479
msgid "default route cannot be added (NetworkManager handles it by itself)"
msgstr ""
"не можна додавати типовий маршрут (NetworkManager оброблÑÑ” його Ñамотужки)"
-#: ../cli/src/common.c:681
+#: ../clients/cli/common.c:496
msgid "unmanaged"
msgstr "некерований"
-#: ../cli/src/common.c:683
+#: ../clients/cli/common.c:498
msgid "unavailable"
msgstr "недоÑтупний"
-#: ../cli/src/common.c:685 ../cli/src/network-manager.c:276
+#: ../clients/cli/common.c:500 ../clients/cli/general.c:260
msgid "disconnected"
msgstr "роз'єднано"
-#: ../cli/src/common.c:687
+#: ../clients/cli/common.c:502
msgid "connecting (prepare)"
msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (приготуваннÑ)"
-#: ../cli/src/common.c:689
+#: ../clients/cli/common.c:504
msgid "connecting (configuring)"
msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (налаштовуваннÑ)"
-#: ../cli/src/common.c:691
+#: ../clients/cli/common.c:506
msgid "connecting (need authentication)"
msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (потрібне розпізнаваннÑ)"
-#: ../cli/src/common.c:693
+#: ../clients/cli/common.c:508
msgid "connecting (getting IP configuration)"
msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½ÑŒ IP)"
-#: ../cli/src/common.c:695
+#: ../clients/cli/common.c:510
msgid "connecting (checking IP connectivity)"
msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (перевірка можливоÑÑ‚Ñ– з’єднаннÑ)"
-#: ../cli/src/common.c:697
+#: ../clients/cli/common.c:512
msgid "connecting (starting secondary connections)"
msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð´Ñ€ÑƒÐ³Ð¾Ñ€Ñдних з’єднань)"
-#: ../cli/src/common.c:699 ../cli/src/network-manager.c:272
+#: ../clients/cli/common.c:514 ../clients/cli/general.c:256
msgid "connected"
msgstr "з'єднано"
-#: ../cli/src/common.c:701 ../cli/src/connections.c:560
+#: ../clients/cli/common.c:516 ../clients/cli/connections.c:538
msgid "deactivating"
msgstr "деактиваціÑ"
-#: ../cli/src/common.c:703
+#: ../clients/cli/common.c:518
msgid "connection failed"
msgstr "невдала Ñпроба з’єднаннÑ"
-#: ../cli/src/common.c:705 ../cli/src/connections.c:565
-#: ../cli/src/connections.c:588 ../cli/src/connections.c:1656
-#: ../cli/src/devices.c:832 ../cli/src/devices.c:2270
-#: ../cli/src/network-manager.c:279 ../cli/src/network-manager.c:297
-#: ../cli/src/network-manager.c:360 ../cli/src/network-manager.c:363
-#: ../cli/src/network-manager.c:373 ../cli/src/network-manager.c:375
-#: ../cli/src/network-manager.c:432 ../cli/src/network-manager.c:448
-#: ../cli/src/settings.c:735 ../cli/src/settings.c:763
-#: ../cli/src/settings.c:825 ../cli/src/settings.c:1141
-#: ../cli/src/utils.c:1122 ../src/main.c:503 ../src/main.c:531
+#: ../clients/cli/common.c:520 ../clients/cli/connections.c:543
+#: ../clients/cli/connections.c:566 ../clients/cli/connections.c:1705
+#: ../clients/cli/devices.c:878 ../clients/cli/general.c:263
+#: ../clients/cli/general.c:281 ../clients/cli/general.c:411
+#: ../clients/cli/general.c:427 ../clients/cli/settings.c:719
+#: ../clients/cli/settings.c:781 ../clients/cli/settings.c:1074
+#: ../clients/cli/utils.c:1145 ../src/main.c:297 ../src/main.c:325
msgid "unknown"
msgstr "невідомо"
-#: ../cli/src/common.c:714
+#: ../clients/cli/common.c:529
msgid "No reason given"
msgstr "Причину не вказано"
-#: ../cli/src/common.c:717 ../cli/src/connections.c:2452
+#: ../clients/cli/common.c:532 ../clients/cli/connections.c:2705
#, c-format
msgid "Unknown error"
msgstr "Ðевідома помилка"
-#: ../cli/src/common.c:720
+#: ../clients/cli/common.c:535
msgid "Device is now managed"
msgstr "Тепер приÑтрій Ñ” керованим"
-#: ../cli/src/common.c:723
+#: ../clients/cli/common.c:538
msgid "Device is now unmanaged"
msgstr "Тепер приÑтрій Ñ” некерованим"
-#: ../cli/src/common.c:726
+#: ../clients/cli/common.c:541
msgid "The device could not be readied for configuration"
msgstr "ПриÑтрій не може бути приготовано до налаштовуваннÑ"
-#: ../cli/src/common.c:729
+#: ../clients/cli/common.c:544
msgid ""
"IP configuration could not be reserved (no available address, timeout, etc.)"
msgstr ""
"Ðе вдалоÑÑ Ð·Ð°Ñ€ÐµÐ·ÐµÑ€Ð²ÑƒÐ²Ð°Ñ‚Ð¸ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ IP (немає доÑтупної адреÑи, чаÑу "
"Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ñ‚Ð¾Ñ‰Ð¾)"
-#: ../cli/src/common.c:732
+#: ../clients/cli/common.c:547
msgid "The IP configuration is no longer valid"
msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ IP вже не Ñ” коректними"
-#: ../cli/src/common.c:735
+#: ../clients/cli/common.c:550
msgid "Secrets were required, but not provided"
msgstr "Потрібні були реєÑтраційні дані, Ñких не було надано"
-#: ../cli/src/common.c:738
+#: ../clients/cli/common.c:553
msgid "802.1X supplicant disconnected"
msgstr "Допоміжну програму 802.1X від’єднано"
-#: ../cli/src/common.c:741
+#: ../clients/cli/common.c:556
msgid "802.1X supplicant configuration failed"
msgstr "Спроба налаштувати допоміжну програму 802.1X завершилаÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
-#: ../cli/src/common.c:744
+#: ../clients/cli/common.c:559
msgid "802.1X supplicant failed"
msgstr "Помилка допоміжної програми 802.1X"
-#: ../cli/src/common.c:747
+#: ../clients/cli/common.c:562
msgid "802.1X supplicant took too long to authenticate"
msgstr ""
"Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð·Ð° допомогою допоміжної програми 802.1X триває занадто довго"
-#: ../cli/src/common.c:750
+#: ../clients/cli/common.c:565
msgid "PPP service failed to start"
msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити Ñлужбу PPP"
-#: ../cli/src/common.c:753
+#: ../clients/cli/common.c:568
msgid "PPP service disconnected"
msgstr "Службу PPP від’єднано"
-#: ../cli/src/common.c:756
+#: ../clients/cli/common.c:571
msgid "PPP failed"
msgstr "помилка PPP"
-#: ../cli/src/common.c:759
+#: ../clients/cli/common.c:574
msgid "DHCP client failed to start"
msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити клієнтÑьку програму DHCP"
-#: ../cli/src/common.c:762
+#: ../clients/cli/common.c:577
msgid "DHCP client error"
msgstr "помилка клієнтÑької програми DHCP"
-#: ../cli/src/common.c:765
+#: ../clients/cli/common.c:580
msgid "DHCP client failed"
msgstr "критична помилка клієнтÑької програми DHCP"
-#: ../cli/src/common.c:768
+#: ../clients/cli/common.c:583
msgid "Shared connection service failed to start"
msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити Ñлужбу Ñпільного викориÑÑ‚Ð°Ð½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
-#: ../cli/src/common.c:771
+#: ../clients/cli/common.c:586
msgid "Shared connection service failed"
msgstr "Критична помилка Ñлужби Ñпільного викориÑÑ‚Ð°Ð½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
-#: ../cli/src/common.c:774
+#: ../clients/cli/common.c:589
msgid "AutoIP service failed to start"
msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити Ñлужбу AutoIP"
-#: ../cli/src/common.c:777
+#: ../clients/cli/common.c:592
msgid "AutoIP service error"
msgstr "Помилка Ñлужби AutoIP"
-#: ../cli/src/common.c:780
+#: ../clients/cli/common.c:595
msgid "AutoIP service failed"
msgstr "Помилка Ñлужби AutoIP"
-#: ../cli/src/common.c:783
+#: ../clients/cli/common.c:598
msgid "The line is busy"
msgstr "Лінію зайнÑто"
-#: ../cli/src/common.c:786
+#: ../clients/cli/common.c:601
msgid "No dial tone"
msgstr "Ðемає гудка"
-#: ../cli/src/common.c:789
+#: ../clients/cli/common.c:604
msgid "No carrier could be established"
msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ ноÑій Ñигналу"
-#: ../cli/src/common.c:792
+#: ../clients/cli/common.c:607
msgid "The dialing request timed out"
msgstr "Перевищено Ñ‡Ð°Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° Ð¿Ñ–Ð´Ñ‚Ð²ÐµÑ€Ð´Ð¶ÐµÐ½Ð½Ñ Ð·Ð°Ð¿Ð¸Ñ‚Ñƒ щодо набору номера"
-#: ../cli/src/common.c:795
+#: ../clients/cli/common.c:610
msgid "The dialing attempt failed"
msgstr "Спроба Ð½Ð°Ð±Ð¸Ñ€Ð°Ð½Ð½Ñ Ð½Ð¾Ð¼ÐµÑ€Ð° завершилаÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
-#: ../cli/src/common.c:798
+#: ../clients/cli/common.c:613
msgid "Modem initialization failed"
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ модем"
-#: ../cli/src/common.c:801
+#: ../clients/cli/common.c:616
msgid "Failed to select the specified APN"
msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð±Ñ€Ð°Ñ‚Ð¸ вказаний APN"
-#: ../cli/src/common.c:804
+#: ../clients/cli/common.c:619
msgid "Not searching for networks"
msgstr "Пошук мереж не виконуєтьÑÑ"
-#: ../cli/src/common.c:807
+#: ../clients/cli/common.c:622
msgid "Network registration denied"
msgstr "РеєÑтрацію у мережі заборонено"
-#: ../cli/src/common.c:810
+#: ../clients/cli/common.c:625
msgid "Network registration timed out"
msgstr "Перевищено Ñ‡Ð°Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° реєÑтрацію у мережі"
-#: ../cli/src/common.c:813
+#: ../clients/cli/common.c:628
msgid "Failed to register with the requested network"
msgstr "Ðе вдалоÑÑ Ð·Ð°Ñ€ÐµÑ”ÑтруватиÑÑ Ñƒ потрібній мережі"
-#: ../cli/src/common.c:816
+#: ../clients/cli/common.c:631
msgid "PIN check failed"
msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби перевірити PIN-код"
-#: ../cli/src/common.c:819
+#: ../clients/cli/common.c:634
msgid "Necessary firmware for the device may be missing"
msgstr "Можливо, не виÑтачає потрібної Ð´Ð»Ñ Ñ€Ð¾Ð±Ð¾Ñ‚Ð¸ приÑтрою мікропрограми"
-#: ../cli/src/common.c:822
+#: ../clients/cli/common.c:637
msgid "The device was removed"
msgstr "ПриÑтрій вилучено"
-#: ../cli/src/common.c:825
+#: ../clients/cli/common.c:640
msgid "NetworkManager went to sleep"
msgstr "NetworkManager переведено у режим Ñну"
-#: ../cli/src/common.c:828
+#: ../clients/cli/common.c:643
msgid "The device's active connection disappeared"
msgstr "Ðктивне Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· приÑтроєм зникло"
-#: ../cli/src/common.c:831
+#: ../clients/cli/common.c:646
msgid "Device disconnected by user or client"
msgstr "ПриÑтрій роз’єднано з боку кориÑтувача або клієнтÑької програми"
-#: ../cli/src/common.c:834
+#: ../clients/cli/common.c:649
msgid "Carrier/link changed"
msgstr "Змінено ноÑій або зв’Ñзок"
-#: ../cli/src/common.c:837
+#: ../clients/cli/common.c:652
msgid "The device's existing connection was assumed"
msgstr ""
"Зроблено Ð¿Ñ€Ð¸Ð¿ÑƒÑ‰ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ викориÑÑ‚Ð°Ð½Ð½Ñ Ð²Ð¶Ðµ вÑтановленого Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· приÑтроєм"
-#: ../cli/src/common.c:840
+#: ../clients/cli/common.c:655
msgid "The supplicant is now available"
msgstr "Відкрито доÑтуп до допоміжної програми"
-#: ../cli/src/common.c:843
+#: ../clients/cli/common.c:658
msgid "The modem could not be found"
msgstr "Ðе вдалоÑÑ Ð²Ð¸Ñвити модем"
-#: ../cli/src/common.c:846
+#: ../clients/cli/common.c:661
msgid "The Bluetooth connection failed or timed out"
msgstr ""
"Помилка Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Bluetooth або Ð¿ÐµÑ€ÐµÐ²Ð¸Ñ‰ÐµÐ½Ð½Ñ Ñ‡Ð°Ñу Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° Ð¿ÐµÑ€ÐµÐ´Ð°Ð²Ð°Ð½Ð½Ñ "
"даних з’єднаннÑм"
-#: ../cli/src/common.c:849
+#: ../clients/cli/common.c:664
msgid "GSM Modem's SIM card not inserted"
msgstr "До модема GSM не вÑтавлено SIM-картки"
-#: ../cli/src/common.c:852
+#: ../clients/cli/common.c:667
msgid "GSM Modem's SIM PIN required"
msgstr "Слід вказати PIN-код SIM-картки у модемі GSM"
-#: ../cli/src/common.c:855
+#: ../clients/cli/common.c:670
msgid "GSM Modem's SIM PUK required"
msgstr "Слід вказати код Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ (PUK) SIM-картки у модемі GSM"
-#: ../cli/src/common.c:858
+#: ../clients/cli/common.c:673
msgid "GSM Modem's SIM wrong"
msgstr "Помилкова SIM-картка у модемі GSM"
-#: ../cli/src/common.c:861
+#: ../clients/cli/common.c:676
msgid "InfiniBand device does not support connected mode"
msgstr "У приÑтрої InfiniBand не передбачено режиму з’єднаннÑ"
-#: ../cli/src/common.c:864
+#: ../clients/cli/common.c:679
msgid "A dependency of the connection failed"
msgstr "Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ñ€Ð¸Ñтати залежніÑÑ‚ÑŒ з’єднаннÑ"
-#: ../cli/src/common.c:867
+#: ../clients/cli/common.c:682
msgid "A problem with the RFC 2684 Ethernet over ADSL bridge"
msgstr "Проблема з міÑтком Ethernet на оÑнові ADSL відповідно до RFC 2684"
-#: ../cli/src/common.c:870
+#: ../clients/cli/common.c:685
msgid "ModemManager is unavailable"
msgstr "ModemManager недоÑтупнийІ"
-#: ../cli/src/common.c:873
+#: ../clients/cli/common.c:688
msgid "The Wi-Fi network could not be found"
msgstr "Ðе вдалоÑÑ Ð²Ð¸Ñвити мережу Wi-Fi"
-#: ../cli/src/common.c:876
+#: ../clients/cli/common.c:691
msgid "A secondary connection of the base connection failed"
msgstr "Ðе вдалоÑÑ Ð²Ñтановити вторинне щодо оÑновного з’єднаннÑ"
-#: ../cli/src/common.c:879
+#: ../clients/cli/common.c:694
msgid "DCB or FCoE setup failed"
msgstr "Ðе вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ DCB або FCoE"
-#: ../cli/src/common.c:882
+#: ../clients/cli/common.c:697
msgid "teamd control failed"
msgstr "помилка ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ teamd"
-#: ../cli/src/common.c:885
-#| msgid "ModemManager is unavailable"
+#: ../clients/cli/common.c:700
msgid "Modem failed or no longer available"
msgstr "Помилка модема або модем недоÑтупний"
-#: ../cli/src/common.c:888
-#| msgid "ModemManager is unavailable"
+#: ../clients/cli/common.c:703
msgid "Modem now ready and available"
msgstr "Модем готовий до роботи Ñ– доÑтупний"
-#: ../cli/src/common.c:891
+#: ../clients/cli/common.c:706
msgid "SIM PIN was incorrect"
msgstr "PIN-код SIM-картки є некоректним"
#. TRANSLATORS: Unknown reason for a device state change (NMDeviceStateReason)
-#: ../cli/src/common.c:895 ../cli/src/devices.c:639
-#: ../libnm-glib/nm-device.c:1814
+#: ../clients/cli/common.c:710 ../clients/cli/devices.c:619
+#: ../libnm-glib/nm-device.c:1813 ../libnm/nm-device.c:1635
msgid "Unknown"
msgstr "Ðевідомо"
-#: ../cli/src/common.c:937
+#: ../clients/cli/common.c:752
#, c-format
msgid "invalid priority map '%s'"
msgstr "некоректне Ð²Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð¿Ñ€Ñ–Ð¾Ñ€Ð¸Ñ‚ÐµÑ‚Ð½Ð¾ÑÑ‚Ñ–, «%s»"
-#: ../cli/src/common.c:944 ../cli/src/common.c:950
+#: ../clients/cli/common.c:759 ../clients/cli/common.c:765
#, c-format
msgid "priority '%s' is not valid (<0-%ld>)"
msgstr ""
"Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ñ€Ñ–Ð¾Ñ€Ð¸Ñ‚ÐµÑ‚Ð½Ð¾ÑÑ‚Ñ– «%s» Ñ” некоректним (можливий діапазон значень: <0-"
"%ld>)"
-#: ../cli/src/common.c:1017
+#: ../clients/cli/common.c:832
#, c-format
msgid "'%s' is not a valid team configuration or file name."
msgstr "«%s» не Ñ” коректним налаштуваннÑм команди або назвою файла."
+#: ../clients/cli/common.c:933
+#, c-format
+msgid ""
+"Warning: password for '%s' not given in 'passwd-file' and nmcli cannot ask "
+"without '--ask' option.\n"
+msgstr ""
+"ПопередженнÑ: у «passwd-file» не вказано Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð´Ð¾ «%s», а nmcli не може "
+"запитати про пароль без параметра «--ask».\n"
+
#. define some prompts for connection editor
-#: ../cli/src/connections.c:64
+#: ../clients/cli/connections.c:42
msgid "Setting name? "
msgstr "Ðазва параметра? "
-#: ../cli/src/connections.c:65
+#: ../clients/cli/connections.c:43
msgid "Property name? "
msgstr "Ðазва влаÑтивоÑÑ‚Ñ–? "
-#: ../cli/src/connections.c:66
+#: ../clients/cli/connections.c:44
msgid "Enter connection type: "
msgstr "Вкажіть тип з’єднаннÑ: "
#. define some other prompts
-#: ../cli/src/connections.c:69
+#: ../clients/cli/connections.c:47
msgid "Connection type: "
msgstr "Тип з’єднаннÑ: "
-#: ../cli/src/connections.c:70
+#: ../clients/cli/connections.c:48
msgid "VPN type: "
msgstr "Тип VPN: "
-#: ../cli/src/connections.c:71
+#: ../clients/cli/connections.c:49
msgid "Bond master: "
msgstr "ОÑнова прив’Ñзки: "
-#: ../cli/src/connections.c:72
+#: ../clients/cli/connections.c:50
msgid "Team master: "
msgstr "ОÑнова команди: "
-#: ../cli/src/connections.c:73
+#: ../clients/cli/connections.c:51
msgid "Bridge master: "
msgstr "ОÑнова міÑтка: "
-#: ../cli/src/connections.c:74
+#: ../clients/cli/connections.c:52
msgid "Connection (name, UUID, or path): "
msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (назва, UUID або шлÑÑ…): "
#. 0
-#: ../cli/src/connections.c:82 ../cli/src/connections.c:194
-#: ../cli/src/devices.c:89 ../cli/src/devices.c:117 ../cli/src/devices.c:127
-#: ../cli/src/devices.c:137 ../cli/src/devices.c:146 ../cli/src/devices.c:161
-#: ../cli/src/devices.c:174 ../cli/src/devices.c:200 ../cli/src/devices.c:215
-#: ../cli/src/devices.c:224
+#: ../clients/cli/connections.c:60 ../clients/cli/connections.c:173
+#: ../clients/cli/devices.c:57 ../clients/cli/devices.c:86
+#: ../clients/cli/devices.c:96 ../clients/cli/devices.c:107
+#: ../clients/cli/devices.c:116 ../clients/cli/devices.c:131
+#: ../clients/cli/devices.c:144 ../clients/cli/devices.c:170
+#: ../clients/cli/devices.c:185 ../clients/cli/devices.c:194
+#: ../clients/cli/devices.c:204
msgid "NAME"
msgstr "ÐÐЗВÐ"
#. 0
#. 1
-#: ../cli/src/connections.c:83 ../cli/src/connections.c:195
+#: ../clients/cli/connections.c:61 ../clients/cli/connections.c:174
msgid "UUID"
msgstr "UUID"
@@ -515,190 +593,225 @@ msgstr "UUID"
#. 0
#. 1
#. 2
-#: ../cli/src/connections.c:84 ../cli/src/connections.c:216
-#: ../cli/src/devices.c:75 ../cli/src/devices.c:91 ../cli/src/devices.c:203
+#: ../clients/cli/connections.c:62 ../clients/cli/connections.c:195
+#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:59
+#: ../clients/cli/devices.c:173
msgid "TYPE"
msgstr "ТИП"
#. 2
-#: ../cli/src/connections.c:85
+#: ../clients/cli/connections.c:63
msgid "TIMESTAMP"
msgstr "ЧÐСОВРМІТКÐ"
#. 3
-#: ../cli/src/connections.c:86
+#: ../clients/cli/connections.c:64
msgid "TIMESTAMP-REAL"
msgstr "ДІЙСÐРЧÐСОВРМІТКÐ"
#. 4
-#. 14
-#: ../cli/src/connections.c:87 ../cli/src/devices.c:104
+#. 15
+#: ../clients/cli/connections.c:65 ../clients/cli/devices.c:73
msgid "AUTOCONNECT"
msgstr "ÐВТОЗ’ЄДÐÐÐÐЯ"
#. 5
-#: ../cli/src/connections.c:88
+#: ../clients/cli/connections.c:66
+msgid "AUTOCONNECT-PRIORITY"
+msgstr "ПРІОРИТЕТ-ÐВТОЗ’ЄДÐÐÐÐЯ"
+
+#. 6
+#: ../clients/cli/connections.c:67
msgid "READONLY"
msgstr "ЛИШЕ ЧИТÐÐÐЯ"
-#. 6
+#. 7
#. 8
#. 2
#. 15
#. 5
-#: ../cli/src/connections.c:89 ../cli/src/connections.c:202
-#: ../cli/src/devices.c:77 ../cli/src/devices.c:190 ../cli/src/devices.c:206
+#: ../clients/cli/connections.c:68 ../clients/cli/connections.c:181
+#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:160
+#: ../clients/cli/devices.c:176
msgid "DBUS-PATH"
msgstr "ШЛЯХ-DBUS"
-#. 7
+#. 8
#. 13
#. 4
-#: ../cli/src/connections.c:90 ../cli/src/devices.c:188
-#: ../cli/src/devices.c:205
+#: ../clients/cli/connections.c:69 ../clients/cli/devices.c:158
+#: ../clients/cli/devices.c:175
msgid "ACTIVE"
msgstr "ÐКТИВÐИЙ"
-#. 8
+#. 9
#. 0
#. 12
#. 3
-#: ../cli/src/connections.c:91 ../cli/src/devices.c:74 ../cli/src/devices.c:90
-#: ../cli/src/devices.c:187 ../cli/src/devices.c:204
+#: ../clients/cli/connections.c:70 ../clients/cli/devices.c:42
+#: ../clients/cli/devices.c:58 ../clients/cli/devices.c:157
+#: ../clients/cli/devices.c:174
msgid "DEVICE"
msgstr "ПРИСТРІЙ"
-#. 9
+#. 10
#. 3
#. 1
#. 9
#. 1
-#: ../cli/src/connections.c:92 ../cli/src/connections.c:197
-#: ../cli/src/devices.c:76 ../cli/src/devices.c:99
-#: ../cli/src/network-manager.c:39
+#: ../clients/cli/connections.c:71 ../clients/cli/connections.c:176
+#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:67
+#: ../clients/cli/general.c:37
msgid "STATE"
msgstr "СТÐÐ"
-#. 10
-#: ../cli/src/connections.c:93
+#. 11
+#: ../clients/cli/connections.c:72
msgid "ACTIVE-PATH"
msgstr "ÐКТИВÐИЙ-ШЛЯХ"
#. 2
-#: ../cli/src/connections.c:196
+#: ../clients/cli/connections.c:175
msgid "DEVICES"
msgstr "ПРИСТРОЇ"
#. 4
-#: ../cli/src/connections.c:198
+#: ../clients/cli/connections.c:177
msgid "DEFAULT"
msgstr "ТИПОВЕ"
#. 5
-#: ../cli/src/connections.c:199
+#: ../clients/cli/connections.c:178
msgid "DEFAULT6"
msgstr "ТИПОВИЙ6"
#. 6
-#: ../cli/src/connections.c:200
+#: ../clients/cli/connections.c:179
msgid "SPEC-OBJECT"
msgstr "SPEC-OBJECT"
#. 7
#. 4
#. Ask for optional 'vpn' arguments.
-#: ../cli/src/connections.c:201 ../cli/src/connections.c:239
-#: ../cli/src/connections.c:3505 ../tui/nm-editor-utils.c:243
-#: ../tui/nmt-connect-connection-list.c:405
+#: ../clients/cli/connections.c:180 ../clients/cli/connections.c:218
+#: ../clients/cli/connections.c:3816 ../clients/tui/nm-editor-utils.c:234
+#: ../clients/tui/nmt-connect-connection-list.c:406
msgid "VPN"
msgstr "VPN"
#. 9
#. 5
-#. 18
-#: ../cli/src/connections.c:203 ../cli/src/devices.c:80
-#: ../cli/src/devices.c:108
+#. 19
+#: ../clients/cli/connections.c:182 ../clients/cli/devices.c:48
+#: ../clients/cli/devices.c:77
msgid "CON-PATH"
msgstr "ШЛЯХ-ДО-CON"
#. 10
-#: ../cli/src/connections.c:204
+#: ../clients/cli/connections.c:183
msgid "ZONE"
msgstr "ЗОÐÐ"
#. 11
-#: ../cli/src/connections.c:205
+#: ../clients/cli/connections.c:184
msgid "MASTER-PATH"
msgstr "ОСÐОВÐИЙ-ШЛЯХ"
#. 1
-#: ../cli/src/connections.c:217
+#: ../clients/cli/connections.c:196
msgid "USERNAME"
msgstr "КОРИСТУВÐЧ"
-#. 2
-#: ../cli/src/connections.c:218
-msgid "GATEWAY"
-msgstr "ШЛЮЗ"
-
#. 3
-#: ../cli/src/connections.c:219
+#: ../clients/cli/connections.c:198
msgid "BANNER"
msgstr "БÐÐЕР"
#. 4
-#: ../cli/src/connections.c:220
+#: ../clients/cli/connections.c:199
msgid "VPN-STATE"
msgstr "СТÐÐ-VPN"
#. 5
-#: ../cli/src/connections.c:221
+#: ../clients/cli/connections.c:200
msgid "CFG"
msgstr "КОÐФ"
-#: ../cli/src/connections.c:234 ../cli/src/devices.c:239
+#: ../clients/cli/connections.c:213 ../clients/cli/devices.c:219
msgid "GENERAL"
msgstr "ЗÐГÐЛЬÐІ"
#. 0
#. 6
-#: ../cli/src/connections.c:235 ../cli/src/devices.c:246
+#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:226
msgid "IP4"
msgstr "IP4"
#. 1
#. 7
-#: ../cli/src/connections.c:236 ../cli/src/devices.c:247
+#: ../clients/cli/connections.c:215 ../clients/cli/devices.c:227
msgid "DHCP4"
msgstr "DHCP4"
#. 2
#. 8
-#: ../cli/src/connections.c:237 ../cli/src/devices.c:248
+#: ../clients/cli/connections.c:216 ../clients/cli/devices.c:228
msgid "IP6"
msgstr "IP6"
#. 3
#. 9
-#: ../cli/src/connections.c:238 ../cli/src/devices.c:249
+#: ../clients/cli/connections.c:217 ../clients/cli/devices.c:229
msgid "DHCP6"
msgstr "DHCP6"
-#: ../cli/src/connections.c:280
+#: ../clients/cli/connections.c:251
#, c-format
+#| msgid ""
+#| "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] <ID>] ...\n"
+#| "\n"
+#| " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp "
+#| "<name>] [passwd-file <file with passwords>]\n"
+#| "\n"
+#| " up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-"
+#| "file <file with passwords>]\n"
+#| "\n"
+#| " down [id | uuid | path | apath] <ID>\n"
+#| "\n"
+#| " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
+#| "\n"
+#| " modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> "
+#| "<value>)+\n"
+#| "\n"
+#| " edit [id | uuid | path] <ID>\n"
+#| " edit [type <new_con_type>] [con-name <new_con_name>]\n"
+#| "\n"
+#| " delete [id | uuid | path] <ID>\n"
+#| "\n"
+#| " reload\n"
+#| "\n"
+#| " load <filename> [ <filename>... ]\n"
+#| "\n"
msgid ""
"Usage: nmcli connection { COMMAND | help }\n"
"\n"
"COMMAND := { show | up | down | add | modify | edit | delete | reload | "
"load }\n"
"\n"
-" show [--active] [[id | uuid | path | apath] <ID>] ...\n"
+" show [--active] [[--show-secrets] [id | uuid | path | apath] <ID>] ...\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [nsp <name>] "
+"[passwd-file <file with passwords>]\n"
"\n"
-" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>]\n"
+" up [[id | uuid | path] <ID>] [ifname <ifname>] [ap <BSSID>] [passwd-file "
+"<file with passwords>]\n"
"\n"
-" down [id | uuid | path | apath] <ID>\n"
+" down [id | uuid | path | apath] <ID> ...\n"
"\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
"\n"
@@ -719,15 +832,16 @@ msgstr ""
"\n"
" КОМÐÐДР:= { show | up | down | add | modify | edit | | delete }\n"
"\n"
-" show [--active] [[id | uuid | path | apath ] <ідентифікатор>] ...\n"
+" show [--active] [[--show-secrets] [id | uuid | path | apath ] "
+"<ідентифікатор>] ...\n"
"\n"
" up [[id | uuid | path] <ідентифікатор>] [iface <інтерфейÑ>] [ap "
-"<ідентифікатор BSS>] [nsp <назва>] [--nowait] [--timeout <очікуваннÑ>]\n"
+"<ідентифікатор BSS>] [nsp <назва>] [passwd-file <файл з паролÑми>]\n"
"\n"
" up [[id | uuid | path] <ідентифікатор>] [iface <інтерфейÑ>] [ap "
-"<ідентифікатор BSS>] [--nowait] [--timeout <очікуваннÑ>]\n"
+"<ідентифікатор BSS>] [passwd-file <файл з паролÑми>]\n"
"\n"
-" down [id | uuid | path | apath] <ідентифікатор>\n"
+" down [id | uuid | path | apath] <ідентифікатор> ...\n"
"\n"
" add ЗÐГÐЛЬÐІ_ПÐРÐМЕТРИ СПЕЦИФІЧÐІ_ДЛЯ_ТИПУ_ПÐРÐМЕТРИ ПÐРÐМЕТРИ_IP\n"
"\n"
@@ -744,7 +858,7 @@ msgstr ""
" load <назва файла> [ <назва файла>... ]\n"
"\n"
-#: ../cli/src/connections.c:302
+#: ../clients/cli/connections.c:272
#, c-format
msgid ""
"Usage: nmcli connection show { ARGUMENTS | help }\n"
@@ -757,7 +871,8 @@ msgid ""
"profiles are listed. When --active option is specified, only the active\n"
"profiles are shown.\n"
"\n"
-"ARGUMENTS := [--active] [id | uuid | path | apath] <ID> ...\n"
+"ARGUMENTS := [--active] [--show-secrets] [id | uuid | path | apath] "
+"<ID> ...\n"
"\n"
"Show details for specified connections. By default, both static "
"configuration\n"
@@ -766,7 +881,7 @@ 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.\n"
+"account. --show-secrets option will reveal associated secrets as well.\n"
msgstr ""
"КориÑтуваннÑ: nmcli connection show { ÐРГУМЕÐТИ | help }\n"
"\n"
@@ -777,7 +892,8 @@ msgstr ""
"приÑтроєм. Без параметрів команда покаже ÑпиÑок уÑÑ–Ñ… профілів. Якщо\n"
"вказано параметр --active, буде показано лише активі профілі.\n"
"\n"
-"ÐРГУМЕÐТИ := [--active] [id | uuid | path | apath] <ідентифікатор> ...\n"
+"ÐРГУМЕÐТИ := [--active] [--show-secrets] [id | uuid | path | apath] "
+"<ідентифікатор> ...\n"
"\n"
"Показати параметри вказаних з’єднань. Типово, буде показано Ñк дані "
"Ñтатичних\n"
@@ -785,41 +901,44 @@ msgstr ""
"за допомогою загального параметра «--fields». Докладніший Ð¾Ð¿Ð¸Ñ Ð¼Ð¾Ð¶Ð½Ð° знайти "
"на\n"
"Ñторінці підручника (man).\n"
-"Якщо вказано параметр «--active», братимутьÑÑ Ð´Ð¾ уваги лише активні "
-"профілі.\n"
+"Якщо вказано параметр «--active», братимутьÑÑ Ð´Ð¾ уваги лише активні профілі. "
+"Параметр --show-secrets покаже також пов’Ñзані паролі.\n"
-#: ../cli/src/connections.c:324
+#: ../clients/cli/connections.c:293
#, c-format
msgid ""
"Usage: nmcli connection up { ARGUMENTS | help }\n"
"\n"
"ARGUMENTS := [id | uuid | path] <ID> [ifname <ifname>] [ap <BSSID>] [nsp "
-"<name>]\n"
+"<name>] [passwd-file <file with passwords>]\n"
"\n"
"Activate a connection on a device. The profile to activate is identified by "
"its\n"
"name, UUID or D-Bus path.\n"
"\n"
-"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>]\n"
+"ARGUMENTS := ifname <ifname> [ap <BSSID>] [nsp <name>] [passwd-file <file "
+"with passwords>]\n"
"\n"
"Activate a device with a connection. The connection profile is selected\n"
"automatically by NetworkManager.\n"
"\n"
-"ifname - specifies the device to active the connection on\n"
-"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
-"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"ifname - specifies the device to active the connection on\n"
+"ap - specifies AP to connect to (only valid for Wi-Fi)\n"
+"nsp - specifies NSP to connect to (only valid for WiMAX)\n"
+"passwd-file - file with password(s) required to activate the connection\n"
"\n"
msgstr ""
"КориÑтуваннÑ: nmcli connection up { ÐРГУМЕÐТИ | help }\n"
"\n"
"ÐРГУМЕÐТИ := [id | uuid | path] <ідентифікатор> [ifname <назва інтерфейÑу>] "
-"[ap <BSSID>] [nsp <назва>]\n"
+"[ap <BSSID>] [nsp <назва>] [passwd-file <файл з паролÑми>]\n"
"\n"
"Ðктивувати Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ð° приÑтрої. Профіль Ð´Ð»Ñ Ð°ÐºÑ‚Ð¸Ð²Ð°Ñ†Ñ–Ñ— можна визначити за "
"назвою,\n"
"UUID або шлÑхом D-Bus.\n"
"\n"
-"ÐРГУМЕÐТИ := ifname <назва інтерфейÑу> [ap <BSSID>] [nsp <назва>]\n"
+"ÐРГУМЕÐТИ := ifname <назва інтерфейÑу> [ap <BSSID>] [nsp <назва>] [passwd-"
+"file <файл з паролÑми>]\n"
"\n"
"Ðктивувати приÑтрій зі з’єднаннÑм. Профіль Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð°Ñ”Ñ‚ÑŒÑÑ "
"NetworkManager\n"
@@ -828,14 +947,26 @@ msgstr ""
"ifname - визначає приÑтрій, на Ñкому Ñлід активувати з’єднаннÑ\n"
"ap - визначає точку доÑтупу Ð´Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (актуальне лише Ð´Ð»Ñ Wi-Fi)\n"
"nsp - визначає Ñлужбу доÑтупу Ð´Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (актуальне лише Ð´Ð»Ñ WiMAX)\n"
+"passwd-file - файл з паролÑми, потрібними Ð´Ð»Ñ Ð°ÐºÑ‚Ð¸Ð²Ð°Ñ†Ñ–Ñ— з’єднаннÑ\n"
"\n"
-#: ../cli/src/connections.c:345
+#: ../clients/cli/connections.c:314
#, c-format
+#| msgid ""
+#| "Usage: nmcli connection down { ARGUMENTS | help }\n"
+#| "\n"
+#| "ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+#| "\n"
+#| "Deactivate a connection from a device (without preventing the device "
+#| "from\n"
+#| "further auto-activation). The profile to deactivate is identified by its "
+#| "name,\n"
+#| "UUID or D-Bus path.\n"
+#| "\n"
msgid ""
"Usage: nmcli connection down { ARGUMENTS | help }\n"
"\n"
-"ARGUMENTS := [id | uuid | path | apath] <ID>\n"
+"ARGUMENTS := [id | uuid | path | apath] <ID> ...\n"
"\n"
"Deactivate a connection from a device (without preventing the device from\n"
"further auto-activation). The profile to deactivate is identified by its "
@@ -845,111 +976,15 @@ msgid ""
msgstr ""
"КориÑтуваннÑ: nmcli connection down { ÐРГУМЕÐТИ | help }\n"
"\n"
-"ÐРГУМЕÐТИ := [id | uuid | path | apath] <ідентифікатор>\n"
+"ÐРГУМЕÐТИ := [id | uuid | path | apath] <ідентифікатор> ...\n"
"\n"
"СкаÑувати активацію Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ð° приÑтрої (без заборони приÑтрою виконувати\n"
"автоматичну активацію). Профіль Ð´Ð»Ñ ÑкаÑÑƒÐ²Ð°Ð½Ð½Ñ Ð°ÐºÑ‚Ð¸Ð²Ð°Ñ†Ñ–Ñ— можна вказати за\n"
"назвою, UUID або шлÑхом D-Bus.\n"
"\n"
-#: ../cli/src/connections.c:358
+#: ../clients/cli/connections.c:326
#, c-format
-#| msgid ""
-#| "Usage: nmcli connection add { ARGUMENTS | help }\n"
-#| "\n"
-#| "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n"
-#| "\n"
-#| " COMMON_OPTIONS:\n"
-#| " type <type>\n"
-#| " ifname <interface name> | \"*\"\n"
-#| " [con-name <connection name>]\n"
-#| " [autoconnect yes|no]\n"
-#| "\n"
-#| " [save yes|no]\n"
-#| "\n"
-#| " TYPE_SPECIFIC_OPTIONS:\n"
-#| " ethernet: [mac <MAC address>]\n"
-#| " [cloned-mac <cloned MAC address>]\n"
-#| " [mtu <MTU>]\n"
-#| "\n"
-#| " wifi: ssid <SSID>\n"
-#| " [mac <MAC address>]\n"
-#| " [cloned-mac <cloned MAC address>]\n"
-#| " [mtu <MTU>]\n"
-#| "\n"
-#| " wimax: [mac <MAC address>]\n"
-#| " [nsp <NSP>]\n"
-#| "\n"
-#| " pppoe: username <PPPoE username>\n"
-#| " [password <PPPoE password>]\n"
-#| " [service <PPPoE service name>]\n"
-#| " [mtu <MTU>]\n"
-#| " [mac <MAC address>]\n"
-#| "\n"
-#| " gsm: apn <APN>\n"
-#| " [user <username>]\n"
-#| " [password <password>]\n"
-#| "\n"
-#| " cdma: [user <username>]\n"
-#| " [password <password>]\n"
-#| "\n"
-#| " infiniband: [mac <MAC address>]\n"
-#| " [mtu <MTU>]\n"
-#| " [transport-mode datagram | connected]\n"
-#| " [parent <ifname>]\n"
-#| " [p-key <IPoIB P_Key>]\n"
-#| "\n"
-#| " bluetooth: [addr <bluetooth address>]\n"
-#| " [bt-type panu|dun-gsm|dun-cdma]\n"
-#| "\n"
-#| " vlan: dev <parent device (connection UUID, ifname, or MAC)>\n"
-#| " id <VLAN ID>\n"
-#| " [flags <VLAN flags>]\n"
-#| " [ingress <ingress priority mapping>]\n"
-#| " [egress <egress priority mapping>]\n"
-#| " [mtu <MTU>]\n"
-#| "\n"
-#| " bond: [mode balance-rr (0) | active-backup (1) | balance-xor "
-#| "(2) | broadcast (3) |\n"
-#| " 802.3ad (4) | balance-tlb (5) | balance-alb "
-#| "(6)]\n"
-#| " [primary <ifname>]\n"
-#| " [miimon <num>]\n"
-#| " [downdelay <num>]\n"
-#| " [updelay <num>]\n"
-#| " [arp-interval <num>]\n"
-#| " [arp-ip-target <num>]\n"
-#| "\n"
-#| " bond-slave: master <master (ifname, or connection UUID or name)>\n"
-#| "\n"
-#| " team: [config <file>|<raw JSON data>]\n"
-#| "\n"
-#| " team-slave: master <master (ifname, or connection UUID or name)>\n"
-#| " [config <file>|<raw JSON data>]\n"
-#| "\n"
-#| " bridge: [stp yes|no]\n"
-#| " [priority <num>]\n"
-#| " [forward-delay <2-30>]\n"
-#| " [hello-time <1-10>]\n"
-#| " [max-age <6-40>]\n"
-#| " [ageing-time <0-1000000>]\n"
-#| "\n"
-#| " bridge-slave: master <master (ifname, or connection UUID or name)>\n"
-#| " [priority <0-63>]\n"
-#| " [path-cost <1-65535>]\n"
-#| " [hairpin yes|no]\n"
-#| "\n"
-#| " vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan\n"
-#| " [user <username>]\n"
-#| "\n"
-#| " olpc-mesh: ssid <SSID>\n"
-#| " [channel <1-13>]\n"
-#| " [dhcp-anycast <MAC address>]\n"
-#| "\n"
-#| " IP_OPTIONS:\n"
-#| " [ip4 <IPv4 address>] [gw4 <IPv4 gateway>]\n"
-#| " [ip6 <IPv6 address>] [gw6 <IPv6 gateway>]\n"
-#| "\n"
msgid ""
"Usage: nmcli connection add { ARGUMENTS | help }\n"
"\n"
@@ -972,6 +1007,7 @@ msgid ""
" [mac <MAC address>]\n"
" [cloned-mac <cloned MAC address>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <MAC address>]\n"
" [nsp <NSP>]\n"
@@ -1015,6 +1051,7 @@ msgid ""
" [updelay <num>]\n"
" [arp-interval <num>]\n"
" [arp-ip-target <num>]\n"
+" [lacp-rate slow (0) | fast (1)]\n"
"\n"
" bond-slave: master <master (ifname, or connection UUID or name)>\n"
"\n"
@@ -1070,6 +1107,7 @@ msgstr ""
" [mac <MAC-адреÑа>]\n"
" [cloned-mac <клонована MAC-адреÑа>]\n"
" [mtu <MTU>]\n"
+" [mode infrastructure|ap|adhoc]\n"
"\n"
" wimax: [mac <MAC-адреÑа>]\n"
" [nsp <NSP>]\n"
@@ -1114,7 +1152,7 @@ msgstr ""
" [updelay <чиÑло>]\n"
" [arp-interval <чиÑло>]\n"
" [arp-ip-target <чиÑло>]\n"
-"\n"
+" [lacp-rate slow (0) | fast (1)]\n"
" bond-slave: master <оÑновний Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ (назва інтерфейÑу чи назва або "
"UUID з’єднаннÑ)>\n"
"\n"
@@ -1138,7 +1176,8 @@ msgstr ""
" [path-cost <1-65535>]\n"
" [hairpin yes|no]\n"
"\n"
-" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan\n"
+" vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|"
+"ssh|l2tp|iodine|...\n"
" [user <кориÑтувач>]\n"
"\n"
" olpc-mesh: ssid <SSID>\n"
@@ -1150,7 +1189,7 @@ msgstr ""
" [ip6 <адреÑа IPv6>] [gw6 <шлюз IPv6>]\n"
"\n"
-#: ../cli/src/connections.c:437
+#: ../clients/cli/connections.c:406
#, c-format
msgid ""
"Usage: nmcli connection modify { ARGUMENTS | help }\n"
@@ -1197,7 +1236,7 @@ msgstr ""
"nmcli con mod bond0 -bond.options downdelay\n"
"\n"
-#: ../cli/src/connections.c:461
+#: ../clients/cli/connections.c:429
#, c-format
msgid ""
"Usage: nmcli connection edit { ARGUMENTS | help }\n"
@@ -1225,7 +1264,7 @@ msgstr ""
"Додати новий профіль Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð·Ð° допомогою інтерактивного редактора.\n"
"\n"
-#: ../cli/src/connections.c:477
+#: ../clients/cli/connections.c:444
#, c-format
msgid ""
"Usage: nmcli connection delete { ARGUMENTS | help }\n"
@@ -1244,7 +1283,7 @@ msgstr ""
"Профіль можна вказати за допомогою назви, UUID або шлÑху D-Bus.\n"
"\n"
-#: ../cli/src/connections.c:489
+#: ../clients/cli/connections.c:455
#, c-format
msgid ""
"Usage: nmcli connection reload { help }\n"
@@ -1257,7 +1296,7 @@ msgstr ""
"Перезавантажити уÑÑ–Ñ… файли з’єднань з диÑка.\n"
"\n"
-#: ../cli/src/connections.c:498
+#: ../clients/cli/connections.c:463
#, c-format
msgid ""
"Usage: nmcli connection load { ARGUMENTS | help }\n"
@@ -1280,364 +1319,407 @@ msgstr ""
"того, щоб завантажити до NetworkManager найÑвіжіші налаштуваннÑ.\n"
"\n"
-#: ../cli/src/connections.c:556
+#: ../clients/cli/connections.c:534
msgid "activating"
msgstr "активаціÑ"
-#: ../cli/src/connections.c:558
+#: ../clients/cli/connections.c:536
msgid "activated"
msgstr "активовано"
-#: ../cli/src/connections.c:562
+#: ../clients/cli/connections.c:540
msgid "deactivated"
msgstr "вимкнено"
-#: ../cli/src/connections.c:574
+#: ../clients/cli/connections.c:552
msgid "VPN connecting (prepare)"
msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN (приготуваннÑ)"
-#: ../cli/src/connections.c:576
+#: ../clients/cli/connections.c:554
msgid "VPN connecting (need authentication)"
msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN (потрібне розпізнаваннÑ)"
-#: ../cli/src/connections.c:578
+#: ../clients/cli/connections.c:556
msgid "VPN connecting"
msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN"
-#: ../cli/src/connections.c:580
+#: ../clients/cli/connections.c:558
msgid "VPN connecting (getting IP configuration)"
msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN (Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½ÑŒ IP)"
-#: ../cli/src/connections.c:582
+#: ../clients/cli/connections.c:560
msgid "VPN connected"
msgstr "VPN з’єднано"
-#: ../cli/src/connections.c:584
+#: ../clients/cli/connections.c:562
msgid "VPN connection failed"
msgstr "Ðевдала Ñпроба Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN"
-#: ../cli/src/connections.c:586
+#: ../clients/cli/connections.c:564
msgid "VPN disconnected"
msgstr "VPN роз’єднано"
-#: ../cli/src/connections.c:669
+#: ../clients/cli/connections.c:634
+#, c-format
+msgid "Error updating secrets for %s: %s\n"
+msgstr "Помилка під Ñ‡Ð°Ñ Ð¿Ñ€Ð¾Ð±Ð¸ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ–Ð² Ð´Ð»Ñ %s: %s\n"
+
+#: ../clients/cli/connections.c:654
msgid "Connection profile details"
msgstr "Параметри профілю з’єднаннÑ"
-#: ../cli/src/connections.c:681 ../cli/src/connections.c:1033
+#: ../clients/cli/connections.c:666 ../clients/cli/connections.c:1075
#, c-format
msgid "Error: 'connection show': %s"
msgstr "Помилка: «connection show»: %s"
-#: ../cli/src/connections.c:825
+#: ../clients/cli/connections.c:812
msgid "never"
msgstr "ніколи"
#. "CAPABILITIES"
-#: ../cli/src/connections.c:826 ../cli/src/connections.c:827
-#: ../cli/src/connections.c:829 ../cli/src/connections.c:888
-#: ../cli/src/connections.c:889 ../cli/src/connections.c:891
-#: ../cli/src/connections.c:2841 ../cli/src/connections.c:6572
-#: ../cli/src/connections.c:6573 ../cli/src/devices.c:609
-#: ../cli/src/devices.c:659 ../cli/src/devices.c:801 ../cli/src/devices.c:802
-#: ../cli/src/devices.c:803 ../cli/src/devices.c:836 ../cli/src/devices.c:865
-#: ../cli/src/devices.c:866 ../cli/src/devices.c:867 ../cli/src/devices.c:868
-#: ../cli/src/devices.c:869 ../cli/src/devices.c:870 ../cli/src/devices.c:871
-#: ../cli/src/network-manager.c:442
+#: ../clients/cli/connections.c:813 ../clients/cli/connections.c:815
+#: ../clients/cli/connections.c:817 ../clients/cli/connections.c:849
+#: ../clients/cli/connections.c:916 ../clients/cli/connections.c:917
+#: ../clients/cli/connections.c:919 ../clients/cli/connections.c:3111
+#: ../clients/cli/connections.c:6949 ../clients/cli/connections.c:6950
+#: ../clients/cli/devices.c:589 ../clients/cli/devices.c:639
+#: ../clients/cli/devices.c:846 ../clients/cli/devices.c:847
+#: ../clients/cli/devices.c:848 ../clients/cli/devices.c:849
+#: ../clients/cli/devices.c:882 ../clients/cli/devices.c:884
+#: ../clients/cli/devices.c:912 ../clients/cli/devices.c:913
+#: ../clients/cli/devices.c:914 ../clients/cli/devices.c:915
+#: ../clients/cli/devices.c:916 ../clients/cli/devices.c:917
+#: ../clients/cli/devices.c:918 ../clients/cli/general.c:421
+#: ../clients/cli/settings.c:1539
msgid "yes"
msgstr "так"
-#: ../cli/src/connections.c:826 ../cli/src/connections.c:827
-#: ../cli/src/connections.c:829 ../cli/src/connections.c:888
-#: ../cli/src/connections.c:889 ../cli/src/connections.c:891
-#: ../cli/src/connections.c:2842 ../cli/src/connections.c:6572
-#: ../cli/src/connections.c:6573 ../cli/src/devices.c:609
-#: ../cli/src/devices.c:659 ../cli/src/devices.c:801 ../cli/src/devices.c:802
-#: ../cli/src/devices.c:803 ../cli/src/devices.c:836 ../cli/src/devices.c:865
-#: ../cli/src/devices.c:866 ../cli/src/devices.c:867 ../cli/src/devices.c:868
-#: ../cli/src/devices.c:869 ../cli/src/devices.c:870 ../cli/src/devices.c:871
-#: ../cli/src/network-manager.c:444
+#: ../clients/cli/connections.c:813 ../clients/cli/connections.c:815
+#: ../clients/cli/connections.c:817 ../clients/cli/connections.c:916
+#: ../clients/cli/connections.c:917 ../clients/cli/connections.c:919
+#: ../clients/cli/connections.c:3112 ../clients/cli/connections.c:6949
+#: ../clients/cli/connections.c:6950 ../clients/cli/devices.c:589
+#: ../clients/cli/devices.c:639 ../clients/cli/devices.c:846
+#: ../clients/cli/devices.c:847 ../clients/cli/devices.c:848
+#: ../clients/cli/devices.c:849 ../clients/cli/devices.c:882
+#: ../clients/cli/devices.c:884 ../clients/cli/devices.c:912
+#: ../clients/cli/devices.c:913 ../clients/cli/devices.c:914
+#: ../clients/cli/devices.c:915 ../clients/cli/devices.c:916
+#: ../clients/cli/devices.c:917 ../clients/cli/devices.c:918
+#: ../clients/cli/general.c:423 ../clients/cli/settings.c:1537
msgid "no"
msgstr "ні"
-#: ../cli/src/connections.c:884 ../cli/src/connections.c:894
-#: ../cli/src/devices.c:599
-msgid "N/A"
-msgstr "н/д"
-
-#: ../cli/src/connections.c:1021
+#: ../clients/cli/connections.c:1063
msgid "Activate connection details"
msgstr "Ðктивувати параметри з’єднаннÑ"
-#: ../cli/src/connections.c:1254
+#: ../clients/cli/connections.c:1299
#, c-format
msgid "invalid field '%s'; allowed fields: %s and %s, or %s,%s"
msgstr "некоректне поле «%s»; дозволені полÑ: %s Ñ– %s або %s,%s"
-#: ../cli/src/connections.c:1269 ../cli/src/connections.c:1277
+#: ../clients/cli/connections.c:1314 ../clients/cli/connections.c:1322
#, c-format
msgid "'%s' has to be alone"
msgstr "«%s» має бути єдиним"
-#: ../cli/src/connections.c:1308 ../cli/src/connections.c:2032
-#: ../cli/src/connections.c:2092 ../cli/src/connections.c:8075
-#: ../cli/src/connections.c:8283 ../cli/src/connections.c:8376
-#: ../cli/src/connections.c:8404 ../cli/src/devices.c:1202
-#: ../cli/src/devices.c:1250 ../cli/src/devices.c:1413
-#: ../cli/src/devices.c:1547 ../cli/src/devices.c:1684
-#: ../cli/src/devices.c:2128 ../cli/src/devices.c:2427
-#: ../cli/src/network-manager.c:484
-#, c-format
-msgid "Error: NetworkManager is not running."
-msgstr "Помилка: NetworkManager не працює."
-
#. Add headers
-#: ../cli/src/connections.c:1338
+#: ../clients/cli/connections.c:1377
msgid "NetworkManager active profiles"
msgstr "Ðктивні профілі NetworkManager"
-#: ../cli/src/connections.c:1339
+#: ../clients/cli/connections.c:1378
msgid "NetworkManager connection profiles"
msgstr "Профілі з’єднань NetworkManager"
-#: ../cli/src/connections.c:1376 ../cli/src/connections.c:1977
-#: ../cli/src/connections.c:1993 ../cli/src/connections.c:2002
-#: ../cli/src/connections.c:2012 ../cli/src/connections.c:2109
-#: ../cli/src/connections.c:8091 ../cli/src/connections.c:8314
-#: ../cli/src/devices.c:1642 ../cli/src/devices.c:1650
-#: ../cli/src/devices.c:2041 ../cli/src/devices.c:2048
-#: ../cli/src/devices.c:2062 ../cli/src/devices.c:2069
-#: ../cli/src/devices.c:2086 ../cli/src/devices.c:2094
-#: ../cli/src/devices.c:2290 ../cli/src/devices.c:2386
-#: ../cli/src/devices.c:2393
+#: ../clients/cli/connections.c:1418 ../clients/cli/connections.c:2145
+#: ../clients/cli/connections.c:2167 ../clients/cli/connections.c:2176
+#: ../clients/cli/connections.c:2186 ../clients/cli/connections.c:2196
+#: ../clients/cli/connections.c:2346 ../clients/cli/connections.c:8499
+#: ../clients/cli/connections.c:8716 ../clients/cli/devices.c:1909
+#: ../clients/cli/devices.c:1917 ../clients/cli/devices.c:2233
+#: ../clients/cli/devices.c:2240 ../clients/cli/devices.c:2254
+#: ../clients/cli/devices.c:2261 ../clients/cli/devices.c:2278
+#: ../clients/cli/devices.c:2286 ../clients/cli/devices.c:2474
+#: ../clients/cli/devices.c:2570 ../clients/cli/devices.c:2577
#, c-format
msgid "Error: %s argument is missing."
msgstr "Помилка: пропущено аргумент %s."
-#: ../cli/src/connections.c:1427
+#: ../clients/cli/connections.c:1433
#, c-format
msgid "Error: %s - no such connection profile."
msgstr "Помилка: профілю Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %s не Ñ–Ñнує."
-#: ../cli/src/connections.c:1443 ../cli/src/connections.c:2045
-#: ../cli/src/connections.c:8382 ../cli/src/connections.c:8423
-#: ../cli/src/connections.c:8628 ../cli/src/devices.c:2269
-#: ../cli/src/devices.c:2714 ../cli/src/network-manager.c:539
-#: ../cli/src/network-manager.c:582 ../cli/src/network-manager.c:599
-#: ../cli/src/network-manager.c:645 ../cli/src/network-manager.c:659
-#: ../cli/src/network-manager.c:776 ../cli/src/network-manager.c:820
-#: ../cli/src/network-manager.c:840
+#: ../clients/cli/connections.c:1492 ../clients/cli/connections.c:2219
+#: ../clients/cli/connections.c:9016 ../clients/cli/devices.c:2453
+#: ../clients/cli/devices.c:2921 ../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
#, c-format
msgid "Error: %s."
msgstr "Помилка: %s."
-#: ../cli/src/connections.c:1538
+#: ../clients/cli/connections.c:1587
#, c-format
msgid "no active connection on device '%s'"
msgstr "на приÑтрої «%s» немає активних з’єднань"
-#: ../cli/src/connections.c:1546
+#: ../clients/cli/connections.c:1595
msgid "no active connection or device"
msgstr "немає активних з’єднань або приÑтроїв"
-#: ../cli/src/connections.c:1617
+#: ../clients/cli/connections.c:1666
#, c-format
msgid "device '%s' not compatible with connection '%s'"
msgstr "приÑтрій «%s» неÑуміÑний зі з’єднаннÑм «%s»"
-#: ../cli/src/connections.c:1620
+#: ../clients/cli/connections.c:1669
#, c-format
msgid "no device found for connection '%s'"
msgstr "не виÑвлено приÑтрою Ð´Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»"
-#: ../cli/src/connections.c:1632
+#: ../clients/cli/connections.c:1681
msgid "unknown reason"
msgstr "невідома причина"
-#: ../cli/src/connections.c:1634 ../cli/src/network-manager.c:288
+#: ../clients/cli/connections.c:1683 ../clients/cli/general.c:272
msgid "none"
msgstr "немає"
-#: ../cli/src/connections.c:1636
+#: ../clients/cli/connections.c:1685
msgid "the user was disconnected"
msgstr "кориÑтувача від’єднано"
-#: ../cli/src/connections.c:1638
+#: ../clients/cli/connections.c:1687
msgid "the base network connection was interrupted"
msgstr "оÑновне Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· мережею розірвано"
-#: ../cli/src/connections.c:1640
+#: ../clients/cli/connections.c:1689
msgid "the VPN service stopped unexpectedly"
msgstr "Ñлужба VPN неочікувано завершила роботу"
-#: ../cli/src/connections.c:1642
+#: ../clients/cli/connections.c:1691
msgid "the VPN service returned invalid configuration"
msgstr "Ñлужбою VPN повернуто неприпуÑтимі налаштуваннÑ"
-#: ../cli/src/connections.c:1644
+#: ../clients/cli/connections.c:1693
msgid "the connection attempt timed out"
msgstr "перевищено Ñ‡Ð°Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
-#: ../cli/src/connections.c:1646
+#: ../clients/cli/connections.c:1695
msgid "the VPN service did not start in time"
msgstr "Ñлужбу VPN не було вчаÑно запущено"
-#: ../cli/src/connections.c:1648
+#: ../clients/cli/connections.c:1697
msgid "the VPN service failed to start"
msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити Ñлужбу VPN"
-#: ../cli/src/connections.c:1650
+#: ../clients/cli/connections.c:1699
msgid "no valid VPN secrets"
msgstr "не виÑвлено коректних реєÑтраційних даних VPN"
-#: ../cli/src/connections.c:1652
+#: ../clients/cli/connections.c:1701
msgid "invalid VPN secrets"
msgstr "некоректні реєÑтраційні дані VPN"
-#: ../cli/src/connections.c:1654
+#: ../clients/cli/connections.c:1703
msgid "the connection was removed"
msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð±ÑƒÐ»Ð¾ вилучено"
-#: ../cli/src/connections.c:1671 ../cli/src/connections.c:1827
-#: ../cli/src/connections.c:6468
+#: ../clients/cli/connections.c:1725 ../clients/cli/connections.c:1753
+#: ../clients/cli/connections.c:1914 ../clients/cli/connections.c:6840
#, c-format
msgid "Connection successfully activated (D-Bus active path: %s)\n"
msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ ÑƒÑпішно задіÑно (активний шлÑÑ… D-Bus: %s)\n"
-#: ../cli/src/connections.c:1676
+#: ../clients/cli/connections.c:1732
+#, c-format
+msgid ""
+"Connection successfully activated (master waiting for slaves) (D-Bus active "
+"path: %s)\n"
+msgstr ""
+"Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ ÑƒÑпішно задіÑно (оÑновне Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¾Ñ‡Ñ–ÐºÑƒÑ” на допоміжні) (активний "
+"шлÑÑ… D-Bus: %s)\n"
+
+#: ../clients/cli/connections.c:1736 ../clients/cli/connections.c:1758
#, c-format
msgid "Error: Connection activation failed."
msgstr "Помилка: невдала Ñпроба активації з’єднаннÑ."
-#: ../cli/src/connections.c:1701
+#: ../clients/cli/connections.c:1809
#, c-format
msgid "VPN connection successfully activated (D-Bus active path: %s)\n"
msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN уÑпішно задіÑно (активний шлÑÑ… D-Bus: %s)\n"
-#: ../cli/src/connections.c:1708
+#: ../clients/cli/connections.c:1817
#, c-format
msgid "Error: Connection activation failed: %s."
msgstr "Помилка: не вдалоÑÑ Ð°ÐºÑ‚Ð¸Ð²ÑƒÐ²Ð°Ñ‚Ð¸ з’єднаннÑ: %s."
-#: ../cli/src/connections.c:1726 ../cli/src/devices.c:1299
+#: ../clients/cli/connections.c:1836 ../clients/cli/devices.c:1322
#, c-format
msgid "Error: Timeout %d sec expired."
msgstr "Помилка: перевищено Ñ‡Ð°Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ñƒ %d Ñ."
-#: ../cli/src/connections.c:1791
-#, c-format
-msgid ""
-"Error: Device '%s' is waiting for slaves before proceeding with activation."
-msgstr ""
-"Помилка: приÑтрій «%s» очікує на реакцію підлеглих приÑтроїв, перш ніж "
-"продовжувати активацію."
-
-#: ../cli/src/connections.c:1811
+#: ../clients/cli/connections.c:1896
#, c-format
msgid "Error: Connection activation failed: %s"
msgstr "Помилка: не вдалоÑÑ Ð°ÐºÑ‚Ð¸Ð²ÑƒÐ²Ð°Ñ‚Ð¸ з’єднаннÑ: %s"
-#: ../cli/src/connections.c:1916 ../cli/src/connections.c:2046
+#: ../clients/cli/connections.c:1981
+#, c-format
+msgid "failed to read passwd-file '%s': %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл passwd «%s»: %s"
+
+#: ../clients/cli/connections.c:1993
+#, c-format
+msgid "missing colon in 'password' entry '%s'"
+msgstr "пропущено двокрапку у запиÑÑ– «password» «%s»"
+
+#: ../clients/cli/connections.c:2001
+#, c-format
+msgid "missing dot in 'password' entry '%s'"
+msgstr "пропущено крапку у запиÑÑ– «password» «%s»"
+
+#: ../clients/cli/connections.c:2014
+#, c-format
+msgid "invalid setting name in 'password' entry '%s'"
+msgstr "некоректна назва параметра у запиÑÑ– «password» «%s»"
+
+#: ../clients/cli/connections.c:2061 ../clients/cli/connections.c:2220
msgid "unknown error"
msgstr "невідома помилка"
-#: ../cli/src/connections.c:1924
+#: ../clients/cli/connections.c:2070
#, c-format
msgid "unknown device '%s'."
msgstr "невідомий приÑтрій, «%s»."
-#: ../cli/src/connections.c:1929
+#: ../clients/cli/connections.c:2075
msgid "neither a valid connection nor device given"
msgstr "не вказано ні коректного з’єднаннÑ, ні приÑтрою"
-#: ../cli/src/connections.c:2021 ../cli/src/devices.c:1176
-#: ../cli/src/devices.c:1656 ../cli/src/devices.c:2105
-#: ../cli/src/devices.c:2399
+#: ../clients/cli/connections.c:2158
+#, c-format
+msgid "Error: Connection '%s' does not exist."
+msgstr "Помилка: Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» не Ñ–Ñнує."
+
+#: ../clients/cli/connections.c:2204 ../clients/cli/devices.c:1221
+#: ../clients/cli/devices.c:1923 ../clients/cli/devices.c:2297
+#: ../clients/cli/devices.c:2583
#, c-format
msgid "Unknown parameter: %s\n"
msgstr "Ðевідомий параметр: %s\n"
-#: ../cli/src/connections.c:2054
+#: ../clients/cli/connections.c:2228
msgid "preparing"
msgstr "приготуваннÑ"
-#: ../cli/src/connections.c:2082 ../cli/src/connections.c:8295
-#: ../cli/src/connections.c:8410
+#: ../clients/cli/connections.c:2267
+#, c-format
+#| msgid "Connection successfully activated (D-Bus active path: %s)\n"
+msgid "Connection '%s' successfully deactivated (D-Bus active path: %s)\n"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» уÑпішно вимкнено (активний шлÑÑ… D-Bus: %s)\n"
+
+#: ../clients/cli/connections.c:2325 ../clients/cli/connections.c:8697
+#: ../clients/cli/connections.c:8811
#, c-format
msgid "Error: No connection specified."
msgstr "Помилка: не вказано з’єднаннÑ."
-#: ../cli/src/connections.c:2119
+#: ../clients/cli/connections.c:2356
+#, c-format
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: '%s' is not an active connection.\n"
+msgstr "Помилка: «%s» не Ñ” активним з’єднаннÑм.\n"
+
+#: ../clients/cli/connections.c:2357
#, c-format
-msgid "Error: '%s' is not an active connection."
-msgstr "Помилка: «%s» не Ñ” активним з’єднаннÑм."
+#| msgid "Error: '%s' is not an active connection."
+msgid "Error: not all active connections found."
+msgstr "Помилка: не уÑÑ– активні Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð·Ð½Ð°Ð¹Ð´ÐµÐ½Ð¾."
-#: ../cli/src/connections.c:2431 ../cli/src/utils.c:515
+#: ../clients/cli/connections.c:2366
+#, c-format
+#| msgid "Error: %s - no such connection profile."
+msgid "Error: no active connection provided."
+msgstr "Помилка: не надано активного з’єднаннÑ."
+
+#: ../clients/cli/connections.c:2684 ../clients/cli/utils.c:516
#, c-format
msgid "'%s' not among [%s]"
msgstr "«%s» немає Ñеред [%s]"
-#: ../cli/src/connections.c:2513
+#: ../clients/cli/connections.c:2763
#, c-format
msgid "Error: '%s': '%s' is not a valid %s MAC address."
msgstr "Помилка: «%s»: «%s» не Ñ” коректною MAC-адреÑою %s."
#. Ask for optional arguments
-#: ../cli/src/connections.c:2514 ../cli/src/connections.c:2957
-#: ../libnm-glib/nm-device.c:1802 ../tui/nm-editor-utils.c:173
+#: ../clients/cli/connections.c:2764 ../clients/cli/connections.c:3226
+#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1573
+#: ../libnm-glib/nm-device.c:1801 ../libnm/nm-device.c:1623
msgid "InfiniBand"
msgstr "InfiniBand"
-#: ../cli/src/connections.c:2514 ../libnm-glib/nm-device.c:1790
-#: ../tui/nm-editor-utils.c:156
+#: ../clients/cli/connections.c:2764 ../clients/tui/nm-editor-utils.c:147
+#: ../libnm-glib/nm-device.c:1789 ../libnm/nm-device.c:1611
msgid "Ethernet"
msgstr "Ethernet"
-#: ../cli/src/connections.c:2537
+#: ../clients/cli/connections.c:2784
#, c-format
msgid "Error: 'mtu': '%s' is not a valid MTU."
msgstr "Помилка: «mtu»: «%s» не Ñ” коректним значеннÑм MTU."
-#: ../cli/src/connections.c:2553
+#: ../clients/cli/connections.c:2800
#, c-format
msgid "Error: 'parent': '%s' is not a valid interface name."
msgstr "Помилка: «parent»: «%s» не Ñ” коректною назвою інтерфейÑу."
-#: ../cli/src/connections.c:2574
+#: ../clients/cli/connections.c:2821
#, c-format
msgid "Error: 'p-key': '%s' is not a valid InfiniBand P_KEY."
msgstr "Помилка: «p-key»: «%s» не є коректним закритим ключем InfiniBand"
-#: ../cli/src/connections.c:2603
+#: ../clients/cli/connections.c:2866
#, c-format
-msgid ""
-"Error: 'mode': '%s' is not a valid InfiniBand transport mode [datagram, "
-"connected]."
-msgstr ""
-"Помилка: «mode»: «%s» не Ñ” коректним режимом Ð¿ÐµÑ€ÐµÐ´Ð°Ð²Ð°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ… InfiniBand "
-"[datagram, connected]."
+msgid "Error: '%s': '%s' is not a valid %s %s."
+msgstr "Помилка: «%s»: «%s» Ñ” некоректним значеннÑм параметра %s %s."
-#: ../cli/src/connections.c:2617
+#: ../clients/cli/connections.c:2879
+msgid "Wi-Fi mode"
+msgstr "Режим Wi-Fi"
+
+#: ../clients/cli/connections.c:2888
+msgid "InfiniBand transport mode"
+msgstr "Режим Ð¿ÐµÑ€ÐµÐ´Ð°Ð²Ð°Ð½Ð½Ñ InfiniBand"
+
+#: ../clients/cli/connections.c:2901
#, c-format
msgid "Error: 'flags': '%s' is not valid; use <0-7>."
msgstr ""
"Помилка: «flags»: «%s» Ñ” некоректним; мало бути чиÑло у діапазоні <0-7>."
-#: ../cli/src/connections.c:2639
+#: ../clients/cli/connections.c:2923
#, c-format
msgid "Error: '%s': '%s' is not valid; %s "
msgstr "Помилка: «%s»: «%s» є некоректним; %s "
-#: ../cli/src/connections.c:2832
+#: ../clients/cli/connections.c:3102
#, c-format
msgid "Error: '%s': '%s' is not valid; use <%u-%u>."
msgstr ""
"Помилка: «%s»: «%s» Ñ” некоректним; мало бути чиÑло у діапазоні <%u-%u>."
#. Ask for optional arguments.
-#: ../cli/src/connections.c:2888
+#: ../clients/cli/connections.c:3158
#, c-format
-#| msgid "There is 1 optional argument for '%s' connection type.\n"
msgid "There is %d optional argument for '%s' connection type.\n"
msgid_plural "There are %d optional arguments for '%s' connection type.\n"
msgstr[0] "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «%2$s» передбачено %1$d додатковий аргумент.\n"
@@ -1645,9 +1727,8 @@ msgstr[1] "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «%2$s» передбачено %1$
msgstr[2] "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «%2$s» передбачено %1$d додаткових аргументів.\n"
msgstr[3] "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «%2$s» передбачено %1$d додатковий аргумент.\n"
-#: ../cli/src/connections.c:2891
+#: ../clients/cli/connections.c:3161
#, c-format
-#| msgid "Do you want to provide it? (yes/no) [yes] "
msgid "Do you want to provide it? %s"
msgid_plural "Do you want to provide them? %s"
msgstr[0] "Хочете вказати їх? %s"
@@ -1655,451 +1736,471 @@ msgstr[1] "Хочете вказати їх? %s"
msgstr[2] "Хочете вказати їх? %s"
msgstr[3] "Хочете вказати його? %s"
-#: ../cli/src/connections.c:2906
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3178
msgid "ethernet"
msgstr "ethernet"
-#: ../cli/src/connections.c:2906 ../libnm-glib/nm-device.c:1792
-#: ../tui/nm-editor-utils.c:164
-msgid "Wi-Fi"
-msgstr "Wi-Fi"
-
-#: ../cli/src/connections.c:2914 ../cli/src/connections.c:2962
-#: ../cli/src/connections.c:3071 ../cli/src/connections.c:3150
+#: ../clients/cli/connections.c:3183 ../clients/cli/connections.c:3231
+#: ../clients/cli/connections.c:3365 ../clients/cli/connections.c:3444
msgid "MTU [auto]: "
msgstr "MTU [типово авто]: "
-#: ../cli/src/connections.c:2925 ../cli/src/connections.c:2973
-#: ../cli/src/connections.c:3043 ../cli/src/connections.c:3082
-#: ../cli/src/connections.c:3437
+#: ../clients/cli/connections.c:3194 ../clients/cli/connections.c:3242
+#: ../clients/cli/connections.c:3337 ../clients/cli/connections.c:3376
+#: ../clients/cli/connections.c:3748
msgid "MAC [none]: "
msgstr "MAC [типово немає]: "
-#: ../cli/src/connections.c:2936
+#: ../clients/cli/connections.c:3205
msgid "Cloned MAC [none]: "
msgstr "Клонований MAC [типово немає]: "
-#: ../cli/src/connections.c:2984
+#: ../clients/cli/connections.c:3253
#, c-format
-#| msgid "Transport mode"
msgid "Transport mode %s"
msgstr "Режим Ð¿ÐµÑ€ÐµÐ´Ð°Ð²Ð°Ð½Ð½Ñ %s"
-#: ../cli/src/connections.c:2997
+#: ../clients/cli/connections.c:3266
msgid "Parent interface [none]: "
msgstr "БатьківÑький Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ [типово немає]: "
-#: ../cli/src/connections.c:3008
+#: ../clients/cli/connections.c:3277
msgid "P_KEY [none]: "
msgstr "P_KEY [типово немає]: "
-#: ../cli/src/connections.c:3018
+#: ../clients/cli/connections.c:3287
#, c-format
msgid "Error: 'p-key' is mandatory when 'parent' is specified.\n"
msgstr ""
"Помилка: параметр «p-key» обов’Ñзковим, Ñкщо вказано параметр «parent».\n"
+#. Ask for optional arguments
+#: ../clients/cli/connections.c:3304 ../clients/tui/nm-editor-utils.c:155
+#: ../libnm-glib/nm-device.c:1791 ../libnm/nm-device.c:1613
+msgid "Wi-Fi"
+msgstr "Wi-Fi"
+
+#: ../clients/cli/connections.c:3312
+#, c-format
+msgid "Mode %s"
+msgstr "Режим %s"
+
#. Ask for optional 'wimax' arguments.
-#: ../cli/src/connections.c:3038 ../libnm-glib/nm-device.c:1798
+#: ../clients/cli/connections.c:3332 ../libnm-glib/nm-device.c:1797
+#: ../libnm/nm-device.c:1619
msgid "WiMAX"
msgstr "WiMAX"
#. Ask for optional 'pppoe' arguments.
-#: ../cli/src/connections.c:3061
+#: ../clients/cli/connections.c:3355
msgid "PPPoE"
msgstr "PPPoE"
-#: ../cli/src/connections.c:3065 ../cli/src/connections.c:3103
+#: ../clients/cli/connections.c:3359 ../clients/cli/connections.c:3397
msgid "Password [none]: "
msgstr "Пароль [типово немає]: "
-#: ../cli/src/connections.c:3067
+#: ../clients/cli/connections.c:3361
msgid "Service [none]: "
msgstr "Служба [типово немає]: "
#. Ask for optional 'gsm' or 'cdma' arguments.
-#: ../cli/src/connections.c:3097
-#| msgid "Mobile Broadband"
+#: ../clients/cli/connections.c:3391
msgid "mobile broadband"
msgstr "мобільна радіомережа"
-#: ../cli/src/connections.c:3101 ../cli/src/connections.c:3509
+#: ../clients/cli/connections.c:3395 ../clients/cli/connections.c:3820
msgid "Username [none]: "
msgstr "КориÑтувач [типово немає]: "
#. Ask for optional 'bluetooth' arguments.
-#: ../cli/src/connections.c:3116
-#| msgid "Bluetooth"
+#: ../clients/cli/connections.c:3410
msgid "bluetooth"
msgstr "bluetooth"
-#: ../cli/src/connections.c:3123
+#: ../clients/cli/connections.c:3417
#, c-format
-#| msgid "Bluetooth"
msgid "Bluetooth type %s"
msgstr "Тип Bluetooth %s"
-#: ../cli/src/connections.c:3129
+#: ../clients/cli/connections.c:3423
#, c-format
msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n"
msgstr "Помилка: «bt-type»: «%s» не є коректним типом bluetooth.\n"
#. Ask for optional 'vlan' arguments.
-#. 11
-#: ../cli/src/connections.c:3145 ../cli/src/devices.c:251
-#: ../libnm-glib/nm-device.c:1810 ../libnm-util/nm-connection.c:1303
-#: ../tui/nm-editor-utils.c:227 ../tui/nmt-page-vlan.c:53
+#. 13
+#: ../clients/cli/connections.c:3439 ../clients/cli/devices.c:233
+#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:97
+#: ../libnm-core/nm-connection.c:1571 ../libnm-glib/nm-device.c:1809
+#: ../libnm-util/nm-connection.c:1614 ../libnm/nm-device.c:1631
msgid "VLAN"
msgstr "VLAN"
-#: ../cli/src/connections.c:3161
+#: ../clients/cli/connections.c:3455
msgid "VLAN flags (<0-7>) [none]: "
msgstr "Прапорці VLAN (<0-7>) [типово немає]: "
-#: ../cli/src/connections.c:3172
+#: ../clients/cli/connections.c:3466
msgid "Ingress priority maps [none]: "
msgstr "Ð’Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð¿Ñ€Ñ–Ð¾Ñ€Ð¸Ñ‚ÐµÑ‚Ð½Ð¾ÑÑ‚Ñ– вхідного доÑтупу [типово немає]: "
-#: ../cli/src/connections.c:3183
+#: ../clients/cli/connections.c:3477
msgid "Egress priority maps [none]: "
msgstr "Ð’Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð¿Ñ€Ñ–Ð¾Ñ€Ð¸Ñ‚ÐµÑ‚Ð½Ð¾ÑÑ‚Ñ– вихідного доÑтупу [типово немає]: "
-#: ../cli/src/connections.c:3194
+#: ../clients/cli/connections.c:3488
msgid "Bonding mode [balance-rr]: "
msgstr "Режим прив’ÑÐ·ÑƒÐ²Ð°Ð½Ð½Ñ [типово balance-rr]: "
#. Ask for optional 'bond' arguments.
-#: ../cli/src/connections.c:3209
+#: ../clients/cli/connections.c:3504
msgid "bond"
msgstr "прив’Ñзка"
-#: ../cli/src/connections.c:3231
+#: ../clients/cli/connections.c:3526
msgid "Bonding primary interface [none]: "
msgstr "ОÑновний Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð¿Ñ€Ð¸Ð²â€™ÑÐ·ÑƒÐ²Ð°Ð½Ð½Ñ [типово немає]: "
-#: ../cli/src/connections.c:3234
+#: ../clients/cli/connections.c:3529
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name.\n"
msgstr "Помилка: «primary»: «%s» не Ñ” коректною назвою інтерфейÑу.\n"
-#: ../cli/src/connections.c:3242
+#: ../clients/cli/connections.c:3537
#, c-format
-#| msgid "Link monitoring"
msgid "Bonding monitoring mode %s"
msgstr "Режим ÑпоÑÑ‚ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° зв’Ñзком %s"
-#: ../cli/src/connections.c:3248
+#: ../clients/cli/connections.c:3543
#, c-format
msgid "Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n"
msgstr ""
"Помилка: «%s» не Ñ” коректним режимом ÑпоÑтереженнÑ; ÑкориÑтайтеÑÑ Â«%s» або "
"«%s».\n"
-#: ../cli/src/connections.c:3257
+#: ../clients/cli/connections.c:3552
msgid "Bonding miimon [100]: "
msgstr "ЧаÑтота ÑпоÑÑ‚ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ MII прив’ÑÐ·ÑƒÐ²Ð°Ð½Ð½Ñ [типово 100]: "
-#: ../cli/src/connections.c:3260
+#: ../clients/cli/connections.c:3555
#, c-format
msgid "Error: 'miimon': '%s' is not a valid number <0-%u>.\n"
msgstr "Помилка: «miimon»: «%s» не Ñ” коректним чиÑлом у діапазоні <0-%u>.\n"
-#: ../cli/src/connections.c:3268
+#: ../clients/cli/connections.c:3563
msgid "Bonding downdelay [0]: "
msgstr "downdelay прив’ÑÐ·ÑƒÐ²Ð°Ð½Ð½Ñ [типово 0]: "
-#: ../cli/src/connections.c:3271
+#: ../clients/cli/connections.c:3566
#, c-format
msgid "Error: 'downdelay': '%s' is not a valid number <0-%u>.\n"
msgstr "Помилка: «downdelay»: «%s» не Ñ” чиÑлом у діапазоні <0-%u>.\n"
-#: ../cli/src/connections.c:3279
+#: ../clients/cli/connections.c:3574
msgid "Bonding updelay [0]: "
msgstr "updelay прив’ÑÐ·ÑƒÐ²Ð°Ð½Ð½Ñ [типово 0]: "
-#: ../cli/src/connections.c:3282
+#: ../clients/cli/connections.c:3577
#, c-format
msgid "Error: 'updelay': '%s' is not a valid number <0-%u>.\n"
msgstr "Помилка: «updelay»: «%s» не Ñ” чиÑлом у діапазоні <0-%u>.\n"
-#: ../cli/src/connections.c:3291
+#: ../clients/cli/connections.c:3586
msgid "Bonding arp-interval [0]: "
msgstr "arp-interval прив’ÑÐ·ÑƒÐ²Ð°Ð½Ð½Ñ [типово 0]: "
-#: ../cli/src/connections.c:3294
+#: ../clients/cli/connections.c:3589
#, c-format
msgid "Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n"
msgstr "Помилка: «arp-interval»: «%s» не Ñ” чиÑлом у діапазоні <0-%u>.\n"
#. FIXME: verify the string
-#: ../cli/src/connections.c:3302
+#: ../clients/cli/connections.c:3597
msgid "Bonding arp-ip-target [none]: "
msgstr "arp-ip-target прив’ÑÐ·ÑƒÐ²Ð°Ð½Ð½Ñ [типово немає]: "
-#: ../cli/src/connections.c:3322
+#: ../clients/cli/connections.c:3604
+msgid "LACP rate ('slow' or 'fast') [slow]: "
+msgstr "ШвидкіÑÑ‚ÑŒ LACP (slow або fast) [slow]: "
+
+#: ../clients/cli/connections.c:3610
+#, c-format
+msgid "Error: 'lacp_rate': '%s' is invalid ('slow' or 'fast').\n"
+msgstr "Помилка: «lacp_rate»: «%s» є некоректним («slow» або «fast»).\n"
+
+#: ../clients/cli/connections.c:3633
msgid "Team JSON configuration [none]: "
msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ JSON команди [немає]: "
-#: ../cli/src/connections.c:3339
+#: ../clients/cli/connections.c:3650
msgid "team"
msgstr "команда"
-#: ../cli/src/connections.c:3345
+#: ../clients/cli/connections.c:3656
msgid "team-slave"
msgstr "підлеглий-команди"
#. Ask for optional 'bridge' arguments.
-#: ../cli/src/connections.c:3357
-#| msgid "Bridge"
+#: ../clients/cli/connections.c:3668
msgid "bridge"
msgstr "міÑток"
-#: ../cli/src/connections.c:3363
+#: ../clients/cli/connections.c:3674
#, c-format
-#| msgid "Enable STP (yes/no) [yes]: "
msgid "Enable STP %s"
msgstr "Ð’Ð¼Ð¸ÐºÐ°Ð½Ð½Ñ STP %s"
-#: ../cli/src/connections.c:3368
+#: ../clients/cli/connections.c:3679
#, c-format
-#| msgid "Error: 'stp': %s."
msgid "Error: 'stp': %s.\n"
msgstr "Помилка: «stp»: %s.\n"
-#: ../cli/src/connections.c:3376
+#: ../clients/cli/connections.c:3687
msgid "STP priority [32768]: "
msgstr "Пріоритет STP [типово 32768]: "
-#: ../cli/src/connections.c:3380
+#: ../clients/cli/connections.c:3691
#, c-format
msgid "Error: 'priority': '%s' is not a valid number <0-%d>.\n"
msgstr "Помилка: «priority»: «%s» не Ñ” чиÑлом у діапазоні <0-%d>.\n"
-#: ../cli/src/connections.c:3388
+#: ../clients/cli/connections.c:3699
msgid "Forward delay [15]: "
msgstr "Затримка переÑпрÑÐ¼ÑƒÐ²Ð°Ð½Ð½Ñ [типово 15]:"
-#: ../cli/src/connections.c:3392
+#: ../clients/cli/connections.c:3703
#, c-format
msgid "Error: 'forward-delay': '%s' is not a valid number <2-30>.\n"
msgstr "Помилка: «forward-delay»: «%s» не Ñ” чиÑлом у діапазоні <2-30>.\n"
-#: ../cli/src/connections.c:3401
+#: ../clients/cli/connections.c:3712
msgid "Hello time [2]: "
msgstr "Ð§Ð°Ñ Ð½Ð° Ð²Ñ–Ñ‚Ð°Ð½Ð½Ñ [типово 2]:"
-#: ../cli/src/connections.c:3405
+#: ../clients/cli/connections.c:3716
#, c-format
msgid "Error: 'hello-time': '%s' is not a valid number <1-10>.\n"
msgstr "Помилка: «hello-time»: «%s» не Ñ” чиÑлом у діапазоні <1-10>.\n"
-#: ../cli/src/connections.c:3413
+#: ../clients/cli/connections.c:3724
msgid "Max age [20]: "
msgstr "МакÑ. вік [типово 20]: "
-#: ../cli/src/connections.c:3417
+#: ../clients/cli/connections.c:3728
#, c-format
msgid "Error: 'max-age': '%s' is not a valid number <6-40>.\n"
msgstr "Помилка: «max-age»: «%s» не Ñ” чиÑлом у діапазоні <6-40>.\n"
-#: ../cli/src/connections.c:3425
+#: ../clients/cli/connections.c:3736
msgid "MAC address ageing time [300]: "
msgstr "Ð§Ð°Ñ Ð·Ð°ÑÑ‚Ð°Ñ€Ñ–Ð²Ð°Ð½Ð½Ñ MAC-адреÑи [типово 300]: "
-#: ../cli/src/connections.c:3429
+#: ../clients/cli/connections.c:3740
#, c-format
msgid "Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n"
msgstr "Помилка: «ageing-time»: «%s» не Ñ” чиÑлом у діапазоні <0-1000000>.\n"
#. Ask for optional 'bridge-slave' arguments.
-#: ../cli/src/connections.c:3456
-#| msgid "team-slave"
+#: ../clients/cli/connections.c:3767
msgid "bridge-slave"
msgstr "міÑток-підлеглий"
-#: ../cli/src/connections.c:3461
+#: ../clients/cli/connections.c:3772
msgid "Bridge port priority [32]: "
msgstr "Пріоритетний порт міÑтка [типово 32]: "
-#: ../cli/src/connections.c:3474
+#: ../clients/cli/connections.c:3785
msgid "Bridge port STP path cost [100]: "
msgstr "ВартіÑÑ‚ÑŒ маршруту STP порту міÑтка [типово 100]: "
-#: ../cli/src/connections.c:3488
+#: ../clients/cli/connections.c:3799
#, c-format
-#| msgid "Hairpin mode"
msgid "Hairpin %s"
msgstr "Початкова зона (hairpin) %s"
-#: ../cli/src/connections.c:3493
+#: ../clients/cli/connections.c:3804
#, c-format
-#| msgid "Error: 'hairpin': %s."
msgid "Error: 'hairpin': %s.\n"
msgstr "Помилка: «hairpin»: %s.\n"
#. Ask for optional 'olpc' arguments.
-#: ../cli/src/connections.c:3520 ../libnm-glib/nm-device.c:1796
+#: ../clients/cli/connections.c:3831 ../libnm-glib/nm-device.c:1795
+#: ../libnm/nm-device.c:1617
msgid "OLPC Mesh"
msgstr "Сітка OLPC"
-#: ../cli/src/connections.c:3525
+#: ../clients/cli/connections.c:3836
msgid "OLPC Mesh channel [1]: "
msgstr "Канал OLPC Mesh [типово 1]: "
-#: ../cli/src/connections.c:3528
+#: ../clients/cli/connections.c:3839
#, c-format
msgid "Error: 'channel': '%s' is not a valid number <1-13>.\n"
msgstr "Помилка: «channel»: «%s» не Ñ” чиÑлом у діапазоні <1-13>.\n"
-#: ../cli/src/connections.c:3536
+#: ../clients/cli/connections.c:3847
msgid "DHCP anycast MAC address [none]: "
msgstr "MAC-адреÑа довільного надÑÐ¸Ð»Ð°Ð½Ð½Ñ (anycast) DHCP [типово немає]: "
-#: ../cli/src/connections.c:3581
-msgid "IPv4 address (IP[/plen] [gateway]) [none]: "
-msgstr "ÐдреÑа IPv4 (IP[/префікÑ] [шлюз]) [none]: "
+#: ../clients/cli/connections.c:3889
+msgid "IPv4 address (IP[/plen]) [none]: "
+msgstr "ÐдреÑа IPv4 (IP[/plen]) [немає]: "
-#: ../cli/src/connections.c:3583
-msgid "IPv6 address (IP[/plen] [gateway]) [none]: "
-msgstr "ÐдреÑа IPv6 (IP[/префікÑ] [шлюз]) [none]: "
+#: ../clients/cli/connections.c:3891
+msgid "IPv6 address (IP[/plen]) [none]: "
+msgstr "ÐдреÑа IPv6 (IP[/plen]) [немає]: "
-#: ../cli/src/connections.c:3601
+#: ../clients/cli/connections.c:3905
#, c-format
-msgid " Address successfully added: %s %s\n"
-msgstr " ÐдреÑу уÑпішно додано: %s %s\n"
+msgid " Address successfully added: %s\n"
+msgstr " ÐдреÑу уÑпішно додано: %s\n"
-#: ../cli/src/connections.c:3603
+#: ../clients/cli/connections.c:3907
#, c-format
-msgid " Warning: address already present: %s %s\n"
-msgstr " ПопередженнÑ: адреÑу вже викориÑтано: %s %s\n"
+msgid " Warning: address already present: %s\n"
+msgstr " ПопердженнÑ: адреÑу вже вказано: %s\n"
-#: ../cli/src/connections.c:3605
+#: ../clients/cli/connections.c:3909
#, c-format
msgid " Warning: ignoring garbage at the end: '%s'\n"
msgstr " ПопередженнÑ: зайві дані наприкінці проігноровано: «%s»\n"
-#: ../cli/src/connections.c:3607 ../cli/src/connections.c:4464
-#: ../cli/src/connections.c:4527 ../cli/src/connections.c:4938
-#: ../cli/src/connections.c:4948
+#: ../clients/cli/connections.c:3911 ../clients/cli/connections.c:4791
+#: ../clients/cli/connections.c:4852 ../clients/cli/connections.c:5253
+#: ../clients/cli/connections.c:5286
msgid "Error: "
msgstr "Помилка: "
+#: ../clients/cli/connections.c:3931
+msgid "IPv4 gateway [none]: "
+msgstr "Шлюз IPv4 [немає]: "
+
+#: ../clients/cli/connections.c:3934
+msgid "IPv6 gateway [none]: "
+msgstr "Шлюз IPv6 [немає]: "
+
+#: ../clients/cli/connections.c:3954
+#, c-format
+msgid "Error: invalid gateway address '%s'\n"
+msgstr "Помилка: некоректна адреÑа шлюзу, «%s»\n"
+
#. Ask for IP addresses
-#: ../cli/src/connections.c:3624
+#: ../clients/cli/connections.c:3967
#, c-format
-#| msgid "Do you want to add IP addresses? (yes/no) [yes] "
msgid "Do you want to add IP addresses? %s"
msgstr "Хочете додати IP-адреÑи? %s"
-#: ../cli/src/connections.c:3631
+#: ../clients/cli/connections.c:3975
#, c-format
msgid "Press <Enter> to finish adding addresses.\n"
msgstr "ÐатиÑніть <Enter>, щоб завершити Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð°Ð´Ñ€ÐµÑ.\n"
-#: ../cli/src/connections.c:3777
+#: ../clients/cli/connections.c:4113
#, c-format
msgid "Error: 'parent': not valid without 'p-key'."
msgstr "Помилка: «parent»: є некоректним без «p-key»."
-#: ../cli/src/connections.c:3833 ../cli/src/connections.c:4854
+#: ../clients/cli/connections.c:4168 ../clients/cli/connections.c:5173
msgid "SSID: "
msgstr "SSID: "
-#: ../cli/src/connections.c:3836 ../cli/src/connections.c:4857
+#: ../clients/cli/connections.c:4171 ../clients/cli/connections.c:5176
msgid "Error: 'ssid' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «ssid»."
-#: ../cli/src/connections.c:3900
+#: ../clients/cli/connections.c:4235
msgid "WiMAX NSP name: "
msgstr "Ðазва NSP WiMAX: "
-#: ../cli/src/connections.c:3903
+#: ../clients/cli/connections.c:4238
msgid "Error: 'nsp' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «nsp»."
-#: ../cli/src/connections.c:3958
+#: ../clients/cli/connections.c:4290
msgid "PPPoE username: "
msgstr "КориÑтувач PPPoE: "
-#: ../cli/src/connections.c:3961
+#: ../clients/cli/connections.c:4293
msgid "Error: 'username' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «username»."
-#: ../cli/src/connections.c:4032
+#: ../clients/cli/connections.c:4362
msgid "APN: "
msgstr "APN: "
-#: ../cli/src/connections.c:4035
+#: ../clients/cli/connections.c:4365
msgid "Error: 'apn' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «apn»."
-#: ../cli/src/connections.c:4094
+#: ../clients/cli/connections.c:4423
msgid "Bluetooth device address: "
msgstr "ÐдреÑа приÑтрою Bluetooth: "
-#: ../cli/src/connections.c:4097
+#: ../clients/cli/connections.c:4426
msgid "Error: 'addr' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «addr»."
-#: ../cli/src/connections.c:4140
+#: ../clients/cli/connections.c:4467
#, c-format
msgid "Error: 'bt-type': '%s' not valid; use [%s, %s (%s), %s]."
msgstr ""
"Помилка: «bt-type»: «%s» Ñ” некоректним; ÑкориÑтайтеÑÑ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñм з переліку "
"[%s, %s (%s), %s]."
-#: ../cli/src/connections.c:4185
+#: ../clients/cli/connections.c:4511
msgid "VLAN parent device or connection UUID: "
msgstr "БатьківÑький приÑтрій VLAN або UUID з’єднаннÑ: "
-#: ../cli/src/connections.c:4188
+#: ../clients/cli/connections.c:4514
msgid "Error: 'dev' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «dev»."
-#: ../cli/src/connections.c:4192
+#: ../clients/cli/connections.c:4518
msgid "VLAN ID <0-4095>: "
msgstr "Ід. VLAN <0-4095>: "
-#: ../cli/src/connections.c:4195
+#: ../clients/cli/connections.c:4521
msgid "Error: 'id' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «id»."
-#: ../cli/src/connections.c:4201
+#: ../clients/cli/connections.c:4527
#, c-format
msgid "Error: 'id': '%s' is not valid; use <0-4095>."
msgstr ""
"Помилка: «id»: «%s» Ñ” некоректним; мало бути чиÑло у діапазоні <0-4095>."
-#: ../cli/src/connections.c:4211
+#: ../clients/cli/connections.c:4537
#, c-format
msgid "Error: 'dev': '%s' is neither UUID, interface name, nor MAC."
msgstr ""
"Помилка: «dev»: «%s» не Ñ” ні UUID, ні назвою інтерфейÑу, ні MAC-адреÑою."
-#: ../cli/src/connections.c:4346
+#: ../clients/cli/connections.c:4671
#, c-format
msgid "Error: 'mode': %s."
msgstr "Помилка: «mode»: %s."
-#: ../cli/src/connections.c:4355
+#: ../clients/cli/connections.c:4680
#, c-format
msgid "Error: 'primary': '%s' is not a valid interface name."
msgstr "Помилка: «primary»: «%s» не Ñ” коректною назвою інтерфейÑу."
-#: ../cli/src/connections.c:4405 ../cli/src/connections.c:4505
-#: ../cli/src/connections.c:4712
+#: ../clients/cli/connections.c:4732 ../clients/cli/connections.c:4830
+#: ../clients/cli/connections.c:5032
msgid "Error: 'master' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «master»."
-#: ../cli/src/connections.c:4411 ../cli/src/connections.c:4511
-#: ../cli/src/connections.c:4718
+#: ../clients/cli/connections.c:4738 ../clients/cli/connections.c:4836
+#: ../clients/cli/connections.c:5038
#, c-format
msgid "Warning: master='%s' doesn't refer to any existing profile.\n"
msgstr ""
"ПопередженнÑ: master='%s' не поÑилаєтьÑÑ Ð½Ñ– на один з наÑвних профілів.\n"
-#: ../cli/src/connections.c:4414 ../cli/src/connections.c:4519
-#: ../cli/src/connections.c:4721
+#: ../clients/cli/connections.c:4741 ../clients/cli/connections.c:4844
+#: ../clients/cli/connections.c:5041
#, c-format
msgid ""
"Warning: 'type' is currently ignored. We only support ethernet slaves for "
@@ -2109,83 +2210,112 @@ msgstr ""
"поточній верÑÑ–Ñ— підтримку підлеглих інтерфейÑів передбачено лише Ð´Ð»Ñ "
"Ethernet.\n"
-#: ../cli/src/connections.c:4614
+#: ../clients/cli/connections.c:4938
#, c-format
msgid "Error: 'stp': %s."
msgstr "Помилка: «stp»: %s."
-#: ../cli/src/connections.c:4748
+#: ../clients/cli/connections.c:5068
#, c-format
msgid "Error: 'hairpin': %s."
msgstr "Помилка: «hairpin»: %s."
-#: ../cli/src/connections.c:4801
+#: ../clients/cli/connections.c:5121
msgid "Error: 'vpn-type' is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «vpn-type»."
-#: ../cli/src/connections.c:4808
+#: ../clients/cli/connections.c:5128
#, c-format
-#| msgid "Error: 'vpn-type': %s."
msgid "Warning: 'vpn-type': %s not known.\n"
msgstr "ПопередженнÑ: «vpn-type»: невідоме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s.\n"
-#: ../cli/src/connections.c:4870
+#: ../clients/cli/connections.c:5189
#, c-format
msgid "Error: 'channel': '%s' is not valid; use <1-13>."
msgstr ""
"Помилка: «channel»: «%s» Ñ” некоректним; Ñлід викориÑтовувати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð· "
"діапазону <1-13>."
-#: ../cli/src/connections.c:4905
+#: ../clients/cli/connections.c:5221
#, c-format
msgid "Error: '%s' is not a valid connection type."
msgstr "Помилка: «%s» не Ñ” коректним типом з’єднаннÑ."
-#: ../cli/src/connections.c:5003
+#: ../clients/cli/connections.c:5265
+#, c-format
+msgid "Error: IPv4 gateway specified without IPv4 addresses"
+msgstr "Помилка: шлюз IPv4 вказано без Ð°Ð´Ñ€ÐµÑ IPv4"
+
+#: ../clients/cli/connections.c:5269
#, c-format
-msgid "Error: Failed to add '%s' connection: (%d) %s"
-msgstr "Помилка: не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»: (%d) %s"
+msgid "Error: multiple IPv4 gateways specified"
+msgstr "Помилка: вказано декілька шлюзів IPv4"
-#: ../cli/src/connections.c:5007
+#: ../clients/cli/connections.c:5273
+#, c-format
+msgid "Error: Invalid IPv4 gateway '%s'"
+msgstr "Помилка: некоректний шлюз IPv4, «%s»"
+
+#: ../clients/cli/connections.c:5298
+#, c-format
+msgid "Error: IPv6 gateway specified without IPv6 addresses"
+msgstr "Помилка: шлюз IPv6 вказано без Ð°Ð´Ñ€ÐµÑ IPv6"
+
+#: ../clients/cli/connections.c:5302
+#, c-format
+msgid "Error: multiple IPv6 gateways specified"
+msgstr "Помилка: вказано декілька шлюзів IPv6"
+
+#: ../clients/cli/connections.c:5306
+#, c-format
+msgid "Error: Invalid IPv6 gateway '%s'"
+msgstr "Помилка: некоректний шлюз IPv6, «%s»"
+
+#: ../clients/cli/connections.c:5366
+#, c-format
+msgid "Error: Failed to add '%s' connection: %s"
+msgstr "Помилка: не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»: %s"
+
+#: ../clients/cli/connections.c:5371
#, c-format
msgid "Connection '%s' (%s) successfully added.\n"
msgstr "Ð—Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s) уÑпішно додано.\n"
-#: ../cli/src/connections.c:5221
+#: ../clients/cli/connections.c:5591
#, c-format
msgid "Error: 'type' argument is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«type»."
-#: ../cli/src/connections.c:5229
+#: ../clients/cli/connections.c:5599
#, c-format
msgid "Error: invalid connection type; %s."
msgstr "Помилка: некоректний тип з’єднаннÑ; %s."
-#: ../cli/src/connections.c:5238
+#: ../clients/cli/connections.c:5608
#, c-format
msgid "Error: 'autoconnect': %s."
msgstr "Помилка: «autoconnect»: %s."
-#: ../cli/src/connections.c:5248
+#: ../clients/cli/connections.c:5618
#, c-format
msgid "Error: 'save': %s."
msgstr "Помилка: «save»: %s."
-#: ../cli/src/connections.c:5264
+#: ../clients/cli/connections.c:5634
msgid "Interface name [*]: "
msgstr "Ðазва інтерфейÑу [типово *]: "
-#: ../cli/src/connections.c:5269
+#: ../clients/cli/connections.c:5639
#, c-format
msgid "Error: 'ifname' argument is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«ifname»."
-#: ../cli/src/connections.c:5276
+#: ../clients/cli/connections.c:5646
#, c-format
msgid "Error: 'ifname': '%s' is not a valid interface nor '*'."
msgstr "Помилка: «ifname»: «%s» не Ñ” коректним інтерфейÑом Ñ– не дорівнює «*»."
-#: ../cli/src/connections.c:6064
+#: ../clients/cli/connections.c:6422
#, c-format
msgid "['%s' setting values]\n"
msgstr "['%s' Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°]\n"
@@ -2193,23 +2323,8 @@ msgstr "['%s' Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°]\n"
#. TRANSLATORS: do not translate command names and keywords before ::
#. * However, you should translate terms enclosed in <>.
#.
-#: ../cli/src/connections.c:6146
+#: ../clients/cli/connections.c:6504
#, c-format
-#| msgid ""
-#| "---[ Main menu ]---\n"
-#| "goto [<setting> | <prop>] :: go to a setting or property\n"
-#| "remove <setting>[.<prop>] | <prop> :: remove setting or reset property "
-#| "value\n"
-#| "set [<setting>.<prop> <value>] :: set property value\n"
-#| "describe [<setting>.<prop>] :: describe property\n"
-#| "print [all] :: print the connection\n"
-#| "verify [all] :: verify the connection\n"
-#| "save [persistent|temporary] :: save the connection\n"
-#| "activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
-#| "back :: go one level up (back)\n"
-#| "help/? [<command>] :: print this help\n"
-#| "nmcli <conf-option> <value> :: nmcli configuration\n"
-#| "quit :: exit nmcli\n"
msgid ""
"---[ Main menu ]---\n"
"goto [<setting> | <prop>] :: go to a setting or property\n"
@@ -2218,7 +2333,7 @@ msgid ""
"set [<setting>.<prop> <value>] :: set property value\n"
"describe [<setting>.<prop>] :: describe property\n"
"print [all | <setting>[.<prop>]] :: print the connection\n"
-"verify [all] :: verify the connection\n"
+"verify [all | fix] :: verify the connection\n"
"save [persistent|temporary] :: save the connection\n"
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
"back :: go one level up (back)\n"
@@ -2233,8 +2348,8 @@ msgstr ""
"початкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ–\n"
"set [<парам.>.<влаÑÑ‚.> <знач.>] :: вÑтановити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ–\n"
"describe [<парам.>.<влаÑÑ‚.>] :: показати Ð¾Ð¿Ð¸Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ–\n"
-"print [all| <параметр>[.<влаÑÑ‚.>]] :: вивеÑти дані з’єднаннÑ\n"
-"verify [all] :: перевірити з’єднаннÑ\n"
+"print [all | <парам.>.<влаÑÑ‚.>] :: вивеÑти дані з’єднаннÑ\n"
+"verify [all | fix] :: перевірити з’єднаннÑ\n"
"save [persistent|temporary] :: зберегти з’єднаннÑ\n"
"activate [<інтерфейÑ>] [/<ap>|<nsp>] :: задіÑти з’єднаннÑ\n"
"back :: перейти на рівень вище (назад)\n"
@@ -2242,7 +2357,7 @@ msgstr ""
"nmcli <параметр-налашт.> <знач.> :: Ð½Ð°Ð»Ð°ÑˆÑ‚Ð¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ nmcli\n"
"quit :: завершити роботу nmcli\n"
-#: ../cli/src/connections.c:6173
+#: ../clients/cli/connections.c:6531
#, c-format
msgid ""
"goto <setting>[.<prop>] | <prop> :: enter setting/property for editing\n"
@@ -2263,7 +2378,7 @@ msgstr ""
" nmcli connection> goto secondaries\n"
" nmcli> goto ipv4.addresses\n"
-#: ../cli/src/connections.c:6180
+#: ../clients/cli/connections.c:6538
#, c-format
msgid ""
"remove <setting>[.<prop>] :: remove setting or reset property value\n"
@@ -2285,7 +2400,7 @@ msgstr ""
"Приклади: nmcli> remove wifi-sec\n"
" nmcli> remove eth.mtu\n"
-#: ../cli/src/connections.c:6187
+#: ../clients/cli/connections.c:6545
#, c-format
msgid ""
"set [<setting>.<prop> <value>] :: set property value\n"
@@ -2301,7 +2416,7 @@ msgstr ""
"\n"
"Приклад: nmcli> s con.id My connection\n"
-#: ../cli/src/connections.c:6192
+#: ../clients/cli/connections.c:6550
#, c-format
msgid ""
"describe [<setting>.<prop>] :: describe property\n"
@@ -2314,7 +2429,7 @@ msgstr ""
"Показує Ð¾Ð¿Ð¸Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ–. СпиÑок уÑÑ–Ñ… параметрів Ñ– влаÑтивоÑтей NM можна "
"знайти на Ñторінці довідника (man) nm-settings(5).\n"
-#: ../cli/src/connections.c:6197
+#: ../clients/cli/connections.c:6555
#, c-format
msgid ""
"print [all] :: print setting or connection values\n"
@@ -2329,27 +2444,32 @@ msgstr ""
"\n"
"Приклад: nmcli ipv4> print all\n"
-#: ../cli/src/connections.c:6202
+#: ../clients/cli/connections.c:6560
#, c-format
msgid ""
-"verify [all] :: verify setting or connection validity\n"
+"verify [all | fix] :: verify setting or connection validity\n"
"\n"
-"Verifies whether the setting or connection is valid and can be saved later. "
-"It indicates invalid values on error.\n"
+"Verifies whether the setting or connection is valid and can be saved later.\n"
+"It indicates invalid values on error. Some errors may be fixed "
+"automatically\n"
+"by 'fix' option.\n"
"\n"
"Examples: nmcli> verify\n"
+" nmcli> verify fix\n"
" nmcli bond> verify\n"
msgstr ""
-"verify [all] :: перевірити чинніÑÑ‚ÑŒ параметра або запиÑу з’єднаннÑ\n"
+"verify [all | fix] :: перевірити чинніÑÑ‚ÑŒ параметра або запиÑу з’єднаннÑ\n"
"\n"
-"ПеревірÑÑ”, чи Ñ” коректним Ð·Ð°Ð¿Ð¸Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° або Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ– чи можна його "
-"згодом зберегти. Показує ÑпиÑок некоректних значень, Ñкщо було виÑвлено "
-"помилку.\n"
+"ПеревірÑÑ”, чи Ñ” коректним Ð·Ð°Ð¿Ð¸Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° або Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ– чи можна його \n"
+"згодом зберегти. Показує ÑпиÑок некоректних значень, Ñкщо було виÑвлено \n"
+"помилку. ДеÑкі помилки може бути виправлено автоматично за допомогою \n"
+"параметра «fix».\n"
"\n"
"Приклади: nmcli> verify\n"
+" nmcli> verify fix\n"
" nmcli bond> verify\n"
-#: ../cli/src/connections.c:6209
+#: ../clients/cli/connections.c:6569
#, c-format
msgid ""
"save [persistent|temporary] :: save the connection\n"
@@ -2376,7 +2496,7 @@ msgstr ""
"потрібно\n"
"повніÑÑ‚ÑŽ вилучити поÑтійне з’єднаннÑ, вам доведетьÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ його профіль.\n"
-#: ../cli/src/connections.c:6220
+#: ../clients/cli/connections.c:6580
#, c-format
msgid ""
"activate [<ifname>] [/<ap>|<nsp>] :: activate the connection\n"
@@ -2397,7 +2517,7 @@ msgstr ""
"/<ap>|<nsp> - AP (Wi-Fi) або NSP (WiMAX) (додайте на початку «/», Ñкщо не "
"вказано <інтерфейÑ>)\n"
-#: ../cli/src/connections.c:6227 ../cli/src/connections.c:6384
+#: ../clients/cli/connections.c:6587 ../clients/cli/connections.c:6745
#, c-format
msgid ""
"back :: go to upper menu level\n"
@@ -2406,7 +2526,7 @@ msgstr ""
"back :: піднÑтиÑÑ Ñƒ меню на один рівень\n"
"\n"
-#: ../cli/src/connections.c:6230
+#: ../clients/cli/connections.c:6590
#, c-format
msgid ""
"help/? [<command>] :: help for the nmcli commands\n"
@@ -2415,7 +2535,7 @@ msgstr ""
"help/? [<команда>] :: довідка з команди nmcli\n"
"\n"
-#: ../cli/src/connections.c:6233
+#: ../clients/cli/connections.c:6593
#, c-format
msgid ""
"nmcli [<conf-option> <value>] :: nmcli configuration\n"
@@ -2423,6 +2543,7 @@ msgid ""
"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"
@@ -2443,6 +2564,7 @@ msgstr ""
"ÐÐ°Ð»Ð°ÑˆÑ‚Ð¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ nmcli. Можна керувати такими параметрами:\n"
"status-line yes | no [типово: no]\n"
"save-confirmation yes | no [типово: yes]\n"
+"show-secrets yes | no [типово: no]\n"
"prompt-color <0-8> [типово: 0]\n"
" 0 = normal\n"
" 1 = чорний\n"
@@ -2458,7 +2580,7 @@ msgstr ""
" nmcli> nmcli save-confirmation no\n"
" nmcli> nmcli prompt-color 3\n"
-#: ../cli/src/connections.c:6253 ../cli/src/connections.c:6390
+#: ../clients/cli/connections.c:6614 ../clients/cli/connections.c:6751
#, c-format
msgid ""
"quit :: exit nmcli\n"
@@ -2472,8 +2594,8 @@ msgstr ""
"Ð·Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ було збережено, кориÑтувачеві буде запропоновано "
"підтвердити дію з виходу з програми.\n"
-#: ../cli/src/connections.c:6258 ../cli/src/connections.c:6395
-#: ../cli/src/connections.c:6783 ../cli/src/connections.c:7676
+#: ../clients/cli/connections.c:6619 ../clients/cli/connections.c:6756
+#: ../clients/cli/connections.c:7167 ../clients/cli/connections.c:8083
#, c-format
msgid "Unknown command: '%s'\n"
msgstr "Ðевідома команда «%s».\n"
@@ -2481,7 +2603,7 @@ msgstr "Ðевідома команда «%s».\n"
#. TRANSLATORS: do not translate command names and keywords before ::
#. * However, you should translate terms enclosed in <>.
#.
-#: ../cli/src/connections.c:6324
+#: ../clients/cli/connections.c:6685
#, c-format
msgid ""
"---[ Property menu ]---\n"
@@ -2508,7 +2630,7 @@ msgstr ""
"help/? [<команда>] :: вивеÑти цю довідку або Ð¾Ð¿Ð¸Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸\n"
"quit :: вийти з nmcli\n"
-#: ../cli/src/connections.c:6349
+#: ../clients/cli/connections.c:6710
#, c-format
msgid ""
"set [<value>] :: set new value\n"
@@ -2520,7 +2642,7 @@ msgstr ""
"За допомогою цієї команди можна змінити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– на вказане "
"<значеннÑ>\n"
-#: ../cli/src/connections.c:6353
+#: ../clients/cli/connections.c:6714
#, c-format
msgid ""
"add [<value>] :: append new value to the property\n"
@@ -2535,7 +2657,7 @@ msgstr ""
"Ñкщо влаÑтивіÑÑ‚ÑŒ належить до типу контейнерів. Якщо влаÑтивіÑÑ‚ÑŒ ÑкладаєтьÑÑ "
"лише з одного значеннÑ, це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð±ÑƒÐ´Ðµ замінено (те Ñаме, що Ñ– «set»).\n"
-#: ../cli/src/connections.c:6359
+#: ../clients/cli/connections.c:6720
#, c-format
msgid ""
"change :: change current value\n"
@@ -2546,7 +2668,7 @@ msgstr ""
"\n"
"Показує поточне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ– надає змогу його редагувати.\n"
-#: ../cli/src/connections.c:6363
+#: ../clients/cli/connections.c:6724
#, c-format
msgid ""
"remove [<value>|<index>|<option name>] :: delete the value\n"
@@ -2579,7 +2701,7 @@ msgstr ""
" nmcli bond.options> remove downdelay\n"
"\n"
-#: ../cli/src/connections.c:6374
+#: ../clients/cli/connections.c:6735
#, c-format
msgid ""
"describe :: describe property\n"
@@ -2592,7 +2714,7 @@ msgstr ""
"Показує Ð¾Ð¿Ð¸Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ–. СпиÑок уÑÑ–Ñ… параметрів Ñ– влаÑтивоÑтей NM можна "
"знайти на Ñторінці довідника (man) nm-settings(5).\n"
-#: ../cli/src/connections.c:6379
+#: ../clients/cli/connections.c:6740
#, c-format
msgid ""
"print [property|setting|connection] :: print property (setting, connection) "
@@ -2607,7 +2729,7 @@ msgstr ""
"Виводить Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ–. За допомогою аргументу команди ви можете "
"виводити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÑƒÑього параметра або уÑього запиÑу з’єднаннÑ.\n"
-#: ../cli/src/connections.c:6387
+#: ../clients/cli/connections.c:6748
#, c-format
msgid ""
"help/? [<command>] :: help for nmcli commands\n"
@@ -2616,30 +2738,29 @@ msgstr ""
"help/? [<команда>] :: довідка з команди nmcli\n"
"\n"
-#: ../cli/src/connections.c:6474
+#: ../clients/cli/connections.c:6846
#, c-format
msgid "Error: Connection activation failed.\n"
msgstr "Помилка: невдала Ñпроба активації з’єднаннÑ.\n"
-#: ../cli/src/connections.c:6552
+#: ../clients/cli/connections.c:6929
#, c-format
msgid "Error: setting '%s' is mandatory and cannot be removed.\n"
msgstr "Помилка: параметр «%s» Ñ” обов’Ñзковим, його не можна вилучати.\n"
#. TRANSLATORS: status line in nmcli connection editor
-#: ../cli/src/connections.c:6570
+#: ../clients/cli/connections.c:6947
#, c-format
msgid "[ Type: %s | Name: %s | UUID: %s | Dirty: %s | Temp: %s ]\n"
msgstr "[ Тип: %s | Ðазва: %s | UUID: %s | Ðе збережено: %s | Тимч.: %s ]\n"
-#: ../cli/src/connections.c:6605
+#: ../clients/cli/connections.c:6983
#, c-format
-#| msgid "The connection is not saved. Do you really want to quit? [y/n]\n"
msgid "The connection is not saved. Do you really want to quit? %s"
msgstr ""
"Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ збережено. Ви Ñправді хочете завершити роботу програми? %s"
-#: ../cli/src/connections.c:6650
+#: ../clients/cli/connections.c:7028
#, c-format
msgid ""
"The connection profile has been removed from another client. You may type "
@@ -2648,65 +2769,61 @@ msgstr ""
"Профіль Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð±ÑƒÐ»Ð¾ вилучено з іншого клієнта. Ви можете ввеÑти «save» у "
"головному меню, щоб відновити його.\n"
-#: ../cli/src/connections.c:6672 ../cli/src/connections.c:7087
-#: ../cli/src/connections.c:7142
+#: ../clients/cli/connections.c:7050 ../clients/cli/connections.c:7471
+#: ../clients/cli/connections.c:7526
#, c-format
msgid "Enter '%s' value: "
msgstr "Введіть Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»: "
-#: ../cli/src/connections.c:6687 ../cli/src/connections.c:6705
-#: ../cli/src/connections.c:7091 ../cli/src/connections.c:7147
+#: ../clients/cli/connections.c:7065 ../clients/cli/connections.c:7087
+#: ../clients/cli/connections.c:7475 ../clients/cli/connections.c:7531
#, c-format
msgid "Error: failed to set '%s' property: %s\n"
msgstr "Помилка: не вдалоÑÑ Ð²Ñтановити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– «%s»: %s\n"
-#: ../cli/src/connections.c:6699
+#: ../clients/cli/connections.c:7081
#, c-format
msgid "Edit '%s' value: "
msgstr "Ð ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»: "
-#: ../cli/src/connections.c:6726
+#: ../clients/cli/connections.c:7110
#, c-format
msgid "Error: %s\n"
msgstr "Помилка: %s\n"
-#: ../cli/src/connections.c:6732 ../cli/src/connections.c:7226
-#: ../cli/src/connections.c:7267
+#: ../clients/cli/connections.c:7116 ../clients/cli/connections.c:7610
+#: ../clients/cli/connections.c:7651
#, c-format
msgid "Error: failed to remove value of '%s': %s\n"
msgstr "Помилка: не вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»: %s\n"
-#: ../cli/src/connections.c:6753
+#: ../clients/cli/connections.c:7137
#, c-format
msgid "Unknown command argument: '%s'\n"
msgstr "Ðевідомий аргумент команди: «%s»\n"
-#: ../cli/src/connections.c:6879
+#: ../clients/cli/connections.c:7263
#, c-format
msgid "Available settings: %s\n"
msgstr "ДоÑтупні параметри: %s\n"
-#: ../cli/src/connections.c:6888
+#: ../clients/cli/connections.c:7272
#, c-format
msgid "Error: invalid setting name; %s\n"
msgstr "Помилка: некоректна назва параметра; %s\n"
-#: ../cli/src/connections.c:6905
+#: ../clients/cli/connections.c:7289
#, c-format
msgid "Available properties: %s\n"
msgstr "ДоÑтупні влаÑтивоÑÑ‚Ñ–: %s\n"
-#: ../cli/src/connections.c:6913
+#: ../clients/cli/connections.c:7297
#, c-format
msgid "Error: property %s\n"
msgstr "Помилка: влаÑтивіÑÑ‚ÑŒ %s\n"
-#: ../cli/src/connections.c:6954
+#: ../clients/cli/connections.c:7338
#, c-format
-#| msgid ""
-#| "Saving the connection with 'autoconnect=yes'. That might result in an "
-#| "immediate activation of the connection.\n"
-#| "Do you still want to save? [yes] "
msgid ""
"Saving the connection with 'autoconnect=yes'. That might result in an "
"immediate activation of the connection.\n"
@@ -2716,12 +2833,12 @@ msgstr ""
"Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° може призвеÑти до негайного задіÑÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ.\n"
"Хочете зберегти запиÑ? %s"
-#: ../cli/src/connections.c:7029
+#: ../clients/cli/connections.c:7413
#, c-format
msgid "You may edit the following settings: %s\n"
msgstr "Можна редагувати такі параметри: %s\n"
-#: ../cli/src/connections.c:7056
+#: ../clients/cli/connections.c:7440
#, c-format
msgid ""
"The connection profile has been removed from another client. You may type "
@@ -2730,216 +2847,233 @@ msgstr ""
"Профіль Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð±ÑƒÐ»Ð¾ вилучено з іншого клієнта. Ви можете ввеÑти «save», "
"щоб відновити його.\n"
-#: ../cli/src/connections.c:7085 ../cli/src/connections.c:7140
+#: ../clients/cli/connections.c:7469 ../clients/cli/connections.c:7524
#, c-format
msgid "Allowed values for '%s' property: %s\n"
msgstr "Можливі Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– «%s»: %s\n"
-#: ../cli/src/connections.c:7095 ../cli/src/connections.c:7309
+#: ../clients/cli/connections.c:7479 ../clients/cli/connections.c:7693
#, c-format
msgid "Error: no setting selected; valid are [%s]\n"
msgstr ""
"Помилка: не вибрано Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°; коректними значеннÑми Ñ” такі: [%s]\n"
-#: ../cli/src/connections.c:7096
+#: ../clients/cli/connections.c:7480
#, c-format
msgid "use 'goto <setting>' first, or 'set <setting>.<property>'\n"
msgstr ""
"Ñпочатку ÑкориÑтайтеÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¾ÑŽ «goto <параметр>» або командою «set "
"<параметр>.<влаÑтивіÑÑ‚ÑŒ>»\n"
-#: ../cli/src/connections.c:7110 ../cli/src/connections.c:7246
-#: ../cli/src/connections.c:7326
+#: ../clients/cli/connections.c:7494 ../clients/cli/connections.c:7630
+#: ../clients/cli/connections.c:7710
#, c-format
msgid "Error: invalid setting argument '%s'; valid are [%s]\n"
msgstr ""
"Помилка: некоректний аргумент параметра, «%s»; коректними є такі аргументи: "
"[%s]\n"
-#: ../cli/src/connections.c:7120
+#: ../clients/cli/connections.c:7504
#, c-format
msgid "Error: missing setting for '%s' property\n"
msgstr "Помилка: не вказано параметра Ð´Ð»Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– «%s»\n"
-#: ../cli/src/connections.c:7127
+#: ../clients/cli/connections.c:7511
#, c-format
msgid "Error: invalid property: %s\n"
msgstr "Помилка: некоректна влаÑтивіÑÑ‚ÑŒ: %s\n"
-#: ../cli/src/connections.c:7174
+#: ../clients/cli/connections.c:7558
#, c-format
msgid "Error: unknown setting '%s'\n"
msgstr "Помилка: невідоме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»\n"
-#: ../cli/src/connections.c:7187
+#: ../clients/cli/connections.c:7571
#, c-format
msgid "You may edit the following properties: %s\n"
msgstr "Можна редагувати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ‚Ð°ÐºÐ¸Ñ… влаÑтивоÑтей: %s\n"
-#: ../cli/src/connections.c:7231
+#: ../clients/cli/connections.c:7615
#, c-format
msgid "Error: no argument given; valid are [%s]\n"
msgstr "Помилка: не вказано аргументу; коректними аргументами є такі: [%s]\n"
-#: ../cli/src/connections.c:7244
+#: ../clients/cli/connections.c:7628
#, c-format
msgid "Setting '%s' is not present in the connection.\n"
msgstr "У Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð°Ñ” параметра «%s».\n"
-#: ../cli/src/connections.c:7285
+#: ../clients/cli/connections.c:7669
#, c-format
msgid "Error: %s properties, nor it is a setting name.\n"
msgstr "Помилка: влаÑтивоÑÑ‚Ñ– %s Ñ– не Ñ” назвою параметра.\n"
-#: ../cli/src/connections.c:7310
+#: ../clients/cli/connections.c:7694
#, c-format
msgid "use 'goto <setting>' first, or 'describe <setting>.<property>'\n"
msgstr ""
"ÑкориÑтайтеÑÑ Ñпочатку командою «goto <параметр> або командою «describe "
"<параметр>.<влаÑтивіÑÑ‚ÑŒ>»\n"
-#: ../cli/src/connections.c:7351
+#: ../clients/cli/connections.c:7735
#, c-format
msgid "Error: invalid property: %s, neither a valid setting name.\n"
msgstr ""
"Помилка: некоректна влаÑтивіÑÑ‚ÑŒ: %s Ñ– не Ñ” коректною назвою параметра.\n"
-#: ../cli/src/connections.c:7380
+#: ../clients/cli/connections.c:7764
#, c-format
msgid "Error: unknown setting: '%s'\n"
msgstr "Помилка: невідомий параметр: «%s»\n"
-#: ../cli/src/connections.c:7385
+#: ../clients/cli/connections.c:7769
#, c-format
-#| msgid "Setting '%s' is not present in the connection.\n"
msgid "Error: '%s' setting not present in the connection\n"
msgstr "Помилка: у Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð°Ñ” параметра «%s».\n"
-#: ../cli/src/connections.c:7410
+#: ../clients/cli/connections.c:7794
#, c-format
-#| msgid "Error: invalid property: %s\n"
msgid "Error: invalid property: %s%s\n"
msgstr "Помилка: некоректна влаÑтивіÑÑ‚ÑŒ: %s%s\n"
-#: ../cli/src/connections.c:7412
-#| msgid "Error: invalid property: %s, neither a valid setting name.\n"
+#: ../clients/cli/connections.c:7796
msgid ", neither a valid setting name"
msgstr ", і не є коректною назвою параметра"
-#: ../cli/src/connections.c:7432
+#: ../clients/cli/connections.c:7813
+#, c-format
+msgid "Invalid verify option: %s\n"
+msgstr "Ðекоректний параметр verify: %s\n"
+
+#: ../clients/cli/connections.c:7821
#, c-format
msgid "Verify setting '%s': %s\n"
msgstr "Перевірка параметра «%s»: %s\n"
-#: ../cli/src/connections.c:7439
+#: ../clients/cli/connections.c:7836
#, c-format
msgid "Verify connection: %s\n"
msgstr "Перевірка з’єднаннÑ: %s\n"
-#: ../cli/src/connections.c:7457
+#: ../clients/cli/connections.c:7839
+#, c-format
+msgid "The error cannot be fixed automatically.\n"
+msgstr "Помилку не можна виправити у автоматичному режимі.\n"
+
+#: ../clients/cli/connections.c:7856
#, c-format
msgid "Error: invalid argument '%s'\n"
msgstr "Помилка: некоректний аргумент «%s»\n"
-#: ../cli/src/connections.c:7491
+#: ../clients/cli/connections.c:7889
#, c-format
-msgid "Error: Failed to save '%s' (%s) connection: (%d) %s\n"
-msgstr "Помилка: не вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s): (%d) %s\n"
+msgid "Error: Failed to save '%s' (%s) connection: %s\n"
+msgstr "Помилка: не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s): %s\n"
-#: ../cli/src/connections.c:7499
+#: ../clients/cli/connections.c:7896
#, c-format
msgid "Connection '%s' (%s) successfully saved.\n"
msgstr "Ð—Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s) уÑпішно збережено.\n"
-#: ../cli/src/connections.c:7500
+#: ../clients/cli/connections.c:7897
#, c-format
msgid "Connection '%s' (%s) successfully updated.\n"
msgstr "Ð—Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s) уÑпішно оновлено.\n"
-#: ../cli/src/connections.c:7534
+#: ../clients/cli/connections.c:7930
#, c-format
msgid "Error: connection verification failed: %s\n"
msgstr "Помилка: Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ пройшло перевірки: %s\n"
-#: ../cli/src/connections.c:7535
+#: ../clients/cli/connections.c:7931
msgid "(unknown error)"
msgstr "(невідома помилка)"
-#: ../cli/src/connections.c:7556
+#: ../clients/cli/connections.c:7932
+#, c-format
+msgid "You may try running 'verify fix' to fix errors.\n"
+msgstr "Ви можете Ñпробувати запуÑтити «verify fix» Ð´Ð»Ñ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ð¼Ð¸Ð»Ð¾Ðº.\n"
+
+#: ../clients/cli/connections.c:7954
#, c-format
msgid "Error: connection is not saved. Type 'save' first.\n"
msgstr "Помилка: Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ збережено. Спочатку введіть «save».\n"
-#: ../cli/src/connections.c:7560
+#: ../clients/cli/connections.c:7958
#, c-format
msgid "Error: connection is not valid: %s\n"
msgstr "Помилка: некоректне з’єднаннÑ: %s\n"
-#: ../cli/src/connections.c:7571
+#: ../clients/cli/connections.c:7968
#, c-format
msgid "Error: Cannot activate connection: %s.\n"
msgstr "Помилка: не вдалоÑÑ Ð·Ð°Ð´Ñ–Ñти з’єднаннÑ: %s.\n"
-#: ../cli/src/connections.c:7581
+#: ../clients/cli/connections.c:7978
#, c-format
-msgid "Error: Failed to activate '%s' (%s) connection: (%d) %s\n"
-msgstr "Помилка: не вдалоÑÑ Ð·Ð°Ð´Ñ–Ñти Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s): (%d) %s\n"
+msgid "Error: Failed to activate '%s' (%s) connection: %s\n"
+msgstr "Помилка: не вдалоÑÑ Ð·Ð°Ð´Ñ–Ñти Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s): %s\n"
-#: ../cli/src/connections.c:7587
+#: ../clients/cli/connections.c:7984
#, c-format
msgid "Monitoring connection activation (press any key to continue)\n"
msgstr ""
"СпоÑтерігаємо за активацією Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (натиÑніть будь-Ñку клавішу, щоб "
"продовжити)\n"
-#: ../cli/src/connections.c:7625
+#: ../clients/cli/connections.c:8022
#, c-format
msgid "Error: status-line: %s\n"
msgstr "Помилка: Ñ€Ñдок Ñтану: %s\n"
-#: ../cli/src/connections.c:7633
+#: ../clients/cli/connections.c:8030
#, c-format
msgid "Error: save-confirmation: %s\n"
msgstr "Помилка: save-confirmation: %s\n"
-#: ../cli/src/connections.c:7641
+#: ../clients/cli/connections.c:8038
+#, c-format
+msgid "Error: show-secrets: %s\n"
+msgstr "Помилка: show-secrets: %s\n"
+
+#: ../clients/cli/connections.c:8046
#, c-format
msgid "Error: bad color number: '%s'; use <0-8>\n"
msgstr ""
"Помилковий номер кольору: «%s»; Ñлід викориÑтовувати номери з діапазону "
"<0-8>\n"
-#: ../cli/src/connections.c:7653
+#: ../clients/cli/connections.c:8058
#, c-format
msgid "Current nmcli configuration:\n"
msgstr "Поточне Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ nmcli:\n"
-#: ../cli/src/connections.c:7661
+#: ../clients/cli/connections.c:8068
#, c-format
msgid "Invalid configuration option '%s'; allowed [%s]\n"
msgstr ""
"Ðекоректний параметр налаштуваннÑ, «%s»; можна викориÑтовувати лише такі: "
"[%s]\n"
-#: ../cli/src/connections.c:7904
+#: ../clients/cli/connections.c:8315
#, c-format
msgid "Error: only one of 'id', uuid, or 'path' can be provided."
msgstr "Помилка: можна вказувати лише один з параметрів «id», uuid або «path»."
-#: ../cli/src/connections.c:7916 ../cli/src/connections.c:8106
-#: ../cli/src/connections.c:8113
+#: ../clients/cli/connections.c:8327 ../clients/cli/connections.c:8514
+#: ../clients/cli/connections.c:8521
#, c-format
msgid "Error: Unknown connection '%s'."
msgstr "Помилка: невідоме з’єднаннÑ, «%s»."
-#: ../cli/src/connections.c:7931
+#: ../clients/cli/connections.c:8345
#, c-format
msgid "Warning: editing existing connection '%s'; 'type' argument is ignored\n"
msgstr ""
"ПопередженнÑ: Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¶Ðµ Ñтвореного запиÑу Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»; аргумент "
"«type» проігноровано\n"
-#: ../cli/src/connections.c:7934
+#: ../clients/cli/connections.c:8348
#, c-format
msgid ""
"Warning: editing existing connection '%s'; 'con-name' argument is ignored\n"
@@ -2947,420 +3081,445 @@ msgstr ""
"ПопередженнÑ: Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¶Ðµ Ñтвореного запиÑу Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»; аргумент "
"«con-name» проігноровано\n"
-#: ../cli/src/connections.c:7948
+#: ../clients/cli/connections.c:8362
#, c-format
msgid "Valid connection types: %s\n"
msgstr "Коректні типи з’єднань: %s\n"
-#: ../cli/src/connections.c:7950
+#: ../clients/cli/connections.c:8364
#, c-format
msgid "Error: invalid connection type; %s\n"
msgstr "Помилка: некоректний тип з’єднаннÑ; %s\n"
-#: ../cli/src/connections.c:7989
+#: ../clients/cli/connections.c:8403
#, c-format
msgid "===| nmcli interactive connection editor |==="
msgstr "===| Інтерактивний редактор з’єднань nmcli |==="
-#: ../cli/src/connections.c:7992
+#: ../clients/cli/connections.c:8406
#, c-format
msgid "Editing existing '%s' connection: '%s'"
msgstr "Ð ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð°Ñвного Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»: «%s»"
-#: ../cli/src/connections.c:7994
+#: ../clients/cli/connections.c:8408
#, c-format
msgid "Adding a new '%s' connection"
msgstr "Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»"
-#: ../cli/src/connections.c:7996
+#: ../clients/cli/connections.c:8410
#, c-format
msgid "Type 'help' or '?' for available commands."
msgstr "Введіть «help» або «?», щоб ознайомитиÑÑ Ð·Ñ– ÑпиÑком доÑтупних команд."
-#: ../cli/src/connections.c:7998
+#: ../clients/cli/connections.c:8412
#, c-format
msgid "Type 'describe [<setting>.<prop>]' for detailed property description."
msgstr ""
"Щоб ознайомитиÑÑ Ð· докладним опиÑом влаÑтивоÑÑ‚Ñ–, ÑкориÑтайтеÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¾ÑŽ "
"«describe [<параметр>.<влаÑтивіÑÑ‚ÑŒ>]."
-#: ../cli/src/connections.c:8034
+#: ../clients/cli/connections.c:8450
#, c-format
-msgid "Error: Failed to modify connection '%s': (%d) %s"
-msgstr "Помилка: не вдалоÑÑ Ð²Ð½ÐµÑти зміни до запиÑу Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»: (%d) %s"
+msgid "Error: Failed to modify connection '%s': %s"
+msgstr "Помилка: не вдалоÑÑ Ð²Ð½ÐµÑти зміни до запиÑу Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»: %s"
-#: ../cli/src/connections.c:8040
+#: ../clients/cli/connections.c:8457
#, c-format
msgid "Connection '%s' (%s) successfully modified.\n"
msgstr "Зміни до Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s) уÑпішно внеÑено.\n"
-#: ../cli/src/connections.c:8081
+#: ../clients/cli/connections.c:8489
#, c-format
msgid "Error: No arguments provided."
msgstr "Помилка: не надано аргументів."
-#: ../cli/src/connections.c:8100
+#: ../clients/cli/connections.c:8508
#, c-format
msgid "Error: connection ID is missing."
msgstr "Помилка: не вказано ідентифікатора з’єднаннÑ."
-#: ../cli/src/connections.c:8122 ../cli/src/connections.c:8135
+#: ../clients/cli/connections.c:8530 ../clients/cli/connections.c:8543
#, c-format
msgid "Error: <setting>.<property> argument is missing."
msgstr "Помилка: пропущено аргумент <параметр>.<влаÑтивіÑÑ‚ÑŒ>."
-#: ../cli/src/connections.c:8140
+#: ../clients/cli/connections.c:8548
#, c-format
msgid "Error: value for '%s' is missing."
msgstr "Помилка: не вказано Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»."
-#: ../cli/src/connections.c:8158
+#: ../clients/cli/connections.c:8566
#, c-format
msgid "Error: invalid <setting>.<property> '%s'."
msgstr "Помилка: некоректний аргумент <параметр>.<влаÑтивіÑÑ‚ÑŒ>, «%s»."
-#: ../cli/src/connections.c:8166
+#: ../clients/cli/connections.c:8574
#, c-format
msgid "Error: invalid or not allowed setting '%s': %s."
msgstr "Помилка: некоректний або заборонений параметр, «%s»: %s."
-#: ../cli/src/connections.c:8187
+#: ../clients/cli/connections.c:8595
#, c-format
msgid "Error: invalid property '%s': %s."
msgstr "Помилка: некоректна влаÑтивіÑÑ‚ÑŒ, «%s»: %s."
-#: ../cli/src/connections.c:8198
+#: ../clients/cli/connections.c:8606
#, c-format
msgid "Error: failed to modify %s.%s: %s."
msgstr "Помилка: не вдалоÑÑ Ð²Ð½ÐµÑти зміни до %s.%s: %s."
-#: ../cli/src/connections.c:8216
+#: ../clients/cli/connections.c:8624
#, c-format
msgid "Error: failed to remove a value from %s.%s: %s."
msgstr "Помилка: не вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð· %s.%s: %s."
-#: ../cli/src/connections.c:8252
+#: ../clients/cli/connections.c:8661
#, c-format
msgid "Error: Connection deletion failed: %s"
msgstr "Помилка: не вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ з’єднаннÑ: %s"
-#: ../cli/src/connections.c:8323
+#: ../clients/cli/connections.c:8725
#, c-format
msgid "Error: unknown connection: %s\n"
msgstr "Помилка: невідоме з’єднаннÑ: %s\n"
#. truncate trailing ", "
-#: ../cli/src/connections.c:8359
+#: ../clients/cli/connections.c:8762
#, c-format
msgid "Error: cannot delete unknown connection(s): %s."
msgstr "Помилка: не можна вилучати невідомі з’єднаннÑ: %s."
-#: ../cli/src/connections.c:8430
+#: ../clients/cli/connections.c:8785
#, c-format
-msgid "Could not load file '%s'\n"
-msgstr "Ðе вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ файл «%s»\n"
+msgid "Error: failed to reload connections: %s."
+msgstr "Помилка: не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ з’єднаннÑ: %s."
-#: ../cli/src/connections.c:8615
+#: ../clients/cli/connections.c:8824
#, c-format
-msgid "Error: '%s' is not valid 'connection' command."
-msgstr "Помилка: «%s» не є коректною командою набору «connection»."
+msgid "Error: failed to load connection: %s."
+msgstr "Помилка: не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ з’єднаннÑ: %s."
-#: ../cli/src/connections.c:8684 ../cli/src/network-manager.c:615
+#: ../clients/cli/connections.c:8832
#, c-format
-msgid "Error: Could not get system settings."
-msgstr "Помилка: не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ параметри ÑиÑтеми."
+msgid "Could not load file '%s'\n"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ файл «%s»\n"
-#: ../cli/src/connections.c:8694
+#: ../clients/cli/connections.c:9008
#, c-format
-msgid "Error: Can't obtain connections: settings service is not running."
-msgstr ""
-"Помилка: не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ ÑпиÑок з’єднань: Ñлужба параметрів не працює."
+msgid "Error: '%s' is not valid 'connection' command."
+msgstr "Помилка: «%s» не є коректною командою набору «connection»."
#. define some prompts
-#: ../cli/src/devices.c:70
+#: ../clients/cli/devices.c:38
msgid "Interface: "
msgstr "ІнтерфейÑ: "
#. 3
-#. 16
-#: ../cli/src/devices.c:78 ../cli/src/devices.c:106
+#. 17
+#: ../clients/cli/devices.c:46 ../clients/cli/devices.c:75
msgid "CONNECTION"
msgstr "З’ЄДÐÐÐÐЯ"
#. 4
-#. 17
-#: ../cli/src/devices.c:79 ../cli/src/devices.c:107
+#. 18
+#: ../clients/cli/devices.c:47 ../clients/cli/devices.c:76
msgid "CON-UUID"
msgstr "CON-UUID"
#. 2
-#: ../cli/src/devices.c:92
+#: ../clients/cli/devices.c:60
msgid "VENDOR"
msgstr "ВИРОБÐИК"
#. 3
-#: ../cli/src/devices.c:93
+#: ../clients/cli/devices.c:61
msgid "PRODUCT"
msgstr "ПРОДУКТ"
#. 4
-#: ../cli/src/devices.c:94
+#: ../clients/cli/devices.c:62
msgid "DRIVER"
msgstr "ДРÐЙВЕР"
#. 5
-#: ../cli/src/devices.c:95
+#: ../clients/cli/devices.c:63
msgid "DRIVER-VERSION"
msgstr "ВЕРСІЯ-ДРÐЙВЕРÐ"
#. 6
-#: ../cli/src/devices.c:96
+#: ../clients/cli/devices.c:64
msgid "FIRMWARE-VERSION"
msgstr "ВЕРСІЯ-МІКРОПРОГРÐМИ"
#. 7
-#: ../cli/src/devices.c:97
+#: ../clients/cli/devices.c:65
msgid "HWADDR"
msgstr "ÐП.ÐДРЕСÐ"
#. 8
-#: ../cli/src/devices.c:98 ../tui/nmt-page-ethernet.c:86
-#: ../tui/nmt-page-infiniband.c:96 ../tui/nmt-page-vlan.c:138
-#: ../tui/nmt-page-wifi.c:364
+#: ../clients/cli/devices.c:66 ../clients/tui/nmt-page-ethernet.c:86
+#: ../clients/tui/nmt-page-infiniband.c:97 ../clients/tui/nmt-page-vlan.c:131
+#: ../clients/tui/nmt-page-wifi.c:373
msgid "MTU"
msgstr "MTU"
#. 10
-#: ../cli/src/devices.c:100
+#: ../clients/cli/devices.c:68
msgid "REASON"
msgstr "ПРИЧИÐÐ"
#. 11
-#: ../cli/src/devices.c:101
+#: ../clients/cli/devices.c:69
msgid "UDI"
msgstr "UDI"
#. 12
-#: ../cli/src/devices.c:102
+#: ../clients/cli/devices.c:70
msgid "IP-IFACE"
msgstr "IP-IFACE"
#. 13
-#: ../cli/src/devices.c:103
+#. 2
+#: ../clients/cli/devices.c:71 ../clients/cli/devices.c:99
+msgid "IS-SOFTWARE"
+msgstr "Є-ПРОГРÐÐœÐИМ"
+
+#. 14
+#: ../clients/cli/devices.c:72
msgid "NM-MANAGED"
msgstr "КЕРОВÐÐЕ-NM"
-#. 15
-#: ../cli/src/devices.c:105
+#. 16
+#: ../clients/cli/devices.c:74
msgid "FIRMWARE-MISSING"
msgstr "ПОТРІБÐИЙ-МІКРОКОД"
#. 0
-#: ../cli/src/devices.c:118
+#: ../clients/cli/devices.c:87
msgid "AVAILABLE-CONNECTION-PATHS"
msgstr "ДОСТУПÐІ-ШЛЯХИ-З’ЄДÐÐÐÐЯ"
#. 1
-#: ../cli/src/devices.c:119
+#: ../clients/cli/devices.c:88
msgid "AVAILABLE-CONNECTIONS"
msgstr "ДОСТУПÐІ-З’ЄДÐÐÐÐЯ"
#. 0
-#: ../cli/src/devices.c:128
+#: ../clients/cli/devices.c:97
msgid "CARRIER-DETECT"
msgstr "ВИЗÐ.ÐОСІЯ"
#. 1
-#: ../cli/src/devices.c:129
+#: ../clients/cli/devices.c:98
msgid "SPEED"
msgstr "ШВИДКІСТЬ"
#. 0
-#: ../cli/src/devices.c:138
+#: ../clients/cli/devices.c:108
msgid "CARRIER"
msgstr "ÐОСІЙ"
#. 0
-#: ../cli/src/devices.c:147 ../cli/src/devices.c:568
+#: ../clients/cli/devices.c:117 ../clients/cli/devices.c:548
msgid "WEP"
msgstr "WEP"
#. 1
-#: ../cli/src/devices.c:148
+#: ../clients/cli/devices.c:118
msgid "WPA"
msgstr "WPA"
#. 2
-#: ../cli/src/devices.c:149 ../cli/src/devices.c:576
+#: ../clients/cli/devices.c:119 ../clients/cli/devices.c:556
msgid "WPA2"
msgstr "WPA2"
#. 3
-#: ../cli/src/devices.c:150
+#: ../clients/cli/devices.c:120
msgid "TKIP"
msgstr "TKIP"
#. 4
-#: ../cli/src/devices.c:151
+#: ../clients/cli/devices.c:121
msgid "CCMP"
msgstr "CCMP"
#. 5
#. 2
-#: ../cli/src/devices.c:152 ../cli/src/devices.c:242
+#: ../clients/cli/devices.c:122 ../clients/cli/devices.c:222
msgid "AP"
msgstr "ТД"
#. 6
-#: ../cli/src/devices.c:153
+#: ../clients/cli/devices.c:123
msgid "ADHOC"
msgstr "ADHOC"
#. 0
-#: ../cli/src/devices.c:162
+#: ../clients/cli/devices.c:132
msgid "CTR-FREQ"
msgstr "CTR-FREQ"
#. 1
-#: ../cli/src/devices.c:163
+#: ../clients/cli/devices.c:133
msgid "RSSI"
msgstr "RSSI"
#. 2
-#: ../cli/src/devices.c:164
+#: ../clients/cli/devices.c:134
msgid "CINR"
msgstr "CINR"
#. 3
-#: ../cli/src/devices.c:165
+#: ../clients/cli/devices.c:135
msgid "TX-POW"
msgstr "TX-POW"
#. 4
-#: ../cli/src/devices.c:166
+#: ../clients/cli/devices.c:136
msgid "BSID"
msgstr "BSID"
#. 0
-#: ../cli/src/devices.c:175 ../tui/nmt-page-wifi.c:221
+#: ../clients/cli/devices.c:145 ../clients/tui/nmt-page-wifi.c:227
msgid "SSID"
msgstr "SSID"
#. 1
-#: ../cli/src/devices.c:176
+#: ../clients/cli/devices.c:146
msgid "SSID-HEX"
msgstr "SSID-HEX"
#. 2
-#: ../cli/src/devices.c:177 ../tui/nmt-page-wifi.c:352
+#: ../clients/cli/devices.c:147 ../clients/tui/nmt-page-wifi.c:361
msgid "BSSID"
msgstr "BSSID"
#. 3
-#: ../cli/src/devices.c:178
+#: ../clients/cli/devices.c:148
msgid "MODE"
msgstr "РЕЖИМ"
#. 4
-#: ../cli/src/devices.c:179
+#: ../clients/cli/devices.c:149
msgid "CHAN"
msgstr "КÐÐÐЛ"
#. 5
-#: ../cli/src/devices.c:180
+#: ../clients/cli/devices.c:150
msgid "FREQ"
msgstr "ЧÐСТОТÐ"
#. 6
-#: ../cli/src/devices.c:181
+#: ../clients/cli/devices.c:151
msgid "RATE"
msgstr "ШВИДКІСТЬ"
#. 7
#. 1
-#: ../cli/src/devices.c:182 ../cli/src/devices.c:202
+#: ../clients/cli/devices.c:152 ../clients/cli/devices.c:172
msgid "SIGNAL"
msgstr "СИГÐÐЛ"
#. 8
-#: ../cli/src/devices.c:183
+#: ../clients/cli/devices.c:153
msgid "BARS"
msgstr "ГРÐФ"
#. 9
-#: ../cli/src/devices.c:184
+#: ../clients/cli/devices.c:154
msgid "SECURITY"
msgstr "ЗÐХИСТ"
#. 10
-#: ../cli/src/devices.c:185
+#: ../clients/cli/devices.c:155
msgid "WPA-FLAGS"
msgstr "ПРÐПОРЦІ WPA"
#. 11
-#: ../cli/src/devices.c:186
+#: ../clients/cli/devices.c:156
msgid "RSN-FLAGS"
msgstr "ПРÐПОРЦІ RSN"
#. 14
-#: ../cli/src/devices.c:189
+#: ../clients/cli/devices.c:159
msgid "*"
msgstr "*"
#. 0
#. 5
-#: ../cli/src/devices.c:201 ../cli/src/devices.c:245
+#: ../clients/cli/devices.c:171 ../clients/cli/devices.c:225
msgid "NSP"
msgstr "NSP"
#. 0
-#: ../cli/src/devices.c:216
+#: ../clients/cli/devices.c:186
msgid "SLAVES"
msgstr "SLAVES"
#. 0
-#: ../cli/src/devices.c:225
+#: ../clients/cli/devices.c:195
+msgid "PARENT"
+msgstr "БÐТЬКІВСЬКИЙ"
+
+#. 1
+#: ../clients/cli/devices.c:196
msgid "ID"
msgstr "Ід"
#. 0
-#: ../cli/src/devices.c:240
+#: ../clients/cli/devices.c:205 ../clients/cli/devices.c:220
msgid "CAPABILITIES"
msgstr "МОЖЛИВОСТІ"
#. 1
-#: ../cli/src/devices.c:241
+#: ../clients/cli/devices.c:221
msgid "WIFI-PROPERTIES"
msgstr "ПÐРÐМЕТРИ WIFI"
#. 3
-#: ../cli/src/devices.c:243
+#: ../clients/cli/devices.c:223
msgid "WIRED-PROPERTIES"
msgstr "ПÐРÐМЕТРИ WIRED"
#. 4
-#: ../cli/src/devices.c:244
+#: ../clients/cli/devices.c:224
msgid "WIMAX-PROPERTIES"
msgstr "ПÐРÐМЕТРИ WIMAX"
#. 10
-#: ../cli/src/devices.c:250 ../tui/nmt-page-bond.c:73
+#: ../clients/cli/devices.c:230 ../clients/tui/nmt-page-bond.c:354
msgid "BOND"
msgstr "BOND"
+#. 11
+#: ../clients/cli/devices.c:231 ../clients/tui/nmt-page-team.c:148
+msgid "TEAM"
+msgstr "КОМÐÐДÐ"
+
#. 12
-#: ../cli/src/devices.c:252
+#: ../clients/cli/devices.c:232 ../clients/tui/nmt-page-bridge.c:77
+msgid "BRIDGE"
+msgstr "МІСТОК"
+
+#. 14
+#: ../clients/cli/devices.c:234
+msgid "BLUETOOTH"
+msgstr "BLUETOOTH"
+
+#. 15
+#: ../clients/cli/devices.c:235
msgid "CONNECTIONS"
msgstr "З’ЄДÐÐÐÐЯ"
-#: ../cli/src/devices.c:277
+#: ../clients/cli/devices.c:259
#, c-format
msgid ""
"Usage: nmcli device { COMMAND | help }\n"
"\n"
-"COMMAND := { status | show | connect | disconnect | wifi | wimax }\n"
+"COMMAND := { status | show | connect | disconnect | delete | wifi | wimax }\n"
"\n"
-"COMMAND := { status | show | connect | disconnect | wifi }\n"
+"COMMAND := { status | show | connect | disconnect | delete | wifi }\n"
"\n"
" status\n"
"\n"
@@ -3370,6 +3529,8 @@ msgid ""
"\n"
" disconnect <ifname>\n"
"\n"
+" delete <ifname>\n"
+"\n"
" wifi [list [ifname <ifname>] [bssid <BSSID>]]\n"
"\n"
" wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] "
@@ -3383,9 +3544,10 @@ msgid ""
msgstr ""
"КориÑтуваннÑ: nmcli приÑтрій { КОМÐÐДР| help }\n"
"\n"
-" КОМÐÐДР:= { status | show | connect | disconnect | wifi | wimax }\n"
+" КОМÐÐДР:= { status | show | connect | disconnect | delete | wifi | "
+"wimax }\n"
"\n"
-" КОМÐÐДР:= { status | show | connect | disconnect | wifi }\n"
+" КОМÐÐДР:= { status | show | connect | disconnect | delete | wifi }\n"
"\n"
" status\n"
"\n"
@@ -3395,6 +3557,8 @@ msgstr ""
"\n"
" disconnect <інтерфейÑ> [--nowait] [--timeout <очікуваннÑ>]\n"
"\n"
+" delete <інтерфейÑ>\n"
+"\n"
" wifi [list [iface <інтерфейÑ>] [bssid <BSSID>]]\n"
"\n"
" wifi connect <(B)SSID> [password <пароль>] [wep-key-type key|phrase] "
@@ -3406,7 +3570,7 @@ msgstr ""
" wimax [list [ifname <назва інтерфейÑу>] [nsp <назва>]]\n"
"\n"
-#: ../cli/src/devices.c:301
+#: ../clients/cli/devices.c:283
#, c-format
msgid ""
"Usage: nmcli device status { help }\n"
@@ -3437,7 +3601,7 @@ msgstr ""
"device status».\n"
"\n"
-#: ../cli/src/devices.c:317
+#: ../clients/cli/devices.c:298
#, c-format
msgid ""
"Usage: nmcli device show { ARGUMENTS | help }\n"
@@ -3457,7 +3621,7 @@ msgstr ""
"аргументу приÑтрою.\n"
"\n"
-#: ../cli/src/devices.c:329
+#: ../clients/cli/devices.c:309
#, c-format
msgid ""
"Usage: nmcli device connect { ARGUMENTS | help }\n"
@@ -3481,7 +3645,7 @@ msgstr ""
"з’єднаннÑ.\n"
"\n"
-#: ../cli/src/devices.c:342
+#: ../clients/cli/devices.c:321
#, c-format
msgid ""
"Usage: nmcli device disconnect { ARGUMENTS | help }\n"
@@ -3502,7 +3666,30 @@ msgstr ""
"повторну активацію Ð´Ð»Ñ Ð¿Ð¾Ð´Ð°Ð»ÑŒÑˆÐ¸Ñ… з’єднань без ручного втручаннÑ.\n"
"\n"
-#: ../cli/src/devices.c:355
+#: ../clients/cli/devices.c:333
+#, c-format
+msgid ""
+"Usage: nmcli device delete { ARGUMENTS | help }\n"
+"\n"
+"ARGUMENTS := <ifname>\n"
+"\n"
+"Deletes the software device.\n"
+"The command removes the interface. It only works for software devices\n"
+"(like bonds, bridges, etc.). Hardware devices cannot be deleted by the\n"
+"command.\n"
+"\n"
+msgstr ""
+"Usage: nmcli device delete { ÐРГУМЕÐТИ | help }\n"
+"\n"
+"ÐРГУМЕÐТИ := <інтерфейÑ>\n"
+"\n"
+"Вилучити програмний приÑтрій.\n"
+"Команда вилучає інтерфейÑ. Працює лише Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð½Ð¸Ñ… приÑтроїв\n"
+"(зокрема зв’Ñзків, міÑтків тощо). Ðпаратні приÑтрої не можна вилучати\n"
+"за допомогою цієї команди.\n"
+"\n"
+
+#: ../clients/cli/devices.c:346
#, c-format
msgid ""
"Usage: nmcli device wifi { ARGUMENTS | help }\n"
@@ -3575,7 +3762,7 @@ msgstr ""
"ÑкориÑтатиÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¾ÑŽ «nmcli device wifi list».\n"
"\n"
-#: ../cli/src/devices.c:389
+#: ../clients/cli/devices.c:379
#, c-format
msgid ""
"Usage: nmcli device wimax { ARGUMENTS | help }\n"
@@ -3599,199 +3786,214 @@ msgstr ""
"Ð´Ð»Ñ Ð¿ÐµÐ²Ð½Ð¾Ð³Ð¾ інтерфейÑу або певної Ñлужби Ð½Ð°Ð´Ð°Ð½Ð½Ñ Ð¿Ð¾Ñлуг.\n"
"\n"
-#: ../cli/src/devices.c:483
+#: ../clients/cli/devices.c:468 ../clients/cli/devices.c:659
msgid "(none)"
msgstr "(немає)"
-#: ../cli/src/devices.c:552
+#: ../clients/cli/devices.c:536
#, c-format
msgid "%u MHz"
msgstr "%u МГц"
-#: ../cli/src/devices.c:553
+#: ../clients/cli/devices.c:537
#, c-format
msgid "%u Mbit/s"
msgstr "%u МБ/Ñ"
-#: ../cli/src/devices.c:572
+#: ../clients/cli/devices.c:552
msgid "WPA1"
msgstr "WPA1"
-#: ../cli/src/devices.c:581
+#: ../clients/cli/devices.c:561
msgid "802.1X"
msgstr "802.1X"
-#: ../cli/src/devices.c:597
+#: ../clients/cli/devices.c:577
msgid "Ad-Hoc"
msgstr "Ad-Hoc"
-#: ../cli/src/devices.c:598
+#: ../clients/cli/devices.c:578
msgid "Infra"
msgstr "ІнфраÑтруктура"
-#: ../cli/src/devices.c:630
+#: ../clients/cli/devices.c:579
+msgid "N/A"
+msgstr "н/д"
+
+#: ../clients/cli/devices.c:610
msgid "Home"
msgstr "Домівка"
-#: ../cli/src/devices.c:633
+#: ../clients/cli/devices.c:613
msgid "Partner"
msgstr "Партнер"
-#: ../cli/src/devices.c:636
+#: ../clients/cli/devices.c:616
msgid "Roaming"
msgstr "Роумінг"
-#: ../cli/src/devices.c:730
+#: ../clients/cli/devices.c:774
msgid "Device details"
msgstr "Дані щодо приÑтрою"
-#: ../cli/src/devices.c:742
+#: ../clients/cli/devices.c:786
#, c-format
msgid "Error: 'device show': %s"
msgstr "Помилка: «device show»: %s"
-#: ../cli/src/devices.c:792 ../cli/src/devices.c:795 ../cli/src/devices.c:1342
-#: ../cli/src/devices.c:1484
+#: ../clients/cli/devices.c:837 ../clients/cli/devices.c:840
msgid "(unknown)"
msgstr "(невідомо)"
-#: ../cli/src/devices.c:832
+#: ../clients/cli/devices.c:878
#, c-format
msgid "%u Mb/s"
msgstr "%u Мб/Ñ"
-#: ../cli/src/devices.c:918
+#: ../clients/cli/devices.c:964
msgid "on"
msgstr "увімкн."
-#: ../cli/src/devices.c:918
+#: ../clients/cli/devices.c:964
msgid "off"
msgstr "вимкн."
-#: ../cli/src/devices.c:1193
+#: ../clients/cli/devices.c:1238
#, c-format
msgid "Error: 'device status': %s"
msgstr "Помилка: «device status»: %s"
#. Add headers
-#: ../cli/src/devices.c:1211
+#: ../clients/cli/devices.c:1245
msgid "Status of devices"
msgstr "Стан приÑтрою"
-#: ../cli/src/devices.c:1242
+#: ../clients/cli/devices.c:1276
#, c-format
msgid "Error: invalid extra argument '%s'."
msgstr "Помилка: некоректний додатковий аргумент, «%s»."
-#: ../cli/src/devices.c:1270 ../cli/src/devices.c:1432
-#: ../cli/src/devices.c:1566 ../cli/src/devices.c:1705
-#: ../cli/src/devices.c:2449
+#: ../clients/cli/devices.c:1293 ../clients/cli/devices.c:1591
+#: ../clients/cli/devices.c:1741 ../clients/cli/devices.c:1828
+#: ../clients/cli/devices.c:1961 ../clients/cli/devices.c:2622
#, c-format
msgid "Error: Device '%s' not found."
msgstr "Помилка: не знайдено приÑтрій «%s»."
-#: ../cli/src/devices.c:1325
+#: ../clients/cli/devices.c:1371
#, c-format
msgid "Device '%s' successfully activated with '%s'.\n"
msgstr "ПриÑтрій «%s» уÑпішно активовано з «%s».\n"
-#: ../cli/src/devices.c:1341
+#: ../clients/cli/devices.c:1377
+#, c-format
+msgid "Error: Connection activation failed: (%d) %s.\n"
+msgstr "Помилка: не вдалоÑÑ Ð°ÐºÑ‚Ð¸Ð²ÑƒÐ²Ð°Ñ‚Ð¸ з’єднаннÑ: (%d) %s.\n"
+
+#: ../clients/cli/devices.c:1411
+#, c-format
+msgid "Error: Failed to add/activate new connection: %s"
+msgstr "Помилка: не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ або задіÑти нове з’єднаннÑ: %s"
+
+#: ../clients/cli/devices.c:1420
+#, c-format
+msgid "Error: Failed to add/activate new connection: Unknown error"
+msgstr ""
+"Помилка: не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ або задіÑти нове Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (невідома помилка)"
+
+#: ../clients/cli/devices.c:1431
+#, c-format
+msgid "Connection with UUID '%s' created and activated on device '%s'\n"
+msgstr "Створено Ñ– задіÑно Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· UUID «%s» на приÑтрої «%s»\n"
+
+#: ../clients/cli/devices.c:1495
#, c-format
msgid "Error: Device activation failed: %s"
msgstr "Помилка: не вдалоÑÑ Ð°ÐºÑ‚Ð¸Ð²ÑƒÐ²Ð°Ñ‚Ð¸ приÑтрій: %s"
-#: ../cli/src/devices.c:1349
+#: ../clients/cli/devices.c:1504
#, c-format
msgid "Error: Device activation failed: device was disconnected"
msgstr "Помилка: не вдалоÑÑ Ð°ÐºÑ‚Ð¸Ð²ÑƒÐ²Ð°Ñ‚Ð¸ приÑтрій: приÑтрій було від’єднано"
-#: ../cli/src/devices.c:1362
+#: ../clients/cli/devices.c:1519
#, c-format
msgid "Device '%s' has been connected.\n"
msgstr "ПриÑтрій «%s» було з’єднано.\n"
-#: ../cli/src/devices.c:1391 ../cli/src/devices.c:1400
-#: ../cli/src/devices.c:1525 ../cli/src/devices.c:1534
+#: ../clients/cli/devices.c:1560 ../clients/cli/devices.c:1569
+#: ../clients/cli/devices.c:1710 ../clients/cli/devices.c:1719
+#: ../clients/cli/devices.c:1798 ../clients/cli/devices.c:1806
#, c-format
msgid "Error: No interface specified."
msgstr "Помилка: мало бути вказано інтерфейÑ."
-#: ../cli/src/devices.c:1406 ../cli/src/devices.c:1540
+#: ../clients/cli/devices.c:1575 ../clients/cli/devices.c:1725
+#: ../clients/cli/devices.c:1812
#, c-format
msgid "Error: extra argument not allowed: '%s'."
msgstr "Помилка: некоректний додатковий аргумент, «%s»."
-#: ../cli/src/devices.c:1469
+#: ../clients/cli/devices.c:1639 ../clients/cli/devices.c:1650
#, c-format
-msgid "Success: Device '%s' successfully disconnected."
-msgstr "Виконано: приÑтрій «%s» уÑпішно від’єднано."
+msgid "Device '%s' successfully disconnected.\n"
+msgstr "ПриÑтрій «%s» уÑпішно від’єднано.\n"
-#: ../cli/src/devices.c:1481
+#: ../clients/cli/devices.c:1664
#, c-format
msgid "Error: Device '%s' (%s) disconnecting failed: %s"
msgstr "Помилка: невдала Ñпроба Ð²Ñ–Ð´â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» (%s): %s"
-#: ../cli/src/devices.c:1495
+#: ../clients/cli/devices.c:1679
#, c-format
msgid "Device '%s' has been disconnected.\n"
msgstr "ПриÑтрій «%s» було від’єднано.\n"
-#: ../cli/src/devices.c:1637
+#: ../clients/cli/devices.c:1770
+#, c-format
+msgid "Error: Device '%s' (%s) deletion failed: %s"
+msgstr "Помилка: помилка під Ñ‡Ð°Ñ Ñпроби Ð²Ð¸Ð»ÑƒÑ‡ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¸Ñтрою «%s» (%s): %s"
+
+#: ../clients/cli/devices.c:1834
+#, c-format
+msgid "Error: Device '%s' is a hardware device. It can't be deleted."
+msgstr "Помилка: приÑтрій «%s» Ñ” апаратним. Його не можна вилучити."
+
+#: ../clients/cli/devices.c:1904
msgid "Wi-Fi scan list"
msgstr "СпиÑок ÑÐºÐ°Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Wi-Fi"
-#: ../cli/src/devices.c:1675
+#: ../clients/cli/devices.c:1942
#, c-format
msgid "Error: 'device wifi': %s"
msgstr "Помилка: «device wifi»: %s"
-#: ../cli/src/devices.c:1728 ../cli/src/devices.c:1797
+#: ../clients/cli/devices.c:1984 ../clients/cli/devices.c:2059
#, c-format
msgid "Error: Access point with bssid '%s' not found."
msgstr "Помилка: не знайдено точки доÑтупу з bssid «%s»."
-#: ../cli/src/devices.c:1752 ../cli/src/devices.c:2144
-#: ../cli/src/devices.c:2306
+#: ../clients/cli/devices.c:2008 ../clients/cli/devices.c:2325
+#: ../clients/cli/devices.c:2489
#, c-format
msgid "Error: Device '%s' is not a Wi-Fi device."
msgstr "Помилка: приÑтрій «%s» не Ñ” приÑтроєм Wi-Fi."
-#: ../cli/src/devices.c:1834 ../cli/src/devices.c:1881
-#, c-format
-msgid "Connection with UUID '%s' created and activated on device '%s'\n"
-msgstr "Створено Ñ– задіÑно Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· UUID «%s» на приÑтрої «%s»\n"
-
-#: ../cli/src/devices.c:1838
-#, c-format
-msgid "Error: Connection activation failed: (%d) %s."
-msgstr "Помилка: не вдалоÑÑ Ð°ÐºÑ‚Ð¸Ð²ÑƒÐ²Ð°Ñ‚Ð¸ з’єднаннÑ: (%d) %s."
-
-#: ../cli/src/devices.c:1863
-#, c-format
-msgid "Error: Failed to add/activate new connection: (%d) %s"
-msgstr "Помилка: не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ або задіÑти нове з’єднаннÑ: (%d) %s"
-
-#: ../cli/src/devices.c:1871
-#, c-format
-msgid "Error: Failed to add/activate new connection: Unknown error"
-msgstr ""
-"Помилка: не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ або задіÑти нове Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (невідома помилка)"
-
-#: ../cli/src/devices.c:2026
+#: ../clients/cli/devices.c:2218
msgid "SSID or BSSID: "
msgstr "SSID або BSSID: "
-#: ../cli/src/devices.c:2031
+#: ../clients/cli/devices.c:2223
#, c-format
msgid "Error: SSID or BSSID are missing."
msgstr "Помилка: не виÑтачає SSID або BSSID."
-#: ../cli/src/devices.c:2055
+#: ../clients/cli/devices.c:2247
#, c-format
msgid "Error: bssid argument value '%s' is not a valid BSSID."
msgstr "Помилка: Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° bssid, «%s», не Ñ” коректним BSSID."
-#: ../cli/src/devices.c:2079
+#: ../clients/cli/devices.c:2271
#, c-format
msgid ""
"Error: wep-key-type argument value '%s' is invalid, use 'key' or 'phrase'."
@@ -3799,153 +4001,153 @@ msgstr ""
"Помилка: Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° wep-key-type, «%s», Ñ” некоректним, Ñлід "
"викориÑтовувати «key» або «phrase»."
-#: ../cli/src/devices.c:2099
+#: ../clients/cli/devices.c:2291
#, c-format
msgid "Error: %s: %s."
msgstr "Помилка: %s: %s."
-#: ../cli/src/devices.c:2114
+#: ../clients/cli/devices.c:2306
#, c-format
msgid "Error: BSSID to connect to (%s) differs from bssid argument (%s)."
msgstr ""
"Помилка: BSSID Ð´Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· (%s) відрізнÑєтьÑÑ Ð²Ñ–Ð´ параметра bssid (%s)."
-#: ../cli/src/devices.c:2120
+#: ../clients/cli/devices.c:2312
#, c-format
msgid "Error: Parameter '%s' is neither SSID nor BSSID."
msgstr "Помилка: параметр «%s» не дорівнює ні SSID, ні BSSID."
-#: ../cli/src/devices.c:2146 ../cli/src/devices.c:2308
+#: ../clients/cli/devices.c:2327 ../clients/cli/devices.c:2491
#, c-format
msgid "Error: No Wi-Fi device found."
msgstr "Помилка: не знайдено жодного приÑтрою Wi-Fi."
-#: ../cli/src/devices.c:2164
+#: ../clients/cli/devices.c:2345
#, c-format
msgid "Error: No network with SSID '%s' found."
msgstr "Помилка: не знайдено мережі з SSID «%s»."
-#: ../cli/src/devices.c:2166
+#: ../clients/cli/devices.c:2347
#, c-format
msgid "Error: No access point with BSSID '%s' found."
msgstr "Помилка: не знайдено точки доÑтупу з BSSID «%s»."
-#: ../cli/src/devices.c:2205
+#: ../clients/cli/devices.c:2386
msgid "Password: "
msgstr "Пароль: "
-#: ../cli/src/devices.c:2334
+#: ../clients/cli/devices.c:2518
#, c-format
msgid "Error: 'device wifi' command '%s' is not valid."
msgstr "Помилка: команда «device wifi» «%s» є некоректною."
-#: ../cli/src/devices.c:2381
+#: ../clients/cli/devices.c:2565
msgid "WiMAX NSP list"
msgstr "СпиÑок WiMAX NSP"
-#: ../cli/src/devices.c:2418
+#: ../clients/cli/devices.c:2602
#, c-format
msgid "Error: 'device wimax': %s"
msgstr "Помилка: «device wimax»: %s"
-#: ../cli/src/devices.c:2472
+#: ../clients/cli/devices.c:2645
#, c-format
msgid "Error: NSP with name '%s' not found."
msgstr "Помилка: не знайдено NSP з назвою «%s»."
-#: ../cli/src/devices.c:2485
+#: ../clients/cli/devices.c:2658
#, c-format
msgid "Error: Device '%s' is not a WiMAX device."
msgstr "Помилка: приÑтрій «%s» не Ñ” приÑтроєм WiMAX."
-#: ../cli/src/devices.c:2523
+#: ../clients/cli/devices.c:2702
#, c-format
msgid "Error: Access point with nsp '%s' not found."
msgstr "Помилка: не знайдено точки доÑтупу з nsp «%s»."
-#: ../cli/src/devices.c:2555
+#: ../clients/cli/devices.c:2739
#, c-format
msgid "Error: 'device wimax' command '%s' is not valid."
msgstr "Помилка: команда «device wimax» «%s» є некоректною."
-#: ../cli/src/devices.c:2705
+#: ../clients/cli/devices.c:2912
#, c-format
msgid "Error: 'dev' command '%s' is not valid."
msgstr "Помилка: команда «dev» «%s» є некоректною."
-#: ../cli/src/network-manager.c:37
+#: ../clients/cli/general.c:35
msgid "RUNNING"
msgstr "ВИКОÐУЄТЬСЯ"
#. 0
-#: ../cli/src/network-manager.c:38
+#: ../clients/cli/general.c:36
msgid "VERSION"
msgstr "ВЕРСІЯ"
#. 2
-#: ../cli/src/network-manager.c:40
+#: ../clients/cli/general.c:38
msgid "STARTUP"
msgstr "ЗÐПУСК"
#. 3
-#: ../cli/src/network-manager.c:41
+#: ../clients/cli/general.c:39
msgid "CONNECTIVITY"
msgstr "МОЖЛИВІСТЬ З’ЄДÐÐÐÐЯ"
#. 4
-#: ../cli/src/network-manager.c:42
+#: ../clients/cli/general.c:40
msgid "NETWORKING"
msgstr "РОБОТРУ МЕРЕЖІ"
#. 5
-#: ../cli/src/network-manager.c:43
+#: ../clients/cli/general.c:41
msgid "WIFI-HW"
msgstr "WIFI-HW"
#. 6
-#: ../cli/src/network-manager.c:44
+#: ../clients/cli/general.c:42
msgid "WIFI"
msgstr "WIFI"
#. 7
-#: ../cli/src/network-manager.c:45
+#: ../clients/cli/general.c:43
msgid "WWAN-HW"
msgstr "WWAN-HW"
#. 8
-#: ../cli/src/network-manager.c:46
+#: ../clients/cli/general.c:44
msgid "WWAN"
msgstr "WWAN"
#. 9
-#: ../cli/src/network-manager.c:47
+#: ../clients/cli/general.c:45
msgid "WIMAX-HW"
msgstr "WIMAX-HW"
#. 10
-#: ../cli/src/network-manager.c:48
+#: ../clients/cli/general.c:46
msgid "WIMAX"
msgstr "WIMAX"
-#: ../cli/src/network-manager.c:70
+#: ../clients/cli/general.c:68
msgid "PERMISSION"
msgstr "ДОСТУП"
#. 0
-#: ../cli/src/network-manager.c:71
+#: ../clients/cli/general.c:69
msgid "VALUE"
msgstr "ЗÐÐЧЕÐÐЯ"
-#: ../cli/src/network-manager.c:79
+#: ../clients/cli/general.c:77
msgid "LEVEL"
msgstr "РІВЕÐЬ"
#. 0
-#: ../cli/src/network-manager.c:80
+#: ../clients/cli/general.c:78
msgid "DOMAINS"
msgstr "ДОМЕÐИ"
-#: ../cli/src/network-manager.c:95
+#: ../clients/cli/general.c:92
#, c-format
msgid ""
"Usage: nmcli general { COMMAND | help }\n"
@@ -3975,7 +4177,7 @@ msgstr ""
"журналу>]\n"
"\n"
-#: ../cli/src/network-manager.c:107
+#: ../clients/cli/general.c:103
#, c-format
msgid ""
"Usage: nmcli general status { help }\n"
@@ -3992,7 +4194,7 @@ msgstr ""
"status»\n"
"\n"
-#: ../cli/src/network-manager.c:117
+#: ../clients/cli/general.c:112
#, c-format
msgid ""
"Usage: nmcli general hostname { ARGUMENTS | help }\n"
@@ -4017,7 +4219,7 @@ msgstr ""
"назвою вузла ÑиÑтеми.\n"
"\n"
-#: ../cli/src/network-manager.c:130
+#: ../clients/cli/general.c:124
#, c-format
msgid ""
"Usage: nmcli general permissions { help }\n"
@@ -4031,7 +4233,7 @@ msgstr ""
"пройти розпізнаваннÑ.\n"
"\n"
-#: ../cli/src/network-manager.c:139
+#: ../clients/cli/general.c:132
#, c-format
msgid ""
"Usage: nmcli general logging { ARGUMENTS | help }\n"
@@ -4058,7 +4260,7 @@ msgstr ""
"Ð¶ÑƒÑ€Ð½Ð°Ð»ÑŽÐ²Ð°Ð½Ð½Ñ Ð½Ð°Ð²ÐµÐ´ÐµÐ½Ð¾ на Ñторінці підручника (man).\n"
"\n"
-#: ../cli/src/network-manager.c:153
+#: ../clients/cli/general.c:145
#, c-format
msgid ""
"Usage: nmcli networking { COMMAND | help }\n"
@@ -4083,7 +4285,7 @@ msgstr ""
" connectivity [перевірити]\n"
"\n"
-#: ../cli/src/network-manager.c:164
+#: ../clients/cli/general.c:155
#, c-format
msgid ""
"Usage: nmcli networking on { help }\n"
@@ -4096,7 +4298,7 @@ msgstr ""
"Увімкнути роботу у мережі\n"
"\n"
-#: ../cli/src/network-manager.c:173
+#: ../clients/cli/general.c:163
#, c-format
msgid ""
"Usage: nmcli networking off { help }\n"
@@ -4109,7 +4311,7 @@ msgstr ""
"Вимкнути роботу у мережі.\n"
"\n"
-#: ../cli/src/network-manager.c:182
+#: ../clients/cli/general.c:171
#, c-format
msgid ""
"Usage: nmcli networking connectivity { ARGUMENTS | help }\n"
@@ -4130,7 +4332,7 @@ msgstr ""
"виконати повторну перевірку можливоÑÑ‚Ñ– з’єднаннÑ.\n"
"\n"
-#: ../cli/src/network-manager.c:195
+#: ../clients/cli/general.c:183
#, c-format
msgid ""
"Usage: nmcli radio { COMMAND | help }\n"
@@ -4155,7 +4357,7 @@ msgstr ""
" all | wifi | wwan [ on | off ]\n"
"\n"
-#: ../cli/src/network-manager.c:210
+#: ../clients/cli/general.c:197
#, c-format
msgid ""
"Usage: nmcli radio all { ARGUMENTS | help }\n"
@@ -4172,7 +4374,7 @@ msgstr ""
"Отримати Ñтан уÑÑ–Ñ… перемикачів або перемкнути Ñ—Ñ… (увімкнути чи вимкнути).\n"
"\n"
-#: ../cli/src/network-manager.c:221
+#: ../clients/cli/general.c:207
#, c-format
msgid ""
"Usage: nmcli radio wifi { ARGUMENTS | help }\n"
@@ -4189,7 +4391,7 @@ msgstr ""
"Отримати Ñтан перемикача Wi-Fi або перемкнути його (увімкнути чи вимкнути).\n"
"\n"
-#: ../cli/src/network-manager.c:232
+#: ../clients/cli/general.c:217
#, c-format
msgid ""
"Usage: nmcli radio wwan { ARGUMENTS | help }\n"
@@ -4207,7 +4409,7 @@ msgstr ""
"(увімкнути чи вимкнути).\n"
"\n"
-#: ../cli/src/network-manager.c:244
+#: ../clients/cli/general.c:228
#, c-format
msgid ""
"Usage: nmcli radio wimax { ARGUMENTS | help }\n"
@@ -4224,174 +4426,165 @@ msgstr ""
"Отримати Ñтан перемикача WiMAX або перемкнути його (увімкнути чи вимкнути).\n"
"\n"
-#: ../cli/src/network-manager.c:264
+#: ../clients/cli/general.c:248
msgid "asleep"
msgstr "приÑпаний"
-#: ../cli/src/network-manager.c:266
+#: ../clients/cli/general.c:250
msgid "connecting"
msgstr "з’єднуєтьÑÑ"
-#: ../cli/src/network-manager.c:268
+#: ../clients/cli/general.c:252
msgid "connected (local only)"
msgstr "з’єднуєтьÑÑ (локально)"
-#: ../cli/src/network-manager.c:270
+#: ../clients/cli/general.c:254
msgid "connected (site only)"
msgstr "з’єднано (на вузлі)"
-#: ../cli/src/network-manager.c:274
+#: ../clients/cli/general.c:258
msgid "disconnecting"
msgstr "роз’єднуєтьÑÑ"
-#: ../cli/src/network-manager.c:290
+#: ../clients/cli/general.c:274
msgid "portal"
msgstr "портал"
-#: ../cli/src/network-manager.c:292
+#: ../clients/cli/general.c:276
msgid "limited"
msgstr "обмежена"
-#: ../cli/src/network-manager.c:294
+#: ../clients/cli/general.c:278
msgid "full"
msgstr "повна"
-#: ../cli/src/network-manager.c:332
+#: ../clients/cli/general.c:316
#, c-format
msgid "Error: only these fields are allowed: %s"
msgstr "Помилка: можна викориÑтовувати лише такі полÑ: %s"
-#: ../cli/src/network-manager.c:348 ../cli/src/network-manager.c:349
-#: ../cli/src/network-manager.c:350 ../cli/src/network-manager.c:351
-#: ../cli/src/network-manager.c:352 ../cli/src/network-manager.c:354
-#: ../cli/src/network-manager.c:355
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "enabled"
msgstr "увімкнено"
-#: ../cli/src/network-manager.c:348 ../cli/src/network-manager.c:349
-#: ../cli/src/network-manager.c:350 ../cli/src/network-manager.c:351
-#: ../cli/src/network-manager.c:352 ../cli/src/network-manager.c:354
-#: ../cli/src/network-manager.c:355
+#: ../clients/cli/general.c:336 ../clients/cli/general.c:337
+#: ../clients/cli/general.c:338 ../clients/cli/general.c:339
+#: ../clients/cli/general.c:340 ../clients/cli/general.c:342
+#: ../clients/cli/general.c:343
msgid "disabled"
msgstr "вимкнено"
-#: ../cli/src/network-manager.c:367
+#: ../clients/cli/general.c:346
msgid "NetworkManager status"
msgstr "Стан NetworkManager"
-#: ../cli/src/network-manager.c:372
+#: ../clients/cli/general.c:351
msgid "running"
msgstr "виконуєтьÑÑ"
-#: ../cli/src/network-manager.c:372
-msgid "not running"
-msgstr "не виконуєтьÑÑ"
-
-#: ../cli/src/network-manager.c:375
+#: ../clients/cli/general.c:354
msgid "starting"
msgstr "запуÑк"
-#: ../cli/src/network-manager.c:375
+#: ../clients/cli/general.c:354
msgid "started"
msgstr "запущено"
-#: ../cli/src/network-manager.c:446
+#: ../clients/cli/general.c:425
msgid "auth"
msgstr "розпізн"
-#: ../cli/src/network-manager.c:475
+#: ../clients/cli/general.c:454
#, c-format
msgid "Error: 'general permissions': %s"
msgstr "Помилка: «general permissions»: %s"
-#: ../cli/src/network-manager.c:489
+#: ../clients/cli/general.c:468
msgid "NetworkManager permissions"
msgstr "Права доÑтупу NetworkManager"
-#: ../cli/src/network-manager.c:530
+#: ../clients/cli/general.c:509
#, c-format
msgid "Error: 'general logging': %s"
msgstr "Помилка: «general logging»: %s"
-#: ../cli/src/network-manager.c:545
+#: ../clients/cli/general.c:524
msgid "NetworkManager logging"
msgstr "Ð’ÐµÐ´ÐµÐ½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ NetworkManager"
-#: ../cli/src/network-manager.c:565
-#, c-format
-msgid "Error: failed to set hostname: (%d) %s"
-msgstr "Помилка: не вдалоÑÑ Ð²Ñтановити назву вузла: (%d) %s"
-
-#: ../cli/src/network-manager.c:682
+#: ../clients/cli/general.c:546
#, c-format
-msgid "Error: access denied to set logging; %s"
-msgstr "Помилка: заборонено доÑтуп до ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ð¾Ð¼; %s"
+msgid "Error: failed to set hostname: %s"
+msgstr "Помилка: не вдалоÑÑ Ð²Ñтановити назву вузла: %s"
-#: ../cli/src/network-manager.c:684
+#: ../clients/cli/general.c:659
#, c-format
-msgid "Error: %s"
-msgstr "Помилка: %s"
+msgid "Error: failed to set logging: %s"
+msgstr "Помилка: не вдалоÑÑ Ð²Ñтановити параметри Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ: %s"
-#: ../cli/src/network-manager.c:692
+#: ../clients/cli/general.c:668
#, c-format
msgid "Error: 'general' command '%s' is not valid."
msgstr "Помилка: команда «general» «%s» є некоректною."
-#: ../cli/src/network-manager.c:710
+#: ../clients/cli/general.c:686
#, c-format
msgid "Error: '--fields' value '%s' is not valid here (allowed field: %s)"
msgstr ""
"Помилка: Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«--fields» «%s» не можна викориÑтовувати тут (дозволене "
"поле: %s)"
-#: ../cli/src/network-manager.c:735
+#: ../clients/cli/general.c:711
#, c-format
msgid "Error: invalid '%s' argument: '%s' (use on/off)."
msgstr "Помилка: некоректний аргумент «%s»: «%s» (мало бути on/off)."
-#: ../cli/src/network-manager.c:746
+#: ../clients/cli/general.c:722
msgid "Connectivity"
msgstr "МожливіÑÑ‚ÑŒ з’єднаннÑ"
-#: ../cli/src/network-manager.c:758
+#: ../clients/cli/general.c:737
msgid "Networking"
msgstr "Робота у мережі"
-#: ../cli/src/network-manager.c:783
+#: ../clients/cli/general.c:762
#, c-format
msgid "Error: 'networking connectivity' command '%s' is not valid."
msgstr "Помилка: команда «networking connectivity» «%s» є некоректною."
-#: ../cli/src/network-manager.c:799
+#: ../clients/cli/general.c:778
#, c-format
msgid "Error: 'networking' command '%s' is not valid."
msgstr "Помилка: команда «networking» «%s» є некоректною."
-#: ../cli/src/network-manager.c:825 ../cli/src/network-manager.c:845
+#: ../clients/cli/general.c:807 ../clients/cli/general.c:827
msgid "Radio switches"
msgstr "Радіоперемикачі"
#. no argument, show current WiFi state
-#: ../cli/src/network-manager.c:863
+#: ../clients/cli/general.c:845
msgid "Wi-Fi radio switch"
msgstr "Перемикач Wi-Fi"
#. no argument, show current WWAN (mobile broadband) state
-#: ../cli/src/network-manager.c:879
+#: ../clients/cli/general.c:861
msgid "WWAN radio switch"
msgstr "Перемикач WWAN"
#. no argument, show current WiMAX state
-#: ../cli/src/network-manager.c:896
+#: ../clients/cli/general.c:878
msgid "WiMAX radio switch"
msgstr "Перемикач WiMAX"
-#: ../cli/src/network-manager.c:908
+#: ../clients/cli/general.c:890
#, c-format
msgid "Error: 'radio' command '%s' is not valid."
msgstr "Помилка: команда «radio» «%s» є некоректною."
-#: ../cli/src/nmcli.c:85
+#: ../clients/cli/nmcli.c:86
#, c-format
msgid ""
"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
@@ -4417,6 +4610,7 @@ msgid ""
" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+" a[gent] NetworkManager secret agent or polkit agent\n"
"\n"
msgstr ""
"КориÑтуваннÑ: %s [ПÐРÐМЕТРИ] ОБ’ЄКТ { КОМÐÐДР| help }\n"
@@ -4443,70 +4637,69 @@ msgstr ""
" r[adio] перемикачі радіозв’Ñзку NetworkManager\n"
" c[onnection] Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ NetworkManager\n"
" d[evice] приÑтрої, Ñкими керує NetworkManager\n"
+" a[gent] агент паролів NetworkManager або агент polkit\n"
"\n"
-#: ../cli/src/nmcli.c:139
+#: ../clients/cli/nmcli.c:142
#, c-format
msgid "Error: Object '%s' is unknown, try 'nmcli help'."
msgstr "Помилка: невідомий об’єкт «%s», Ñпробуйте «nmcli help»."
-#: ../cli/src/nmcli.c:169
+#: ../clients/cli/nmcli.c:172
#, c-format
msgid "Error: Option '--terse' is specified the second time."
msgstr "Помилка: параметр «--terse» вказано двічі."
-#: ../cli/src/nmcli.c:174
+#: ../clients/cli/nmcli.c:177
#, c-format
msgid "Error: Option '--terse' is mutually exclusive with '--pretty'."
msgstr ""
"Помилка: параметр «--terse» Ñ– «--pretty» не можна викориÑтовувати одночаÑно."
-#: ../cli/src/nmcli.c:182
+#: ../clients/cli/nmcli.c:185
#, c-format
msgid "Error: Option '--pretty' is specified the second time."
msgstr "Помилка: параметр «--pretty» вказано двічі."
-#: ../cli/src/nmcli.c:187
+#: ../clients/cli/nmcli.c:190
#, c-format
msgid "Error: Option '--pretty' is mutually exclusive with '--terse'."
msgstr ""
"Помилка: параметр «--pretty» Ñ– «--terse» не можна викориÑтовувати одночаÑно"
-#: ../cli/src/nmcli.c:197 ../cli/src/nmcli.c:213 ../cli/src/nmcli.c:242
+#: ../clients/cli/nmcli.c:200 ../clients/cli/nmcli.c:216
+#: ../clients/cli/nmcli.c:245
#, c-format
msgid "Error: missing argument for '%s' option."
msgstr "Помилка: не вказано аргумент параметра «%s»."
-#: ../cli/src/nmcli.c:206 ../cli/src/nmcli.c:222
+#: ../clients/cli/nmcli.c:209 ../clients/cli/nmcli.c:225
#, c-format
msgid "Error: '%s' is not valid argument for '%s' option."
msgstr "Помилка: «%s» не є коректним аргументом «%s»."
-#: ../cli/src/nmcli.c:229
+#: ../clients/cli/nmcli.c:232
#, c-format
msgid "Error: fields for '%s' options are missing."
msgstr "Помилка: не вказано полів Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ñ–Ð² «%s»."
-#: ../cli/src/nmcli.c:247
+#: ../clients/cli/nmcli.c:250
#, c-format
msgid "Error: '%s' is not a valid timeout for '%s' option."
msgstr "Помилка: «%s» не Ñ” коректним чаÑом Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s»."
-#: ../cli/src/nmcli.c:254
+#: ../clients/cli/nmcli.c:257
#, c-format
msgid "nmcli tool, version %s\n"
msgstr "інÑтрумент nmcli, верÑÑ–Ñ %s\n"
-#: ../cli/src/nmcli.c:260
+#: ../clients/cli/nmcli.c:263
#, c-format
msgid "Error: Option '%s' is unknown, try 'nmcli -help'."
msgstr "Помилка: невідомий параметр «%s», Ñпробуйте «nmcli -help»."
-#: ../cli/src/nmcli.c:340 ../cli/src/nmcli.c:349
+#: ../clients/cli/nmcli.c:346 ../clients/cli/nmcli.c:356
#, c-format
-#| msgid ""
-#| "\n"
-#| "Error: nmcli terminated by signal %d."
msgid ""
"\n"
"Error: nmcli terminated by signal %s (%d)\n"
@@ -4514,189 +4707,147 @@ msgstr ""
"\n"
"Помилка: роботу nmcli перервано Ñигналом %s (%d).\n"
-#: ../cli/src/nmcli.c:380
+#: ../clients/cli/nmcli.c:387
#, c-format
-#| msgid "Failed to set signal mask: %d"
msgid "Failed to set signal mask: %d\n"
msgstr "Ðе вдалоÑÑ Ð²Ñтановити маÑку Ñигналу: %d\n"
-#: ../cli/src/nmcli.c:387
+#: ../clients/cli/nmcli.c:394
#, c-format
-#| msgid "Failed to create signal handling thread: %d"
msgid "Failed to create signal handling thread: %d\n"
msgstr "Ðе вдалоÑÑ Ñтворити потік обробки Ñигналів: %d\n"
-#: ../cli/src/nmcli.c:400 ../test/nm-online.c:196
+#: ../clients/cli/nmcli.c:491 ../clients/nm-online.c:197
#, c-format
-msgid "Error: Could not create NMClient object."
-msgstr "Помилка: не вдалоÑÑ Ñтворити об’єкт NMClient."
+msgid "Error: Could not create NMClient object: %s."
+msgstr "Помилка: не вдалоÑÑ Ñтворити об’єкт NMClient: %s."
-#: ../cli/src/nmcli.c:416
+#: ../clients/cli/nmcli.c:508
msgid "Success"
msgstr "Виконано"
-#: ../cli/src/settings.c:669
+#: ../clients/cli/polkit-agent.c:82
+#, c-format
+msgid "Authentication message: %s\n"
+msgstr "ÐŸÐ¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ розпізнаваннÑ: %s\n"
+
+#: ../clients/cli/polkit-agent.c:88
+#, c-format
+msgid "Authentication error: %s\n"
+msgstr "Помилка розпізнаваннÑ: %s\n"
+
+#: ../clients/cli/polkit-agent.c:134
+#, c-format
+msgid "Warning: polkit agent initialization failed: %s\n"
+msgstr "ПопередженнÑ: не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ агент polkit: %s\n"
+
+#: ../clients/cli/settings.c:672
#, c-format
msgid "%d (key)"
msgstr "%d (ключ)"
-#: ../cli/src/settings.c:671
+#: ../clients/cli/settings.c:674
#, c-format
msgid "%d (passphrase)"
msgstr "%d (пароль)"
-#: ../cli/src/settings.c:674 ../cli/src/settings.c:802
+#: ../clients/cli/settings.c:677 ../clients/cli/settings.c:758
#, c-format
msgid "%d (unknown)"
msgstr "%d (невідомо)"
-#: ../cli/src/settings.c:700
-msgid "0 (unknown)"
-msgstr "0 (невідомо)"
-
-#: ../cli/src/settings.c:706
-msgid "any, "
-msgstr "будь-Ñкий, "
-
-#: ../cli/src/settings.c:708
-msgid "900 MHz, "
-msgstr "900 МГц, "
-
-#: ../cli/src/settings.c:710
-msgid "1800 MHz, "
-msgstr "1800 МГц, "
-
-#: ../cli/src/settings.c:712
-msgid "1900 MHz, "
-msgstr "1900 МГц, "
-
-#: ../cli/src/settings.c:714
-msgid "850 MHz, "
-msgstr "800 МГц, "
-
-#: ../cli/src/settings.c:716
-msgid "WCDMA 3GPP UMTS 2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 2100 МГц, "
-
-#: ../cli/src/settings.c:718
-msgid "WCDMA 3GPP UMTS 1800 MHz, "
-msgstr "WCDMA 3GPP UMTS 1800 МГц, "
-
-#: ../cli/src/settings.c:720
-msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700/2100 МГц, "
-
-#: ../cli/src/settings.c:722
-msgid "WCDMA 3GPP UMTS 800 MHz, "
-msgstr "WCDMA 3GPP UMTS 800 МГц, "
-
-#: ../cli/src/settings.c:724
-msgid "WCDMA 3GPP UMTS 850 MHz, "
-msgstr "WCDMA 3GPP UMTS 850 МГц, "
-
-#: ../cli/src/settings.c:726
-msgid "WCDMA 3GPP UMTS 900 MHz, "
-msgstr "WCDMA 3GPP UMTS 900 МГц, "
-
-#: ../cli/src/settings.c:728
-msgid "WCDMA 3GPP UMTS 1700 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700 МГц, "
-
-#: ../cli/src/settings.c:730
-msgid "WCDMA 3GPP UMTS 1900 MHz, "
-msgstr "WCDMA 3GPP UMTS 1900 МГц, "
-
-#: ../cli/src/settings.c:732
-msgid "WCDMA 3GPP UMTS 2600 MHz, "
-msgstr "WCDMA 3GPP UMTS 2600 МГц, "
-
-#: ../cli/src/settings.c:750
+#: ../clients/cli/settings.c:706
msgid "0 (NONE)"
msgstr "0 (ÐЕМÐЄ)"
-#: ../cli/src/settings.c:756
+#: ../clients/cli/settings.c:712
msgid "REORDER_HEADERS, "
msgstr "ПЕРЕВПОРЯДКОВУВÐÐÐЯ_ЗÐГОЛОВКІВ, "
-#: ../cli/src/settings.c:758
+#: ../clients/cli/settings.c:714
msgid "GVRP, "
msgstr "GVRP, "
-#: ../cli/src/settings.c:760
+#: ../clients/cli/settings.c:716
msgid "LOOSE_BINDING, "
msgstr "ШИРОКЕ_ПРИВ’ЯЗУВÐÐÐЯ, "
-#: ../cli/src/settings.c:796
+#: ../clients/cli/settings.c:752
#, c-format
msgid "%d (disabled)"
msgstr "%d (вимкнено)"
-#: ../cli/src/settings.c:798
+#: ../clients/cli/settings.c:754
#, c-format
msgid "%d (enabled, prefer public IP)"
msgstr "%d (увімкнено, перевага відкритого IP)"
-#: ../cli/src/settings.c:800
+#: ../clients/cli/settings.c:756
#, c-format
msgid "%d (enabled, prefer temporary IP)"
msgstr "%d (увімкнено, перевага тимчаÑового IP)"
-#: ../cli/src/settings.c:812
+#: ../clients/cli/settings.c:768
msgid "0 (none)"
msgstr "0 (немає)"
-#: ../cli/src/settings.c:818
+#: ../clients/cli/settings.c:774
msgid "agent-owned, "
msgstr ", влаÑником Ñ” агент, "
-#: ../cli/src/settings.c:820
+#: ../clients/cli/settings.c:776
msgid "not saved, "
msgstr "не збережено, "
-#: ../cli/src/settings.c:822
+#: ../clients/cli/settings.c:778
msgid "not required, "
msgstr "не Ñ” обов’Ñзковим, "
-#: ../cli/src/settings.c:1128
+#: ../clients/cli/settings.c:1061
msgid "0 (disabled)"
msgstr "0 (вимкнено)"
-#: ../cli/src/settings.c:1134
+#: ../clients/cli/settings.c:1067
msgid "enabled, "
msgstr "увімкнено, "
-#: ../cli/src/settings.c:1136
+#: ../clients/cli/settings.c:1069
msgid "advertise, "
msgstr "оголошеннÑ, "
-#: ../cli/src/settings.c:1138
+#: ../clients/cli/settings.c:1071
msgid "willing, "
msgstr "наданнÑ, "
-#: ../cli/src/settings.c:1166
+#: ../clients/cli/settings.c:1099
msgid "-1 (unset)"
msgstr "-1 (не вÑтановлено)"
-#: ../cli/src/settings.c:1274 ../cli/src/settings.c:1457
-#: ../cli/src/settings.c:1497
+#: ../clients/cli/settings.c:1196 ../clients/cli/settings.c:1483
+#: ../clients/cli/settings.c:1525
msgid "auto"
msgstr "авто"
-#: ../cli/src/settings.c:1287
+#: ../clients/cli/settings.c:1209
msgid "default"
msgstr "типовий"
-#: ../cli/src/settings.c:1625
+#: ../clients/cli/settings.c:1541
+#, c-format
+msgid "yes (%u)"
+msgstr "так (%u)"
+
+#: ../clients/cli/settings.c:1667
#, c-format
msgid "Do you also want to set '%s' to '%s'? [yes]: "
msgstr "Хочете також вÑтановити Ð´Ð»Ñ Â«%s» Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»? [типово yes або так]: "
-#: ../cli/src/settings.c:1627
+#: ../clients/cli/settings.c:1669
#, c-format
msgid "Do you also want to clear '%s'? [yes]: "
msgstr "Хочете також Ñпорожнити «%s»? [типово yes — так]: "
-#: ../cli/src/settings.c:1788
+#: ../clients/cli/settings.c:1830
#, c-format
msgid ""
"Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"
@@ -4704,97 +4855,125 @@ msgstr ""
"ПопередженнÑ: %s.%s вÑтановлено у Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s», але це може бути "
"проігноровано у режимі інфраÑтруктури\n"
-#: ../cli/src/settings.c:1870 ../cli/src/settings.c:2150
-#: ../cli/src/settings.c:4232
+#: ../clients/cli/settings.c:1849
+#, c-format
+msgid "Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"
+msgstr ""
+"ПопередженнÑ: вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ %s.%s потребує Ð²Ð¸Ð»ÑƒÑ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ñ–Ð² ipv4 та ipv6\n"
+
+#: ../clients/cli/settings.c:1851
+msgid "Do you want to remove them? [yes] "
+msgstr "Хочете вилучити їх? [yes — так] "
+
+#: ../clients/cli/settings.c:1947 ../clients/cli/settings.c:2269
+#: ../clients/cli/settings.c:4402
#, c-format
msgid "'%s' is not valid"
msgstr "«%s» не є коректним"
-#: ../cli/src/settings.c:1893
+#: ../clients/cli/settings.c:1970
#, c-format
msgid "'%d' is not valid; use <%d-%d>"
msgstr "«%d» Ñ” некоректним значеннÑм; Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” належати діапазону <%d-%d>"
-#: ../cli/src/settings.c:1915
+#: ../clients/cli/settings.c:1992
+#, c-format
+msgid "'%lld' is not valid; use <%lld-%lld>"
+msgstr ""
+"«%lld» Ñ” некоректним значеннÑм; ÑкориÑтайтеÑÑ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñм у діапазоні <%lld-"
+"%lld>"
+
+#: ../clients/cli/settings.c:2014
#, c-format
-msgid "'%u' is not valid; use <%d-%d>"
-msgstr "«%u» не Ñ” коректним значеннÑм; Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” належати діапазону <%d-%d>"
+msgid "'%u' is not valid; use <%u-%u>"
+msgstr "«%u» Ñ” некоректним; ÑкориÑтайтеÑÑ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñм у діапазоні <%u-%u>"
-#: ../cli/src/settings.c:1981
+#: ../clients/cli/settings.c:2080
#, c-format
msgid "'%s' is not valid; use <option>=<value>"
msgstr ""
"Ð—Ð°Ð¿Ð¸Ñ Â«%s» Ñ” некоректним; Ñлід викориÑтовувати формат <параметр>=<значеннÑ>"
-#: ../cli/src/settings.c:2015
+#: ../clients/cli/settings.c:2114
#, c-format
msgid "index '%s' is not valid"
msgstr "Ñ–Ð½Ð´ÐµÐºÑ Â«%s» Ñ” некоректним"
-#: ../cli/src/settings.c:2020 ../cli/src/settings.c:2045
+#: ../clients/cli/settings.c:2119 ../clients/cli/settings.c:2144
msgid "no item to remove"
msgstr "немає пунктів Ð´Ð»Ñ Ð²Ð¸Ð»ÑƒÑ‡ÐµÐ½Ð½Ñ"
-#: ../cli/src/settings.c:2024 ../cli/src/settings.c:2049
+#: ../clients/cli/settings.c:2123 ../clients/cli/settings.c:2148
#, c-format
msgid "index '%d' is not in range <0-%d>"
msgstr "Ñ–Ð½Ð´ÐµÐºÑ Â«%d» лежить поза діапазоном <0-%d>"
-#: ../cli/src/settings.c:2064
+#: ../clients/cli/settings.c:2163
#, c-format
msgid "invalid option '%s'"
msgstr "некоректний параметр, «%s»"
-#: ../cli/src/settings.c:2066
+#: ../clients/cli/settings.c:2165
msgid "missing option"
msgstr "пропущено параметр"
-#: ../cli/src/settings.c:2096 ../cli/src/settings.c:2116
+#: ../clients/cli/settings.c:2195 ../clients/cli/settings.c:2215
+#: ../clients/cli/settings.c:2235
#, c-format
msgid "'%s' is not a valid number (or out of range)"
msgstr ""
"«%s» не Ñ” коректним значеннÑм номер (або лежить поза діапазоном припуÑтимих "
"номерів)"
-#: ../cli/src/settings.c:2170
+#: ../clients/cli/settings.c:2285
#, c-format
msgid "'%s' is not a valid Ethernet MAC"
msgstr "«%s» не Ñ” коректним значеннÑм MAC-адреÑи Ethernet"
-#: ../cli/src/settings.c:2196 ../libnm-util/nm-setting-bridge.c:296
-#: ../libnm-util/nm-setting-connection.c:830
-#: ../libnm-util/nm-setting-vlan.c:548
+#: ../clients/cli/settings.c:2310 ../libnm-core/nm-setting-connection.c:795
+#: ../libnm-core/nm-setting-infiniband.c:256
+#: ../libnm-util/nm-setting-connection.c:835
+#: ../libnm-util/nm-setting-infiniband.c:270
#, c-format
msgid "'%s' is not a valid interface name"
msgstr "«%s» не Ñ” коректною назвою інтерфейÑу"
-#: ../cli/src/settings.c:2214 ../cli/src/settings.c:3621
-#: ../libnm-util/nm-setting-gsm.c:375
+#: ../clients/cli/settings.c:2334
#, c-format
-msgid "'%s' is not a number"
-msgstr "«%s» не Ñ” чиÑлом"
+msgid "'%s' is not a valid flag number; use <0-%d>"
+msgstr ""
+"«%s» не Ñ” коректним номером прапорцÑ; ÑкориÑтайтеÑÑ Ð½Ð¾Ð¼ÐµÑ€Ð¾Ð¼ у діапазоні <0-"
+"%d>"
-#: ../cli/src/settings.c:2266
+#: ../clients/cli/settings.c:2346
+#, c-format
+msgid "Warning: '%s' sum is higher than all flags => all flags set\n"
+msgstr ""
+"ПопередженнÑ: Ñума «%s» перевищує уÑÑ– прапорці => вÑтановлено нове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ "
+"Ð´Ð»Ñ ÑƒÑÑ–Ñ… прапорців\n"
+
+#: ../clients/cli/settings.c:2387
#, c-format
msgid "'%s' is not a valid hex character"
msgstr "«%s» не Ñ” коректним шіÑтнадцÑтковим Ñимволом"
-#: ../cli/src/settings.c:2296
+#: ../clients/cli/settings.c:2417
#, c-format
msgid "'%s' is not a valid MAC"
msgstr "«%s» не Ñ” коректною MAC-адреÑою"
-#: ../cli/src/settings.c:2333 ../libnm-util/nm-setting-connection.c:793
+#: ../clients/cli/settings.c:2454 ../libnm-core/nm-setting-connection.c:784
+#: ../libnm-util/nm-setting-connection.c:792
#, c-format
msgid "'%s' is not a valid UUID"
msgstr "«%s» не є коректним UUID"
-#: ../cli/src/settings.c:2400
+#: ../clients/cli/settings.c:2521
#, c-format
msgid "the property doesn't contain permission '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить права доÑтупу «%s»"
-#: ../cli/src/settings.c:2412
+#: ../clients/cli/settings.c:2533
msgid ""
"Enter a list of user permissions. This is a list of user names formatted "
"as:\n"
@@ -4809,42 +4988,39 @@ msgstr ""
"\n"
"Приклад: alice bob charlie\n"
-#: ../cli/src/settings.c:2431
+#: ../clients/cli/settings.c:2552
#, c-format
msgid "'%s' is not valid master; use ifname or connection UUID"
msgstr ""
"«%s» не Ñ” коректним значеннÑм оÑновного інтерфейÑу; ÑкориÑтайтеÑÑ Ð½Ð°Ð·Ð²Ð¾ÑŽ "
"інтерфейÑу або UUID з’єднаннÑ"
-#: ../cli/src/settings.c:2475
+#: ../clients/cli/settings.c:2596
#, c-format
-#| msgid "Warning: master='%s' doesn't refer to any existing profile.\n"
msgid "Warning: %s is not an UUID of any existing connection profile\n"
msgstr "ПопередженнÑ: %s не Ñ” UUID жодного з наÑвних профілів з’єднаннÑ.\n"
-#: ../cli/src/settings.c:2479 ../cli/src/settings.c:2495
+#: ../clients/cli/settings.c:2600 ../clients/cli/settings.c:2616
#, c-format
-#| msgid "Error: '%s' is not a valid connection type."
msgid "'%s' is not a VPN connection profile"
msgstr "«%s» не Ñ” профілем Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN"
-#: ../cli/src/settings.c:2488
+#: ../clients/cli/settings.c:2609
#, c-format
-#| msgid "Warning: master='%s' doesn't refer to any existing profile.\n"
msgid "'%s' is not a name of any exiting profile"
msgstr "«%s» не Ñ” назвою жодного з наÑвних профілів"
-#: ../cli/src/settings.c:2522
+#: ../clients/cli/settings.c:2643
#, c-format
msgid "the value '%s' is not a valid UUID"
msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s» не Ñ” коректним UUID"
-#: ../cli/src/settings.c:2529
+#: ../clients/cli/settings.c:2650
#, c-format
msgid "the property doesn't contain UUID '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить UUID «%s»"
-#: ../cli/src/settings.c:2541
+#: ../clients/cli/settings.c:2662
msgid ""
"Enter secondary connections that should be activated when this connection "
"is\n"
@@ -4865,39 +5041,105 @@ msgstr ""
"\n"
"Приклад: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"
-#: ../cli/src/settings.c:2618
+#: ../clients/cli/settings.c:2739
msgid "private key password not provided"
msgstr "не надано Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð´Ð¾ закритого ключа"
-#: ../cli/src/settings.c:2645
+#: ../clients/cli/settings.c:2766
#, c-format
msgid "the property doesn't contain EAP method '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить методу EAP «%s»"
-#: ../cli/src/settings.c:2670
+#: ../clients/cli/settings.c:2781
+msgid ""
+"Enter file path to CA certificate (optionally prefixed with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/cacert.crt\n"
+msgstr ""
+"Вкажіть шлÑÑ… до файла Ñертифіката CA (з необов’Ñзковим префікÑом file://).\n"
+" [file://]<шлÑÑ… до файла>\n"
+"Зауважте, що у nmcli не передбачено підтримки Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñертифікатів у "
+"форматі проÑтого маÑиву даних.\n"
+"Приклад: /home/cimrman/cacert.crt\n"
+
+#: ../clients/cli/settings.c:2800
#, c-format
msgid "the property doesn't contain alternative subject match '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить альтернативної відповідноÑÑ‚Ñ– «%s»"
-#: ../cli/src/settings.c:2699
+#: ../clients/cli/settings.c:2816
+msgid ""
+"Enter file path to client certificate (optionally prefixed with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/jara.crt\n"
+msgstr ""
+"Вкажіть шлÑÑ… до файла клієнтÑького Ñертифіката (з необов’Ñзковим префікÑом "
+"file://)\n"
+" [file://]<шлÑÑ… до файла>\n"
+"Зауважте, що у nmcli не передбачено підтримки Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñертифікатів у "
+"форматі проÑтого маÑиву даних.\n"
+"Приклад: /home/cimrman/jara.crt\n"
+
+#: ../clients/cli/settings.c:2828
+msgid ""
+"Enter file path to CA certificate for inner authentication (optionally "
+"prefixed\n"
+"with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/ca-zweite-phase.crt\n"
+msgstr ""
+"Вкажіть шлÑÑ… до файла Ñертифіката CA Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½ÑŒÐ¾Ð³Ð¾ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ (з "
+"необов’Ñзковим префікÑом file://)\n"
+" [file://]<шлÑÑ… до файла>\n"
+"Зауважте, що у nmcli не передбачено підтримки Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñертифікатів у "
+"форматі проÑтого маÑиву даних.\n"
+"Приклад: /home/cimrman/ca-zweite-phase.crt\n"
+
+#: ../clients/cli/settings.c:2848
#, c-format
msgid "the property doesn't contain \"phase2\" alternative subject match '%s'"
msgstr ""
"влаÑтивіÑÑ‚ÑŒ не міÑтить відповідноÑÑ‚Ñ– альтернативного Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«phase2» "
"«%s»"
-#: ../cli/src/settings.c:2725
+#: ../clients/cli/settings.c:2864
+msgid ""
+"Enter file path to client certificate for inner authentication (optionally "
+"prefixed\n"
+"with file://).\n"
+" [file://]<file path>\n"
+"Note that nmcli does not support specifying certificates as raw blob data.\n"
+"Example: /home/cimrman/jara-zweite-phase.crt\n"
+msgstr ""
+"Вкажіть шлÑÑ… до файла клієнтÑького Ñертифіката Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½ÑŒÐ¾Ð³Ð¾ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ "
+"(з необов’Ñзковим префікÑом file://)\n"
+" [file://]<шлÑÑ… до файла>\n"
+"Зауважте, що у nmcli не передбачено підтримки Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñертифікатів у "
+"форматі проÑтого маÑиву даних.\n"
+"Приклад: /home/cimrman/jara-zweite-phase.crt\n"
+
+#: ../clients/cli/settings.c:2884
+#| msgid ""
+#| "Enter path to a private key and the key password (if not set yet):\n"
+#| " <file path> [<password>]\n"
+#| "Example: /home/cimrman/jara-priv-key Dardanely\n"
msgid ""
"Enter path to a private key and the key password (if not set yet):\n"
-" <file path> [<password>]\n"
+" [file://]<file path> [<password>]\n"
+"Note that nmcli does not support specifying private key as raw blob data.\n"
"Example: /home/cimrman/jara-priv-key Dardanely\n"
msgstr ""
"Вкажіть шлÑÑ… до закритого ключа Ñ– пароль до ключа (Ñкщо його ще не "
"вÑтановлено):\n"
-" <шлÑÑ… до ключа> [<пароль>]\n"
+" [file://]<шлÑÑ… до ключа> [<пароль>]\n"
+"Зауважет, що у nmcli не передбачено підтримки Ð·Ð°Ð´Ð°Ð½Ð½Ñ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¾Ð³Ð¾ ключа у "
+"форматі проÑтого маÑиву даних.\n"
"Приклад: /home/cimrman/jara-priv-key Dardanely\n"
-#: ../cli/src/settings.c:2795
+#: ../clients/cli/settings.c:2955
msgid ""
"Enter bytes as a list of hexadecimal values.\n"
"Two formats are accepted:\n"
@@ -4919,7 +5161,7 @@ msgstr ""
"Приклади: ab0455a6ea3a74C2\n"
" ab 4 55 0xa6 ea 3a 74 C2\n"
-#: ../cli/src/settings.c:2898
+#: ../clients/cli/settings.c:3058
#, c-format
msgid ""
"Enter a list of bonding options formatted as:\n"
@@ -4950,22 +5192,33 @@ msgstr ""
"\n"
"Приклад: mode=2,miimon=120\n"
-#: ../cli/src/settings.c:2939
+#: ../clients/cli/settings.c:3096
#, c-format
msgid "'%s' is not a valid InfiniBand MAC"
msgstr "«%s» не Ñ” коректним значеннÑм MAC-адреÑи InfiniBand"
-#: ../cli/src/settings.c:2977
+#: ../clients/cli/settings.c:3133
#, c-format
msgid "'%s' is not a valid IBoIP P_Key"
msgstr "«%s» не є коректним закритим ключем IBoIP"
-#: ../cli/src/settings.c:3045 ../cli/src/settings.c:3390
+#: ../clients/cli/settings.c:3164
+#, c-format
+msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
+msgstr ""
+"«%s» Ñ” некоректним (формат: ip[/префікÑ] [наÑтупний_перехід] [метрика])"
+
+#: ../clients/cli/settings.c:3212 ../clients/cli/settings.c:3231
+#, c-format
+msgid "invalid IPv4 address '%s'"
+msgstr "некоректна адреÑа IPv4, «%s»"
+
+#: ../clients/cli/settings.c:3237 ../clients/cli/settings.c:3538
#, c-format
msgid "the property doesn't contain DNS server '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить Ñервера DNS «%s»"
-#: ../cli/src/settings.c:3057
+#: ../clients/cli/settings.c:3249
msgid ""
"Enter a list of IPv4 addresses of DNS servers.\n"
"\n"
@@ -4975,63 +5228,48 @@ msgstr ""
"\n"
"Приклад: 8.8.8.8, 8.8.4.4\n"
-#: ../cli/src/settings.c:3093 ../cli/src/settings.c:3444
+#: ../clients/cli/settings.c:3285 ../clients/cli/settings.c:3592
#, c-format
msgid "the property doesn't contain DNS search domain '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить домену пошуку DNS «%s»"
-#: ../cli/src/settings.c:3113 ../cli/src/settings.c:3464
-#, c-format
-msgid "'%s' is not valid (use ip[/prefix] [gateway])"
-msgstr "«%s» не Ñ” коректним значеннÑм (мало бути ip[/префікÑ] [шлюз])"
-
-#: ../cli/src/settings.c:3162 ../cli/src/settings.c:3512
+#: ../clients/cli/settings.c:3339 ../clients/cli/settings.c:3645
#, c-format
msgid "the property doesn't contain IP address '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить адреÑи IP «%s»"
-#: ../cli/src/settings.c:3175
+#: ../clients/cli/settings.c:3352
msgid ""
"Enter a list of IPv4 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 32.\n"
"\n"
-"Example: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+"Example: 192.168.1.5/24, 10.0.0.11/24\n"
msgstr ""
"Вкажіть ÑпиÑок Ð°Ð´Ñ€ÐµÑ IPv4 у такому форматуванні:\n"
-" ip[/префікÑ] [шлюз], ip[/префікÑ] [шлюз],...\n"
+" ip[/префікÑ], ip[/префікÑ]...\n"
"Якщо Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð½Ðµ буде вказано, викориÑтовуватиметьÑÑ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ 32.\n"
"\n"
-"Приклад: 192.168.1.5/24 192.168.1.1, 10.0.0.11/24\n"
+"Приклад: 192.168.1.5/24, 10.0.0.11/24\n"
-#: ../cli/src/settings.c:3228 ../cli/src/settings.c:3543
+#: ../clients/cli/settings.c:3368 ../clients/cli/settings.c:3674
#, c-format
-#| msgid "'%s' is not valid (use ip/[prefix] next-hop [metric])"
-msgid "'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"
-msgstr ""
-"«%s» Ñ” некоректним (формат: ip[/префікÑ] [наÑтупний_перехід] [метрика])"
+msgid "invalid gateway address '%s'"
+msgstr "некоректна адреÑа шлюзу, «%s»"
-#: ../cli/src/settings.c:3276 ../cli/src/settings.c:3591
+#: ../clients/cli/settings.c:3423 ../clients/cli/settings.c:3729
#, c-format
msgid "the property doesn't contain route '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить маршруту «%s»"
-#: ../cli/src/settings.c:3289
-#| msgid ""
-#| "Enter a list of IPv4 routes formatted as:\n"
-#| " ip/[prefix] next-hop [metric],...\n"
-#| "Missing prefix is regarded as a prefix of 32.\n"
-#| "Missing metric is regarded as a metric of 0.\n"
-#| "\n"
-#| "Example: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
+#: ../clients/cli/settings.c:3436
msgid ""
"Enter a list of IPv4 routes formatted as:\n"
" ip[/prefix] [next-hop] [metric],...\n"
"\n"
"Missing prefix is regarded as a prefix of 32.\n"
"Missing next-hop is regarded as 0.0.0.0.\n"
-"Missing metric or 0 means a default metric (NM/kernel will set a default "
-"value).\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
"Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
" 10.1.2.0/24\n"
@@ -5041,13 +5279,18 @@ msgstr ""
"\n"
"Якщо Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð½Ðµ вказано, буде викориÑтано Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ 32.\n"
"Якщо не вказано наÑтупний перехід, викориÑтовуєтьÑÑ 0.0.0.0.\n"
-"Якщо метрику не вказано або вказано 0, викориÑтовувати типову метрику (типове "
-"Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð±ÑƒÐ´Ðµ визначено NM або Ñдром).\n"
+"Якщо метрику не вказано, викориÑтовувати типову метрику (типове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ "
+"буде визначено NM або Ñдром).\n"
"\n"
"Приклади: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n"
" 10.1.2.0/24\n"
-#: ../cli/src/settings.c:3402
+#: ../clients/cli/settings.c:3513 ../clients/cli/settings.c:3532
+#, c-format
+msgid "invalid IPv6 address '%s'"
+msgstr "некоректна адреÑа IPv6, «%s»"
+
+#: ../clients/cli/settings.c:3550
msgid ""
"Enter a list of IPv6 addresses of DNS servers. If the IPv6 configuration "
"method is 'auto' these DNS servers are appended to those (if any) returned "
@@ -5068,39 +5311,28 @@ msgstr ""
"\n"
"Приклад: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"
-#: ../cli/src/settings.c:3525
+#: ../clients/cli/settings.c:3658
msgid ""
"Enter a list of IPv6 addresses formatted as:\n"
-" ip[/prefix] [gateway], ip[/prefix] [gateway],...\n"
+" ip[/prefix], ip[/prefix],...\n"
"Missing prefix is regarded as prefix of 128.\n"
"\n"
-"Example: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
-"1050:0:0:0:5:600:300c:326b\n"
+"Example: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"
msgstr ""
"Вкажіть ÑпиÑок Ð°Ð´Ñ€ÐµÑ IPv6 у такому форматуванні:\n"
-" ip[/префікÑ] [шлюз], ip[/префікÑ] [шлюз],...\n"
+" ip[/префікÑ], ip[/префікÑ]...\n"
"Якщо Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð½Ðµ буде вказано, викориÑтовуватиметьÑÑ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ 128.\n"
"\n"
-"Приклад: 2607:f0d0:1002:51::4/64 2607:f0d0:1002:51::1, "
-"1050:0:0:0:5:600:300c:326b\n"
+"Приклад: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"
-#: ../cli/src/settings.c:3604
-#| msgid ""
-#| "Enter a list of IPv6 routes formatted as:\n"
-#| " ip/[prefix] next-hop [metric],...\n"
-#| "Missing prefix is regarded as a prefix of 128.\n"
-#| "Missing metric is regarded as a metric of 0.\n"
-#| "\n"
-#| "Example: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
-#| "db8:beef::3 2\n"
+#: ../clients/cli/settings.c:3742
msgid ""
"Enter a list of IPv6 routes formatted as:\n"
" ip[/prefix] [next-hop] [metric],...\n"
"\n"
"Missing prefix is regarded as a prefix of 128.\n"
"Missing next-hop is regarded as \"::\".\n"
-"Missing metric or 0 means a default metric (NM/kernel will set a default "
-"value).\n"
+"Missing metric means default (NM/kernel will set a default value).\n"
"\n"
"Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
"db8:beef::3 2\n"
@@ -5110,32 +5342,38 @@ msgstr ""
" ip/[префікÑ] [наÑтупний_перехід] [метрика],...\n"
"\n"
"Якщо Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð½Ðµ вказано, буде викориÑтано Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ 128.\n"
-"Якщо не вказано наÑтупний перехід, викориÑтовуєтьÑÑ Â«::».\n"
-"Якщо метрику не вказано або вказано 0, викориÑтовувати типову метрику (типове "
-"Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð±ÑƒÐ´Ðµ визначено NM або Ñдром).\n"
+"Якщо не вказано наÑтупний перехід, викориÑтовуєтьÑÑ \"::\".\n"
+"Якщо метрику не вказано, викориÑтовувати типову метрику (типове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ "
+"буде визначено NM або Ñдром).\n"
"\n"
"Приклади: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:"
"db8:beef::3 2\n"
" abbe::/64 55\n"
-#: ../cli/src/settings.c:3628
+#: ../clients/cli/settings.c:3759 ../libnm-core/nm-setting-gsm.c:317
+#: ../libnm-util/nm-setting-gsm.c:374
+#, c-format
+msgid "'%s' is not a number"
+msgstr "«%s» не Ñ” чиÑлом"
+
+#: ../clients/cli/settings.c:3766
#, c-format
msgid "'%s' is not valid; use 0, 1, or 2"
msgstr ""
"«%s» не Ñ” коректним значеннÑм; можна викориÑтовувати лише Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ 0, 1, 2"
-#: ../cli/src/settings.c:3645
+#: ../clients/cli/settings.c:3783
#, c-format
msgid "'%s' is not a valid channel; use <1-13>"
msgstr "«%s» не є коректним каналом; канал має належати діапазону <1-13>"
-#: ../cli/src/settings.c:3666
+#: ../clients/cli/settings.c:3820
#, c-format
msgid "'%s' is not valid; use [e, o, n]"
msgstr ""
"«%s» Ñ” некоректним значеннÑм; Ñлід викориÑтовувати такі значеннÑ: [e, o, n]"
-#: ../cli/src/settings.c:3694
+#: ../clients/cli/settings.c:3848
msgid ""
"nmcli can accepts both direct JSON configuration data and a file name "
"containing the configuration. In the latter case the file is read and the "
@@ -5154,16 +5392,16 @@ msgstr ""
"\"roundrobin\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }\n"
" set team.config /etc/my-team.conf\n"
-#: ../cli/src/settings.c:3734
+#: ../clients/cli/settings.c:3888
msgid "no priority to remove"
msgstr "немає пріоритетноÑÑ‚Ñ– Ð´Ð»Ñ Ð²Ð¸Ð»ÑƒÑ‡ÐµÐ½Ð½Ñ"
-#: ../cli/src/settings.c:3738
+#: ../clients/cli/settings.c:3892
#, c-format
msgid "index '%d' is not in the range of <0-%d>"
msgstr "Ñ–Ð½Ð´ÐµÐºÑ Â«%d» лежить поза діапазоном <0-%d>"
-#: ../cli/src/settings.c:3777
+#: ../clients/cli/settings.c:3931
#, c-format
msgid ""
"Warning: only one mapping at a time is supported; taking the first one (%s)\n"
@@ -5171,41 +5409,49 @@ msgstr ""
"ПопередженнÑ: передбачено підтримку лише одної прив’Ñзки одночаÑно; вибрано "
"першу прив’Ñзку (%s)\n"
-#: ../cli/src/settings.c:3784
+#: ../clients/cli/settings.c:3938
#, c-format
msgid "the property doesn't contain mapping '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить прив’Ñзки «%s»"
-#: ../cli/src/settings.c:3893 ../cli/src/settings.c:4061
-#: ../libnm-util/nm-setting-wired.c:651
-#: ../libnm-util/nm-setting-wireless.c:843
-#: ../libnm-util/nm-setting-wireless.c:857
+#: ../clients/cli/settings.c:4047 ../clients/cli/settings.c:4210
+#: ../libnm-core/nm-setting-wired.c:607
+#: ../libnm-core/nm-setting-wireless.c:803
+#: ../libnm-core/nm-setting-wireless.c:815
+#: ../libnm-util/nm-setting-wired.c:650
+#: ../libnm-util/nm-setting-wireless.c:860
+#: ../libnm-util/nm-setting-wireless.c:874
#, c-format
msgid "'%s' is not a valid MAC address"
msgstr "%s не Ñ” припуÑтимою MAC-адреÑою"
-#: ../cli/src/settings.c:3899 ../cli/src/settings.c:4067
+#: ../clients/cli/settings.c:4053 ../clients/cli/settings.c:4216
#, c-format
msgid "the property doesn't contain MAC address '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить адреÑи MAC «%s»"
-#: ../cli/src/settings.c:3918
+#: ../clients/cli/settings.c:4072
#, c-format
-msgid "'%s' is not valid; 3 strings should be provided"
-msgstr "«%s» не Ñ” коректним значеннÑм; Ñлід вказати 3 Ñ€Ñдки"
+#| msgid "'%s' is not valid; 3 strings should be provided"
+msgid "'%s' is not valid; 2 or 3 strings should be provided"
+msgstr "«%s» не Ñ” коректним значеннÑм; Ñлід вказати 2 або 3 Ñ€Ñдки"
-#: ../cli/src/settings.c:3937
+#: ../clients/cli/settings.c:4086
+#| msgid ""
+#| "Enter a list of three channels (comma or space separated).\n"
+#| "\n"
+#| "Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
msgid ""
-"Enter a list of three channels (comma or space separated).\n"
+"Enter a list of subchannels (comma or space separated).\n"
"\n"
"Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"
msgstr ""
-"Вкажіть ÑпиÑок з трьох каналів (запиÑи Ñлід відокремлювати комою або "
+"Вкажіть ÑпиÑок підканалів (запиÑи Ñлід відокремлювати комою або "
"пробілом).\n"
"\n"
"Приклад: 0.0.0e20 0.0.0e21 0.0.0e22\n"
-#: ../cli/src/settings.c:3987
+#: ../clients/cli/settings.c:4136
#, c-format
msgid ""
"Enter a list of S/390 options formatted as:\n"
@@ -5216,23 +5462,29 @@ msgstr ""
" параметр = <значеннÑ>, параметр = <значеннÑ>,...\n"
"Коректні Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ñ–Ð²: %s\n"
-#: ../cli/src/settings.c:4033
+#: ../clients/cli/settings.c:4182
#, c-format
msgid "'%s' is not a valid channel"
msgstr "«%s» не є коректним каналом"
-#: ../cli/src/settings.c:4039
+#: ../clients/cli/settings.c:4188
#, c-format
msgid "'%ld' is not a valid channel"
msgstr "«%ld» не є коректним каналом"
-#: ../cli/src/settings.c:4126 ../cli/src/settings.c:4164
-#: ../cli/src/settings.c:4202
+#: ../clients/cli/settings.c:4236
+#, c-format
+#| msgid "'%s' is not a valid duplex value"
+msgid "'%s' is not a valid powersave value"
+msgstr "«%s» не Ñ” коректним значеннÑм режиму Ð·Ð°Ð¾Ñ‰Ð°Ð´Ð¶ÐµÐ½Ð½Ñ ÐµÐ½ÐµÑ€Ð³Ñ–Ñ—"
+
+#: ../clients/cli/settings.c:4296 ../clients/cli/settings.c:4334
+#: ../clients/cli/settings.c:4372
#, c-format
msgid "the property doesn't contain protocol '%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не міÑтить протоколу «%s»"
-#: ../cli/src/settings.c:4241
+#: ../clients/cli/settings.c:4411
#, c-format
msgid ""
"'%s' not compatible with %s '%s', please change the key or set the right %s "
@@ -5241,23 +5493,23 @@ msgstr ""
"«%s» Ñ” неÑуміÑним з %s «%s», будь лаÑка, Ñпочатку змініть ключ або "
"вÑтановіть правильне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s."
-#: ../cli/src/settings.c:4249
+#: ../clients/cli/settings.c:4419
#, c-format
msgid "WEP key is guessed to be of '%s'\n"
msgstr "ПрипуÑкаємо, що ключем WEP Ñ” «%s»\n"
-#: ../cli/src/settings.c:4251
+#: ../clients/cli/settings.c:4421
#, c-format
msgid "WEP key index set to '%d'\n"
msgstr "Ñ–Ð½Ð´ÐµÐºÑ ÐºÐ»ÑŽÑ‡Ð° WEP вÑтановлено у Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%d»\n"
-#: ../cli/src/settings.c:4274
+#: ../clients/cli/settings.c:4444
#, c-format
msgid "'%s' not among [0 (unknown), 1 (key), 2 (passphrase)]"
msgstr "«%s» не належить до набору [0 (невідомо), 1 (ключ), 2 (пароль)]"
-#: ../cli/src/settings.c:4290 ../cli/src/settings.c:4293
-#: ../cli/src/settings.c:4296 ../cli/src/settings.c:4299
+#: ../clients/cli/settings.c:4460 ../clients/cli/settings.c:4463
+#: ../clients/cli/settings.c:4466 ../clients/cli/settings.c:4469
#, c-format
msgid ""
"Warning: '%s' is not compatible with '%s' type, please change or delete the "
@@ -5266,7 +5518,7 @@ msgstr ""
"ПопередженнÑ: «%s» неÑуміÑний з типом «%s». Будь лаÑка, змініть або вилучіть "
"ключ.\n"
-#: ../cli/src/settings.c:4312
+#: ../clients/cli/settings.c:4482
#, c-format
msgid ""
"Enter the type of WEP keys. The accepted values are: 0 or unknown, 1 or key, "
@@ -5275,36 +5527,36 @@ msgstr ""
"Вкажіть тип ключів WEP. Можливі значеннÑ: 0 або unknown (невідомо), 1 або "
"key (ключ) та 2 або passphrase (пароль).\n"
-#: ../cli/src/settings.c:4325
+#: ../clients/cli/settings.c:4495
#, c-format
msgid "'%s' is not a valid PSK"
msgstr "«%s» не є коректним PSK"
-#: ../cli/src/settings.c:4369
+#: ../clients/cli/settings.c:4539
#, c-format
msgid "'%s' is not a valid DCB flag"
msgstr "«%s» не є коректним прапорцем DCB"
-#: ../cli/src/settings.c:4392
+#: ../clients/cli/settings.c:4562
#, c-format
msgid "'%s' is not a DCB app priority"
msgstr "«%s» не є пріоритетом програм DCB"
-#: ../cli/src/settings.c:4418
+#: ../clients/cli/settings.c:4588
msgid "must contain 8 comma-separated numbers"
msgstr "має міÑтити 8 чиÑел, відокремлених комами"
-#: ../cli/src/settings.c:4435
+#: ../clients/cli/settings.c:4605
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive) or %u"
msgstr "«%s» не Ñ” чиÑлом у діапазоні від 0 до %u (включно) або %u"
-#: ../cli/src/settings.c:4438
+#: ../clients/cli/settings.c:4608
#, c-format
msgid "'%s' not a number between 0 and %u (inclusive)"
msgstr "«%s» не Ñ” чиÑлом у діапазоні від 0 до %u (включно)"
-#: ../cli/src/settings.c:4460
+#: ../clients/cli/settings.c:4630
#, c-format
msgid ""
"Warning: changes will have no effect until '%s' includes 1 (enabled)\n"
@@ -5313,100 +5565,103 @@ msgstr ""
"ПопередженнÑ: зміни не буде задіÑно, доки «%s» не включатиме 1 (увімкнено)\n"
"\n"
-#: ../cli/src/settings.c:4513
+#: ../clients/cli/settings.c:4683
#, c-format
msgid "bandwidth percentages must total 100%%"
msgstr "Ñума чаÑтин каналу у відÑотках має Ñкладати 100%%"
-#: ../cli/src/settings.c:6198
+#: ../clients/cli/settings.c:6384
msgid "don't know how to get the property value"
msgstr "програмі невідомий ÑпоÑіб Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ–"
-#: ../cli/src/settings.c:6251 ../cli/src/settings.c:6291
+#: ../clients/cli/settings.c:6437 ../clients/cli/settings.c:6477
msgid "the property can't be changed"
msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– не можна змінювати"
-#: ../cli/src/settings.c:6374
-#| msgid "unavailable"
+#: ../clients/cli/settings.c:6560
msgid "(not available)"
msgstr "(недоÑтупний)"
-#: ../cli/src/settings.c:6399
+#: ../clients/cli/settings.c:6585
msgid "[NM property description]"
msgstr "[Ð¾Ð¿Ð¸Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– NM]"
-#: ../cli/src/settings.c:6404
+#: ../clients/cli/settings.c:6590
msgid "[nmcli specific description]"
msgstr "[Ñпецифічний Ð´Ð»Ñ nmcli опиÑ]"
-#: ../cli/src/utils.c:128
+#. ----------------------------------------------------------------------------
+#: ../clients/cli/settings.c:6639
+msgid "<hidden>"
+msgstr "<приховано>"
+
+#: ../clients/cli/utils.c:127
#, c-format
msgid "Error: value for '%s' argument is required."
msgstr "Помилка: Ñлід вказати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s» аргументу."
-#: ../cli/src/utils.c:153
+#: ../clients/cli/utils.c:152
#, c-format
msgid "Error: Argument '%s' was expected, but '%s' provided."
msgstr "Помилка: мало бути вказано аргумент «%s», втім вказано аргумент «%s»."
-#: ../cli/src/utils.c:156
+#: ../clients/cli/utils.c:155
#, c-format
msgid "Error: Unexpected argument '%s'"
msgstr "Помилка: неочікуваний аргумент «%s»."
-#: ../cli/src/utils.c:206
+#: ../clients/cli/utils.c:205
#, c-format
msgid "Error converting IP4 address '0x%X' to text form"
msgstr ""
"Помилка під Ñ‡Ð°Ñ Ñпроби Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð°Ð´Ñ€ÐµÑи IP4 «0x%X» у текÑтовий формат"
-#: ../cli/src/utils.c:234
+#: ../clients/cli/utils.c:233
#, c-format
msgid "Error converting IP6 address '%s' to text form"
msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð°Ð´Ñ€ÐµÑи IP6 «%s» у текÑтовий формат"
-#: ../cli/src/utils.c:408
+#: ../clients/cli/utils.c:410
#, c-format
-#| msgid "'%s' is ambiguous (%s x %s)"
msgid "'%s' is ambiguous (on x off)"
msgstr "«%s» є неоднозначним (on x off)"
-#: ../cli/src/utils.c:418
+#: ../clients/cli/utils.c:420
#, c-format
msgid "'%s' is not valid; use [%s] or [%s]"
msgstr "«%s» не Ñ” коректним значеннÑм; мало бути [%s] або [%s]"
-#: ../cli/src/utils.c:500
+#: ../clients/cli/utils.c:502
#, c-format
msgid "'%s' is ambiguous (%s x %s)"
msgstr "«%s» є неоднозначним (%s x %s)"
-#: ../cli/src/utils.c:512
+#: ../clients/cli/utils.c:514
#, c-format
msgid "missing name, try one of [%s]"
msgstr "пропущено назву, Ñпробуйте одну з таких назв: [%s]"
-#: ../cli/src/utils.c:729
+#: ../clients/cli/utils.c:753
#, c-format
msgid "field '%s' has to be alone"
msgstr "поле «%s» має бути єдиним"
-#: ../cli/src/utils.c:732
+#: ../clients/cli/utils.c:756
#, c-format
msgid "invalid field '%s'; allowed fields: %s"
msgstr "некоректне поле «%s»; дозволені полÑ: %s"
-#: ../cli/src/utils.c:789
+#: ../clients/cli/utils.c:813
msgid "Option '--terse' requires specifying '--fields'"
msgstr "ВикориÑÑ‚Ð°Ð½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «--terse» потребує Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«--fields»"
-#: ../cli/src/utils.c:793
+#: ../clients/cli/utils.c:817
#, c-format
msgid "Option '--terse' requires specific '--fields' option values , not '%s'"
msgstr ""
"Параметр «--terse» потребує певних значень параметра «--fields», а не «%s»"
-#: ../cli/src/utils.c:1112
+#: ../clients/cli/utils.c:1135
#, c-format
msgid ""
"Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --"
@@ -5415,7 +5670,7 @@ msgstr ""
"Увага: верÑÑ–Ñ— nmcli (%s) Ñ– NetworkManager (%s) не збігаютьÑÑ. СкориÑтайтеÑÑ "
"параметром --nocheck Ð´Ð»Ñ Ð²Ð¸Ð¼Ð¸ÐºÐ°Ð½Ð½Ñ Ñ†ÑŒÐ¾Ð³Ð¾ попередженнÑ.\n"
-#: ../cli/src/utils.c:1121
+#: ../clients/cli/utils.c:1144
#, c-format
msgid ""
"Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force "
@@ -5426,780 +5681,2149 @@ msgstr ""
"можуть бути непередбачуваними.\n"
"."
-#: ../libnm-glib/nm-device.c:1794
-msgid "Bluetooth"
-msgstr "Bluetooth"
+#: ../clients/common/nm-polkit-listener.c:215
+msgid "An authentication session is already underway."
+msgstr "Ð¡ÐµÐ°Ð½Ñ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð²Ð¶Ðµ триває."
+
+#. TTLS and PEAP are actually much more complicated, but this complication
+#. * is not visible here since we only care about phase2 authentication
+#. * (and don't even care of which one)
+#.
+#: ../clients/common/nm-secret-agent-simple.c:209
+#: ../clients/common/nm-secret-agent-simple.c:300
+#: ../clients/tui/nmt-page-dsl.c:69 ../clients/tui/nmt-page-wifi.c:335
+msgid "Username"
+msgstr "КориÑтувач"
+
+#: ../clients/common/nm-secret-agent-simple.c:214
+#: ../clients/common/nm-secret-agent-simple.c:251
+#: ../clients/common/nm-secret-agent-simple.c:277
+#: ../clients/common/nm-secret-agent-simple.c:310
+#: ../clients/common/nm-secret-agent-simple.c:379
+#: ../clients/common/nm-secret-agent-simple.c:392
+#: ../clients/common/nm-secret-agent-simple.c:408
+#: ../clients/tui/nmt-page-dsl.c:78 ../clients/tui/nmt-page-wifi.c:280
+#: ../clients/tui/nmt-page-wifi.c:311 ../clients/tui/nmt-page-wifi.c:344
+msgid "Password"
+msgstr "Пароль"
+
+#: ../clients/common/nm-secret-agent-simple.c:223
+msgid "Identity"
+msgstr "Профіль"
+
+#: ../clients/common/nm-secret-agent-simple.c:228
+msgid "Private key password"
+msgstr "Пароль закритого ключа"
+
+#: ../clients/common/nm-secret-agent-simple.c:265
+#: ../clients/tui/nmt-page-wifi.c:292
+msgid "Key"
+msgstr "Ключ"
+
+#: ../clients/common/nm-secret-agent-simple.c:305
+#: ../clients/tui/nmt-page-dsl.c:81
+msgid "Service"
+msgstr "Служба"
+
+#: ../clients/common/nm-secret-agent-simple.c:339
+msgid "Authentication required by wireless network"
+msgstr "Ð”Ð»Ñ Ð´Ð¾Ñтупу до бездротової мережі Ñлід пройти розпізнаваннÑ"
+
+#: ../clients/common/nm-secret-agent-simple.c:340
+#, c-format
+msgid ""
+"Passwords or encryption keys are required to access the wireless network "
+"'%s'."
+msgstr ""
+"Ð”Ð»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð´Ð¾Ñтупу до бездротової мережі потрібні паролі або ключі "
+"ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Â«%s»."
+
+#: ../clients/common/nm-secret-agent-simple.c:348
+msgid "Wired 802.1X authentication"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð´Ñ€Ð¾Ñ‚Ð¾Ð²Ð¾Ñ— мережі 802.1X"
+
+#: ../clients/common/nm-secret-agent-simple.c:351
+msgid "Network name"
+msgstr "Ðазва мережі"
-#: ../libnm-glib/nm-device.c:1800 ../tui/nm-editor-utils.c:182
+#: ../clients/common/nm-secret-agent-simple.c:358
+msgid "DSL authentication"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ DSL"
+
+#: ../clients/common/nm-secret-agent-simple.c:366
+msgid "PIN code required"
+msgstr "Потрібен PIN-код"
+
+#: ../clients/common/nm-secret-agent-simple.c:367
+msgid "PIN code is needed for the mobile broadband device"
+msgstr ""
+"Ð”Ð»Ñ ÐºÐ¾Ñ€Ð¸ÑÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¸Ñтроєм мобільної широкоÑмугової мережі Ñлід вказати PIN-"
+"код"
+
+#: ../clients/common/nm-secret-agent-simple.c:369
+msgid "PIN"
+msgstr "PIN"
+
+#: ../clients/common/nm-secret-agent-simple.c:375
+#: ../clients/common/nm-secret-agent-simple.c:388
+#: ../clients/common/nm-secret-agent-simple.c:404
+msgid "Mobile broadband network password"
+msgstr "Пароль до мобільної широкоÑмугової мережі"
+
+#: ../clients/common/nm-secret-agent-simple.c:376
+#: ../clients/common/nm-secret-agent-simple.c:389
+#: ../clients/common/nm-secret-agent-simple.c:405
+#, c-format
+msgid "A password is required to connect to '%s'."
+msgstr "Ð”Ð»Ñ Ð²ÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· «%s» Ñлід вказати пароль."
+
+#: ../clients/nm-online.c:96
+#, c-format
+msgid "\rConnecting"
+msgstr "\rÐ’ÑтановлюєтьÑÑ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
+
+#: ../clients/nm-online.c:149
+msgid ""
+"Time to wait for a connection, in seconds (without the option, default value "
+"is 30)"
+msgstr ""
+"Ð§Ð°Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° з’єднаннÑ, у Ñекундах (без цього параметра типовим "
+"значеннÑм Ñ” 30)"
+
+#: ../clients/nm-online.c:150
+msgid "Exit immediately if NetworkManager is not running or connecting"
+msgstr ""
+"Ðегайно завершити роботу, Ñкщо NetworkManager не запущено або виконуєтьÑÑ "
+"Ñпроба з’єднаннÑ"
+
+#: ../clients/nm-online.c:151
+msgid "Don't print anything"
+msgstr "Ðічого не виводити"
+
+#: ../clients/nm-online.c:152
+msgid "Wait for NetworkManager startup instead of a connection"
+msgstr "Чекати на запуÑк NetworkManager, а не на з’єднаннÑ"
+
+#: ../clients/nm-online.c:173
+msgid ""
+"Waits for NetworkManager to finish activating startup network connections."
+msgstr ""
+"Очікує на Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ð°ÐºÑ‚Ð¸Ð²Ð°Ñ†Ñ–Ñ— NetworkManager з’єднань, Ñкі Ñлід активувати "
+"під Ñ‡Ð°Ñ Ð·Ð°Ð¿ÑƒÑку."
+
+#: ../clients/nm-online.c:180 ../clients/nm-online.c:186
+msgid "Invalid option. Please use --help to see a list of valid options."
+msgstr ""
+"Ðекоректний параметр. Щоб ознайомитиÑÑ Ð·Ñ– ÑпиÑком параметрів, ÑкориÑтайтеÑÑ "
+"параметром --help."
+
+#: ../clients/tui/newt/nmt-newt-utils.c:180 ../clients/tui/nmt-editor.c:417
+#: ../clients/tui/nmt-password-dialog.c:174
+#: ../clients/tui/nmt-route-editor.c:125 ../clients/tui/nmtui-hostname.c:71
+#: ../clients/tui/nmtui.c:117
+msgid "OK"
+msgstr "Гаразд"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:328
+#: ../clients/tui/newt/nmt-newt-utils.c:360
+#, c-format
+msgid "Could not create temporary file: %s"
+msgstr "Ðе вдалоÑÑ Ñтворити тимчаÑовий файл «%s»"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:368
+#, c-format
+msgid "Editor failed: %s"
+msgstr "Помилка редактора: %s"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:376
+#, c-format
+msgid "Editor failed with status %d"
+msgstr "Помилка редактора з кодом Ñтану %d"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:378
+#, c-format
+msgid "Editor failed with signal %d"
+msgstr "Помилка редактора з Ñигналом %d"
+
+#: ../clients/tui/newt/nmt-newt-utils.c:382
+#, c-format
+msgid "Could not re-read file: %s"
+msgstr "Ðе вдалоÑÑ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð½Ð¾ прочитати файл: %s"
+
+#: ../clients/tui/nm-editor-utils.c:151
+#, c-format
+msgid "Ethernet connection %d"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ethernet %d"
+
+#: ../clients/tui/nm-editor-utils.c:159
+#, c-format
+msgid "Wi-Fi connection %d"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Wi-Fi %d"
+
+#: ../clients/tui/nm-editor-utils.c:168
+#, c-format
+msgid "InfiniBand connection %d"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ InfiniBand %d"
+
+#: ../clients/tui/nm-editor-utils.c:173 ../libnm-glib/nm-device.c:1799
+#: ../libnm/nm-device.c:1621
msgid "Mobile Broadband"
msgstr "Мобільна радіомережа"
-#: ../libnm-glib/nm-device.c:1804 ../libnm-util/nm-connection.c:1297
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4287 ../tui/nm-editor-utils.c:200
+#: ../clients/tui/nm-editor-utils.c:176
+#, c-format
+msgid "Mobile broadband connection %d"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð·Ð° допомогою мобільної радіомережі %d"
+
+#: ../clients/tui/nm-editor-utils.c:182 ../clients/tui/nmt-page-dsl.c:65
+msgid "DSL"
+msgstr "DSL"
+
+#: ../clients/tui/nm-editor-utils.c:186
+#, c-format
+msgid "DSL connection %d"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ DSL %d"
+
+#: ../clients/tui/nm-editor-utils.c:191 ../libnm-core/nm-connection.c:1565
+#: ../libnm-glib/nm-device.c:1803 ../libnm-util/nm-connection.c:1608
+#: ../libnm/nm-device.c:1625 ../src/settings/plugins/ifcfg-rh/reader.c:3931
msgid "Bond"
msgstr "Прив’Ñзка"
-#: ../libnm-glib/nm-device.c:1806 ../libnm-util/nm-connection.c:1299
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4398 ../tui/nm-editor-utils.c:218
-msgid "Team"
-msgstr "Команда"
+#: ../clients/tui/nm-editor-utils.c:195
+#, c-format
+msgid "Bond connection %d"
+msgstr "Прив’Ñзане Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %d"
-#: ../libnm-glib/nm-device.c:1808 ../libnm-util/nm-connection.c:1301
-#: ../src/settings/plugins/ifcfg-rh/reader.c:4593 ../tui/nm-editor-utils.c:209
+#: ../clients/tui/nm-editor-utils.c:200 ../libnm-core/nm-connection.c:1569
+#: ../libnm-glib/nm-device.c:1807 ../libnm-util/nm-connection.c:1612
+#: ../libnm/nm-device.c:1629 ../src/settings/plugins/ifcfg-rh/reader.c:4222
msgid "Bridge"
msgstr "МіÑток"
-#: ../libnm-glib/nm-device.c:1812
-msgid "ADSL"
-msgstr "ADSL"
+#: ../clients/tui/nm-editor-utils.c:205
+#, c-format
+msgid "Bridge connection %d"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¼Ñ–Ñтка %d"
-#: ../libnm-glib/nm-device.c:1840
-msgid "Wired"
-msgstr "Дротове"
+#: ../clients/tui/nm-editor-utils.c:209 ../libnm-core/nm-connection.c:1567
+#: ../libnm-glib/nm-device.c:1805 ../libnm-util/nm-connection.c:1610
+#: ../libnm/nm-device.c:1627 ../src/settings/plugins/ifcfg-rh/reader.c:4037
+msgid "Team"
+msgstr "Команда"
-#: ../libnm-glib/nm-device.c:1871
-msgid "PCI"
-msgstr "PCI"
+#: ../clients/tui/nm-editor-utils.c:214
+#, c-format
+msgid "Team connection %d"
+msgstr "Командне Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %d"
-#: ../libnm-glib/nm-device.c:1873
-msgid "USB"
-msgstr "USB"
+#: ../clients/tui/nm-editor-utils.c:222
+#, c-format
+msgid "VLAN connection %d"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VLAN %d"
-#. Translators: the first %s is a bus name (eg, "USB") or
-#. * product name, the second is a device type (eg,
-#. * "Ethernet"). You can change this to something like
-#. * "%2$s (%1$s)" if there's no grammatical way to combine
-#. * the strings otherwise.
-#.
-#: ../libnm-glib/nm-device.c:1969 ../libnm-glib/nm-device.c:1988
+#: ../clients/tui/nm-editor-utils.c:237
#, c-format
-msgctxt "long device name"
-msgid "%s %s"
-msgstr "%s %s"
+msgid "VPN connection %d"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN %d"
-#: ../libnm-glib/nm-remote-connection.c:151
-msgid "Disconnected by D-Bus"
-msgstr "Від’єднано D-Bus"
+#: ../clients/tui/nmt-device-entry.c:371
+msgid "Select..."
+msgstr "Вибрати…"
+
+#: ../clients/tui/nmt-edit-connection-list.c:112
+msgid "Add"
+msgstr "Додати"
+
+#: ../clients/tui/nmt-edit-connection-list.c:115
+#: ../clients/tui/nmt-page-ip4.c:172 ../clients/tui/nmt-page-ip6.c:170
+#: ../clients/tui/nmt-page-team-port.c:112 ../clients/tui/nmt-page-team.c:176
+msgid "Edit..."
+msgstr "Змінити..."
+
+#: ../clients/tui/nmt-edit-connection-list.c:118
+#: ../clients/tui/nmtui-edit.c:527
+msgid "Delete"
+msgstr "Вилучити"
-#: ../libnm-util/crypto.c:133
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Hide"
+msgstr "Сховати"
+
+#: ../clients/tui/nmt-editor-section.c:105
+msgid "Show"
+msgstr "Показати"
+
+#: ../clients/tui/nmt-editor.c:99
+#, c-format
+msgid "Could not create editor for connection '%s' of type '%s'."
+msgstr "Ðе вдалоÑÑ Ñтворити редактор Ð´Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» типу «%s»."
+
+#: ../clients/tui/nmt-editor.c:103
+#, c-format
+msgid "Could not create editor for invalid connection '%s'."
+msgstr "Ðе вдалоÑÑ Ñтворити редактор Ð´Ð»Ñ Ð½ÐµÐºÐ¾Ñ€ÐµÐºÑ‚Ð½Ð¾Ð³Ð¾ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»."
+
+#: ../clients/tui/nmt-editor.c:113
+msgid "Edit Connection"
+msgstr "Редагувати з’єднаннÑ"
+
+#: ../clients/tui/nmt-editor.c:166
+#, c-format
+msgid "Unable to save connection: %s"
+msgstr "Ðе вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ: %s"
+
+#: ../clients/tui/nmt-editor.c:180
+#, c-format
+msgid "Unable to add new connection: %s"
+msgstr "Ðе вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ нове з’єднаннÑ: %s"
+
+#: ../clients/tui/nmt-editor.c:322
+msgid "Profile name"
+msgstr "Ðазва профілю"
+
+#: ../clients/tui/nmt-editor.c:333
+msgid "Ethernet device"
+msgstr "ПриÑтрій Ethernet"
+
+#: ../clients/tui/nmt-editor.c:335
+msgid "Device"
+msgstr "ПриÑтрій"
+
+#. And finally the bottom widgets
+#: ../clients/tui/nmt-editor.c:393
+msgid "Automatically connect"
+msgstr "З’єднуватиÑÑŒ автоматично"
+
+#: ../clients/tui/nmt-editor.c:399
+msgid "Available to all users"
+msgstr "ДоÑтупне уÑім кориÑтувачам"
+
+#: ../clients/tui/nmt-editor.c:414 ../clients/tui/nmt-password-dialog.c:171
+#: ../clients/tui/nmt-route-editor.c:118 ../clients/tui/nmtui-edit.c:218
+#: ../clients/tui/nmtui-edit.c:526 ../clients/tui/nmtui-hostname.c:69
+msgid "Cancel"
+msgstr "СкаÑувати"
+
+#: ../clients/tui/nmt-mtu-entry.c:86
+msgid "(default)"
+msgstr "(типово)"
+
+#: ../clients/tui/nmt-mtu-entry.c:88 ../clients/tui/nmt-mtu-entry.c:119
+msgid "bytes"
+msgstr "байтів"
+
+#: ../clients/tui/nmt-page-bond.c:87
+msgid "Round-robin"
+msgstr "Циклічний"
+
+#: ../clients/tui/nmt-page-bond.c:88
+msgid "Active Backup"
+msgstr "Ðктивне резервуваннÑ"
+
+#: ../clients/tui/nmt-page-bond.c:89
+msgid "XOR"
+msgstr "XOR"
+
+#: ../clients/tui/nmt-page-bond.c:90
+msgid "Broadcast"
+msgstr "ТранÑлÑціÑ"
+
+#: ../clients/tui/nmt-page-bond.c:91
+msgid "802.3ad"
+msgstr "802.3ad"
+
+#: ../clients/tui/nmt-page-bond.c:92
+msgid "Adaptive Transmit Load Balancing (tlb)"
+msgstr "Ðдаптивне ÑƒÑ€Ñ–Ð²Ð½Ð¾Ð²Ð°Ð¶ÐµÐ½Ð½Ñ Ð½Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð° передаваннÑм (tlb)"
+
+#: ../clients/tui/nmt-page-bond.c:93
+msgid "Adaptive Load Balancing (alb)"
+msgstr "Ðдаптивне ÑƒÑ€Ñ–Ð²Ð½Ð¾Ð²Ð°Ð¶ÐµÐ½Ð½Ñ Ð½Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ (alb)"
+
+#: ../clients/tui/nmt-page-bond.c:99
+msgid "MII (recommended)"
+msgstr "MII (рекомендоване)"
+
+#: ../clients/tui/nmt-page-bond.c:100
+msgid "ARP"
+msgstr "ARP"
+
+#: ../clients/tui/nmt-page-bond.c:358 ../clients/tui/nmt-page-bridge.c:81
+#: ../clients/tui/nmt-page-team.c:155
+msgid "Slaves"
+msgstr "Підлеглі"
+
+#: ../clients/tui/nmt-page-bond.c:370 ../clients/tui/nmt-page-wifi.c:233
+msgid "Mode"
+msgstr "Режим"
+
+#: ../clients/tui/nmt-page-bond.c:376
+msgid "Primary"
+msgstr "ОÑновний"
+
+#: ../clients/tui/nmt-page-bond.c:382
+msgid "Link monitoring"
+msgstr "СпоÑÑ‚ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° зв’Ñзком"
+
+#: ../clients/tui/nmt-page-bond.c:388 ../clients/tui/nmt-page-bond.c:395
+#: ../clients/tui/nmt-page-bond.c:402 ../clients/tui/nmt-page-bond.c:409
+msgctxt "milliseconds"
+msgid "ms"
+msgstr "мÑ"
+
+#: ../clients/tui/nmt-page-bond.c:389 ../clients/tui/nmt-page-bond.c:410
+msgid "Monitoring frequency"
+msgstr "ЧаÑтота оновленнÑ"
+
+#: ../clients/tui/nmt-page-bond.c:396
+msgid "Link up delay"
+msgstr "Затримка вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·Ð²â€™Ñзку"
+
+#: ../clients/tui/nmt-page-bond.c:403
+msgid "Link down delay"
+msgstr "Затримка Ñ€Ð¾Ð·Ñ–Ñ€Ð²Ð°Ð½Ð½Ñ Ð·Ð²â€™Ñзку"
+
+#: ../clients/tui/nmt-page-bond.c:416
+msgid "ARP targets"
+msgstr "Цілі ARP"
+
+#: ../clients/tui/nmt-page-bridge-port.c:63
+msgid "BRIDGE PORT"
+msgstr "ПОРТ МІСТКÐ"
+
+#: ../clients/tui/nmt-page-bridge-port.c:70
+#: ../clients/tui/nmt-page-bridge.c:107
+msgid "Priority"
+msgstr "Пріоритет"
+
+#: ../clients/tui/nmt-page-bridge-port.c:76
+msgid "Path cost"
+msgstr "ВартіÑÑ‚ÑŒ маршруту"
+
+#: ../clients/tui/nmt-page-bridge-port.c:78
+msgid "Hairpin mode"
+msgstr "Режим початкової зони (hairpin)"
+
+#: ../clients/tui/nmt-page-bridge.c:91 ../clients/tui/nmt-page-bridge.c:116
+#: ../clients/tui/nmt-page-bridge.c:126 ../clients/tui/nmt-page-bridge.c:136
+msgid "seconds"
+msgstr "Ñекунд"
+
+#: ../clients/tui/nmt-page-bridge.c:92
+msgid "Aging time"
+msgstr "Ð§Ð°Ñ Ð·Ð°ÑтаріваннÑ"
+
+#: ../clients/tui/nmt-page-bridge.c:94
+msgid "Enable STP (Spanning Tree Protocol)"
+msgstr "Увімкнути STP (протокол розподілу за деревом)"
+
+#: ../clients/tui/nmt-page-bridge.c:117
+msgid "Forward delay"
+msgstr "Затримка переÑпрÑмуваннÑ"
+
+#: ../clients/tui/nmt-page-bridge.c:127
+msgid "Hello time"
+msgstr "Ð§Ð°Ñ Ð½Ð° вітаннÑ"
+
+#: ../clients/tui/nmt-page-bridge.c:137
+msgid "Max age"
+msgstr "МакÑ. вік"
+
+#: ../clients/tui/nmt-page-ethernet.c:73
+msgid "ETHERNET"
+msgstr "ETHERNET"
+
+#: ../clients/tui/nmt-page-ethernet.c:80 ../clients/tui/nmt-page-vlan.c:125
+#: ../clients/tui/nmt-page-wifi.c:367
+msgid "Cloned MAC address"
+msgstr "Клонована MAC-адреÑа"
+
+#: ../clients/tui/nmt-page-infiniband.c:50
+msgid "Datagram"
+msgstr "Данограма"
+
+#: ../clients/tui/nmt-page-infiniband.c:51
+msgid "Connected"
+msgstr "З'єднано"
+
+#: ../clients/tui/nmt-page-infiniband.c:84
+msgid "INFINIBAND"
+msgstr "INFINIBAND"
+
+#: ../clients/tui/nmt-page-infiniband.c:91
+msgid "Transport mode"
+msgstr "Режим передаваннÑ"
+
+#: ../clients/tui/nmt-page-ip4.c:41
+msgid "Disabled"
+msgstr "Вимкнено"
+
+#: ../clients/tui/nmt-page-ip4.c:42 ../clients/tui/nmt-page-ip6.c:42
+msgid "Automatic"
+msgstr "Ðвтоматично"
+
+#: ../clients/tui/nmt-page-ip4.c:43 ../clients/tui/nmt-page-ip6.c:44
+msgid "Link-Local"
+msgstr "Link-Local"
+
+#: ../clients/tui/nmt-page-ip4.c:44 ../clients/tui/nmt-page-ip6.c:45
+msgid "Manual"
+msgstr "Вручну"
+
+#: ../clients/tui/nmt-page-ip4.c:45
+msgid "Shared"
+msgstr "Спільний"
+
+#: ../clients/tui/nmt-page-ip4.c:85 ../clients/tui/nmt-page-ip6.c:85
+msgid "(No custom routes)"
+msgstr "(Ðемає нетипових маршрутів)"
+
+#: ../clients/tui/nmt-page-ip4.c:88 ../clients/tui/nmt-page-ip6.c:88
+#, c-format
+msgid "One custom route"
+msgid_plural "%d custom routes"
+msgstr[0] "%d нетипове правило"
+msgstr[1] "%d нетипових правила"
+msgstr[2] "%d нетипових правил"
+msgstr[3] "Одне нетипове правило"
+
+#: ../clients/tui/nmt-page-ip4.c:131
+msgid "IPv4 CONFIGURATION"
+msgstr "ÐÐЛÐШТУВÐÐÐЯ IPv4"
+
+#: ../clients/tui/nmt-page-ip4.c:139 ../clients/tui/nmt-page-ip6.c:139
+msgid "Addresses"
+msgstr "ÐдреÑи"
+
+#: ../clients/tui/nmt-page-ip4.c:146 ../clients/tui/nmt-page-ip6.c:146
+msgid "Gateway"
+msgstr "Шлюз"
+
+#: ../clients/tui/nmt-page-ip4.c:153 ../clients/tui/nmt-page-ip6.c:153
+msgid "DNS servers"
+msgstr "Сервери DNS"
+
+#: ../clients/tui/nmt-page-ip4.c:159 ../clients/tui/nmt-page-ip6.c:159
+msgid "Search domains"
+msgstr "Домени пошуку"
+
+#: ../clients/tui/nmt-page-ip4.c:174 ../clients/tui/nmt-page-ip6.c:172
+msgid "Routing"
+msgstr "Маршрути"
+
+#: ../clients/tui/nmt-page-ip4.c:176 ../clients/tui/nmt-page-ip6.c:174
+msgid "Never use this network for default route"
+msgstr "Ðіколи не викориÑтовувати цю мережу Ð´Ð»Ñ Ñ‚Ð¸Ð¿Ð¾Ð²Ð¾Ñ— маршрутизації"
+
+#: ../clients/tui/nmt-page-ip4.c:184
+msgid "Require IPv4 addressing for this connection"
+msgstr "Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ‚Ñ€Ñ–Ð±Ð½Ðµ адреÑÑƒÐ²Ð°Ð½Ð½Ñ IPv4"
+
+#: ../clients/tui/nmt-page-ip6.c:41
+msgid "Ignore"
+msgstr "Ігнорувати"
+
+#: ../clients/tui/nmt-page-ip6.c:43
+msgid "Automatic (DHCP-only)"
+msgstr "Ðвтоматично (лише DHCP)"
+
+#: ../clients/tui/nmt-page-ip6.c:131
+msgid "IPv6 CONFIGURATION"
+msgstr "ÐÐЛÐШТУВÐÐÐЯ IPv6"
+
+#: ../clients/tui/nmt-page-ip6.c:182
+msgid "Require IPv6 addressing for this connection"
+msgstr "Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ‚Ñ€Ñ–Ð±Ð½Ðµ адреÑÑƒÐ²Ð°Ð½Ð½Ñ IPv6"
+
+#: ../clients/tui/nmt-page-ppp.c:134
+msgid "PPP CONFIGURATION"
+msgstr "ÐÐЛÐШТУВÐÐÐЯ PPP"
+
+#: ../clients/tui/nmt-page-ppp.c:143
+msgid "Allowed authentication methods:"
+msgstr "Дозволені методи розпізнаваннÑ:"
+
+#: ../clients/tui/nmt-page-ppp.c:150
+msgid "EAP"
+msgstr "EAP"
+
+#: ../clients/tui/nmt-page-ppp.c:158
+msgid "PAP"
+msgstr "PAP"
+
+#: ../clients/tui/nmt-page-ppp.c:166
+msgid "CHAP"
+msgstr "CHAP"
+
+#: ../clients/tui/nmt-page-ppp.c:174
+msgid "MSCHAPv2"
+msgstr "MSCHAPv2"
+
+#: ../clients/tui/nmt-page-ppp.c:182
+msgid "MSCHAP"
+msgstr "MSCHAP"
+
+#: ../clients/tui/nmt-page-ppp.c:198
+msgid "Use point-to-point encryption (MPPE)"
+msgstr "ВикориÑтовувати міжточкове ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ (MPPE)"
+
+#: ../clients/tui/nmt-page-ppp.c:210
+msgid "Require 128-bit encryption"
+msgstr "Потрібне 128-бітове шифруваннÑ"
+
+#: ../clients/tui/nmt-page-ppp.c:220
+msgid "Use stateful MPPE"
+msgstr "ВикориÑтовувати MPPE зі збереженнÑм Ñтану"
+
+#: ../clients/tui/nmt-page-ppp.c:232
+msgid "Allow BSD data compression"
+msgstr "Дозволити ÑтиÑÐºÐ°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ… BSD"
+
+#: ../clients/tui/nmt-page-ppp.c:240
+msgid "Allow Deflate data compression"
+msgstr "Дозволити ÑтиÑÐºÐ°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ… DEFLATE"
+
+#: ../clients/tui/nmt-page-ppp.c:248
+msgid "Use TCP header compression"
+msgstr "ВикориÑтовувати ÑтиÑÐºÐ°Ð½Ð½Ñ Ð·Ð°Ð³Ð¾Ð»Ð¾Ð²ÐºÐ° TCP"
+
+#: ../clients/tui/nmt-page-ppp.c:258
+msgid "Send PPP echo packets"
+msgstr "ÐадÑилати PPP-луна пакети"
+
+#: ../clients/tui/nmt-page-team-port.c:95
+msgid "TEAM PORT"
+msgstr "ПОРТ КОМÐÐДИ"
+
+#: ../clients/tui/nmt-page-team-port.c:102 ../clients/tui/nmt-page-team.c:166
+msgid "JSON configuration"
+msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ JSON"
+
+#: ../clients/tui/nmt-page-vlan.c:102
+msgid "Parent"
+msgstr "БатьківÑький"
+
+#: ../clients/tui/nmt-page-vlan.c:117
+msgid "VLAN id"
+msgstr "Ід. VLAN"
+
+#: ../clients/tui/nmt-page-wifi.c:67
+msgctxt "Wi-Fi"
+msgid "Client"
+msgstr "Клієнт"
+
+#: ../clients/tui/nmt-page-wifi.c:68
+msgid "Access Point"
+msgstr "Точка доÑтупу"
+
+#: ../clients/tui/nmt-page-wifi.c:69
+msgid "Ad-Hoc Network"
+msgstr "Спеціальна мережа"
+
+#: ../clients/tui/nmt-page-wifi.c:74
+msgctxt "Wi-Fi"
+msgid "Automatic"
+msgstr "Ðвтоматично"
+
+#. 802.11a Wi-Fi network
+#: ../clients/tui/nmt-page-wifi.c:76
+msgid "A (5 GHz)"
+msgstr "A (5 ГГц)"
+
+#. 802.11b / 802.11g Wi-Fi network
+#: ../clients/tui/nmt-page-wifi.c:78
+msgid "B/G (2.4 GHz)"
+msgstr "B/G (2,4 ГГц)"
+
+#: ../clients/tui/nmt-page-wifi.c:83
+msgctxt "Wi-Fi security"
+msgid "None"
+msgstr "Ðемає"
+
+#: ../clients/tui/nmt-page-wifi.c:84
+msgid "WPA & WPA2 Personal"
+msgstr "WPA/WPA2 Personal"
+
+#: ../clients/tui/nmt-page-wifi.c:85
+msgid "WPA & WPA2 Enterprise"
+msgstr "WPA/WPA2 Enterprise"
+
+#: ../clients/tui/nmt-page-wifi.c:86
+msgid "WEP 40/128-bit Key (Hex or ASCII)"
+msgstr "40/128-бітовий ключ WEP (шіÑтнадцÑтковий або ASCII)"
+
+#: ../clients/tui/nmt-page-wifi.c:87
+msgid "WEP 128-bit Passphrase"
+msgstr "128-бітовий пароль WEP"
+
+#: ../clients/tui/nmt-page-wifi.c:88
+msgid "Dynamic WEP (802.1x)"
+msgstr "Динамічна WEP (802.1x)"
+
+#: ../clients/tui/nmt-page-wifi.c:89
+msgid "LEAP"
+msgstr "LEAP"
+
+#: ../clients/tui/nmt-page-wifi.c:94
+msgctxt "WEP key index"
+msgid "1 (Default)"
+msgstr "1 (типово)"
+
+#: ../clients/tui/nmt-page-wifi.c:95
+msgctxt "WEP key index"
+msgid "2"
+msgstr "2"
+
+#: ../clients/tui/nmt-page-wifi.c:96
+msgctxt "WEP key index"
+msgid "3"
+msgstr "3"
+
+#: ../clients/tui/nmt-page-wifi.c:97
+msgctxt "WEP key index"
+msgid "4"
+msgstr "4"
+
+#: ../clients/tui/nmt-page-wifi.c:102
+msgid "Open System"
+msgstr "Відкрита ÑиÑтема"
+
+#: ../clients/tui/nmt-page-wifi.c:103
+msgid "Shared Key"
+msgstr "Відкритий ключ"
+
+#: ../clients/tui/nmt-page-wifi.c:217
+msgid "WI-FI"
+msgstr "WI-FI"
+
+#: ../clients/tui/nmt-page-wifi.c:259
+msgid "Channel"
+msgstr "Канал"
+
+#: ../clients/tui/nmt-page-wifi.c:264
+msgid "Security"
+msgstr "ЗахиÑÑ‚"
+
+#. "wpa-enterprise"
+#. FIXME
+#: ../clients/tui/nmt-page-wifi.c:285
+msgid "(No support for wpa-enterprise yet...)"
+msgstr "(Підтримки wpa-enterprise ще не передбачено...)"
+
+#: ../clients/tui/nmt-page-wifi.c:295 ../clients/tui/nmt-page-wifi.c:314
+msgid "WEP index"
+msgstr "Ð†Ð½Ð´ÐµÐºÑ WEP"
+
+#: ../clients/tui/nmt-page-wifi.c:303 ../clients/tui/nmt-page-wifi.c:322
+msgid "Authentication"
+msgstr "РозпізнаваннÑ"
+
+#. "dynamic-wep"
+#. FIXME
+#: ../clients/tui/nmt-page-wifi.c:328
+msgid "(No support for dynamic-wep yet...)"
+msgstr "(Підтримки dynamic-wep ще не передбачено...)"
+
+#: ../clients/tui/nmt-password-fields.c:130
+msgid "Ask for this password every time"
+msgstr "Запитувати про цей пароль щоразу"
+
+#: ../clients/tui/nmt-password-fields.c:131
+msgid "Show password"
+msgstr "Показати фразу паролÑ"
+
+#: ../clients/tui/nmt-route-table.c:192
+msgid "Destination"
+msgstr "ПризначеннÑ"
+
+#: ../clients/tui/nmt-route-table.c:192
+msgid "Prefix"
+msgstr "ПрефікÑ"
+
+#: ../clients/tui/nmt-route-table.c:201
+msgid "Next Hop"
+msgstr "ÐаÑтупне переÑиланнÑ"
+
+#: ../clients/tui/nmt-route-table.c:209
+msgid "Metric"
+msgstr "Метрика"
+
+#: ../clients/tui/nmt-route-table.c:229
+msgid "No custom routes are defined."
+msgstr "Ðетипових маршрутів не визначено."
+
+#: ../clients/tui/nmt-slave-list.c:137
+msgid "Select the type of slave connection you wish to add."
+msgstr "Виберіть тип підлеглого з’єднаннÑ, Ñке ви хочете додати."
+
+#: ../clients/tui/nmt-widget-list.c:141
+msgid "Add..."
+msgstr "Додати…"
+
+#: ../clients/tui/nmt-widget-list.c:204
+msgid "Remove"
+msgstr "Вилучити"
+
+#: ../clients/tui/nmtui-connect.c:90
+msgid "Activation failed"
+msgstr "Ðевдала Ñпроба активації"
+
+#: ../clients/tui/nmtui-connect.c:145
+msgid "Connecting..."
+msgstr "Ð’ÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ..."
+
+#: ../clients/tui/nmtui-connect.c:180 ../clients/tui/nmtui-connect.c:211
+#, c-format
+msgid "Could not activate connection: %s"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð´Ñ–Ñти з’єднаннÑ: %s"
+
+#: ../clients/tui/nmtui-connect.c:271 ../clients/tui/nmtui-connect.c:320
+msgid "Activate"
+msgstr "Ðктивізувати"
+
+#: ../clients/tui/nmtui-connect.c:273
+msgid "Deactivate"
+msgstr "Вимкнути"
+
+#: ../clients/tui/nmtui-connect.c:325 ../clients/tui/nmtui-edit.c:121
+#: ../clients/tui/nmtui.c:111
+msgid "Quit"
+msgstr "Вийти"
+
+#: ../clients/tui/nmtui-connect.c:348
+#, c-format
+msgid "No such connection '%s'"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» не Ñ–Ñнує"
+
+#: ../clients/tui/nmtui-connect.c:350
+msgid "Connection is already active"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð²Ð¶Ðµ Ñ” активним"
+
+#: ../clients/tui/nmtui-edit.c:226
+msgid "Create"
+msgstr "Створити"
+
+#: ../clients/tui/nmtui-edit.c:368
+msgid "Select the type of connection you wish to create."
+msgstr "Виберіть тип з’єднаннÑ, Ñке Ñлід Ñтворити."
+
+#: ../clients/tui/nmtui-edit.c:376
+msgid ""
+"If you are creating a VPN, and the VPN connection you wish to create does "
+"not appear in the list, you may not have the correct VPN plugin installed."
+msgstr ""
+"Якщо ви Ñтворюєте VPN Ñ– пункту Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN, Ñке ви хочете Ñтворити, немає "
+"у ÑпиÑку, ймовірно, додаток VPN не вÑтановлено або вÑтановлено неналежним "
+"чином."
+
+#: ../clients/tui/nmtui-edit.c:412 ../clients/tui/nmtui-edit.c:428
+msgid "New Connection"
+msgstr "Ðове з’єднаннÑ"
+
+#: ../clients/tui/nmtui-edit.c:467
+#, c-format
+msgid "Unable to delete connection: %s"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ з’єднаннÑ: %s"
+
+#: ../clients/tui/nmtui-edit.c:506
+#, c-format
+msgid "Could not delete connection '%s': %s"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»: %s"
+
+#: ../clients/tui/nmtui-edit.c:528
+#, c-format
+msgid "Are you sure you want to delete the connection '%s'?"
+msgstr "Ви Ñправді хочете вилучити Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»?"
+
+#: ../clients/tui/nmtui-hostname.c:47
+msgid "Set Hostname"
+msgstr "Ð’Ñтановити назву вузла"
+
+#: ../clients/tui/nmtui-hostname.c:55
+msgid "Hostname"
+msgstr "Ðазва вузла"
+
+#. Translators: this indicates the result. ie, "I have set the hostname to ..."
+#: ../clients/tui/nmtui-hostname.c:118
+#, c-format
+msgid "Set hostname to '%s'"
+msgstr "Ð’Ñтановити назву вузла «%s»"
+
+#: ../clients/tui/nmtui-hostname.c:120
+#, c-format
+msgid "Unable to set hostname: %s"
+msgstr "Ðе вдалоÑÑ Ð²Ñтановити назву вузла: %s"
+
+#: ../clients/tui/nmtui.c:56 ../clients/tui/nmtui.c:59
+msgid "connection"
+msgstr "з’єднаннÑ"
+
+#: ../clients/tui/nmtui.c:57
+msgid "Edit a connection"
+msgstr "Змінити Ð·Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
+
+#: ../clients/tui/nmtui.c:60
+msgid "Activate a connection"
+msgstr "ЗадіÑти з’єднаннÑ"
+
+#: ../clients/tui/nmtui.c:62
+msgid "new hostname"
+msgstr "нова назва вузла"
+
+#: ../clients/tui/nmtui.c:63
+msgid "Set system hostname"
+msgstr "Ð’Ñтановити назву вузла ÑиÑтеми"
+
+#: ../clients/tui/nmtui.c:86
+msgid "NetworkManager TUI"
+msgstr "КонÑольний Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð´Ð¾ NetworkManager"
+
+#: ../clients/tui/nmtui.c:94
+msgid "Please select an option"
+msgstr "Будь лаÑка, виберіть варіант"
+
+#: ../clients/tui/nmtui.c:146
+msgid "Usage"
+msgstr "КориÑтуваннÑ"
+
+#: ../clients/tui/nmtui.c:227
+msgid "Could not parse arguments"
+msgstr "Ðе вдалоÑÑ Ð¾Ð±Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ аргументи"
+
+#: ../clients/tui/nmtui.c:237
+#, c-format
+msgid "Could not contact NetworkManager: %s.\n"
+msgstr "Ðе вдалоÑÑ Ð·Ð²â€™ÑзатиÑÑ Ñ–Ð· NetworkManager: %s.\n"
+
+#: ../clients/tui/nmtui.c:242
+msgid "NetworkManager is not running."
+msgstr "NetworkManager не запущено."
+
+#: ../libnm-core/crypto.c:120 ../libnm-util/crypto.c:133
#, c-format
msgid "PEM key file had no end tag '%s'."
msgstr "У файлі ключа PEM не міÑтитьÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ°Ð»ÑŒÐ½Ð¾Ð³Ð¾ теґу «%s»."
-#: ../libnm-util/crypto.c:146
+#: ../libnm-core/crypto.c:133 ../libnm-util/crypto.c:146
#, c-format
msgid "Doesn't look like a PEM private key file."
msgstr "Ймовірно, цей файл не є файлом закритого ключа PEM."
-#: ../libnm-util/crypto.c:163
+#: ../libnm-core/crypto.c:150 ../libnm-util/crypto.c:163
#, c-format
msgid "Malformed PEM file: Proc-Type was not first tag."
msgstr "Помилкове Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ PEM: Proc-Type не Ñ” першим теґом."
-#: ../libnm-util/crypto.c:171
+#: ../libnm-core/crypto.c:158 ../libnm-util/crypto.c:171
#, c-format
msgid "Malformed PEM file: unknown Proc-Type tag '%s'."
msgstr "Помилкове Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ PEM: невідомий теґ Proc-Type «%s»."
-#: ../libnm-util/crypto.c:181
+#: ../libnm-core/crypto.c:168 ../libnm-util/crypto.c:181
#, c-format
msgid "Malformed PEM file: DEK-Info was not the second tag."
msgstr "Помилкове Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ PEM: DEK-Info не Ñ” другим теґом."
-#: ../libnm-util/crypto.c:192
+#: ../libnm-core/crypto.c:179 ../libnm-util/crypto.c:192
#, c-format
msgid "Malformed PEM file: no IV found in DEK-Info tag."
msgstr "Помилкове Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° PEM: не знайдено теґу DEK-Info у ВІ."
-#: ../libnm-util/crypto.c:199
+#: ../libnm-core/crypto.c:186 ../libnm-util/crypto.c:199
#, c-format
msgid "Malformed PEM file: invalid format of IV in DEK-Info tag."
msgstr ""
"Помилкове Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° PEM: некоректне Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð’Ð† у тезі DEK-Info."
-#: ../libnm-util/crypto.c:214
+#: ../libnm-core/crypto.c:201 ../libnm-util/crypto.c:214
#, c-format
msgid "Malformed PEM file: unknown private key cipher '%s'."
msgstr ""
"Помилкове Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° PEM: невідоме ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¾Ð³Ð¾ ключа «%s»."
-#: ../libnm-util/crypto.c:233
+#: ../libnm-core/crypto.c:220 ../libnm-util/crypto.c:233
#, c-format
msgid "Could not decode private key."
msgstr "Ðе вдалоÑÑ Ð´ÐµÐºÐ¾Ð´ÑƒÐ²Ð°Ñ‚Ð¸ закритий ключ."
-#: ../libnm-util/crypto.c:285
+#: ../libnm-core/crypto.c:274 ../libnm-util/crypto.c:285
msgid "Failed to find expected PKCS#8 start tag."
msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ очікуваний початковий теґ PKCS#8."
-#: ../libnm-util/crypto.c:293
+#: ../libnm-core/crypto.c:282 ../libnm-util/crypto.c:293
#, c-format
msgid "Failed to find expected PKCS#8 end tag '%s'."
msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ очікуваний завершальний теґ PKCS#8 «%s»."
-#: ../libnm-util/crypto.c:312
+#: ../libnm-core/crypto.c:301 ../libnm-util/crypto.c:312
msgid "Failed to decode PKCS#8 private key."
msgstr "Ðе вдалоÑÑ Ð´ÐµÐºÐ¾Ð´ÑƒÐ²Ð°Ñ‚Ð¸ закритий ключ PKCS#8."
-#: ../libnm-util/crypto.c:354
+#: ../libnm-core/crypto.c:343 ../libnm-util/crypto.c:354
#, c-format
msgid "IV must be an even number of bytes in length."
msgstr "Довжина ВІ має дорівнювати парній кількоÑÑ‚Ñ– байтів."
-#: ../libnm-util/crypto.c:368
+#: ../libnm-core/crypto.c:357 ../libnm-util/crypto.c:368
#, c-format
msgid "IV contains non-hexadecimal digits."
msgstr "ВІ міÑтить не шіÑтнадцÑткові цифри."
-#: ../libnm-util/crypto.c:408 ../libnm-util/crypto_gnutls.c:150
-#: ../libnm-util/crypto_gnutls.c:267 ../libnm-util/crypto_nss.c:170
-#: ../libnm-util/crypto_nss.c:331
+#: ../libnm-core/crypto.c:397 ../libnm-core/crypto_gnutls.c:93
+#: ../libnm-core/crypto_gnutls.c:214 ../libnm-core/crypto_nss.c:115
+#: ../libnm-core/crypto_nss.c:280 ../libnm-util/crypto.c:408
+#: ../libnm-util/crypto_gnutls.c:146 ../libnm-util/crypto_gnutls.c:263
+#: ../libnm-util/crypto_nss.c:165 ../libnm-util/crypto_nss.c:326
#, c-format
msgid "Private key cipher '%s' was unknown."
msgstr "Ðевідоме ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¾Ð³Ð¾ ключа «%s»."
-#: ../libnm-util/crypto.c:518
+#: ../libnm-core/crypto.c:496 ../libnm-util/crypto.c:518
#, c-format
msgid "Unable to determine private key type."
msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ тип закритого ключа."
-#: ../libnm-util/crypto.c:573
+#: ../libnm-core/crypto.c:504
+#, c-format
+msgid "Password provided, but key was not encrypted."
+msgstr "Ðадано пароль, але ключ не зашифровано."
+
+#: ../libnm-core/crypto.c:557 ../libnm-util/crypto.c:573
#, c-format
msgid "PEM certificate had no start tag '%s'."
msgstr "Сертифікат PEM не міÑтить початкового теґу «%s»."
-#: ../libnm-util/crypto.c:582
+#: ../libnm-core/crypto.c:566 ../libnm-util/crypto.c:582
#, c-format
msgid "PEM certificate had no end tag '%s'."
msgstr "Сертифікат PEM не міÑтить завершального теґу «%s»."
-#: ../libnm-util/crypto.c:600
+#: ../libnm-core/crypto.c:584 ../libnm-util/crypto.c:600
#, c-format
msgid "Failed to decode certificate."
msgstr "Ðе вдалоÑÑ Ð´ÐµÐºÐ¾Ð´ÑƒÐ²Ð°Ñ‚Ð¸ Ñертифікат."
-#: ../libnm-util/crypto_gnutls.c:50
+#: ../libnm-core/crypto_gnutls.c:51 ../libnm-util/crypto_gnutls.c:51
msgid "Failed to initialize the crypto engine."
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ рушій шифруваннÑ."
-#: ../libnm-util/crypto_gnutls.c:92
-#, c-format
-msgid "Failed to initialize the MD5 engine: %s / %s."
-msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ рушій обчиÑÐ»ÐµÐ½Ð½Ñ MD5: %s / %s."
-
-#: ../libnm-util/crypto_gnutls.c:158
+#: ../libnm-core/crypto_gnutls.c:101 ../libnm-util/crypto_gnutls.c:154
#, c-format
msgid "Invalid IV length (must be at least %zd)."
msgstr "Ðекоректна довжина ВІ (має бути принаймні %zd)."
-#: ../libnm-util/crypto_gnutls.c:169
+#: ../libnm-core/crypto_gnutls.c:112 ../libnm-util/crypto_gnutls.c:165
#, c-format
msgid "Failed to initialize the decryption cipher context: %s / %s."
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ контекÑÑ‚ шифру декодуваннÑ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:178
+#: ../libnm-core/crypto_gnutls.c:121 ../libnm-util/crypto_gnutls.c:174
#, c-format
msgid "Failed to set symmetric key for decryption: %s / %s."
msgstr "Ðе вдалоÑÑ Ð²Ñтановити Ñиметричний ключ Ð´Ð»Ñ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:187
+#: ../libnm-core/crypto_gnutls.c:130 ../libnm-util/crypto_gnutls.c:183
#, c-format
msgid "Failed to set IV for decryption: %s / %s."
msgstr "Ðе вдалоÑÑ Ð²Ñтановити ВІ Ð´Ð»Ñ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:196
+#: ../libnm-core/crypto_gnutls.c:139 ../libnm-util/crypto_gnutls.c:192
#, c-format
msgid "Failed to decrypt the private key: %s / %s."
msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ закритий ключ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:206 ../libnm-util/crypto_nss.c:260
+#: ../libnm-core/crypto_gnutls.c:149 ../libnm-core/crypto_nss.c:205
+#: ../libnm-util/crypto_gnutls.c:202 ../libnm-util/crypto_nss.c:255
#, c-format
msgid "Failed to decrypt the private key: unexpected padding length."
msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ закритий ключ: неочікувана довжина доповненнÑ."
-#: ../libnm-util/crypto_gnutls.c:217 ../libnm-util/crypto_nss.c:271
+#: ../libnm-core/crypto_gnutls.c:160 ../libnm-core/crypto_nss.c:216
+#: ../libnm-util/crypto_gnutls.c:213 ../libnm-util/crypto_nss.c:266
#, c-format
msgid "Failed to decrypt the private key."
msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ закритий ключ."
-#: ../libnm-util/crypto_gnutls.c:289
+#: ../libnm-core/crypto_gnutls.c:236 ../libnm-util/crypto_gnutls.c:285
#, c-format
msgid "Failed to initialize the encryption cipher context: %s / %s."
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ контекÑÑ‚ шифру кодуваннÑ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:298
+#: ../libnm-core/crypto_gnutls.c:245 ../libnm-util/crypto_gnutls.c:294
#, c-format
msgid "Failed to set symmetric key for encryption: %s / %s."
msgstr "Ðе вдалоÑÑ Ð²Ñтановити Ñиметричний ключ Ð´Ð»Ñ ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:308
+#: ../libnm-core/crypto_gnutls.c:255 ../libnm-util/crypto_gnutls.c:304
#, c-format
msgid "Failed to set IV for encryption: %s / %s."
msgstr "Ðе вдалоÑÑ Ð²Ñтановити ВІ Ð´Ð»Ñ ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:317
+#: ../libnm-core/crypto_gnutls.c:264 ../libnm-util/crypto_gnutls.c:313
#, c-format
msgid "Failed to encrypt the data: %s / %s."
msgstr "Ðе вдалоÑÑ Ð·Ð°ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ дані: %s / %s."
-#: ../libnm-util/crypto_gnutls.c:357
+#: ../libnm-core/crypto_gnutls.c:307 ../libnm-util/crypto_gnutls.c:353
#, c-format
msgid "Error initializing certificate data: %s"
msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби ініціалізації даних Ñертифіката: %s"
-#: ../libnm-util/crypto_gnutls.c:379
+#: ../libnm-core/crypto_gnutls.c:329 ../libnm-util/crypto_gnutls.c:375
#, c-format
msgid "Couldn't decode certificate: %s"
msgstr "Ðе вдалоÑÑ Ð´ÐµÐºÐ¾Ð´ÑƒÐ²Ð°Ñ‚Ð¸ Ñертифікат: %s"
-#: ../libnm-util/crypto_gnutls.c:403
+#: ../libnm-core/crypto_gnutls.c:357 ../libnm-util/crypto_gnutls.c:399
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %s"
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ інÑтрумент Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:416
+#: ../libnm-core/crypto_gnutls.c:370 ../libnm-util/crypto_gnutls.c:412
#, c-format
msgid "Couldn't decode PKCS#12 file: %s"
msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ файл PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:428
+#: ../libnm-core/crypto_gnutls.c:382 ../libnm-util/crypto_gnutls.c:424
#, c-format
msgid "Couldn't verify PKCS#12 file: %s"
msgstr "Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ²Ñ–Ñ€Ð¸Ñ‚Ð¸ файл PKCS#12: %s"
-#: ../libnm-util/crypto_gnutls.c:456
+#: ../libnm-core/crypto_gnutls.c:414 ../libnm-util/crypto_gnutls.c:452
#, c-format
msgid "Couldn't initialize PKCS#8 decoder: %s"
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ інÑтрумент Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ PKCS#8: %s"
-#: ../libnm-util/crypto_gnutls.c:479
+#: ../libnm-core/crypto_gnutls.c:437 ../libnm-util/crypto_gnutls.c:475
#, c-format
msgid "Couldn't decode PKCS#8 file: %s"
msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ файл PKCS#8: %s"
-#: ../libnm-util/crypto_nss.c:56
+#: ../libnm-core/crypto_nss.c:57 ../libnm-util/crypto_nss.c:56
#, c-format
msgid "Failed to initialize the crypto engine: %d."
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ рушій шифруваннÑ: %d."
-#: ../libnm-util/crypto_nss.c:107
-#, c-format
-msgid "Failed to initialize the MD5 context: %d."
-msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ контекÑÑ‚ MD5: %d."
-
-#: ../libnm-util/crypto_nss.c:178
+#: ../libnm-core/crypto_nss.c:123 ../libnm-util/crypto_nss.c:173
#, c-format
msgid "Invalid IV length (must be at least %d)."
msgstr "Ðекоректна довжина ВІ (має бути принаймні %d)."
-#: ../libnm-util/crypto_nss.c:189
+#: ../libnm-core/crypto_nss.c:134 ../libnm-util/crypto_nss.c:184
#, c-format
msgid "Failed to initialize the decryption cipher slot."
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ Ñлот шифру декодуваннÑ."
-#: ../libnm-util/crypto_nss.c:199
+#: ../libnm-core/crypto_nss.c:144 ../libnm-util/crypto_nss.c:194
#, c-format
msgid "Failed to set symmetric key for decryption."
msgstr "Ðе вдалоÑÑ Ð²Ñтановити Ñиметричний ключ Ð´Ð»Ñ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ."
-#: ../libnm-util/crypto_nss.c:209
+#: ../libnm-core/crypto_nss.c:154 ../libnm-util/crypto_nss.c:204
#, c-format
msgid "Failed to set IV for decryption."
msgstr "Ðе вдалоÑÑ Ð²Ñтановити ВІ Ð´Ð»Ñ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ."
-#: ../libnm-util/crypto_nss.c:217
+#: ../libnm-core/crypto_nss.c:162 ../libnm-util/crypto_nss.c:212
#, c-format
msgid "Failed to initialize the decryption context."
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ контекÑÑ‚ розшифруваннÑ."
-#: ../libnm-util/crypto_nss.c:230
+#: ../libnm-core/crypto_nss.c:175 ../libnm-util/crypto_nss.c:225
#, c-format
msgid "Failed to decrypt the private key: %d."
msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ закритий ключ: %d."
-#: ../libnm-util/crypto_nss.c:238
+#: ../libnm-core/crypto_nss.c:183 ../libnm-util/crypto_nss.c:233
#, c-format
msgid "Failed to decrypt the private key: decrypted data too large."
msgstr ""
"Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ закритий ключ: розшифровані дані Ñ” занадто об’ємними."
-#: ../libnm-util/crypto_nss.c:249
+#: ../libnm-core/crypto_nss.c:194 ../libnm-util/crypto_nss.c:244
#, c-format
msgid "Failed to finalize decryption of the private key: %d."
msgstr "Ðе вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¾Ð³Ð¾ ключа: %d."
-#: ../libnm-util/crypto_nss.c:353
+#: ../libnm-core/crypto_nss.c:302 ../libnm-util/crypto_nss.c:348
#, c-format
msgid "Failed to initialize the encryption cipher slot."
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ Ñлот шифру розкодуваннÑ."
-#: ../libnm-util/crypto_nss.c:361
+#: ../libnm-core/crypto_nss.c:310 ../libnm-util/crypto_nss.c:356
#, c-format
msgid "Failed to set symmetric key for encryption."
msgstr "Ðе вдалоÑÑ Ð²Ñтановити Ñиметричний ключ Ð´Ð»Ñ ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ."
-#: ../libnm-util/crypto_nss.c:369
+#: ../libnm-core/crypto_nss.c:318 ../libnm-util/crypto_nss.c:364
#, c-format
msgid "Failed to set IV for encryption."
msgstr "Ðе вдалоÑÑ Ð²Ñтановити вектор ініціалізації Ð´Ð»Ñ ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ."
-#: ../libnm-util/crypto_nss.c:377
+#: ../libnm-core/crypto_nss.c:326 ../libnm-util/crypto_nss.c:372
#, c-format
msgid "Failed to initialize the encryption context."
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ контекÑÑ‚ шифруваннÑ."
-#: ../libnm-util/crypto_nss.c:385
+#: ../libnm-core/crypto_nss.c:334 ../libnm-util/crypto_nss.c:380
#, c-format
msgid "Failed to encrypt: %d."
msgstr "Ðе вдалоÑÑ Ð·Ð°ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸: %d."
-#: ../libnm-util/crypto_nss.c:393
+#: ../libnm-core/crypto_nss.c:342 ../libnm-util/crypto_nss.c:388
#, c-format
msgid "Unexpected amount of data after encrypting."
msgstr "Ðеочікуваний об’єм даних піÑÐ»Ñ ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ."
-#: ../libnm-util/crypto_nss.c:433
+#: ../libnm-core/crypto_nss.c:385 ../libnm-util/crypto_nss.c:428
#, c-format
msgid "Couldn't decode certificate: %d"
msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ Ñертифікат: %d"
-#: ../libnm-util/crypto_nss.c:468
+#: ../libnm-core/crypto_nss.c:423
#, c-format
-msgid "Couldn't convert password to UCS2: %d"
-msgstr "Ðе вдалоÑÑ Ð·Ð¼Ñ–Ð½Ð¸Ñ‚Ð¸ ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð½Ð° UCS2: %d"
+msgid "Password must be UTF-8"
+msgstr "Пароль має бути вказано у кодуванні UTF-8"
-#: ../libnm-util/crypto_nss.c:496
+#: ../libnm-core/crypto_nss.c:453 ../libnm-util/crypto_nss.c:491
#, c-format
msgid "Couldn't initialize PKCS#12 decoder: %d"
msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ інÑтрумент Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:505
+#: ../libnm-core/crypto_nss.c:462 ../libnm-util/crypto_nss.c:500
#, c-format
msgid "Couldn't decode PKCS#12 file: %d"
msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ñ‚Ð¸ файл PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:514
+#: ../libnm-core/crypto_nss.c:471 ../libnm-util/crypto_nss.c:509
#, c-format
msgid "Couldn't verify PKCS#12 file: %d"
msgstr "Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ²Ñ–Ñ€Ð¸Ñ‚Ð¸ файл PKCS#12: %d"
-#: ../libnm-util/crypto_nss.c:558
+#: ../libnm-core/crypto_nss.c:522 ../libnm-util/crypto_nss.c:553
msgid "Could not generate random data."
msgstr "Ðе вдалоÑÑ Ñтворити пÑевдовипадкові дані."
-#: ../libnm-util/nm-setting-8021x.c:594
+#: ../libnm-core/nm-connection.c:225
+msgid "wrong type; should be a list of strings."
+msgstr "помилковий тип; має бути ÑпиÑок Ñ€Ñдків."
+
+#: ../libnm-core/nm-connection.c:280
+msgid "unknown setting name"
+msgstr "невідома назва параметра"
+
+#: ../libnm-core/nm-connection.c:802
+msgid "setting not found"
+msgstr "параметра не знайдено"
+
+#: ../libnm-core/nm-connection.c:866
+msgid "setting not allowed in slave connection"
+msgstr "параметр не можна викориÑтовувати у підлеглому з’єднанні"
+
+#: ../libnm-core/nm-connection.c:877
+msgid "setting is required for non-slave connections"
+msgstr "Ð´Ð»Ñ Ð½ÐµÐ¿Ñ–Ð´Ð»ÐµÐ³Ð»Ð¸Ñ… з’єднань потрібен параметр"
+
+#: ../libnm-core/nm-connection.c:943
+msgid "Unexpected failure to verify the connection"
+msgstr "Ðеочікувана помилка під Ñ‡Ð°Ñ Ñпроби перевірити з’єднаннÑ"
+
+#: ../libnm-core/nm-connection.c:976
+msgid "Unexpected failure to normalize the connection"
+msgstr "Ðеочікувана помилка під Ñ‡Ð°Ñ Ñпроби нормалізувати з’єднаннÑ"
+
+#: ../libnm-core/nm-connection.c:1440 ../libnm-core/nm-setting-8021x.c:2273
+#: ../libnm-core/nm-setting-8021x.c:2290 ../libnm-core/nm-setting-8021x.c:2321
+#: ../libnm-core/nm-setting-8021x.c:2338 ../libnm-core/nm-setting-8021x.c:2380
+#: ../libnm-core/nm-setting-8021x.c:2392 ../libnm-core/nm-setting-8021x.c:2410
+#: ../libnm-core/nm-setting-8021x.c:2422 ../libnm-core/nm-setting-8021x.c:2446
+#: ../libnm-core/nm-setting-8021x.c:2628 ../libnm-core/nm-setting-adsl.c:190
+#: ../libnm-core/nm-setting-bluetooth.c:121
+#: ../libnm-core/nm-setting-bluetooth.c:139
+#: ../libnm-core/nm-setting-cdma.c:142
+#: ../libnm-core/nm-setting-connection.c:768
+#: ../libnm-core/nm-setting-connection.c:807
+#: ../libnm-core/nm-setting-connection.c:908
+#: ../libnm-core/nm-setting-ip-config.c:1841
+#: ../libnm-core/nm-setting-olpc-mesh.c:113
+#: ../libnm-core/nm-setting-pppoe.c:143 ../libnm-core/nm-setting-vpn.c:400
+#: ../libnm-core/nm-setting-wimax.c:117
+#: ../libnm-core/nm-setting-wireless-security.c:862
+#: ../libnm-core/nm-setting-wireless.c:712 ../libnm-util/nm-setting.c:1366
+#: ../libnm-util/nm-setting.c:1385 ../libnm-util/nm-setting.c:1403
+#: ../libnm-util/nm-setting-8021x.c:2284 ../libnm-util/nm-setting-8021x.c:2301
+#: ../libnm-util/nm-setting-8021x.c:2342 ../libnm-util/nm-setting-8021x.c:2359
+#: ../libnm-util/nm-setting-8021x.c:2411 ../libnm-util/nm-setting-8021x.c:2423
+#: ../libnm-util/nm-setting-8021x.c:2441 ../libnm-util/nm-setting-8021x.c:2453
+#: ../libnm-util/nm-setting-8021x.c:2477 ../libnm-util/nm-setting-8021x.c:2655
+#: ../libnm-util/nm-setting-adsl.c:210
+#: ../libnm-util/nm-setting-bluetooth.c:143
+#: ../libnm-util/nm-setting-bluetooth.c:161
+#: ../libnm-util/nm-setting-cdma.c:163
+#: ../libnm-util/nm-setting-connection.c:769
+#: ../libnm-util/nm-setting-connection.c:785
+#: ../libnm-util/nm-setting-connection.c:846
+#: ../libnm-util/nm-setting-ip4-config.c:852
+#: ../libnm-util/nm-setting-ip6-config.c:833
+#: ../libnm-util/nm-setting-ip6-config.c:897
+#: ../libnm-util/nm-setting-olpc-mesh.c:124
+#: ../libnm-util/nm-setting-pppoe.c:164 ../libnm-util/nm-setting-vpn.c:424
+#: ../libnm-util/nm-setting-wimax.c:139
+#: ../libnm-util/nm-setting-wireless-security.c:892
+#: ../libnm-util/nm-setting-wireless.c:770
+msgid "property is missing"
+msgstr "не вказано влаÑтивоÑÑ‚Ñ–"
+
+#: ../libnm-core/nm-setting-8021x.c:579 ../libnm-util/nm-setting-8021x.c:598
msgid "CA certificate must be in X.509 format"
msgstr "Форматом Ñертифіката CA має бути X.509"
-#: ../libnm-util/nm-setting-8021x.c:912 ../libnm-util/nm-setting-8021x.c:1175
-#: ../libnm-util/nm-setting-8021x.c:1498
-#| msgid "Error initializing certificate data: %s"
+#: ../libnm-core/nm-setting-8021x.c:894 ../libnm-core/nm-setting-8021x.c:1158
+#: ../libnm-core/nm-setting-8021x.c:1478 ../libnm-util/nm-setting-8021x.c:916
+#: ../libnm-util/nm-setting-8021x.c:1179 ../libnm-util/nm-setting-8021x.c:1502
msgid "invalid certificate format"
msgstr "некоректний формат Ñертифіката"
-#: ../libnm-util/nm-setting-8021x.c:1767
-#| msgid "invalid gateway '%s'"
+#: ../libnm-core/nm-setting-8021x.c:1761 ../libnm-util/nm-setting-8021x.c:1771
msgid "invalid private key"
msgstr "некоректний закритий ключ"
-#: ../libnm-util/nm-setting-8021x.c:2078
-#| msgid "Failed to decrypt the private key."
+#: ../libnm-core/nm-setting-8021x.c:2071 ../libnm-util/nm-setting-8021x.c:2082
msgid "invalid phase2 private key"
msgstr "некоректний закритий ключ фази 2"
-#: ../libnm-util/nm-setting-8021x.c:2280 ../libnm-util/nm-setting-8021x.c:2297
-#: ../libnm-util/nm-setting-8021x.c:2338 ../libnm-util/nm-setting-8021x.c:2355
-#: ../libnm-util/nm-setting-8021x.c:2407 ../libnm-util/nm-setting-8021x.c:2419
-#: ../libnm-util/nm-setting-8021x.c:2437 ../libnm-util/nm-setting-8021x.c:2449
-#: ../libnm-util/nm-setting-8021x.c:2473 ../libnm-util/nm-setting-8021x.c:2651
-#: ../libnm-util/nm-setting-adsl.c:212
-#: ../libnm-util/nm-setting-bluetooth.c:144
-#: ../libnm-util/nm-setting-bluetooth.c:162
-#: ../libnm-util/nm-setting-bond.c:498 ../libnm-util/nm-setting-bridge.c:287
-#: ../libnm-util/nm-setting-cdma.c:163
-#: ../libnm-util/nm-setting-connection.c:770
-#: ../libnm-util/nm-setting-connection.c:786
-#: ../libnm-util/nm-setting-connection.c:841
-#: ../libnm-util/nm-setting-ip4-config.c:887
-#: ../libnm-util/nm-setting-ip6-config.c:812
-#: ../libnm-util/nm-setting-ip6-config.c:876
-#: ../libnm-util/nm-setting-olpc-mesh.c:127
-#: ../libnm-util/nm-setting-pppoe.c:165 ../libnm-util/nm-setting-team.c:141
-#: ../libnm-util/nm-setting-vpn.c:405 ../libnm-util/nm-setting-wimax.c:137
-#: ../libnm-util/nm-setting-wireless-security.c:894
-#: ../libnm-util/nm-setting-wireless.c:753
-msgid "property is missing"
-msgstr "не вказано влаÑтивоÑÑ‚Ñ–"
-
-#: ../libnm-util/nm-setting-8021x.c:2287 ../libnm-util/nm-setting-8021x.c:2304
-#: ../libnm-util/nm-setting-8021x.c:2345 ../libnm-util/nm-setting-8021x.c:2362
-#: ../libnm-util/nm-setting-8021x.c:2413 ../libnm-util/nm-setting-8021x.c:2425
-#: ../libnm-util/nm-setting-8021x.c:2443 ../libnm-util/nm-setting-8021x.c:2455
-#: ../libnm-util/nm-setting-8021x.c:2480 ../libnm-util/nm-setting-adsl.c:219
-#: ../libnm-util/nm-setting-adsl.c:228 ../libnm-util/nm-setting-cdma.c:179
+#: ../libnm-core/nm-setting-8021x.c:2280 ../libnm-core/nm-setting-8021x.c:2297
+#: ../libnm-core/nm-setting-8021x.c:2328 ../libnm-core/nm-setting-8021x.c:2345
+#: ../libnm-core/nm-setting-8021x.c:2386 ../libnm-core/nm-setting-8021x.c:2398
+#: ../libnm-core/nm-setting-8021x.c:2416 ../libnm-core/nm-setting-8021x.c:2428
+#: ../libnm-core/nm-setting-8021x.c:2453 ../libnm-core/nm-setting-adsl.c:197
+#: ../libnm-core/nm-setting-adsl.c:206 ../libnm-core/nm-setting-cdma.c:158
+#: ../libnm-core/nm-setting-cdma.c:167
+#: ../libnm-core/nm-setting-connection.c:775
+#: ../libnm-core/nm-setting-connection.c:818
+#: ../libnm-core/nm-setting-gsm.c:226 ../libnm-core/nm-setting-gsm.c:283
+#: ../libnm-core/nm-setting-gsm.c:292
+#: ../libnm-core/nm-setting-ip-config.c:1848
+#: ../libnm-core/nm-setting-ip4-config.c:178
+#: ../libnm-core/nm-setting-pppoe.c:150 ../libnm-core/nm-setting-pppoe.c:159
+#: ../libnm-core/nm-setting-vpn.c:409 ../libnm-core/nm-setting-vpn.c:419
+#: ../libnm-core/nm-setting-wimax.c:126
+#: ../libnm-core/nm-setting-wireless-security.c:892
+#: ../libnm-core/nm-setting-wireless-security.c:900
+#: ../libnm-core/nm-setting-wireless-security.c:924
+#: ../libnm-util/nm-setting-8021x.c:2291 ../libnm-util/nm-setting-8021x.c:2308
+#: ../libnm-util/nm-setting-8021x.c:2349 ../libnm-util/nm-setting-8021x.c:2366
+#: ../libnm-util/nm-setting-8021x.c:2417 ../libnm-util/nm-setting-8021x.c:2429
+#: ../libnm-util/nm-setting-8021x.c:2447 ../libnm-util/nm-setting-8021x.c:2459
+#: ../libnm-util/nm-setting-8021x.c:2484 ../libnm-util/nm-setting-adsl.c:217
+#: ../libnm-util/nm-setting-adsl.c:226 ../libnm-util/nm-setting-cdma.c:179
#: ../libnm-util/nm-setting-cdma.c:188
-#: ../libnm-util/nm-setting-connection.c:777
-#: ../libnm-util/nm-setting-connection.c:848
-#: ../libnm-util/nm-setting-gsm.c:284 ../libnm-util/nm-setting-gsm.c:341
-#: ../libnm-util/nm-setting-gsm.c:350
-#: ../libnm-util/nm-setting-ip4-config.c:952
-#: ../libnm-util/nm-setting-ip4-config.c:961
-#: ../libnm-util/nm-setting-pppoe.c:172 ../libnm-util/nm-setting-pppoe.c:181
-#: ../libnm-util/nm-setting-vpn.c:414 ../libnm-util/nm-setting-vpn.c:424
-#: ../libnm-util/nm-setting-wimax.c:146
-#: ../libnm-util/nm-setting-wireless-security.c:924
-#: ../libnm-util/nm-setting-wireless-security.c:932
-#: ../libnm-util/nm-setting-wireless-security.c:956
+#: ../libnm-util/nm-setting-connection.c:776
+#: ../libnm-util/nm-setting-connection.c:853
+#: ../libnm-util/nm-setting-gsm.c:283 ../libnm-util/nm-setting-gsm.c:340
+#: ../libnm-util/nm-setting-gsm.c:349
+#: ../libnm-util/nm-setting-ip4-config.c:917
+#: ../libnm-util/nm-setting-ip4-config.c:926
+#: ../libnm-util/nm-setting-pppoe.c:171 ../libnm-util/nm-setting-pppoe.c:180
+#: ../libnm-util/nm-setting-vpn.c:433 ../libnm-util/nm-setting-vpn.c:443
+#: ../libnm-util/nm-setting-wimax.c:148
+#: ../libnm-util/nm-setting-wireless-security.c:922
+#: ../libnm-util/nm-setting-wireless-security.c:930
+#: ../libnm-util/nm-setting-wireless-security.c:954
msgid "property is empty"
msgstr "влаÑтивіÑÑ‚ÑŒ Ñ” порожньою"
-#: ../libnm-util/nm-setting-8021x.c:2315 ../libnm-util/nm-setting-8021x.c:2327
-#: ../libnm-util/nm-setting-8021x.c:2373 ../libnm-util/nm-setting-8021x.c:2385
+#: ../libnm-core/nm-setting-8021x.c:2310 ../libnm-core/nm-setting-8021x.c:2358
+#: ../libnm-util/nm-setting-8021x.c:2319 ../libnm-util/nm-setting-8021x.c:2331
+#: ../libnm-util/nm-setting-8021x.c:2377 ../libnm-util/nm-setting-8021x.c:2389
#, c-format
msgid "has to match '%s' property for PKCS#12"
msgstr "має відповідати влаÑтивоÑÑ‚Ñ– «%s» Ð´Ð»Ñ PKCS#12"
-#: ../libnm-util/nm-setting-8021x.c:2626 ../libnm-util/nm-setting-8021x.c:2660
-#: ../libnm-util/nm-setting-bluetooth.c:153
-#: ../libnm-util/nm-setting-bond.c:507
-#: ../libnm-util/nm-setting-infiniband.c:203
-#: ../libnm-util/nm-setting-infiniband.c:218
-#: ../libnm-util/nm-setting-ip4-config.c:943
-#: ../libnm-util/nm-setting-ip6-config.c:867
-#: ../libnm-util/nm-setting-olpc-mesh.c:155
-#: ../libnm-util/nm-setting-team.c:150 ../libnm-util/nm-setting-wimax.c:155
-#: ../libnm-util/nm-setting-wired.c:663 ../libnm-util/nm-setting-wired.c:672
-#: ../libnm-util/nm-setting-wireless-security.c:975
-#: ../libnm-util/nm-setting-wireless-security.c:984
-#: ../libnm-util/nm-setting-wireless-security.c:992
-#: ../libnm-util/nm-setting-wireless-security.c:1000
-#: ../libnm-util/nm-setting-wireless-security.c:1008
-#: ../libnm-util/nm-setting-wireless-security.c:1017
-#: ../libnm-util/nm-setting-wireless-security.c:1026
-#: ../libnm-util/nm-setting-wireless-security.c:1035
-#: ../libnm-util/nm-setting-wireless-security.c:1071
-#: ../libnm-util/nm-setting-wireless-security.c:1081
-#: ../libnm-util/nm-setting-wireless.c:813
-#: ../libnm-util/nm-setting-wireless.c:822
-#: ../libnm-util/nm-setting-wireless.c:831
+#: ../libnm-core/nm-setting-8021x.c:2603 ../libnm-core/nm-setting-8021x.c:2637
+#: ../libnm-core/nm-setting-bluetooth.c:130
+#: ../libnm-core/nm-setting-infiniband.c:193
+#: ../libnm-core/nm-setting-infiniband.c:208
+#: ../libnm-core/nm-setting-ip4-config.c:169
+#: ../libnm-core/nm-setting-ip6-config.c:166
+#: ../libnm-core/nm-setting-olpc-mesh.c:142
+#: ../libnm-core/nm-setting-wimax.c:135 ../libnm-core/nm-setting-wired.c:621
+#: ../libnm-core/nm-setting-wired.c:631
+#: ../libnm-core/nm-setting-wireless-security.c:943
+#: ../libnm-core/nm-setting-wireless-security.c:952
+#: ../libnm-core/nm-setting-wireless-security.c:960
+#: ../libnm-core/nm-setting-wireless-security.c:968
+#: ../libnm-core/nm-setting-wireless-security.c:976
+#: ../libnm-core/nm-setting-wireless-security.c:985
+#: ../libnm-core/nm-setting-wireless-security.c:994
+#: ../libnm-core/nm-setting-wireless-security.c:1003
+#: ../libnm-core/nm-setting-wireless-security.c:1039
+#: ../libnm-core/nm-setting-wireless-security.c:1049
+#: ../libnm-core/nm-setting-wireless.c:773
+#: ../libnm-core/nm-setting-wireless.c:782
+#: ../libnm-core/nm-setting-wireless.c:791 ../libnm-util/nm-setting.c:1376
+#: ../libnm-util/nm-setting.c:1394 ../libnm-util/nm-setting.c:1413
+#: ../libnm-util/nm-setting-8021x.c:2630 ../libnm-util/nm-setting-8021x.c:2664
+#: ../libnm-util/nm-setting-bluetooth.c:152
+#: ../libnm-util/nm-setting-infiniband.c:206
+#: ../libnm-util/nm-setting-infiniband.c:222
+#: ../libnm-util/nm-setting-ip4-config.c:908
+#: ../libnm-util/nm-setting-ip6-config.c:888
+#: ../libnm-util/nm-setting-olpc-mesh.c:152
+#: ../libnm-util/nm-setting-wimax.c:157 ../libnm-util/nm-setting-wired.c:662
+#: ../libnm-util/nm-setting-wired.c:671
+#: ../libnm-util/nm-setting-wireless-security.c:973
+#: ../libnm-util/nm-setting-wireless-security.c:982
+#: ../libnm-util/nm-setting-wireless-security.c:990
+#: ../libnm-util/nm-setting-wireless-security.c:998
+#: ../libnm-util/nm-setting-wireless-security.c:1006
+#: ../libnm-util/nm-setting-wireless-security.c:1015
+#: ../libnm-util/nm-setting-wireless-security.c:1024
+#: ../libnm-util/nm-setting-wireless-security.c:1033
+#: ../libnm-util/nm-setting-wireless-security.c:1069
+#: ../libnm-util/nm-setting-wireless-security.c:1079
+#: ../libnm-util/nm-setting-wireless.c:830
+#: ../libnm-util/nm-setting-wireless.c:839
+#: ../libnm-util/nm-setting-wireless.c:848
msgid "property is invalid"
msgstr "влаÑтивіÑÑ‚ÑŒ Ñ” некоректною"
-#: ../libnm-util/nm-setting-8021x.c:2685 ../libnm-util/nm-setting-8021x.c:2695
-#: ../libnm-util/nm-setting-8021x.c:2705 ../libnm-util/nm-setting-8021x.c:2715
-#: ../libnm-util/nm-setting-8021x.c:2725 ../libnm-util/nm-setting-adsl.c:239
+#: ../libnm-core/nm-setting-8021x.c:2662 ../libnm-core/nm-setting-8021x.c:2672
+#: ../libnm-core/nm-setting-8021x.c:2682 ../libnm-core/nm-setting-8021x.c:2692
+#: ../libnm-core/nm-setting-8021x.c:2702 ../libnm-core/nm-setting-adsl.c:218
+#: ../libnm-core/nm-setting-adsl.c:230
+#: ../libnm-core/nm-setting-bluetooth.c:147
+#: ../libnm-core/nm-setting-wireless-security.c:871
+#: ../libnm-util/nm-setting-8021x.c:2689 ../libnm-util/nm-setting-8021x.c:2699
+#: ../libnm-util/nm-setting-8021x.c:2709 ../libnm-util/nm-setting-8021x.c:2719
+#: ../libnm-util/nm-setting-8021x.c:2729 ../libnm-util/nm-setting-adsl.c:238
#: ../libnm-util/nm-setting-adsl.c:250
-#: ../libnm-util/nm-setting-bluetooth.c:170
-#: ../libnm-util/nm-setting-wireless-security.c:903
+#: ../libnm-util/nm-setting-bluetooth.c:169
+#: ../libnm-util/nm-setting-wireless-security.c:901
#, c-format
msgid "'%s' is not a valid value for the property"
msgstr "«%s» не Ñ” коректним значеннÑм влаÑтивоÑÑ‚Ñ–"
-#: ../libnm-util/nm-setting-bluetooth.c:188
+#: ../libnm-core/nm-setting-bluetooth.c:169
#, c-format
-msgid "requires '%s' or '%s' setting"
-msgstr "Ñлід вказати параметр «%s» або «%s»"
+msgid "'%s' connection requires '%s' or '%s' setting"
+msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» потребує параметра «%s» або «%s»"
-#: ../libnm-util/nm-setting-bond.c:518
+#: ../libnm-core/nm-setting-bond.c:455 ../libnm-util/nm-setting-bond.c:503
#, c-format
msgid "invalid option '%s' or its value '%s'"
msgstr "некоректний параметр «%s» або його Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»"
-#: ../libnm-util/nm-setting-bond.c:537
+#: ../libnm-core/nm-setting-bond.c:474 ../libnm-util/nm-setting-bond.c:522
#, c-format
msgid "only one of '%s' and '%s' can be set"
msgstr "можна вÑтановлювати лише одне з «%s» або «%s»"
-#: ../libnm-util/nm-setting-bond.c:548
+#: ../libnm-core/nm-setting-bond.c:486 ../libnm-util/nm-setting-bond.c:533
#, c-format
msgid "mandatory option '%s' is missing"
msgstr "пропущено обов’Ñзковий параметр «%s»"
-#: ../libnm-util/nm-setting-bond.c:557
+#: ../libnm-core/nm-setting-bond.c:496 ../libnm-util/nm-setting-bond.c:542
#, c-format
msgid "'%s' is not a valid value for '%s'"
msgstr "«%s» не Ñ” коректним значеннÑм «%s»"
-#: ../libnm-util/nm-setting-bond.c:570
+#: ../libnm-core/nm-setting-bond.c:510 ../libnm-util/nm-setting-bond.c:555
#, c-format
msgid "'%s=%s' is incompatible with '%s > 0'"
msgstr "«%s=%s» Ñ” неÑуміÑним з «%s > 0»"
-#: ../libnm-util/nm-setting-bond.c:583
+#: ../libnm-core/nm-setting-bond.c:523 ../libnm-util/nm-setting-bond.c:568
#, c-format
msgid "'%s' is not a valid interface name for '%s' option"
msgstr "«%s» не Ñ” коректною назвою інтерфейÑу Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s»"
-#: ../libnm-util/nm-setting-bond.c:593
+#: ../libnm-core/nm-setting-bond.c:533 ../libnm-util/nm-setting-bond.c:578
#, c-format
msgid "'%s' option is only valid for '%s=%s'"
msgstr "параметр «%s» можна викориÑтовувати, лише Ñкщо «%s=%s»"
-#: ../libnm-util/nm-setting-bond.c:606
+#: ../libnm-core/nm-setting-bond.c:546 ../libnm-util/nm-setting-bond.c:591
#, c-format
msgid "'%s=%s' is not a valid configuration for '%s'"
msgstr "«%s=%s» не Ñ” коректним налаштуваннÑм Ð´Ð»Ñ Â«%s»"
-#: ../libnm-util/nm-setting-bond.c:619 ../libnm-util/nm-setting-bond.c:628
-#: ../libnm-util/nm-setting-bond.c:648 ../libnm-util/nm-setting-bond.c:684
+#: ../libnm-core/nm-setting-bond.c:559 ../libnm-core/nm-setting-bond.c:568
+#: ../libnm-core/nm-setting-bond.c:588 ../libnm-core/nm-setting-bond.c:624
+#: ../libnm-util/nm-setting-bond.c:604 ../libnm-util/nm-setting-bond.c:613
+#: ../libnm-util/nm-setting-bond.c:633 ../libnm-util/nm-setting-bond.c:669
#, c-format
msgid "'%s' option requires '%s' option to be set"
msgstr "викориÑÑ‚Ð°Ð½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s» вимагає вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s»"
-#: ../libnm-util/nm-setting-bond.c:659
+#: ../libnm-core/nm-setting-bond.c:599 ../libnm-util/nm-setting-bond.c:644
#, c-format
msgid "'%s' option is empty"
msgstr "параметр «%s» є порожнім"
-#: ../libnm-util/nm-setting-bond.c:671
+#: ../libnm-core/nm-setting-bond.c:611 ../libnm-util/nm-setting-bond.c:656
#, c-format
msgid "'%s' is not a valid IPv4 address for '%s' option"
msgstr "«%s» не Ñ” припуÑтимою адреÑою IPv4 Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s»"
+#: ../libnm-core/nm-setting-bond.c:638 ../libnm-util/nm-setting-bond.c:683
+#, c-format
+msgid "'%s' option is only valid with mode '%s'"
+msgstr "параметр «%s» є коректним лише у режимі «%s»"
+
+#: ../libnm-core/nm-setting-bond.c:653
+#, c-format
+#| msgid "'%s' option is empty"
+msgid "'%s' option should be string"
+msgstr "параметр «%s» має бути Ñ€Ñдком"
+
+#: ../libnm-core/nm-setting-bridge-port.c:125
+#: ../libnm-core/nm-setting-bridge-port.c:137
#: ../libnm-util/nm-setting-bridge-port.c:155
#: ../libnm-util/nm-setting-bridge-port.c:167
#, c-format
msgid "'%d' is not a valid value for the property (should be <= %d)"
msgstr "«%d» Ñ” некоректним значеннÑм влаÑтивоÑÑ‚Ñ– (має бути <= %d)"
-#: ../libnm-util/nm-setting-bridge.c:270
+#: ../libnm-core/nm-setting-bridge-port.c:155
+#: ../libnm-core/nm-setting-team-port.c:98
+#, c-format
+msgid "missing setting"
+msgstr "пропущено параметр"
+
+#: ../libnm-core/nm-setting-bridge-port.c:166
+#: ../libnm-core/nm-setting-team-port.c:109
+#, c-format
+msgid ""
+"A connection with a '%s' setting must have the slave-type set to '%s'. "
+"Instead it is '%s'"
+msgstr ""
+"Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· параметром «%s» має бути вÑтановлено тип підлеглоÑÑ‚Ñ– «%s». "
+"ЗаміÑÑ‚ÑŒ цього маємо «%s»."
+
+#: ../libnm-core/nm-setting-bridge.c:210 ../libnm-util/nm-setting-bridge.c:270
#, c-format
msgid "value '%d' is out of range <%d-%d>"
msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%d» лежить поза діапазоном <%d-%d>"
-#: ../libnm-util/nm-setting-bridge.c:306 ../libnm-util/nm-setting-wired.c:638
-#: ../libnm-util/nm-setting-wired.c:696
+#: ../libnm-core/nm-setting-bridge.c:227 ../libnm-core/nm-setting-wired.c:595
+#: ../libnm-core/nm-setting-wired.c:655 ../libnm-util/nm-setting-bridge.c:287
+#: ../libnm-util/nm-setting-wired.c:637 ../libnm-util/nm-setting-wired.c:695
msgid "is not a valid MAC address"
msgstr "не Ñ” коректною MAC-адреÑою"
-#: ../libnm-util/nm-setting-cdma.c:170
+#: ../libnm-core/nm-setting-cdma.c:149 ../libnm-util/nm-setting-cdma.c:170
msgid "property is empty'"
msgstr "влаÑтивіÑÑ‚ÑŒ Ñ” порожньою"
-#: ../libnm-util/nm-setting-connection.c:812
+#: ../libnm-core/nm-setting-connection.c:747
#, c-format
-msgid "'%s' doesn't match the virtual interface name '%s'"
-msgstr "«%s» не відповідає назві віртуального інтерфейÑу «%s»"
+msgid "setting required for connection of type '%s'"
+msgstr "Ð´Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ‚Ð¸Ð¿Ñƒ «%s» потрібен параметр"
-#: ../libnm-util/nm-setting-connection.c:858
+#: ../libnm-core/nm-setting-connection.c:828
#, c-format
-msgid "requires presence of '%s' setting in the connection"
-msgstr "потребує Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s» у параметрах з’єднаннÑ"
+msgid "connection type '%s' is not valid"
+msgstr "тип Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» Ñ” некоректним"
+
+#: ../libnm-core/nm-setting-connection.c:863
+#: ../libnm-util/nm-setting-connection.c:878
+#, c-format
+msgid "Unknown slave type '%s'"
+msgstr "Ðевідомий тип підлеглого «%s»"
+
+#: ../libnm-core/nm-setting-connection.c:873
+#, c-format
+msgid "Slave connections need a valid '%s' property"
+msgstr "Ð”Ð»Ñ Ð¿Ñ–Ð´Ð»ÐµÐ³Ð»Ð¸Ñ… з’єднань потрібна коректна влаÑтивіÑÑ‚ÑŒ «%s»"
-#: ../libnm-util/nm-setting-connection.c:880
-msgid "IPv4 configuration is not allowed for slave"
-msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚Ð¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ IPv4 Ð´Ð»Ñ Ð¿Ñ–Ð´Ð»ÐµÐ³Ð»Ð¾Ð³Ð¾ приÑтрою неможливе"
+#: ../libnm-core/nm-setting-connection.c:894
+#, c-format
+msgid "Cannot set '%s' without '%s'"
+msgstr "Ðе можна вÑтановити «%s» без «%s»"
-#: ../libnm-util/nm-setting-connection.c:893
-msgid "IPv6 configuration is not allowed for slave"
-msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚Ð¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ IPv6 Ð´Ð»Ñ Ð¿Ñ–Ð´Ð»ÐµÐ³Ð»Ð¾Ð³Ð¾ приÑтрою неможливе"
+#: ../libnm-core/nm-setting-connection.c:917
+#, c-format
+msgid "property type should be set to '%s'"
+msgstr "тип влаÑтивоÑÑ‚Ñ– має бути вÑтановлено у Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»"
+
+#: ../libnm-core/nm-setting-connection.c:932
+#, c-format
+msgid "slave-type '%s' requires a '%s' setting in the connection"
+msgstr "тип підлеглого Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» потребує параметра «%s» у з’єднанні"
+
+#: ../libnm-core/nm-setting-connection.c:942
+#, c-format
+msgid ""
+"Detect a slave connection with '%s' set and a port type '%s'. '%s' should be "
+"set to '%s'"
+msgstr ""
+"Визначити підлегле Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð·Ñ– вÑтановленим «%s» Ñ– типом порту «%s». «%s» "
+"Ñлід вÑтановити у Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»"
-#: ../libnm-util/nm-setting-dcb.c:595
+#: ../libnm-core/nm-setting-dcb.c:523 ../libnm-util/nm-setting-dcb.c:595
msgid "flags invalid"
msgstr "некоректні прапорці"
-#: ../libnm-util/nm-setting-dcb.c:604
+#: ../libnm-core/nm-setting-dcb.c:532 ../libnm-util/nm-setting-dcb.c:604
msgid "flags invalid - disabled"
msgstr "некоректні прапорці — вимкнено"
+#: ../libnm-core/nm-setting-dcb.c:558 ../libnm-core/nm-setting-dcb.c:607
#: ../libnm-util/nm-setting-dcb.c:630 ../libnm-util/nm-setting-dcb.c:679
msgid "property invalid (not enabled)"
msgstr "влаÑтивіÑÑ‚ÑŒ Ñ” некоректною (не увімкнено)"
-#: ../libnm-util/nm-setting-dcb.c:639
+#: ../libnm-core/nm-setting-dcb.c:567 ../libnm-util/nm-setting-dcb.c:639
msgid "element invalid"
msgstr "некоректний елемент"
-#: ../libnm-util/nm-setting-dcb.c:654
+#: ../libnm-core/nm-setting-dcb.c:582 ../libnm-util/nm-setting-dcb.c:654
msgid "sum not 100%"
msgstr "Ñума не дорівнює 100%"
+#: ../libnm-core/nm-setting-dcb.c:616 ../libnm-core/nm-setting-dcb.c:648
#: ../libnm-util/nm-setting-dcb.c:688 ../libnm-util/nm-setting-dcb.c:720
msgid "property invalid"
msgstr "некоректна влаÑтивіÑÑ‚ÑŒ"
-#: ../libnm-util/nm-setting-dcb.c:710
+#: ../libnm-core/nm-setting-dcb.c:638 ../libnm-util/nm-setting-dcb.c:710
msgid "property missing"
msgstr "пропущено влаÑтивіÑÑ‚ÑŒ"
-#: ../libnm-util/nm-setting-gsm.c:297
+#: ../libnm-core/nm-setting-gsm.c:239 ../libnm-util/nm-setting-gsm.c:296
#, c-format
msgid "property value '%s' is empty or too long (>64)"
msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ–, «%s», Ñ” порожнім або надто довгим (>64)"
-#: ../libnm-util/nm-setting-gsm.c:329
+#: ../libnm-core/nm-setting-gsm.c:271 ../libnm-util/nm-setting-gsm.c:328
#, c-format
msgid "'%s' contains invalid char(s) (use [A-Za-z._-])"
msgstr "«%s» міÑтить некоректні Ñимволи (Ñлід викориÑтовувати [A-Za-z._-])"
-#: ../libnm-util/nm-setting-gsm.c:364
+#: ../libnm-core/nm-setting-gsm.c:306 ../libnm-util/nm-setting-gsm.c:363
#, c-format
msgid "'%s' length is invalid (should be 5 or 6 digits)"
msgstr "довжина «%s» є некоректною (має бути 5 або 6 цифр)"
-#: ../libnm-util/nm-setting-infiniband.c:228
+#: ../libnm-core/nm-setting-infiniband.c:218
+#: ../libnm-util/nm-setting-infiniband.c:232
msgid "not a valid interface name"
msgstr "не Ñ” коректною назвою інтерфейÑу"
-#: ../libnm-util/nm-setting-infiniband.c:236
+#: ../libnm-core/nm-setting-infiniband.c:226
+#: ../libnm-util/nm-setting-infiniband.c:240
msgid "Must specify a P_Key if specifying parent"
msgstr "Якщо вказано параметр parent, Ñлід вказати Ñ– P_Key"
-#: ../libnm-util/nm-setting-infiniband.c:246
+#: ../libnm-core/nm-setting-infiniband.c:236
+#: ../libnm-util/nm-setting-infiniband.c:250
msgid "InfiniBand P_Key connection did not specify parent interface name"
msgstr ""
"У запиÑÑ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¾Ð³Ð¾ ключа InfiniBand не вказано назви батьківÑького "
"інтерфейÑу"
-#: ../libnm-util/nm-setting-ip4-config.c:897
-#: ../libnm-util/nm-setting-ip6-config.c:822
+#: ../libnm-core/nm-setting-infiniband.c:272
+#: ../libnm-util/nm-setting-infiniband.c:286
#, c-format
-msgid "this property cannot be empty for '%s=%s'"
-msgstr "Ñ†Ñ Ð²Ð»Ð°ÑтивіÑÑ‚ÑŒ не може бути порожньою, Ñкщо «%s=%s»"
+msgid ""
+"interface name of software infiniband device must be '%s' or unset (instead "
+"it is '%s')"
+msgstr ""
+"назвою інтерфейÑу програмного приÑтрою infiniband має бути «%s» або назву "
+"має бути не вÑтановлено (заміÑÑ‚ÑŒ неї має бути «%s»)"
-#: ../libnm-util/nm-setting-ip4-config.c:909
-#: ../libnm-util/nm-setting-ip4-config.c:919
-#: ../libnm-util/nm-setting-ip4-config.c:931
-#: ../libnm-util/nm-setting-ip6-config.c:835
-#: ../libnm-util/nm-setting-ip6-config.c:845
-#: ../libnm-util/nm-setting-ip6-config.c:855
+#: ../libnm-core/nm-setting-infiniband.c:287
#, c-format
-msgid "this property is not allowed for '%s=%s'"
-msgstr "цю влаÑтивіÑÑ‚ÑŒ не можна заÑтоÑовувати до «%s=%s»"
+msgid "mtu for transport mode '%s' can be at most %d but it is %d"
+msgstr "mtu Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ñƒ Ð¿ÐµÑ€ÐµÐ´Ð°Ð²Ð°Ð½Ð½Ñ Â«%s» має не перевищувати %d, але маємо %d"
-#: ../libnm-util/nm-setting-ip4-config.c:978
+#: ../libnm-core/nm-setting-ip-config.c:79
#, c-format
-msgid "%d. IPv4 address is invalid"
-msgstr "%d. ÐдреÑа IPv4 Ñ” некоректною"
+msgid "Invalid IPv4 address '%s'"
+msgstr "Ðекоректна адреÑа IPv4, «%s»"
-#: ../libnm-util/nm-setting-ip4-config.c:988
+#: ../libnm-core/nm-setting-ip-config.c:79
#, c-format
-msgid "%d. IPv4 address has invalid prefix"
-msgstr "%d. ÐдреÑа IPv4 має некоректний префікÑ"
+msgid "Invalid IPv6 address '%s"
+msgstr "некоректна адреÑа IPv6, «%s»"
+
+#: ../libnm-core/nm-setting-ip-config.c:93
+#, c-format
+msgid "Invalid IPv4 address prefix '%u'"
+msgstr "Ðекоректний Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð°Ð´Ñ€ÐµÑи IPv4, «%u»"
+
+#: ../libnm-core/nm-setting-ip-config.c:93
+#, c-format
+msgid "Invalid IPv6 address prefix '%u"
+msgstr "Ðекоректний Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð°Ð´Ñ€ÐµÑи IPv6, «%u»"
+
+#: ../libnm-core/nm-setting-ip-config.c:111
+#, c-format
+msgid "Invalid routing metric '%s'"
+msgstr "Ðекоректна метрика маршрутизації, «%s»"
+
+#: ../libnm-core/nm-setting-ip-config.c:1861
+#, c-format
+msgid "%d. DNS server address is invalid"
+msgstr "%d. ÐдреÑа Ñервера DNS Ñ” некоректною."
-#: ../libnm-util/nm-setting-ip4-config.c:998
+#: ../libnm-core/nm-setting-ip-config.c:1877
#, c-format
-#| msgid "%d. IPv4 address has invalid prefix"
-msgid "%d. IPv4 address has invalid label '%s'"
-msgstr "%d. ÐдреÑа IPv4 має некоректну мітку, «%s»"
+msgid "%d. IP address is invalid"
+msgstr "%d. IP-адреÑа Ñ” некоректною."
-#: ../libnm-util/nm-setting-ip4-config.c:1009
+#: ../libnm-core/nm-setting-ip-config.c:1889
#, c-format
-msgid "IPv4 address / label count mismatch (%d vs %d)"
-msgstr "ÐевідповідніÑÑ‚ÑŒ кількоÑÑ‚Ñ– Ð°Ð´Ñ€ÐµÑ IPv4 Ñ– кількоÑÑ‚Ñ– міток (%d Ñ– %d)"
+msgid "%d. IP address has 'label' property with invalid type"
+msgstr "%d. IP-адреÑа має влаÑтивіÑÑ‚ÑŒ «label» некоректного типу"
-#: ../libnm-util/nm-setting-ip4-config.c:1025
+#: ../libnm-core/nm-setting-ip-config.c:1898
+#, c-format
+msgid "%d. IP address has invalid label '%s'"
+msgstr "%d. IP-адреÑа має некоректну мітку, «%s»"
+
+#: ../libnm-core/nm-setting-ip-config.c:1912
+msgid "gateway cannot be set if there are no addresses configured"
+msgstr "шлюз не може бути вÑтановлено, Ñкщо не налаштовано адреÑ"
+
+#: ../libnm-core/nm-setting-ip-config.c:1921
+msgid "gateway is invalid"
+msgstr "шлюз є некоректним"
+
+#: ../libnm-core/nm-setting-ip-config.c:1935
+#: ../libnm-util/nm-setting-ip4-config.c:966
#, c-format
msgid "%d. route is invalid"
msgstr "%d. Ðекоректний маршрут"
-#: ../libnm-util/nm-setting-ip4-config.c:1035
+#: ../libnm-core/nm-setting-ip-config.c:1944
#, c-format
-msgid "%d. route has invalid prefix"
-msgstr "%d. Маршрут має некоректний префікÑ"
+msgid "%d. route cannot be a default route"
+msgstr "%d. Маршрут не може бути типовим."
+
+#: ../libnm-core/nm-setting-ip4-config.c:123
+#: ../libnm-core/nm-setting-ip6-config.c:121
+#: ../libnm-util/nm-setting-ip4-config.c:862
+#: ../libnm-util/nm-setting-ip6-config.c:843
+#, c-format
+msgid "this property cannot be empty for '%s=%s'"
+msgstr "Ñ†Ñ Ð²Ð»Ð°ÑтивіÑÑ‚ÑŒ не може бути порожньою, Ñкщо «%s=%s»"
-#: ../libnm-util/nm-setting-ip6-config.c:834
+#: ../libnm-core/nm-setting-ip4-config.c:135
+#: ../libnm-core/nm-setting-ip4-config.c:145
+#: ../libnm-core/nm-setting-ip4-config.c:157
+#: ../libnm-core/nm-setting-ip6-config.c:134
+#: ../libnm-core/nm-setting-ip6-config.c:144
+#: ../libnm-core/nm-setting-ip6-config.c:154
+#: ../libnm-util/nm-setting-ip4-config.c:874
+#: ../libnm-util/nm-setting-ip4-config.c:884
+#: ../libnm-util/nm-setting-ip4-config.c:896
+#: ../libnm-util/nm-setting-ip6-config.c:856
+#: ../libnm-util/nm-setting-ip6-config.c:866
+#: ../libnm-util/nm-setting-ip6-config.c:876
+#, c-format
+msgid "this property is not allowed for '%s=%s'"
+msgstr "цю влаÑтивіÑÑ‚ÑŒ не можна заÑтоÑовувати до «%s=%s»"
+
+#: ../libnm-core/nm-setting-ip6-config.c:133
+#: ../libnm-util/nm-setting-ip6-config.c:855
#, c-format
msgid "'%s' not allowed for %s=%s"
msgstr "«%s» не можна викориÑтовувати Ð´Ð»Ñ %s=%s"
-#: ../libnm-util/nm-setting-olpc-mesh.c:136
-#: ../libnm-util/nm-setting-wireless.c:762
+#: ../libnm-core/nm-setting-olpc-mesh.c:123
+#: ../libnm-core/nm-setting-wireless.c:722
+#: ../libnm-util/nm-setting-olpc-mesh.c:133
+#: ../libnm-util/nm-setting-wireless.c:779
msgid "SSID length is out of range <1-32> bytes"
msgstr "Довжина SSID лежить поза діапазоном у <1-32> байтів"
-#: ../libnm-util/nm-setting-olpc-mesh.c:145
-#: ../libnm-util/nm-setting-wireless.c:802
+#: ../libnm-core/nm-setting-olpc-mesh.c:132
+#: ../libnm-core/nm-setting-wireless.c:762
+#: ../libnm-util/nm-setting-olpc-mesh.c:142
+#: ../libnm-util/nm-setting-wireless.c:819
#, c-format
msgid "'%d' is not a valid channel"
msgstr "«%d» не є коректним каналом"
-#: ../libnm-util/nm-setting-ppp.c:390
+#: ../libnm-core/nm-setting-ppp.c:367 ../libnm-util/nm-setting-ppp.c:389
#, c-format
msgid "'%d' is out of valid range <128-16384>"
msgstr "«%d» не належить до коректного діапазону <128-16384>"
-#: ../libnm-util/nm-setting-ppp.c:403
+#: ../libnm-core/nm-setting-ppp.c:380 ../libnm-util/nm-setting-ppp.c:402
#, c-format
msgid "setting this property requires non-zero '%s' property"
msgstr ""
"вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ†Ñ–Ñ”Ñ— влаÑтивоÑÑ‚Ñ– вимагає ненульового Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– «%s»"
-#: ../libnm-util/nm-setting-vlan.c:570
+#: ../libnm-core/nm-setting-vlan.c:516 ../libnm-util/nm-setting-vlan.c:557
#, c-format
msgid "'%s' value doesn't match '%s=%s'"
msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s» не відповідає «%s=%s»"
-#: ../libnm-util/nm-setting-vlan.c:581
+#: ../libnm-core/nm-setting-vlan.c:527 ../libnm-util/nm-setting-vlan.c:568
#, c-format
msgid "'%s' is neither an UUID nor an interface name"
msgstr "«%s» не Ñ” ні UUID, ні назвою інтерфейÑу"
-#: ../libnm-util/nm-setting-vlan.c:594
+#: ../libnm-core/nm-setting-vlan.c:541 ../libnm-util/nm-setting-vlan.c:581
#, c-format
msgid "property is not specified and neither is '%s:%s'"
msgstr "влаÑтивіÑÑ‚ÑŒ не вказано Ñ– не визначено «%s:%s»"
-#: ../libnm-util/nm-setting-vlan.c:607
+#: ../libnm-core/nm-setting-vlan.c:554 ../libnm-util/nm-setting-vlan.c:594
msgid "flags are invalid"
msgstr "прапорці є некоректними"
-#: ../libnm-util/nm-setting-wired.c:618
+#: ../libnm-core/nm-setting-vpn.c:441
+#, c-format
+msgid "secret was empty"
+msgstr "пароль є порожнім"
+
+#: ../libnm-core/nm-setting-vpn.c:471
+msgid "setting contained a secret with an empty name"
+msgstr "параметри міÑтив пароль з порожньою назвою"
+
+#: ../libnm-core/nm-setting-vpn.c:479
+#, c-format
+msgid "secret value was empty"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ Ñ” порожнім"
+
+#: ../libnm-core/nm-setting-vpn.c:526 ../libnm-core/nm-setting.c:1607
+msgid "not a secret property"
+msgstr "не Ñ” влаÑтивіÑÑ‚ÑŽ паролÑ"
+
+#: ../libnm-core/nm-setting-vpn.c:532
+msgid "secret is not of correct type"
+msgstr "пароль не належить до коректного типу"
+
+#: ../libnm-core/nm-setting-vpn.c:567
+#, c-format
+msgid "failed to convert value '%s' to uint"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s» на uint"
+
+#: ../libnm-core/nm-setting-vpn.c:575
+msgid "secret flags property not found"
+msgstr "влаÑтивоÑÑ‚Ñ– прапорців паролів не знайдено"
+
+#: ../libnm-core/nm-setting-wired.c:575 ../libnm-util/nm-setting-wired.c:617
#, c-format
-#| msgid "'%s' is not a valid ethernet port value"
msgid "'%s' is not a valid Ethernet port value"
msgstr "«%s» не Ñ” коректним значеннÑм номера порту Ethernet"
-#: ../libnm-util/nm-setting-wired.c:628
+#: ../libnm-core/nm-setting-wired.c:585 ../libnm-util/nm-setting-wired.c:627
#, c-format
msgid "'%s' is not a valid duplex value"
msgstr "«%s» не Ñ” коректним значеннÑм дуплекÑного режиму"
-#: ../libnm-util/nm-setting-wired.c:685
+#: ../libnm-core/nm-setting-wired.c:644 ../libnm-util/nm-setting-wired.c:684
#, c-format
msgid "invalid '%s' or its value '%s'"
msgstr "некоректний «%s» або його Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s»"
-#: ../libnm-util/nm-setting-wireless-security.c:915
+#: ../libnm-core/nm-setting-wireless-security.c:883
+#: ../libnm-util/nm-setting-wireless-security.c:913
#, c-format
msgid "'%s' security requires '%s=%s'"
msgstr "Ð´Ð»Ñ Ð·Ð°Ñ…Ð¸Ñту «%s» Ñлід вказати «%s=%s»"
-#: ../libnm-util/nm-setting-wireless-security.c:944
+#: ../libnm-core/nm-setting-wireless-security.c:912
+#: ../libnm-util/nm-setting-wireless-security.c:942
#, c-format
msgid "'%s' security requires '%s' setting presence"
msgstr "захиÑÑ‚ «%s» вимагає викориÑÑ‚Ð°Ð½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° «%s»"
-#: ../libnm-util/nm-setting-wireless-security.c:965
+#: ../libnm-core/nm-setting-wireless-security.c:933
+#: ../libnm-util/nm-setting-wireless-security.c:963
#, c-format
msgid "'%d' value is out of range <0-3>"
msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%d» лежить поза діапазоном <0-3>"
-#: ../libnm-util/nm-setting-wireless-security.c:1062
+#: ../libnm-core/nm-setting-wireless-security.c:1030
+#: ../libnm-util/nm-setting-wireless-security.c:1060
#, c-format
msgid "'%s' connections require '%s' in this property"
msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» потребують «%s» у цій влаÑтивоÑÑ‚Ñ–"
-#: ../libnm-util/nm-setting-wireless-security.c:1092
+#: ../libnm-core/nm-setting-wireless-security.c:1060
+#: ../libnm-util/nm-setting-wireless-security.c:1090
#, c-format
msgid "'%s' can only be used with '%s=%s' (WEP)"
msgstr "«%s» можна викориÑтовувати лише з «%s=%s» (WEP)"
-#: ../libnm-util/nm-setting-wireless.c:771
+#: ../libnm-core/nm-setting-wireless.c:731
+#: ../libnm-util/nm-setting-wireless.c:788
#, c-format
msgid "'%s' is not a valid Wi-Fi mode"
msgstr "«%s» не є коректним режимом Wi-Fi"
-#: ../libnm-util/nm-setting-wireless.c:781
+#: ../libnm-core/nm-setting-wireless.c:741
+#: ../libnm-util/nm-setting-wireless.c:798
#, c-format
msgid "'%s' is not a valid band"
msgstr "«%s» не Ñ” коректним значеннÑм Ñмуги"
-#: ../libnm-util/nm-setting-wireless.c:791
+#: ../libnm-core/nm-setting-wireless.c:751
+#, c-format
+msgid "'%s' requires setting '%s' property"
+msgstr "«%s» потребує вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– «%s»"
+
+#: ../libnm-core/nm-setting.c:827
+#, c-format
+msgid "can't set property of type '%s' from value of type '%s'"
+msgstr "не вдалоÑÑ Ð²Ñтановити влаÑтивіÑÑ‚ÑŒ типу «%s» зі Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ‚Ð¸Ð¿Ñƒ «%s»"
+
+#: ../libnm-core/nm-setting.c:1505
+msgid "secret not found"
+msgstr "не знайдено ключа"
+
+#: ../libnm-core/nm-setting.c:1597
+msgid "secret is not set"
+msgstr "пароль не вÑтановлено"
+
+#: ../libnm-core/nm-utils.c:2275 ../libnm-util/nm-utils.c:1813
+#, c-format
+msgid "Could not find \"%s\" binary"
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ виконуваний файл «%s»"
+
+#: ../libnm-glib/nm-device.c:1793 ../libnm/nm-device.c:1615
+msgid "Bluetooth"
+msgstr "Bluetooth"
+
+#: ../libnm-glib/nm-device.c:1811 ../libnm/nm-device.c:1633
+msgid "ADSL"
+msgstr "ADSL"
+
+#: ../libnm-glib/nm-device.c:1839 ../libnm/nm-device.c:1661
+msgid "Wired"
+msgstr "Дротове"
+
+#: ../libnm-glib/nm-device.c:1870 ../libnm/nm-device.c:1692
+msgid "PCI"
+msgstr "PCI"
+
+#: ../libnm-glib/nm-device.c:1872 ../libnm/nm-device.c:1694
+msgid "USB"
+msgstr "USB"
+
+#. Translators: the first %s is a bus name (eg, "USB") or
+#. * product name, the second is a device type (eg,
+#. * "Ethernet"). You can change this to something like
+#. * "%2$s (%1$s)" if there's no grammatical way to combine
+#. * the strings otherwise.
+#.
+#: ../libnm-glib/nm-device.c:1968 ../libnm-glib/nm-device.c:1987
+#: ../libnm/nm-device.c:1788 ../libnm/nm-device.c:1807
+#, c-format
+msgctxt "long device name"
+msgid "%s %s"
+msgstr "%s %s"
+
+#: ../libnm-glib/nm-remote-connection.c:151
+msgid "Disconnected by D-Bus"
+msgstr "Від’єднано D-Bus"
+
+#: ../libnm-util/crypto_gnutls.c:88
+#, c-format
+msgid "Failed to initialize the MD5 engine: %s / %s."
+msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ рушій обчиÑÐ»ÐµÐ½Ð½Ñ MD5: %s / %s."
+
+#: ../libnm-util/crypto_nss.c:102
+#, c-format
+msgid "Failed to initialize the MD5 context: %d."
+msgstr "Ðе вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ контекÑÑ‚ MD5: %d."
+
+#: ../libnm-util/crypto_nss.c:463
+#, c-format
+msgid "Couldn't convert password to UCS2: %d"
+msgstr "Ðе вдалоÑÑ Ð·Ð¼Ñ–Ð½Ð¸Ñ‚Ð¸ ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð½Ð° UCS2: %d"
+
+#: ../libnm-util/nm-setting-bluetooth.c:187
+#, c-format
+msgid "requires '%s' or '%s' setting"
+msgstr "Ñлід вказати параметр «%s» або «%s»"
+
+#: ../libnm-util/nm-setting-connection.c:863
+#, c-format
+msgid "requires presence of '%s' setting in the connection"
+msgstr "потребує Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%s» у параметрах з’єднаннÑ"
+
+#: ../libnm-util/nm-setting-connection.c:888
+msgid "Slave connections need a valid '"
+msgstr "Ð”Ð»Ñ Ð¿Ñ–Ð´Ð»ÐµÐ³Ð»Ð¸Ñ… з’єднань потрібна коректна влаÑтивіÑÑ‚ÑŒ «"
+
+#: ../libnm-util/nm-setting-connection.c:897
+msgid "Cannot set '"
+msgstr "Ðе вдалоÑÑ Ð²Ñтановити «"
+
+#: ../libnm-util/nm-setting-ip4-config.c:940
+#, c-format
+msgid "%d. IPv4 address is invalid"
+msgstr "%d. ÐдреÑа IPv4 Ñ” некоректною"
+
+#: ../libnm-util/nm-setting-ip4-config.c:950
+#, c-format
+msgid "%d. IPv4 address has invalid prefix"
+msgstr "%d. ÐдреÑа IPv4 має некоректний префікÑ"
+
+#: ../libnm-util/nm-setting-ip4-config.c:976
+#, c-format
+msgid "%d. route has invalid prefix"
+msgstr "%d. Маршрут має некоректний префікÑ"
+
+#: ../libnm-util/nm-setting-vpn.c:583
+#, c-format
+msgid "Failed to convert '%s' value '%s' to uint"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«%2$s» «%1$s» на uint"
+
+#: ../libnm-util/nm-setting-vpn.c:590
+#, c-format
+msgid "Secret flags property '%s' not found"
+msgstr "ВлаÑтивіÑÑ‚ÑŒ прапорців паролів «%s» не знайдено"
+
+#: ../libnm-util/nm-setting-wireless.c:808
#, c-format
msgid "requires setting '%s' property"
msgstr "потребує вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑÑ‚Ñ– «%s»"
+#: ../libnm/nm-device-adsl.c:73
+msgid "The connection was not an ADSL connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм ADSL."
+
+#: ../libnm/nm-device-bond.c:115
+msgid "The connection was not a bond connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм зв’Ñзку."
+
+#: ../libnm/nm-device-bridge.c:115
+msgid "The connection was not a bridge connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм міÑтка."
+
+#: ../libnm/nm-device-bt.c:140
+#, c-format
+msgid "The connection was not a Bluetooth connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм Bluetooth."
+
+#: ../libnm/nm-device-bt.c:149
+msgid "Invalid device Bluetooth address."
+msgstr "Ðекоректна адреÑа Bluetooth приÑтрою."
+
+#: ../libnm/nm-device-bt.c:156
+msgid "The Bluetooth addresses of the device and the connection didn't match."
+msgstr "ÐдреÑи Bluetooth приÑтрою Ñ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ збігаютьÑÑ."
+
+#: ../libnm/nm-device-bt.c:165
+msgid ""
+"The device is lacking Bluetooth capabilities required by the connection."
+msgstr "У приÑтрою немає можливоÑтей Bluetooth, потрібних з’єднанню."
+
+#: ../libnm/nm-device-ethernet.c:138
+msgid "The connection was not an Ethernet or PPPoE connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм Ethernet або PPPoE."
+
+#: ../libnm/nm-device-ethernet.c:154 ../libnm/nm-device-infiniband.c:105
+#: ../libnm/nm-device-wifi.c:492 ../libnm/nm-device-wimax.c:311
+msgid "Invalid device MAC address."
+msgstr "Ðекоректна MAC-адреÑа приÑтрою."
+
+#: ../libnm/nm-device-ethernet.c:160 ../libnm/nm-device-infiniband.c:113
+#: ../libnm/nm-device-wifi.c:499 ../libnm/nm-device-wimax.c:318
+msgid "The MACs of the device and the connection didn't match."
+msgstr "ÐдреÑи MAC приÑтрою Ñ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ збігаютьÑÑ."
+
+#: ../libnm/nm-device-generic.c:92
+msgid "The connection was not a generic connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” загальним з’єднаннÑм."
+
+#: ../libnm/nm-device-generic.c:99
+msgid "The connection did not specify an interface name."
+msgstr "У запиÑÑ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ вказано назви інтерфейÑу."
+
+#: ../libnm/nm-device-infiniband.c:97
+msgid "The connection was not an InfiniBand connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм InfiniBand."
+
+#: ../libnm/nm-device-modem.c:123
+msgid "The connection was not a modem connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” модемним з’єднаннÑм."
+
+#: ../libnm/nm-device-modem.c:131
+msgid "The connection was not a valid modem connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” коректним модемним з’єднаннÑм."
+
+#: ../libnm/nm-device-modem.c:138
+msgid "The device is lacking capabilities required by the connection."
+msgstr "У приÑтрою немає можливоÑтей, потрібних з’єднанню."
+
+#: ../libnm/nm-device-olpc-mesh.c:118
+msgid "The connection was not an OLPC Mesh connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм OLPC Mesh."
+
+#: ../libnm/nm-device-team.c:121
+msgid "The connection was not a team connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” командним з’єднаннÑм."
+
+#: ../libnm/nm-device-vlan.c:131
+msgid "The connection was not a VLAN connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм VLAN."
+
+#: ../libnm/nm-device-vlan.c:138
+msgid "The VLAN identifiers of the device and the connection didn't match."
+msgstr "Ідентифікатори VLAN приÑтрою Ñ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ збігаютьÑÑ."
+
+#: ../libnm/nm-device-vlan.c:151
+msgid "The hardware address of the device and the connection didn't match."
+msgstr "Ðпаратні адреÑи приÑтрою Ñ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ збігаютьÑÑ."
+
+#: ../libnm/nm-device-wifi.c:483
+msgid "The connection was not a Wi-Fi connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм Wi-Fi."
+
+#: ../libnm/nm-device-wifi.c:519
+msgid "The device is lacking WPA capabilities required by the connection."
+msgstr "У приÑтрою немає можливоÑтей WPA, потрібних з’єднанню."
+
+#: ../libnm/nm-device-wifi.c:526
+msgid "The device is lacking WPA2/RSN capabilities required by the connection."
+msgstr "У приÑтрою немає можливоÑтей WPA2/RSN, потрібних з’єднанню."
+
+#: ../libnm/nm-device-wimax.c:302
+msgid "The connection was not a WiMAX connection."
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” з’єднаннÑм WiMAX."
+
+#: ../libnm/nm-device.c:2152
+#, c-format
+msgid "The connection was not valid: %s"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” коректним: %s"
+
+#: ../libnm/nm-device.c:2161
+#, c-format
+msgid "The interface names of the device and the connection didn't match."
+msgstr "Ðазви інтерфейÑу приÑтрою Ñ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ збігаютьÑÑ."
+
+#: ../libnm/nm-manager.c:858
+msgid "Active connection could not be attached to the device"
+msgstr "Ðктивне Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ вдалоÑÑ Ð´Ð¾Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ до приÑтрою"
+
+#: ../libnm/nm-manager.c:1082
+msgid "Active connection removed before it was initialized"
+msgstr "Ðктивне Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð²Ð¸Ð»ÑƒÑ‡ÐµÐ½Ð¾ до його ініціалізації"
+
+#: ../libnm/nm-object.c:1439 ../libnm/nm-object.c:1585
+msgid "Caller did not specify D-Bus path for object"
+msgstr "Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ Ð²Ð¸ÐºÐ»Ð¸ÐºÑƒ не вказала шлÑÑ… D-Bus Ð´Ð»Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð°"
+
+#: ../libnm/nm-remote-settings.c:261
+msgid "Connection removed before it was initialized"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð²Ð¸Ð»ÑƒÑ‡ÐµÐ½Ð¾ до його ініціалізації"
+
+#: ../libnm/nm-vpn-plugin-old.c:885
+msgid "No service name specified"
+msgstr "Ðе вказано назви Ñлужби"
+
#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:1
msgid "Enable or disable system networking"
msgstr "Увімкнути або вимкнути ÑиÑтемну роботу у мережі"
@@ -6308,95 +7932,64 @@ msgid "System policy prevents modification of the persistent system hostname"
msgstr ""
"Правила ÑиÑтеми заборонÑÑŽÑ‚ÑŒ внеÑÐµÐ½Ð½Ñ Ð·Ð¼Ñ–Ð½ до поÑтійної назви вузла у мережі"
-#: ../src/main.c:129
-#, c-format
-msgid "Failed to set signal mask: %d"
-msgstr "Ðе вдалоÑÑ Ð²Ñтановити маÑку Ñигналу: %d"
-
-#: ../src/main.c:138
-#, c-format
-msgid "Failed to create signal handling thread: %d"
-msgstr "Ðе вдалоÑÑ Ñтворити потік обробки Ñигналів: %d"
-
-#: ../src/main.c:153
-#, c-format
-msgid "Opening %s failed: %s\n"
-msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби відкрити %s: %s\n"
-
-#: ../src/main.c:159
-#, c-format
-msgid "Writing to %s failed: %s\n"
-msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби запиÑу даних до %s: %s\n"
-
-#: ../src/main.c:164
+#. Translators: the first %s is a prefix for the connection id, such
+#. * as "Wired Connection" or "VPN Connection". The %d is a number
+#. * that is combined with the first argument to create a unique
+#. * connection id.
+#: ../src/NetworkManagerUtils.c:1175
#, c-format
-msgid "Closing %s failed: %s\n"
-msgstr "Ðе вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ роботу %s: %s\n"
+msgctxt "connection id fallback"
+msgid "%s %d"
+msgstr "%s %d"
-#: ../src/main.c:207
-#, c-format
-msgid "NetworkManager is already running (pid %ld)\n"
-msgstr "NetworkManager вже запущено (pid %ld)\n"
-
-#: ../src/main.c:360
+#. Logging/debugging
+#: ../src/main.c:209 ../src/nm-iface-helper.c:300
msgid "Print NetworkManager version and exit"
msgstr "ВивеÑти дані щодо верÑÑ–Ñ— NetworkManager Ñ– завершити роботу"
-#: ../src/main.c:361
+#: ../src/main.c:210 ../src/nm-iface-helper.c:301
msgid "Don't become a daemon"
msgstr "Ðе переходити у Ñтан фонової Ñлужби"
-#: ../src/main.c:362
+#: ../src/main.c:211 ../src/nm-iface-helper.c:302
msgid "Don't become a daemon, and log to stderr"
msgstr ""
"Ðе переходити у Ñтан фонової Ñлужби Ñ– запиÑувати Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ до "
"stderr"
-#: ../src/main.c:363
+#: ../src/main.c:212 ../src/nm-iface-helper.c:303
#, c-format
msgid "Log level: one of [%s]"
msgstr "Рівень докладноÑÑ‚Ñ– журналу: одне з таких значень: [%s]"
-#: ../src/main.c:365
+#: ../src/main.c:214 ../src/nm-iface-helper.c:305
#, c-format
msgid "Log domains separated by ',': any combination of [%s]"
msgstr ""
"СпиÑок доменів Ð´Ð»Ñ Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ, відокремлених Ñимволом «,»: будь-Ñка "
"ÐºÐ¾Ð¼Ð±Ñ–Ð½Ð°Ñ†Ñ–Ñ Ð· [%s]"
-#: ../src/main.c:367
+#: ../src/main.c:216 ../src/nm-iface-helper.c:307
msgid "Make all warnings fatal"
msgstr "Вважати вÑÑ– Ð¿Ð¾Ð¿ÐµÑ€ÐµÐ´Ð¶ÐµÐ½Ð½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°Ð¼Ð¸"
-#: ../src/main.c:368
+#: ../src/main.c:217
msgid "Specify the location of a PID file"
msgstr "Вказати Ñ€Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° ідентифікатора процеÑу (PID)"
-#: ../src/main.c:368
+#: ../src/main.c:217
msgid "filename"
msgstr "назва файла"
-#: ../src/main.c:369
+#: ../src/main.c:218
msgid "State file location"
msgstr "Ð Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° Ñтану"
-#: ../src/main.c:369
+#: ../src/main.c:218
msgid "/path/to/state.file"
msgstr "/шлÑÑ…/до/файла.Ñтану"
-#: ../src/main.c:395
-#, c-format
-msgid "GModules are not supported on your platform!\n"
-msgstr "Підтримки GModules на цій платформі не передбачено!\n"
-
-#: ../src/main.c:400
-#, c-format
-msgid "You must be root to run NetworkManager!\n"
-msgstr ""
-"ЗапуÑк NetworkManager Ñлід здійÑнювати з облікового запиÑу адмініÑтратора "
-"(root)!\n"
-
-#: ../src/main.c:423
+#: ../src/main.c:232
msgid ""
"NetworkManager monitors all network connections and automatically\n"
"chooses the best connection to use. It also allows the user to\n"
@@ -6409,51 +8002,76 @@ msgstr ""
"з Ñкими Ñлід пов’Ñзувати картки бездротового доÑтупу на вашому\n"
"комп’ютері."
-#: ../src/main.c:429 ../src/main.c:445
+#: ../src/main.c:245 ../src/main-utils.c:229 ../src/nm-iface-helper.c:336
#, c-format
msgid "%s. Please use --help to see a list of valid options.\n"
msgstr ""
"%s. Щоб ознайомитиÑÑ Ð·Ñ– ÑпиÑком параметрів, ÑкориÑтайтеÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ --"
"help.\n"
-#: ../src/main.c:450
+#: ../src/main.c:250 ../src/nm-iface-helper.c:341
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' passed on command line.\n"
msgstr ""
"Ігноруємо нерозпізнані домени журналюваннÑ, «%s», передані за допомогою "
"командного Ñ€Ñдка.\n"
-#: ../src/main.c:501
+#: ../src/main.c:295
#, c-format
msgid "Failed to read configuration: (%d) %s\n"
msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ налаштуваннÑ: (%d) %s\n"
-#: ../src/main.c:515
+#: ../src/main.c:309
#, c-format
msgid "Error in configuration file: %s.\n"
msgstr "Помилка у файлі налаштувань: %s.\n"
-#: ../src/main.c:520
+#: ../src/main.c:314
#, c-format
msgid "Ignoring unrecognized log domain(s) '%s' from config files.\n"
msgstr ""
"Ігноруємо нерозпізнані домени журналюваннÑ, «%s», з файлів налаштувань.\n"
-#: ../src/main.c:528
+#: ../src/main.c:322
#, c-format
msgid "State file %s parsing failed: (%d) %s\n"
msgstr "Помилка під Ñ‡Ð°Ñ Ð¾Ð±Ñ€Ð¾Ð±ÐºÐ¸ файла Ñтану %s: (%d) %s\n"
-#: ../src/main.c:541
+#: ../src/main.c:335 ../src/nm-iface-helper.c:358
#, c-format
msgid "Could not daemonize: %s [error %u]\n"
msgstr "Ðе вдалоÑÑ Ñтворити фонову Ñлужбу: %s [помилка %u]\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:140
+#: ../src/main-utils.c:97
+#, c-format
+msgid "Opening %s failed: %s\n"
+msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби відкрити %s: %s\n"
+
+#: ../src/main-utils.c:103
+#, c-format
+msgid "Writing to %s failed: %s\n"
+msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби запиÑу даних до %s: %s\n"
+
+#: ../src/main-utils.c:108
+#, c-format
+msgid "Closing %s failed: %s\n"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ роботу %s: %s\n"
+
+#: ../src/main-utils.c:164
+#, c-format
+msgid "%s is already running (pid %ld)\n"
+msgstr "%s вже працює (pid %ld)\n"
+
+#: ../src/main-utils.c:206
+#, c-format
+msgid "You must be root to run %s!\n"
+msgstr "Ð”Ð»Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ %s потрібно перейти у режим root!\n"
+
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:205
msgid "# Created by NetworkManager\n"
msgstr "# Створено за допомогою NetworkManager\n"
-#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:147
+#: ../src/dhcp-manager/nm-dhcp-dhclient-utils.c:212
#, c-format
msgid ""
"# Merged from %s\n"
@@ -6462,973 +8080,599 @@ msgstr ""
"# Об’єднано з %s\n"
"\n"
-#: ../src/dhcp-manager/nm-dhcp-manager.c:311
+#: ../src/dhcp-manager/nm-dhcp-manager.c:130
+#, c-format
+msgid "'%s' support not found or not enabled."
+msgstr "Підтримки «%s» не знайдено або підтримку не увімкнено."
+
+#: ../src/dhcp-manager/nm-dhcp-manager.c:177
msgid "no usable DHCP client could be found."
msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ придатного до викориÑÑ‚Ð°Ð½Ð½Ñ ÐºÐ»Ñ–Ñ”Ð½Ñ‚Ð° DHCP."
-#: ../src/dhcp-manager/nm-dhcp-manager.c:320
-msgid "'dhclient' could be found."
-msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ «dhclient»."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:330
-msgid "'dhcpcd' could be found."
-msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ «dhcpcd»."
-
-#: ../src/dhcp-manager/nm-dhcp-manager.c:338
-#, c-format
-msgid "unsupported DHCP client '%s'"
-msgstr "підтримки клієнта DHCP «%s» не передбачено"
-
-#: ../src/dns-manager/nm-dns-manager.c:385
+#: ../src/dns-manager/nm-dns-manager.c:361
msgid "NOTE: the libc resolver may not support more than 3 nameservers."
msgstr ""
"ЗÐУВÐЖЕÐÐЯ: можливо, інÑтрумент Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð°Ð´Ñ€ÐµÑ Ð·Ð° назвами libc вашої "
"ÑиÑтеми не підтримує викориÑÑ‚Ð°Ð½Ð½Ñ Ð¿Ð¾Ð½Ð°Ð´ 3 Ñерверів назв."
-#: ../src/dns-manager/nm-dns-manager.c:387
+#: ../src/dns-manager/nm-dns-manager.c:363
msgid "The nameservers listed below may not be recognized."
msgstr "Вказані у наведеному нижче ÑпиÑку Ñервери назв може бути пропущено."
-#: ../src/logging/nm-logging.c:150
-#, c-format
-msgid "Unknown log level '%s'"
-msgstr "Ðевідомий рівень Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ, «%s»"
-
-#: ../src/logging/nm-logging.c:229
-#, c-format
-msgid "Unknown log domain '%s'"
-msgstr "Ðевідомий домен Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ, «%s»"
-
-#: ../src/config/nm-config.c:281
-msgid "Config file location"
-msgstr "Ð Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° налаштувань"
-
-#: ../src/config/nm-config.c:281
-msgid "/path/to/config.file"
-msgstr "/шлÑÑ…/до/файла.налаштувань"
-
-#: ../src/config/nm-config.c:282
-msgid "Config directory location"
-msgstr "Ð Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñƒ налаштувань"
-
-#: ../src/config/nm-config.c:282
-msgid "/path/to/config/dir"
-msgstr "/шлÑÑ…/до/каталогу/налаштувань"
-
-#: ../src/config/nm-config.c:284
-msgid "List of plugins separated by ','"
-msgstr "СпиÑок додатків, відокремлених комами («,»)"
-
-#: ../src/config/nm-config.c:284
-msgid "plugin1,plugin2"
-msgstr "додаток1,додаток2"
-
-#. These three are hidden for now, and should eventually just go away.
-#: ../src/config/nm-config.c:287
-msgid "An http(s) address for checking internet connectivity"
-msgstr "ÐдреÑа http(s) Ð´Ð»Ñ Ñпроб перевірки можливоÑÑ‚Ñ– вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
-
-#: ../src/config/nm-config.c:288
-msgid "The interval between connectivity checks (in seconds)"
-msgstr "Інтервал між перевірками можливоÑÑ‚Ñ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (у Ñекундах)"
-
-#: ../src/config/nm-config.c:289
-msgid "The expected start of the response"
-msgstr "Очікуваний початок відповіді"
-
-#: ../src/config/nm-config.c:289
-msgid "Bingo!"
-msgstr "Влучно!"
-
-#: ../src/devices/adsl/nm-device-adsl.c:122
-#, c-format
-msgid "ADSL connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ ADSL %d"
+#: ../src/devices/adsl/nm-device-adsl.c:129
+msgid "ADSL connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ ADSL"
-#: ../src/devices/bluetooth/nm-bluez-device.c:194
+#: ../src/devices/bluetooth/nm-bluez-device.c:200
#, c-format
msgid "%s Network"
msgstr "Мережа %s"
-#: ../src/devices/bluetooth/nm-device-bt.c:284
-#, c-format
-msgid "PAN connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ PAN %d"
-
-#: ../src/devices/bluetooth/nm-device-bt.c:309
-#: ../src/devices/wwan/nm-modem-broadband.c:438
-#: ../src/devices/wwan/nm-modem-old.c:815
-#, c-format
-msgid "GSM connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ GSM %d"
-
-#: ../src/devices/bluetooth/nm-device-bt.c:313
-#: ../src/devices/wwan/nm-modem-broadband.c:460
-#: ../src/devices/wwan/nm-modem-old.c:842
-#, c-format
-msgid "CDMA connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ CDMA %d"
-
-#: ../src/devices/bluetooth/nm-device-bt.c:317
-#, c-format
-msgid "DUN connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ DUN %d"
-
-#: ../src/devices/nm-device-bond.c:138 ../tui/nm-editor-utils.c:204
-#, c-format
-msgid "Bond connection %d"
-msgstr "Прив’Ñзане Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %d"
-
-#: ../src/devices/nm-device-bridge.c:148 ../tui/nm-editor-utils.c:214
-#, c-format
-msgid "Bridge connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¼Ñ–Ñтка %d"
-
-#: ../src/devices/nm-device-ethernet.c:1486
-#, c-format
-msgid "PPPoE connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ PPPoE %d"
-
-#: ../src/devices/nm-device-ethernet.c:1486
-#: ../src/settings/nm-settings-utils.c:50
-#, c-format
-msgid "Wired connection %d"
-msgstr "Дротове Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %d"
-
-#: ../src/devices/nm-device-infiniband.c:255 ../tui/nm-editor-utils.c:177
-#, c-format
-msgid "InfiniBand connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ InfiniBand %d"
-
-#: ../src/devices/nm-device-team.c:152 ../tui/nm-editor-utils.c:223
-#, c-format
-msgid "Team connection %d"
-msgstr "Командне Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %d"
-
-#: ../src/devices/nm-device-vlan.c:230 ../tui/nm-editor-utils.c:231
-#, c-format
-msgid "VLAN connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VLAN %d"
-
-#: ../src/devices/wifi/nm-device-olpc-mesh.c:164
-#, c-format
-msgid "Mesh %d"
-msgstr "Mesh %d"
-
-#: ../src/nm-manager.c:3304 ../tui/nm-editor-utils.c:246
-#, c-format
-msgid "VPN connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN %d"
-
-#: ../src/nm-sleep-monitor-systemd.c:116
-msgid "NetworkManager needs to turn off networks"
-msgstr "NetworkManager потрібно вимкнути роботу мереж"
+#: ../src/devices/bluetooth/nm-device-bt.c:254
+msgid "PAN requested, but Bluetooth device does not support NAP"
+msgstr ""
+"ÐадіÑлано запит щодо PAN, але у приÑтрої Bluetooth не передбачено підтримки "
+"NAP"
-#: ../src/settings/plugins/ifcfg-rh/reader.c:113
-msgid "System"
-msgstr "СиÑтема"
+#: ../src/devices/bluetooth/nm-device-bt.c:264
+msgid "PAN connections cannot specify GSM, CDMA, or serial settings"
+msgstr ""
+"ЗапиÑи Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ PAN не можуть вказувати параметрів GSM, CDMA або "
+"поÑлідовного приÑтрою"
-#: ../test/nm-online.c:96
-#, c-format
-msgid "\rConnecting"
-msgstr "\rÐ’ÑтановлюєтьÑÑ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
+#: ../src/devices/bluetooth/nm-device-bt.c:277
+msgid "PAN connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ PAN"
-#: ../test/nm-online.c:148
-msgid ""
-"Time to wait for a connection, in seconds (without the option, default value "
-"is 30)"
+#: ../src/devices/bluetooth/nm-device-bt.c:284
+msgid "DUN requested, but Bluetooth device does not support DUN"
msgstr ""
-"Ð§Ð°Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° з’єднаннÑ, у Ñекундах (без цього параметра типовим "
-"значеннÑм Ñ” 30)"
+"ÐадіÑлано запит щодо DUN, але у приÑтрої Bluetooth не передбачено підтримки "
+"DUN"
-#: ../test/nm-online.c:149
-#| msgid "Exit immediately if NetworkManager is not running"
-msgid "Exit immediately if NetworkManager is not running or connecting"
-msgstr ""
-"Ðегайно завершити роботу, Ñкщо NetworkManager не запущено або виконуєтьÑÑ "
-"Ñпроба з’єднаннÑ"
+#: ../src/devices/bluetooth/nm-device-bt.c:294
+msgid "DUN connection must include a GSM or CDMA setting"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ DUN має включати параметр GSM або CDMA"
-#: ../test/nm-online.c:150
-msgid "Don't print anything"
-msgstr "Ðічого не виводити"
+#: ../src/devices/bluetooth/nm-device-bt.c:304
+#: ../src/devices/wwan/nm-modem-broadband.c:488
+msgid "GSM connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ GSM"
-#: ../test/nm-online.c:151
-#| msgid ""
-#| "Waits for NetworkManager to finish activating startup network connections."
-msgid "Wait for NetworkManager startup instead of a connection"
-msgstr "Чекати на запуÑк NetworkManager, а не на з’єднаннÑ"
+#: ../src/devices/bluetooth/nm-device-bt.c:308
+#: ../src/devices/wwan/nm-modem-broadband.c:511
+msgid "CDMA connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ CDMA"
-#: ../test/nm-online.c:172
-msgid ""
-"Waits for NetworkManager to finish activating startup network connections."
-msgstr ""
-"Очікує на Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ð°ÐºÑ‚Ð¸Ð²Ð°Ñ†Ñ–Ñ— NetworkManager з’єднань, Ñкі Ñлід активувати "
-"під Ñ‡Ð°Ñ Ð·Ð°Ð¿ÑƒÑку."
+#: ../src/devices/bluetooth/nm-device-bt.c:316
+msgid "Unknown/unhandled Bluetooth connection type"
+msgstr "Ðевідомий або непридатний тип Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Bluetooth"
-#: ../test/nm-online.c:179 ../test/nm-online.c:185
-msgid "Invalid option. Please use --help to see a list of valid options."
-msgstr ""
-"Ðекоректний параметр. Щоб ознайомитиÑÑ Ð·Ñ– ÑпиÑком параметрів, ÑкориÑтайтеÑÑ "
-"параметром --help."
+#: ../src/devices/bluetooth/nm-device-bt.c:336
+#: ../src/devices/nm-device-ethernet.c:1442
+#: ../src/devices/nm-device-infiniband.c:196
+#: ../src/devices/wifi/nm-device-wifi.c:1124
+#: ../src/devices/wimax/nm-device-wimax.c:450
+msgid "connection does not match device"
+msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ відповідає приÑтрою"
-#: ../tui/newt/nmt-newt-utils.c:179 ../tui/nmt-editor.c:231
-#: ../tui/nmt-password-dialog.c:175 ../tui/nmt-route-editor.c:135
-#: ../tui/nmtui-hostname.c:71 ../tui/nmtui.c:121
-msgid "OK"
-msgstr "Гаразд"
+#: ../src/devices/nm-device-bond.c:125
+msgid "Bond connection"
+msgstr "Прив’Ñзане з’єднаннÑ"
-#: ../tui/newt/nmt-newt-utils.c:327 ../tui/newt/nmt-newt-utils.c:359
-#, c-format
-msgid "Could not create temporary file: %s"
-msgstr "Ðе вдалоÑÑ Ñтворити тимчаÑовий файл «%s»"
+#: ../src/devices/nm-device-bridge.c:131
+msgid "Bridge connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¼Ñ–Ñтка"
-#: ../tui/newt/nmt-newt-utils.c:367
-#, c-format
-msgid "Editor failed: %s"
-msgstr "Помилка редактора: %s"
+#: ../src/devices/nm-device-ethernet.c:1425
+msgid "PPPoE connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ PPPoE"
-#: ../tui/newt/nmt-newt-utils.c:375
-#, c-format
-msgid "Editor failed with status %d"
-msgstr "Помилка редактора з кодом Ñтану %d"
+#: ../src/devices/nm-device-ethernet.c:1425
+msgid "Wired connection"
+msgstr "Дротове з’єднаннÑ"
-#: ../tui/newt/nmt-newt-utils.c:377
+#: ../src/devices/nm-device-ethernet-utils.c:40
#, c-format
-msgid "Editor failed with signal %d"
-msgstr "Помилка редактора з Ñигналом %d"
+msgid "Wired connection %d"
+msgstr "Дротове Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %d"
-#: ../tui/newt/nmt-newt-utils.c:381
-#, c-format
-msgid "Could not re-read file: %s"
-msgstr "Ðе вдалоÑÑ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð½Ð¾ прочитати файл: %s"
+#: ../src/devices/nm-device-infiniband.c:178
+msgid "InfiniBand connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ InfiniBand"
-#: ../tui/nm-editor-utils.c:160
-#, c-format
-msgid "Ethernet connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ethernet %d"
+#: ../src/devices/nm-device-vlan.c:218
+msgid "VLAN connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VLAN"
-#: ../tui/nm-editor-utils.c:168
-#, c-format
-msgid "Wi-Fi connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Wi-Fi %d"
+#: ../src/devices/team/nm-device-team.c:131
+msgid "Team connection"
+msgstr "Командне з’єднаннÑ"
-#: ../tui/nm-editor-utils.c:185
-#, c-format
-msgid "Mobile broadband connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð·Ð° допомогою мобільної радіомережі %d"
+#: ../src/devices/wifi/nm-device-olpc-mesh.c:151
+msgid "Mesh"
+msgstr "Сітка"
-#: ../tui/nm-editor-utils.c:190
-msgid "DSL"
-msgstr "DSL"
+#: ../src/devices/wifi/nm-device-wifi.c:1094
+msgid "WPA Ad-Hoc disabled due to kernel bugs"
+msgstr "Спеціальний WPA вимкнено через вади у Ñдрі"
-#: ../tui/nm-editor-utils.c:194
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:44
#, c-format
-msgid "DSL connection %d"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ DSL %d"
+msgid "%s is incompatible with static WEP keys"
+msgstr "%s Ñ” неÑуміÑним зі Ñтатичними ключами WEP"
-#: ../tui/nmt-device-entry.c:391
-msgid "Select..."
-msgstr "Вибрати…"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:78
+msgid "LEAP authentication requires a LEAP username"
+msgstr "Ð”Ð»Ñ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ LEAP потрібне Ñ–Ð¼â€™Ñ ÐºÐ¾Ñ€Ð¸Ñтувача LEAP"
-#: ../tui/nmt-edit-connection-list.c:129
-msgid "Add"
-msgstr "Додати"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:88
+msgid "LEAP username requires 'leap' authentication"
+msgstr "Ð†Ð¼â€™Ñ ÐºÐ¾Ñ€Ð¸Ñтувача LEAP потребує Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«leap»"
-#: ../tui/nmt-edit-connection-list.c:132 ../tui/nmt-page-ip4.c:175
-#: ../tui/nmt-page-ip6.c:173 ../tui/nmt-page-team-port.c:110
-#: ../tui/nmt-page-team.c:180
-msgid "Edit..."
-msgstr "Змінити..."
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:101
+msgid "LEAP authentication requires IEEE 802.1x key management"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ LEAP потребує ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ»ÑŽÑ‡Ð°Ð¼Ð¸ IEEE 802.1x"
-#: ../tui/nmt-edit-connection-list.c:135 ../tui/nmtui-edit.c:467
-msgid "Delete"
-msgstr "Вилучити"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:121
+msgid "LEAP authentication is incompatible with Ad-Hoc mode"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ LEAP Ñ” неÑуміÑним зі Ñпеціальним (Ad-Hoc) режимом"
-#: ../tui/nmt-editor.c:81
-#, c-format
-msgid "Could not create editor for connection '%s' of type '%s'."
-msgstr "Ðе вдалоÑÑ Ñтворити редактор Ð´Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» типу «%s»."
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:133
+msgid "LEAP authentication is incompatible with 802.1x setting"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ LEAP Ñ” неÑуміÑним із вÑтановленнÑм 802.1x"
-#: ../tui/nmt-editor.c:85
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:155
#, c-format
-msgid "Could not create editor for invalid connection '%s'."
-msgstr "Ðе вдалоÑÑ Ñтворити редактор Ð´Ð»Ñ Ð½ÐµÐºÐ¾Ñ€ÐµÐºÑ‚Ð½Ð¾Ð³Ð¾ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»."
-
-#: ../tui/nmt-editor.c:95
-#| msgid "Edit connection"
-msgid "Edit Connection"
-msgstr "Редагувати з’єднаннÑ"
+msgid "a connection using '%s' authentication cannot use WPA key management"
+msgstr ""
+"з’єднаннÑ, де викориÑтовуєтьÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«%s», не може викориÑтовувати "
+"ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ»ÑŽÑ‡Ð°Ð¼Ð¸ WPA"
-#: ../tui/nmt-editor.c:134
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:166
#, c-format
-msgid "Error saving connection: %s"
-msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби зберегти Ð·Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ: %s"
+msgid "a connection using '%s' authentication cannot specific WPA protocols"
+msgstr ""
+"з’єднаннÑ, де викориÑтовуєтьÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«%s», не може викориÑтовувати "
+"Ñпецифічні протоколи WPA"
-#: ../tui/nmt-editor.c:144
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:182
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:199
#, c-format
-msgid "Unable to save connection: %s"
-msgstr "Ðе вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ: %s"
+msgid "a connection using '%s' authentication cannot specific WPA ciphers"
+msgstr ""
+"з’єднаннÑ, де викориÑтовуєтьÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«%s», не може викориÑтовувати "
+"Ñпецифічні шифри WPA"
-#: ../tui/nmt-editor.c:158
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:211
#, c-format
-msgid "Unable to add new connection: %s"
-msgstr "Ðе вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ нове з’єднаннÑ: %s"
-
-#: ../tui/nmt-editor.c:228 ../tui/nmt-password-dialog.c:172
-#: ../tui/nmt-route-editor.c:128 ../tui/nmtui-edit.c:192
-#: ../tui/nmtui-edit.c:466 ../tui/nmtui-hostname.c:69
-msgid "Cancel"
-msgstr "СкаÑувати"
-
-#: ../tui/nmt-mtu-entry.c:86
-msgid "(default)"
-msgstr "(типово)"
-
-#: ../tui/nmt-mtu-entry.c:88 ../tui/nmt-mtu-entry.c:119
-msgid "bytes"
-msgstr "байтів"
-
-#: ../tui/nmt-page-bond.c:88
-msgid "Round-robin"
-msgstr "Циклічний"
-
-#: ../tui/nmt-page-bond.c:89
-msgid "Active Backup"
-msgstr "Ðктивне резервуваннÑ"
-
-#: ../tui/nmt-page-bond.c:90
-msgid "XOR"
-msgstr "XOR"
-
-#: ../tui/nmt-page-bond.c:91
-msgid "Broadcast"
-msgstr "ТранÑлÑціÑ"
-
-#: ../tui/nmt-page-bond.c:92
-msgid "802.3ad"
-msgstr "802.3ad"
-
-#: ../tui/nmt-page-bond.c:93
-msgid "Adaptive Transmit Load Balancing (tlb)"
-msgstr "Ðдаптивне ÑƒÑ€Ñ–Ð²Ð½Ð¾Ð²Ð°Ð¶ÐµÐ½Ð½Ñ Ð½Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð° передаваннÑм (tlb)"
-
-#: ../tui/nmt-page-bond.c:94
-msgid "Adaptive Load Balancing (alb)"
-msgstr "Ðдаптивне ÑƒÑ€Ñ–Ð²Ð½Ð¾Ð²Ð°Ð¶ÐµÐ½Ð½Ñ Ð½Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ (alb)"
-
-#: ../tui/nmt-page-bond.c:100
-msgid "MII (recommended)"
-msgstr "MII (рекомендоване)"
-
-#: ../tui/nmt-page-bond.c:101
-msgid "ARP"
-msgstr "ARP"
-
-#: ../tui/nmt-page-bond.c:359 ../tui/nmt-page-bridge.c:86
-#: ../tui/nmt-page-team.c:159
-msgid "Slaves"
-msgstr "Підлеглі"
-
-#: ../tui/nmt-page-bond.c:371 ../tui/nmt-page-wifi.c:227
-msgid "Mode"
-msgstr "Режим"
-
-#: ../tui/nmt-page-bond.c:377
-msgid "Primary"
-msgstr "ОÑновний"
-
-#: ../tui/nmt-page-bond.c:383
-msgid "Link monitoring"
-msgstr "СпоÑÑ‚ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° зв’Ñзком"
-
-#: ../tui/nmt-page-bond.c:389 ../tui/nmt-page-bond.c:396
-#: ../tui/nmt-page-bond.c:403 ../tui/nmt-page-bond.c:410
-msgctxt "milliseconds"
-msgid "ms"
-msgstr "мÑ"
-
-#: ../tui/nmt-page-bond.c:390 ../tui/nmt-page-bond.c:411
-msgid "Monitoring frequency"
-msgstr "ЧаÑтота оновленнÑ"
-
-#: ../tui/nmt-page-bond.c:397
-msgid "Link up delay"
-msgstr "Затримка вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·Ð²â€™Ñзку"
-
-#: ../tui/nmt-page-bond.c:404
-msgid "Link down delay"
-msgstr "Затримка Ñ€Ð¾Ð·Ñ–Ñ€Ð²Ð°Ð½Ð½Ñ Ð·Ð²â€™Ñзку"
-
-#: ../tui/nmt-page-bond.c:417
-msgid "ARP targets"
-msgstr "Цілі ARP"
-
-#: ../tui/nmt-page-bridge-port.c:38
-msgid "BRIDGE PORT"
-msgstr "ПОРТ МІСТКÐ"
-
-#: ../tui/nmt-page-bridge-port.c:69 ../tui/nmt-page-bridge.c:112
-msgid "Priority"
-msgstr "Пріоритет"
-
-#: ../tui/nmt-page-bridge-port.c:75
-msgid "Path cost"
-msgstr "ВартіÑÑ‚ÑŒ маршруту"
-
-#: ../tui/nmt-page-bridge-port.c:77
-msgid "Hairpin mode"
-msgstr "Режим початкової зони (hairpin)"
-
-#: ../tui/nmt-page-bridge.c:42
-msgid "BRIDGE"
-msgstr "МІСТОК"
+msgid "a connection using '%s' authentication cannot specific a WPA password"
+msgstr ""
+"з’єднаннÑ, де викориÑтовуєтьÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«%s», не може викориÑтовувати "
+"Ñпецифічний пароль WPA"
-#: ../tui/nmt-page-bridge.c:96 ../tui/nmt-page-bridge.c:121
-#: ../tui/nmt-page-bridge.c:131 ../tui/nmt-page-bridge.c:141
-msgid "seconds"
-msgstr "Ñекунд"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:242
+msgid "Dynamic WEP requires an 802.1x setting"
+msgstr "Динамічний WEP потребує вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° 802.1x"
-#: ../tui/nmt-page-bridge.c:97
-msgid "Aging time"
-msgstr "Ð§Ð°Ñ Ð·Ð°ÑтаріваннÑ"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:252
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:280
+msgid "Dynamic WEP requires 'open' authentication"
+msgstr "Динамічний WEP потребує Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«open»"
-#: ../tui/nmt-page-bridge.c:99
-msgid "Enable STP (Spanning Tree Protocol)"
-msgstr "Увімкнути STP (протокол розподілу за деревом)"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:267
+msgid "Dynamic WEP requires 'ieee8021x' key management"
+msgstr "Динамічний WEP потребує ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ»ÑŽÑ‡Ð°Ð¼Ð¸ «ieee8021x»"
-#: ../tui/nmt-page-bridge.c:122
-msgid "Forward delay"
-msgstr "Затримка переÑпрÑмуваннÑ"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:314
+msgid "WPA-PSK authentication is incompatible with 802.1x"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð·Ð° допомогою WPA-PSK Ñ” неÑуміÑним з 802.1x"
-#: ../tui/nmt-page-bridge.c:132
-msgid "Hello time"
-msgstr "Ð§Ð°Ñ Ð½Ð° вітаннÑ"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:324
+msgid "WPA-PSK requires 'open' authentication"
+msgstr "WPA-PSK потребує Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«open»"
-#: ../tui/nmt-page-bridge.c:142
-msgid "Max age"
-msgstr "МакÑ. вік"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:336
+msgid "WPA Ad-Hoc authentication requires an Ad-Hoc mode AP"
+msgstr ""
+"Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð·Ð° Ñпеціальним WPA потребує точки доÑтупу у Ñпеціальному (Ad-"
+"Hoc) режимі"
-#: ../tui/nmt-page-ethernet.c:41
-msgid "ETHERNET"
-msgstr "ETHERNET"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:349
+msgid "WPA Ad-Hoc authentication requires 'wpa' protocol"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð·Ð° Ñпеціальним WPA потребує протоколу «wpa»"
-#: ../tui/nmt-page-ethernet.c:80 ../tui/nmt-page-vlan.c:132
-#: ../tui/nmt-page-wifi.c:358
-msgid "Cloned MAC address"
-msgstr "Клонована MAC-адреÑа"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:361
+msgid "WPA Ad-Hoc authentication requires 'none' pairwise cipher"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð·Ð° Ñпеціальним WPA потребує парного шифру «none»"
-#: ../tui/nmt-page-infiniband.c:40
-msgid "INFINIBAND"
-msgstr "INFINIBAND"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:373
+msgid "WPA Ad-Hoc requires 'tkip' group cipher"
+msgstr "Спеціальний (Ad-Hoc) режим WPA потребує групового ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Â«tkip»"
-#: ../tui/nmt-page-infiniband.c:51
-msgid "Datagram"
-msgstr "Данограма"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:387
+msgid "Access point does not support PSK but setting requires it"
+msgstr ""
+"У точці доÑтупу не передбачено підтримки PSK, але параметром передбачено "
+"таку підтримку"
-#: ../tui/nmt-page-infiniband.c:52
-msgid "Connected"
-msgstr "З'єднано"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:417
+msgid "WPA-EAP authentication requires an 802.1x setting"
+msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ WPA-EAP потребує параметра 802.1x"
-#: ../tui/nmt-page-infiniband.c:90
-msgid "Transport mode"
-msgstr "Режим передаваннÑ"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:427
+msgid "WPA-EAP requires 'open' authentication"
+msgstr "WPA-EAP потребує Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«open»"
-#: ../tui/nmt-page-ip4.c:41
-msgid "Disabled"
-msgstr "Вимкнено"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:438
+msgid "802.1x setting requires 'wpa-eap' key management"
+msgstr "Параметр 802.1x потребує ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ»ÑŽÑ‡Ð°Ð¼Ð¸ «wpa-eap»"
-#: ../tui/nmt-page-ip4.c:42 ../tui/nmt-page-ip6.c:42
-msgid "Automatic"
-msgstr "Ðвтоматично"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:451
+msgid "Access point does not support 802.1x but setting requires it"
+msgstr ""
+"У точці доÑтупу не передбачено підтримки 802.1x, але параметром передбачено "
+"таку підтримку"
-#: ../tui/nmt-page-ip4.c:43 ../tui/nmt-page-ip6.c:44
-msgid "Link-Local"
-msgstr "Link-Local"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:479
+msgid ""
+"Access point mode is Ad-Hoc but setting requires Infrastructure security"
+msgstr ""
+"Режимом роботи точки доÑтупу вказано Ñпеціальний (Ad-Hoc), але параметр "
+"потребує захиÑту інфраÑтруктури"
-#: ../tui/nmt-page-ip4.c:44 ../tui/nmt-page-ip6.c:45
-msgid "Manual"
-msgstr "Вручну"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:489
+msgid "Ad-Hoc mode is incompatible with 802.1x security"
+msgstr "Спеціальний (Ad-Hoc) режим Ñ” неÑуміÑним із захиÑтом 802.1x"
-#: ../tui/nmt-page-ip4.c:45
-msgid "Shared"
-msgstr "Спільний"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:498
+msgid "Ad-Hoc mode is incompatible with LEAP security"
+msgstr "Спеціальний (Ad-Hoc) режим Ñ” неÑуміÑним із захиÑтом LEAP"
-#: ../tui/nmt-page-ip4.c:54
-msgid "IPv4 CONFIGURATION"
-msgstr "ÐÐЛÐШТУВÐÐÐЯ IPv4"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:508
+msgid "Ad-Hoc mode requires 'open' authentication"
+msgstr "Ð”Ð»Ñ Ñпеціального (Ad-Hoc) режиму потрібне Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Â«open»"
-#: ../tui/nmt-page-ip4.c:100 ../tui/nmt-page-ip6.c:100
-msgid "(No custom routes)"
-msgstr "(Ðемає нетипових маршрутів)"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:518
+msgid ""
+"Access point mode is Infrastructure but setting requires Ad-Hoc security"
+msgstr ""
+"Режим роботи точки доÑтупу вÑтановлено у Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ–Ð½Ñ„Ñ€Ð°Ñтруктура "
+"(infrastructure), а параметр потребує Ñпеціального (Ad-Hoc) з’єднаннÑ"
-#: ../tui/nmt-page-ip4.c:103 ../tui/nmt-page-ip6.c:103
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:560
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:590
#, c-format
-msgid "One custom route"
-msgid_plural "%d custom routes"
-msgstr[0] "%d нетипове правило"
-msgstr[1] "%d нетипових правила"
-msgstr[2] "%d нетипових правил"
-msgstr[3] "Одне нетипове правило"
-
-#: ../tui/nmt-page-ip4.c:144 ../tui/nmt-page-ip6.c:144
-msgid "Addresses"
-msgstr "ÐдреÑи"
-
-#: ../tui/nmt-page-ip4.c:150 ../tui/nmt-page-ip6.c:150
-msgid "Gateway"
-msgstr "Шлюз"
-
-#: ../tui/nmt-page-ip4.c:156 ../tui/nmt-page-ip6.c:156
-msgid "DNS servers"
-msgstr "Сервери DNS"
-
-#: ../tui/nmt-page-ip4.c:162 ../tui/nmt-page-ip6.c:162
-msgid "Search domains"
-msgstr "Домени пошуку"
-
-#: ../tui/nmt-page-ip4.c:177 ../tui/nmt-page-ip6.c:175
-msgid "Routing"
-msgstr "Маршрути"
-
-#: ../tui/nmt-page-ip4.c:179 ../tui/nmt-page-ip6.c:177
-msgid "Never use this network for default route"
-msgstr "Ðіколи не викориÑтовувати цю мережу Ð´Ð»Ñ Ñ‚Ð¸Ð¿Ð¾Ð²Ð¾Ñ— маршрутизації"
-
-#: ../tui/nmt-page-ip4.c:187
-msgid "Require IPv4 addressing for this connection"
-msgstr "Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ‚Ñ€Ñ–Ð±Ð½Ðµ адреÑÑƒÐ²Ð°Ð½Ð½Ñ IPv4"
-
-#: ../tui/nmt-page-ip6.c:41
-msgid "Ignore"
-msgstr "Ігнорувати"
-
-#: ../tui/nmt-page-ip6.c:43
-msgid "Automatic (DHCP-only)"
-msgstr "Ðвтоматично (лише DHCP)"
-
-#: ../tui/nmt-page-ip6.c:54
-msgid "IPv6 CONFIGURATION"
-msgstr "ÐÐЛÐШТУВÐÐÐЯ IPv6"
+msgid "connection does not match access point"
+msgstr "Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ відповідає точці доÑтупу"
-#: ../tui/nmt-page-ip6.c:185
-msgid "Require IPv6 addressing for this connection"
-msgstr "Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ‚Ñ€Ñ–Ð±Ð½Ðµ адреÑÑƒÐ²Ð°Ð½Ð½Ñ IPv6"
-
-#: ../tui/nmt-page-main.c:134
-msgid "Hide"
-msgstr "Сховати"
-
-#: ../tui/nmt-page-main.c:134
-msgid "Show"
-msgstr "Показати"
-
-#: ../tui/nmt-page-main.c:181
-msgid "Profile name"
-msgstr "Ðазва профілю"
-
-#: ../tui/nmt-page-main.c:188
-msgid "Device"
-msgstr "ПриÑтрій"
-
-#: ../tui/nmt-page-main.c:252
-msgid "Automatically connect"
-msgstr "З’єднуватиÑÑŒ автоматично"
-
-#: ../tui/nmt-page-main.c:258
-msgid "Available to all users"
-msgstr "ДоÑтупне уÑім кориÑтувачам"
-
-#: ../tui/nmt-page-team-port.c:45
-msgid "TEAM PORT"
-msgstr "ПОРТ КОМÐÐДИ"
-
-#: ../tui/nmt-page-team-port.c:100 ../tui/nmt-page-team.c:170
-msgid "JSON configuration"
-msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ JSON"
-
-#: ../tui/nmt-page-team.c:51
-msgid "TEAM"
-msgstr "КОМÐÐДÐ"
-
-#: ../tui/nmt-page-vlan.c:109
-msgid "Parent"
-msgstr "БатьківÑький"
-
-#: ../tui/nmt-page-vlan.c:124
-msgid "VLAN id"
-msgstr "Ід. VLAN"
-
-#: ../tui/nmt-page-wifi.c:58
-msgid "WI-FI"
-msgstr "WI-FI"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:614
+msgid "Access point is unencrypted but setting specifies security"
+msgstr ""
+"Обмін даними із точкою доÑтупу Ñ” незашифрованим, але Ð·Ð°Ð¿Ð¸Ñ Ð²ÐºÐ°Ð·ÑƒÑ” за "
+"захищене з’єднаннÑ"
-#: ../tui/nmt-page-wifi.c:69
-msgctxt "Wi-Fi"
-msgid "Client"
-msgstr "Клієнт"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:703
+msgid ""
+"WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic "
+"WEP"
+msgstr ""
+"Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð·Ð° допомогою WPA Ñ” неÑуміÑним з LEAP без EAP (оригінальним) "
+"або динамічним WEP"
-#: ../tui/nmt-page-wifi.c:70
-msgid "Access Point"
-msgstr "Точка доÑтупу"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:713
+msgid "WPA authentication is incompatible with Shared Key authentication"
+msgstr ""
+"Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð·Ð° допомогою WPA Ñ” неÑуміÑним із розпізнаваннÑм за допомогою "
+"розповÑюдженого ключа"
-#: ../tui/nmt-page-wifi.c:71
-msgid "Ad-Hoc Network"
-msgstr "Спеціальна мережа"
+#: ../src/devices/wifi/nm-wifi-ap-utils.c:760
+msgid "Failed to determine AP security information"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ дані щодо захиÑту точки доÑтупу"
-#: ../tui/nmt-page-wifi.c:76
-msgctxt "Wi-Fi"
-msgid "Automatic"
-msgstr "Ðвтоматично"
+#: ../src/devices/wwan/nm-modem-broadband.c:475
+msgid "GSM mobile broadband connection requires a 'gsm' setting"
+msgstr ""
+"Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð·Ð° допомогою мобільної радіомережі GSM потребує параметра «gsm»"
-#. 802.11a Wi-Fi network
-#: ../tui/nmt-page-wifi.c:78
-msgid "A (5 GHz)"
-msgstr "A (5 ГГц)"
+#: ../src/nm-config.c:356
+msgid "Config file location"
+msgstr "Ð Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° налаштувань"
-#. 802.11b / 802.11g Wi-Fi network
-#: ../tui/nmt-page-wifi.c:80
-msgid "B/G (2.4 GHz)"
-msgstr "B/G (2,4 ГГц)"
+#: ../src/nm-config.c:356
+msgid "/path/to/config.file"
+msgstr "/шлÑÑ…/до/файла.налаштувань"
-#: ../tui/nmt-page-wifi.c:85
-msgctxt "Wi-Fi security"
-msgid "None"
-msgstr "Ðемає"
+#: ../src/nm-config.c:357
+msgid "Config directory location"
+msgstr "Ð Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñƒ налаштувань"
-#: ../tui/nmt-page-wifi.c:86
-msgid "WPA & WPA2 Personal"
-msgstr "WPA/WPA2 Personal"
+#: ../src/nm-config.c:357
+msgid "/path/to/config/dir"
+msgstr "/шлÑÑ…/до/каталогу/налаштувань"
-#: ../tui/nmt-page-wifi.c:87
-msgid "WPA & WPA2 Enterprise"
-msgstr "WPA/WPA2 Enterprise"
+#: ../src/nm-config.c:359
+msgid "List of plugins separated by ','"
+msgstr "СпиÑок додатків, відокремлених комами («,»)"
-#: ../tui/nmt-page-wifi.c:88
-msgid "WEP 40/128-bit Key (Hex or ASCII)"
-msgstr "40/128-бітовий ключ WEP (шіÑтнадцÑтковий або ASCII)"
+#: ../src/nm-config.c:359
+msgid "plugin1,plugin2"
+msgstr "додаток1,додаток2"
-#: ../tui/nmt-page-wifi.c:89
-msgid "WEP 128-bit Passphrase"
-msgstr "128-бітовий пароль WEP"
+#. These three are hidden for now, and should eventually just go away.
+#: ../src/nm-config.c:362
+msgid "An http(s) address for checking internet connectivity"
+msgstr "ÐдреÑа http(s) Ð´Ð»Ñ Ñпроб перевірки можливоÑÑ‚Ñ– вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
-#: ../tui/nmt-page-wifi.c:90
-msgid "Dynamic WEP (802.1x)"
-msgstr "Динамічна WEP (802.1x)"
+#: ../src/nm-config.c:363
+msgid "The interval between connectivity checks (in seconds)"
+msgstr "Інтервал між перевірками можливоÑÑ‚Ñ– Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ (у Ñекундах)"
-#: ../tui/nmt-page-wifi.c:91
-msgid "LEAP"
-msgstr "LEAP"
+#: ../src/nm-config.c:364
+msgid "The expected start of the response"
+msgstr "Очікуваний початок відповіді"
-#: ../tui/nmt-page-wifi.c:96
-msgctxt "WEP key index"
-msgid "1 (Default)"
-msgstr "1 (типово)"
+#: ../src/nm-config.c:364
+msgid "Bingo!"
+msgstr "Влучно!"
-#: ../tui/nmt-page-wifi.c:97
-msgctxt "WEP key index"
-msgid "2"
-msgstr "2"
+#. Interface/IP config
+#: ../src/nm-iface-helper.c:286
+msgid "The interface to manage"
+msgstr "Ð†Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð´Ð»Ñ ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ"
-#: ../tui/nmt-page-wifi.c:98
-msgctxt "WEP key index"
-msgid "3"
-msgstr "3"
+#: ../src/nm-iface-helper.c:286
+msgid "eth0"
+msgstr "eth0"
-#: ../tui/nmt-page-wifi.c:99
-msgctxt "WEP key index"
-msgid "4"
-msgstr "4"
+#: ../src/nm-iface-helper.c:287
+msgid "Connection UUID"
+msgstr "UUID з’єднаннÑ"
-#: ../tui/nmt-page-wifi.c:104
-msgid "Open System"
-msgstr "Відкрита ÑиÑтема"
+#: ../src/nm-iface-helper.c:287
+msgid "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
+msgstr "661e8cd0-b618-46b8-9dc9-31a52baaa16b"
-#: ../tui/nmt-page-wifi.c:105
-msgid "Shared Key"
-msgstr "Відкритий ключ"
+#: ../src/nm-iface-helper.c:288
+msgid "Whether to manage IPv6 SLAAC"
+msgstr "Чи Ñлід керувати SLAAC IPv6"
-#: ../tui/nmt-page-wifi.c:253
-msgid "Channel"
-msgstr "Канал"
+#: ../src/nm-iface-helper.c:289
+msgid "Whether SLAAC must be successful"
+msgstr "Чи має бути SLAAC уÑпішним"
-#: ../tui/nmt-page-wifi.c:258
-msgid "Security"
-msgstr "ЗахиÑÑ‚"
+#: ../src/nm-iface-helper.c:290
+msgid "Use an IPv6 temporary privacy address"
+msgstr "ВикориÑтовувати тимчаÑову приватну адреÑу IPv6"
-#: ../tui/nmt-page-wifi.c:274 ../tui/nmt-page-wifi.c:305
-#: ../tui/nmt-page-wifi.c:335 ../tui/nmt-secret-agent.c:214
-#: ../tui/nmt-secret-agent.c:251 ../tui/nmt-secret-agent.c:281
-#: ../tui/nmt-secret-agent.c:314 ../tui/nmt-secret-agent.c:380
-#: ../tui/nmt-secret-agent.c:393 ../tui/nmt-secret-agent.c:409
-msgid "Password"
-msgstr "Пароль"
+#: ../src/nm-iface-helper.c:291
+msgid "Current DHCPv4 address"
+msgstr "Поточна адреÑа DHCPv4"
-#. "wpa-enterprise"
-#. FIXME
-#: ../tui/nmt-page-wifi.c:279
-msgid "(No support for wpa-enterprise yet...)"
-msgstr "(Підтримки wpa-enterprise ще не передбачено...)"
+#: ../src/nm-iface-helper.c:292
+msgid "Whether DHCPv4 must be successful"
+msgstr "Чи має DHCPv4 бути уÑпішним"
-#: ../tui/nmt-page-wifi.c:286 ../tui/nmt-secret-agent.c:265
-msgid "Key"
-msgstr "Ключ"
+#: ../src/nm-iface-helper.c:293
+msgid "Hex-encoded DHCPv4 client ID"
+msgstr "Закодований у шіÑтнадцÑткову форму ідентифікатор клієнта DHCPv4"
-#: ../tui/nmt-page-wifi.c:289 ../tui/nmt-page-wifi.c:308
-msgid "WEP index"
-msgstr "Ð†Ð½Ð´ÐµÐºÑ WEP"
+#: ../src/nm-iface-helper.c:294
+msgid "Hostname to send to DHCP server"
+msgstr "Ðазва вузла Ð´Ð»Ñ Ð½Ð°Ð´ÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð° Ñервер DHCP"
-#: ../tui/nmt-page-wifi.c:297 ../tui/nmt-page-wifi.c:316
-msgid "Authentication"
-msgstr "РозпізнаваннÑ"
+#: ../src/nm-iface-helper.c:294
+msgid "barbar"
+msgstr "щоÑьщоÑÑŒ"
-#. "dynamic-wep"
-#. FIXME
-#: ../tui/nmt-page-wifi.c:322
-msgid "(No support for dynamic-wep yet...)"
-msgstr "(Підтримки dynamic-wep ще не передбачено...)"
+#: ../src/nm-iface-helper.c:295
+#| msgid "Route priority"
+msgid "Route priority for IPv4"
+msgstr "Пріоритет маршруту Ð´Ð»Ñ IPv4"
-#. TTLS and PEAP are actually much more complicated, but this complication
-#. * is not visible here since we only care about phase2 authentication
-#. * (and don't even care of which one)
-#.
-#: ../tui/nmt-page-wifi.c:329 ../tui/nmt-secret-agent.c:209
-#: ../tui/nmt-secret-agent.c:304
-msgid "Username"
-msgstr "КориÑтувач"
+#: ../src/nm-iface-helper.c:295
+#| msgid "10"
+msgid "0"
+msgstr "0"
-#: ../tui/nmt-password-fields.c:130
-msgid "Ask for this password every time"
-msgstr "Запитувати про цей пароль щоразу"
+#: ../src/nm-iface-helper.c:296
+#| msgid "Route priority"
+msgid "Route priority for IPv6"
+msgstr "Пріоритет маршруту Ð´Ð»Ñ IPv6"
-#: ../tui/nmt-password-fields.c:131
-msgid "Show password"
-msgstr "Показати фразу паролÑ"
+#: ../src/nm-iface-helper.c:296
+msgid "1024"
+msgstr "1024"
-#: ../tui/nmt-route-table.c:226
-msgid "Destination"
-msgstr "ПризначеннÑ"
+#: ../src/nm-iface-helper.c:297
+msgid "Hex-encoded Interface Identifier"
+msgstr "Закодований у шіÑтнадцÑткове чиÑло ідентифікатор інтерфейÑу"
-#: ../tui/nmt-route-table.c:226
-msgid "Prefix"
-msgstr "ПрефікÑ"
+#: ../src/nm-iface-helper.c:318
+msgid ""
+"nm-iface-helper is a small, standalone process that manages a single network "
+"interface."
+msgstr ""
+"nm-iface-helper — малий окремий процеÑ, Ñкий керує окремим інтерфейÑом "
+"мережі."
-#: ../tui/nmt-route-table.c:235
-msgid "Next Hop"
-msgstr "ÐаÑтупне переÑиланнÑ"
+#: ../src/nm-iface-helper.c:327
+#, c-format
+msgid "An interface name and UUID are required\n"
+msgstr "Потрібні назва Ñ– UUID інтерфейÑу\n"
-#: ../tui/nmt-route-table.c:243
-msgid "Metric"
-msgstr "Метрика"
+#: ../src/nm-iface-helper.c:392
+#, c-format
+msgid "Failed to find interface index for %s\n"
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ покажчик інтерфейÑу Ð´Ð»Ñ %s\n"
-#: ../tui/nmt-route-table.c:263
-msgid "No custom routes are defined."
-msgstr "Ðетипових маршрутів не визначено."
+#: ../src/nm-iface-helper.c:408
+#, c-format
+msgid "(%s): Invalid IID %s\n"
+msgstr "(%s): некоректний IID %s\n"
-#: ../tui/nmt-secret-agent.c:223
-msgid "Identity"
-msgstr "Профіль"
+#: ../src/nm-logging.c:140
+#, c-format
+msgid "Unknown log level '%s'"
+msgstr "Ðевідомий рівень Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ, «%s»"
-#: ../tui/nmt-secret-agent.c:228
-msgid "Private key password"
-msgstr "Пароль закритого ключа"
+#: ../src/nm-logging.c:222
+#, c-format
+msgid "Unknown log domain '%s'"
+msgstr "Ðевідомий домен Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ, «%s»"
-#: ../tui/nmt-secret-agent.c:309
-msgid "Service"
-msgstr "Служба"
+#: ../src/nm-manager.c:3421
+msgid "VPN connection"
+msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN"
-#: ../tui/nmt-secret-agent.c:340
-msgid "Authentication required by wireless network"
-msgstr "Ð”Ð»Ñ Ð´Ð¾Ñтупу до бездротової мережі Ñлід пройти розпізнаваннÑ"
+#: ../src/nm-sleep-monitor-systemd.c:115
+msgid "NetworkManager needs to turn off networks"
+msgstr "NetworkManager потрібно вимкнути роботу мереж"
-#: ../tui/nmt-secret-agent.c:341
+#: ../src/settings/plugins/ibft/plugin.c:66
#, c-format
-msgid ""
-"Passwords or encryption keys are required to access the wireless network "
-"'%s'."
-msgstr ""
-"Ð”Ð»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð´Ð¾Ñтупу до бездротової мережі потрібні паролі або ключі "
-"ÑˆÐ¸Ñ„Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Â«%s»."
-
-#: ../tui/nmt-secret-agent.c:349
-msgid "Wired 802.1X authentication"
-msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ Ð´Ñ€Ð¾Ñ‚Ð¾Ð²Ð¾Ñ— мережі 802.1X"
+msgid "ibft: failed to read iscsiadm records: %s"
+msgstr "ibft: не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ запиÑи iscsiadm: %s"
-#: ../tui/nmt-secret-agent.c:352
-msgid "Network name"
-msgstr "Ðазва мережі"
+#: ../src/settings/plugins/ibft/plugin.c:74
+#, c-format
+msgid "ibft: read connection '%s'"
+msgstr "ibft: Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»"
-#: ../tui/nmt-secret-agent.c:359
-msgid "DSL authentication"
-msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ DSL"
+#: ../src/settings/plugins/ibft/plugin.c:80
+#, c-format
+msgid "ibft: failed to read iscsiadm record: %s"
+msgstr "ibft: не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ iscsiadm: %s"
-#: ../tui/nmt-secret-agent.c:367
-msgid "PIN code required"
-msgstr "Потрібен PIN-код"
+#: ../src/settings/plugins/ifcfg-rh/reader.c:112
+msgid "System"
+msgstr "СиÑтема"
-#: ../tui/nmt-secret-agent.c:368
-msgid "PIN code is needed for the mobile broadband device"
-msgstr ""
-"Ð”Ð»Ñ ÐºÐ¾Ñ€Ð¸ÑÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¸Ñтроєм мобільної широкоÑмугової мережі Ñлід вказати PIN-"
-"код"
+#~ msgid "Failed to set signal mask: %d"
+#~ msgstr "Ðе вдалоÑÑ Ð²Ñтановити маÑку Ñигналу: %d"
-#: ../tui/nmt-secret-agent.c:370
-msgid "PIN"
-msgstr "PIN"
+#~ msgid "Failed to create signal handling thread: %d"
+#~ msgstr "Ðе вдалоÑÑ Ñтворити потік обробки Ñигналів: %d"
-#: ../tui/nmt-secret-agent.c:376 ../tui/nmt-secret-agent.c:389
-#: ../tui/nmt-secret-agent.c:405
-msgid "Mobile broadband network password"
-msgstr "Пароль до мобільної широкоÑмугової мережі"
+#~| msgid "DUN connection %d"
+#~ msgid "DUN connection"
+#~ msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ DUN"
-#: ../tui/nmt-secret-agent.c:377 ../tui/nmt-secret-agent.c:390
-#: ../tui/nmt-secret-agent.c:406
-#, c-format
-msgid "A password is required to connect to '%s'."
-msgstr "Ð”Ð»Ñ Ð²ÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· «%s» Ñлід вказати пароль."
+#~ msgid "invalid prefix '%s'; <1-32> allowed"
+#~ msgstr ""
+#~ "некоректний префікÑ, «%s»; можна викориÑтовувати префікÑи лише у "
+#~ "діапазоні <1-32>"
-#: ../tui/nmt-slave-list.c:138
-msgid "Select the type of slave connection you wish to add."
-msgstr "Виберіть тип підлеглого з’єднаннÑ, Ñке ви хочете додати."
+#~ msgid "invalid prefix '%s'; <1-128> allowed"
+#~ msgstr ""
+#~ "некоректний префікÑ, «%s»; можна викориÑтовувати префікÑи лише у "
+#~ "діапазоні <1-128>"
-#: ../tui/nmt-widget-list.c:142
-msgid "Add..."
-msgstr "Додати…"
+#~| msgid "invalid next hop address '%s'"
+#~ msgid "invalid route destination address '%s'"
+#~ msgstr "некоректна адреÑа Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ€ÑˆÑ€ÑƒÑ‚Ñƒ, «%s»"
-#: ../tui/nmt-widget-list.c:205
-msgid "Remove"
-msgstr "Вилучити"
+#~ msgid "invalid next hop address '%s'"
+#~ msgstr "некоректна адреÑа наÑтупного переходу, «%s»"
-#: ../tui/nmtui-connect.c:94
-msgid "Activation failed"
-msgstr "Ðевдала Ñпроба активації"
+#~ msgid ""
+#~ "Error: Device '%s' is waiting for slaves before proceeding with "
+#~ "activation."
+#~ msgstr ""
+#~ "Помилка: приÑтрій «%s» очікує на реакцію підлеглих приÑтроїв, перш ніж "
+#~ "продовжувати активацію."
-#: ../tui/nmtui-connect.c:142
-msgid "Connecting..."
-msgstr "Ð’ÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ..."
+#~ msgid ""
+#~ "Error: 'mode': '%s' is not a valid InfiniBand transport mode [datagram, "
+#~ "connected]."
+#~ msgstr ""
+#~ "Помилка: «mode»: «%s» не Ñ” коректним режимом Ð¿ÐµÑ€ÐµÐ´Ð°Ð²Ð°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ… InfiniBand "
+#~ "[datagram, connected]."
-#: ../tui/nmtui-connect.c:172 ../tui/nmtui-connect.c:195
-#, c-format
-msgid "Could not activate connection: %s"
-msgstr "Ðе вдалоÑÑ Ð·Ð°Ð´Ñ–Ñти з’єднаннÑ: %s"
+#~ msgid "Error: Could not get system settings."
+#~ msgstr "Помилка: не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ параметри ÑиÑтеми."
-#: ../tui/nmtui-connect.c:259 ../tui/nmtui-connect.c:308
-msgid "Activate"
-msgstr "Ðктивізувати"
+#~ msgid "Error: Can't obtain connections: settings service is not running."
+#~ msgstr ""
+#~ "Помилка: не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ ÑпиÑок з’єднань: Ñлужба параметрів не працює."
-#: ../tui/nmtui-connect.c:261
-msgid "Deactivate"
-msgstr "Вимкнути"
+#~ msgid "not running"
+#~ msgstr "не виконуєтьÑÑ"
-#: ../tui/nmtui-connect.c:313 ../tui/nmtui-edit.c:95 ../tui/nmtui.c:115
-msgid "Quit"
-msgstr "Вийти"
+#~ msgid "Error: %s"
+#~ msgstr "Помилка: %s"
-#: ../tui/nmtui-connect.c:336
-#, c-format
-msgid "No such connection '%s'"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s» не Ñ–Ñнує"
+#~ msgid "0 (unknown)"
+#~ msgstr "0 (невідомо)"
-#: ../tui/nmtui-connect.c:338
-msgid "Connection is already active"
-msgstr "Ð—â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð²Ð¶Ðµ Ñ” активним"
+#~ msgid "any, "
+#~ msgstr "будь-Ñкий, "
-#: ../tui/nmtui-edit.c:200
-msgid "Create"
-msgstr "Створити"
+#~ msgid "900 MHz, "
+#~ msgstr "900 МГц, "
-#: ../tui/nmtui-edit.c:342
-msgid "Select the type of connection you wish to create."
-msgstr "Виберіть тип з’єднаннÑ, Ñке Ñлід Ñтворити."
+#~ msgid "1800 MHz, "
+#~ msgstr "1800 МГц, "
-#: ../tui/nmtui-edit.c:350
-msgid ""
-"If you are creating a VPN, and the VPN connection you wish to create does "
-"not appear in the list, you may not have the correct VPN plugin installed."
-msgstr ""
-"Якщо ви Ñтворюєте VPN Ñ– пункту Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VPN, Ñке ви хочете Ñтворити, немає "
-"у ÑпиÑку, ймовірно, додаток VPN не вÑтановлено або вÑтановлено неналежним "
-"чином."
+#~ msgid "1900 MHz, "
+#~ msgstr "1900 МГц, "
-#: ../tui/nmtui-edit.c:386 ../tui/nmtui-edit.c:402
-msgid "New Connection"
-msgstr "Ðове з’єднаннÑ"
+#~ msgid "850 MHz, "
+#~ msgstr "800 МГц, "
-#: ../tui/nmtui-edit.c:439
-#, c-format
-msgid "Unable to delete connection: %s"
-msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ з’єднаннÑ: %s"
+#~ msgid "WCDMA 3GPP UMTS 2100 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 2100 МГц, "
-#: ../tui/nmtui-edit.c:468
-#, c-format
-msgid "Are you sure you want to delete the connection '%s'?"
-msgstr "Ви Ñправді хочете вилучити Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Â«%s»?"
+#~ msgid "WCDMA 3GPP UMTS 1800 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1800 МГц, "
-#: ../tui/nmtui-edit.c:482
-#, c-format
-msgid "Could not delete connection: %s"
-msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ з’єднаннÑ: %s"
+#~ msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1700/2100 МГц, "
-#: ../tui/nmtui-hostname.c:47
-msgid "Set Hostname"
-msgstr "Ð’Ñтановити назву вузла"
+#~ msgid "WCDMA 3GPP UMTS 800 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 800 МГц, "
-#: ../tui/nmtui-hostname.c:55
-msgid "Hostname"
-msgstr "Ðазва вузла"
+#~ msgid "WCDMA 3GPP UMTS 850 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 850 МГц, "
-#. Translators: this indicates the result. ie, "I have set the hostname to ..."
-#: ../tui/nmtui-hostname.c:114
-#, c-format
-msgid "Set hostname to '%s'"
-msgstr "Ð’Ñтановити назву вузла «%s»"
+#~ msgid "WCDMA 3GPP UMTS 900 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 900 МГц, "
-#: ../tui/nmtui-hostname.c:116
-#, c-format
-msgid "Unable to set hostname: %s"
-msgstr "Ðе вдалоÑÑ Ð²Ñтановити назву вузла: %s"
+#~ msgid "WCDMA 3GPP UMTS 1700 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1700 МГц, "
-#: ../tui/nmtui.c:60 ../tui/nmtui.c:63
-msgid "connection"
-msgstr "з’єднаннÑ"
+#~ msgid "WCDMA 3GPP UMTS 1900 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 1900 МГц, "
-#: ../tui/nmtui.c:61
-msgid "Edit a connection"
-msgstr "Змінити Ð·Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ"
+#~ msgid "WCDMA 3GPP UMTS 2600 MHz, "
+#~ msgstr "WCDMA 3GPP UMTS 2600 МГц, "
-#: ../tui/nmtui.c:64
-msgid "Activate a connection"
-msgstr "ЗадіÑти з’єднаннÑ"
+#~ msgid "'%s' is not valid (use ip[/prefix] [gateway])"
+#~ msgstr "«%s» не Ñ” коректним значеннÑм (мало бути ip[/префікÑ] [шлюз])"
-#: ../tui/nmtui.c:66
-msgid "new hostname"
-msgstr "нова назва вузла"
+#~ msgid "'%s' doesn't match the virtual interface name '%s'"
+#~ msgstr "«%s» не відповідає назві віртуального інтерфейÑу «%s»"
-#: ../tui/nmtui.c:67
-msgid "Set system hostname"
-msgstr "Ð’Ñтановити назву вузла ÑиÑтеми"
+#~ msgid "IPv4 configuration is not allowed for slave"
+#~ msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚Ð¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ IPv4 Ð´Ð»Ñ Ð¿Ñ–Ð´Ð»ÐµÐ³Ð»Ð¾Ð³Ð¾ приÑтрою неможливе"
-#: ../tui/nmtui.c:90
-msgid "NetworkManager TUI"
-msgstr "КонÑольний Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð´Ð¾ NetworkManager"
+#~ msgid "IPv6 configuration is not allowed for slave"
+#~ msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚Ð¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ IPv6 Ð´Ð»Ñ Ð¿Ñ–Ð´Ð»ÐµÐ³Ð»Ð¾Ð³Ð¾ приÑтрою неможливе"
-#: ../tui/nmtui.c:98
-msgid "Please select an option"
-msgstr "Будь лаÑка, виберіть варіант"
+#~ msgid "IPv4 address / label count mismatch (%d vs %d)"
+#~ msgstr "ÐевідповідніÑÑ‚ÑŒ кількоÑÑ‚Ñ– Ð°Ð´Ñ€ÐµÑ IPv4 Ñ– кількоÑÑ‚Ñ– міток (%d Ñ– %d)"
-#: ../tui/nmtui.c:159
-msgid "Usage"
-msgstr "КориÑтуваннÑ"
+#~ msgid "GModules are not supported on your platform!\n"
+#~ msgstr "Підтримки GModules на цій платформі не передбачено!\n"
-#: ../tui/nmtui.c:241
-msgid "Could not parse arguments"
-msgstr "Ðе вдалоÑÑ Ð¾Ð±Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ аргументи"
+#~ msgid "'dhclient' could be found."
+#~ msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ «dhclient»."
-#: ../tui/nmtui.c:251
-msgid "NetworkManager is not running."
-msgstr "NetworkManager не запущено."
+#~ msgid "'dhcpcd' could be found."
+#~ msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ «dhcpcd»."
-#~ msgid "invalid IPv4 route '%s'"
-#~ msgstr "некоректний маршрут IPv4, «%s»"
+#~ msgid "Error saving connection: %s"
+#~ msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби зберегти Ð·Ð°Ð¿Ð¸Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ: %s"
#~ msgid "invalid prefix '%s'; <0-32> allowed"
#~ msgstr ""
@@ -7446,37 +8690,17 @@ msgstr "NetworkManager не запущено."
#~ msgid "There are 3 optional arguments for '%s' connection type.\n"
#~ msgstr "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «%s» передбачено 3 додаткових аргументи.\n"
-#~ msgid "Do you want to provide them? (yes/no) [yes] "
-#~ msgstr "Хочете вказати назву? (yes — так/no — ні) [типово yes] "
-
-#~ msgid "There are 5 optional arguments for 'InfiniBand' connection type.\n"
-#~ msgstr ""
-#~ "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «InfiniBand» передбачено 5 додаткових аргументів.\n"
-
#~ msgid "Transport mode (datagram or connected) [datagram]: "
#~ msgstr "Режим Ð¿ÐµÑ€ÐµÐ´Ð°Ð²Ð°Ð½Ð½Ñ (datagram або connected) [типово datagram]: "
-#~ msgid "There is 1 optional argument for 'WiMax' connection type.\n"
-#~ msgstr "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «WiMax» передбачено один додатковий аргумент.\n"
-
-#~ msgid "There are 4 optional arguments for 'PPPoE' connection type.\n"
-#~ msgstr "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «PPPoE» передбачено 4 додаткових аргументи.\n"
-
#~ msgid ""
#~ "There are 2 optional arguments for 'mobile broadband' connection type.\n"
#~ msgstr ""
#~ "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «mobile broadband» передбачено 2 додаткових аргументи.\n"
-#~ msgid "There is 1 optional argument for 'bluetooth' connection type.\n"
-#~ msgstr ""
-#~ "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «bluetooth» передбачено один додатковий аргумент.\n"
-
#~ msgid "Bluetooth type (panu, dun-gsm or dun-cdma) [panu]: "
#~ msgstr "Тип bluetooth (panu, dun-gsm або dun-cdma) [типово panu]: "
-#~ msgid "There are 4 optional arguments for 'VLAN' connection type.\n"
-#~ msgstr "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «VLAN» передбачено 4 додаткових аргументів.\n"
-
#~ msgid "There are optional arguments for 'bond' connection type.\n"
#~ msgstr "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «bond» передбачено додаткові аргументи.\n"
@@ -7504,9 +8728,6 @@ msgstr "NetworkManager не запущено."
#~ msgid "There is 1 optional argument for 'VPN' connection type.\n"
#~ msgstr "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «VPN» передбачено один додатковий аргумент.\n"
-#~ msgid "There are 2 optional arguments for 'OLPC Mesh' connection type.\n"
-#~ msgstr "Ð”Ð»Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½ÑŒ типу «OLPC-Mesh» передбачено 2 додаткових аргументи.\n"
-
#~ msgid "Error: '%s' setting not present\n"
#~ msgstr "Помилка: немає параметра «%s»\n"
@@ -7605,12 +8826,6 @@ msgstr "NetworkManager не запущено."
#~ msgid "List of active connections"
#~ msgstr "СпиÑок активних з’єднань"
-#~ msgid "Error: 'show active': %s"
-#~ msgstr "Помилка: «show active»: %s"
-
-#~ msgid "Error: 'master': '%s' is not valid UUID nor interface."
-#~ msgstr "Помилка: «master»: «%s» не Ñ” коректним UUID Ñ– не Ñ” інтерфейÑом."
-
#~ msgid ""
#~ "save :: save the connection\n"
#~ "\n"
@@ -7810,25 +9025,14 @@ msgstr "NetworkManager не запущено."
#~ msgid "setting '%s' is required"
#~ msgstr "Ñлід визначити параметр «%s»"
-#~ msgid "'%s' setting is required for the connection when the property is set"
-#~ msgstr ""
-#~ "Ð´Ð»Ñ Ð²ÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· цією вÑтановленою влаÑтивіÑÑ‚ÑŽ потрібен "
-#~ "параметр «%s»"
-
#~ msgid "unable to allocate netlink link cache for monitoring link status: %s"
#~ msgstr ""
#~ "не вдалоÑÑ Ñ€Ð¾Ð·Ð¼Ñ–Ñтити у пам’ÑÑ‚Ñ– кеш з’єднань netlink Ð´Ð»Ñ ÑпоÑÑ‚ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° "
#~ "Ñтаном з’єднань: %s"
-#~ msgid "error updating link cache: %s"
-#~ msgstr "помилка під Ñ‡Ð°Ñ Ñпроби Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ ÐºÐµÑˆÑƒ з’єднаннÑ: %s"
-
#~ msgid "Waits for a successful connection in NetworkManager."
#~ msgstr "Очікувати на уÑпішне Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñƒ NetworkManager."
-#~ msgid "Error: no valid parameter specified."
-#~ msgstr "Помилка: не вказано коректних параметрів."
-
#~ msgid "Error: Can't find out if NetworkManager is running: %s."
#~ msgstr "Помилка: не вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸, чи працює NetworkManager: %s."
@@ -7841,9 +9045,6 @@ msgstr "NetworkManager не запущено."
#~ msgid "Error: could not connect to D-Bus."
#~ msgstr "Помилка: не вдалоÑÑ Ð²Ñтановити Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· D-Bus."
-#~ msgid "Error: Device '%s' is not a WiFi device."
-#~ msgstr "Помилка: приÑтрій «%s» не Ñ” приÑтроєм WiFi."
-
#~ msgid "Error: 'nm status': %s; allowed fields: %s"
#~ msgstr "Помилка: «nm status»: %s; дозволені полÑ: %s"
diff --git a/src/Makefile.am b/src/Makefile.am
index d568c00a46..64aa9dd485 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,18 +2,19 @@ include $(GLIB_MAKEFILE)
@GNOME_CODE_COVERAGE_RULES@
-SUBDIRS = \
- . \
- devices/adsl \
- devices/wifi \
- dhcp-manager \
- ppp-manager \
- settings/plugins
+SUBDIRS = \
+ . \
+ dhcp-manager \
+ ppp-manager \
+ settings/plugins \
+ devices/adsl
if WITH_MODEM_MANAGER_1
-SUBDIRS += \
- devices/wwan \
- devices/bluetooth
+SUBDIRS += devices/wwan devices/bluetooth
+endif
+
+if WITH_WIFI
+SUBDIRS += devices/wifi
endif
if WITH_WIMAX
@@ -48,6 +49,84 @@ AM_CPPFLAGS = \
# primarily for its side effect of removing duplicates.
AM_CPPFLAGS += $(foreach d,$(sort $(dir $(libNetworkManager_la_SOURCES))),-I$(top_srcdir)/src/$d)
+noinst_LTLIBRARIES = \
+ libNetworkManager.la \
+ libnm-iface-helper.la \
+ libsystemd-dhcp.la
+
+######################
+# libsystemd-dhcp
+######################
+
+SYSTEMD_DHCP_CFLAGS = \
+ -I$(top_srcdir)/src/dhcp-manager/systemd-dhcp/src/systemd \
+ -I$(top_srcdir)/src/dhcp-manager/systemd-dhcp/src/libsystemd-network \
+ -I$(top_srcdir)/src/dhcp-manager/systemd-dhcp/src/shared \
+ -I$(top_srcdir)/src/dhcp-manager/systemd-dhcp
+
+libsystemd_dhcp_la_SOURCES = \
+ dhcp-manager/systemd-dhcp/src/libsystemd/sd-id128/sd-id128.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-network.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-lease-internal.h \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-option.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-lease.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-option.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.h \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-lease.c \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-protocol.h \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-internal.h \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-protocol.h \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-lease-internal.h \
+ dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c \
+ dhcp-manager/systemd-dhcp/src/shared/async.h \
+ dhcp-manager/systemd-dhcp/src/shared/time-util.h \
+ dhcp-manager/systemd-dhcp/src/shared/siphash24.h \
+ dhcp-manager/systemd-dhcp/src/shared/time-util.c \
+ dhcp-manager/systemd-dhcp/src/shared/socket-util.h \
+ dhcp-manager/systemd-dhcp/src/shared/sparse-endian.h \
+ dhcp-manager/systemd-dhcp/src/shared/macro.h \
+ dhcp-manager/systemd-dhcp/src/shared/refcnt.h \
+ dhcp-manager/systemd-dhcp/src/shared/util.c \
+ dhcp-manager/systemd-dhcp/src/shared/in-addr-util.c \
+ dhcp-manager/systemd-dhcp/src/shared/siphash24.c \
+ dhcp-manager/systemd-dhcp/src/shared/util.h \
+ dhcp-manager/systemd-dhcp/src/shared/in-addr-util.h \
+ dhcp-manager/systemd-dhcp/src/shared/list.h \
+ dhcp-manager/systemd-dhcp/src/shared/log.h \
+ dhcp-manager/systemd-dhcp/src/shared/fileio.h \
+ dhcp-manager/systemd-dhcp/src/shared/fileio.c \
+ dhcp-manager/systemd-dhcp/src/shared/path-util.c \
+ dhcp-manager/systemd-dhcp/src/shared/path-util.h \
+ dhcp-manager/systemd-dhcp/src/shared/strv.h \
+ dhcp-manager/systemd-dhcp/src/shared/strv.c \
+ dhcp-manager/systemd-dhcp/src/shared/unaligned.h \
+ dhcp-manager/systemd-dhcp/src/shared/utf8.h \
+ dhcp-manager/systemd-dhcp/src/shared/utf8.c \
+ dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-lease.h \
+ dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-client.h \
+ dhcp-manager/systemd-dhcp/src/systemd/sd-id128.h \
+ dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-lease.h \
+ dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-client.h \
+ dhcp-manager/systemd-dhcp/src/systemd/sd-event.h \
+ dhcp-manager/systemd-dhcp/src/systemd/_sd-common.h \
+ dhcp-manager/systemd-dhcp/nm-sd-adapt.h \
+ dhcp-manager/systemd-dhcp/nm-sd-adapt.c
+
+libsystemd_dhcp_la_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ $(SYSTEMD_DHCP_CFLAGS) \
+ $(GLIB_CFLAGS)
+
+libsystemd_dhcp_la_LIBADD = \
+ $(GLIB_LIBS)
+
###########################################
# NetworkManager
###########################################
@@ -56,12 +135,13 @@ sbin_PROGRAMS = NetworkManager
NetworkManager_SOURCES = \
$(nm_device_sources) $(nm_device_headers) \
+ $(nm_dhcp_client_sources) $(nm_dhcp_client_headers) \
+ main-utils.c \
+ main-utils.h \
main.c
NetworkManager_LDADD = libNetworkManager.la
-noinst_LTLIBRARIES = libNetworkManager.la
-
nm_device_sources = \
devices/nm-device-bond.c \
devices/nm-device-bridge.c \
@@ -87,8 +167,21 @@ nm_device_headers = \
devices/nm-device-vlan.h \
devices/nm-device-vxlan.h
+nm_dhcp_client_sources = \
+ dhcp-manager/nm-dhcp-dhclient.c \
+ dhcp-manager/nm-dhcp-dhclient-utils.c \
+ dhcp-manager/nm-dhcp-dhcpcd.c \
+ dhcp-manager/nm-dhcp-systemd.c
+
+nm_dhcp_client_headers = \
+ dhcp-manager/nm-dhcp-dhclient.h \
+ dhcp-manager/nm-dhcp-dhclient-utils.h \
+ dhcp-manager/nm-dhcp-dhcpcd.h \
+ dhcp-manager/nm-dhcp-systemd.h
+
nm_sources = \
$(nm_device_headers) \
+ $(nm_dhcp_client_headers) \
devices/nm-device.c \
devices/nm-device.h \
devices/nm-device-ethernet-utils.c \
@@ -104,12 +197,8 @@ nm_sources = \
dhcp-manager/nm-dhcp-client.h \
dhcp-manager/nm-dhcp-utils.c \
dhcp-manager/nm-dhcp-utils.h \
- dhcp-manager/nm-dhcp-dhclient.c \
- dhcp-manager/nm-dhcp-dhclient.h \
- dhcp-manager/nm-dhcp-dhclient-utils.c \
- dhcp-manager/nm-dhcp-dhclient-utils.h \
- dhcp-manager/nm-dhcp-dhcpcd.c \
- dhcp-manager/nm-dhcp-dhcpcd.h \
+ dhcp-manager/nm-dhcp-listener.c \
+ dhcp-manager/nm-dhcp-listener.h \
dhcp-manager/nm-dhcp-manager.c \
dhcp-manager/nm-dhcp-manager.h \
\
@@ -129,9 +218,6 @@ nm_sources = \
dnsmasq-manager/nm-dnsmasq-utils.c \
dnsmasq-manager/nm-dnsmasq-utils.h \
\
- firewall-manager/nm-firewall-manager.c \
- firewall-manager/nm-firewall-manager.h \
- \
platform/nm-fake-platform.c \
platform/nm-fake-platform.h \
platform/nm-linux-platform.c \
@@ -189,8 +275,6 @@ nm_sources = \
supplicant-manager/nm-supplicant-settings-verify.c \
supplicant-manager/nm-supplicant-settings-verify.h \
supplicant-manager/nm-supplicant-types.h \
- supplicant-manager/nm-call-store.c \
- supplicant-manager/nm-call-store.h \
\
vpn-manager/nm-vpn-connection.c \
vpn-manager/nm-vpn-connection.h \
@@ -205,6 +289,8 @@ nm_sources = \
nm-active-connection.h \
nm-config.c \
nm-config.h \
+ nm-config-data.c \
+ nm-config-data.h \
nm-connection-provider.c \
nm-connection-provider.h \
nm-connectivity.c \
@@ -213,6 +299,10 @@ nm_sources = \
nm-dbus-manager.h \
nm-dcb.c \
nm-dcb.h \
+ nm-route-manager.c \
+ nm-route-manager.h \
+ nm-default-route-manager.c \
+ nm-default-route-manager.h \
nm-dhcp4-config.c \
nm-dhcp4-config.h \
nm-dhcp6-config.c \
@@ -221,6 +311,8 @@ nm_sources = \
nm-dispatcher.h \
nm-enum-types.c \
nm-enum-types.h \
+ nm-firewall-manager.c \
+ nm-firewall-manager.h \
nm-ip4-config.c \
nm-ip4-config.h \
nm-ip6-config.c \
@@ -237,29 +329,17 @@ nm_sources = \
nm-manager.h \
nm-policy.c \
nm-policy.h \
- nm-posix-signals.c \
- nm-posix-signals.h \
nm-properties-changed-signal.c \
nm-properties-changed-signal.h \
nm-rfkill-manager.c \
nm-rfkill-manager.h \
nm-session-monitor.h \
- nm-session-utils.c \
- nm-session-utils.h \
+ nm-session-monitor.c \
nm-sleep-monitor.h \
nm-types.h \
NetworkManagerUtils.c \
NetworkManagerUtils.h
-if SESSION_TRACKING_SYSTEMD
-nm_sources += nm-session-monitor-systemd.c
-else
-if SESSION_TRACKING_CK
-nm_sources += nm-session-monitor-ck.c
-else
-nm_sources += nm-session-monitor-null.c
-endif
-endif
if SUSPEND_RESUME_SYSTEMD
nm_sources += nm-sleep-monitor-systemd.c
@@ -328,6 +408,7 @@ AM_CPPFLAGS += \
$(LIBNDP_CFLAGS) \
$(LIBSOUP_CFLAGS) \
$(SYSTEMD_LOGIN_CFLAGS) \
+ $(SYSTEMD_DHCP_CFLAGS) \
\
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\" \
@@ -349,16 +430,13 @@ AM_CPPFLAGS += \
\
$(NULL)
-if SESSION_TRACKING_CK
-AM_CPPFLAGS += -DCKDB_PATH=\"${CKDB_PATH}\"
-endif
-
libNetworkManager_la_SOURCES = \
$(nm_sources) \
$(glue_sources)
libNetworkManager_la_LIBADD = \
$(top_builddir)/libnm-core/libnm-core.la \
+ libsystemd-dhcp.la \
$(DBUS_LIBS) \
$(GLIB_LIBS) \
$(GUDEV_LIBS) \
@@ -374,6 +452,89 @@ endif
NetworkManager_LDFLAGS = -rdynamic
+######################
+
+libnm_iface_helper_la_SOURCES = \
+ dhcp-manager/nm-dhcp-client.c \
+ dhcp-manager/nm-dhcp-client.h \
+ dhcp-manager/nm-dhcp-utils.c \
+ dhcp-manager/nm-dhcp-utils.h \
+ dhcp-manager/nm-dhcp-manager.c \
+ dhcp-manager/nm-dhcp-manager.h \
+ \
+ platform/nm-linux-platform.c \
+ platform/nm-linux-platform.h \
+ platform/nm-platform.c \
+ platform/nm-platform.h \
+ platform/wifi/wifi-utils-nl80211.c \
+ platform/wifi/wifi-utils-nl80211.h \
+ platform/wifi/wifi-utils-private.h \
+ platform/wifi/wifi-utils.c \
+ platform/wifi/wifi-utils.h \
+ \
+ rdisc/nm-fake-rdisc.c \
+ rdisc/nm-fake-rdisc.h \
+ rdisc/nm-lndp-rdisc.c \
+ rdisc/nm-lndp-rdisc.h \
+ rdisc/nm-rdisc.c \
+ rdisc/nm-rdisc.h \
+ \
+ nm-route-manager.c \
+ nm-route-manager.h \
+ \
+ nm-ip4-config.c \
+ nm-ip4-config.h \
+ nm-ip6-config.c \
+ nm-ip6-config.h \
+ \
+ nm-enum-types.c \
+ nm-enum-types.h \
+ nm-logging.c \
+ nm-logging.h \
+ NetworkManagerUtils.c \
+ NetworkManagerUtils.h
+
+if WITH_WEXT
+libnm_iface_helper_la_SOURCES += \
+ platform/wifi/wifi-utils-wext.c \
+ platform/wifi/wifi-utils-wext.h
+endif
+
+libnm_iface_helper_la_LIBADD = \
+ $(top_builddir)/libnm-core/libnm-core.la \
+ libsystemd-dhcp.la \
+ $(DBUS_LIBS) \
+ $(GLIB_LIBS) \
+ $(GUDEV_LIBS) \
+ $(LIBNL_LIBS) \
+ $(LIBNDP_LIBS) \
+ $(LIBDL) \
+ $(LIBM)
+
+libexec_PROGRAMS = nm-iface-helper
+
+nm_iface_helper_SOURCES = \
+ dhcp-manager/nm-dhcp-systemd.h \
+ dhcp-manager/nm-dhcp-systemd.c \
+ nm-iface-helper.c \
+ main-utils.c \
+ main-utils.h
+
+nm_iface_helper_LDADD = \
+ $(top_builddir)/libnm-core/libnm-core.la \
+ libsystemd-dhcp.la \
+ libnm-iface-helper.la \
+ $(DBUS_LIBS) \
+ $(GLIB_LIBS) \
+ $(GUDEV_LIBS) \
+ $(LIBNL_LIBS) \
+ $(LIBNDP_LIBS) \
+ $(LIBM)
+
+nm_iface_helper_LDFLAGS = -rdynamic
+
+######################
+
dbusservicedir = $(DBUS_SYS_DIR)
dbusservice_DATA = org.freedesktop.NetworkManager.conf
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c
index 526aba570c..57f817649e 100644
--- a/src/NetworkManagerUtils.c
+++ b/src/NetworkManagerUtils.c
@@ -22,6 +22,7 @@
#include "config.h"
#include <glib.h>
+#include <gio/gio.h>
#include <glib/gi18n.h>
#include <errno.h>
#include <fcntl.h>
@@ -35,6 +36,7 @@
#include <linux/if_infiniband.h>
#include "NetworkManagerUtils.h"
+#include "nm-platform.h"
#include "nm-utils.h"
#include "nm-core-internal.h"
#include "nm-logging.h"
@@ -45,8 +47,8 @@
#include "nm-setting-wireless.h"
#include "nm-setting-wireless-security.h"
#include "nm-auth-utils.h"
-#include "nm-posix-signals.h"
#include "nm-dbus-glib-types.h"
+#include "gsystem-local-alloc.h"
/*
* Some toolchains (E.G. uClibc 0.9.33 and earlier) don't export
@@ -165,7 +167,7 @@ nm_spawn_process (const char *args)
return -1;
}
- if (!g_spawn_sync ("/", argv, NULL, 0, nm_unblock_posix_signals, NULL, NULL, NULL, &status, &error)) {
+ if (!g_spawn_sync ("/", argv, NULL, 0, NULL, NULL, NULL, NULL, &status, &error)) {
nm_log_warn (LOGD_CORE, "could not spawn process '%s': %s", args, error->message);
g_error_free (error);
}
@@ -174,6 +176,42 @@ nm_spawn_process (const char *args)
return status;
}
+int
+nm_utils_modprobe (GError **error, const char *arg1, ...)
+{
+ gs_unref_ptrarray GPtrArray *argv = NULL;
+ int exit_status;
+ gs_free char *_log_str = NULL;
+#define ARGV_TO_STR(argv) (_log_str ? _log_str : (_log_str = g_strjoinv (" ", (char **) argv->pdata)))
+ GError *local = NULL;
+ va_list ap;
+
+ g_return_val_if_fail (!error || !*error, -1);
+ g_return_val_if_fail (arg1, -1);
+
+ /* construct the argument list */
+ argv = g_ptr_array_sized_new (4);
+ g_ptr_array_add (argv, "/sbin/modprobe");
+ g_ptr_array_add (argv, (char *) arg1);
+
+ va_start (ap, arg1);
+ while ((arg1 = va_arg (ap, const char *)))
+ g_ptr_array_add (argv, (char *) arg1);
+ va_end (ap);
+
+ g_ptr_array_add (argv, NULL);
+
+ nm_log_dbg (LOGD_CORE, "modprobe: '%s'", ARGV_TO_STR (argv));
+ if (!g_spawn_sync (NULL, (char **) argv->pdata, NULL, 0, NULL, NULL, NULL, NULL, &exit_status, &local)) {
+ nm_log_err (LOGD_CORE, "modprobe: '%s' failed: %s", ARGV_TO_STR (argv), local->message);
+ g_propagate_error (error, local);
+ return -1;
+ } else if (exit_status != 0)
+ nm_log_err (LOGD_CORE, "modprobe: '%s' exited with error %d", ARGV_TO_STR (argv), exit_status);
+
+ return exit_status;
+}
+
/**
* nm_utils_get_start_time_for_pid:
* @pid: the process identifier
@@ -484,6 +522,17 @@ nm_utils_kill_child_async (pid_t pid, int sig, guint64 log_domain,
g_child_watch_add (pid, _kc_cb_watch_child, data);
}
+static inline gulong
+_sleep_duration_convert_ms_to_us (guint32 sleep_duration_msec)
+{
+ if (sleep_duration_msec > 0) {
+ guint64 x = (gint64) sleep_duration_msec * (guint64) 1000L;
+
+ return x < G_MAXULONG ? (gulong) x : G_MAXULONG;
+ }
+ return G_USEC_PER_SEC / 20;
+}
+
/* nm_utils_kill_child_sync:
* @pid: process id to kill
* @sig: signal to sent initially. If 0, no signal is sent. If %SIGKILL, the
@@ -567,7 +616,7 @@ nm_utils_kill_child_sync (pid_t pid, int sig, guint64 log_domain, const char *lo
gulong sleep_time, sleep_duration_usec;
int loop_count = 0;
- sleep_duration_usec = (sleep_duration_msec <= 0) ? (G_USEC_PER_SEC / 20) : MIN (G_MAXULONG, ((gint64) sleep_duration_msec) * 1000L);
+ sleep_duration_usec = _sleep_duration_convert_ms_to_us (sleep_duration_msec);
wait_until = wait_before_kill_msec <= 0 ? 0 : wait_start_us + (((gint64) wait_before_kill_msec) * 1000L);
while (TRUE) {
@@ -721,7 +770,7 @@ nm_utils_kill_process_sync (pid_t pid, guint64 start_time, int sig, guint64 log_
wait_start_us = nm_utils_get_monotonic_timestamp_us ();
- sleep_duration_usec = (sleep_duration_msec == 0) ? (G_USEC_PER_SEC / 20) : MIN (G_MAXULONG, ((gulong) sleep_duration_msec) * 1000UL);
+ sleep_duration_usec = _sleep_duration_convert_ms_to_us (sleep_duration_msec);
wait_until = wait_start_us + (((gint64) wait_before_kill_msec) * 1000L);
while (TRUE) {
@@ -795,107 +844,119 @@ nm_utils_kill_process_sync (pid_t pid, guint64 start_time, int sig, guint64 log_
#undef LOG_NAME_PROCESS_FMT
#undef LOG_NAME_ARGS
-/**
- * nm_utils_find_helper:
- * @progname: the helper program name, like "iptables"
- * @try_first: a custom path to try first before searching
- * @error: on failure, a "not found" error using @error_domain and @error_code
- *
- * Searches for the @progname in common system paths.
- *
- * Returns: the full path to the helper, if found, or %NULL if not found.
- */
-const char *
-nm_utils_find_helper (const char *progname,
- const char *try_first,
- GError **error)
-{
- static const char *paths[] = {
- PREFIX "/sbin/",
- PREFIX "/bin/",
- "/sbin/",
- "/usr/sbin/",
- "/usr/local/sbin/",
- "/usr/bin/",
- "/usr/local/bin/",
- };
- guint i;
- GString *tmp;
- const char *ret;
-
- if (error)
- g_return_val_if_fail (*error == NULL, NULL);
-
- if (try_first && try_first[0] && g_file_test (try_first, G_FILE_TEST_EXISTS))
- return g_intern_string (try_first);
-
- tmp = g_string_sized_new (50);
- for (i = 0; i < G_N_ELEMENTS (paths); i++) {
- g_string_append_printf (tmp, "%s%s", paths[i], progname);
- if (g_file_test (tmp->str, G_FILE_TEST_EXISTS)) {
- ret = g_intern_string (tmp->str);
- g_string_free (tmp, TRUE);
- return ret;
- }
- g_string_set_size (tmp, 0);
- }
- g_string_free (tmp, TRUE);
+const char *const NM_PATHS_DEFAULT[] = {
+ PREFIX "/sbin/",
+ PREFIX "/bin/",
+ "/sbin/",
+ "/usr/sbin/",
+ "/usr/local/sbin/",
+ "/bin/",
+ "/usr/bin/",
+ "/usr/local/bin/",
+ NULL,
+};
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, "Could not find %s binary", progname);
- return NULL;
+const char *
+nm_utils_find_helper(const char *progname, const char *try_first, GError **error)
+{
+ return nm_utils_file_search_in_paths (progname, try_first, NM_PATHS_DEFAULT, G_FILE_TEST_IS_EXECUTABLE, NULL, NULL, error);
}
/******************************************************************************************/
-gboolean
-nm_match_spec_string (const GSList *specs, const char *match)
-{
- const GSList *iter;
-
- for (iter = specs; iter; iter = g_slist_next (iter)) {
- if (!g_ascii_strcasecmp ((const char *) iter->data, match))
- return TRUE;
- }
+#define MAC_TAG "mac:"
+#define INTERFACE_NAME_TAG "interface-name:"
+#define SUBCHAN_TAG "s390-subchannels:"
+#define EXCEPT_TAG "except:"
- return FALSE;
+static const char *
+_match_except (const char *spec_str, gboolean *out_except)
+{
+ if (!g_ascii_strncasecmp (spec_str, EXCEPT_TAG, STRLEN (EXCEPT_TAG))) {
+ spec_str += STRLEN (EXCEPT_TAG);
+ *out_except = TRUE;
+ } else
+ *out_except = FALSE;
+ return spec_str;
}
-gboolean
+NMMatchSpecMatchType
nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr)
{
const GSList *iter;
+ NMMatchSpecMatchType match = NM_MATCH_SPEC_NO_MATCH;
- g_return_val_if_fail (hwaddr != NULL, FALSE);
+ g_return_val_if_fail (hwaddr != NULL, NM_MATCH_SPEC_NO_MATCH);
for (iter = specs; iter; iter = g_slist_next (iter)) {
const char *spec_str = iter->data;
+ gboolean except;
- if ( !g_ascii_strncasecmp (spec_str, "mac:", 4)
- && nm_utils_hwaddr_matches (spec_str + 4, -1, hwaddr, -1))
- return TRUE;
+ if (!spec_str || !*spec_str)
+ continue;
- if (nm_utils_hwaddr_matches (spec_str, -1, hwaddr, -1))
- return TRUE;
- }
+ spec_str = _match_except (spec_str, &except);
- return FALSE;
+ if ( !g_ascii_strncasecmp (spec_str, INTERFACE_NAME_TAG, STRLEN (INTERFACE_NAME_TAG))
+ || !g_ascii_strncasecmp (spec_str, SUBCHAN_TAG, STRLEN (SUBCHAN_TAG)))
+ continue;
+
+ if (!g_ascii_strncasecmp (spec_str, MAC_TAG, STRLEN (MAC_TAG)))
+ spec_str += STRLEN (MAC_TAG);
+ else if (except)
+ continue;
+
+ if (nm_utils_hwaddr_matches (spec_str, -1, hwaddr, -1)) {
+ if (except)
+ return NM_MATCH_SPEC_NEG_MATCH;
+ match = NM_MATCH_SPEC_MATCH;
+ }
+ }
+ return match;
}
-gboolean
+NMMatchSpecMatchType
nm_match_spec_interface_name (const GSList *specs, const char *interface_name)
{
- char *iface_match;
- gboolean matched;
+ const GSList *iter;
+ NMMatchSpecMatchType match = NM_MATCH_SPEC_NO_MATCH;
- g_return_val_if_fail (interface_name != NULL, FALSE);
+ g_return_val_if_fail (interface_name != NULL, NM_MATCH_SPEC_NO_MATCH);
- if (nm_match_spec_string (specs, interface_name))
- return TRUE;
+ for (iter = specs; iter; iter = g_slist_next (iter)) {
+ const char *spec_str = iter->data;
+ gboolean use_pattern = FALSE;
+ gboolean except;
+
+ if (!spec_str || !*spec_str)
+ continue;
+
+ spec_str = _match_except (spec_str, &except);
- iface_match = g_strdup_printf ("interface-name:%s", interface_name);
- matched = nm_match_spec_string (specs, iface_match);
- g_free (iface_match);
- return matched;
+ if ( !g_ascii_strncasecmp (spec_str, MAC_TAG, STRLEN (MAC_TAG))
+ || !g_ascii_strncasecmp (spec_str, SUBCHAN_TAG, STRLEN (SUBCHAN_TAG)))
+ continue;
+
+ if (!g_ascii_strncasecmp (spec_str, INTERFACE_NAME_TAG, STRLEN (INTERFACE_NAME_TAG))) {
+ spec_str += STRLEN (INTERFACE_NAME_TAG);
+ if (spec_str[0] == '=')
+ spec_str += 1;
+ else {
+ if (spec_str[0] == '~')
+ spec_str += 1;
+ use_pattern=TRUE;
+ }
+ } else if (except)
+ continue;
+
+ if ( !strcmp (spec_str, interface_name)
+ || (use_pattern && g_pattern_match_simple (spec_str, interface_name))) {
+ if (except)
+ return NM_MATCH_SPEC_NEG_MATCH;
+ match = NM_MATCH_SPEC_MATCH;
+ }
+ }
+ return match;
}
#define BUFSIZE 10
@@ -964,33 +1025,108 @@ parse_subchannels (const char *subchannels, guint32 *a, guint32 *b, guint32 *c)
return TRUE;
}
-#define SUBCHAN_TAG "s390-subchannels:"
-
-gboolean
+NMMatchSpecMatchType
nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels)
{
const GSList *iter;
guint32 a = 0, b = 0, c = 0;
guint32 spec_a = 0, spec_b = 0, spec_c = 0;
+ NMMatchSpecMatchType match = NM_MATCH_SPEC_NO_MATCH;
- g_return_val_if_fail (subchannels != NULL, FALSE);
+ g_return_val_if_fail (subchannels != NULL, NM_MATCH_SPEC_NO_MATCH);
if (!parse_subchannels (subchannels, &a, &b, &c))
- return FALSE;
+ return NM_MATCH_SPEC_NO_MATCH;
for (iter = specs; iter; iter = g_slist_next (iter)) {
- const char *spec = iter->data;
+ const char *spec_str = iter->data;
+ gboolean except;
+
+ if (!spec_str || !*spec_str)
+ continue;
+
+ spec_str = _match_except (spec_str, &except);
+
+ if (!g_ascii_strncasecmp (spec_str, SUBCHAN_TAG, STRLEN (SUBCHAN_TAG))) {
+ spec_str += STRLEN (SUBCHAN_TAG);
+ if (parse_subchannels (spec_str, &spec_a, &spec_b, &spec_c)) {
+ if (a == spec_a && b == spec_b && c == spec_c) {
+ if (except)
+ return NM_MATCH_SPEC_NEG_MATCH;
+ match = NM_MATCH_SPEC_MATCH;
+ }
+ }
+ }
+ }
+ return match;
+}
+
+GSList *
+nm_match_spec_split (const char *value)
+{
+ char *string_value, *p, *q0, *q;
+ GSList *pieces = NULL;
+
+ if (!value || !*value)
+ return NULL;
+
+ /* Copied from glibs g_key_file_parse_value_as_string() function
+ * and adjusted. */
+
+ string_value = g_new (gchar, strlen (value) + 1);
+
+ p = (gchar *) value;
+ q0 = q = string_value;
+ while (*p) {
+ if (*p == '\\') {
+ p++;
- if (!strncmp (spec, SUBCHAN_TAG, strlen (SUBCHAN_TAG))) {
- spec += strlen (SUBCHAN_TAG);
- if (parse_subchannels (spec, &spec_a, &spec_b, &spec_c)) {
- if (a == spec_a && b == spec_b && c == spec_c)
- return TRUE;
+ switch (*p) {
+ case 's':
+ *q = ' ';
+ break;
+ case 'n':
+ *q = '\n';
+ break;
+ case 't':
+ *q = '\t';
+ break;
+ case 'r':
+ *q = '\r';
+ break;
+ case '\\':
+ *q = '\\';
+ break;
+ case '\0':
+ break;
+ default:
+ if (NM_IN_SET (*p, ',', ';'))
+ *q = *p;
+ else {
+ *q++ = '\\';
+ *q = *p;
+ }
+ break;
+ }
+ } else {
+ *q = *p;
+ if (NM_IN_SET (*p, ',', ';')) {
+ if (q0 < q)
+ pieces = g_slist_prepend (pieces, g_strndup (q0, q - q0));
+ q0 = q + 1;
}
}
+ if (*p == '\0')
+ break;
+ q++;
+ p++;
}
- return FALSE;
+ *q = '\0';
+ if (q0 < q)
+ pieces = g_slist_prepend (pieces, g_strndup (q0, q - q0));
+ g_free (string_value);
+ return g_slist_reverse (pieces);
}
const char *
@@ -1212,8 +1348,7 @@ nm_utils_get_ip_config_method (NMConnection *connection,
GType ip_setting_type)
{
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4, *s_ip6;
const char *method;
s_con = nm_connection_get_setting_connection (connection);
@@ -1226,7 +1361,7 @@ nm_utils_get_ip_config_method (NMConnection *connection,
else {
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_return_val_if_fail (s_ip4 != NULL, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
- method = nm_setting_ip4_config_get_method (s_ip4);
+ method = nm_setting_ip_config_get_method (s_ip4);
g_return_val_if_fail (method != NULL, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
return method;
@@ -1240,7 +1375,7 @@ nm_utils_get_ip_config_method (NMConnection *connection,
else {
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_return_val_if_fail (s_ip6 != NULL, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
- method = nm_setting_ip6_config_get_method (s_ip6);
+ method = nm_setting_ip_config_get_method (s_ip6);
g_return_val_if_fail (method != NULL, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
return method;
@@ -1387,12 +1522,12 @@ check_ip6_method (NMConnection *orig,
{
GHashTable *props;
const char *orig_ip6_method, *candidate_ip6_method;
- NMSettingIP6Config *candidate_ip6;
+ NMSettingIPConfig *candidate_ip6;
gboolean allow = FALSE;
props = check_property_in_hash (settings,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
if (!props)
return TRUE;
@@ -1408,7 +1543,7 @@ check_ip6_method (NMConnection *orig,
if ( strcmp (orig_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0
&& strcmp (candidate_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0
- && (!candidate_ip6 || nm_setting_ip6_config_get_may_fail (candidate_ip6))) {
+ && (!candidate_ip6 || nm_setting_ip_config_get_may_fail (candidate_ip6))) {
allow = TRUE;
}
@@ -1425,7 +1560,7 @@ check_ip6_method (NMConnection *orig,
if (allow) {
remove_from_hash (settings, props,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
}
return allow;
}
@@ -1438,11 +1573,11 @@ check_ip4_method (NMConnection *orig,
{
GHashTable *props;
const char *orig_ip4_method, *candidate_ip4_method;
- NMSettingIP4Config *candidate_ip4;
+ NMSettingIPConfig *candidate_ip4;
props = check_property_in_hash (settings,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
if (!props)
return TRUE;
@@ -1457,11 +1592,11 @@ check_ip4_method (NMConnection *orig,
if ( strcmp (orig_ip4_method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0
&& strcmp (candidate_ip4_method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0
- && (!candidate_ip4 || nm_setting_ip4_config_get_may_fail (candidate_ip4))
+ && (!candidate_ip4 || nm_setting_ip_config_get_may_fail (candidate_ip4))
&& (device_has_carrier == FALSE)) {
remove_from_hash (settings, props,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
return TRUE;
}
return FALSE;
@@ -1663,81 +1798,7 @@ nm_utils_cmp_connection_by_autoconnect_priority (NMConnection **a, NMConnection
return 0;
}
-/* nm_utils_ascii_str_to_int64:
- *
- * A wrapper for g_ascii_strtoll, that checks whether the whole string
- * can be successfully converted to a number and is within a given
- * range. On any error, @fallback will be returned and %errno will be set
- * to a non-zero value. On success, %errno will be set to zero, check %errno
- * for errors. Any trailing or leading (ascii) white space is ignored and the
- * functions is locale independent.
- *
- * The function is guaranteed to return a value between @min and @max
- * (inclusive) or @fallback. Also, the parsing is rather strict, it does
- * not allow for any unrecognized characters, except leading and trailing
- * white space.
- **/
-gint64
-nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback)
-{
- gint64 v;
- size_t len;
- char buf[64], *s, *str_free = NULL;
-
- if (str) {
- while (g_ascii_isspace (str[0]))
- str++;
- }
- if (!str || !str[0]) {
- errno = EINVAL;
- return fallback;
- }
-
- len = strlen (str);
- if (g_ascii_isspace (str[--len])) {
- /* backward search the first non-ws character.
- * We already know that str[0] is non-ws. */
- while (g_ascii_isspace (str[--len]))
- ;
-
- /* str[len] is now the last non-ws character... */
- len++;
-
- if (len >= sizeof (buf))
- s = str_free = g_malloc (len + 1);
- else
- s = buf;
-
- memcpy (s, str, len);
- s[len] = 0;
-
- /*
- g_assert (len > 0 && len < strlen (str) && len == strlen (s));
- g_assert (!g_ascii_isspace (str[len-1]) && g_ascii_isspace (str[len]));
- g_assert (strncmp (str, s, len) == 0);
- */
-
- str = s;
- }
-
- errno = 0;
- v = g_ascii_strtoll (str, &s, base);
-
- if (errno != 0)
- v = fallback;
- else if (s[0] != 0) {
- errno = EINVAL;
- v = fallback;
- } else if (v > max || v < min) {
- errno = ERANGE;
- v = fallback;
- }
-
- if (G_UNLIKELY (str_free))
- g_free (str_free);
- return v;
-}
-
+/**************************************************************************/
static gint64 monotonic_timestamp_offset_sec;
@@ -1819,7 +1880,7 @@ monotonic_timestamp_get (struct timespec *tp)
gint64
nm_utils_get_monotonic_timestamp_ns (void)
{
- struct timespec tp;
+ struct timespec tp = { 0 };
monotonic_timestamp_get (&tp);
@@ -1846,7 +1907,7 @@ nm_utils_get_monotonic_timestamp_ns (void)
gint64
nm_utils_get_monotonic_timestamp_us (void)
{
- struct timespec tp;
+ struct timespec tp = { 0 };
monotonic_timestamp_get (&tp);
@@ -1873,7 +1934,7 @@ nm_utils_get_monotonic_timestamp_us (void)
gint64
nm_utils_get_monotonic_timestamp_ms (void)
{
- struct timespec tp;
+ struct timespec tp = { 0 };
monotonic_timestamp_get (&tp);
@@ -1900,7 +1961,7 @@ nm_utils_get_monotonic_timestamp_ms (void)
gint32
nm_utils_get_monotonic_timestamp_s (void)
{
- struct timespec tp;
+ struct timespec tp = { 0 };
monotonic_timestamp_get (&tp);
return (((gint64) tp.tv_sec) + monotonic_timestamp_offset_sec);
@@ -1972,9 +2033,9 @@ _log_connection_sort_names_fcn (gconstpointer a, gconstpointer b)
/* we want to first show the items, that disappeared, then the one that changed and
* then the ones that were added. */
- if ((v1->diff_result & NM_SETTING_DIFF_RESULT_IN_A) != (v1->diff_result & NM_SETTING_DIFF_RESULT_IN_A))
+ if ((v1->diff_result & NM_SETTING_DIFF_RESULT_IN_A) != (v2->diff_result & NM_SETTING_DIFF_RESULT_IN_A))
return (v1->diff_result & NM_SETTING_DIFF_RESULT_IN_A) ? -1 : 1;
- if ((v1->diff_result & NM_SETTING_DIFF_RESULT_IN_B) != (v1->diff_result & NM_SETTING_DIFF_RESULT_IN_B))
+ if ((v1->diff_result & NM_SETTING_DIFF_RESULT_IN_B) != (v2->diff_result & NM_SETTING_DIFF_RESULT_IN_B))
return (v1->diff_result & NM_SETTING_DIFF_RESULT_IN_B) ? 1 : -1;
return strcmp (v1->item_name, v2->item_name);
}
@@ -2068,9 +2129,9 @@ nm_utils_log_connection_diff (NMConnection *connection, NMConnection *diff_base,
connection_diff_are_same = nm_connection_diff (connection, diff_base, NM_SETTING_COMPARE_FLAG_EXACT | NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT, &connection_diff);
if (connection_diff_are_same) {
if (diff_base)
- nm_log (level, domain, "%sconnection '%s' (%p and %p): no difference", prefix, name, connection, diff_base);
+ nm_log (level, domain, "%sconnection '%s' (%p/%s and %p/%s): no difference", prefix, name, connection, G_OBJECT_TYPE_NAME (connection), diff_base, G_OBJECT_TYPE_NAME (diff_base));
else
- nm_log (level, domain, "%sconnection '%s' (%p): no properties set", prefix, name, connection);
+ nm_log (level, domain, "%sconnection '%s' (%p/%s): no properties set", prefix, name, connection, G_OBJECT_TYPE_NAME (connection));
g_assert (!connection_diff);
return;
}
@@ -2105,9 +2166,9 @@ nm_utils_log_connection_diff (NMConnection *connection, NMConnection *diff_base,
GError *err_verify = NULL;
if (diff_base)
- nm_log (level, domain, "%sconnection '%s' (%p < %p):", prefix, name, connection, diff_base);
+ nm_log (level, domain, "%sconnection '%s' (%p/%s < %p/%s):", prefix, name, connection, G_OBJECT_TYPE_NAME (connection), diff_base, G_OBJECT_TYPE_NAME (diff_base));
else
- nm_log (level, domain, "%sconnection '%s' (%p):", prefix, name, connection);
+ nm_log (level, domain, "%sconnection '%s' (%p/%s):", prefix, name, connection, G_OBJECT_TYPE_NAME (connection));
print_header = FALSE;
if (!nm_connection_verify (connection, &err_verify)) {
@@ -2155,6 +2216,32 @@ out:
}
+#define IPV6_PROPERTY_DIR "/proc/sys/net/ipv6/conf/"
+#define IPV4_PROPERTY_DIR "/proc/sys/net/ipv4/conf/"
+G_STATIC_ASSERT (sizeof (IPV4_PROPERTY_DIR) == sizeof (IPV6_PROPERTY_DIR));
+
+static const char *
+_get_property_path (const char *ifname,
+ const char *property,
+ gboolean ipv6)
+{
+ static char path[sizeof (IPV6_PROPERTY_DIR) + IFNAMSIZ + 32];
+ int len;
+
+ ifname = ASSERT_VALID_PATH_COMPONENT (ifname);
+ property = ASSERT_VALID_PATH_COMPONENT (property);
+
+ len = g_snprintf (path,
+ sizeof (path),
+ "%s%s/%s",
+ ipv6 ? IPV6_PROPERTY_DIR : IPV4_PROPERTY_DIR,
+ ifname,
+ property);
+ g_assert (len < sizeof (path) - 1);
+
+ return path;
+}
+
/**
* nm_utils_ip6_property_path:
* @ifname: an interface name
@@ -2166,18 +2253,21 @@ out:
const char *
nm_utils_ip6_property_path (const char *ifname, const char *property)
{
-#define IPV6_PROPERTY_DIR "/proc/sys/net/ipv6/conf/"
- static char path[sizeof (IPV6_PROPERTY_DIR) + IFNAMSIZ + 32];
- int len;
-
- ifname = ASSERT_VALID_PATH_COMPONENT (ifname);
- property = ASSERT_VALID_PATH_COMPONENT (property);
-
- len = g_snprintf (path, sizeof (path), IPV6_PROPERTY_DIR "%s/%s",
- ifname, property);
- g_assert (len < sizeof (path) - 1);
+ return _get_property_path (ifname, property, TRUE);
+}
- return path;
+/**
+ * nm_utils_ip4_property_path:
+ * @ifname: an interface name
+ * @property: a property name
+ *
+ * Returns the path to IPv4 property @property on @ifname. Note that
+ * this uses a static buffer.
+ */
+const char *
+nm_utils_ip4_property_path (const char *ifname, const char *property)
+{
+ return _get_property_path (ifname, property, FALSE);
}
const char *
@@ -2381,106 +2471,20 @@ nm_utils_connection_dict_to_hash (GVariant *dict)
return g_value_get_boxed (&val);
}
-GSList *
-nm_utils_ip4_routes_from_gvalue (const GValue *value)
-{
- GPtrArray *routes;
- int i;
- GSList *list = NULL;
-
- routes = (GPtrArray *) g_value_get_boxed (value);
- for (i = 0; routes && (i < routes->len); i++) {
- GArray *array = (GArray *) g_ptr_array_index (routes, i);
- NMIP4Route *route;
-
- if (array->len < 4) {
- g_warning ("Ignoring invalid IP4 route");
- continue;
- }
-
- route = nm_ip4_route_new ();
- nm_ip4_route_set_dest (route, g_array_index (array, guint32, 0));
- nm_ip4_route_set_prefix (route, g_array_index (array, guint32, 1));
- nm_ip4_route_set_next_hop (route, g_array_index (array, guint32, 2));
- nm_ip4_route_set_metric (route, g_array_index (array, guint32, 3));
- list = g_slist_prepend (list, route);
- }
-
- return g_slist_reverse (list);
-}
-
-static gboolean
-_nm_utils_gvalue_array_validate (GValueArray *elements, guint n_expected, ...)
-{
- va_list args;
- GValue *tmp;
- int i;
- gboolean valid = FALSE;
-
- if (n_expected != elements->n_values)
- return FALSE;
-
- va_start (args, n_expected);
- for (i = 0; i < n_expected; i++) {
- tmp = g_value_array_get_nth (elements, i);
- if (G_VALUE_TYPE (tmp) != va_arg (args, GType))
- goto done;
- }
- valid = TRUE;
-
-done:
- va_end (args);
- return valid;
-}
-
-GSList *
-nm_utils_ip6_routes_from_gvalue (const GValue *value)
+/**
+ * nm_utils_setpgid:
+ * @unused: unused
+ *
+ * This can be passed as a child setup function to the g_spawn*() family
+ * of functions, to ensure that the child is in its own process group
+ * (and thus, in some situations, will not be killed when NetworkManager
+ * is killed).
+ */
+void
+nm_utils_setpgid (gpointer unused G_GNUC_UNUSED)
{
- GPtrArray *routes;
- int i;
- GSList *list = NULL;
-
- routes = (GPtrArray *) g_value_get_boxed (value);
- for (i = 0; routes && (i < routes->len); i++) {
- GValueArray *route_values = (GValueArray *) g_ptr_array_index (routes, i);
- GByteArray *dest, *next_hop;
- guint prefix, metric;
- NMIP6Route *route;
-
- if (!_nm_utils_gvalue_array_validate (route_values, 4,
- DBUS_TYPE_G_UCHAR_ARRAY,
- G_TYPE_UINT,
- DBUS_TYPE_G_UCHAR_ARRAY,
- G_TYPE_UINT)) {
- g_warning ("Ignoring invalid IP6 route");
- continue;
- }
-
- dest = g_value_get_boxed (g_value_array_get_nth (route_values, 0));
- if (dest->len != 16) {
- g_warning ("%s: ignoring invalid IP6 dest address of length %d",
- __func__, dest->len);
- continue;
- }
-
- prefix = g_value_get_uint (g_value_array_get_nth (route_values, 1));
-
- next_hop = g_value_get_boxed (g_value_array_get_nth (route_values, 2));
- if (next_hop->len != 16) {
- g_warning ("%s: ignoring invalid IP6 next_hop address of length %d",
- __func__, next_hop->len);
- continue;
- }
-
- metric = g_value_get_uint (g_value_array_get_nth (route_values, 3));
-
- route = nm_ip6_route_new ();
- nm_ip6_route_set_dest (route, (struct in6_addr *)dest->data);
- nm_ip6_route_set_prefix (route, prefix);
- nm_ip6_route_set_next_hop (route, (struct in6_addr *)next_hop->data);
- nm_ip6_route_set_metric (route, metric);
- list = g_slist_prepend (list, route);
- }
+ pid_t pid;
- return g_slist_reverse (list);
+ pid = getpid ();
+ setpgid (pid, pid);
}
diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h
index 90182b1921..23d8330a34 100644
--- a/src/NetworkManagerUtils.h
+++ b/src/NetworkManagerUtils.h
@@ -24,9 +24,10 @@
#include <glib.h>
#include <stdio.h>
+#include <arpa/inet.h>
#include "nm-connection.h"
-#include "nm-platform.h"
+#include "nm-types.h"
gboolean nm_ethernet_address_is_valid (gconstpointer addr, gssize len);
@@ -38,20 +39,19 @@ const struct in6_addr *nm_utils_ip6_address_clear_host_address (struct in6_addr
* @metric: the route metric
*
* For IPv6 route, kernel treats the value 0 as IP6_RT_PRIO_USER (1024).
- * Thus, when comparing metric (values), we want to treat zero as NM_PLATFORM_ROUTE_METRIC_DEFAULT.
+ * Thus, when comparing metric (values), we want to treat zero as NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6.
*
* Returns: @metric, if @metric is not zero, otherwise 1024.
*/
static inline guint32
nm_utils_ip6_route_metric_normalize (guint32 metric)
{
- return metric ? metric : 1024 /*NM_PLATFORM_ROUTE_METRIC_DEFAULT*/;
+ return metric ? metric : 1024 /*NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6*/;
}
int nm_spawn_process (const char *args);
-/* macro to return strlen() of a compile time string. */
-#define STRLEN(str) ( sizeof ("" str) - 1 )
+int nm_utils_modprobe (GError **error, const char *arg1, ...) G_GNUC_NULL_TERMINATED;
/* 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. */
@@ -96,10 +96,16 @@ const char *nm_utils_find_helper (const char *progname,
const char *try_first,
GError **error);
-gboolean nm_match_spec_string (const GSList *specs, const char *string);
-gboolean nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr);
-gboolean nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels);
-gboolean nm_match_spec_interface_name (const GSList *specs, const char *interface_name);
+typedef enum {
+ NM_MATCH_SPEC_NO_MATCH = 0,
+ NM_MATCH_SPEC_MATCH = 1,
+ NM_MATCH_SPEC_NEG_MATCH = 2,
+} NMMatchSpecMatchType;
+
+NMMatchSpecMatchType nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr);
+NMMatchSpecMatchType nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels);
+NMMatchSpecMatchType nm_match_spec_interface_name (const GSList *specs, const char *interface_name);
+GSList *nm_match_spec_split (const char *value);
const char *nm_utils_get_shared_wifi_permission (NMConnection *connection);
@@ -157,8 +163,6 @@ int nm_utils_cmp_connection_by_autoconnect_priority (NMConnection **a, NMConnect
void nm_utils_log_connection_diff (NMConnection *connection, NMConnection *diff_base, guint32 level, guint64 domain, const char *name, const char *prefix);
-gint64 nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback);
-
#define NM_UTILS_NS_PER_SECOND ((gint64) 1000000000)
gint64 nm_utils_get_monotonic_timestamp_ns (void);
gint64 nm_utils_get_monotonic_timestamp_us (void);
@@ -167,6 +171,7 @@ gint32 nm_utils_get_monotonic_timestamp_s (void);
const char *ASSERT_VALID_PATH_COMPONENT (const char *name) G_GNUC_WARN_UNUSED_RESULT;
const char *nm_utils_ip6_property_path (const char *ifname, const char *property);
+const char *nm_utils_ip4_property_path (const char *ifname, const char *property);
gboolean nm_utils_is_specific_hostname (const char *name);
@@ -181,14 +186,14 @@ gboolean nm_utils_is_specific_hostname (const char *name);
* and should not normally be treated as a %guint64, but this is done for
* convenience of validity checking and initialization.
*/
-typedef struct {
+struct _NMUtilsIPv6IfaceId {
union {
guint64 id;
guint8 id_u8[8];
};
-} NMUtilsIPv6IfaceId;
+};
-#define NM_UTILS_IPV6_IFACE_ID_INIT { .id = 0 };
+#define NM_UTILS_IPV6_IFACE_ID_INIT { .id = 0 }
gboolean nm_utils_get_ipv6_interface_identifier (NMLinkType link_type,
const guint8 *hwaddr,
@@ -204,7 +209,6 @@ void nm_utils_ipv6_interface_identfier_get_from_addr (NMUtilsIPv6IfaceId *iid,
GVariant *nm_utils_connection_hash_to_dict (GHashTable *hash);
GHashTable *nm_utils_connection_dict_to_hash (GVariant *dict);
-GSList *nm_utils_ip4_routes_from_gvalue (const GValue *value);
-GSList *nm_utils_ip6_routes_from_gvalue (const GValue *value);
+void nm_utils_setpgid (gpointer unused);
#endif /* __NETWORKMANAGER_UTILS_H__ */
diff --git a/src/devices/adsl/nm-atm-manager.c b/src/devices/adsl/nm-atm-manager.c
index 37be69c6e4..6f34c02bbd 100644
--- a/src/devices/adsl/nm-atm-manager.c
+++ b/src/devices/adsl/nm-atm-manager.c
@@ -18,7 +18,7 @@
* Copyright (C) 2009 - 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <string.h>
#include <gudev/gudev.h>
@@ -28,6 +28,7 @@
#include "nm-device-adsl.h"
#include "nm-device-factory.h"
#include "nm-logging.h"
+#include "nm-glib-compat.h"
typedef struct {
GUdevClient *client;
diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c
index abe2b3301f..e664ff4850 100644
--- a/src/devices/adsl/nm-device-adsl.c
+++ b/src/devices/adsl/nm-device-adsl.c
@@ -18,7 +18,7 @@
* Pantelis Koukousoulas <pktoss@gmail.com>
*/
-#include <config.h>
+#include "config.h"
#include <sys/socket.h>
#include <linux/atmdev.h>
@@ -76,7 +76,9 @@ typedef struct {
static guint32
get_generic_capabilities (NMDevice *dev)
{
- return (NM_DEVICE_CAP_CARRIER_DETECT | NM_DEVICE_CAP_NONSTANDARD_CARRIER);
+ return ( NM_DEVICE_CAP_CARRIER_DETECT
+ | NM_DEVICE_CAP_NONSTANDARD_CARRIER
+ | NM_DEVICE_CAP_IS_NON_KERNEL);
}
static gboolean
diff --git a/src/devices/bluetooth/nm-bluez-device.c b/src/devices/bluetooth/nm-bluez-device.c
index 74a89a5f64..fe1a97bbab 100644
--- a/src/devices/bluetooth/nm-bluez-device.c
+++ b/src/devices/bluetooth/nm-bluez-device.c
@@ -19,6 +19,8 @@
* Copyright (C) 2013 Intel Corporation.
*/
+#include "config.h"
+
#include <glib.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
@@ -30,9 +32,12 @@
#include "nm-bluez-device.h"
#include "nm-logging.h"
#include "nm-settings-connection.h"
-#include "nm-bluez5-dun.h"
#include "NetworkManagerUtils.h"
+#if WITH_BLUEZ5_DUN
+#include "nm-bluez5-dun.h"
+#endif
+
G_DEFINE_TYPE (NMBluezDevice, nm_bluez_device, G_TYPE_OBJECT)
#define NM_BLUEZ_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_BLUEZ_DEVICE, NMBluezDevicePrivate))
@@ -59,7 +64,9 @@ typedef struct {
gboolean connected;
char *b4_iface;
+#if WITH_BLUEZ5_DUN
NMBluez5DunContext *b5_dun_context;
+#endif
NMConnectionProvider *provider;
GSList *connections;
@@ -211,16 +218,16 @@ pan_connection_check_create (NMBluezDevice *self)
/* Setting: IPv4 */
setting = nm_setting_ip4_config_new ();
g_object_set (G_OBJECT (setting),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, FALSE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, FALSE,
NULL);
nm_connection_add_setting (connection, setting);
/* Setting: IPv6 */
setting = nm_setting_ip6_config_new ();
g_object_set (G_OBJECT (setting),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
nm_connection_add_setting (connection, setting);
@@ -427,7 +434,11 @@ nm_bluez_device_disconnect (NMBluezDevice *self)
args = g_variant_new ("(s)", priv->b4_iface),
dbus_iface = BLUEZ4_SERIAL_INTERFACE;
} else if (priv->bluez_version == 5) {
+#if WITH_BLUEZ5_DUN
nm_bluez5_dun_cleanup (priv->b5_dun_context);
+#else
+ g_assert_not_reached ();
+#endif
priv->connected = FALSE;
goto out;
}
@@ -491,6 +502,7 @@ bluez_connect_cb (GDBusConnection *dbus_connection,
g_object_unref (result_object);
}
+#if WITH_BLUEZ5_DUN
static void
bluez5_dun_connect_cb (NMBluez5DunContext *context,
const char *device,
@@ -510,6 +522,7 @@ bluez5_dun_connect_cb (NMBluez5DunContext *context,
g_simple_async_result_complete (result);
g_object_unref (result);
}
+#endif
void
nm_bluez_device_connect_async (NMBluezDevice *self,
@@ -541,9 +554,13 @@ nm_bluez_device_connect_async (NMBluezDevice *self,
if (priv->bluez_version == 4)
dbus_iface = BLUEZ4_SERIAL_INTERFACE;
else if (priv->bluez_version == 5) {
+#if WITH_BLUEZ5_DUN
if (priv->b5_dun_context == NULL)
priv->b5_dun_context = nm_bluez5_dun_new (priv->adapter_address, priv->address);
nm_bluez5_dun_connect (priv->b5_dun_context, bluez5_dun_connect_cb, simple);
+#else
+ g_assert_not_reached ();
+#endif
return;
}
} else
@@ -1089,10 +1106,12 @@ dispose (GObject *object)
priv->pan_connection = NULL;
}
+#if WITH_BLUEZ5_DUN
if (priv->b5_dun_context) {
nm_bluez5_dun_free (priv->b5_dun_context);
priv->b5_dun_context = NULL;
}
+#endif
g_signal_handlers_disconnect_by_func (priv->provider, cp_connection_added, self);
g_signal_handlers_disconnect_by_func (priv->provider, cp_connection_removed, self);
diff --git a/src/devices/bluetooth/nm-bluez-manager.c b/src/devices/bluetooth/nm-bluez-manager.c
index f054e5b308..e176a4b462 100644
--- a/src/devices/bluetooth/nm-bluez-manager.c
+++ b/src/devices/bluetooth/nm-bluez-manager.c
@@ -18,6 +18,8 @@
* Copyright (C) 2013 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <signal.h>
#include <string.h>
#include <stdlib.h>
diff --git a/src/devices/bluetooth/nm-bluez4-adapter.c b/src/devices/bluetooth/nm-bluez4-adapter.c
index dd3304eab5..9d1cfe1fee 100644
--- a/src/devices/bluetooth/nm-bluez4-adapter.c
+++ b/src/devices/bluetooth/nm-bluez4-adapter.c
@@ -18,6 +18,8 @@
* Copyright (C) 2009 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
diff --git a/src/devices/bluetooth/nm-bluez4-manager.c b/src/devices/bluetooth/nm-bluez4-manager.c
index 2660cbd924..23b13d32df 100644
--- a/src/devices/bluetooth/nm-bluez4-manager.c
+++ b/src/devices/bluetooth/nm-bluez4-manager.c
@@ -19,6 +19,8 @@
* Copyright (C) 2007 - 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <signal.h>
#include <string.h>
#include <stdlib.h>
diff --git a/src/devices/bluetooth/nm-bluez5-dun.c b/src/devices/bluetooth/nm-bluez5-dun.c
index 5bdd801453..a97eaa770f 100644
--- a/src/devices/bluetooth/nm-bluez5-dun.c
+++ b/src/devices/bluetooth/nm-bluez5-dun.c
@@ -18,7 +18,8 @@
* Copyright (C) 2014 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <sys/socket.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
diff --git a/src/devices/bluetooth/nm-bluez5-manager.c b/src/devices/bluetooth/nm-bluez5-manager.c
index 8653c285ea..b856852397 100644
--- a/src/devices/bluetooth/nm-bluez5-manager.c
+++ b/src/devices/bluetooth/nm-bluez5-manager.c
@@ -20,6 +20,8 @@
* Copyright (C) 2013 Intel Corporation.
*/
+#include "config.h"
+
#include <signal.h>
#include <string.h>
#include <stdlib.h>
diff --git a/src/devices/bluetooth/nm-bt-error.c b/src/devices/bluetooth/nm-bt-error.c
index d014a107c3..e3b8e7f583 100644
--- a/src/devices/bluetooth/nm-bt-error.c
+++ b/src/devices/bluetooth/nm-bt-error.c
@@ -18,6 +18,8 @@
* Copyright (C) 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include "nm-bt-error.h"
diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c
index 0a1f591540..61371dddec 100644
--- a/src/devices/bluetooth/nm-device-bt.c
+++ b/src/devices/bluetooth/nm-device-bt.c
@@ -124,6 +124,12 @@ get_connection_bt_type (NMConnection *connection)
return NM_BT_CAPABILITY_NONE;
}
+static guint32
+get_generic_capabilities (NMDevice *device)
+{
+ return NM_DEVICE_CAP_IS_NON_KERNEL;
+}
+
static gboolean
can_auto_connect (NMDevice *device,
NMConnection *connection,
@@ -181,6 +187,7 @@ check_connection_compatible (NMDevice *device, NMConnection *connection)
static gboolean
check_connection_available (NMDevice *device,
NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
const char *specific_object)
{
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);
@@ -298,12 +305,11 @@ complete_connection (NMDevice *device,
fallback_prefix = _("GSM connection");
if (!nm_setting_gsm_get_number (s_gsm))
g_object_set (G_OBJECT (s_gsm), NM_SETTING_GSM_NUMBER, "*99#", NULL);
- } else if (s_cdma) {
+ } else {
fallback_prefix = _("CDMA connection");
if (!nm_setting_cdma_get_number (s_cdma))
g_object_set (G_OBJECT (s_cdma), NM_SETTING_GSM_NUMBER, "#777", NULL);
- } else
- fallback_prefix = _("DUN connection");
+ }
} else {
g_set_error_literal (error,
NM_CONNECTION_ERROR,
@@ -924,7 +930,7 @@ bluez_device_removed (NMBluezDevice *bdev, gpointer user_data)
/*****************************************************************************/
static gboolean
-is_available (NMDevice *dev)
+is_available (NMDevice *dev, NMDeviceCheckDevAvailableFlags flags)
{
NMDeviceBt *self = NM_DEVICE_BT (dev);
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self);
@@ -952,7 +958,7 @@ handle_availability_change (NMDeviceBt *self,
return;
}
- available = nm_device_is_available (device);
+ available = nm_device_is_available (device, NM_DEVICE_CHECK_DEV_AVAILABLE_NONE);
if (available == old_available)
return;
@@ -982,7 +988,7 @@ set_mm_running (NMDeviceBt *self, gboolean running)
_LOGD (LOGD_BT, "ModemManager now %s",
running ? "available" : "unavailable");
- old_available = nm_device_is_available (NM_DEVICE (self));
+ old_available = nm_device_is_available (NM_DEVICE (self), NM_DEVICE_CHECK_DEV_AVAILABLE_NONE);
priv->mm_running = running;
handle_availability_change (self, old_available, NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE);
@@ -1179,6 +1185,7 @@ nm_device_bt_class_init (NMDeviceBtClass *klass)
object_class->dispose = dispose;
object_class->finalize = finalize;
+ device_class->get_generic_capabilities = get_generic_capabilities;
device_class->can_auto_connect = can_auto_connect;
device_class->deactivate = deactivate;
device_class->act_stage2_config = act_stage2_config;
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c
index 9d9fe426b2..6b4581082b 100644
--- a/src/devices/nm-device-bond.c
+++ b/src/devices/nm-device-bond.c
@@ -37,6 +37,7 @@
#include "nm-enum-types.h"
#include "nm-device-factory.h"
#include "nm-core-internal.h"
+#include "nm-ip4-config.h"
#include "nm-device-bond-glue.h"
@@ -67,7 +68,7 @@ get_generic_capabilities (NMDevice *dev)
}
static gboolean
-is_available (NMDevice *dev)
+is_available (NMDevice *dev, NMDeviceCheckDevAvailableFlags flags)
{
if (NM_DEVICE_GET_CLASS (dev)->is_up)
return NM_DEVICE_GET_CLASS (dev)->is_up (dev);
@@ -77,6 +78,7 @@ is_available (NMDevice *dev)
static gboolean
check_connection_available (NMDevice *device,
NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
const char *specific_object)
{
/* Connections are always available because the carrier state is determined
@@ -376,6 +378,25 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
return ret;
}
+static void
+ip4_config_pre_commit (NMDevice *self, NMIP4Config *config)
+{
+ NMConnection *connection;
+ NMSettingWired *s_wired;
+ guint32 mtu;
+
+ connection = nm_device_get_connection (self);
+ g_assert (connection);
+ s_wired = nm_connection_get_setting_wired (connection);
+
+ if (s_wired) {
+ /* MTU override */
+ mtu = nm_setting_wired_get_mtu (s_wired);
+ if (mtu)
+ nm_ip4_config_set_mtu (config, mtu, NM_IP_CONFIG_SOURCE_USER);
+ }
+}
+
static gboolean
enslave_slave (NMDevice *device,
NMDevice *slave,
@@ -509,6 +530,7 @@ nm_device_bond_class_init (NMDeviceBondClass *klass)
parent_class->master_update_slave_connection = master_update_slave_connection;
parent_class->act_stage1_prepare = act_stage1_prepare;
+ parent_class->ip4_config_pre_commit = ip4_config_pre_commit;
parent_class->enslave_slave = enslave_slave;
parent_class->release_slave = release_slave;
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c
index a70cfd9571..c92e8ddfa7 100644
--- a/src/devices/nm-device-bridge.c
+++ b/src/devices/nm-device-bridge.c
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright 2011 - 2012 Red Hat, Inc.
+ * Copyright 2011 - 2015 Red Hat, Inc.
*/
#include "config.h"
@@ -66,7 +66,7 @@ get_generic_capabilities (NMDevice *dev)
}
static gboolean
-is_available (NMDevice *dev)
+is_available (NMDevice *dev, NMDeviceCheckDevAvailableFlags flags)
{
if (NM_DEVICE_GET_CLASS (dev)->is_up)
return NM_DEVICE_GET_CLASS (dev)->is_up (dev);
@@ -76,6 +76,7 @@ is_available (NMDevice *dev)
static gboolean
check_connection_available (NMDevice *device,
NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
const char *specific_object)
{
/* Connections are always available because the carrier state is determined
@@ -157,6 +158,7 @@ static const Option master_options[] = {
{ NM_SETTING_BRIDGE_HELLO_TIME, "hello_time", TRUE, TRUE },
{ NM_SETTING_BRIDGE_MAX_AGE, "max_age", TRUE, TRUE },
{ NM_SETTING_BRIDGE_AGEING_TIME, "ageing_time", TRUE, TRUE },
+ { NM_SETTING_BRIDGE_MULTICAST_SNOOPING, "multicast_snooping", FALSE, FALSE },
{ NULL, NULL }
};
diff --git a/src/devices/nm-device-ethernet-utils.c b/src/devices/nm-device-ethernet-utils.c
index 631dd34d8b..585f6a0e0e 100644
--- a/src/devices/nm-device-ethernet-utils.c
+++ b/src/devices/nm-device-ethernet-utils.c
@@ -16,6 +16,8 @@
* (C) Copyright 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
#include <glib/gi18n.h>
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c
index eb1f75b455..24aa8967d6 100644
--- a/src/devices/nm-device-ethernet.c
+++ b/src/devices/nm-device-ethernet.c
@@ -20,6 +20,7 @@
*/
#include "config.h"
+
#include <glib.h>
#include <glib/gi18n.h>
#include <netinet/in.h>
@@ -264,7 +265,9 @@ constructor (GType type,
int ifindex = nm_device_get_ifindex (NM_DEVICE (object));
NMLinkType link_type = nm_platform_link_get_type (ifindex);
- g_assert (link_type == NM_LINK_TYPE_ETHERNET || link_type == NM_LINK_TYPE_VETH);
+ g_assert ( link_type == NM_LINK_TYPE_ETHERNET
+ || link_type == NM_LINK_TYPE_VETH
+ || link_type == NM_LINK_TYPE_NONE);
#endif
/* s390 stuff */
@@ -943,7 +946,7 @@ nm_8021x_stage2_config (NMDeviceEthernet *self, NMDeviceStateReason *reason)
}
if (!priv->supplicant.mgr)
- priv->supplicant.mgr = nm_supplicant_manager_get ();
+ priv->supplicant.mgr = g_object_ref (nm_supplicant_manager_get ());
/* If we need secrets, get them */
setting_name = nm_connection_need_secrets (connection, NULL);
@@ -1388,7 +1391,8 @@ deactivate (NMDevice *device)
NM_DEVICE_ETHERNET_GET_PRIVATE (device)->last_pppoe_time = nm_utils_get_monotonic_timestamp_s ();
/* Reset MAC address back to initial address */
- nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_ETHER);
+ if (priv->initial_hw_addr)
+ nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_ETHER);
}
static gboolean
@@ -1459,7 +1463,7 @@ new_default_connection (NMDevice *self)
const char *hw_address;
char *defname, *uuid;
- if (!nm_config_get_ethernet_can_auto_default (nm_config_get (), self))
+ if (nm_config_get_no_auto_default_for_device (nm_config_get (), self))
return NULL;
hw_address = nm_device_get_hw_address (self);
@@ -1491,15 +1495,19 @@ new_default_connection (NMDevice *self)
return connection;
}
-static gboolean
+static NMMatchSpecMatchType
spec_match_list (NMDevice *device, const GSList *specs)
{
+ NMMatchSpecMatchType matched = NM_MATCH_SPEC_NO_MATCH, m;
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device);
- if (priv->subchannels && nm_match_spec_s390_subchannels (specs, priv->subchannels))
- return TRUE;
-
- return NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->spec_match_list (device, specs);
+ if (priv->subchannels)
+ matched = nm_match_spec_s390_subchannels (specs, priv->subchannels);
+ if (matched != NM_MATCH_SPEC_NEG_MATCH) {
+ m = NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->spec_match_list (device, specs);
+ matched = MAX (matched, m);
+ }
+ return matched;
}
static void
@@ -1535,15 +1543,14 @@ update_connection (NMDevice *device, NMConnection *connection)
/* s390 */
if (priv->subchannels) {
- GPtrArray *subchan_arr = g_ptr_array_sized_new (3);
- if (priv->subchan1)
- g_ptr_array_add (subchan_arr, priv->subchan1);
- if (priv->subchan2)
- g_ptr_array_add (subchan_arr, priv->subchan2);
- if (priv->subchan3)
- g_ptr_array_add (subchan_arr, priv->subchan3);
- g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchan_arr, NULL);
- g_ptr_array_free (subchan_arr, TRUE);
+ char **subchannels = g_new (char *, 3 + 1);
+
+ subchannels[0] = g_strdup (priv->subchan1);
+ subchannels[1] = g_strdup (priv->subchan2);
+ subchannels[2] = g_strdup (priv->subchan3);
+ subchannels[3] = NULL;
+ g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchannels, NULL);
+ g_strfreev (subchannels);
}
if (priv->s390_nettype)
g_object_set (s_wired, NM_SETTING_WIRED_S390_NETTYPE, priv->s390_nettype, NULL);
diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c
index 80488aec37..abfb8d4a67 100644
--- a/src/devices/nm-device-factory.c
+++ b/src/devices/nm-device-factory.c
@@ -18,6 +18,8 @@
* Copyright (C) 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include "nm-device-factory.h"
enum {
diff --git a/src/devices/nm-device-gre.c b/src/devices/nm-device-gre.c
index e7df12e3f8..9c25b398ce 100644
--- a/src/devices/nm-device-gre.c
+++ b/src/devices/nm-device-gre.c
@@ -21,6 +21,7 @@
#include "config.h"
#include <string.h>
+#include <arpa/inet.h>
#include "nm-device-gre.h"
#include "nm-device-private.h"
diff --git a/src/devices/nm-device-logging.h b/src/devices/nm-device-logging.h
index c6f4f99f1e..acca32e556 100644
--- a/src/devices/nm-device-logging.h
+++ b/src/devices/nm-device-logging.h
@@ -37,6 +37,7 @@ _nm_device_log_self_to_device (t *self) \
(self) ? str_if_set (nm_device_get_iface (_nm_device_log_self_to_device (self)), "(null)") : "(none)" \
_NM_UTILS_MACRO_REST(__VA_ARGS__))
+#define _LOGT(domain, ...) _LOG (LOGL_TRACE, domain, __VA_ARGS__)
#define _LOGD(domain, ...) _LOG (LOGL_DEBUG, domain, __VA_ARGS__)
#define _LOGI(domain, ...) _LOG (LOGL_INFO, domain, __VA_ARGS__)
#define _LOGW(domain, ...) _LOG (LOGL_WARN, domain, __VA_ARGS__)
diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h
index 16c4d03885..1f781bbc05 100644
--- a/src/devices/nm-device-private.h
+++ b/src/devices/nm-device-private.h
@@ -33,12 +33,14 @@ enum NMActStageReturn {
NM_ACT_STAGE_RETURN_SUCCESS, /* Activation stage done */
NM_ACT_STAGE_RETURN_POSTPONE, /* Long-running operation in progress */
NM_ACT_STAGE_RETURN_WAIT, /* Not ready to start stage; wait */
- NM_ACT_STAGE_RETURN_STOP /* Activation stage done; nothing to do */
+ NM_ACT_STAGE_RETURN_STOP, /* Activation not wanted */
+ NM_ACT_STAGE_RETURN_FINISH /* Activation stage done; nothing to do */
};
#define NM_DEVICE_CAP_NONSTANDARD_CARRIER 0x80000000
+#define NM_DEVICE_CAP_IS_NON_KERNEL 0x40000000
-#define NM_DEVICE_CAP_INTERNAL_MASK 0x80000000
+#define NM_DEVICE_CAP_INTERNAL_MASK 0xc0000000
void nm_device_set_ip_iface (NMDevice *self, const char *iface);
@@ -55,8 +57,6 @@ void nm_device_take_down (NMDevice *self, gboolean block);
gboolean nm_device_set_hw_addr (NMDevice *device, const char *addr,
const char *detail, guint64 hw_log_domain);
-gboolean nm_device_ip_config_should_fail (NMDevice *self, gboolean ip6);
-
void nm_device_set_firmware_missing (NMDevice *self, gboolean missing);
void nm_device_activate_schedule_stage1_device_prepare (NMDevice *device);
diff --git a/src/devices/nm-device-veth.c b/src/devices/nm-device-veth.c
index db29c00d2f..6a05cc3214 100644
--- a/src/devices/nm-device-veth.c
+++ b/src/devices/nm-device-veth.c
@@ -102,7 +102,6 @@ get_peer (NMDeviceVeth *self)
static void
nm_device_veth_init (NMDeviceVeth *self)
{
- nm_device_set_initial_unmanaged_flag (NM_DEVICE (self), NM_UNMANAGED_DEFAULT, TRUE);
}
static void
diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c
index 555180f4e7..c69bcdedde 100644
--- a/src/devices/nm-device-vlan.c
+++ b/src/devices/nm-device-vlan.c
@@ -67,6 +67,8 @@ enum {
PROP_PARENT,
PROP_VLAN_ID,
+ PROP_INT_PARENT_DEVICE,
+
LAST_PROP
};
@@ -388,7 +390,8 @@ deactivate (NMDevice *device)
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (self);
/* Reset MAC address back to initial address */
- nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_VLAN);
+ if (priv->initial_hw_addr)
+ nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_VLAN);
}
/******************************************************************/
@@ -406,16 +409,7 @@ parent_state_changed (NMDevice *parent,
if (reason == NM_DEVICE_STATE_REASON_CARRIER)
return;
- if (new_state < NM_DEVICE_STATE_DISCONNECTED) {
- /* If the parent becomes unavailable or unmanaged so does the VLAN */
- nm_device_state_changed (NM_DEVICE (self), new_state, reason);
- } else if ( new_state == NM_DEVICE_STATE_DISCONNECTED
- && old_state < NM_DEVICE_STATE_DISCONNECTED) {
- /* Mark VLAN interface as available/disconnected when the parent
- * becomes available as a result of becoming initialized.
- */
- nm_device_state_changed (NM_DEVICE (self), new_state, reason);
- }
+ nm_device_set_unmanaged (NM_DEVICE (self), NM_UNMANAGED_PARENT, !nm_device_get_managed (parent), reason);
}
/******************************************************************/
@@ -477,6 +471,12 @@ get_property (GObject *object, guint prop_id,
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
switch (prop_id) {
+ case PROP_PARENT:
+ g_value_set_boxed (value, priv->parent ? nm_device_get_path (priv->parent) : "/");
+ break;
+ case PROP_INT_PARENT_DEVICE:
+ g_value_set_object (value, priv->parent);
+ break;
case PROP_VLAN_ID:
g_value_set_uint (value, priv->vlan_id);
break;
@@ -493,7 +493,7 @@ set_property (GObject *object, guint prop_id,
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
switch (prop_id) {
- case PROP_PARENT:
+ case PROP_INT_PARENT_DEVICE:
nm_device_vlan_set_parent (NM_DEVICE_VLAN (object), g_value_get_object (value));
break;
case PROP_VLAN_ID:
@@ -564,10 +564,10 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass)
/* properties */
g_object_class_install_property
(object_class, PROP_PARENT,
- g_param_spec_object (NM_DEVICE_VLAN_PARENT, "", "",
- NM_TYPE_DEVICE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
+ g_param_spec_boxed (NM_DEVICE_VLAN_PARENT, "", "",
+ DBUS_TYPE_G_OBJECT_PATH,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property
(object_class, PROP_VLAN_ID,
g_param_spec_uint (NM_DEVICE_VLAN_ID, "", "",
@@ -575,6 +575,14 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
+ /* Internal properties */
+ g_object_class_install_property
+ (object_class, PROP_INT_PARENT_DEVICE,
+ g_param_spec_object (NM_DEVICE_VLAN_INT_PARENT_DEVICE, "", "",
+ NM_TYPE_DEVICE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
&dbus_glib_nm_device_vlan_object_info);
@@ -613,7 +621,7 @@ new_link (NMDeviceFactory *factory, NMPlatformLink *plink, GError **error)
device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_VLAN,
NM_DEVICE_PLATFORM_DEVICE, plink,
- NM_DEVICE_VLAN_PARENT, parent,
+ NM_DEVICE_VLAN_INT_PARENT_DEVICE, parent,
NM_DEVICE_DRIVER, "8021q",
NM_DEVICE_TYPE_DESC, "VLAN",
NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_VLAN,
@@ -623,6 +631,10 @@ new_link (NMDeviceFactory *factory, NMPlatformLink *plink, GError **error)
device = NULL;
}
+ /* Set initial parent-dependent unmanaged flag */
+ if (device)
+ nm_device_set_initial_unmanaged_flag (device, NM_UNMANAGED_PARENT, !nm_device_get_managed (parent));
+
return device;
}
@@ -663,7 +675,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory,
device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_VLAN,
NM_DEVICE_IFACE, iface,
- NM_DEVICE_VLAN_PARENT, parent,
+ NM_DEVICE_VLAN_INT_PARENT_DEVICE, parent,
NM_DEVICE_DRIVER, "8021q",
NM_DEVICE_TYPE_DESC, "VLAN",
NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_VLAN,
@@ -674,6 +686,10 @@ create_virtual_device_for_connection (NMDeviceFactory *factory,
device = NULL;
}
+ /* Set initial parent-dependent unmanaged flag */
+ if (device)
+ nm_device_set_initial_unmanaged_flag (device, NM_UNMANAGED_PARENT, !nm_device_get_managed (parent));
+
return device;
}
diff --git a/src/devices/nm-device-vlan.h b/src/devices/nm-device-vlan.h
index e1618db440..20fc345379 100644
--- a/src/devices/nm-device-vlan.h
+++ b/src/devices/nm-device-vlan.h
@@ -40,9 +40,13 @@ typedef enum {
NM_VLAN_ERROR_CONNECTION_INCOMPATIBLE, /*< nick=ConnectionIncompatible >*/
} NMVlanError;
+/* D-Bus exported properties */
#define NM_DEVICE_VLAN_PARENT "parent"
#define NM_DEVICE_VLAN_ID "vlan-id"
+/* Internal non-exported properties */
+#define NM_DEVICE_VLAN_INT_PARENT_DEVICE "int-parent-device"
+
typedef NMDevice NMDeviceVlan;
typedef NMDeviceClass NMDeviceVlanClass;
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index af5e52750c..ddc213c0a4 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -19,7 +19,8 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <glib.h>
#include <glib/gi18n.h>
#include <dbus/dbus.h>
@@ -61,13 +62,14 @@
#include "nm-enum-types.h"
#include "nm-settings-connection.h"
#include "nm-connection-provider.h"
-#include "nm-posix-signals.h"
#include "nm-auth-utils.h"
#include "nm-dbus-glib-types.h"
#include "nm-dispatcher.h"
#include "nm-config.h"
#include "nm-dns-manager.h"
#include "nm-core-internal.h"
+#include "nm-default-route-manager.h"
+#include "nm-route-manager.h"
#include "nm-device-logging.h"
_LOG_DECLARE_SELF (NMDevice);
@@ -172,6 +174,7 @@ typedef struct {
typedef struct {
gboolean in_state_changed;
+ gboolean initialized;
NMDeviceState state;
NMDeviceStateReason state_reason;
@@ -203,9 +206,12 @@ typedef struct {
gboolean is_nm_owned; /* whether the device is a device owned and created by NM */
DeleteOnDeactivateData *delete_on_deactivate_data; /* data for scheduled cleanup when deleting link (g_idle_add) */
+ GCancellable *deactivating_cancellable;
+
guint32 ip4_address;
NMActRequest * queued_act_request;
+ gboolean queued_act_request_is_waiting_for_carrier;
NMActRequest * act_request;
guint act_source_id;
gpointer act_source_func;
@@ -226,6 +232,7 @@ typedef struct {
guint carrier_wait_id;
gboolean ignore_carrier;
guint32 mtu;
+ gboolean up; /* IFF_UP */
/* Generic DHCP stuff */
guint32 dhcp_timeout;
@@ -234,9 +241,18 @@ typedef struct {
/* IP4 configuration info */
NMIP4Config * ip4_config; /* Combined config from VPN, settings, and device */
IpState ip4_state;
+ NMIP4Config * con_ip4_config; /* config from the setting */
NMIP4Config * dev_ip4_config; /* Config from DHCP, PPP, LLv4, etc */
NMIP4Config * ext_ip4_config; /* Stuff added outside NM */
NMIP4Config * wwan_ip4_config; /* WWAN configuration */
+ struct {
+ gboolean v4_has;
+ gboolean v4_is_assumed;
+ NMPlatformIP4Route v4;
+ gboolean v6_has;
+ gboolean v6_is_assumed;
+ NMPlatformIP6Route v6;
+ } default_route;
/* DHCPv4 tracking */
NMDhcpClient * dhcp4_client;
@@ -252,7 +268,7 @@ typedef struct {
gulong dnsmasq_state_id;
/* Firewall */
- DBusGProxyCall *fw_call;
+ NMFirewallPendingCall fw_call;
/* avahi-autoipd stuff */
GPid aipd_pid;
@@ -262,10 +278,12 @@ typedef struct {
/* IP6 configuration info */
NMIP6Config * ip6_config;
IpState ip6_state;
+ NMIP6Config * con_ip6_config; /* config from the setting */
NMIP6Config * vpn6_config; /* routes added by a VPN which uses this device */
NMIP6Config * wwan_ip6_config;
NMIP6Config * ext_ip6_config; /* Stuff added outside NM */
gboolean nm_ipv6ll; /* TRUE if NM handles the device's IPv6LL address */
+ guint32 ip6_mtu;
NMRDisc * rdisc;
gulong rdisc_changed_id;
@@ -302,6 +320,7 @@ typedef struct {
static gboolean nm_device_set_ip4_config (NMDevice *self,
NMIP4Config *config,
+ guint32 default_route_metric,
gboolean commit,
NMDeviceStateReason *reason);
static gboolean ip4_config_merge_and_apply (NMDevice *self,
@@ -319,6 +338,10 @@ static void nm_device_slave_notify_enslave (NMDevice *self, gboolean success);
static void nm_device_slave_notify_release (NMDevice *self, NMDeviceStateReason reason);
static gboolean addrconf6_start_with_link_ready (NMDevice *self);
+static gboolean dhcp6_start_with_link_ready (NMDevice *self, NMConnection *connection);
+static NMActStageReturn linklocal6_start (NMDevice *self);
+
+static void _carrier_wait_check_queued_act_request (NMDevice *self);
static gboolean nm_device_get_default_unmanaged (NMDevice *self);
@@ -441,6 +464,12 @@ nm_device_ipv6_sysctl_set (NMDevice *self, const char *property, const char *val
return nm_platform_sysctl_set (nm_utils_ip6_property_path (nm_device_get_ip_iface (self), property), value);
}
+static guint32
+nm_device_ipv6_sysctl_get_int32 (NMDevice *self, const char *property, gint32 fallback)
+{
+ return nm_platform_sysctl_get_int32 (nm_utils_ip6_property_path (nm_device_get_ip_iface (self), property), fallback);
+}
+
static gboolean
device_has_capability (NMDevice *self, NMDeviceCapabilities caps)
{
@@ -640,44 +669,137 @@ nm_device_get_device_type (NMDevice *self)
int
nm_device_get_priority (NMDevice *self)
{
- g_return_val_if_fail (NM_IS_DEVICE (self), 100);
+ g_return_val_if_fail (NM_IS_DEVICE (self), 1000);
- /* Device 'priority' is used for two things:
+ /* Device 'priority' is used for the default route-metric and is based on
+ * the device type. The settings ipv4.route-metric and ipv6.route-metric
+ * can overwrite this default.
+ *
+ * Currently for both IPv4 and IPv6 we use the same default values.
+ *
+ * The route-metric is used for the metric of the routes of device.
+ * This also applies to the default route. Therefore it affects also
+ * which device is the "best".
*
- * a) two devices on the same IP subnet: the "better" (ie, lower number)
- * device is the default outgoing device for that subnet
- * b) default route: the "better" device gets the default route. This can
- * always be modified by setting a connection to never-default=TRUE, in
- * which case that device will never take the default route when
- * it's using that connection.
+ * For comparison, note that iproute2 by default adds IPv4 routes with
+ * metric 0, and IPv6 routes with metric 1024. The latter is the IPv6
+ * "user default" in the kernel (NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6).
+ * In kernel, the full uint32_t range is available for route
+ * metrics (except for IPv6, where 0 means 1024).
*/
switch (nm_device_get_device_type (self)) {
+ /* 50 is reserved for VPN (NM_VPN_ROUTE_METRIC_DEFAULT) */
case NM_DEVICE_TYPE_ETHERNET:
- return 1;
+ return 100;
case NM_DEVICE_TYPE_INFINIBAND:
- return 2;
+ return 150;
case NM_DEVICE_TYPE_ADSL:
- return 3;
+ return 200;
case NM_DEVICE_TYPE_WIMAX:
- return 4;
+ return 250;
case NM_DEVICE_TYPE_BOND:
- return 5;
+ return 300;
case NM_DEVICE_TYPE_TEAM:
- return 6;
+ return 350;
case NM_DEVICE_TYPE_VLAN:
- return 7;
+ return 400;
+ case NM_DEVICE_TYPE_BRIDGE:
+ return 425;
case NM_DEVICE_TYPE_MODEM:
- return 8;
+ return 450;
case NM_DEVICE_TYPE_BT:
- return 9;
+ return 550;
case NM_DEVICE_TYPE_WIFI:
- return 10;
+ return 600;
case NM_DEVICE_TYPE_OLPC_MESH:
- return 11;
- default:
- return 20;
+ return 650;
+ case NM_DEVICE_TYPE_GENERIC:
+ return 950;
+ case NM_DEVICE_TYPE_UNKNOWN:
+ return 10000;
+ case NM_DEVICE_TYPE_UNUSED1:
+ case NM_DEVICE_TYPE_UNUSED2:
+ /* omit default: to get compiler warning about missing switch cases */
+ break;
}
+ return 11000;
+}
+
+guint32
+nm_device_get_ip4_route_metric (NMDevice *self)
+{
+ NMConnection *connection;
+ NMSettingIPConfig *s_ip = NULL;
+ gint64 route_metric = -1;
+
+ g_return_val_if_fail (NM_IS_DEVICE (self), G_MAXUINT32);
+
+ connection = nm_device_get_connection (self);
+ if (connection)
+ s_ip = nm_connection_get_setting_ip4_config (connection);
+
+ /* Slave interfaces don't have IP settings, but we may get here when
+ * external changes are made or when noticing IP changes when starting
+ * the slave connection.
+ */
+ if (s_ip)
+ route_metric = nm_setting_ip_config_get_route_metric (s_ip);
+
+ return route_metric >= 0 ? route_metric : nm_device_get_priority (self);
+}
+
+guint32
+nm_device_get_ip6_route_metric (NMDevice *self)
+{
+ NMConnection *connection;
+ NMSettingIPConfig *s_ip = NULL;
+ gint64 route_metric = -1;
+
+ g_return_val_if_fail (NM_IS_DEVICE (self), G_MAXUINT32);
+
+ connection = nm_device_get_connection (self);
+ if (connection)
+ s_ip = nm_connection_get_setting_ip6_config (connection);
+
+ /* Slave interfaces don't have IP settings, but we may get here when
+ * external changes are made or when noticing IP changes when starting
+ * the slave connection.
+ */
+ if (s_ip)
+ route_metric = nm_setting_ip_config_get_route_metric (s_ip);
+
+ return route_metric >= 0 ? route_metric : nm_device_get_priority (self);
+}
+
+const NMPlatformIP4Route *
+nm_device_get_ip4_default_route (NMDevice *self, gboolean *out_is_assumed)
+{
+ NMDevicePrivate *priv;
+
+ g_return_val_if_fail (NM_IS_DEVICE (self), NULL);
+
+ priv = NM_DEVICE_GET_PRIVATE (self);
+
+ if (out_is_assumed)
+ *out_is_assumed = priv->default_route.v4_is_assumed;
+
+ return priv->default_route.v4_has ? &priv->default_route.v4 : NULL;
+}
+
+const NMPlatformIP6Route *
+nm_device_get_ip6_default_route (NMDevice *self, gboolean *out_is_assumed)
+{
+ NMDevicePrivate *priv;
+
+ g_return_val_if_fail (NM_IS_DEVICE (self), NULL);
+
+ priv = NM_DEVICE_GET_PRIVATE (self);
+
+ if (out_is_assumed)
+ *out_is_assumed = priv->default_route.v6_is_assumed;
+
+ return priv->default_route.v6_has ? &priv->default_route.v6 : NULL;
}
const char *
@@ -742,6 +864,17 @@ nm_device_uses_generated_assumed_connection (NMDevice *self)
return FALSE;
}
+gboolean
+nm_device_uses_assumed_connection (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+ if ( priv->act_request
+ && nm_active_connection_get_assumed (NM_ACTIVE_CONNECTION (priv->act_request)))
+ return TRUE;
+ return FALSE;
+}
+
static SlaveInfo *
find_slave_info (NMDevice *self, NMDevice *slave)
{
@@ -863,7 +996,7 @@ nm_device_release_one_slave (NMDevice *self, NMDevice *slave, gboolean configure
}
if (!configure) {
- g_warn_if_fail (reason == NM_DEVICE_STATE_REASON_NONE);
+ g_warn_if_fail (reason == NM_DEVICE_STATE_REASON_NONE || reason == NM_DEVICE_STATE_REASON_REMOVED);
reason = NM_DEVICE_STATE_REASON_NONE;
} else if (reason == NM_DEVICE_STATE_REASON_NONE) {
g_warn_if_reached ();
@@ -881,6 +1014,39 @@ nm_device_release_one_slave (NMDevice *self, NMDevice *slave, gboolean configure
return success;
}
+static gboolean
+is_software_external (NMDevice *self)
+{
+ return nm_device_is_software (self)
+ && !nm_device_get_is_nm_owned (self);
+}
+
+/**
+ * nm_device_finish_init:
+ * @self: the master device
+ *
+ * Whatever needs to be done post-initialization, when the device has a DBus
+ * object name.
+ */
+void
+nm_device_finish_init (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+ g_assert (priv->initialized == FALSE);
+
+ /* Do not manage externally created software devices until they are IFF_UP */
+ if ( is_software_external (self)
+ && !nm_platform_link_is_up (priv->ifindex)
+ && priv->ifindex > 0)
+ nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_EXTERNAL_DOWN, TRUE);
+
+ if (priv->master)
+ nm_device_enslave_slave (priv->master, self, NULL);
+
+ priv->initialized = TRUE;
+}
+
static void
carrier_changed (NMDevice *self, gboolean carrier)
{
@@ -997,6 +1163,7 @@ nm_device_set_carrier (NMDevice *self, gboolean carrier)
g_source_remove (priv->carrier_wait_id);
priv->carrier_wait_id = 0;
nm_device_remove_pending_action (self, "carrier wait", TRUE);
+ _carrier_wait_check_queued_act_request (self);
}
} else if (state <= NM_DEVICE_STATE_DISCONNECTED) {
_LOGI (LOGD_DEVICE, "link disconnected");
@@ -1042,10 +1209,32 @@ update_for_ip_ifname_change (NMDevice *self)
}
static void
+device_set_master (NMDevice *self, int ifindex)
+{
+ NMDevice *master;
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+ master = nm_manager_get_device_by_ifindex (nm_manager_get (), ifindex);
+ if (master && NM_DEVICE_GET_CLASS (master)->enslave_slave) {
+ g_clear_object (&priv->master);
+ priv->master = g_object_ref (master);
+ nm_device_master_add_slave (master, self, FALSE);
+ } else if (master) {
+ _LOGI (LOGD_DEVICE, "enslaved to non-master-type device %s; ignoring",
+ nm_device_get_iface (master));
+ } else {
+ _LOGW (LOGD_DEVICE, "enslaved to unknown device %d %s",
+ ifindex,
+ nm_platform_link_get_name (ifindex));
+ }
+}
+
+static void
device_link_changed (NMDevice *self, NMPlatformLink *info)
{
NMDeviceClass *klass = NM_DEVICE_GET_CLASS (self);
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMUtilsIPv6IfaceId token_iid;
gboolean ip_ifname_changed = FALSE;
if (info->udi && g_strcmp0 (info->udi, priv->udi)) {
@@ -1084,33 +1273,69 @@ device_link_changed (NMDevice *self, NMPlatformLink *info)
}
/* Update slave status for external changes */
- if (info->master && !priv->enslaved) {
- NMDevice *master;
-
- master = nm_manager_get_device_by_ifindex (nm_manager_get (), info->master);
- if (master && NM_DEVICE_GET_CLASS (master)->enslave_slave) {
- g_clear_object (&priv->master);
- priv->master = g_object_ref (master);
- nm_device_master_add_slave (master, self, FALSE);
- nm_device_enslave_slave (master, self, NULL);
- } else if (master) {
- _LOGI (LOGD_DEVICE, "enslaved to non-master-type device %s; ignoring",
- nm_device_get_iface (master));
- } else {
- _LOGW (LOGD_DEVICE, "enslaved to unknown device %d %s",
- info->master,
- nm_platform_link_get_name (info->master));
- }
- } else if (priv->enslaved && !info->master)
+ if (priv->enslaved && info->master != nm_device_get_ifindex (priv->master))
nm_device_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_NONE);
+ if (info->master && !priv->enslaved) {
+ device_set_master (self, info->master);
+ if (priv->master)
+ nm_device_enslave_slave (priv->master, self, NULL);
+ }
+
+ if (priv->rdisc && nm_platform_link_get_ipv6_token (priv->ifindex, &token_iid)) {
+ _LOGD (LOGD_DEVICE, "IPv6 tokenized identifier present on device %s", priv->iface);
+ if (nm_rdisc_set_iid (priv->rdisc, token_iid))
+ nm_rdisc_start (priv->rdisc);
+ }
if (klass->link_changed)
klass->link_changed (self, info);
-
/* Update DHCP, etc, if needed */
if (ip_ifname_changed)
update_for_ip_ifname_change (self);
+
+ if (priv->up != info->up) {
+ priv->up = info->up;
+
+ /* Manage externally-created software interfaces only when they are IFF_UP */
+ g_assert (priv->ifindex > 0);
+ if (is_software_external (self)) {
+ gboolean external_down = nm_device_get_unmanaged_flag (self, NM_UNMANAGED_EXTERNAL_DOWN);
+
+ if (external_down && info->up) {
+ if (nm_device_get_state (self) < NM_DEVICE_STATE_DISCONNECTED) {
+ /* Ensure the assume check is queued before any queued state changes
+ * from the transition to UNAVAILABLE.
+ */
+ nm_device_queue_recheck_assume (self);
+
+ /* Resetting the EXTERNAL_DOWN flag may change the device's state
+ * to UNAVAILABLE. To ensure that the state change doesn't touch
+ * the device before assumption occurs, pass
+ * NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED as the reason.
+ */
+ nm_device_set_unmanaged (self,
+ NM_UNMANAGED_EXTERNAL_DOWN,
+ FALSE,
+ NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
+ } else {
+ /* Don't trigger a state change; if the device is in a
+ * state higher than UNAVAILABLE, it is already IFF_UP
+ * or an explicit activation request was received.
+ */
+ priv->unmanaged_flags &= ~NM_UNMANAGED_EXTERNAL_DOWN;
+ }
+ } else if (!external_down && !info->up && nm_device_get_state (self) <= NM_DEVICE_STATE_DISCONNECTED) {
+ /* If the device is already disconnected and is set !IFF_UP,
+ * unmanage it.
+ */
+ nm_device_set_unmanaged (self,
+ NM_UNMANAGED_EXTERNAL_DOWN,
+ TRUE,
+ NM_DEVICE_STATE_REASON_USER_REQUESTED);
+ }
+ }
+ }
}
static void
@@ -1284,6 +1509,7 @@ nm_device_master_add_slave (NMDevice *self, NMDevice *slave, gboolean configure)
G_CALLBACK (slave_state_changed), self);
priv->slaves = g_slist_append (priv->slaves, info);
}
+ nm_device_queue_recheck_assume (self);
return TRUE;
}
@@ -1492,8 +1718,10 @@ nm_device_slave_notify_release (NMDevice *self, NMDeviceStateReason reason)
master_status);
nm_device_queue_state (self, new_state, reason);
- } else
+ } else if (priv->master)
_LOGI (LOGD_DEVICE, "released from master %s", nm_device_get_iface (priv->master));
+ else
+ _LOGD (LOGD_DEVICE, "released from master%s", priv->enslaved ? "" : " (was not enslaved)");
if (priv->enslaved) {
priv->enslaved = FALSE;
@@ -1514,17 +1742,42 @@ nm_device_get_enslaved (NMDevice *self)
return NM_DEVICE_GET_PRIVATE (self)->enslaved;
}
+/**
+ * nm_device_removed:
+ * @self: the #NMDevice
+ *
+ * Called by the manager when the device was removed. Releases the device from
+ * the master in case it's enslaved.
+ */
+void
+nm_device_removed (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+ if (priv->enslaved)
+ nm_device_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_REMOVED);
+}
+
+
static gboolean
-is_available (NMDevice *self)
+is_available (NMDevice *self, NMDeviceCheckDevAvailableFlags flags)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- return priv->carrier || priv->ignore_carrier;
+ if (priv->carrier || priv->ignore_carrier)
+ return TRUE;
+
+ if (NM_FLAGS_HAS (flags, NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER))
+ return TRUE;
+
+ return FALSE;
}
/**
* nm_device_is_available:
* @self: the #NMDevice
+ * @flags: additional flags to influence the check. Flags have the
+ * meaning to increase the availability of a device.
*
* Checks if @self would currently be capable of activating a
* connection. In particular, it checks that the device is ready (eg,
@@ -1540,14 +1793,14 @@ is_available (NMDevice *self)
* Returns: %TRUE or %FALSE
*/
gboolean
-nm_device_is_available (NMDevice *self)
+nm_device_is_available (NMDevice *self, NMDeviceCheckDevAvailableFlags flags)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
if (priv->firmware_missing)
return FALSE;
- return NM_DEVICE_GET_CLASS (self)->is_available (self);
+ return NM_DEVICE_GET_CLASS (self)->is_available (self, flags);
}
gboolean
@@ -1671,7 +1924,7 @@ can_auto_connect (NMDevice *self,
if (!nm_setting_connection_get_autoconnect (s_con))
return FALSE;
- return nm_device_connection_is_available (self, connection, FALSE);
+ return nm_device_check_connection_available (self, connection, NM_DEVICE_CHECK_CON_AVAILABLE_NONE, NULL);
}
/**
@@ -1852,8 +2105,9 @@ nm_device_generate_connection (NMDevice *self, NMDevice *master)
ip6_method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG);
if ( g_strcmp0 (ip4_method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0
&& g_strcmp0 (ip6_method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0
- && !nm_setting_connection_get_master (NM_SETTING_CONNECTION (s_con))) {
- _LOGD (LOGD_DEVICE, "ignoring generated connection (no IP and not slave)");
+ && !nm_setting_connection_get_master (NM_SETTING_CONNECTION (s_con))
+ && !priv->slaves) {
+ _LOGD (LOGD_DEVICE, "ignoring generated connection (no IP and not in master-slave relationship)");
g_object_unref (connection);
connection = NULL;
}
@@ -2013,7 +2267,7 @@ nm_device_emit_recheck_assume (gpointer self)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
priv->recheck_assume_id = 0;
- if (!nm_device_get_act_request (self) && (priv->ip4_config || priv->ip6_config)) {
+ if (!nm_device_get_act_request (self)) {
_LOGD (LOGD_DEVICE, "emit RECHECK_ASSUME signal");
g_signal_emit (self, signals[RECHECK_ASSUME], 0);
}
@@ -2102,12 +2356,11 @@ activation_source_schedule (NMDevice *self, GSourceFunc func, int family)
}
}
-gboolean
-nm_device_ip_config_should_fail (NMDevice *self, gboolean ip6)
+static gboolean
+get_ip_config_may_fail (NMDevice *self, int family)
{
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip = NULL;
g_return_val_if_fail (self != NULL, TRUE);
@@ -2115,17 +2368,18 @@ nm_device_ip_config_should_fail (NMDevice *self, gboolean ip6)
g_assert (connection);
/* Fail the connection if the failed IP method is required to complete */
- if (ip6) {
- s_ip6 = nm_connection_get_setting_ip6_config (connection);
- if (!nm_setting_ip6_config_get_may_fail (s_ip6))
- return TRUE;
- } else {
- s_ip4 = nm_connection_get_setting_ip4_config (connection);
- if (!nm_setting_ip4_config_get_may_fail (s_ip4))
- return TRUE;
+ switch (family) {
+ case AF_INET:
+ s_ip = nm_connection_get_setting_ip4_config (connection);
+ break;
+ case AF_INET6:
+ s_ip = nm_connection_get_setting_ip6_config (connection);
+ break;
+ default:
+ g_assert_not_reached ();
}
- return FALSE;
+ return nm_setting_ip_config_get_may_fail (s_ip);
}
static void
@@ -2380,7 +2634,7 @@ aipd_get_ip4_config (NMDevice *self, guint32 lla)
NMPlatformIP4Address address;
NMPlatformIP4Route route;
- config = nm_ip4_config_new ();
+ config = nm_ip4_config_new (nm_device_get_ip_ifindex (self));
g_assert (config);
memset (&address, 0, sizeof (address));
@@ -2394,7 +2648,7 @@ aipd_get_ip4_config (NMDevice *self, guint32 lla)
route.network = htonl (0xE0000000L);
route.plen = 4;
route.source = NM_IP_CONFIG_SOURCE_IP4LL;
- route.metric = nm_device_get_priority (self);
+ route.metric = nm_device_get_ip4_route_metric (self);
nm_ip4_config_add_route (config, &route);
return config;
@@ -2514,23 +2768,6 @@ aipd_timeout_cb (gpointer user_data)
return FALSE;
}
-static void
-aipd_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point.
- * Give child it's own program group for signal
- * separation.
- */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for avahi-autoipd here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
/* default to installed helper, but can be modified for testing */
const char *nm_device_autoipd_helper_path = LIBEXECDIR "/nm-avahi-autoipd.action";
@@ -2570,7 +2807,7 @@ aipd_start (NMDevice *self, NMDeviceStateReason *reason)
g_free (cmdline);
if (!g_spawn_async ("/", (char **) argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
- &aipd_child_setup, NULL, &(priv->aipd_pid), &error)) {
+ nm_utils_setpgid, NULL, &(priv->aipd_pid), &error)) {
_LOGW (LOGD_DEVICE | LOGD_AUTOIP4,
"Activation: Stage 3 of 5 (IP Configure Start) failed"
" to start avahi-autoipd: %s",
@@ -2594,6 +2831,90 @@ aipd_start (NMDevice *self, NMDeviceStateReason *reason)
}
/*********************************************/
+
+static gboolean
+_device_get_default_route_from_platform (NMDevice *self, int addr_family, NMPlatformIPRoute *out_route)
+{
+ gboolean success = FALSE;
+ int ifindex = nm_device_get_ip_ifindex (self);
+ GArray *routes;
+
+ if (addr_family == AF_INET)
+ routes = nm_platform_ip4_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT);
+ else
+ routes = nm_platform_ip6_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT);
+
+ if (routes) {
+ guint route_metric = G_MAXUINT32, m;
+ const NMPlatformIPRoute *route = NULL, *r;
+ guint i;
+
+ /* if there are several default routes, find the one with the best metric */
+ for (i = 0; i < routes->len; i++) {
+ if (addr_family == AF_INET) {
+ r = (const NMPlatformIPRoute *) &g_array_index (routes, NMPlatformIP4Route, i);
+ m = r->metric;
+ } else {
+ r = (const NMPlatformIPRoute *) &g_array_index (routes, NMPlatformIP6Route, i);
+ m = nm_utils_ip6_route_metric_normalize (r->metric);
+ }
+ if (!route || m < route_metric) {
+ route = r;
+ route_metric = m;
+ }
+ }
+
+ if (route) {
+ if (addr_family == AF_INET)
+ *((NMPlatformIP4Route *) out_route) = *((NMPlatformIP4Route *) route);
+ else
+ *((NMPlatformIP6Route *) out_route) = *((NMPlatformIP6Route *) route);
+ success = TRUE;
+ }
+ g_array_free (routes, TRUE);
+ }
+ return success;
+}
+
+/*********************************************/
+
+static void
+ensure_con_ipx_config (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ int ip_ifindex = nm_device_get_ip_ifindex (self);
+ NMConnection *connection;
+
+ g_assert (!!priv->con_ip4_config == !!priv->con_ip6_config);
+
+ if (priv->con_ip4_config)
+ return;
+
+ connection = nm_device_get_connection (self);
+ if (!connection)
+ return;
+
+ priv->con_ip4_config = nm_ip4_config_new (ip_ifindex);
+ priv->con_ip6_config = nm_ip6_config_new (ip_ifindex);
+
+ nm_ip4_config_merge_setting (priv->con_ip4_config,
+ nm_connection_get_setting_ip4_config (connection),
+ nm_device_get_ip4_route_metric (self));
+ nm_ip6_config_merge_setting (priv->con_ip6_config,
+ nm_connection_get_setting_ip6_config (connection),
+ nm_device_get_ip6_route_metric (self));
+
+ if (nm_device_uses_assumed_connection (self)) {
+ /* For assumed connections ignore all addresses and routes. */
+ nm_ip4_config_reset_addresses (priv->con_ip4_config);
+ nm_ip4_config_reset_routes (priv->con_ip4_config);
+
+ nm_ip6_config_reset_addresses (priv->con_ip6_config);
+ nm_ip6_config_reset_routes (priv->con_ip6_config);
+ }
+}
+
+/*********************************************/
/* DHCPv4 stuff */
static void
@@ -2632,6 +2953,9 @@ ip4_config_merge_and_apply (NMDevice *self,
NMConnection *connection;
gboolean success;
NMIP4Config *composite;
+ gboolean has_direct_route;
+ const guint32 default_route_metric = nm_device_get_ip4_route_metric (self);
+ guint32 gateway;
/* Merge all the configs into the composite config */
if (config) {
@@ -2639,7 +2963,10 @@ ip4_config_merge_and_apply (NMDevice *self,
priv->dev_ip4_config = g_object_ref (config);
}
- composite = nm_ip4_config_new ();
+ composite = nm_ip4_config_new (nm_device_get_ip_ifindex (self));
+
+ ensure_con_ipx_config (self);
+
if (priv->dev_ip4_config)
nm_ip4_config_merge (composite, priv->dev_ip4_config);
if (priv->vpn4_config)
@@ -2653,16 +2980,87 @@ ip4_config_merge_and_apply (NMDevice *self,
if (priv->wwan_ip4_config)
nm_ip4_config_merge (composite, priv->wwan_ip4_config);
- /* Merge user overrides into the composite config. Generated+assumed
- * connections come from the system not the user and merging them would
- * be redundant, so don't bother.
- */
+ /* Merge user overrides into the composite config. For assumed connection,
+ * con_ip4_config is empty. */
+ if (priv->con_ip4_config)
+ nm_ip4_config_merge (composite, priv->con_ip4_config);
+
connection = nm_device_get_connection (self);
- if ( connection
- && !nm_settings_connection_get_nm_generated_assumed (NM_SETTINGS_CONNECTION (connection))) {
- nm_ip4_config_merge_setting (composite,
- nm_connection_get_setting_ip4_config (connection),
- nm_device_get_priority (self));
+
+ /* Add the default route.
+ *
+ * We keep track of the default route of a device in a private field.
+ * NMDevice needs to know the default route at this point, because the gateway
+ * might require a direct route (see below).
+ *
+ * But also, we don't want to add the default route to priv->ip4_config,
+ * because the default route from the setting might not be the same that
+ * NMDefaultRouteManager eventually configures (because the it might
+ * tweak the effective metric).
+ */
+
+ /* unless we come to a different conclusion below, we have no default route and
+ * the route is assumed. */
+ priv->default_route.v4_has = FALSE;
+ priv->default_route.v4_is_assumed = TRUE;
+
+ if (!commit) {
+ /* during a non-commit event, we always pickup whatever is configured. */
+ goto END_ADD_DEFAULT_ROUTE;
+ }
+
+ if (nm_device_uses_assumed_connection (self))
+ goto END_ADD_DEFAULT_ROUTE;
+
+
+ /* we are about to commit (for a non-assumed connection). Enforce whatever we have
+ * configured. */
+ priv->default_route.v4_is_assumed = FALSE;
+
+ if ( !connection
+ || !nm_default_route_manager_ip4_connection_has_default_route (nm_default_route_manager_get (), connection))
+ goto END_ADD_DEFAULT_ROUTE;
+
+ if (!nm_ip4_config_get_num_addresses (composite)) {
+ /* without addresses we can have no default route. */
+ goto END_ADD_DEFAULT_ROUTE;
+ }
+
+ gateway = nm_ip4_config_get_gateway (composite);
+ if ( !gateway
+ && nm_device_get_device_type (self) != NM_DEVICE_TYPE_MODEM)
+ goto END_ADD_DEFAULT_ROUTE;
+
+ has_direct_route = ( gateway == 0
+ || nm_ip4_config_get_subnet_for_host (composite, gateway)
+ || nm_ip4_config_get_direct_route_for_host (composite, gateway));
+
+ priv->default_route.v4_has = TRUE;
+ memset (&priv->default_route.v4, 0, sizeof (priv->default_route.v4));
+ priv->default_route.v4.source = NM_IP_CONFIG_SOURCE_USER;
+ priv->default_route.v4.gateway = gateway;
+ priv->default_route.v4.metric = default_route_metric;
+ priv->default_route.v4.mss = nm_ip4_config_get_mss (composite);
+
+ if (!has_direct_route) {
+ NMPlatformIP4Route r = priv->default_route.v4;
+
+ /* add a direct route to the gateway */
+ r.network = gateway;
+ r.plen = 32;
+ r.gateway = 0;
+ nm_ip4_config_add_route (composite, &r);
+ }
+
+END_ADD_DEFAULT_ROUTE:
+
+ if (priv->default_route.v4_is_assumed) {
+ /* If above does not explicitly assign a default route, we always pick up the
+ * default route based on what is currently configured.
+ * That means that even managed connections with never-default, can
+ * get a default route (if configured externally).
+ */
+ priv->default_route.v4_has = _device_get_default_route_from_platform (self, AF_INET, (NMPlatformIPRoute *) &priv->default_route.v4);
}
/* Allow setting MTU etc */
@@ -2671,7 +3069,7 @@ ip4_config_merge_and_apply (NMDevice *self,
NM_DEVICE_GET_CLASS (self)->ip4_config_pre_commit (self, composite);
}
- success = nm_device_set_ip4_config (self, composite, commit, out_reason);
+ success = nm_device_set_ip4_config (self, composite, default_route_metric, commit, out_reason);
g_object_unref (composite);
return success;
}
@@ -2762,9 +3160,13 @@ dhcp4_state_changed (NMDhcpClient *client,
case NM_DHCP_STATE_TIMEOUT:
dhcp4_fail (self, TRUE);
break;
+ case NM_DHCP_STATE_EXPIRE:
+ /* Ignore expiry before we even have a lease (NAK, old lease, etc) */
+ if (priv->ip4_state == IP_CONF)
+ break;
+ /* Fall through */
case NM_DHCP_STATE_DONE:
case NM_DHCP_STATE_FAIL:
- /* dhclient quit and can't get/renew a lease; so kill the connection */
dhcp4_fail (self, FALSE);
break;
default:
@@ -2778,7 +3180,7 @@ dhcp4_start (NMDevice *self,
NMDeviceStateReason *reason)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
const guint8 *hw_addr;
size_t hw_addr_len = 0;
GByteArray *tmp = NULL;
@@ -2803,12 +3205,13 @@ dhcp4_start (NMDevice *self,
nm_device_get_ip_ifindex (self),
tmp,
nm_connection_get_uuid (connection),
- nm_device_get_priority (self),
- nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4),
- nm_setting_ip4_config_get_dhcp_hostname (s_ip4),
- nm_setting_ip4_config_get_dhcp_client_id (s_ip4),
+ nm_device_get_ip4_route_metric (self),
+ nm_setting_ip_config_get_dhcp_send_hostname (s_ip4),
+ nm_setting_ip_config_get_dhcp_hostname (s_ip4),
+ nm_setting_ip4_config_get_dhcp_client_id (NM_SETTING_IP4_CONFIG (s_ip4)),
priv->dhcp_timeout,
- priv->dhcp_anycast_address);
+ priv->dhcp_anycast_address,
+ NULL);
if (tmp)
g_byte_array_free (tmp, TRUE);
@@ -2864,20 +3267,20 @@ release_shared_ip (gpointer data)
}
static gboolean
-reserve_shared_ip (NMDevice *self, NMSettingIP4Config *s_ip4, NMPlatformIP4Address *address)
+reserve_shared_ip (NMDevice *self, NMSettingIPConfig *s_ip4, NMPlatformIP4Address *address)
{
if (G_UNLIKELY (shared_ips == NULL))
shared_ips = g_hash_table_new (g_direct_hash, g_direct_equal);
memset (address, 0, sizeof (*address));
- if (s_ip4 && nm_setting_ip4_config_get_num_addresses (s_ip4)) {
+ if (s_ip4 && nm_setting_ip_config_get_num_addresses (s_ip4)) {
/* Use the first user-supplied address */
- NMIP4Address *user = nm_setting_ip4_config_get_address (s_ip4, 0);
+ NMIPAddress *user = nm_setting_ip_config_get_address (s_ip4, 0);
g_assert (user);
- address->address = nm_ip4_address_get_address (user);
- address->plen = nm_ip4_address_get_prefix (user);
+ nm_ip_address_get_address_binary (user, &address->address);
+ address->plen = nm_ip_address_get_prefix (user);
} else {
/* Find an unused address in the 10.42.x.x range */
guint32 start = (guint32) ntohl (0x0a2a0001); /* 10.42.0.1 */
@@ -2914,7 +3317,7 @@ shared4_new_config (NMDevice *self, NMConnection *connection, NMDeviceStateReaso
return NULL;
}
- config = nm_ip4_config_new ();
+ config = nm_ip4_config_new (nm_device_get_ip_ifindex (self));
address.source = NM_IP_CONFIG_SOURCE_SHARED;
nm_ip4_config_add_address (config, &address);
@@ -2964,8 +3367,7 @@ connection_ip6_method_requires_carrier (NMConnection *connection,
static gboolean
connection_requires_carrier (NMConnection *connection)
{
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4, *s_ip6;
gboolean ip4_carrier_wanted, ip6_carrier_wanted;
gboolean ip4_used = FALSE, ip6_used = FALSE;
@@ -2975,7 +3377,7 @@ connection_requires_carrier (NMConnection *connection)
* requires a carrier regardless of the IPv6 method.
*/
s_ip4 = nm_connection_get_setting_ip4_config (connection);
- if (s_ip4 && !nm_setting_ip4_config_get_may_fail (s_ip4))
+ if (s_ip4 && !nm_setting_ip_config_get_may_fail (s_ip4))
return TRUE;
}
@@ -2985,7 +3387,7 @@ connection_requires_carrier (NMConnection *connection)
* requires a carrier regardless of the IPv4 method.
*/
s_ip6 = nm_connection_get_setting_ip6_config (connection);
- if (s_ip6 && !nm_setting_ip6_config_get_may_fail (s_ip6))
+ if (s_ip6 && !nm_setting_ip_config_get_may_fail (s_ip6))
return TRUE;
}
@@ -3075,7 +3477,7 @@ act_stage3_ip4_config_start (NMDevice *self,
ret = aipd_start (self, reason);
else if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0) {
/* Use only IPv4 config from the connection data */
- *out_config = nm_ip4_config_new ();
+ *out_config = nm_ip4_config_new (nm_device_get_ip_ifindex (self));
g_assert (*out_config);
ret = NM_ACT_STAGE_RETURN_SUCCESS;
} else if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED) == 0) {
@@ -3111,14 +3513,14 @@ dhcp6_cleanup (NMDevice *self, gboolean stop, gboolean release)
priv->dhcp6_state_sigid = 0;
}
- nm_device_remove_pending_action (self, PENDING_ACTION_DHCP6, FALSE);
-
if (stop)
nm_dhcp_client_stop (priv->dhcp6_client, release);
g_clear_object (&priv->dhcp6_client);
}
+ nm_device_remove_pending_action (self, PENDING_ACTION_DHCP6, FALSE);
+
if (priv->dhcp6_config) {
g_clear_object (&priv->dhcp6_config);
g_object_notify (G_OBJECT (self), NM_DEVICE_DHCP6_CONFIG);
@@ -3134,9 +3536,13 @@ ip6_config_merge_and_apply (NMDevice *self,
NMConnection *connection;
gboolean success;
NMIP6Config *composite;
+ gboolean has_direct_route;
+ const struct in6_addr *gateway;
/* If no config was passed in, create a new one */
- composite = nm_ip6_config_new ();
+ composite = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
+
+ ensure_con_ipx_config (self);
g_assert (composite);
/* Merge all the IP configs into the composite config */
@@ -3155,16 +3561,87 @@ ip6_config_merge_and_apply (NMDevice *self,
if (priv->wwan_ip6_config)
nm_ip6_config_merge (composite, priv->wwan_ip6_config);
- /* Merge user overrides into the composite config. Generated+assumed
- * connections come from the system not the user and merging them would
- * be redundant, so don't bother.
- */
+ /* Merge user overrides into the composite config. For assumed connections,
+ * con_ip6_config is empty. */
+ if (priv->con_ip6_config)
+ nm_ip6_config_merge (composite, priv->con_ip6_config);
+
connection = nm_device_get_connection (self);
- if ( connection
- && !nm_settings_connection_get_nm_generated_assumed (NM_SETTINGS_CONNECTION (connection))) {
- nm_ip6_config_merge_setting (composite,
- nm_connection_get_setting_ip6_config (connection),
- nm_device_get_priority (self));
+
+ /* Add the default route.
+ *
+ * We keep track of the default route of a device in a private field.
+ * NMDevice needs to know the default route at this point, because the gateway
+ * might require a direct route (see below).
+ *
+ * But also, we don't want to add the default route to priv->ip6_config,
+ * because the default route from the setting might not be the same that
+ * NMDefaultRouteManager eventually configures (because the it might
+ * tweak the effective metric).
+ */
+
+ /* unless we come to a different conclusion below, we have no default route and
+ * the route is assumed. */
+ priv->default_route.v6_has = FALSE;
+ priv->default_route.v6_is_assumed = TRUE;
+
+ if (!commit) {
+ /* during a non-commit event, we always pickup whatever is configured. */
+ goto END_ADD_DEFAULT_ROUTE;
+ }
+
+ if (nm_device_uses_assumed_connection (self))
+ goto END_ADD_DEFAULT_ROUTE;
+
+
+ /* we are about to commit (for a non-assumed connection). Enforce whatever we have
+ * configured. */
+ priv->default_route.v6_is_assumed = FALSE;
+
+ if ( !connection
+ || !nm_default_route_manager_ip6_connection_has_default_route (nm_default_route_manager_get (), connection))
+ goto END_ADD_DEFAULT_ROUTE;
+
+ if (!nm_ip6_config_get_num_addresses (composite)) {
+ /* without addresses we can have no default route. */
+ goto END_ADD_DEFAULT_ROUTE;
+ }
+
+ gateway = nm_ip6_config_get_gateway (composite);
+ if (!gateway)
+ goto END_ADD_DEFAULT_ROUTE;
+
+
+ has_direct_route = nm_ip6_config_get_direct_route_for_host (composite, gateway) != NULL;
+
+
+
+ priv->default_route.v6_has = TRUE;
+ memset (&priv->default_route.v6, 0, sizeof (priv->default_route.v6));
+ priv->default_route.v6.source = NM_IP_CONFIG_SOURCE_USER;
+ priv->default_route.v6.gateway = *gateway;
+ priv->default_route.v6.metric = nm_device_get_ip6_route_metric (self);
+ priv->default_route.v6.mss = nm_ip6_config_get_mss (composite);
+
+ if (!has_direct_route) {
+ NMPlatformIP6Route r = priv->default_route.v6;
+
+ /* add a direct route to the gateway */
+ r.network = *gateway;
+ r.plen = 128;
+ r.gateway = in6addr_any;
+ nm_ip6_config_add_route (composite, &r);
+ }
+
+END_ADD_DEFAULT_ROUTE:
+
+ if (priv->default_route.v6_is_assumed) {
+ /* If above does not explicitly assign a default route, we always pick up the
+ * default route based on what is currently configured.
+ * That means that even managed connections with never-default, can
+ * get a default route (if configured externally).
+ */
+ priv->default_route.v6_has = _device_get_default_route_from_platform (self, AF_INET6, (NMPlatformIPRoute *) &priv->default_route.v6);
}
nm_ip6_config_addresses_sort (composite,
@@ -3297,6 +3774,11 @@ dhcp6_state_changed (NMDhcpClient *client,
case NM_DHCP_STATE_TIMEOUT:
dhcp6_timeout (self, client);
break;
+ case NM_DHCP_STATE_EXPIRE:
+ /* Ignore expiry before we even have a lease (NAK, old lease, etc) */
+ if (priv->ip6_state != IP_CONF)
+ dhcp6_fail (self, FALSE);
+ break;
case NM_DHCP_STATE_DONE:
/* In IPv6 info-only mode, the client doesn't handle leases so it
* may exit right after getting a response from the server. That's
@@ -3306,7 +3788,6 @@ dhcp6_state_changed (NMDhcpClient *client,
break;
/* Otherwise, fall through */
case NM_DHCP_STATE_FAIL:
- /* dhclient quit and can't get/renew a lease; so kill the connection */
dhcp6_fail (self, FALSE);
break;
default:
@@ -3314,38 +3795,19 @@ dhcp6_state_changed (NMDhcpClient *client,
}
}
-static NMActStageReturn
-dhcp6_start (NMDevice *self,
- NMConnection *connection,
- guint32 dhcp_opt,
- NMDeviceStateReason *reason)
+static gboolean
+dhcp6_start_with_link_ready (NMDevice *self, NMConnection *connection)
{
- NMSettingIP6Config *s_ip6;
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE;
+ NMSettingIPConfig *s_ip6;
GByteArray *tmp = NULL;
const guint8 *hw_addr;
size_t hw_addr_len = 0;
- if (!connection) {
- connection = nm_device_get_connection (self);
- g_assert (connection);
- }
-
+ g_assert (connection);
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
- /* Clear old exported DHCP options */
- if (priv->dhcp6_config)
- g_object_unref (priv->dhcp6_config);
- priv->dhcp6_config = nm_dhcp6_config_new ();
-
- g_warn_if_fail (priv->dhcp6_ip6_config == NULL);
- if (priv->dhcp6_ip6_config) {
- g_object_unref (priv->dhcp6_ip6_config);
- priv->dhcp6_ip6_config = NULL;
- }
-
hw_addr = nm_platform_link_get_address (nm_device_get_ip_ifindex (self), &hw_addr_len);
if (hw_addr_len) {
tmp = g_byte_array_sized_new (hw_addr_len);
@@ -3357,12 +3819,13 @@ dhcp6_start (NMDevice *self,
nm_device_get_ip_ifindex (self),
tmp,
nm_connection_get_uuid (connection),
- nm_device_get_priority (self),
- nm_setting_ip6_config_get_dhcp_hostname (s_ip6),
+ nm_device_get_ip6_route_metric (self),
+ nm_setting_ip_config_get_dhcp_send_hostname (s_ip6),
+ nm_setting_ip_config_get_dhcp_hostname (s_ip6),
priv->dhcp_timeout,
priv->dhcp_anycast_address,
- (dhcp_opt == NM_RDISC_DHCP_LEVEL_OTHERCONF) ? TRUE : FALSE,
- nm_setting_ip6_config_get_ip6_privacy (s_ip6));
+ (priv->dhcp6_mode == NM_RDISC_DHCP_LEVEL_OTHERCONF) ? TRUE : FALSE,
+ nm_setting_ip6_config_get_ip6_privacy (NM_SETTING_IP6_CONFIG (s_ip6)));
if (tmp)
g_byte_array_free (tmp, TRUE);
@@ -3371,29 +3834,57 @@ dhcp6_start (NMDevice *self,
NM_DHCP_CLIENT_SIGNAL_STATE_CHANGED,
G_CALLBACK (dhcp6_state_changed),
self);
+ }
- s_ip6 = nm_connection_get_setting_ip6_config (connection);
- if (!nm_setting_ip6_config_get_may_fail (s_ip6) ||
- !strcmp (nm_setting_ip6_config_get_method (s_ip6), NM_SETTING_IP6_CONFIG_METHOD_DHCP))
- nm_device_add_pending_action (self, PENDING_ACTION_DHCP6, TRUE);
+ return !!priv->dhcp6_client;
+}
- /* DHCP devices will be notified by the DHCP manager when stuff happens */
- ret = NM_ACT_STAGE_RETURN_POSTPONE;
- } else {
+static gboolean
+dhcp6_start (NMDevice *self, gboolean wait_for_ll, NMDeviceStateReason *reason)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMConnection *connection;
+ NMSettingIPConfig *s_ip6;
+
+ g_clear_object (&priv->dhcp6_config);
+ priv->dhcp6_config = nm_dhcp6_config_new ();
+
+ g_warn_if_fail (priv->dhcp6_ip6_config == NULL);
+ g_clear_object (&priv->dhcp6_ip6_config);
+
+ connection = nm_device_get_connection (self);
+ g_assert (connection);
+ s_ip6 = nm_connection_get_setting_ip6_config (connection);
+ if (!nm_setting_ip_config_get_may_fail (s_ip6) ||
+ !strcmp (nm_setting_ip_config_get_method (s_ip6), NM_SETTING_IP6_CONFIG_METHOD_DHCP))
+ nm_device_add_pending_action (self, PENDING_ACTION_DHCP6, TRUE);
+
+ if (wait_for_ll) {
+ NMActStageReturn ret;
+
+ /* ensure link local is ready... */
+ ret = linklocal6_start (self);
+ if (ret == NM_ACT_STAGE_RETURN_POSTPONE) {
+ /* success; wait for the LL address to show up */
+ return TRUE;
+ }
+
+ /* success; already have the LL address; kick off DHCP */
+ g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS || ret == NM_ACT_STAGE_RETURN_FINISH);
+ }
+
+ if (!dhcp6_start_with_link_ready (self, connection)) {
*reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED;
- ret = NM_ACT_STAGE_RETURN_FAILURE;
+ return FALSE;
}
- return ret;
+ return TRUE;
}
gboolean
nm_device_dhcp6_renew (NMDevice *self, gboolean release)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- NMActStageReturn ret;
- NMDeviceStateReason reason;
- NMConnection *connection;
g_return_val_if_fail (priv->dhcp6_client != NULL, FALSE);
@@ -3402,13 +3893,8 @@ nm_device_dhcp6_renew (NMDevice *self, gboolean release)
/* Terminate old DHCP instance and release the old lease */
dhcp6_cleanup (self, TRUE, release);
- connection = nm_device_get_connection (self);
- g_assert (connection);
-
/* Start DHCP again on the interface */
- ret = dhcp6_start (self, connection, priv->dhcp6_mode, &reason);
-
- return (ret != NM_ACT_STAGE_RETURN_FAILURE);
+ return dhcp6_start (self, FALSE, NULL);
}
/******************************************/
@@ -3421,6 +3907,8 @@ have_ip6_address (const NMIP6Config *ip6_config, gboolean linklocal)
if (!ip6_config)
return FALSE;
+ linklocal = !!linklocal;
+
for (i = 0; i < nm_ip6_config_get_num_addresses (ip6_config); i++) {
const NMPlatformIP6Address *addr = nm_ip6_config_get_address (ip6_config, i);
@@ -3480,6 +3968,11 @@ linklocal6_complete (NMDevice *self)
/* Time out IPv6 instead of failing the entire activation */
nm_device_activate_schedule_ip6_config_timeout (self);
}
+ } else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0) {
+ if (!dhcp6_start_with_link_ready (self, connection)) {
+ /* Time out IPv6 instead of failing the entire activation */
+ nm_device_activate_schedule_ip6_config_timeout (self);
+ }
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0)
nm_device_activate_schedule_ip6_config_result (self);
else
@@ -3542,7 +4035,7 @@ linklocal6_start (NMDevice *self)
linklocal6_cleanup (self);
if (have_ip6_address (priv->ip6_config, TRUE))
- return NM_ACT_STAGE_RETURN_SUCCESS;
+ return NM_ACT_STAGE_RETURN_FINISH;
connection = nm_device_get_connection (self);
g_assert (connection);
@@ -3606,13 +4099,63 @@ print_support_extended_ifa_flags (NMSettingIP6ConfigPrivacy use_tempaddr)
warn = 2;
}
+static void nm_device_ipv6_set_mtu (NMDevice *self, guint32 mtu);
+
+static void
+nm_device_set_mtu (NMDevice *self, guint32 mtu)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ int ifindex = nm_device_get_ifindex (self);
+
+ if (mtu)
+ priv->mtu = mtu;
+
+ /* Ensure the IPv6 MTU is still alright. */
+ if (priv->ip6_mtu)
+ nm_device_ipv6_set_mtu (self, priv->ip6_mtu);
+
+ if (priv->mtu != nm_platform_link_get_mtu (ifindex))
+ nm_platform_link_set_mtu (ifindex, priv->mtu);
+}
+
+static void
+nm_device_ipv6_set_mtu (NMDevice *self, guint32 mtu)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ guint32 plat_mtu = nm_device_ipv6_sysctl_get_int32 (self, "mtu", priv->mtu);
+ char val[16];
+
+ priv->ip6_mtu = mtu ?: plat_mtu;
+
+ if (priv->ip6_mtu && priv->mtu < priv->ip6_mtu) {
+ _LOGW (LOGD_DEVICE | LOGD_IP6, "Lowering IPv6 MTU (%d) to match device MTU (%d)",
+ priv->ip6_mtu, priv->mtu);
+ priv->ip6_mtu = priv->mtu;
+ }
+
+ if (priv->ip6_mtu < 1280) {
+ _LOGW (LOGD_DEVICE | LOGD_IP6, "IPv6 MTU (%d) smaller than 1280, adjusting",
+ priv->ip6_mtu);
+ priv->ip6_mtu = 1280;
+ }
+
+ if (priv->mtu < priv->ip6_mtu) {
+ _LOGW (LOGD_DEVICE | LOGD_IP6, "Raising device MTU (%d) to match IPv6 MTU (%d)",
+ priv->mtu, priv->ip6_mtu);
+ nm_device_set_mtu (self, priv->ip6_mtu);
+ }
+
+ if (priv->ip6_mtu != plat_mtu) {
+ g_snprintf (val, sizeof (val), "%d", mtu);
+ nm_device_ipv6_sysctl_set (self, "mtu", val);
+ }
+}
+
static void
rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- NMConnection *connection;
int i;
- NMDeviceStateReason reason;
static int system_support = -1;
guint ifa_flags = 0x00;
@@ -3638,11 +4181,9 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
}
g_return_if_fail (priv->act_request);
- connection = nm_device_get_connection (self);
- g_assert (connection);
if (!priv->ac_ip6_config)
- priv->ac_ip6_config = nm_ip6_config_new ();
+ priv->ac_ip6_config = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
if (changed & NM_RDISC_CONFIG_GATEWAYS) {
/* Use the first gateway as ordered in router discovery cache. */
@@ -3700,7 +4241,7 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
route.plen = discovered_route->plen;
route.gateway = discovered_route->gateway;
route.source = NM_IP_CONFIG_SOURCE_RDISC;
- route.metric = nm_device_get_priority (self);
+ route.metric = nm_device_get_ip6_route_metric (self);
nm_ip6_config_add_route (priv->ac_ip6_config, &route);
}
@@ -3733,24 +4274,17 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
dhcp6_cleanup (self, TRUE, TRUE);
priv->dhcp6_mode = rdisc->dhcp_level;
+ if (priv->dhcp6_mode != NM_RDISC_DHCP_LEVEL_NONE) {
+ NMDeviceStateReason reason;
- switch (priv->dhcp6_mode) {
- case NM_RDISC_DHCP_LEVEL_NONE:
- break;
- default:
_LOGI (LOGD_DEVICE | LOGD_DHCP6,
"Activation: Stage 3 of 5 (IP Configure Start) starting DHCPv6"
" as requested by IPv6 router...");
- switch (dhcp6_start (self, connection, priv->dhcp6_mode, &reason)) {
- case NM_ACT_STAGE_RETURN_SUCCESS:
- g_warn_if_reached ();
- break;
- case NM_ACT_STAGE_RETURN_POSTPONE:
- return;
- default:
- nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason);
- return;
+ if (!dhcp6_start (self, FALSE, &reason)) {
+ if (priv->dhcp6_mode == NM_RDISC_DHCP_LEVEL_MANAGED)
+ nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason);
}
+ return;
}
}
@@ -3763,12 +4297,8 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
nm_device_ipv6_sysctl_set (self, "hop_limit", val);
}
- if (changed & NM_RDISC_CONFIG_MTU) {
- char val[16];
-
- g_snprintf (val, sizeof (val), "%d", rdisc->mtu);
- nm_device_ipv6_sysctl_set (self, "mtu", val);
- }
+ if (changed & NM_RDISC_CONFIG_MTU)
+ priv->ip6_mtu = rdisc->mtu;
nm_device_activate_schedule_ip6_config_result (self);
}
@@ -3805,11 +4335,12 @@ addrconf6_start_with_link_ready (NMDevice *self)
g_assert (priv->rdisc);
- if (!nm_device_get_ip_iface_identifier (self, &iid)) {
+ if (nm_platform_link_get_ipv6_token (priv->ifindex, &iid)) {
+ _LOGD (LOGD_DEVICE, "IPv6 tokenized identifier present on device %s", priv->iface);
+ } else if (!nm_device_get_ip_iface_identifier (self, &iid)) {
_LOGW (LOGD_IP6, "failed to get interface identifier; IPv6 cannot continue");
return FALSE;
}
- nm_rdisc_set_iid (priv->rdisc, iid);
/* Apply any manual configuration before starting RA */
if (!ip6_config_merge_and_apply (self, TRUE, NULL))
@@ -3828,11 +4359,13 @@ addrconf6_start_with_link_ready (NMDevice *self)
NM_RDISC_RA_TIMEOUT,
G_CALLBACK (rdisc_ra_timeout),
self);
+
+ nm_rdisc_set_iid (priv->rdisc, iid);
nm_rdisc_start (priv->rdisc);
return TRUE;
}
-static NMActStageReturn
+static gboolean
addrconf6_start (NMDevice *self, NMSettingIP6ConfigPrivacy use_tempaddr)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
@@ -3858,7 +4391,7 @@ addrconf6_start (NMDevice *self, NMSettingIP6ConfigPrivacy use_tempaddr)
priv->rdisc_use_tempaddr = use_tempaddr;
print_support_extended_ifa_flags (use_tempaddr);
- if (!nm_setting_ip6_config_get_may_fail (nm_connection_get_setting_ip6_config (connection)))
+ if (!nm_setting_ip_config_get_may_fail (nm_connection_get_setting_ip6_config (connection)))
nm_device_add_pending_action (self, PENDING_ACTION_AUTOCONF6, TRUE);
/* ensure link local is ready... */
@@ -3869,7 +4402,7 @@ addrconf6_start (NMDevice *self, NMSettingIP6ConfigPrivacy use_tempaddr)
}
/* success; already have the LL address; kick off router discovery */
- g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS);
+ g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS || ret == NM_ACT_STAGE_RETURN_FINISH);
return addrconf6_start_with_link_ready (self);
}
@@ -3955,6 +4488,8 @@ set_nm_ipv6ll (NMDevice *self, gboolean enable)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
int ifindex = nm_device_get_ip_ifindex (self);
+ const char *iface = nm_device_get_ip_iface (self);
+ char *value;
if (!nm_platform_check_support_user_ipv6ll ())
return;
@@ -3967,6 +4502,18 @@ set_nm_ipv6ll (NMDevice *self, gboolean enable)
if ( !nm_platform_link_set_user_ipv6ll_enabled (ifindex, enable)
&& nm_platform_get_error () != NM_PLATFORM_ERROR_NOT_FOUND)
_LOGW (LOGD_IP6, "failed to %s userspace IPv6LL address handling", detail);
+
+ if (enable) {
+ /* Bounce IPv6 to ensure the kernel stops IPv6LL address generation */
+ value = nm_platform_sysctl_get (nm_utils_ip6_property_path (iface, "disable_ipv6"));
+ if (g_strcmp0 (value, "0") == 0)
+ nm_device_ipv6_sysctl_set (self, "disable_ipv6", "1");
+ g_free (value);
+
+ /* Ensure IPv6 is enabled */
+ nm_device_ipv6_sysctl_set (self, "disable_ipv6", "0");
+ }
+
}
}
@@ -4060,7 +4607,7 @@ act_stage3_ip6_config_start (NMDevice *self,
connection = nm_device_get_connection (self);
g_assert (connection);
- if ( connection_ip4_method_requires_carrier (connection, NULL)
+ if ( connection_ip6_method_requires_carrier (connection, NULL)
&& priv->is_master
&& !priv->carrier) {
_LOGI (LOGD_IP6 | LOGD_DEVICE,
@@ -4089,22 +4636,32 @@ act_stage3_ip6_config_start (NMDevice *self,
if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0) {
if (!priv->master) {
+ gboolean old_nm_ipv6ll = priv->nm_ipv6ll;
+
/* When activating an IPv6 'ignore' connection we need to revert back
* to kernel IPv6LL, but the kernel won't actually assign an address
* to the interface until disable_ipv6 is bounced.
*/
set_nm_ipv6ll (self, FALSE);
- nm_device_ipv6_sysctl_set (self, "disable_ipv6", "1");
+ if (old_nm_ipv6ll == TRUE)
+ nm_device_ipv6_sysctl_set (self, "disable_ipv6", "1");
restore_ip6_properties (self);
}
return NM_ACT_STAGE_RETURN_STOP;
}
+ /* Ensure the MTU makes sense. If it was below 1280 the kernel would not
+ * expose any ipv6 sysctls or allow presence of any addresses on the interface,
+ * including LL, which * would make it impossible to autoconfigure MTU to a
+ * correct value. */
+ if (!nm_device_uses_assumed_connection (self))
+ nm_device_ipv6_set_mtu (self, priv->ip6_mtu);
+
/* Any method past this point requires an IPv6LL address. Use NM-controlled
* IPv6LL if this is not an assumed connection, since assumed connections
* will already have IPv6 set up.
*/
- if (!nm_device_uses_generated_assumed_connection (self))
+ if (!nm_device_uses_assumed_connection (self))
set_nm_ipv6ll (self, TRUE);
/* Re-enable IPv6 on the interface */
@@ -4116,10 +4673,10 @@ act_stage3_ip6_config_start (NMDevice *self,
*/
ip6_privacy = ip6_use_tempaddr ();
if (ip6_privacy == NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN) {
- NMSettingIP6Config *s_ip6 = nm_connection_get_setting_ip6_config (connection);
+ NMSettingIPConfig *s_ip6 = nm_connection_get_setting_ip6_config (connection);
if (s_ip6)
- ip6_privacy = nm_setting_ip6_config_get_ip6_privacy (s_ip6);
+ ip6_privacy = nm_setting_ip6_config_get_ip6_privacy (NM_SETTING_IP6_CONFIG (s_ip6));
}
ip6_privacy = use_tempaddr_clamp (ip6_privacy);
@@ -4131,17 +4688,21 @@ act_stage3_ip6_config_start (NMDevice *self,
ret = NM_ACT_STAGE_RETURN_POSTPONE;
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0) {
ret = linklocal6_start (self);
- if (ret == NM_ACT_STAGE_RETURN_SUCCESS) {
+ if (ret == NM_ACT_STAGE_RETURN_FINISH) {
/* New blank config; LL address is already in priv->ext_ip6_config */
- *out_config = nm_ip6_config_new ();
+ *out_config = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
g_assert (*out_config);
}
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0) {
priv->dhcp6_mode = NM_RDISC_DHCP_LEVEL_MANAGED;
- ret = dhcp6_start (self, connection, priv->dhcp6_mode, reason);
+ if (!dhcp6_start (self, TRUE, reason)) {
+ /* IPv6 might be disabled; allow IPv4 to proceed */
+ ret = NM_ACT_STAGE_RETURN_STOP;
+ } else
+ ret = NM_ACT_STAGE_RETURN_POSTPONE;
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0) {
/* New blank config */
- *out_config = nm_ip6_config_new ();
+ *out_config = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
g_assert (*out_config);
ret = NM_ACT_STAGE_RETURN_SUCCESS;
@@ -4234,8 +4795,11 @@ nm_device_activate_stage3_ip6_start (NMDevice *self)
nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason);
return FALSE;
} else if (ret == NM_ACT_STAGE_RETURN_STOP) {
- /* Early finish */
+ /* Activation not wanted */
priv->ip6_state = IP_FAIL;
+ } else if (ret == NM_ACT_STAGE_RETURN_FINISH) {
+ /* Early finish, nothing more to do */
+ priv->ip6_state = IP_DONE;
} else if (ret == NM_ACT_STAGE_RETURN_WAIT) {
/* Wait for something to try IP config again */
priv->ip6_state = IP_WAIT;
@@ -4246,6 +4810,42 @@ nm_device_activate_stage3_ip6_start (NMDevice *self)
}
/*
+ * nm_device_check_ip_failed
+ *
+ * Progress the device to appropriate state if both IPv4 and IPv6 failed
+ */
+static void
+nm_device_check_ip_failed (NMDevice *self, gboolean may_fail)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMDeviceState state;
+
+ if ( priv->ip4_state != IP_FAIL
+ || priv->ip6_state != IP_FAIL)
+ return;
+
+ if (nm_device_uses_assumed_connection (self)) {
+ /* We have assumed configuration, but couldn't
+ * redo it. No problem, move to check state. */
+ priv->ip4_state = priv->ip6_state = IP_DONE;
+ state = NM_DEVICE_STATE_IP_CHECK;
+ } else if ( may_fail
+ && get_ip_config_may_fail (self, AF_INET)
+ && get_ip_config_may_fail (self, AF_INET6)) {
+ /* Couldn't start either IPv6 and IPv4 autoconfiguration,
+ * but both are allowed to fail. */
+ state = NM_DEVICE_STATE_SECONDARIES;
+ } else {
+ /* Autoconfiguration attempted without success. */
+ state = NM_DEVICE_STATE_FAILED;
+ }
+
+ nm_device_state_changed (self,
+ state,
+ NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
+}
+
+/*
* nm_device_activate_stage3_ip_config_start
*
* Begin automatic/manual IP configuration
@@ -4299,10 +4899,7 @@ nm_device_activate_stage3_ip_config_start (gpointer user_data)
if (!nm_device_activate_stage3_ip6_start (self))
goto out;
- if (priv->ip4_state == IP_FAIL && priv->ip6_state == IP_FAIL) {
- nm_device_state_changed (self, NM_DEVICE_STATE_FAILED,
- NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
- }
+ nm_device_check_ip_failed (self, TRUE);
out:
_LOGI (LOGD_DEVICE, "Activation: Stage 3 of 5 (IP Configure Start) complete.");
@@ -4313,8 +4910,14 @@ out:
static void
fw_change_zone_cb (GError *error, gpointer user_data)
{
- NMDevice *self = NM_DEVICE (user_data);
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMDevice *self;
+ NMDevicePrivate *priv;
+
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_DEVICE (user_data);
+ priv = NM_DEVICE_GET_PRIVATE (self);
priv->fw_call = NULL;
@@ -4323,7 +4926,6 @@ fw_change_zone_cb (GError *error, gpointer user_data)
}
activation_source_schedule (self, nm_device_activate_stage3_ip_config_start, 0);
-
_LOGI (LOGD_DEVICE, "Activation: Stage 3 of 5 (IP Configure Start) scheduled.");
}
@@ -4345,12 +4947,22 @@ nm_device_activate_schedule_stage3_ip_config_start (NMDevice *self)
priv = NM_DEVICE_GET_PRIVATE (self);
g_return_if_fail (priv->act_request);
+ g_return_if_fail (!priv->fw_call);
+
/* Add the interface to the specified firewall zone */
connection = nm_device_get_connection (self);
g_assert (connection);
s_con = nm_connection_get_setting_connection (connection);
zone = nm_setting_connection_get_zone (s_con);
+
+ if (nm_device_uses_assumed_connection (self)) {
+ _LOGD (LOGD_DEVICE, "Activation: skip setting firewall zone '%s' for assumed device", zone ? zone : "default");
+ activation_source_schedule (self, nm_device_activate_stage3_ip_config_start, 0);
+ _LOGI (LOGD_DEVICE, "Activation: Stage 3 of 5 (IP Configure Start) scheduled.");
+ return;
+ }
+
_LOGD (LOGD_DEVICE, "Activation: setting firewall zone '%s'", zone ? zone : "default");
priv->fw_call = nm_firewall_manager_add_or_change_zone (nm_firewall_manager_get (),
nm_device_get_ip_iface (self),
@@ -4363,7 +4975,7 @@ nm_device_activate_schedule_stage3_ip_config_start (NMDevice *self)
static NMActStageReturn
act_stage4_ip4_config_timeout (NMDevice *self, NMDeviceStateReason *reason)
{
- if (nm_device_ip_config_should_fail (self, FALSE)) {
+ if (!get_ip_config_may_fail (self, AF_INET)) {
*reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
return NM_ACT_STAGE_RETURN_FAILURE;
}
@@ -4402,11 +5014,7 @@ nm_device_activate_ip4_config_timeout (gpointer user_data)
priv->ip4_state = IP_FAIL;
- /* If IPv4 failed and IPv6 failed, the activation fails */
- if (priv->ip6_state == IP_FAIL)
- nm_device_state_changed (self,
- NM_DEVICE_STATE_FAILED,
- NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
+ nm_device_check_ip_failed (self, FALSE);
out:
_LOGI (LOGD_DEVICE | LOGD_IP4,
@@ -4441,7 +5049,7 @@ nm_device_activate_schedule_ip4_config_timeout (NMDevice *self)
static NMActStageReturn
act_stage4_ip6_config_timeout (NMDevice *self, NMDeviceStateReason *reason)
{
- if (nm_device_ip_config_should_fail (self, TRUE)) {
+ if (!get_ip_config_may_fail (self, AF_INET6)) {
*reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
return NM_ACT_STAGE_RETURN_FAILURE;
}
@@ -4481,11 +5089,7 @@ nm_device_activate_ip6_config_timeout (gpointer user_data)
priv->ip6_state = IP_FAIL;
- /* If IPv6 failed and IPv4 failed, the activation fails */
- if (priv->ip4_state == IP_FAIL)
- nm_device_state_changed (self,
- NM_DEVICE_STATE_FAILED,
- NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
+ nm_device_check_ip_failed (self, FALSE);
out:
_LOGI (LOGD_DEVICE | LOGD_IP6,
@@ -4516,20 +5120,9 @@ nm_device_activate_schedule_ip6_config_timeout (NMDevice *self)
"Activation: Stage 4 of 5 (IPv6 Configure Timeout) scheduled...");
}
-static void
-share_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- nm_unblock_posix_signals (NULL);
-}
-
static gboolean
share_init (void)
{
- int status;
char *modules[] = { "ip_tables", "iptable_nat", "nf_nat_ftp", "nf_nat_irc",
"nf_nat_sip", "nf_nat_tftp", "nf_nat_pptp", "nf_nat_h323",
NULL };
@@ -4549,20 +5142,8 @@ share_init (void)
errsv, strerror (errsv));
}
- for (iter = modules; *iter; iter++) {
- char *argv[3] = { "/sbin/modprobe", *iter, NULL };
- char *envp[1] = { NULL };
- GError *error = NULL;
-
- if (!g_spawn_sync ("/", argv, envp, G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
- share_child_setup, NULL, NULL, NULL, &status, &error)) {
- nm_log_err (LOGD_SHARING, "share: error loading NAT module %s: (%d) %s",
- *iter, error ? error->code : 0,
- (error && error->message) ? error->message : "unknown");
- if (error)
- g_error_free (error);
- }
- }
+ for (iter = modules; *iter; iter++)
+ nm_utils_modprobe (NULL, *iter, NULL);
return TRUE;
}
@@ -4648,10 +5229,9 @@ send_arps (NMDevice *self, const char *mode_arg)
const char *argv[] = { NULL, mode_arg, "-q", "-I", nm_device_get_ip_iface (self), "-c", "1", NULL, NULL };
int ip_arg = G_N_ELEMENTS (argv) - 2;
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
int i, num;
- NMIP4Address *addr;
- guint32 ipaddr;
+ NMIPAddress *addr;
GError *error = NULL;
connection = nm_device_get_connection (self);
@@ -4660,7 +5240,7 @@ send_arps (NMDevice *self, const char *mode_arg)
s_ip4 = nm_connection_get_setting_ip4_config (connection);
if (!s_ip4)
return;
- num = nm_setting_ip4_config_get_num_addresses (s_ip4);
+ num = nm_setting_ip_config_get_num_addresses (s_ip4);
if (num == 0)
return;
@@ -4672,17 +5252,17 @@ send_arps (NMDevice *self, const char *mode_arg)
for (i = 0; i < num; i++) {
gs_free char *tmp_str = NULL;
- addr = nm_setting_ip4_config_get_address (s_ip4, i);
- ipaddr = nm_ip4_address_get_address (addr);
- argv[ip_arg] = (char *) nm_utils_inet4_ntop (ipaddr, NULL);
+ gboolean success;
+
+ addr = nm_setting_ip_config_get_address (s_ip4, i);
+ argv[ip_arg] = nm_ip_address_get_address (addr);
_LOGD (LOGD_DEVICE | LOGD_IP4,
"arping: run %s", (tmp_str = g_strjoinv (" ", (char **) argv)));
- g_spawn_async (NULL, (char **) argv, NULL,
- G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
- nm_unblock_posix_signals,
- NULL, NULL, &error);
- if (error) {
+ success = g_spawn_async (NULL, (char **) argv, NULL,
+ G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
+ NULL, NULL, NULL, &error);
+ if (!success) {
_LOGW (LOGD_DEVICE | LOGD_IP4,
"arping: could not send ARP for local address %s: %s",
argv[ip_arg], error->message);
@@ -4721,7 +5301,7 @@ arp_announce (NMDevice *self)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
int num;
arp_cleanup (self);
@@ -4735,7 +5315,7 @@ arp_announce (NMDevice *self)
s_ip4 = nm_connection_get_setting_ip4_config (connection);
if (!s_ip4)
return;
- num = nm_setting_ip4_config_get_num_addresses (s_ip4);
+ num = nm_setting_ip_config_get_num_addresses (s_ip4);
if (num == 0)
return;
@@ -4766,7 +5346,7 @@ nm_device_activate_ip4_config_commit (gpointer user_data)
/* Interface must be IFF_UP before IP config can be applied */
ip_ifindex = nm_device_get_ip_ifindex (self);
- if (!nm_platform_link_is_up (ip_ifindex)) {
+ if (!nm_platform_link_is_up (ip_ifindex) && !nm_device_uses_assumed_connection (self)) {
nm_platform_link_set_up (ip_ifindex);
if (!nm_platform_link_is_up (ip_ifindex))
_LOGW (LOGD_DEVICE, "interface %s not up for IP configuration", nm_device_get_ip_iface (self));
@@ -4822,6 +5402,18 @@ out:
return FALSE;
}
+static void
+nm_device_queued_ip_config_change_clear (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+ if (priv->queued_ip_config_id) {
+ _LOGD (LOGD_DEVICE, "clearing queued IP config change");
+ g_source_remove (priv->queued_ip_config_id);
+ priv->queued_ip_config_id = 0;
+ }
+}
+
void
nm_device_activate_schedule_ip4_config_result (NMDevice *self, NMIP4Config *config)
{
@@ -4834,6 +5426,7 @@ nm_device_activate_schedule_ip4_config_result (NMDevice *self, NMIP4Config *conf
if (config)
priv->dev_ip4_config = g_object_ref (config);
+ nm_device_queued_ip_config_change_clear (self);
activation_source_schedule (self, nm_device_activate_ip4_config_commit, AF_INET);
_LOGI (LOGD_DEVICE | LOGD_IP4,
@@ -4877,7 +5470,7 @@ nm_device_activate_ip6_config_commit (gpointer user_data)
/* Interface must be IFF_UP before IP config can be applied */
ip_ifindex = nm_device_get_ip_ifindex (self);
- if (!nm_platform_link_is_up (ip_ifindex)) {
+ if (!nm_platform_link_is_up (ip_ifindex) && !nm_device_uses_assumed_connection (self)) {
nm_platform_link_set_up (ip_ifindex);
if (!nm_platform_link_is_up (ip_ifindex))
_LOGW (LOGD_DEVICE, "interface %s not up for IP configuration", nm_device_get_ip_iface (self));
@@ -5084,6 +5677,8 @@ delete_on_deactivate_check_and_schedule (NMDevice *self, int ifindex)
return;
if (!priv->is_nm_owned)
return;
+ if (priv->queued_act_request)
+ return;
if (!nm_device_is_software (self))
return;
if (nm_device_get_state (self) == NM_DEVICE_STATE_UNMANAGED)
@@ -5135,6 +5730,15 @@ disconnect_cb (NMDevice *self,
}
static void
+_clear_queued_act_request (NMDevicePrivate *priv)
+{
+ if (priv->queued_act_request) {
+ nm_active_connection_set_state ((NMActiveConnection *) priv->queued_act_request, NM_ACTIVE_CONNECTION_STATE_DEACTIVATED);
+ g_clear_object (&priv->queued_act_request);
+ }
+}
+
+static void
impl_device_disconnect (NMDevice *self, DBusGMethodInvocation *context)
{
NMConnection *connection;
@@ -5236,26 +5840,97 @@ _device_activate (NMDevice *self, NMActRequest *req)
nm_device_activate_schedule_stage1_device_prepare (self);
}
+static void
+_carrier_wait_check_queued_act_request (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMActRequest *queued_req;
+
+ if ( !priv->queued_act_request
+ || !priv->queued_act_request_is_waiting_for_carrier)
+ return;
+
+ priv->queued_act_request_is_waiting_for_carrier = FALSE;
+ if (!priv->carrier) {
+ _LOGD (LOGD_DEVICE, "Cancel queued activation request as we have no carrier after timeout");
+ g_clear_object (&priv->queued_act_request);
+ } else {
+ _LOGD (LOGD_DEVICE, "Activate queued activation request as we now have carrier");
+ queued_req = priv->queued_act_request;
+ priv->queued_act_request = NULL;
+ _device_activate (self, queued_req);
+ g_object_unref (queued_req);
+ }
+}
+
+static gboolean
+_carrier_wait_check_act_request_must_queue (NMDevice *self, NMActRequest *req)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMConnection *connection;
+
+ /* If we have carrier or if we are not waiting for it, the activation
+ * request is not blocked waiting for carrier. */
+ if (priv->carrier)
+ return FALSE;
+ if (priv->carrier_wait_id == 0)
+ return FALSE;
+
+ connection = nm_act_request_get_connection (req);
+
+ if (!nm_device_check_connection_available (self, connection, NM_DEVICE_CHECK_CON_AVAILABLE_ALL, NULL)) {
+ /* We passed all @flags we have, and no @specific_object.
+ * This equals maximal availability, if a connection is not available
+ * in this case, it is not waiting for carrier.
+ *
+ * Actually, why are we even trying to activate it? Strange, but whatever
+ * the reason, don't wait for carrier.
+ */
+ return FALSE;
+ }
+
+ if (nm_device_check_connection_available (self, connection, NM_DEVICE_CHECK_CON_AVAILABLE_ALL & ~_NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_WAITING_CARRIER, NULL)) {
+ /* The connection was available with flags ALL, and it is still available
+ * if we pretend not to wait for carrier. That means that the
+ * connection is available now, and does not wait for carrier.
+ *
+ * Since the flags increase the availability of a connection, when checking
+ * ALL&~WAITING_CARRIER, it means that we certainly would wait for carrier. */
+ return FALSE;
+ }
+
+ /* The activation request must wait for carrier. */
+ return TRUE;
+}
+
void
nm_device_queue_activation (NMDevice *self, NMActRequest *req)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ gboolean must_queue;
+
+ must_queue = _carrier_wait_check_act_request_must_queue (self, req);
- if (!priv->act_request) {
+ if (!priv->act_request && !must_queue) {
/* Just activate immediately */
_device_activate (self, req);
return;
}
/* supercede any already-queued request */
- g_clear_object (&priv->queued_act_request);
+ _clear_queued_act_request (priv);
priv->queued_act_request = g_object_ref (req);
+ priv->queued_act_request_is_waiting_for_carrier = must_queue;
- /* Deactivate existing activation request first */
- _LOGI (LOGD_DEVICE, "disconnecting for new activation request.");
- nm_device_state_changed (self,
- NM_DEVICE_STATE_DEACTIVATING,
- NM_DEVICE_STATE_REASON_NONE);
+ _LOGD (LOGD_DEVICE, "queue activation request waiting for %s", must_queue ? "carrier" : "currently active connection to disconnect");
+
+ if (priv->act_request) {
+ /* Deactivate existing activation request first */
+ _LOGI (LOGD_DEVICE, "disconnecting for new activation request.");
+ nm_device_state_changed (self,
+ NM_DEVICE_STATE_DEACTIVATING,
+ NM_DEVICE_STATE_REASON_USER_REQUESTED);
+ }
}
/*
@@ -5306,6 +5981,7 @@ nm_device_get_ip4_config (NMDevice *self)
static gboolean
nm_device_set_ip4_config (NMDevice *self,
NMIP4Config *new_config,
+ guint32 default_route_metric,
gboolean commit,
NMDeviceStateReason *reason)
{
@@ -5315,7 +5991,7 @@ nm_device_set_ip4_config (NMDevice *self,
gboolean has_changes = FALSE;
gboolean success = TRUE;
NMDeviceStateReason reason_local = NM_DEVICE_STATE_REASON_NONE;
- int ip_ifindex;
+ int ip_ifindex, config_ifindex;
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
@@ -5323,11 +5999,24 @@ nm_device_set_ip4_config (NMDevice *self,
ip_iface = nm_device_get_ip_iface (self);
ip_ifindex = nm_device_get_ip_ifindex (self);
+ if (new_config) {
+ config_ifindex = nm_ip4_config_get_ifindex (new_config);
+ if (config_ifindex > 0)
+ g_return_val_if_fail (ip_ifindex == config_ifindex, FALSE);
+ }
+
old_config = priv->ip4_config;
/* Always commit to nm-platform to update lifetimes */
if (commit && new_config) {
- success = nm_ip4_config_commit (new_config, ip_ifindex);
+ gboolean assumed = nm_device_uses_assumed_connection (self);
+
+ nm_device_set_mtu (self, nm_ip4_config_get_mtu (new_config));
+
+ /* for assumed devices we set the device_route_metric to the default which will
+ * stop nm_platform_ip4_address_sync() to replace the device routes. */
+ success = nm_ip4_config_commit (new_config, ip_ifindex,
+ assumed ? NM_PLATFORM_ROUTE_METRIC_IP4_DEVICE_ROUTE : default_route_metric);
if (!success)
reason_local = NM_DEVICE_STATE_REASON_CONFIG_FAILED;
}
@@ -5362,6 +6051,8 @@ nm_device_set_ip4_config (NMDevice *self,
g_clear_object (&priv->dev_ip4_config);
}
+ nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), self);
+
if (has_changes) {
_update_ip4_address (self);
@@ -5438,7 +6129,7 @@ nm_device_set_ip6_config (NMDevice *self,
gboolean has_changes = FALSE;
gboolean success = TRUE;
NMDeviceStateReason reason_local = NM_DEVICE_STATE_REASON_NONE;
- int ip_ifindex;
+ int ip_ifindex, config_ifindex;
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
@@ -5446,10 +6137,17 @@ nm_device_set_ip6_config (NMDevice *self,
ip_iface = nm_device_get_ip_iface (self);
ip_ifindex = nm_device_get_ip_ifindex (self);
+ if (new_config) {
+ config_ifindex = nm_ip6_config_get_ifindex (new_config);
+ if (config_ifindex > 0)
+ g_return_val_if_fail (ip_ifindex == config_ifindex, FALSE);
+ }
+
old_config = priv->ip6_config;
/* Always commit to nm-platform to update lifetimes */
if (commit && new_config) {
+ nm_device_ipv6_set_mtu (self, priv->ip6_mtu);
success = nm_ip6_config_commit (new_config, ip_ifindex);
if (!success)
reason_local = NM_DEVICE_STATE_REASON_CONFIG_FAILED;
@@ -5473,7 +6171,7 @@ nm_device_set_ip6_config (NMDevice *self,
nm_ip6_config_export (new_config);
}
- _LOGD (LOGD_IP4, "set IP6Config instance (%s)",
+ _LOGD (LOGD_IP6, "set IP6Config instance (%s)",
nm_ip6_config_get_dbus_path (new_config));
}
} else if (old_config) {
@@ -5483,6 +6181,8 @@ nm_device_set_ip6_config (NMDevice *self,
nm_ip6_config_get_dbus_path (old_config));
}
+ nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), self);
+
if (has_changes) {
if (old_config != priv->ip6_config)
g_object_notify (G_OBJECT (self), NM_DEVICE_IP6_CONFIG);
@@ -5704,7 +6404,7 @@ spawn_ping (NMDevice *self,
(gchar **) args,
NULL,
G_SPAWN_DO_NOT_REAP_CHILD,
- nm_unblock_posix_signals,
+ NULL,
NULL,
&priv->gw_ping.pid,
&error);
@@ -5749,7 +6449,7 @@ nm_device_start_ip_check (NMDevice *self)
timeout = nm_setting_connection_get_gateway_ping_timeout (s_con);
if (timeout) {
- if (priv->ip4_state == IP_DONE) {
+ if (priv->ip4_config && priv->ip4_state == IP_DONE) {
guint gw = 0;
ping_binary = "/usr/bin/ping";
@@ -5787,6 +6487,9 @@ carrier_wait_timeout (gpointer user_data)
NM_DEVICE_GET_PRIVATE (self)->carrier_wait_id = 0;
nm_device_remove_pending_action (self, "carrier wait", TRUE);
+
+ _carrier_wait_check_queued_act_request (self);
+
return G_SOURCE_REMOVE;
}
@@ -5851,12 +6554,11 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware)
* a timeout is reached.
*/
if (device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) {
- if (priv->carrier_wait_id) {
+ if (priv->carrier_wait_id)
g_source_remove (priv->carrier_wait_id);
- nm_device_remove_pending_action (self, "carrier wait", TRUE);
- }
+ else
+ nm_device_add_pending_action (self, "carrier wait", TRUE);
priv->carrier_wait_id = g_timeout_add_seconds (5, carrier_wait_timeout, self);
- nm_device_add_pending_action (self, "carrier wait", TRUE);
}
/* Can only get HW address of some devices when they are up */
@@ -5972,6 +6674,7 @@ find_ip4_lease_config (NMDevice *self,
NMIP4Config *ext_ip4_config)
{
const char *ip_iface = nm_device_get_ip_iface (self);
+ int ip_ifindex = nm_device_get_ip_ifindex (self);
GSList *leases, *liter;
NMIP4Config *found = NULL;
@@ -5980,8 +6683,10 @@ find_ip4_lease_config (NMDevice *self,
leases = nm_dhcp_manager_get_lease_ip_configs (nm_dhcp_manager_get (),
ip_iface,
+ ip_ifindex,
nm_connection_get_uuid (connection),
- FALSE);
+ FALSE,
+ nm_device_get_ip4_route_metric (self));
for (liter = leases; liter && !found; liter = liter->next) {
NMIP4Config *lease_config = liter->data;
const NMPlatformIP4Address *address = nm_ip4_config_get_address (lease_config, 0);
@@ -6083,12 +6788,31 @@ update_ip_config (NMDevice *self, gboolean initial)
/* IPv4 */
g_clear_object (&priv->ext_ip4_config);
priv->ext_ip4_config = nm_ip4_config_capture (ifindex, capture_resolv_conf);
-
if (priv->ext_ip4_config) {
if (initial) {
g_clear_object (&priv->dev_ip4_config);
capture_lease_config (self, priv->ext_ip4_config, &priv->dev_ip4_config, NULL, NULL);
}
+ ensure_con_ipx_config (self);
+
+ /* This function was called upon external changes. Remove the configuration
+ * (adresses,routes) that is no longer present externally from the interal
+ * config. This way, we don't readd addresses that were manually removed
+ * by the user. */
+ if (priv->con_ip4_config)
+ nm_ip4_config_intersect (priv->con_ip4_config, priv->ext_ip4_config);
+ if (priv->dev_ip4_config)
+ nm_ip4_config_intersect (priv->dev_ip4_config, priv->ext_ip4_config);
+ if (priv->vpn4_config)
+ nm_ip4_config_intersect (priv->vpn4_config, priv->ext_ip4_config);
+ if (priv->wwan_ip4_config)
+ nm_ip4_config_intersect (priv->wwan_ip4_config, priv->ext_ip4_config);
+
+ /* Remove parts from ext_ip4_config to only contain the information that
+ * was configured externally -- we already have the same configuration from
+ * internal origins. */
+ if (priv->con_ip4_config)
+ nm_ip4_config_subtract (priv->ext_ip4_config, priv->con_ip4_config);
if (priv->dev_ip4_config)
nm_ip4_config_subtract (priv->ext_ip4_config, priv->dev_ip4_config);
if (priv->vpn4_config)
@@ -6108,6 +6832,28 @@ update_ip_config (NMDevice *self, gboolean initial)
linklocal6_just_completed = priv->linklocal6_timeout_id &&
have_ip6_address (priv->ext_ip6_config, TRUE);
+ ensure_con_ipx_config (self);
+
+ /* This function was called upon external changes. Remove the configuration
+ * (adresses,routes) that is no longer present externally from the interal
+ * config. This way, we don't readd addresses that were manually removed
+ * by the user. */
+ if (priv->con_ip6_config)
+ nm_ip6_config_intersect (priv->con_ip6_config, priv->ext_ip6_config);
+ if (priv->ac_ip6_config)
+ nm_ip6_config_intersect (priv->ac_ip6_config, priv->ext_ip6_config);
+ if (priv->dhcp6_ip6_config)
+ nm_ip6_config_intersect (priv->dhcp6_ip6_config, priv->ext_ip6_config);
+ if (priv->wwan_ip6_config)
+ nm_ip6_config_intersect (priv->wwan_ip6_config, priv->ext_ip6_config);
+ if (priv->vpn6_config)
+ nm_ip6_config_intersect (priv->vpn6_config, priv->ext_ip6_config);
+
+ /* Remove parts from ext_ip6_config to only contain the information that
+ * was configured externally -- we already have the same configuration from
+ * internal origins. */
+ if (priv->con_ip6_config)
+ nm_ip6_config_subtract (priv->ext_ip6_config, priv->con_ip6_config);
if (priv->ac_ip6_config)
nm_ip6_config_subtract (priv->ext_ip6_config, priv->ac_ip6_config);
if (priv->dhcp6_ip6_config)
@@ -6176,18 +6922,6 @@ device_ip_changed (NMPlatform *platform,
}
}
-static void
-nm_device_queued_ip_config_change_clear (NMDevice *self)
-{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
-
- if (priv->queued_ip_config_id) {
- _LOGD (LOGD_DEVICE, "clearing queued IP config change");
- g_source_remove (priv->queued_ip_config_id);
- priv->queued_ip_config_id = 0;
- }
-}
-
/**
* nm_device_get_managed():
* @self: the #NMDevice
@@ -6225,7 +6959,7 @@ nm_device_get_managed (NMDevice *self)
gboolean
nm_device_get_unmanaged_flag (NMDevice *self, NMUnmanagedFlags flag)
{
- return NM_DEVICE_GET_PRIVATE (self)->unmanaged_flags & flag;
+ return NM_FLAGS_ANY (NM_DEVICE_GET_PRIVATE (self)->unmanaged_flags, flag);
}
/**
@@ -6294,9 +7028,9 @@ nm_device_set_unmanaged_quitting (NMDevice *self)
* @flag: an #NMUnmanagedFlag
* @unmanaged: %TRUE or %FALSE to set or clear @flag
*
- * Like nm_device_set_unmanaged() but must be set before the device is exported
- * and does not trigger state changes. Should only be used when initializing
- * a device.
+ * Like nm_device_set_unmanaged(), but must be set before the device is
+ * initialized by nm_device_finish_init(), and does not trigger state changes.
+ * Should only be used when initializing a device.
*/
void
nm_device_set_initial_unmanaged_flag (NMDevice *self,
@@ -6309,7 +7043,7 @@ nm_device_set_initial_unmanaged_flag (NMDevice *self,
g_return_if_fail (flag <= NM_UNMANAGED_LAST);
priv = NM_DEVICE_GET_PRIVATE (self);
- g_return_if_fail (priv->path == NULL);
+ g_return_if_fail (priv->initialized == FALSE);
if (unmanaged)
priv->unmanaged_flags |= flag;
@@ -6340,48 +7074,45 @@ nm_device_set_dhcp_anycast_address (NMDevice *self, const char *addr)
}
/**
- * nm_device_connection_is_available():
+ * nm_device_check_connection_available():
* @self: the #NMDevice
* @connection: the #NMConnection to check for availability
- * @allow_device_override: set to %TRUE to let the device do specific checks
+ * @flags: flags to affect the decision making of whether a connection
+ * is available. Adding a flag can only make a connection more available,
+ * not less.
+ * @specific_object: a device type dependent argument to further
+ * filter the result. Passing a non %NULL specific object can only reduce
+ * the availability of a connection.
*
- * Check if @connection is available to be activated on @self. Normally this
- * only checks if the connection is in @self's AvailableConnections property.
- * If @allow_device_override is %TRUE then the device is asked to do specific
- * checks that may bypass the AvailableConnections property.
+ * Check if @connection is available to be activated on @self.
*
* Returns: %TRUE if @connection can be activated on @self
*/
gboolean
-nm_device_connection_is_available (NMDevice *self,
- NMConnection *connection,
- gboolean allow_device_override)
+nm_device_check_connection_available (NMDevice *self,
+ NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
+ const char *specific_object)
{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- gboolean available = FALSE;
+ NMDeviceState state;
- if (nm_device_get_default_unmanaged (self) && (priv->state == NM_DEVICE_STATE_UNMANAGED)) {
- /* default-unmanaged devices in UNMANAGED state have no available connections
- * so we must manually check whether the connection is available here.
- */
- if ( nm_device_check_connection_compatible (self, connection)
- && NM_DEVICE_GET_CLASS (self)->check_connection_available (self, connection, NULL))
- return TRUE;
- }
+ state = nm_device_get_state (self);
+ if (state < NM_DEVICE_STATE_UNMANAGED)
+ return FALSE;
+ if ( state < NM_DEVICE_STATE_UNAVAILABLE
+ && nm_device_get_unmanaged_flag (self, NM_UNMANAGED_ALL & ~NM_UNMANAGED_DEFAULT))
+ return FALSE;
+ if ( state < NM_DEVICE_STATE_DISCONNECTED
+ && ( ( !NM_FLAGS_HAS (flags, _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_WAITING_CARRIER)
+ && !nm_device_is_available (self, NM_DEVICE_CHECK_DEV_AVAILABLE_NONE))
+ || ( NM_FLAGS_HAS (flags, _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_WAITING_CARRIER)
+ && !nm_device_is_available (self, NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER))))
+ return FALSE;
- available = !!g_hash_table_lookup (priv->available_connections, connection);
- if (!available && allow_device_override) {
- /* FIXME: hack for hidden WiFi becuase clients didn't consistently
- * set the 'hidden' property to indicate hidden SSID networks. If
- * activating but the network isn't available let the device recheck
- * availability.
- */
- if ( nm_device_check_connection_compatible (self, connection)
- && NM_DEVICE_GET_CLASS (self)->check_connection_available_wifi_hidden)
- available = NM_DEVICE_GET_CLASS (self)->check_connection_available_wifi_hidden (self, connection);
- }
+ if (!nm_device_check_connection_compatible (self, connection))
+ return FALSE;
- return available;
+ return NM_DEVICE_GET_CLASS (self)->check_connection_available (self, connection, flags, specific_object);
}
static void
@@ -6401,17 +7132,10 @@ _clear_available_connections (NMDevice *self, gboolean do_signal)
static gboolean
_try_add_available_connection (NMDevice *self, NMConnection *connection)
{
- if ( nm_device_get_state (self) < NM_DEVICE_STATE_DISCONNECTED
- && !nm_device_get_default_unmanaged (self))
- return FALSE;
-
- if (nm_device_check_connection_compatible (self, connection)) {
- if (NM_DEVICE_GET_CLASS (self)->check_connection_available (self, connection, NULL)) {
- g_hash_table_insert (NM_DEVICE_GET_PRIVATE (self)->available_connections,
- g_object_ref (connection),
- GUINT_TO_POINTER (1));
- return TRUE;
- }
+ if (nm_device_check_connection_available (self, connection, NM_DEVICE_CHECK_CON_AVAILABLE_NONE, NULL)) {
+ g_hash_table_add (NM_DEVICE_GET_PRIVATE (self)->available_connections,
+ g_object_ref (connection));
+ return TRUE;
}
return FALSE;
}
@@ -6425,15 +7149,28 @@ _del_available_connection (NMDevice *self, NMConnection *connection)
static gboolean
check_connection_available (NMDevice *self,
NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
const char *specific_object)
{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
+
/* Connections which require a network connection are not available when
* the device has no carrier, even with ignore-carrer=TRUE.
*/
- if (NM_DEVICE_GET_PRIVATE (self)->carrier == FALSE)
- return connection_requires_carrier (connection) ? FALSE : TRUE;
+ if ( priv->carrier
+ || !connection_requires_carrier (connection))
+ return TRUE;
- return TRUE;
+ if ( NM_FLAGS_HAS (flags, _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_WAITING_CARRIER)
+ && priv->carrier_wait_id != 0) {
+ /* The device has no carrier though the connection requires it.
+ *
+ * If we are still waiting for carrier, the connection is available
+ * for an explicit user-request. */
+ return TRUE;
+ }
+
+ return FALSE;
}
void
@@ -6485,8 +7222,8 @@ nm_device_get_available_connections (NMDevice *self, const char *specific_object
/* If a specific object is given, only include connections that are
* compatible with it.
*/
- if ( !specific_object
- || NM_DEVICE_GET_CLASS (self)->check_connection_available (self, connection, specific_object))
+ if ( !specific_object /* << Optimization: we know that the connection is available without @specific_object. */
+ || nm_device_check_connection_available (self, connection, NM_DEVICE_CHECK_CON_AVAILABLE_NONE, specific_object))
g_ptr_array_add (array, connection);
}
}
@@ -6631,20 +7368,38 @@ nm_device_has_pending_action (NMDevice *self)
/***********************************************************/
static void
+_cleanup_ip_pre (NMDevice *self, gboolean deconfigure)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+ priv->ip4_state = priv->ip6_state = IP_NONE;
+ nm_device_queued_ip_config_change_clear (self);
+
+ dhcp4_cleanup (self, deconfigure, FALSE);
+ arp_cleanup (self);
+ dhcp6_cleanup (self, deconfigure, FALSE);
+ linklocal6_cleanup (self);
+ addrconf6_cleanup (self);
+ dnsmasq_cleanup (self);
+ aipd_cleanup (self);
+}
+
+static void
_cleanup_generic_pre (NMDevice *self, gboolean deconfigure)
{
- NMConnection *connection;
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMConnection *connection;
/* Clean up when device was deactivated during call to firewall */
-
if (priv->fw_call) {
nm_firewall_manager_cancel_call (nm_firewall_manager_get (), priv->fw_call);
priv->fw_call = NULL;
}
connection = nm_device_get_connection (self);
- if (deconfigure && connection) {
+ if ( deconfigure
+ && connection
+ && !nm_device_uses_assumed_connection (self)) {
nm_firewall_manager_remove_from_zone (nm_firewall_manager_get (),
nm_device_get_ip_iface (self),
NULL);
@@ -6658,17 +7413,8 @@ _cleanup_generic_pre (NMDevice *self, gboolean deconfigure)
/* Clear any queued transitions */
nm_device_queued_state_clear (self);
- nm_device_queued_ip_config_change_clear (self);
-
- priv->ip4_state = priv->ip6_state = IP_NONE;
- dhcp4_cleanup (self, deconfigure, FALSE);
- arp_cleanup (self);
- dhcp6_cleanup (self, deconfigure, FALSE);
- linklocal6_cleanup (self);
- addrconf6_cleanup (self);
- dnsmasq_cleanup (self);
- aipd_cleanup (self);
+ _cleanup_ip_pre (self, deconfigure);
}
static void
@@ -6677,16 +7423,26 @@ _cleanup_generic_post (NMDevice *self, gboolean deconfigure)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE;
+ priv->default_route.v4_has = FALSE;
+ priv->default_route.v4_is_assumed = TRUE;
+ priv->default_route.v6_has = FALSE;
+ priv->default_route.v6_is_assumed = TRUE;
+
+ nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), self);
+ nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), self);
+
/* Clean up IP configs; this does not actually deconfigure the
* interface; the caller must flush routes and addresses explicitly.
*/
- nm_device_set_ip4_config (self, NULL, TRUE, &ignored);
+ nm_device_set_ip4_config (self, NULL, 0, TRUE, &ignored);
nm_device_set_ip6_config (self, NULL, TRUE, &ignored);
+ g_clear_object (&priv->con_ip4_config);
g_clear_object (&priv->dev_ip4_config);
g_clear_object (&priv->ext_ip4_config);
g_clear_object (&priv->wwan_ip4_config);
g_clear_object (&priv->vpn4_config);
g_clear_object (&priv->ip4_config);
+ g_clear_object (&priv->con_ip6_config);
g_clear_object (&priv->ac_ip6_config);
g_clear_object (&priv->ext_ip6_config);
g_clear_object (&priv->vpn6_config);
@@ -6722,7 +7478,7 @@ _cleanup_generic_post (NMDevice *self, gboolean deconfigure)
*
*/
static void
-nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason)
+nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, gboolean deconfigure)
{
NMDevicePrivate *priv;
int ifindex;
@@ -6737,12 +7493,14 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason)
/* Save whether or not we tried IPv6 for later */
priv = NM_DEVICE_GET_PRIVATE (self);
- _cleanup_generic_pre (self, TRUE);
+ _cleanup_generic_pre (self, deconfigure);
/* Turn off kernel IPv6 */
- set_disable_ipv6 (self, "1");
- nm_device_ipv6_sysctl_set (self, "accept_ra", "0");
- nm_device_ipv6_sysctl_set (self, "use_tempaddr", "0");
+ if (deconfigure) {
+ set_disable_ipv6 (self, "1");
+ nm_device_ipv6_sysctl_set (self, "accept_ra", "0");
+ nm_device_ipv6_sysctl_set (self, "use_tempaddr", "0");
+ }
/* Call device type-specific deactivation */
if (NM_DEVICE_GET_CLASS (self)->deactivate)
@@ -6759,11 +7517,175 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason)
/* Take out any entries in the routing table and any IP address the device had. */
ifindex = nm_device_get_ip_ifindex (self);
if (ifindex > 0) {
- nm_platform_route_flush (ifindex);
+ nm_route_manager_route_flush (nm_route_manager_get (), ifindex);
nm_platform_address_flush (ifindex);
}
- _cleanup_generic_post (self, TRUE);
+ _cleanup_generic_post (self, deconfigure);
+}
+
+static char *
+bin2hexstr (const char *bytes, gsize len)
+{
+ GString *str;
+ int i;
+
+ g_return_val_if_fail (bytes != NULL, NULL);
+ g_return_val_if_fail (len > 0, NULL);
+
+ str = g_string_sized_new (len * 2 + 1);
+ for (i = 0; i < len; i++) {
+ if (str->len)
+ g_string_append_c (str, ':');
+ g_string_append_printf (str, "%02x", (guint8) bytes[i]);
+ }
+ return g_string_free (str, FALSE);
+}
+
+static char *
+find_dhcp4_address (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ guint i, n;
+
+ if (!priv->ip4_config)
+ return NULL;
+
+ n = nm_ip4_config_get_num_addresses (priv->ip4_config);
+ for (i = 0; i < n; i++) {
+ const NMPlatformIP4Address *a = nm_ip4_config_get_address (priv->ip4_config, i);
+
+ if (a->source == NM_IP_CONFIG_SOURCE_DHCP)
+ return g_strdup (nm_utils_inet4_ntop (a->address, NULL));
+ }
+ return NULL;
+}
+
+void
+nm_device_spawn_iface_helper (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ gboolean configured = FALSE;
+ NMConnection *connection;
+ GError *error = NULL;
+ const char *method;
+ GPtrArray *argv;
+ gs_free char *dhcp4_address = NULL;
+
+ if (priv->state != NM_DEVICE_STATE_ACTIVATED)
+ return;
+ if (!nm_device_can_assume_connections (self))
+ return;
+
+ connection = nm_device_get_connection (self);
+ g_assert (connection);
+
+ argv = g_ptr_array_sized_new (10);
+ g_ptr_array_set_free_func (argv, g_free);
+
+ g_ptr_array_add (argv, g_strdup (LIBEXECDIR "/nm-iface-helper"));
+ g_ptr_array_add (argv, g_strdup ("--ifname"));
+ g_ptr_array_add (argv, g_strdup (nm_device_get_ip_iface (self)));
+ g_ptr_array_add (argv, g_strdup ("--uuid"));
+ g_ptr_array_add (argv, g_strdup (nm_connection_get_uuid (connection)));
+
+ dhcp4_address = find_dhcp4_address (self);
+
+ method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG);
+ if ( priv->ip4_config
+ && priv->ip4_state == IP_DONE
+ && g_strcmp0 (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0
+ && priv->dhcp4_client
+ && dhcp4_address) {
+ NMSettingIPConfig *s_ip4;
+ GBytes *client_id;
+ char *hex_client_id;
+ const char *hostname;
+
+ s_ip4 = nm_connection_get_setting_ip4_config (connection);
+ g_assert (s_ip4);
+
+ g_ptr_array_add (argv, g_strdup ("--priority4"));
+ g_ptr_array_add (argv, g_strdup_printf ("%u", nm_device_get_ip4_route_metric (self)));
+
+ g_ptr_array_add (argv, g_strdup ("--dhcp4"));
+ g_ptr_array_add (argv, g_strdup (dhcp4_address));
+ if (nm_setting_ip_config_get_may_fail (s_ip4) == FALSE)
+ g_ptr_array_add (argv, g_strdup ("--dhcp4-required"));
+
+ client_id = nm_dhcp_client_get_client_id (priv->dhcp4_client);
+ if (client_id) {
+ g_ptr_array_add (argv, g_strdup ("--dhcp4-clientid"));
+ hex_client_id = bin2hexstr (g_bytes_get_data (client_id, NULL),
+ g_bytes_get_size (client_id));
+ g_ptr_array_add (argv, hex_client_id);
+ }
+
+ hostname = nm_dhcp_client_get_hostname (priv->dhcp4_client);
+ if (hostname) {
+ g_ptr_array_add (argv, g_strdup ("--dhcp4-hostname"));
+ g_ptr_array_add (argv, g_strdup (hostname));
+ }
+
+ configured = TRUE;
+ }
+
+ method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG);
+ if ( priv->ip6_config
+ && priv->ip6_state == IP_DONE
+ && g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0
+ && priv->rdisc
+ && priv->ac_ip6_config) {
+ NMSettingIPConfig *s_ip6;
+ char *hex_iid;
+ NMUtilsIPv6IfaceId iid = NM_UTILS_IPV6_IFACE_ID_INIT;
+
+ s_ip6 = nm_connection_get_setting_ip6_config (connection);
+ g_assert (s_ip6);
+
+ g_ptr_array_add (argv, g_strdup ("--priority6"));
+ g_ptr_array_add (argv, g_strdup_printf ("%u", nm_device_get_ip6_route_metric (self)));
+
+ g_ptr_array_add (argv, g_strdup ("--slaac"));
+
+ if (nm_setting_ip_config_get_may_fail (s_ip6) == FALSE)
+ g_ptr_array_add (argv, g_strdup ("--slaac-required"));
+
+ g_ptr_array_add (argv, g_strdup ("--slaac-tempaddr"));
+ g_ptr_array_add (argv, g_strdup_printf ("%d", priv->rdisc_use_tempaddr));
+
+ if (nm_device_get_ip_iface_identifier (self, &iid)) {
+ g_ptr_array_add (argv, g_strdup ("--iid"));
+ hex_iid = bin2hexstr ((const char *) iid.id_u8, sizeof (NMUtilsIPv6IfaceId));
+ g_ptr_array_add (argv, hex_iid);
+ }
+
+ configured = TRUE;
+ }
+
+ if (configured) {
+ GPid pid;
+
+ g_ptr_array_add (argv, NULL);
+
+ if (nm_logging_enabled (LOGL_DEBUG, LOGD_DEVICE)) {
+ char *tmp;
+
+ tmp = g_strjoinv (" ", (char **) argv->pdata);
+ _LOGD (LOGD_DEVICE, "running '%s'", tmp);
+ g_free (tmp);
+ }
+
+ if (g_spawn_async (NULL, (char **) argv->pdata, NULL,
+ G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, &error)) {
+ _LOGI (LOGD_DEVICE, "spawned helper PID %u", (guint) pid);
+ } else {
+ _LOGW (LOGD_DEVICE, "failed to spawn helper: %s", error->message);
+ g_error_free (error);
+ }
+ }
+
+ g_ptr_array_unref (argv);
}
/***********************************************************/
@@ -6787,6 +7709,80 @@ notify_ip_properties (NMDevice *self)
}
static void
+ip6_managed_setup (NMDevice *self)
+{
+ set_nm_ipv6ll (self, TRUE);
+ set_disable_ipv6 (self, "1");
+ nm_device_ipv6_sysctl_set (self, "accept_ra_defrtr", "0");
+ nm_device_ipv6_sysctl_set (self, "accept_ra_pinfo", "0");
+ nm_device_ipv6_sysctl_set (self, "accept_ra_rtr_pref", "0");
+ nm_device_ipv6_sysctl_set (self, "use_tempaddr", "0");
+}
+
+static void
+deactivate_async_ready (NMDevice *self,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMDeviceStateReason reason = GPOINTER_TO_UINT (user_data);
+ GError *error = NULL;
+
+ NM_DEVICE_GET_CLASS (self)->deactivate_async_finish (self, res, &error);
+
+ /* If operation cancelled, just return */
+ if ( g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)
+ || (priv->deactivating_cancellable && g_cancellable_is_cancelled (priv->deactivating_cancellable))) {
+ nm_log_warn (LOGD_DEVICE, "Deactivation (%s) cancelled",
+ nm_device_get_iface (self));
+ }
+ /* In every other case, transition to the DISCONNECTED state */
+ else {
+ if (error)
+ nm_log_warn (LOGD_DEVICE, "Deactivation (%s) failed: %s",
+ nm_device_get_iface (self),
+ error->message);
+ nm_device_queue_state (self, NM_DEVICE_STATE_DISCONNECTED, reason);
+ }
+
+ g_clear_object (&priv->deactivating_cancellable);
+ g_clear_error (&error);
+}
+
+static void
+deactivate_dispatcher_complete (guint call_id, gpointer user_data)
+{
+ NMDevice *self = NM_DEVICE (user_data);
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMDeviceStateReason reason;
+
+ g_return_if_fail (call_id == priv->dispatcher.call_id);
+ g_return_if_fail (priv->dispatcher.post_state == NM_DEVICE_STATE_DISCONNECTED);
+
+ reason = priv->dispatcher.post_state_reason;
+
+ priv->dispatcher.call_id = 0;
+ priv->dispatcher.post_state = NM_DEVICE_STATE_UNKNOWN;
+ priv->dispatcher.post_state_reason = NM_DEVICE_STATE_REASON_NONE;
+
+ if (priv->deactivating_cancellable) {
+ g_warn_if_reached ();
+ g_cancellable_cancel (priv->deactivating_cancellable);
+ g_clear_object (&priv->deactivating_cancellable);
+ }
+
+ if ( NM_DEVICE_GET_CLASS (self)->deactivate_async
+ && NM_DEVICE_GET_CLASS (self)->deactivate_async_finish) {
+ priv->deactivating_cancellable = g_cancellable_new ();
+ NM_DEVICE_GET_CLASS (self)->deactivate_async (self,
+ priv->deactivating_cancellable,
+ (GAsyncReadyCallback) deactivate_async_ready,
+ GUINT_TO_POINTER (reason));
+ } else
+ nm_device_queue_state (self, NM_DEVICE_STATE_DISCONNECTED, reason);
+}
+
+static void
_set_state_full (NMDevice *self,
NMDeviceState state,
NMDeviceStateReason reason,
@@ -6830,13 +7826,15 @@ _set_state_full (NMDevice *self,
nm_device_queued_state_clear (self);
dispatcher_cleanup (self);
+ if (priv->deactivating_cancellable)
+ g_cancellable_cancel (priv->deactivating_cancellable);
/* Cache the activation request for the dispatcher */
req = priv->act_request ? g_object_ref (priv->act_request) : NULL;
if (state <= NM_DEVICE_STATE_UNAVAILABLE) {
_clear_available_connections (self, TRUE);
- g_clear_object (&priv->queued_act_request);
+ _clear_queued_act_request (priv);
}
/* Update the available connections list when a device first becomes available */
@@ -6851,52 +7849,67 @@ _set_state_full (NMDevice *self,
case NM_DEVICE_STATE_UNMANAGED:
nm_device_set_firmware_missing (self, FALSE);
if (old_state > NM_DEVICE_STATE_UNMANAGED) {
- /* Clean up if the device is now unmanaged but was activated */
- if (nm_device_get_act_request (self))
- nm_device_cleanup (self, reason);
- nm_device_take_down (self, TRUE);
- set_nm_ipv6ll (self, FALSE);
- restore_ip6_properties (self);
+ if (reason == NM_DEVICE_STATE_REASON_REMOVED) {
+ nm_device_cleanup (self, reason, FALSE);
+ } else {
+ /* Clean up if the device is now unmanaged but was activated */
+ if (nm_device_get_act_request (self))
+ nm_device_cleanup (self, reason, TRUE);
+ nm_device_take_down (self, TRUE);
+ set_nm_ipv6ll (self, FALSE);
+ restore_ip6_properties (self);
+ }
}
break;
case NM_DEVICE_STATE_UNAVAILABLE:
if (old_state == NM_DEVICE_STATE_UNMANAGED) {
save_ip6_properties (self);
- if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) {
- set_nm_ipv6ll (self, TRUE);
- set_disable_ipv6 (self, "1");
- nm_device_ipv6_sysctl_set (self, "accept_ra_defrtr", "0");
- nm_device_ipv6_sysctl_set (self, "accept_ra_pinfo", "0");
- nm_device_ipv6_sysctl_set (self, "accept_ra_rtr_pref", "0");
- nm_device_ipv6_sysctl_set (self, "use_tempaddr", "0");
- }
+ if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED)
+ ip6_managed_setup (self);
}
- if (old_state == NM_DEVICE_STATE_UNMANAGED || priv->firmware_missing) {
- if (!nm_device_bring_up (self, TRUE, &no_firmware) && no_firmware)
- _LOGW (LOGD_HW, "firmware may be missing.");
- nm_device_set_firmware_missing (self, no_firmware ? TRUE : FALSE);
+ if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) {
+ if (old_state == NM_DEVICE_STATE_UNMANAGED || priv->firmware_missing) {
+ if (!nm_device_bring_up (self, TRUE, &no_firmware) && no_firmware)
+ _LOGW (LOGD_HW, "firmware may be missing.");
+ nm_device_set_firmware_missing (self, no_firmware ? TRUE : FALSE);
+ }
+
+ /* Ensure the device gets deactivated in response to stuff like
+ * carrier changes or rfkill. But don't deactivate devices that are
+ * about to assume a connection since that defeats the purpose of
+ * assuming the device's existing connection.
+ *
+ * Note that we "deactivate" the device even when coming from
+ * UNMANAGED, to ensure that it's in a clean state.
+ */
+ nm_device_cleanup (self, reason, TRUE);
}
- /* Ensure the device gets deactivated in response to stuff like
- * carrier changes or rfkill. But don't deactivate devices that are
- * about to assume a connection since that defeats the purpose of
- * assuming the device's existing connection.
- *
- * Note that we "deactivate" the device even when coming from
- * UNMANAGED, to ensure that it's in a clean state.
- */
- if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED)
- nm_device_cleanup (self, reason);
break;
case NM_DEVICE_STATE_DISCONNECTED:
- /* Ensure devices that previously assumed a connection now have
- * userspace IPv6LL enabled.
- */
- if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED)
+ if (old_state > NM_DEVICE_STATE_DISCONNECTED) {
+ /* Ensure devices that previously assumed a connection now have
+ * userspace IPv6LL enabled.
+ */
set_nm_ipv6ll (self, TRUE);
- if (old_state > NM_DEVICE_STATE_UNAVAILABLE)
- nm_device_cleanup (self, reason);
+ nm_device_cleanup (self, reason, TRUE);
+ } else if (old_state < NM_DEVICE_STATE_DISCONNECTED) {
+ if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) {
+ /* Ensure IPv6 is set up as it may not have been done when
+ * entering the UNAVAILABLE state depending on the reason.
+ */
+ ip6_managed_setup (self);
+ }
+ }
+ break;
+ case NM_DEVICE_STATE_NEED_AUTH:
+ if (old_state > NM_DEVICE_STATE_NEED_AUTH) {
+ /* Clean up any half-done IP operations if the device's layer2
+ * finds out it needs authentication during IP config.
+ */
+ _cleanup_ip_pre (self, TRUE);
+ }
break;
default:
break;
@@ -6921,7 +7934,7 @@ _set_state_full (NMDevice *self,
* we can't change states again from the state handler for a variety of
* reasons.
*/
- if (nm_device_is_available (self)) {
+ if (nm_device_is_available (self, NM_DEVICE_CHECK_DEV_AVAILABLE_NONE)) {
_LOGD (LOGD_DEVICE, "device is available, will transition to DISCONNECTED");
nm_device_queue_state (self, NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE);
} else {
@@ -6943,16 +7956,17 @@ _set_state_full (NMDevice *self,
if (!nm_dispatcher_call (DISPATCHER_ACTION_PRE_DOWN,
nm_act_request_get_connection (req),
self,
- dispatcher_complete_proceed_state,
+ deactivate_dispatcher_complete,
self,
&priv->dispatcher.call_id)) {
/* Just proceed on errors */
- dispatcher_complete_proceed_state (0, self);
+ deactivate_dispatcher_complete (0, self);
}
}
break;
case NM_DEVICE_STATE_DISCONNECTED:
- if (priv->queued_act_request) {
+ if ( priv->queued_act_request
+ && !priv->queued_act_request_is_waiting_for_carrier) {
NMActRequest *queued_req;
queued_req = priv->queued_act_request;
@@ -6968,6 +7982,14 @@ _set_state_full (NMDevice *self,
nm_dispatcher_call (DISPATCHER_ACTION_UP, nm_act_request_get_connection (req), self, NULL, NULL, NULL);
break;
case NM_DEVICE_STATE_FAILED:
+ if (nm_device_uses_assumed_connection (self)) {
+ /* Avoid tearing down assumed connection, assume it's connected */
+ nm_device_queue_state (self,
+ NM_DEVICE_STATE_ACTIVATED,
+ NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
+ break;
+ }
+
connection = nm_device_get_connection (self);
_LOGW (LOGD_DEVICE | LOGD_WIFI,
"Activation: failed for connection '%s'",
@@ -7262,24 +8284,30 @@ nm_device_spec_match_list (NMDevice *self, const GSList *specs)
if (!specs)
return FALSE;
- return NM_DEVICE_GET_CLASS (self)->spec_match_list (self, specs);
+ return NM_DEVICE_GET_CLASS (self)->spec_match_list (self, specs) == NM_MATCH_SPEC_MATCH;
}
-static gboolean
+static NMMatchSpecMatchType
spec_match_list (NMDevice *self, const GSList *specs)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- gboolean matched = FALSE;
-
- if (nm_match_spec_string (specs, "*"))
- return TRUE;
-
- if (priv->hw_addr_len)
- matched = nm_match_spec_hwaddr (specs, priv->hw_addr);
-
- if (!matched)
- matched = nm_match_spec_interface_name (specs, nm_device_get_iface (self));
+ NMMatchSpecMatchType matched = NM_MATCH_SPEC_NO_MATCH, m;
+ const GSList *iter;
+ for (iter = specs; iter; iter = g_slist_next (iter)) {
+ if (!strcmp ((const char *) iter->data, "*")) {
+ matched = NM_MATCH_SPEC_MATCH;
+ break;
+ }
+ }
+ if (priv->hw_addr_len) {
+ m = nm_match_spec_hwaddr (specs, priv->hw_addr);
+ matched = MAX (matched, m);
+ }
+ if (matched != NM_MATCH_SPEC_NEG_MATCH) {
+ m = nm_match_spec_interface_name (specs, nm_device_get_iface (self));
+ matched = MAX (matched, m);
+ }
return matched;
}
@@ -7302,6 +8330,9 @@ nm_device_init (NMDevice *self)
priv->unmanaged_flags = NM_UNMANAGED_INTERNAL;
priv->available_connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL);
priv->ip6_saved_properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
+
+ priv->default_route.v4_is_assumed = TRUE;
+ priv->default_route.v6_is_assumed = TRUE;
}
/*
@@ -7379,6 +8410,9 @@ constructor (GType type,
if (NM_DEVICE_GET_CLASS (self)->get_generic_capabilities)
priv->capabilities |= NM_DEVICE_GET_CLASS (self)->get_generic_capabilities (self);
+ if (priv->ifindex <= 0 && !device_has_capability (self, NM_DEVICE_CAP_IS_NON_KERNEL))
+ _LOGW (LOGD_HW, "failed to look up interface index");
+
device_get_driver_info (self, priv->iface, &priv->driver_version, &priv->firmware_version);
/* Watch for external IP config changes */
@@ -7389,6 +8423,9 @@ constructor (GType type,
g_signal_connect (platform, NM_PLATFORM_SIGNAL_IP6_ROUTE_CHANGED, G_CALLBACK (device_ip_changed), self);
g_signal_connect (platform, NM_PLATFORM_SIGNAL_LINK_CHANGED, G_CALLBACK (link_changed_cb), self);
+ /* trigger initial ip config change to initialize ip-config */
+ priv->queued_ip_config_id = g_idle_add (queued_ip_config_change, self);
+
if (nm_platform_check_support_user_ipv6ll ()) {
int ip_ifindex = nm_device_get_ip_ifindex (self);
@@ -7408,6 +8445,7 @@ constructed (GObject *object)
{
NMDevice *self = NM_DEVICE (object);
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ int master;
nm_device_update_hw_address (self);
@@ -7440,6 +8478,11 @@ constructed (GObject *object)
if (priv->is_software)
priv->capabilities |= NM_DEVICE_CAP_IS_SOFTWARE;
+ /* Enslave ourselves */
+ master = nm_platform_link_get_master (priv->ifindex);
+ if (master)
+ device_set_master (self, master);
+
priv->con_provider = nm_connection_provider_get ();
g_assert (priv->con_provider);
g_signal_connect (priv->con_provider,
@@ -7476,6 +8519,8 @@ dispose (GObject *object)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
NMPlatform *platform;
+ _LOGD (LOGD_DEVICE, "dispose(): %s", G_OBJECT_TYPE_NAME (self));
+
dispatcher_cleanup (self);
_cleanup_generic_pre (self, FALSE);
@@ -7488,7 +8533,7 @@ dispose (GObject *object)
_cleanup_generic_post (self, FALSE);
- g_clear_pointer (&priv->ip6_saved_properties, g_hash_table_unref);
+ g_hash_table_remove_all (priv->ip6_saved_properties);
if (priv->recheck_assume_id) {
g_source_remove (priv->recheck_assume_id);
@@ -7504,15 +8549,14 @@ dispose (GObject *object)
priv->con_provider = NULL;
}
- g_hash_table_unref (priv->available_connections);
- priv->available_connections = NULL;
+ g_hash_table_remove_all (priv->available_connections);
if (priv->carrier_wait_id) {
g_source_remove (priv->carrier_wait_id);
priv->carrier_wait_id = 0;
}
- g_clear_object (&priv->queued_act_request);
+ _clear_queued_act_request (priv);
platform = nm_platform_get ();
g_signal_handlers_disconnect_by_func (platform, G_CALLBACK (device_ip_changed), self);
@@ -7542,6 +8586,9 @@ finalize (GObject *object)
g_free (priv->type_desc);
g_free (priv->dhcp_anycast_address);
+ g_hash_table_unref (priv->ip6_saved_properties);
+ g_hash_table_unref (priv->available_connections);
+
G_OBJECT_CLASS (nm_device_parent_class)->finalize (object);
}
@@ -7564,6 +8611,7 @@ set_property (GObject *object, guint prop_id,
g_free (priv->iface);
priv->iface = g_strdup (platform_device->name);
priv->ifindex = platform_device->ifindex;
+ priv->up = platform_device->up;
g_free (priv->driver);
priv->driver = g_strdup (platform_device->driver);
}
@@ -7577,18 +8625,10 @@ set_property (GObject *object, guint prop_id,
case PROP_IFACE:
if (g_value_get_string (value)) {
g_free (priv->iface);
- priv->ifindex = 0;
priv->iface = g_value_dup_string (value);
-
- /* Only look up the ifindex if it appears to be an actual kernel
- * interface name. eg Bluetooth devices won't have one until we know
- * the IP interface.
- */
- if (priv->iface && !strchr (priv->iface, ':')) {
- priv->ifindex = nm_platform_link_get_ifindex (priv->iface);
- if (priv->ifindex <= 0)
- _LOGW (LOGD_HW, "failed to look up interface index");
- }
+ priv->ifindex = nm_platform_link_get_ifindex (priv->iface);
+ if (priv->ifindex > 0)
+ priv->up = nm_platform_link_is_up (priv->ifindex);
}
break;
case PROP_DRIVER:
diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h
index b053070388..479c9bf299 100644
--- a/src/devices/nm-device.h
+++ b/src/devices/nm-device.h
@@ -23,6 +23,7 @@
#define __NETWORKMANAGER_DEVICE_H__
#include <glib-object.h>
+#include <gio/gio.h>
#include <dbus/dbus-glib.h>
#include <netinet/in.h>
@@ -85,10 +86,37 @@ G_BEGIN_DECLS
typedef enum NMActStageReturn NMActStageReturn;
+/* These flags affect whether a connection is considered available on a device
+ * (check_connection_available()). The flags should have the meaning of relaxing
+ * a condition, so that adding a flag might make a connection available that would
+ * not be available otherwise. Adding a flag should never make a connection
+ * not available if it would be available otherwise. */
+typedef enum { /*< skip >*/
+ NM_DEVICE_CHECK_CON_AVAILABLE_NONE = 0,
+
+ _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_WAITING_CARRIER = (1L << 0),
+ _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_IGNORE_AP = (1L << 1),
+ NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST = _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_WAITING_CARRIER
+ | _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_IGNORE_AP,
+
+ __NM_DEVICE_CHECK_CON_AVAILABLE_ALL,
+ NM_DEVICE_CHECK_CON_AVAILABLE_ALL = (((__NM_DEVICE_CHECK_CON_AVAILABLE_ALL - 1) << 1) - 1),
+} NMDeviceCheckConAvailableFlags;
+
struct _NMDevice {
GObject parent;
};
+/* The flags have an relaxing meaning, that means, specifying more flags, can make
+ * a device appear more available. It can never make a device less available. */
+typedef enum { /*< skip >*/
+ NM_DEVICE_CHECK_DEV_AVAILABLE_NONE = 0,
+ NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER = (1L << 0),
+
+ __NM_DEVICE_CHECK_DEV_AVAILABLE_ALL,
+ NM_DEVICE_CHECK_DEV_AVAILABLE_ALL = (((__NM_DEVICE_CHECK_DEV_AVAILABLE_ALL - 1) << 1) - 1),
+} NMDeviceCheckDevAvailableFlags;
+
typedef struct {
GObjectClass parent;
@@ -116,7 +144,7 @@ typedef struct {
guint32 (* get_generic_capabilities) (NMDevice *self);
- gboolean (* is_available) (NMDevice *self);
+ gboolean (* is_available) (NMDevice *self, NMDeviceCheckDevAvailableFlags flags);
gboolean (* get_enabled) (NMDevice *self);
@@ -136,19 +164,18 @@ typedef struct {
* including any live network information like scan lists. The connection
* is checked against the object defined by @specific_object, if given.
* Returns TRUE if the connection is available; FALSE if not.
+ *
+ * The passed @flags affect whether a connection is considered
+ * available or not. Adding more flags, means the connection is
+ * *more* available.
+ *
+ * Specifying @specific_object can only reduce the availability of a connection.
*/
gboolean (* check_connection_available) (NMDevice *self,
NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
const char *specific_object);
- /* Same as check_connection_available() but called if the connection
- * is not present in the activating-connections array during activation,
- * to give the device a chance to allow/deny the activation. This is a
- * hack only meant for hidden WiFi networks.
- */
- gboolean (* check_connection_available_wifi_hidden) (NMDevice *self,
- NMConnection *connection);
-
gboolean (* complete_connection) (NMDevice *self,
NMConnection *connection,
const char *specific_object,
@@ -174,9 +201,19 @@ typedef struct {
void (* ip4_config_pre_commit) (NMDevice *self, NMIP4Config *config);
void (* ip6_config_pre_commit) (NMDevice *self, NMIP6Config *config);
+ /* Async deactivating (in the DEACTIVATING phase) */
+ void (* deactivate_async) (NMDevice *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* deactivate_async_finish) (NMDevice *self,
+ GAsyncResult *res,
+ GError **error);
+
+ /* Sync deactivating (in the DISCONNECTED phase) */
void (* deactivate) (NMDevice *self);
- gboolean (* spec_match_list) (NMDevice *self, const GSList *specs);
+ NMMatchSpecMatchType (* spec_match_list) (NMDevice *self, const GSList *specs);
/* Update the connection with currently configured L2 settings */
void (* update_connection) (NMDevice *device, NMConnection *connection);
@@ -216,6 +253,8 @@ GType nm_device_get_type (void);
const char * nm_device_get_path (NMDevice *dev);
void nm_device_dbus_export (NMDevice *device);
+void nm_device_finish_init (NMDevice *device);
+
const char * nm_device_get_udi (NMDevice *dev);
const char * nm_device_get_iface (NMDevice *dev);
int nm_device_get_ifindex (NMDevice *dev);
@@ -228,6 +267,8 @@ const char * nm_device_get_type_desc (NMDevice *dev);
NMDeviceType nm_device_get_device_type (NMDevice *dev);
int nm_device_get_priority (NMDevice *dev);
+guint32 nm_device_get_ip4_route_metric (NMDevice *dev);
+guint32 nm_device_get_ip6_route_metric (NMDevice *dev);
const char * nm_device_get_hw_address (NMDevice *dev);
@@ -251,7 +292,9 @@ NMDevice * nm_device_get_master (NMDevice *dev);
NMActRequest * nm_device_get_act_request (NMDevice *dev);
NMConnection * nm_device_get_connection (NMDevice *dev);
-gboolean nm_device_is_available (NMDevice *dev);
+void nm_device_removed (NMDevice *dev);
+
+gboolean nm_device_is_available (NMDevice *dev, NMDeviceCheckDevAvailableFlags flags);
gboolean nm_device_has_carrier (NMDevice *dev);
NMConnection * nm_device_generate_connection (NMDevice *self, NMDevice *master);
@@ -273,6 +316,8 @@ gboolean nm_device_complete_connection (NMDevice *device,
gboolean nm_device_check_connection_compatible (NMDevice *device, NMConnection *connection);
+gboolean nm_device_uses_assumed_connection (NMDevice *device);
+
gboolean nm_device_can_assume_active_connection (NMDevice *device);
gboolean nm_device_spec_match_list (NMDevice *device, const GSList *specs);
@@ -295,16 +340,21 @@ RfKillType nm_device_get_rfkill_type (NMDevice *device);
* @NM_UNMANAGED_INTERNAL: %TRUE when unmanaged by internal decision (ie,
* because NM is sleeping or not managed for some other reason)
* @NM_UNMANAGED_USER: %TRUE when unmanaged by user decision (via unmanaged-specs)
+ * @NM_UNMANAGED_PARENT: %TRUE when unmanaged due to parent device being unmanaged
+ * @NM_UNMANAGED_EXTERNAL_DOWN: %TRUE when unmanaged because !IFF_UP and not created by NM
*/
typedef enum {
- NM_UNMANAGED_NONE = 0x00,
- NM_UNMANAGED_DEFAULT = 0x01,
- NM_UNMANAGED_INTERNAL = 0x02,
- NM_UNMANAGED_USER = 0x04,
+ NM_UNMANAGED_NONE = 0x00,
+ NM_UNMANAGED_DEFAULT = 0x01,
+ NM_UNMANAGED_INTERNAL = 0x02,
+ NM_UNMANAGED_USER = 0x04,
+ NM_UNMANAGED_PARENT = 0x08,
+ NM_UNMANAGED_EXTERNAL_DOWN = 0x10,
/* Boundary value */
__NM_UNMANAGED_LAST,
- NM_UNMANAGED_LAST = __NM_UNMANAGED_LAST - 1,
+ NM_UNMANAGED_LAST = __NM_UNMANAGED_LAST - 1,
+ NM_UNMANAGED_ALL = ((NM_UNMANAGED_LAST << 1) - 1),
} NMUnmanagedFlags;
gboolean nm_device_get_managed (NMDevice *device);
@@ -348,9 +398,10 @@ gboolean nm_device_has_pending_action (NMDevice *device);
GPtrArray *nm_device_get_available_connections (NMDevice *device,
const char *specific_object);
-gboolean nm_device_connection_is_available (NMDevice *device,
- NMConnection *connection,
- gboolean allow_device_override);
+gboolean nm_device_check_connection_available (NMDevice *device,
+ NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
+ const char *specific_object);
gboolean nm_device_notify_component_added (NMDevice *device, GObject *component);
@@ -358,6 +409,11 @@ gboolean nm_device_owns_iface (NMDevice *device, const char *iface);
NMConnection *nm_device_new_default_connection (NMDevice *self);
+const NMPlatformIP4Route *nm_device_get_ip4_default_route (NMDevice *self, gboolean *out_is_assumed);
+const NMPlatformIP6Route *nm_device_get_ip6_default_route (NMDevice *self, gboolean *out_is_assumed);
+
+void nm_device_spawn_iface_helper (NMDevice *self);
+
G_END_DECLS
/* For testing only */
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c
index df27562019..c8f510b9b5 100644
--- a/src/devices/team/nm-device-team.c
+++ b/src/devices/team/nm-device-team.c
@@ -39,7 +39,6 @@
#include "nm-dbus-manager.h"
#include "nm-enum-types.h"
#include "nm-team-enum-types.h"
-#include "nm-posix-signals.h"
#include "nm-core-internal.h"
#include "nm-device-team-glue.h"
@@ -51,8 +50,6 @@ G_DEFINE_TYPE (NMDeviceTeam, nm_device_team, NM_TYPE_DEVICE)
#define NM_DEVICE_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_TEAM, NMDeviceTeamPrivate))
-static gboolean teamd_start (NMDevice *device, NMSettingTeam *s_team);
-
typedef struct {
struct teamdctl *tdc;
GPid teamd_pid;
@@ -77,7 +74,7 @@ get_generic_capabilities (NMDevice *device)
}
static gboolean
-is_available (NMDevice *device)
+is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
{
if (NM_DEVICE_GET_CLASS (device)->is_up)
return NM_DEVICE_GET_CLASS (device)->is_up (device);
@@ -87,6 +84,7 @@ is_available (NMDevice *device)
static gboolean
check_connection_available (NMDevice *device,
NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
const char *specific_object)
{
/* Connections are always available because the carrier state is determined
@@ -171,6 +169,7 @@ update_connection (NMDevice *device, NMConnection *connection)
{
NMDeviceTeam *self = NM_DEVICE_TEAM (device);
NMSettingTeam *s_team = nm_connection_get_setting_team (connection);
+ NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (self);
if (!s_team) {
s_team = (NMSettingTeam *) nm_setting_team_new ();
@@ -178,8 +177,7 @@ update_connection (NMDevice *device, NMConnection *connection)
}
g_object_set (G_OBJECT (s_team), NM_SETTING_TEAM_CONFIG, NULL, NULL);
- teamd_start (device, s_team);
- if (NM_DEVICE_TEAM_GET_PRIVATE (device)->teamd_pid > 0 && ensure_teamd_connection (device)) {
+ if (priv->tdc) {
const char *config = NULL;
int err;
@@ -276,11 +274,6 @@ teamd_cleanup (NMDevice *device, gboolean device_state_failed)
{
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (device);
- if (priv->teamd_dbus_watch) {
- g_bus_unwatch_name (priv->teamd_dbus_watch);
- priv->teamd_dbus_watch = 0;
- }
-
if (priv->teamd_process_watch) {
g_source_remove (priv->teamd_process_watch);
priv->teamd_process_watch = 0;
@@ -330,16 +323,22 @@ teamd_dbus_appeared (GDBusConnection *connection,
NMDeviceTeam *self = NM_DEVICE_TEAM (user_data);
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (self);
NMDevice *device = NM_DEVICE (self);
+ gboolean success;
g_return_if_fail (priv->teamd_dbus_watch);
_LOGI (LOGD_TEAM, "teamd appeared on D-Bus");
teamd_timeout_remove (device);
- if (!ensure_teamd_connection (device)) {
- nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED);
+ nm_device_queue_recheck_assume (device);
+
+ success = ensure_teamd_connection (device);
+ if (nm_device_get_state (device) == NM_DEVICE_STATE_PREPARE) {
+ if (success)
+ nm_device_activate_schedule_stage2_device_config (device);
+ else if (!nm_device_uses_assumed_connection (device))
+ nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED);
return;
}
- nm_device_activate_schedule_stage2_device_config (device);
}
static void
@@ -353,15 +352,12 @@ teamd_dbus_vanished (GDBusConnection *connection,
g_return_if_fail (priv->teamd_dbus_watch);
- if (priv->teamd_timeout) {
+ if (!priv->tdc) {
/* g_bus_watch_name will always raise an initial signal, to indicate whether the
- * name exists/not exists initially. Do not take this as a failure, until the
- * startup timeout is over.
- *
- * Note that g_bus_watch_name is guaranteed to alternate vanished/appeared signals,
- * so we won't hit this condition again (because the next signal is either 'appeared'
- * or 'timeout'). */
- _LOGD (LOGD_TEAM, "teamd vanished from D-Bus (ignored)");
+ * name exists/not exists initially. Do not take this as a failure if it hadn't
+ * previously appeared.
+ */
+ _LOGD (LOGD_TEAM, "teamd not on D-Bus (ignored)");
return;
}
@@ -385,20 +381,22 @@ teamd_process_watch_cb (GPid pid, gint status, gpointer user_data)
}
static void
-teamd_child_setup (gpointer user_data G_GNUC_UNUSED)
+nm_device_team_watch_dbus (NMDeviceTeam *self)
{
- /* We are in the child process at this point.
- * Give child it's own program group for signal
- * separation.
- */
- pid_t pid = getpid ();
- setpgid (pid, pid);
+ NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (self);
+ const char *iface = nm_device_get_ip_iface (NM_DEVICE (self));
+ char *tmp_str = NULL;
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for avahi-autoipd here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
+ /* Register D-Bus name watcher */
+ tmp_str = g_strdup_printf ("org.libteam.teamd.%s", iface);
+ priv->teamd_dbus_watch = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
+ tmp_str,
+ G_BUS_NAME_WATCHER_FLAGS_NONE,
+ teamd_dbus_appeared,
+ teamd_dbus_vanished,
+ NM_DEVICE (self),
+ NULL);
+ g_free (tmp_str);
}
static gboolean
@@ -415,14 +413,14 @@ teamd_start (NMDevice *device, NMSettingTeam *s_team)
gboolean ret;
int status;
- if (priv->teamd_dbus_watch ||
- priv->teamd_process_watch ||
+ if (priv->teamd_process_watch ||
priv->teamd_pid > 0 ||
priv->tdc ||
priv->teamd_timeout)
{
- /* Just return if teamd_start() was already called */
- return TRUE;
+ /* FIXME g_assert that this never hits. For now, be more reluctant, and try to recover. */
+ g_warn_if_reached ();
+ teamd_cleanup (device, FALSE);
}
teamd_binary = nm_utils_find_helper ("teamd", NULL, NULL);
@@ -443,7 +441,7 @@ teamd_start (NMDevice *device, NMSettingTeam *s_team)
(tmp_str = g_strjoinv (" ", (gchar **) argv->pdata)));
g_clear_pointer (&tmp_str, g_free);
- ret = g_spawn_sync ("/", (char **) argv->pdata, NULL, 0, nm_unblock_posix_signals, NULL, NULL, NULL, &status, &error);
+ ret = g_spawn_sync ("/", (char **) argv->pdata, NULL, 0, NULL, NULL, NULL, NULL, &status, &error);
g_ptr_array_free (argv, TRUE);
/* Start teamd now */
@@ -453,6 +451,7 @@ teamd_start (NMDevice *device, NMSettingTeam *s_team)
g_ptr_array_add (argv, (gpointer) "-n");
g_ptr_array_add (argv, (gpointer) "-U");
g_ptr_array_add (argv, (gpointer) "-D");
+ g_ptr_array_add (argv, (gpointer) "-N");
g_ptr_array_add (argv, (gpointer) "-t");
g_ptr_array_add (argv, (gpointer) iface);
@@ -473,19 +472,8 @@ teamd_start (NMDevice *device, NMSettingTeam *s_team)
/* Start a timeout for teamd to appear at D-Bus */
priv->teamd_timeout = g_timeout_add_seconds (5, teamd_timeout_cb, device);
- /* Register D-Bus name watcher */
- tmp_str = g_strdup_printf ("org.libteam.teamd.%s", iface);
- priv->teamd_dbus_watch = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
- tmp_str,
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- teamd_dbus_appeared,
- teamd_dbus_vanished,
- device,
- NULL);
- g_free (tmp_str);
-
ret = g_spawn_async ("/", (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
- &teamd_child_setup, NULL, &priv->teamd_pid, &error);
+ nm_utils_setpgid, NULL, &priv->teamd_pid, &error);
g_ptr_array_free (argv, TRUE);
if (!ret) {
_LOGW (LOGD_TEAM, "Activation: (team) failed to start teamd: %s", error->message);
@@ -688,6 +676,16 @@ nm_device_team_init (NMDeviceTeam * self)
}
static void
+constructed (GObject *object)
+{
+ NMDeviceTeam *self = NM_DEVICE_TEAM (object);
+
+ G_OBJECT_CLASS (nm_device_team_parent_class)->constructed (object);
+
+ nm_device_team_watch_dbus (self);
+}
+
+static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
@@ -724,6 +722,14 @@ set_property (GObject *object, guint prop_id,
static void
dispose (GObject *object)
{
+ NMDeviceTeam *self = NM_DEVICE_TEAM (object);
+ NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (self);
+
+ if (priv->teamd_dbus_watch) {
+ g_bus_unwatch_name (priv->teamd_dbus_watch);
+ priv->teamd_dbus_watch = 0;
+ }
+
teamd_cleanup (NM_DEVICE (object), FALSE);
G_OBJECT_CLASS (nm_device_team_parent_class)->dispose (object);
@@ -740,6 +746,7 @@ nm_device_team_class_init (NMDeviceTeamClass *klass)
parent_class->connection_type = NM_SETTING_TEAM_SETTING_NAME;
/* virtual methods */
+ object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->dispose = dispose;
diff --git a/src/devices/team/nm-team-factory.c b/src/devices/team/nm-team-factory.c
index 8f6930aa23..cb887cac24 100644
--- a/src/devices/team/nm-team-factory.c
+++ b/src/devices/team/nm-team-factory.c
@@ -18,10 +18,11 @@
* Copyright (C) 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gmodule.h>
-#include "config.h"
#include "nm-device-factory.h"
#include "nm-team-factory.h"
#include "nm-device-team.h"
diff --git a/src/devices/wifi/Makefile.am b/src/devices/wifi/Makefile.am
index 230c00acc4..1be3eb014d 100644
--- a/src/devices/wifi/Makefile.am
+++ b/src/devices/wifi/Makefile.am
@@ -2,7 +2,9 @@ include $(GLIB_MAKEFILE)
@GNOME_CODE_COVERAGE_RULES@
+if ENABLE_TESTS
SUBDIRS=. tests
+endif
AM_CPPFLAGS = \
-I${top_srcdir}/src \
diff --git a/src/devices/wifi/nm-device-olpc-mesh.c b/src/devices/wifi/nm-device-olpc-mesh.c
index d801795985..dc3dfbc659 100644
--- a/src/devices/wifi/nm-device-olpc-mesh.c
+++ b/src/devices/wifi/nm-device-olpc-mesh.c
@@ -25,6 +25,7 @@
*/
#include "config.h"
+
#include <glib.h>
#include <glib/gi18n.h>
#include <dbus/dbus.h>
@@ -234,7 +235,7 @@ act_stage2_config (NMDevice *device, NMDeviceStateReason *reason)
}
static gboolean
-is_available (NMDevice *device)
+is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
{
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (device);
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index 1210106a0e..425dadcfd8 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -19,6 +19,8 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <glib/gi18n.h>
#include <dbus/dbus.h>
@@ -163,7 +165,7 @@ static void supplicant_iface_state_cb (NMSupplicantInterface *iface,
static void supplicant_iface_new_bss_cb (NMSupplicantInterface * iface,
const char *object_path,
- GHashTable *properties,
+ GVariant *properties,
NMDeviceWifi * self);
static void supplicant_iface_bss_updated_cb (NMSupplicantInterface *iface,
@@ -222,8 +224,7 @@ constructor (GType type,
_LOGI (LOGD_HW | LOGD_WIFI, "driver supports Access Point (AP) mode");
/* Connect to the supplicant manager */
- priv->sup_mgr = nm_supplicant_manager_get ();
- g_assert (priv->sup_mgr);
+ priv->sup_mgr = g_object_ref (nm_supplicant_manager_get ());
return object;
}
@@ -361,14 +362,14 @@ find_active_ap (NMDeviceWifi *self,
guint32 devfreq;
nm_platform_wifi_get_bssid (ifindex, bssid);
- _LOGD (LOGD_WIFI, "active BSSID: %02x:%02x:%02x:%02x:%02x:%02x",
+ _LOGT (LOGD_WIFI, "active BSSID: %02x:%02x:%02x:%02x:%02x:%02x",
bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
if (!nm_ethernet_address_is_valid (bssid, ETH_ALEN))
return NULL;
ssid = nm_platform_wifi_get_ssid (ifindex);
- _LOGD (LOGD_WIFI, "active SSID: %s%s%s",
+ _LOGT (LOGD_WIFI, "active SSID: %s%s%s",
ssid ? "'" : "",
ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)",
ssid ? "'" : "");
@@ -381,7 +382,7 @@ find_active_ap (NMDeviceWifi *self,
* and therefore it won't get matched the first time around.
*/
while (i++ < (match_hidden ? 2 : 1)) {
- _LOGD (LOGD_WIFI, " Pass #%d %s", i, i > 1 ? "(ignoring SSID)" : "");
+ _LOGT (LOGD_WIFI, " Pass #%d %s", i, i > 1 ? "(ignoring SSID)" : "");
/* Find this SSID + BSSID in the device's AP list */
for (iter = priv->ap_list; iter; iter = g_slist_next (iter)) {
@@ -391,19 +392,19 @@ find_active_ap (NMDeviceWifi *self,
NM80211Mode apmode;
guint32 apfreq;
- _LOGD (LOGD_WIFI, " AP: %s%s%s %s",
+ _LOGT (LOGD_WIFI, " AP: %s%s%s %s",
ap_ssid ? "'" : "",
ap_ssid ? nm_utils_escape_ssid (ap_ssid->data, ap_ssid->len) : "(none)",
ap_ssid ? "'" : "",
- ap_bssid);
+ str_if_set (ap_bssid, "(none)"));
if (ap == ignore_ap) {
- _LOGD (LOGD_WIFI, " ignored");
+ _LOGT (LOGD_WIFI, " ignored");
continue;
}
if (!nm_utils_hwaddr_matches (bssid, ETH_ALEN, ap_bssid, -1)) {
- _LOGD (LOGD_WIFI, " BSSID mismatch");
+ _LOGT (LOGD_WIFI, " BSSID mismatch");
continue;
}
@@ -413,21 +414,21 @@ find_active_ap (NMDeviceWifi *self,
|| (ssid && ap_ssid && !nm_utils_same_ssid (ssid->data, ssid->len,
ap_ssid->data, ap_ssid->len,
TRUE))) {
- _LOGD (LOGD_WIFI, " SSID mismatch");
+ _LOGT (LOGD_WIFI, " SSID mismatch");
continue;
}
}
apmode = nm_ap_get_mode (ap);
if (devmode != apmode) {
- _LOGD (LOGD_WIFI, " mode mismatch (device %d, ap %d)",
+ _LOGT (LOGD_WIFI, " mode mismatch (device %d, ap %d)",
devmode, apmode);
continue;
}
apfreq = nm_ap_get_freq (ap);
if (devfreq != apfreq) {
- _LOGD (LOGD_WIFI, " frequency mismatch (device %u, ap %u)",
+ _LOGT (LOGD_WIFI, " frequency mismatch (device %u, ap %u)",
devfreq, apfreq);
if (match_nofreq == NULL)
@@ -441,7 +442,7 @@ find_active_ap (NMDeviceWifi *self,
}
// FIXME: handle security settings here too
- _LOGD (LOGD_WIFI, " matched");
+ _LOGT (LOGD_WIFI, " matched");
active_ap = ap;
goto done;
}
@@ -460,20 +461,19 @@ find_active_ap (NMDeviceWifi *self,
* we can't match the AP based on frequency at all, just give up.
*/
if (match_nofreq && ((found_a_band != found_bg_band) || (devfreq == 0))) {
- const char *ap_bssid = nm_ap_get_address (match_nofreq);
const GByteArray *ap_ssid = nm_ap_get_ssid (match_nofreq);
- _LOGD (LOGD_WIFI, " matched %s%s%s %s",
+ _LOGT (LOGD_WIFI, " matched %s%s%s %s",
ap_ssid ? "'" : "",
ap_ssid ? nm_utils_escape_ssid (ap_ssid->data, ap_ssid->len) : "(none)",
ap_ssid ? "'" : "",
- ap_bssid);
+ str_if_set (nm_ap_get_address (match_nofreq), "(none)"));
active_ap = match_nofreq;
goto done;
}
- _LOGD (LOGD_WIFI, " No matching AP found.");
+ _LOGT (LOGD_WIFI, " No matching AP found.");
done:
if (ssid)
@@ -740,7 +740,10 @@ deactivate (NMDevice *device)
nm_platform_wifi_indicate_addressing_running (ifindex, FALSE);
/* Reset MAC address back to initial address */
- nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_WIFI);
+ if (priv->initial_hw_addr)
+ nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_WIFI);
+
+ nm_platform_wifi_set_powersave (ifindex, 0);
/* Ensure we're in infrastructure mode after deactivation; some devices
* (usually older ones) don't scan well in adhoc mode.
@@ -861,10 +864,10 @@ check_connection_compatible (NMDevice *device, NMConnection *connection)
static gboolean
-_internal_check_connection_available (NMDevice *device,
- NMConnection *connection,
- const char *specific_object,
- gboolean ignore_ap_list)
+check_connection_available (NMDevice *device,
+ NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
+ const char *specific_object)
{
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
NMSettingWireless *s_wifi;
@@ -874,6 +877,9 @@ _internal_check_connection_available (NMDevice *device,
s_wifi = nm_connection_get_setting_wireless (connection);
g_return_val_if_fail (s_wifi, FALSE);
+ /* a connection that is available for a certain @specific_object, MUST
+ * also be available in general (without @specific_object). */
+
if (specific_object) {
NMAccessPoint *ap;
@@ -889,8 +895,15 @@ _internal_check_connection_available (NMDevice *device,
|| g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_AP) == 0)
return TRUE;
- /* Hidden SSIDs obviously don't always appear in the scan list either */
- if (nm_setting_wireless_get_hidden (s_wifi) || ignore_ap_list)
+ /* Hidden SSIDs obviously don't always appear in the scan list either.
+ *
+ * For an explict user-activation-request, a connection is considered
+ * available because for hidden Wi-Fi, clients didn't consistently
+ * set the 'hidden' property to indicate hidden SSID networks. If
+ * activating but the network isn't available let the device recheck
+ * availability.
+ */
+ if (nm_setting_wireless_get_hidden (s_wifi) || NM_FLAGS_HAS (flags, _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_IGNORE_AP))
return TRUE;
/* check if its visible */
@@ -902,24 +915,6 @@ _internal_check_connection_available (NMDevice *device,
return FALSE;
}
-static gboolean
-check_connection_available (NMDevice *device,
- NMConnection *connection,
- const char *specific_object)
-{
- return _internal_check_connection_available (device, connection, specific_object, FALSE);
-}
-
-/* FIXME: remove this function when we require the 'hidden' property to be
- * set before a hidden connection can be activated.
- */
-static gboolean
-check_connection_available_wifi_hidden (NMDevice *device,
- NMConnection *connection)
-{
- return _internal_check_connection_available (device, connection, NULL, TRUE);
-}
-
/*
* List of manufacturer default SSIDs that are often unchanged by users.
*
@@ -1141,28 +1136,22 @@ complete_connection (NMDevice *device,
}
static gboolean
-is_available (NMDevice *device)
+is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
{
NMDeviceWifi *self = NM_DEVICE_WIFI (device);
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
guint32 state;
- if (!priv->enabled) {
- _LOGD (LOGD_WIFI, "not available because not enabled");
+ if (!priv->enabled)
return FALSE;
- }
- if (!priv->sup_iface) {
- _LOGD (LOGD_WIFI, "not available because supplicant not running");
+ if (!priv->sup_iface)
return FALSE;
- }
state = nm_supplicant_interface_get_state (priv->sup_iface);
if ( state < NM_SUPPLICANT_INTERFACE_STATE_READY
- || state > NM_SUPPLICANT_INTERFACE_STATE_COMPLETED) {
- _LOGD (LOGD_WIFI, "not available because supplicant interface not ready");
+ || state > NM_SUPPLICANT_INTERFACE_STATE_COMPLETED)
return FALSE;
- }
return TRUE;
}
@@ -1699,12 +1688,12 @@ merge_scanned_ap (NMDeviceWifi *self,
if (ssid && (nm_utils_is_empty_ssid (ssid->data, ssid->len) == FALSE)) {
/* Yay, matched it, no longer treat as hidden */
_LOGD (LOGD_WIFI_SCAN, "matched hidden AP %s => '%s'",
- bssid, nm_utils_escape_ssid (ssid->data, ssid->len));
+ str_if_set (bssid, "(none)"), nm_utils_escape_ssid (ssid->data, ssid->len));
nm_ap_set_broadcast (merge_ap, FALSE);
} else {
/* Didn't have an entry for this AP in the database */
_LOGD (LOGD_WIFI_SCAN, "failed to match hidden AP %s",
- bssid);
+ str_if_set (bssid, "(none)"));
}
}
@@ -1723,7 +1712,7 @@ merge_scanned_ap (NMDeviceWifi *self,
if (found_ap) {
_LOGD (LOGD_WIFI_SCAN, "merging AP '%s' %s (%p) with existing (%p)",
ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)",
- bssid,
+ str_if_set (bssid, "(none)"),
merge_ap,
found_ap);
@@ -1745,7 +1734,7 @@ merge_scanned_ap (NMDeviceWifi *self,
/* New entry in the list */
_LOGD (LOGD_WIFI_SCAN, "adding new AP '%s' %s (%p)",
ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)",
- bssid, merge_ap);
+ str_if_set (bssid, "(none)"), merge_ap);
g_object_ref (merge_ap);
priv->ap_list = g_slist_prepend (priv->ap_list, merge_ap);
@@ -1801,14 +1790,12 @@ cull_scan_list (NMDeviceWifi *self)
/* Remove outdated APs */
for (elt = outdated_list; elt; elt = g_slist_next (elt)) {
NMAccessPoint *outdated_ap = NM_AP (elt->data);
- const char *bssid;
const GByteArray *ssid;
- bssid = nm_ap_get_address (outdated_ap);
ssid = nm_ap_get_ssid (outdated_ap);
_LOGD (LOGD_WIFI_SCAN,
" removing %s (%s%s%s)",
- bssid,
+ str_if_set (nm_ap_get_address (outdated_ap), "(none)"),
ssid ? "'" : "",
ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)",
ssid ? "'" : "");
@@ -1843,7 +1830,7 @@ schedule_scanlist_cull (NMDeviceWifi *self)
static void
supplicant_iface_new_bss_cb (NMSupplicantInterface *iface,
const char *object_path,
- GHashTable *properties,
+ GVariant *properties,
NMDeviceWifi *self)
{
NMDeviceState state;
@@ -2169,7 +2156,7 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
/* If the interface can now be activated because the supplicant is now
* available, transition to DISCONNECTED.
*/
- if ((devstate == NM_DEVICE_STATE_UNAVAILABLE) && nm_device_is_available (device)) {
+ if ((devstate == NM_DEVICE_STATE_UNAVAILABLE) && nm_device_is_available (device, NM_DEVICE_CHECK_DEV_AVAILABLE_NONE)) {
nm_device_state_changed (device,
NM_DEVICE_STATE_DISCONNECTED,
NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE);
@@ -2759,6 +2746,11 @@ act_stage2_config (NMDevice *device, NMDeviceStateReason *reason)
if ((nm_ap_get_mode (ap) == NM_802_11_MODE_ADHOC) || nm_ap_is_hotspot (ap))
ensure_hotspot_frequency (self, s_wireless, ap);
+ if (nm_ap_get_mode (ap) == NM_802_11_MODE_INFRA) {
+ nm_platform_wifi_set_powersave (nm_device_get_ifindex (device),
+ nm_setting_wireless_get_powersave (s_wireless));
+ }
+
/* Build up the supplicant configuration */
config = build_supplicant_config (self, connection, nm_ap_get_freq (ap));
if (config == NULL) {
@@ -2809,14 +2801,14 @@ act_stage3_ip4_config_start (NMDevice *device,
NMDeviceStateReason *reason)
{
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
const char *method = NM_SETTING_IP4_CONFIG_METHOD_AUTO;
connection = nm_device_get_connection (device);
g_assert (connection);
s_ip4 = nm_connection_get_setting_ip4_config (connection);
if (s_ip4)
- method = nm_setting_ip4_config_get_method (s_ip4);
+ method = nm_setting_ip_config_get_method (s_ip4);
/* Indicate that a critical protocol is about to start */
if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0)
@@ -2831,14 +2823,14 @@ act_stage3_ip6_config_start (NMDevice *device,
NMDeviceStateReason *reason)
{
NMConnection *connection;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
const char *method = NM_SETTING_IP6_CONFIG_METHOD_AUTO;
connection = nm_device_get_connection (device);
g_assert (connection);
s_ip6 = nm_connection_get_setting_ip6_config (connection);
if (s_ip6)
- method = nm_setting_ip6_config_get_method (s_ip6);
+ method = nm_setting_ip_config_get_method (s_ip6);
/* Indicate that a critical protocol is about to start */
if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0 ||
@@ -2938,7 +2930,7 @@ static NMActStageReturn
act_stage4_ip4_config_timeout (NMDevice *device, NMDeviceStateReason *reason)
{
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
gboolean may_fail = FALSE, chain_up = FALSE;
NMActStageReturn ret;
@@ -2946,7 +2938,7 @@ act_stage4_ip4_config_timeout (NMDevice *device, NMDeviceStateReason *reason)
g_assert (connection);
s_ip4 = nm_connection_get_setting_ip4_config (connection);
- may_fail = nm_setting_ip4_config_get_may_fail (s_ip4);
+ may_fail = nm_setting_ip_config_get_may_fail (s_ip4);
ret = handle_ip_config_timeout (NM_DEVICE_WIFI (device), connection, may_fail, &chain_up, reason);
if (chain_up)
@@ -2959,7 +2951,7 @@ static NMActStageReturn
act_stage4_ip6_config_timeout (NMDevice *device, NMDeviceStateReason *reason)
{
NMConnection *connection;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
gboolean may_fail = FALSE, chain_up = FALSE;
NMActStageReturn ret;
@@ -2967,7 +2959,7 @@ act_stage4_ip6_config_timeout (NMDevice *device, NMDeviceStateReason *reason)
g_assert (connection);
s_ip6 = nm_connection_get_setting_ip6_config (connection);
- may_fail = nm_setting_ip6_config_get_may_fail (s_ip6);
+ may_fail = nm_setting_ip_config_get_may_fail (s_ip6);
ret = handle_ip_config_timeout (NM_DEVICE_WIFI (device), connection, may_fail, &chain_up, reason);
if (chain_up)
@@ -3015,7 +3007,7 @@ activation_success_handler (NMDevice *device)
* the BSSID off the card and fill in the BSSID of the activation AP.
*/
nm_platform_wifi_get_bssid (ifindex, bssid);
- if (!nm_ethernet_address_is_valid (nm_ap_get_address (ap), -1)) {
+ if (!nm_ap_get_address (ap)) {
char *bssid_str = nm_utils_hwaddr_ntoa (bssid, ETH_ALEN);
nm_ap_set_address (ap, bssid_str);
g_free (bssid_str);
@@ -3335,7 +3327,6 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
parent_class->is_available = is_available;
parent_class->check_connection_compatible = check_connection_compatible;
parent_class->check_connection_available = check_connection_available;
- parent_class->check_connection_available_wifi_hidden = check_connection_available_wifi_hidden;
parent_class->complete_connection = complete_connection;
parent_class->set_enabled = set_enabled;
diff --git a/src/devices/wifi/nm-wifi-ap-utils.c b/src/devices/wifi/nm-wifi-ap-utils.c
index 85d76d2187..9ac7052e96 100644
--- a/src/devices/wifi/nm-wifi-ap-utils.c
+++ b/src/devices/wifi/nm-wifi-ap-utils.c
@@ -18,7 +18,8 @@
* (C) Copyright 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c
index 0c252218fa..c0f8b11dff 100644
--- a/src/devices/wifi/nm-wifi-ap.c
+++ b/src/devices/wifi/nm-wifi-ap.c
@@ -19,6 +19,8 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
@@ -28,6 +30,7 @@
#include "nm-utils.h"
#include "nm-logging.h"
#include "nm-dbus-manager.h"
+#include "nm-core-internal.h"
#include "nm-setting-wireless.h"
#include "nm-glib-compat.h"
@@ -328,163 +331,131 @@ nm_ap_new (void)
}
static NM80211ApSecurityFlags
-pair_to_flags (const char *str)
+security_from_vardict (GVariant *security)
{
- g_return_val_if_fail (str != NULL, NM_802_11_AP_SEC_NONE);
-
- if (strcmp (str, "tkip") == 0)
- return NM_802_11_AP_SEC_PAIR_TKIP;
- if (strcmp (str, "ccmp") == 0)
- return NM_802_11_AP_SEC_PAIR_CCMP;
- return NM_802_11_AP_SEC_NONE;
-}
+ NM80211ApSecurityFlags flags = NM_802_11_AP_SEC_NONE;
+ const char **array, *tmp;
-static NM80211ApSecurityFlags
-group_to_flags (const char *str)
-{
- g_return_val_if_fail (str != NULL, NM_802_11_AP_SEC_NONE);
-
- if (strcmp (str, "wep40") == 0)
- return NM_802_11_AP_SEC_GROUP_WEP40;
- if (strcmp (str, "wep104") == 0)
- return NM_802_11_AP_SEC_GROUP_WEP104;
- if (strcmp (str, "tkip") == 0)
- return NM_802_11_AP_SEC_GROUP_TKIP;
- if (strcmp (str, "ccmp") == 0)
- return NM_802_11_AP_SEC_GROUP_CCMP;
- return NM_802_11_AP_SEC_NONE;
-}
+ g_return_val_if_fail (g_variant_is_of_type (security, G_VARIANT_TYPE_VARDICT), NM_802_11_AP_SEC_NONE);
-static NM80211ApSecurityFlags
-security_from_dict (GHashTable *security)
-{
- GValue *value;
- NM80211ApSecurityFlags flags = NM_802_11_AP_SEC_NONE;
- const char **items, **iter;
-
- value = g_hash_table_lookup (security, "KeyMgmt");
- if (value) {
- items = g_value_get_boxed (value);
- for (iter = items; iter && *iter; iter++) {
- if (strcmp (*iter, "wpa-psk") == 0)
- flags |= NM_802_11_AP_SEC_KEY_MGMT_PSK;
- else if (strcmp (*iter, "wpa-eap") == 0)
- flags |= NM_802_11_AP_SEC_KEY_MGMT_802_1X;
- }
+ if (g_variant_lookup (security, "KeyMgmt", "^a&s", &array)) {
+ if (_nm_utils_string_in_list ("wpa-psk", array))
+ flags |= NM_802_11_AP_SEC_KEY_MGMT_PSK;
+ if (_nm_utils_string_in_list ("wpa-eap", array))
+ flags |= NM_802_11_AP_SEC_KEY_MGMT_802_1X;
+ g_free (array);
}
- value = g_hash_table_lookup (security, "Pairwise");
- if (value) {
- items = g_value_get_boxed (value);
- for (iter = items; iter && *iter; iter++)
- flags |= pair_to_flags (*iter);
+ if (g_variant_lookup (security, "Pairwise", "^a&s", &array)) {
+ if (_nm_utils_string_in_list ("tkip", array))
+ flags |= NM_802_11_AP_SEC_PAIR_TKIP;
+ if (_nm_utils_string_in_list ("ccmp", array))
+ flags |= NM_802_11_AP_SEC_PAIR_CCMP;
+ g_free (array);
}
- value = g_hash_table_lookup (security, "Group");
- if (value)
- flags |= group_to_flags (g_value_get_string (value));
+ if (g_variant_lookup (security, "Group", "&s", &tmp)) {
+ if (strcmp (tmp, "wep40") == 0)
+ flags |= NM_802_11_AP_SEC_GROUP_WEP40;
+ if (strcmp (tmp, "wep104") == 0)
+ flags |= NM_802_11_AP_SEC_GROUP_WEP104;
+ if (strcmp (tmp, "tkip") == 0)
+ flags |= NM_802_11_AP_SEC_GROUP_TKIP;
+ if (strcmp (tmp, "ccmp") == 0)
+ flags |= NM_802_11_AP_SEC_GROUP_CCMP;
+ }
return flags;
}
-static void
-foreach_property_cb (gpointer key, gpointer value, gpointer user_data)
+NMAccessPoint *
+nm_ap_new_from_properties (const char *supplicant_path, GVariant *properties)
{
- GValue *variant = (GValue *) value;
- NMAccessPoint *ap = (NMAccessPoint *) user_data;
+ const char bad_bssid1[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ const char bad_bssid2[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+ const char *addr;
+ const guint8 *bytes;
+ NMAccessPoint *ap;
+ GVariant *v;
+ gsize len;
+ gboolean b = FALSE;
+ const char *s;
+ gint16 i16;
+ guint16 u16;
- if (G_VALUE_HOLDS_BOXED (variant)) {
- GArray *array = g_value_get_boxed (variant);
+ g_return_val_if_fail (properties != NULL, NULL);
- if (!strcmp (key, "SSID")) {
- guint32 len = MIN (32, array->len);
+ ap = nm_ap_new ();
- /* Stupid ieee80211 layer uses <hidden> */
- if (((len == 8) || (len == 9))
- && (memcmp (array->data, "<hidden>", 8) == 0))
- return;
+ g_object_freeze_notify (G_OBJECT (ap));
- if (nm_utils_is_empty_ssid ((const guint8 *) array->data, len))
- return;
+ if (g_variant_lookup (properties, "Privacy", "b", &b) && b)
+ nm_ap_set_flags (ap, nm_ap_get_flags (ap) | NM_802_11_AP_FLAGS_PRIVACY);
- nm_ap_set_ssid (ap, (const guint8 *) array->data, len);
- } else if (!strcmp (key, "BSSID")) {
- char *addr;
+ if (g_variant_lookup (properties, "Mode", "&s", &s)) {
+ if (!g_strcmp0 (s, "infrastructure"))
+ nm_ap_set_mode (ap, NM_802_11_MODE_INFRA);
+ else if (!g_strcmp0 (s, "ad-hoc"))
+ nm_ap_set_mode (ap, NM_802_11_MODE_ADHOC);
+ }
- if (array->len != ETH_ALEN)
- return;
- addr = nm_utils_hwaddr_ntoa (array->data, array->len);
- nm_ap_set_address (ap, addr);
- g_free (addr);
- } else if (!strcmp (key, "Rates")) {
- guint32 maxrate = 0;
- int i;
-
- /* Find the max AP rate */
- for (i = 0; i < array->len; i++) {
- guint32 r = g_array_index (array, guint32, i);
-
- if (r > maxrate) {
- maxrate = r;
- nm_ap_set_max_bitrate (ap, r / 1000);
- }
- }
- } else if (!strcmp (key, "WPA")) {
- NM80211ApSecurityFlags flags = nm_ap_get_wpa_flags (ap);
+ if (g_variant_lookup (properties, "Signal", "n", &i16))
+ nm_ap_set_strength (ap, nm_ap_utils_level_to_quality (i16));
- flags |= security_from_dict (g_value_get_boxed (variant));
- nm_ap_set_wpa_flags (ap, flags);
- } else if (!strcmp (key, "RSN")) {
- NM80211ApSecurityFlags flags = nm_ap_get_rsn_flags (ap);
+ if (g_variant_lookup (properties, "Frequency", "q", &u16))
+ nm_ap_set_freq (ap, u16);
- flags |= security_from_dict (g_value_get_boxed (variant));
- nm_ap_set_rsn_flags (ap, flags);
- }
- } else if (G_VALUE_HOLDS_UINT (variant)) {
- guint32 val = g_value_get_uint (variant);
-
- if (!strcmp (key, "Frequency"))
- nm_ap_set_freq (ap, val);
- } else if (G_VALUE_HOLDS_INT (variant)) {
- gint val = g_value_get_int (variant);
-
- if (!strcmp (key, "Signal"))
- nm_ap_set_strength (ap, nm_ap_utils_level_to_quality (val));
- } else if (G_VALUE_HOLDS_STRING (variant)) {
- const char *val = g_value_get_string (variant);
-
- if (val && !strcmp (key, "Mode")) {
- if (strcmp (val, "infrastructure") == 0)
- nm_ap_set_mode (ap, NM_802_11_MODE_INFRA);
- else if (strcmp (val, "ad-hoc") == 0)
- nm_ap_set_mode (ap, NM_802_11_MODE_ADHOC);
+ v = g_variant_lookup_value (properties, "SSID", G_VARIANT_TYPE_BYTESTRING);
+ if (v) {
+ bytes = g_variant_get_fixed_array (v, &len, 1);
+ len = MIN (32, len);
+
+ /* Stupid ieee80211 layer uses <hidden> */
+ if ( bytes && len
+ && !(((len == 8) || (len == 9)) && !memcmp (bytes, "<hidden>", 8))
+ && !nm_utils_is_empty_ssid (bytes, len))
+ nm_ap_set_ssid (ap, bytes, len);
+
+ g_variant_unref (v);
+ }
+
+ v = g_variant_lookup_value (properties, "BSSID", G_VARIANT_TYPE_BYTESTRING);
+ if (v) {
+ bytes = g_variant_get_fixed_array (v, &len, 1);
+ if (len == ETH_ALEN) {
+ addr = nm_utils_hwaddr_ntoa (bytes, len);
+ nm_ap_set_address (ap, addr);
}
- } else if (G_VALUE_HOLDS_BOOLEAN (variant)) {
- gboolean val = g_value_get_boolean (variant);
+ g_variant_unref (v);
+ }
- if (strcmp (key, "Privacy") == 0) {
- if (val) {
- NM80211ApFlags flags = nm_ap_get_flags (ap);
- nm_ap_set_flags (ap, flags | NM_802_11_AP_FLAGS_PRIVACY);
+ v = g_variant_lookup_value (properties, "Rates", G_VARIANT_TYPE ("au"));
+ if (v) {
+ const guint32 *rates = g_variant_get_fixed_array (v, &len, sizeof (guint32));
+ guint32 maxrate = 0;
+ int i;
+
+ /* Find the max AP rate */
+ for (i = 0; i < len; i++) {
+ if (rates[i] > maxrate) {
+ maxrate = rates[i];
+ nm_ap_set_max_bitrate (ap, rates[i] / 1000);
}
}
+ g_variant_unref (v);
}
-}
-NMAccessPoint *
-nm_ap_new_from_properties (const char *supplicant_path, GHashTable *properties)
-{
- NMAccessPoint *ap;
- const char *addr;
- const char bad_bssid1[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
- const char bad_bssid2[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
-
- g_return_val_if_fail (properties != NULL, NULL);
-
- ap = nm_ap_new ();
+ v = g_variant_lookup_value (properties, "WPA", G_VARIANT_TYPE_VARDICT);
+ if (v) {
+ nm_ap_set_wpa_flags (ap, nm_ap_get_wpa_flags (ap) | security_from_vardict (v));
+ g_variant_unref (v);
+ }
- g_object_freeze_notify (G_OBJECT (ap));
- g_hash_table_foreach (properties, foreach_property_cb, ap);
+ v = g_variant_lookup_value (properties, "RSN", G_VARIANT_TYPE_VARDICT);
+ if (v) {
+ nm_ap_set_rsn_flags (ap, nm_ap_get_rsn_flags (ap) | security_from_vardict (v));
+ g_variant_unref (v);
+ }
nm_ap_set_supplicant_path (ap, supplicant_path);
@@ -725,7 +696,7 @@ nm_ap_dump (NMAccessPoint *ap, const char *prefix)
prefix,
priv->ssid ? nm_utils_escape_ssid (priv->ssid->data, priv->ssid->len) : "(none)",
ap);
- nm_log_dbg (LOGD_WIFI_SCAN, " BSSID %s", priv->address);
+ nm_log_dbg (LOGD_WIFI_SCAN, " BSSID %s", str_if_set (priv->address, "(none)"));
nm_log_dbg (LOGD_WIFI_SCAN, " mode %d", priv->mode);
nm_log_dbg (LOGD_WIFI_SCAN, " flags 0x%X", priv->flags);
nm_log_dbg (LOGD_WIFI_SCAN, " wpa flags 0x%X", priv->wpa_flags);
@@ -806,7 +777,7 @@ nm_ap_set_ssid (NMAccessPoint *ap, const guint8 *ssid, gsize len)
NM80211ApFlags
nm_ap_get_flags (NMAccessPoint *ap)
{
- g_return_val_if_fail (NM_IS_AP (ap), NM_802_11_AP_SEC_NONE);
+ g_return_val_if_fail (NM_IS_AP (ap), NM_802_11_AP_FLAGS_NONE);
return NM_AP_GET_PRIVATE (ap)->flags;
}
@@ -1129,7 +1100,7 @@ nm_ap_check_compatible (NMAccessPoint *self,
return FALSE;
bssid = nm_setting_wireless_get_bssid (s_wireless);
- if (bssid && !nm_utils_hwaddr_matches (bssid, -1, priv->address, -1))
+ if (bssid && (!priv->address || !nm_utils_hwaddr_matches (bssid, -1, priv->address, -1)))
return FALSE;
mode = nm_setting_wireless_get_mode (s_wireless);
diff --git a/src/devices/wifi/nm-wifi-ap.h b/src/devices/wifi/nm-wifi-ap.h
index 0abb28fccd..8ad9acb71b 100644
--- a/src/devices/wifi/nm-wifi-ap.h
+++ b/src/devices/wifi/nm-wifi-ap.h
@@ -56,7 +56,7 @@ typedef struct {
GType nm_ap_get_type (void);
NMAccessPoint * nm_ap_new_from_properties (const char *supplicant_path,
- GHashTable *properties);
+ GVariant *properties);
NMAccessPoint * nm_ap_new_fake_from_connection (NMConnection *connection);
void nm_ap_export_to_dbus (NMAccessPoint *ap);
diff --git a/src/devices/wifi/nm-wifi-factory.c b/src/devices/wifi/nm-wifi-factory.c
index bca588e6eb..4093c61239 100644
--- a/src/devices/wifi/nm-wifi-factory.c
+++ b/src/devices/wifi/nm-wifi-factory.c
@@ -18,6 +18,8 @@
* Copyright (C) 2011 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <gmodule.h>
#include "nm-device-factory.h"
diff --git a/src/devices/wifi/tests/Makefile.am b/src/devices/wifi/tests/Makefile.am
index 09c6401fef..2a7d784970 100644
--- a/src/devices/wifi/tests/Makefile.am
+++ b/src/devices/wifi/tests/Makefile.am
@@ -23,5 +23,6 @@ test_wifi_ap_utils_SOURCES = \
test_wifi_ap_utils_LDADD = $(top_builddir)/src/libNetworkManager.la
+@VALGRIND_RULES@
TESTS = test-wifi-ap-utils
diff --git a/src/devices/wifi/tests/test-wifi-ap-utils.c b/src/devices/wifi/tests/test-wifi-ap-utils.c
index 35920e932e..3c405e264f 100644
--- a/src/devices/wifi/tests/test-wifi-ap-utils.c
+++ b/src/devices/wifi/tests/test-wifi-ap-utils.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
@@ -783,6 +785,7 @@ test_priv_ap_leap_connection_1 (gconstpointer add_wifi)
COMPARE (src, expected, success, error, 0, 0);
g_object_unref (src);
+ g_object_unref (expected);
}
/*******************************************/
@@ -864,6 +867,7 @@ test_priv_ap_dynamic_wep_1 (void)
COMPARE (src, expected, success, error, 0, 0);
g_object_unref (src);
+ g_object_unref (expected);
}
/*******************************************/
@@ -911,6 +915,7 @@ test_priv_ap_dynamic_wep_2 (void)
COMPARE (src, expected, success, error, 0, 0);
g_object_unref (src);
+ g_object_unref (expected);
}
/*******************************************/
diff --git a/src/devices/wimax/iwmxsdk.c b/src/devices/wimax/iwmxsdk.c
index 2508088819..1c2c682145 100644
--- a/src/devices/wimax/iwmxsdk.c
+++ b/src/devices/wimax/iwmxsdk.c
@@ -19,9 +19,7 @@
*
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/devices/wimax/nm-device-wimax.c b/src/devices/wimax/nm-device-wimax.c
index 34c2d2a54d..0c8f1cbbe3 100644
--- a/src/devices/wimax/nm-device-wimax.c
+++ b/src/devices/wimax/nm-device-wimax.c
@@ -19,6 +19,8 @@
* Copyright (C) 2009 Novell, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -237,7 +239,7 @@ update_availability (NMDeviceWimax *self, gboolean old_available)
NMDeviceState state;
gboolean new_available, changed = FALSE;
- new_available = nm_device_is_available (device);
+ new_available = nm_device_is_available (device, NM_DEVICE_CHECK_DEV_AVAILABLE_NONE);
if (new_available == old_available)
return FALSE;
@@ -279,7 +281,7 @@ set_enabled (NMDevice *device, gboolean enabled)
if (priv->enabled == enabled)
return;
- old_available = nm_device_is_available (NM_DEVICE (device));
+ old_available = nm_device_is_available (NM_DEVICE (device), NM_DEVICE_CHECK_DEV_AVAILABLE_NONE);
priv->enabled = enabled;
nm_log_dbg (LOGD_WIMAX, "(%s): radio now %s",
@@ -332,12 +334,16 @@ check_connection_compatible (NMDevice *device, NMConnection *connection)
static gboolean
check_connection_available (NMDevice *device,
NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
const char *specific_object)
{
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (device);
const GSList *ns_iter = NULL;
NMWimaxNsp *nsp;
+ /* a connection that is available for a certain @specific_object, MUST
+ * also be available in general (without @specific_object). */
+
if (specific_object) {
nsp = get_nsp_by_path (NM_DEVICE_WIMAX (device), specific_object);
return nsp ? nm_wimax_nsp_check_compatible (nsp, connection) : FALSE;
@@ -482,30 +488,21 @@ can_auto_connect (NMDevice *device,
}
static gboolean
-is_available (NMDevice *device)
+is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
{
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (device);
- const char *iface = nm_device_get_iface (device);
- if (!priv->enabled) {
- nm_log_dbg (LOGD_WIMAX, "(%s): not available because not enabled", iface);
+ if (!priv->enabled)
return FALSE;
- }
- if (!priv->wimaxd_enabled) {
- nm_log_dbg (LOGD_WIMAX, "(%s): not available because not enabled in wimaxd", iface);
+ if (!priv->wimaxd_enabled)
return FALSE;
- }
- if (!nm_wimax_util_sdk_is_initialized ()) {
- nm_log_dbg (LOGD_WIMAX, "(%s): not available because WiMAX SDK not initialized", iface);
+ if (!nm_wimax_util_sdk_is_initialized ())
return FALSE;
- }
- if (!priv->sdk) {
- nm_log_dbg (LOGD_WIMAX, "(%s): not available because not known to WiMAX SDK", iface);
+ if (!priv->sdk)
return FALSE;
- }
return iwmxsdk_status_get (priv->sdk) >= WIMAX_API_DEVICE_STATUS_Ready;
}
@@ -710,7 +707,7 @@ wmx_state_change_cb (struct wmxsdk *wmxsdk,
return;
state = nm_device_get_state (NM_DEVICE (self));
- old_available = nm_device_is_available (NM_DEVICE (self));
+ old_available = nm_device_is_available (NM_DEVICE (self), NM_DEVICE_CHECK_DEV_AVAILABLE_NONE);
priv->status = new_status;
if (priv->current_nsp)
@@ -1151,7 +1148,7 @@ static gboolean
sdk_action_defer_cb (gpointer user_data)
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (user_data);
- gboolean old_available = nm_device_is_available (NM_DEVICE (self));
+ gboolean old_available = nm_device_is_available (NM_DEVICE (self), NM_DEVICE_CHECK_DEV_AVAILABLE_NONE);
NM_DEVICE_WIMAX_GET_PRIVATE (self)->sdk_action_defer_id = 0;
update_availability (self, old_available);
diff --git a/src/devices/wimax/nm-wimax-factory.c b/src/devices/wimax/nm-wimax-factory.c
index 9205919842..39e9a28738 100644
--- a/src/devices/wimax/nm-wimax-factory.c
+++ b/src/devices/wimax/nm-wimax-factory.c
@@ -18,6 +18,8 @@
* Copyright (C) 2011 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <gmodule.h>
#include "nm-device-factory.h"
diff --git a/src/devices/wimax/nm-wimax-nsp.c b/src/devices/wimax/nm-wimax-nsp.c
index aa4ca5fa03..f4db63f028 100644
--- a/src/devices/wimax/nm-wimax-nsp.c
+++ b/src/devices/wimax/nm-wimax-nsp.c
@@ -19,6 +19,8 @@
* Copyright (C) 2009 Novell, Inc.
*/
+#include "config.h"
+
#include "nm-wimax-nsp.h"
#include "nm-dbus-interface.h"
#include "nm-dbus-manager.h"
diff --git a/src/devices/wimax/nm-wimax-util.c b/src/devices/wimax/nm-wimax-util.c
index 3c90ebae96..0ae285aed1 100644
--- a/src/devices/wimax/nm-wimax-util.c
+++ b/src/devices/wimax/nm-wimax-util.c
@@ -18,6 +18,8 @@
* Copyright (C) 2009 Novell, Inc.
*/
+#include "config.h"
+
#include "nm-wimax-util.h"
#include "nm-utils.h"
#include "iwmxsdk.h"
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index 3eb570c465..f819d1d774 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -295,16 +295,19 @@ modem_state_cb (NMModem *modem,
* device's enabled/disabled state.
*/
nm_modem_set_mm_enabled (priv->modem, priv->rf_enabled);
+
+ /* Now allow connections without a PIN to be available */
+ nm_device_recheck_available_connections (device);
}
- if ((dev_state >= NM_DEVICE_STATE_DISCONNECTED) && !nm_device_is_available (device)) {
+ if ((dev_state >= NM_DEVICE_STATE_DISCONNECTED) && !nm_device_is_available (device, NM_DEVICE_CHECK_DEV_AVAILABLE_NONE)) {
nm_device_state_changed (device,
NM_DEVICE_STATE_UNAVAILABLE,
NM_DEVICE_STATE_REASON_MODEM_FAILED);
return;
}
- if ((dev_state == NM_DEVICE_STATE_UNAVAILABLE) && nm_device_is_available (device)) {
+ if ((dev_state == NM_DEVICE_STATE_UNAVAILABLE) && nm_device_is_available (device, NM_DEVICE_CHECK_DEV_AVAILABLE_NONE)) {
nm_device_state_changed (device,
NM_DEVICE_STATE_DISCONNECTED,
NM_DEVICE_STATE_REASON_MODEM_AVAILABLE);
@@ -373,6 +376,12 @@ device_state_changed (NMDevice *device,
}
}
+static guint32
+get_generic_capabilities (NMDevice *device)
+{
+ return NM_DEVICE_CAP_IS_NON_KERNEL;
+}
+
static gboolean
check_connection_compatible (NMDevice *device, NMConnection *connection)
{
@@ -385,6 +394,7 @@ check_connection_compatible (NMDevice *device, NMConnection *connection)
static gboolean
check_connection_available (NMDevice *device,
NMConnection *connection,
+ NMDeviceCheckConAvailableFlags flags,
const char *specific_object)
{
NMDeviceModem *self = NM_DEVICE_MODEM (device);
@@ -427,6 +437,50 @@ deactivate (NMDevice *device)
nm_modem_deactivate (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device);
}
+/***********************************************************/
+
+static gboolean
+deactivate_async_finish (NMDevice *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+}
+
+static void
+modem_deactivate_async_ready (NMModem *modem,
+ GAsyncResult *res,
+ GSimpleAsyncResult *simple)
+{
+ GError *error = NULL;
+
+ if (!nm_modem_deactivate_async_finish (modem, res, &error))
+ g_simple_async_result_take_error (simple, error);
+ g_simple_async_result_complete (simple);
+ g_object_unref (simple);
+}
+
+static void
+deactivate_async (NMDevice *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *simple;
+
+ simple = g_simple_async_result_new (G_OBJECT (self),
+ callback,
+ user_data,
+ deactivate_async);
+ nm_modem_deactivate_async (NM_DEVICE_MODEM_GET_PRIVATE (self)->modem,
+ self,
+ cancellable,
+ (GAsyncReadyCallback) modem_deactivate_async_ready,
+ simple);
+}
+
+/***********************************************************/
+
static NMActStageReturn
act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
{
@@ -530,24 +584,19 @@ set_enabled (NMDevice *device, gboolean enabled)
}
static gboolean
-is_available (NMDevice *device)
+is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
{
NMDeviceModem *self = NM_DEVICE_MODEM (device);
- NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device);
+ NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self);
NMModemState modem_state;
- if (!priv->rf_enabled) {
- _LOGD (LOGD_MB, "not available because WWAN airplane mode is on");
+ if (!priv->rf_enabled)
return FALSE;
- }
g_assert (priv->modem);
modem_state = nm_modem_get_state (priv->modem);
- if (modem_state <= NM_MODEM_STATE_INITIALIZING) {
- _LOGD (LOGD_MB, "not available because modem is not ready (%s)",
- nm_modem_state_to_string (modem_state));
+ if (modem_state <= NM_MODEM_STATE_INITIALIZING)
return FALSE;
- }
return TRUE;
}
@@ -632,7 +681,7 @@ set_modem (NMDeviceModem *self, NMModem *modem)
static void
set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
+ const GValue *value, GParamSpec *pspec)
{
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
@@ -655,7 +704,7 @@ set_property (GObject *object, guint prop_id,
static void
get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
+ GValue *value, GParamSpec *pspec)
{
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
@@ -701,9 +750,12 @@ nm_device_modem_class_init (NMDeviceModemClass *mclass)
object_class->set_property = set_property;
object_class->constructed = constructed;
+ device_class->get_generic_capabilities = get_generic_capabilities;
device_class->check_connection_compatible = check_connection_compatible;
device_class->check_connection_available = check_connection_available;
device_class->complete_connection = complete_connection;
+ device_class->deactivate_async = deactivate_async;
+ device_class->deactivate_async_finish = deactivate_async_finish;
device_class->deactivate = deactivate;
device_class->act_stage1_prepare = act_stage1_prepare;
device_class->act_stage2_config = act_stage2_config;
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index e896cbc10a..8129a64222 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -18,8 +18,11 @@
* Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org>
*/
+#include "config.h"
+
#include <glib/gi18n.h>
#include <string.h>
+#include <arpa/inet.h>
#include <libmm-glib.h>
#include "nm-modem-broadband.h"
@@ -39,7 +42,7 @@ struct _NMModemBroadbandPrivate {
MMModemSimple *simple_iface;
/* Connection setup */
- MMSimpleConnectProperties *connect_properties;
+
MMBearer *bearer;
MMBearerIpConfig *ipv4_config;
MMBearerIpConfig *ipv6_config;
@@ -173,78 +176,6 @@ get_bearer_ip_method (MMBearerIpConfig *config)
return NM_MODEM_IP_METHOD_UNKNOWN;
}
-static void
-connect_ready (MMModemSimple *simple_iface,
- GAsyncResult *res,
- NMModemBroadband *self)
-{
- GError *error = NULL;
- NMModemIPMethod ip4_method = NM_MODEM_IP_METHOD_UNKNOWN;
- NMModemIPMethod ip6_method = NM_MODEM_IP_METHOD_UNKNOWN;
-
- g_clear_object (&self->priv->connect_properties);
-
- self->priv->bearer = mm_modem_simple_connect_finish (simple_iface, res, &error);
- if (!self->priv->bearer) {
- if (g_error_matches (error,
- MM_MOBILE_EQUIPMENT_ERROR,
- MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN) ||
- (g_error_matches (error,
- MM_CORE_ERROR,
- MM_CORE_ERROR_UNAUTHORIZED) &&
- mm_modem_get_unlock_required (self->priv->modem_iface) == MM_MODEM_LOCK_SIM_PIN)) {
- /* Request PIN */
- ask_for_pin (self);
- } else {
- /* Strip remote error info before logging it */
- if (g_dbus_error_is_remote_error (error))
- g_dbus_error_strip_remote_error (error);
-
- nm_log_warn (LOGD_MB, "(%s) failed to connect modem: %s",
- nm_modem_get_uid (NM_MODEM (self)),
- error && error->message ? error->message : "(unknown)");
- g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, translate_mm_error (error));
- }
-
- g_clear_error (&error);
- g_object_unref (self);
- return;
- }
-
- /* Grab IP configurations */
- self->priv->ipv4_config = mm_bearer_get_ipv4_config (self->priv->bearer);
- if (self->priv->ipv4_config)
- ip4_method = get_bearer_ip_method (self->priv->ipv4_config);
-
- self->priv->ipv6_config = mm_bearer_get_ipv6_config (self->priv->bearer);
- if (self->priv->ipv6_config)
- ip6_method = get_bearer_ip_method (self->priv->ipv6_config);
-
- if (ip4_method == NM_MODEM_IP_METHOD_UNKNOWN &&
- ip6_method == NM_MODEM_IP_METHOD_UNKNOWN) {
- nm_log_warn (LOGD_MB, "(%s) failed to connect modem: invalid bearer IP configuration",
- nm_modem_get_uid (NM_MODEM (self)));
-
- error = g_error_new_literal (NM_DEVICE_ERROR,
- NM_DEVICE_ERROR_INVALID_CONNECTION,
- "invalid bearer IP configuration");
- g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, error);
- g_error_free (error);
- g_object_unref (self);
- return;
- }
-
- g_object_set (self,
- NM_MODEM_DATA_PORT, mm_bearer_get_interface (self->priv->bearer),
- NM_MODEM_IP4_METHOD, ip4_method,
- NM_MODEM_IP6_METHOD, ip6_method,
- NM_MODEM_IP_TIMEOUT, mm_bearer_get_ip_timeout (self->priv->bearer),
- NULL);
-
- g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE);
- g_object_unref (self);
-}
-
static MMSimpleConnectProperties *
create_cdma_connect_properties (NMConnection *connection)
{
@@ -263,15 +194,12 @@ create_cdma_connect_properties (NMConnection *connection)
}
static MMSimpleConnectProperties *
-create_gsm_connect_properties (NMModem *modem,
- NMConnection *connection,
- GError **error)
+create_gsm_connect_properties (NMConnection *connection)
{
NMSettingGsm *setting;
NMSettingPpp *s_ppp;
MMSimpleConnectProperties *properties;
const gchar *str;
- NMModemIPType ip_type;
setting = nm_connection_get_setting_gsm (connection);
properties = mm_simple_connect_properties_new ();
@@ -326,23 +254,137 @@ create_gsm_connect_properties (NMModem *modem,
mm_simple_connect_properties_set_allowed_auth (properties, allowed_auth);
}
- /* Determine IP types to use when connecting */
- ip_type = nm_modem_get_connection_ip_type (modem, connection, error);
- if (ip_type == NM_MODEM_IP_TYPE_UNKNOWN) {
- g_object_unref (properties);
- return NULL;
+ return properties;
+}
+
+typedef struct {
+ NMModemBroadband *self;
+ MMModemCapability caps;
+ MMSimpleConnectProperties *connect_properties;
+ GArray *ip_types;
+ guint ip_types_i;
+ GError *first_error;
+} ActStageContext;
+
+static void
+act_stage_context_free (ActStageContext *ctx)
+{
+ g_clear_error (&ctx->first_error);
+ g_clear_pointer (&ctx->ip_types, (GDestroyNotify) g_array_unref);
+ g_clear_object (&ctx->connect_properties);
+ g_object_unref (ctx->self);
+ g_slice_free (ActStageContext, ctx);
+}
+
+static void act_stage_context_step (ActStageContext *ctx);
+
+static void
+connect_ready (MMModemSimple *simple_iface,
+ GAsyncResult *res,
+ ActStageContext *ctx)
+{
+ GError *error = NULL;
+ NMModemIPMethod ip4_method = NM_MODEM_IP_METHOD_UNKNOWN;
+ NMModemIPMethod ip6_method = NM_MODEM_IP_METHOD_UNKNOWN;
+
+ ctx->self->priv->bearer = mm_modem_simple_connect_finish (simple_iface, res, &error);
+ if (!ctx->self->priv->bearer) {
+ if (g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN) ||
+ (g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_UNAUTHORIZED) &&
+ mm_modem_get_unlock_required (ctx->self->priv->modem_iface) == MM_MODEM_LOCK_SIM_PIN)) {
+ /* Request PIN */
+ ask_for_pin (ctx->self);
+ g_error_free (error);
+ act_stage_context_free (ctx);
+ return;
+ }
+
+ /* Save the error, if it's the first one */
+ if (!ctx->first_error) {
+ /* Strip remote error info before saving it */
+ if (g_dbus_error_is_remote_error (error))
+ g_dbus_error_strip_remote_error (error);
+ ctx->first_error = error;
+ } else
+ g_error_free (error);
+
+ /* If the modem/provider lies and the IP type we tried isn't supported,
+ * retry with the next one, if any.
+ */
+ ctx->ip_types_i++;
+ act_stage_context_step (ctx);
+ return;
}
- if (ip_type == NM_MODEM_IP_TYPE_IPV4)
- mm_simple_connect_properties_set_ip_type (properties, MM_BEARER_IP_FAMILY_IPV4);
- else if (ip_type == NM_MODEM_IP_TYPE_IPV6)
- mm_simple_connect_properties_set_ip_type (properties, MM_BEARER_IP_FAMILY_IPV6);
- else if (ip_type == NM_MODEM_IP_TYPE_IPV4V6)
- mm_simple_connect_properties_set_ip_type (properties, MM_BEARER_IP_FAMILY_IPV4V6);
- else
- g_assert_not_reached ();
+ /* Grab IP configurations */
+ ctx->self->priv->ipv4_config = mm_bearer_get_ipv4_config (ctx->self->priv->bearer);
+ if (ctx->self->priv->ipv4_config)
+ ip4_method = get_bearer_ip_method (ctx->self->priv->ipv4_config);
- return properties;
+ ctx->self->priv->ipv6_config = mm_bearer_get_ipv6_config (ctx->self->priv->bearer);
+ if (ctx->self->priv->ipv6_config)
+ ip6_method = get_bearer_ip_method (ctx->self->priv->ipv6_config);
+
+ if (ip4_method == NM_MODEM_IP_METHOD_UNKNOWN &&
+ ip6_method == NM_MODEM_IP_METHOD_UNKNOWN) {
+ nm_log_warn (LOGD_MB, "(%s): failed to connect modem: invalid bearer IP configuration",
+ nm_modem_get_uid (NM_MODEM (ctx->self)));
+ g_signal_emit_by_name (ctx->self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_CONFIG_FAILED);
+ act_stage_context_free (ctx);
+ return;
+ }
+
+ g_object_set (ctx->self,
+ NM_MODEM_DATA_PORT, mm_bearer_get_interface (ctx->self->priv->bearer),
+ NM_MODEM_IP4_METHOD, ip4_method,
+ NM_MODEM_IP6_METHOD, ip6_method,
+ NM_MODEM_IP_TIMEOUT, mm_bearer_get_ip_timeout (ctx->self->priv->bearer),
+ NULL);
+
+ g_signal_emit_by_name (ctx->self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE);
+ act_stage_context_free (ctx);
+}
+
+static void
+act_stage_context_step (ActStageContext *ctx)
+{
+ if (ctx->ip_types_i < ctx->ip_types->len) {
+ NMModemIPType current;
+
+ current = g_array_index (ctx->ip_types, NMModemIPType, ctx->ip_types_i);
+
+ if (current == NM_MODEM_IP_TYPE_IPV4)
+ mm_simple_connect_properties_set_ip_type (ctx->connect_properties, MM_BEARER_IP_FAMILY_IPV4);
+ else if (current == NM_MODEM_IP_TYPE_IPV6)
+ mm_simple_connect_properties_set_ip_type (ctx->connect_properties, MM_BEARER_IP_FAMILY_IPV6);
+ else if (current == NM_MODEM_IP_TYPE_IPV4V6)
+ mm_simple_connect_properties_set_ip_type (ctx->connect_properties, MM_BEARER_IP_FAMILY_IPV4V6);
+ else
+ g_assert_not_reached ();
+
+ nm_log_dbg (LOGD_MB, "(%s): launching connection with ip type '%s'",
+ nm_modem_get_uid (NM_MODEM (ctx->self)),
+ nm_modem_ip_type_to_string (current));
+
+ mm_modem_simple_connect (ctx->self->priv->simple_iface,
+ ctx->connect_properties,
+ NULL,
+ (GAsyncReadyCallback)connect_ready,
+ ctx);
+ return;
+ }
+
+ /* If we have a saved error from a previous attempt, use it */
+ if (!ctx->first_error)
+ ctx->first_error = g_error_new_literal (NM_DEVICE_ERROR,
+ NM_DEVICE_ERROR_INVALID_CONNECTION,
+ "invalid bearer IP configuration");
+
+ nm_log_warn (LOGD_MB, "(%s): failed to connect modem: %s",
+ nm_modem_get_uid (NM_MODEM (ctx->self)),
+ ctx->first_error->message);
+ g_signal_emit_by_name (ctx->self, NM_MODEM_PREPARE_RESULT, FALSE, translate_mm_error (ctx->first_error));
+ act_stage_context_free (ctx);
}
static NMActStageReturn
@@ -351,42 +393,55 @@ act_stage1_prepare (NMModem *_self,
NMDeviceStateReason *reason)
{
NMModemBroadband *self = NM_MODEM_BROADBAND (_self);
- MMModemCapability caps;
+ ActStageContext *ctx;
GError *error = NULL;
- g_clear_object (&self->priv->connect_properties);
+ /* Make sure we can get the Simple interface from the modem */
+ if (!self->priv->simple_iface) {
+ self->priv->simple_iface = mm_object_get_modem_simple (self->priv->modem_object);
+ if (!self->priv->simple_iface) {
+ nm_log_warn (LOGD_MB, "(%s) cannot access the Simple mobile broadband modem interface",
+ nm_modem_get_uid (NM_MODEM (self)));
+ *reason = NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED;
+ return NM_ACT_STAGE_RETURN_FAILURE;
+ }
+ }
+
+ /* Allocate new context for this activation stage attempt */
+ ctx = g_slice_new0 (ActStageContext);
+ ctx->self = NM_MODEM_BROADBAND (g_object_ref (self));
+ ctx->caps = mm_modem_get_current_capabilities (self->priv->modem_iface);
- caps = mm_modem_get_current_capabilities (self->priv->modem_iface);
- if (MODEM_CAPS_3GPP (caps))
- self->priv->connect_properties = create_gsm_connect_properties (_self, connection, &error);
- else if (MODEM_CAPS_3GPP2 (caps))
- self->priv->connect_properties = create_cdma_connect_properties (connection);
+ /* Create core connect properties based on the modem capabilities */
+ if (MODEM_CAPS_3GPP (ctx->caps))
+ ctx->connect_properties = create_gsm_connect_properties (connection);
+ else if (MODEM_CAPS_3GPP2 (ctx->caps))
+ ctx->connect_properties = create_cdma_connect_properties (connection);
else {
- nm_log_warn (LOGD_MB, "(%s) not a mobile broadband modem",
- nm_modem_get_uid (NM_MODEM (self)));
+ nm_log_warn (LOGD_MB, "(%s): Failed to connect '%s': not a mobile broadband modem",
+ nm_modem_get_uid (NM_MODEM (self)),
+ nm_connection_get_id (connection));
+ act_stage_context_free (ctx);
*reason = NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED;
return NM_ACT_STAGE_RETURN_FAILURE;
}
+ g_assert (ctx->connect_properties);
- if (error) {
+ /* Checkout list of IP types that we need to use in the retries */
+ ctx->ip_types = nm_modem_get_connection_ip_type (NM_MODEM (self), connection, &error);
+ if (!ctx->ip_types) {
nm_log_warn (LOGD_MB, "(%s): Failed to connect '%s': %s",
nm_modem_get_uid (NM_MODEM (self)),
nm_connection_get_id (connection),
- error->message);
+ error ? error->message : "unknown error");
g_clear_error (&error);
+ act_stage_context_free (ctx);
*reason = NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED;
return NM_ACT_STAGE_RETURN_FAILURE;
}
- if (!self->priv->simple_iface)
- self->priv->simple_iface = mm_object_get_modem_simple (self->priv->modem_object);
-
g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (self->priv->simple_iface), MODEM_CONNECT_TIMEOUT_SECS * 1000);
- mm_modem_simple_connect (self->priv->simple_iface,
- self->priv->connect_properties,
- NULL,
- (GAsyncReadyCallback)connect_ready,
- g_object_ref (self));
+ act_stage_context_step (ctx);
return NM_ACT_STAGE_RETURN_POSTPONE;
}
@@ -563,9 +618,9 @@ set_power_state_low_ready (MMModem *modem,
if (!mm_modem_set_power_state_finish (modem, result, &error)) {
/* Log but ignore errors; not all modems support low power state */
- nm_log_dbg (LOGD_MB, "(%s) failed to set modem low power state: %s",
- nm_modem_get_uid (NM_MODEM (self)),
- error && error->message ? error->message : "(unknown)");
+ nm_log_dbg (LOGD_MB, "(%s): failed to set modem low power state: %s",
+ nm_modem_get_uid (NM_MODEM (self)),
+ error && error->message ? error->message : "(unknown)");
g_clear_error (&error);
}
@@ -588,7 +643,7 @@ modem_disable_ready (MMModem *modem_iface,
(GAsyncReadyCallback) set_power_state_low_ready,
g_object_ref (self));
} else {
- nm_log_warn (LOGD_MB, "(%s) failed to disable modem: %s",
+ nm_log_warn (LOGD_MB, "(%s): failed to disable modem: %s",
nm_modem_get_uid (NM_MODEM (self)),
error && error->message ? error->message : "(unknown)");
nm_modem_set_prev_state (NM_MODEM (self), "disable failed");
@@ -660,6 +715,7 @@ static_stage3_ip4_done (NMModemBroadband *self)
{
GError *error = NULL;
NMIP4Config *config = NULL;
+ const char *data_port;
const gchar *address_string;
const gchar *gw_string;
guint32 address_network;
@@ -669,6 +725,7 @@ static_stage3_ip4_done (NMModemBroadband *self)
guint i;
g_assert (self->priv->ipv4_config);
+ g_assert (self->priv->bearer);
nm_log_info (LOGD_MB, "(%s): IPv4 static configuration:",
nm_modem_get_uid (NM_MODEM (self)));
@@ -688,7 +745,9 @@ static_stage3_ip4_done (NMModemBroadband *self)
gw_string = mm_bearer_ip_config_get_gateway (self->priv->ipv4_config);
ip4_string_to_num (gw_string, &gw);
- config = nm_ip4_config_new ();
+ data_port = mm_bearer_get_interface (self->priv->bearer);
+ g_assert (data_port);
+ config = nm_ip4_config_new (nm_platform_link_get_ifindex (data_port));
memset (&address, 0, sizeof (address));
address.address = address_network;
@@ -705,7 +764,7 @@ static_stage3_ip4_done (NMModemBroadband *self)
/* DNS servers */
dns = mm_bearer_ip_config_get_dns (self->priv->ipv4_config);
- for (i = 0; dns[i]; i++) {
+ for (i = 0; dns && dns[i]; i++) {
if ( ip4_string_to_num (dns[i], &address_network)
&& address_network > 0) {
nm_ip4_config_add_nameserver (config, address_network);
@@ -741,6 +800,7 @@ stage3_ip6_done (NMModemBroadband *self)
{
GError *error = NULL;
NMIP6Config *config = NULL;
+ const char *data_port;
const gchar *address_string;
NMPlatformIP6Address address;
NMModemIPMethod ip_method;
@@ -758,9 +818,9 @@ stage3_ip6_done (NMModemBroadband *self)
/* DHCP/SLAAC is allowed to skip addresses; other methods require it */
if (ip_method != NM_MODEM_IP_METHOD_AUTO) {
error = g_error_new (NM_DEVICE_ERROR,
- NM_DEVICE_ERROR_INVALID_CONNECTION,
- "(%s) retrieving IPv6 configuration failed: no address given",
- nm_modem_get_uid (NM_MODEM (self)));
+ NM_DEVICE_ERROR_INVALID_CONNECTION,
+ "(%s) retrieving IPv6 configuration failed: no address given",
+ nm_modem_get_uid (NM_MODEM (self)));
}
goto out;
}
@@ -778,7 +838,9 @@ stage3_ip6_done (NMModemBroadband *self)
nm_log_info (LOGD_MB, "(%s): IPv6 base configuration:",
nm_modem_get_uid (NM_MODEM (self)));
- config = nm_ip6_config_new ();
+ data_port = mm_bearer_get_interface (self->priv->bearer);
+ g_assert (data_port);
+ config = nm_ip6_config_new (nm_platform_link_get_ifindex (data_port));
address.plen = mm_bearer_ip_config_get_prefix (self->priv->ipv6_config);
nm_ip6_config_add_address (config, &address);
@@ -789,10 +851,10 @@ stage3_ip6_done (NMModemBroadband *self)
if (address_string) {
if (!inet_pton (AF_INET6, address_string, (void *) &(address.address))) {
error = g_error_new (NM_DEVICE_ERROR,
- NM_DEVICE_ERROR_INVALID_CONNECTION,
- "(%s) retrieving IPv6 configuration failed: invalid gateway given '%s'",
- nm_modem_get_uid (NM_MODEM (self)),
- address_string);
+ NM_DEVICE_ERROR_INVALID_CONNECTION,
+ "(%s) retrieving IPv6 configuration failed: invalid gateway given '%s'",
+ nm_modem_get_uid (NM_MODEM (self)),
+ address_string);
goto out;
}
nm_log_info (LOGD_MB, " gateway %s", address_string);
@@ -841,54 +903,97 @@ stage3_ip6_config_request (NMModem *_self, NMDeviceStateReason *reason)
typedef struct {
NMModemBroadband *self;
+ GSimpleAsyncResult *result;
+ GCancellable *cancellable;
gboolean warn;
-} SimpleDisconnectContext;
+} DisconnectContext;
static void
-simple_disconnect_context_free (SimpleDisconnectContext *ctx)
+disconnect_context_complete (DisconnectContext *ctx)
{
+ g_simple_async_result_complete_in_idle (ctx->result);
+ if (ctx->cancellable)
+ g_object_unref (ctx->cancellable);
+ g_object_unref (ctx->result);
g_object_unref (ctx->self);
- g_slice_free (SimpleDisconnectContext, ctx);
+ g_slice_free (DisconnectContext, ctx);
+}
+
+static gboolean
+disconnect_context_complete_if_cancelled (DisconnectContext *ctx)
+{
+ GError *error = NULL;
+
+ if (g_cancellable_set_error_if_cancelled (ctx->cancellable, &error)) {
+ g_simple_async_result_take_error (ctx->result, error);
+ disconnect_context_complete (ctx);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gboolean
+disconnect_finish (NMModem *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
}
static void
simple_disconnect_ready (MMModemSimple *modem_iface,
GAsyncResult *res,
- SimpleDisconnectContext *ctx)
+ DisconnectContext *ctx)
{
GError *error = NULL;
if (!mm_modem_simple_disconnect_finish (modem_iface, res, &error)) {
- if (ctx->warn)
+ if (ctx->warn && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)) {
nm_log_warn (LOGD_MB, "(%s) failed to disconnect modem: %s",
nm_modem_get_uid (NM_MODEM (ctx->self)),
- error && error->message ? error->message : "(unknown)");
- g_clear_error (&error);
+ error->message);
+ }
+ g_simple_async_result_take_error (ctx->result, error);
}
- simple_disconnect_context_free (ctx);
+ disconnect_context_complete (ctx);
}
static void
-disconnect (NMModem *modem,
- gboolean warn)
+disconnect (NMModem *self,
+ gboolean warn,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
- NMModemBroadband *self = NM_MODEM_BROADBAND (modem);
- SimpleDisconnectContext *ctx;
-
- if (!self->priv->simple_iface)
- return;
+ DisconnectContext *ctx;
- ctx = g_slice_new (SimpleDisconnectContext);
+ ctx = g_slice_new (DisconnectContext);
ctx->self = g_object_ref (self);
-
+ ctx->result = g_simple_async_result_new (G_OBJECT (self),
+ callback,
+ user_data,
+ disconnect);
/* Don't bother warning on FAILED since the modem is already gone */
ctx->warn = warn;
+ /* Setup cancellable */
+ ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
+ if (disconnect_context_complete_if_cancelled (ctx))
+ return;
+
+ /* If no simple iface, we're done */
+ if (!ctx->self->priv->simple_iface) {
+ disconnect_context_complete (ctx);
+ return;
+ }
+
+ nm_log_dbg (LOGD_MB, "(%s): notifying ModemManager about the modem disconnection",
+ nm_modem_get_uid (NM_MODEM (ctx->self)));
mm_modem_simple_disconnect (
ctx->self->priv->simple_iface,
NULL, /* bearer path; if NULL given ALL get disconnected */
- NULL, /* cancellable */
+ cancellable,
(GAsyncReadyCallback)simple_disconnect_ready,
ctx);
}
@@ -896,7 +1001,7 @@ disconnect (NMModem *modem,
/*****************************************************************************/
static void
-deactivate (NMModem *_self, NMDevice *device)
+deactivate_cleanup (NMModem *_self, NMDevice *device)
{
NMModemBroadband *self = NM_MODEM_BROADBAND (_self);
@@ -910,7 +1015,7 @@ deactivate (NMModem *_self, NMDevice *device)
self->priv->pin_tries = 0;
/* Chain up parent's */
- NM_MODEM_CLASS (nm_modem_broadband_parent_class)->deactivate (_self, device);
+ NM_MODEM_CLASS (nm_modem_broadband_parent_class)->deactivate_cleanup (_self, device);
}
/*****************************************************************************/
@@ -1024,7 +1129,7 @@ get_sim_ready (MMModem *modem,
NULL);
g_object_unref (new_sim);
} else {
- nm_log_warn (LOGD_MB, "(%s) failed to retrieve SIM object: %s",
+ nm_log_warn (LOGD_MB, "(%s): failed to retrieve SIM object: %s",
nm_modem_get_uid (NM_MODEM (self)),
error && error->message ? error->message : "(unknown)");
}
@@ -1059,7 +1164,7 @@ nm_modem_broadband_init (NMModemBroadband *self)
static void
set_property (GObject *object,
guint prop_id,
- const GValue *value,
+ const GValue *value,
GParamSpec *pspec)
{
NMModemBroadband *self = NM_MODEM_BROADBAND (object);
@@ -1092,7 +1197,7 @@ set_property (GObject *object,
static void
get_property (GObject *object,
guint prop_id,
- GValue *value,
+ GValue *value,
GParamSpec *pspec)
{
NMModemBroadband *self = NM_MODEM_BROADBAND (object);
@@ -1139,7 +1244,8 @@ nm_modem_broadband_class_init (NMModemBroadbandClass *klass)
modem_class->static_stage3_ip4_config_start = static_stage3_ip4_config_start;
modem_class->stage3_ip6_config_request = stage3_ip6_config_request;
modem_class->disconnect = disconnect;
- modem_class->deactivate = deactivate;
+ modem_class->disconnect_finish = disconnect_finish;
+ modem_class->deactivate_cleanup = deactivate_cleanup;
modem_class->set_mm_enabled = set_mm_enabled;
modem_class->get_user_pass = get_user_pass;
modem_class->check_connection_compatible = check_connection_compatible;
diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c
index 431dc05c0b..bbb229d930 100644
--- a/src/devices/wwan/nm-modem.c
+++ b/src/devices/wwan/nm-modem.c
@@ -19,6 +19,8 @@
* Copyright (C) 2009 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include "nm-modem.h"
#include "nm-platform.h"
@@ -30,6 +32,7 @@
#include "nm-device-private.h"
#include "nm-dbus-glib-types.h"
#include "nm-modem-enum-types.h"
+#include "nm-route-manager.h"
G_DEFINE_TYPE (NMModem, nm_modem, G_TYPE_OBJECT)
@@ -173,23 +176,23 @@ nm_modem_set_mm_enabled (NMModem *self,
NMModemState prev_state = priv->state;
if (enabled && priv->state >= NM_MODEM_STATE_ENABLING) {
- nm_log_dbg (LOGD_MB, "(%s) cannot enable modem: already enabled",
+ nm_log_dbg (LOGD_MB, "(%s): cannot enable modem: already enabled",
nm_modem_get_uid (self));
return;
}
if (!enabled && priv->state <= NM_MODEM_STATE_DISABLING) {
- nm_log_dbg (LOGD_MB, "(%s) cannot disable modem: already disabled",
+ nm_log_dbg (LOGD_MB, "(%s): cannot disable modem: already disabled",
nm_modem_get_uid (self));
return;
}
if (priv->state <= NM_MODEM_STATE_INITIALIZING) {
- nm_log_dbg (LOGD_MB, "(%s) cannot enable/disable modem: initializing or failed",
+ nm_log_dbg (LOGD_MB, "(%s): cannot enable/disable modem: initializing or failed",
nm_modem_get_uid (self));
return;
} else if (priv->state == NM_MODEM_STATE_LOCKED) {
/* Don't try to enable if the modem is locked since that will fail */
- nm_log_warn (LOGD_MB, "(%s) cannot enable/disable modem: locked",
+ nm_log_warn (LOGD_MB, "(%s): cannot enable/disable modem: locked",
nm_modem_get_uid (self));
/* Try to unlock the modem if it's being enabled */
@@ -219,42 +222,63 @@ nm_modem_get_supported_ip_types (NMModem *self)
return NM_MODEM_GET_PRIVATE (self)->ip_types;
}
+const gchar *
+nm_modem_ip_type_to_string (NMModemIPType ip_type)
+{
+ switch (ip_type) {
+ case NM_MODEM_IP_TYPE_IPV4:
+ return "ipv4";
+ case NM_MODEM_IP_TYPE_IPV6:
+ return "ipv6";
+ case NM_MODEM_IP_TYPE_IPV4V6:
+ return "ipv4v6";
+ default:
+ g_return_val_if_reached ("unknown");
+ }
+}
+
+static GArray *
+build_single_ip_type_array (NMModemIPType type)
+{
+ return g_array_append_val (g_array_sized_new (FALSE, FALSE, sizeof (NMModemIPType), 1), type);
+}
+
/**
* nm_modem_get_connection_ip_type:
* @self: the #NMModem
* @connection: the #NMConnection to determine IP type to use
*
- * Given a modem and a connection, determine which NMModemIpType to use
+ * Given a modem and a connection, determine which #NMModemIPTypes to use
* when connecting.
*
- * Returns: a single %NMModemIpType value
+ * Returns: an array of #NMModemIpType values, in the order in which they
+ * should be tried.
*/
-NMModemIPType
+GArray *
nm_modem_get_connection_ip_type (NMModem *self,
NMConnection *connection,
GError **error)
{
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self);
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4, *s_ip6;
const char *method;
gboolean ip4 = TRUE, ip6 = TRUE;
gboolean ip4_may_fail = TRUE, ip6_may_fail = TRUE;
s_ip4 = nm_connection_get_setting_ip4_config (connection);
if (s_ip4) {
- method = nm_setting_ip4_config_get_method (s_ip4);
+ method = nm_setting_ip_config_get_method (s_ip4);
if (g_strcmp0 (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0)
ip4 = FALSE;
- ip4_may_fail = nm_setting_ip4_config_get_may_fail (s_ip4);
+ ip4_may_fail = nm_setting_ip_config_get_may_fail (s_ip4);
}
s_ip6 = nm_connection_get_setting_ip6_config (connection);
if (s_ip6) {
- method = nm_setting_ip6_config_get_method (s_ip6);
+ method = nm_setting_ip_config_get_method (s_ip6);
if (g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0)
ip6 = FALSE;
- ip6_may_fail = nm_setting_ip6_config_get_may_fail (s_ip6);
+ ip6_may_fail = nm_setting_ip_config_get_may_fail (s_ip6);
}
if (ip4 && !ip6) {
@@ -264,9 +288,9 @@ nm_modem_get_connection_ip_type (NMModem *self,
NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
"Connection requested IPv4 but IPv4 is "
"unsuported by the modem.");
- return NM_MODEM_IP_TYPE_UNKNOWN;
+ return NULL;
}
- return NM_MODEM_IP_TYPE_IPV4;
+ return build_single_ip_type_array (NM_MODEM_IP_TYPE_IPV4);
}
if (ip6 && !ip4) {
@@ -276,38 +300,54 @@ nm_modem_get_connection_ip_type (NMModem *self,
NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
"Connection requested IPv6 but IPv6 is "
"unsuported by the modem.");
- return NM_MODEM_IP_TYPE_UNKNOWN;
+ return NULL;
}
- return NM_MODEM_IP_TYPE_IPV6;
+ return build_single_ip_type_array (NM_MODEM_IP_TYPE_IPV6);
}
if (ip4 && ip6) {
- /* Modem supports dual-stack */
- if (priv->ip_types & NM_MODEM_IP_TYPE_IPV4V6)
- return NM_MODEM_IP_TYPE_IPV4V6;
+ NMModemIPType type;
+ GArray *out;
- /* Both IPv4 and IPv6 requested, but modem doesn't support dual-stack;
- * if one method is marked "may-fail" then use the other.
- */
- if (ip6_may_fail)
- return NM_MODEM_IP_TYPE_IPV4;
- else if (ip4_may_fail)
- return NM_MODEM_IP_TYPE_IPV6;
+ out = g_array_sized_new (FALSE, FALSE, sizeof (NMModemIPType), 3);
+
+ /* Modem supports dual-stack? */
+ if (priv->ip_types & NM_MODEM_IP_TYPE_IPV4V6) {
+ type = NM_MODEM_IP_TYPE_IPV4V6;
+ g_array_append_val (out, type);
+ }
+
+ /* If IPv6 may-fail=false, we should NOT try IPv4 as fallback */
+ if ((priv->ip_types & NM_MODEM_IP_TYPE_IPV4) && ip6_may_fail) {
+ type = NM_MODEM_IP_TYPE_IPV4;
+ g_array_append_val (out, type);
+ }
+ /* If IPv4 may-fail=false, we should NOT try IPv6 as fallback */
+ if ((priv->ip_types & NM_MODEM_IP_TYPE_IPV6) && ip4_may_fail) {
+ type = NM_MODEM_IP_TYPE_IPV6;
+ g_array_append_val (out, type);
+ }
+
+ if (out->len > 0)
+ return out;
+
+ /* Error... */
+ g_array_unref (out);
g_set_error_literal (error,
NM_DEVICE_ERROR,
NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
"Connection requested both IPv4 and IPv6 "
"but dual-stack addressing is unsupported "
"by the modem.");
- return NM_MODEM_IP_TYPE_UNKNOWN;
+ return NULL;
}
g_set_error_literal (error,
NM_DEVICE_ERROR,
NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
"Connection specified no IP configuration!");
- return NM_MODEM_IP_TYPE_UNKNOWN;
+ return NULL;
}
/*****************************************************************************/
@@ -342,9 +382,9 @@ set_data_port (NMModem *self, const char *new_data_port)
static void
ppp_ip4_config (NMPPPManager *ppp_manager,
- const char *iface,
- NMIP4Config *config,
- gpointer user_data)
+ const char *iface,
+ NMIP4Config *config,
+ gpointer user_data)
{
NMModem *self = NM_MODEM (user_data);
guint32 i, num;
@@ -415,9 +455,9 @@ ppp_ip6_config (NMPPPManager *ppp_manager,
static void
ppp_stats (NMPPPManager *ppp_manager,
- guint32 in_bytes,
- guint32 out_bytes,
- gpointer user_data)
+ guint32 in_bytes,
+ guint32 out_bytes,
+ gpointer user_data)
{
NMModem *self = NM_MODEM (user_data);
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self);
@@ -463,7 +503,8 @@ ppp_stage3_ip_config_start (NMModem *self,
/* Check if ModemManager requested a specific IP timeout to be used. If 0 reported,
* use the default one (30s) */
if (priv->mm_ip_timeout > 0) {
- nm_log_info (LOGD_PPP, "using modem-specified IP timeout: %u seconds",
+ nm_log_info (LOGD_PPP, "(%s): using modem-specified IP timeout: %u seconds",
+ nm_modem_get_uid (self),
priv->mm_ip_timeout);
ip_timeout = priv->mm_ip_timeout;
}
@@ -485,7 +526,8 @@ ppp_stage3_ip_config_start (NMModem *self,
ret = NM_ACT_STAGE_RETURN_POSTPONE;
} else {
- nm_log_err (LOGD_PPP, "error starting PPP: (%d) %s",
+ nm_log_err (LOGD_PPP, "(%s): error starting PPP: (%d) %s",
+ nm_modem_get_uid (self),
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
g_error_free (error);
@@ -704,7 +746,7 @@ modem_secrets_cb (NMActRequest *req,
priv->secrets_id = 0;
if (error)
- nm_log_warn (LOGD_MB, "%s", error->message);
+ nm_log_warn (LOGD_MB, "(%s): %s", nm_modem_get_uid (self), error->message);
g_signal_emit (self, signals[AUTH_RESULT], 0, error);
}
@@ -838,13 +880,12 @@ nm_modem_complete_connection (NMModem *self,
/*****************************************************************************/
static void
-deactivate (NMModem *self, NMDevice *device)
+deactivate_cleanup (NMModem *self, NMDevice *device)
{
NMModemPrivate *priv;
int ifindex;
g_return_if_fail (NM_IS_MODEM (self));
- g_return_if_fail (NM_IS_DEVICE (device));
priv = NM_MODEM_GET_PRIVATE (self);
@@ -863,15 +904,19 @@ deactivate (NMModem *self, NMDevice *device)
priv->ppp_manager = NULL;
}
- if (priv->ip4_method == NM_MODEM_IP_METHOD_STATIC ||
- priv->ip4_method == NM_MODEM_IP_METHOD_AUTO ||
- priv->ip6_method == NM_MODEM_IP_METHOD_STATIC ||
- priv->ip6_method == NM_MODEM_IP_METHOD_AUTO) {
- ifindex = nm_device_get_ip_ifindex (device);
- if (ifindex > 0) {
- nm_platform_route_flush (ifindex);
- nm_platform_address_flush (ifindex);
- nm_platform_link_set_down (ifindex);
+ if (device) {
+ g_return_if_fail (NM_IS_DEVICE (device));
+
+ if (priv->ip4_method == NM_MODEM_IP_METHOD_STATIC ||
+ priv->ip4_method == NM_MODEM_IP_METHOD_AUTO ||
+ priv->ip6_method == NM_MODEM_IP_METHOD_STATIC ||
+ priv->ip6_method == NM_MODEM_IP_METHOD_AUTO) {
+ ifindex = nm_device_get_ip_ifindex (device);
+ if (ifindex > 0) {
+ nm_route_manager_route_flush (nm_route_manager_get (), ifindex);
+ nm_platform_address_flush (ifindex);
+ nm_platform_link_set_down (ifindex);
+ }
}
}
priv->ip4_method = NM_MODEM_IP_METHOD_UNKNOWN;
@@ -883,10 +928,176 @@ deactivate (NMModem *self, NMDevice *device)
/*****************************************************************************/
+typedef enum {
+ DEACTIVATE_CONTEXT_STEP_FIRST,
+ DEACTIVATE_CONTEXT_STEP_CLEANUP,
+ DEACTIVATE_CONTEXT_STEP_PPP_MANAGER_STOP,
+ DEACTIVATE_CONTEXT_STEP_MM_DISCONNECT,
+ DEACTIVATE_CONTEXT_STEP_LAST
+} DeactivateContextStep;
+
+typedef struct {
+ NMModem *self;
+ NMDevice *device;
+ GCancellable *cancellable;
+ GSimpleAsyncResult *result;
+ DeactivateContextStep step;
+ NMPPPManager *ppp_manager;
+} DeactivateContext;
+
+static void
+deactivate_context_complete (DeactivateContext *ctx)
+{
+ if (ctx->ppp_manager)
+ g_object_unref (ctx->ppp_manager);
+ if (ctx->cancellable)
+ g_object_unref (ctx->cancellable);
+ g_simple_async_result_complete_in_idle (ctx->result);
+ g_object_unref (ctx->result);
+ g_object_unref (ctx->device);
+ g_object_unref (ctx->self);
+ g_slice_free (DeactivateContext, ctx);
+}
+
+gboolean
+nm_modem_deactivate_async_finish (NMModem *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+}
+
+static void deactivate_step (DeactivateContext *ctx);
+
+static void
+disconnect_ready (NMModem *self,
+ GAsyncResult *res,
+ DeactivateContext *ctx)
+{
+ GError *error = NULL;
+
+ if (!NM_MODEM_GET_CLASS (self)->disconnect_finish (self, res, &error)) {
+ g_simple_async_result_take_error (ctx->result, error);
+ deactivate_context_complete (ctx);
+ return;
+ }
+
+ /* Go on */
+ ctx->step++;
+ deactivate_step (ctx);
+}
+
+static void
+ppp_manager_stop_ready (NMPPPManager *ppp_manager,
+ GAsyncResult *res,
+ DeactivateContext *ctx)
+{
+ GError *error = NULL;
+
+ if (!nm_ppp_manager_stop_finish (ppp_manager, res, &error)) {
+ nm_log_warn (LOGD_MB, "(%s): cannot stop PPP manager: %s",
+ nm_modem_get_uid (ctx->self),
+ error->message);
+ g_simple_async_result_take_error (ctx->result, error);
+ deactivate_context_complete (ctx);
+ return;
+ }
+
+ /* Go on */
+ ctx->step++;
+ deactivate_step (ctx);
+}
+
+static void
+deactivate_step (DeactivateContext *ctx)
+{
+ NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (ctx->self);
+ GError *error = NULL;
+
+ /* Check cancellable in each step */
+ if (g_cancellable_set_error_if_cancelled (ctx->cancellable, &error)) {
+ g_simple_async_result_take_error (ctx->result, error);
+ deactivate_context_complete (ctx);
+ return;
+ }
+
+ switch (ctx->step) {
+ case DEACTIVATE_CONTEXT_STEP_FIRST:
+ ctx->step++;
+ /* Fall down */
+
+ case DEACTIVATE_CONTEXT_STEP_CLEANUP:
+ /* Make sure we keep a ref to the PPP manager if there is one */
+ if (priv->ppp_manager)
+ ctx->ppp_manager = g_object_ref (priv->ppp_manager);
+ /* Run cleanup */
+ NM_MODEM_GET_CLASS (ctx->self)->deactivate_cleanup (ctx->self, ctx->device);
+ ctx->step++;
+ /* Fall down */
+
+ case DEACTIVATE_CONTEXT_STEP_PPP_MANAGER_STOP:
+ /* If we have a PPP manager, stop it */
+ if (ctx->ppp_manager) {
+ nm_ppp_manager_stop (ctx->ppp_manager,
+ ctx->cancellable,
+ (GAsyncReadyCallback) ppp_manager_stop_ready,
+ ctx);
+ return;
+ }
+ ctx->step++;
+ /* Fall down */
+
+ case DEACTIVATE_CONTEXT_STEP_MM_DISCONNECT:
+ /* Disconnect asynchronously */
+ NM_MODEM_GET_CLASS (ctx->self)->disconnect (ctx->self,
+ FALSE,
+ ctx->cancellable,
+ (GAsyncReadyCallback) disconnect_ready,
+ ctx);
+ return;
+
+ case DEACTIVATE_CONTEXT_STEP_LAST:
+ nm_log_dbg (LOGD_MB, "(%s): modem deactivation finished",
+ nm_modem_get_uid (ctx->self));
+ deactivate_context_complete (ctx);
+ return;
+ }
+
+ g_assert_not_reached ();
+}
+
+void
+nm_modem_deactivate_async (NMModem *self,
+ NMDevice *device,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ DeactivateContext *ctx;
+
+ ctx = g_slice_new0 (DeactivateContext);
+ ctx->self = g_object_ref (self);
+ ctx->device = g_object_ref (device);
+ ctx->result = g_simple_async_result_new (G_OBJECT (self),
+ callback,
+ user_data,
+ nm_modem_deactivate_async);
+ ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
+
+ /* Start */
+ ctx->step = DEACTIVATE_CONTEXT_STEP_FIRST;
+ deactivate_step (ctx);
+}
+
+/*****************************************************************************/
+
void
nm_modem_deactivate (NMModem *self, NMDevice *device)
{
- NM_MODEM_GET_CLASS (self)->deactivate (self, device);
+ /* First cleanup */
+ NM_MODEM_GET_CLASS (self)->deactivate_cleanup (self, device);
+ /* Then disconnect without waiting */
+ NM_MODEM_GET_CLASS (self)->disconnect (self, FALSE, NULL, NULL, NULL);
}
/*****************************************************************************/
@@ -911,7 +1122,6 @@ nm_modem_device_state_changed (NMModem *self,
switch (new_state) {
case NM_DEVICE_STATE_UNMANAGED:
case NM_DEVICE_STATE_UNAVAILABLE:
- case NM_DEVICE_STATE_DISCONNECTED:
case NM_DEVICE_STATE_FAILED:
if (priv->act_request) {
cancel_get_secrets (self);
@@ -923,7 +1133,9 @@ nm_modem_device_state_changed (NMModem *self,
/* Don't bother warning on FAILED since the modem is already gone */
if (new_state == NM_DEVICE_STATE_FAILED)
warn = FALSE;
- NM_MODEM_GET_CLASS (self)->disconnect (self, warn);
+ /* First cleanup */
+ NM_MODEM_GET_CLASS (self)->deactivate_cleanup (self, NULL);
+ NM_MODEM_GET_CLASS (self)->disconnect (self, warn, NULL, NULL, NULL);
}
break;
default:
@@ -1029,8 +1241,8 @@ nm_modem_init (NMModem *self)
static GObject*
constructor (GType type,
- guint n_construct_params,
- GObjectConstructParam *construct_params)
+ guint n_construct_params,
+ GObjectConstructParam *construct_params)
{
GObject *object;
NMModemPrivate *priv;
@@ -1055,7 +1267,7 @@ constructor (GType type,
return object;
- err:
+err:
g_object_unref (object);
return NULL;
}
@@ -1208,7 +1420,7 @@ nm_modem_class_init (NMModemClass *klass)
klass->act_stage1_prepare = act_stage1_prepare;
klass->stage3_ip6_config_request = stage3_ip6_config_request;
- klass->deactivate = deactivate;
+ klass->deactivate_cleanup = deactivate_cleanup;
/* Properties */
diff --git a/src/devices/wwan/nm-modem.h b/src/devices/wwan/nm-modem.h
index 2a4d917332..2cace8902d 100644
--- a/src/devices/wwan/nm-modem.h
+++ b/src/devices/wwan/nm-modem.h
@@ -143,9 +143,16 @@ typedef struct {
void (*set_mm_enabled) (NMModem *self, gboolean enabled);
- void (*disconnect) (NMModem *self, gboolean warn);
+ void (*disconnect) (NMModem *self,
+ gboolean warn,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*disconnect_finish) (NMModem *self,
+ GAsyncResult *res,
+ GError **error);
- void (*deactivate) (NMModem *self, NMDevice *device);
+ void (*deactivate_cleanup) (NMModem *self, NMDevice *device);
gboolean (*owns_port) (NMModem *self, const char *iface);
@@ -218,6 +225,15 @@ gboolean nm_modem_get_secrets (NMModem *modem,
void nm_modem_deactivate (NMModem *modem, NMDevice *device);
+void nm_modem_deactivate_async (NMModem *self,
+ NMDevice *device,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean nm_modem_deactivate_async_finish (NMModem *self,
+ GAsyncResult *res,
+ GError **error);
+
void nm_modem_device_state_changed (NMModem *modem,
NMDeviceState new_state,
NMDeviceState old_state,
@@ -237,7 +253,7 @@ NMModemIPType nm_modem_get_supported_ip_types (NMModem *self);
/* For the modem-manager only */
void nm_modem_emit_removed (NMModem *self);
-NMModemIPType nm_modem_get_connection_ip_type (NMModem *self,
+GArray *nm_modem_get_connection_ip_type (NMModem *self,
NMConnection *connection,
GError **error);
@@ -246,6 +262,8 @@ void nm_modem_emit_ip6_config_result (NMModem *self,
NMIP6Config *config,
GError *error);
+const gchar *nm_modem_ip_type_to_string (NMModemIPType ip_type);
+
G_END_DECLS
#endif /* __NETWORKMANAGER_MODEM_H__ */
diff --git a/src/devices/wwan/nm-wwan-factory.c b/src/devices/wwan/nm-wwan-factory.c
index a2f3d3576a..2b9c3d4dd0 100644
--- a/src/devices/wwan/nm-wwan-factory.c
+++ b/src/devices/wwan/nm-wwan-factory.c
@@ -18,10 +18,11 @@
* Copyright (C) 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gmodule.h>
-#include "config.h"
#include "nm-device-factory.h"
#include "nm-wwan-factory.h"
#include "nm-modem-manager.h"
diff --git a/src/devices/wwan/wwan-exports.ver b/src/devices/wwan/wwan-exports.ver
index c23ab24b79..23412de627 100644
--- a/src/devices/wwan/wwan-exports.ver
+++ b/src/devices/wwan/wwan-exports.ver
@@ -5,6 +5,8 @@ global:
nm_modem_check_connection_compatible;
nm_modem_complete_connection;
nm_modem_deactivate;
+ nm_modem_deactivate_async;
+ nm_modem_deactivate_async_finish;
nm_modem_device_state_changed;
nm_modem_get_capabilities;
nm_modem_get_control_port;
diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c
index 085f7f3655..48b9fe650c 100644
--- a/src/dhcp-manager/nm-dhcp-client.c
+++ b/src/dhcp-manager/nm-dhcp-client.c
@@ -17,7 +17,8 @@
*
*/
-#include <config.h>
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <sys/types.h>
@@ -42,9 +43,11 @@ typedef struct {
GByteArray * hwaddr;
gboolean ipv6;
char * uuid;
- guint priority;
+ guint32 priority;
guint32 timeout;
GByteArray * duid;
+ GBytes * client_id;
+ char * hostname;
NMDhcpState state;
pid_t pid;
@@ -143,12 +146,44 @@ nm_dhcp_client_get_priority (NMDhcpClient *self)
return NM_DHCP_CLIENT_GET_PRIVATE (self)->priority;
}
+GBytes *
+nm_dhcp_client_get_client_id (NMDhcpClient *self)
+{
+ g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
+
+ return NM_DHCP_CLIENT_GET_PRIVATE (self)->client_id;
+}
+
+void
+nm_dhcp_client_set_client_id (NMDhcpClient *self, GBytes *client_id)
+{
+ NMDhcpClientPrivate *priv;
+
+ g_return_if_fail (NM_IS_DHCP_CLIENT (self));
+
+ priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
+
+ if (priv->client_id && client_id && g_bytes_equal (priv->client_id, client_id))
+ return;
+ g_clear_pointer (&priv->client_id, g_bytes_unref);
+ priv->client_id = client_id ? g_bytes_ref (client_id) : NULL;
+}
+
+const char *
+nm_dhcp_client_get_hostname (NMDhcpClient *self)
+{
+ g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
+
+ return NM_DHCP_CLIENT_GET_PRIVATE (self)->hostname;
+}
+
/********************************************/
static const char *state_table[NM_DHCP_STATE_MAX + 1] = {
[NM_DHCP_STATE_UNKNOWN] = "unknown",
[NM_DHCP_STATE_BOUND] = "bound",
[NM_DHCP_STATE_TIMEOUT] = "timeout",
+ [NM_DHCP_STATE_EXPIRE] = "expire",
[NM_DHCP_STATE_DONE] = "done",
[NM_DHCP_STATE_FAIL] = "fail",
};
@@ -174,13 +209,14 @@ reason_to_state (const char *iface, const char *reason)
return NM_DHCP_STATE_BOUND;
else if (g_ascii_strcasecmp (reason, "timeout") == 0)
return NM_DHCP_STATE_TIMEOUT;
+ else if (g_ascii_strcasecmp (reason, "nak") == 0 ||
+ g_ascii_strcasecmp (reason, "expire") == 0 ||
+ g_ascii_strcasecmp (reason, "expire6") == 0)
+ return NM_DHCP_STATE_EXPIRE;
else if (g_ascii_strcasecmp (reason, "end") == 0)
return NM_DHCP_STATE_DONE;
else if (g_ascii_strcasecmp (reason, "fail") == 0 ||
- g_ascii_strcasecmp (reason, "abend") == 0 ||
- g_ascii_strcasecmp (reason, "nak") == 0 ||
- g_ascii_strcasecmp (reason, "expire") == 0 ||
- g_ascii_strcasecmp (reason, "expire6") == 0)
+ g_ascii_strcasecmp (reason, "abend") == 0)
return NM_DHCP_STATE_FAIL;
nm_log_dbg (LOGD_DHCP, "(%s): unmapped DHCP state '%s'", iface, reason);
@@ -360,7 +396,8 @@ gboolean
nm_dhcp_client_start_ip4 (NMDhcpClient *self,
const char *dhcp_client_id,
const char *dhcp_anycast_addr,
- const char *hostname)
+ const char *hostname,
+ const char *last_ip4_address)
{
NMDhcpClientPrivate *priv;
@@ -374,7 +411,12 @@ nm_dhcp_client_start_ip4 (NMDhcpClient *self,
nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv4 transaction (timeout in %d seconds)",
priv->iface, priv->timeout);
- return NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, dhcp_client_id, dhcp_anycast_addr, hostname);
+ nm_dhcp_client_set_client_id (self, dhcp_client_id ? nm_dhcp_utils_client_id_string_to_bytes (dhcp_client_id) : NULL);
+
+ g_clear_pointer (&priv->hostname, g_free);
+ priv->hostname = g_strdup (hostname);
+
+ return NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, dhcp_anycast_addr, last_ip4_address);
}
/* uuid_parse does not work for machine-id, so we use our own converter */
@@ -518,6 +560,9 @@ nm_dhcp_client_start_ip6 (NMDhcpClient *self,
g_free (str);
}
+ g_clear_pointer (&priv->hostname, g_free);
+ priv->hostname = g_strdup (hostname);
+
priv->info_only = info_only;
nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv6 transaction (timeout in %d seconds)",
@@ -525,7 +570,6 @@ nm_dhcp_client_start_ip6 (NMDhcpClient *self,
return NM_DHCP_CLIENT_GET_CLASS (self)->ip6_start (self,
dhcp_anycast_addr,
- hostname,
info_only,
privacy,
priv->duid);
@@ -673,10 +717,13 @@ copy_option (const char * key,
g_hash_table_insert (hash, g_strdup (key), str_value);
}
-void
-nm_dhcp_client_new_options (NMDhcpClient *self,
- GHashTable *options,
- const char *reason)
+gboolean
+nm_dhcp_client_handle_event (gpointer unused,
+ const char *iface,
+ gint pid,
+ GHashTable *options,
+ const char *reason,
+ NMDhcpClient *self)
{
NMDhcpClientPrivate *priv;
guint32 old_state;
@@ -684,13 +731,23 @@ nm_dhcp_client_new_options (NMDhcpClient *self,
GHashTable *str_options = NULL;
GObject *ip_config = NULL;
- g_return_if_fail (NM_IS_DHCP_CLIENT (self));
- g_return_if_fail (options != NULL);
- g_return_if_fail (reason != NULL);
+ g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE);
+ g_return_val_if_fail (iface != NULL, FALSE);
+ g_return_val_if_fail (pid > 0, FALSE);
+ g_return_val_if_fail (options != NULL, FALSE);
+ g_return_val_if_fail (reason != NULL, FALSE);
priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
+
+ if (g_strcmp0 (priv->iface, iface) != 0)
+ return FALSE;
+ if (priv->pid != pid)
+ return FALSE;
+
old_state = priv->state;
new_state = reason_to_state (priv->iface, reason);
+ nm_log_dbg (LOGD_DHCP, "(%s): DHCP reason '%s' -> state '%s'",
+ iface, reason, state_to_string (new_state));
if (new_state == NM_DHCP_STATE_BOUND) {
/* Copy options */
@@ -701,16 +758,24 @@ nm_dhcp_client_new_options (NMDhcpClient *self,
g_warn_if_fail (g_hash_table_size (str_options));
if (g_hash_table_size (str_options)) {
if (priv->ipv6) {
- ip_config = (GObject *) nm_dhcp_utils_ip6_config_from_options (priv->iface,
+ ip_config = (GObject *) nm_dhcp_utils_ip6_config_from_options (priv->ifindex,
+ priv->iface,
str_options,
priv->priority,
priv->info_only);
} else {
- ip_config = (GObject *) nm_dhcp_utils_ip4_config_from_options (priv->iface,
+ ip_config = (GObject *) nm_dhcp_utils_ip4_config_from_options (priv->ifindex,
+ priv->iface,
str_options,
priv->priority);
}
- g_warn_if_fail (ip_config != NULL);
+
+ /* Fail if no valid IP config was received */
+ if (ip_config == NULL) {
+ nm_log_warn (LOGD_DHCP, "(%s): DHCP client bound but IP config not received", iface);
+ new_state = NM_DHCP_STATE_FAIL;
+ g_clear_pointer (&str_options, g_hash_table_unref);
+ }
}
}
@@ -719,6 +784,8 @@ nm_dhcp_client_new_options (NMDhcpClient *self,
if (str_options)
g_hash_table_destroy (str_options);
g_clear_object (&ip_config);
+
+ return TRUE;
}
/********************************************/
@@ -819,6 +886,8 @@ dispose (GObject *object)
timeout_cleanup (self);
g_clear_pointer (&priv->iface, g_free);
+ g_clear_pointer (&priv->hostname, g_free);
+ g_clear_pointer (&priv->uuid, g_free);
if (priv->hwaddr) {
g_byte_array_free (priv->hwaddr, TRUE);
@@ -885,7 +954,7 @@ nm_dhcp_client_class_init (NMDhcpClientClass *client_class)
g_object_class_install_property
(object_class, PROP_PRIORITY,
g_param_spec_uint (NM_DHCP_CLIENT_PRIORITY, "", "",
- 0, G_MAXUINT, 0,
+ 0, G_MAXUINT32, 0,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h
index 89fe821db5..0cbd2001bb 100644
--- a/src/dhcp-manager/nm-dhcp-client.h
+++ b/src/dhcp-manager/nm-dhcp-client.h
@@ -46,10 +46,11 @@
typedef enum {
NM_DHCP_STATE_UNKNOWN = 0,
- NM_DHCP_STATE_BOUND, /* lease changed (state_is_bound) */
- NM_DHCP_STATE_TIMEOUT, /* TIMEOUT */
- NM_DHCP_STATE_DONE, /* END */
- NM_DHCP_STATE_FAIL, /* failed or quit unexpectedly */
+ NM_DHCP_STATE_BOUND, /* new lease or lease changed */
+ NM_DHCP_STATE_TIMEOUT, /* timed out contacting server */
+ NM_DHCP_STATE_DONE, /* client quit or stopped */
+ NM_DHCP_STATE_EXPIRE, /* lease expired or NAKed */
+ NM_DHCP_STATE_FAIL, /* failed for some reason */
__NM_DHCP_STATE_MAX,
NM_DHCP_STATE_MAX = __NM_DHCP_STATE_MAX - 1,
} NMDhcpState;
@@ -64,13 +65,11 @@ typedef struct {
/* Methods */
gboolean (*ip4_start) (NMDhcpClient *self,
- const char *dhcp_client_id,
const char *anycast_addr,
- const char *hostname);
+ const char *last_ip4_address);
gboolean (*ip6_start) (NMDhcpClient *self,
const char *anycast_addr,
- const char *hostname,
gboolean info_only,
NMSettingIP6ConfigPrivacy privacy,
const GByteArray *duid);
@@ -99,6 +98,19 @@ typedef struct {
GType nm_dhcp_client_get_type (void);
+typedef const char *(*NMDhcpClientGetPathFunc) (void);
+
+typedef GSList * (*NMDhcpClientGetLeaseConfigsFunc) (const char *iface,
+ int ifindex,
+ const char *uuid,
+ gboolean ipv6,
+ guint32 default_route_metric);
+
+void _nm_dhcp_client_register (GType gtype,
+ const char *name,
+ NMDhcpClientGetPathFunc get_path_func,
+ NMDhcpClientGetLeaseConfigsFunc get_lease_configs_func);
+
pid_t nm_dhcp_client_get_pid (NMDhcpClient *self);
const char *nm_dhcp_client_get_iface (NMDhcpClient *self);
@@ -115,10 +127,15 @@ const GByteArray *nm_dhcp_client_get_hw_addr (NMDhcpClient *self);
guint32 nm_dhcp_client_get_priority (NMDhcpClient *self);
+GBytes *nm_dhcp_client_get_client_id (NMDhcpClient *self);
+
+const char *nm_dhcp_client_get_hostname (NMDhcpClient *self);
+
gboolean nm_dhcp_client_start_ip4 (NMDhcpClient *self,
const char *dhcp_client_id,
const char *dhcp_anycast_addr,
- const char *hostname);
+ const char *hostname,
+ const char *last_ip4_address);
gboolean nm_dhcp_client_start_ip6 (NMDhcpClient *self,
const char *dhcp_anycast_addr,
@@ -128,10 +145,6 @@ gboolean nm_dhcp_client_start_ip6 (NMDhcpClient *self,
void nm_dhcp_client_stop (NMDhcpClient *self, gboolean release);
-void nm_dhcp_client_new_options (NMDhcpClient *self,
- GHashTable *options,
- const char *reason);
-
/* Backend helpers for subclasses */
void nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name);
@@ -144,5 +157,14 @@ void nm_dhcp_client_set_state (NMDhcpClient *self,
GObject *ip_config, /* NMIP4Config or NMIP6Config */
GHashTable *options); /* str:str hash */
+gboolean nm_dhcp_client_handle_event (gpointer unused,
+ const char *iface,
+ gint pid,
+ GHashTable *options,
+ const char *reason,
+ NMDhcpClient *self);
+
+void nm_dhcp_client_set_client_id (NMDhcpClient *self, GBytes *client_id);
+
#endif /* __NETWORKMANAGER_DHCP_CLIENT_H__ */
diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.c b/src/dhcp-manager/nm-dhcp-dhclient-utils.c
index 2469076719..213d33a6a5 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient-utils.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.c
@@ -17,28 +17,30 @@
* Copyright (C) 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include <string.h>
#include <ctype.h>
+#include <arpa/inet.h>
#include "nm-dhcp-dhclient-utils.h"
+#include "nm-dhcp-utils.h"
#include "nm-ip4-config.h"
#include "nm-utils.h"
#include "nm-platform.h"
#include "NetworkManagerUtils.h"
+#include "gsystem-local-alloc.h"
+#include "nm-utils-internal.h"
#define CLIENTID_TAG "send dhcp-client-identifier"
-#define CLIENTID_FORMAT CLIENTID_TAG " \"%s\"; # added by NetworkManager"
-#define CLIENTID_FORMAT_OCTETS CLIENTID_TAG " %s; # added by NetworkManager"
#define HOSTNAME4_TAG "send host-name"
#define HOSTNAME4_FORMAT HOSTNAME4_TAG " \"%s\"; # added by NetworkManager"
-#define HOSTNAME6_TAG "send fqdn.fqdn"
-#define HOSTNAME6_FORMAT HOSTNAME6_TAG " \"%s\"; # added by NetworkManager"
+#define FQDN_TAG "send fqdn.fqdn"
+#define FQDN_FORMAT FQDN_TAG " \"%s\"; # added by NetworkManager"
#define ALSOREQ_TAG "also request "
@@ -55,7 +57,7 @@ add_also_request (GPtrArray *array, const char *item)
}
static void
-add_hostname (GString *str, const char *format, const char *hostname)
+add_hostname4 (GString *str, const char *format, const char *hostname)
{
char *plain_hostname, *dot;
@@ -72,43 +74,42 @@ add_hostname (GString *str, const char *format, const char *hostname)
}
static void
-add_ip4_config (GString *str, const char *dhcp_client_id, const char *hostname)
+add_ip4_config (GString *str, GBytes *client_id, const char *hostname)
{
- if (dhcp_client_id && *dhcp_client_id) {
- gboolean is_octets = TRUE;
- int i = 0;
+ if (client_id) {
+ const char *p;
+ gsize l;
+ guint i;
- while (dhcp_client_id[i]) {
- if (!g_ascii_isxdigit (dhcp_client_id[i])) {
- is_octets = FALSE;
- break;
- }
- i++;
- if (!dhcp_client_id[i])
- break;
- if (g_ascii_isxdigit (dhcp_client_id[i])) {
- i++;
- if (!dhcp_client_id[i])
- break;
- }
- if (dhcp_client_id[i] != ':') {
- is_octets = FALSE;
+ p = g_bytes_get_data (client_id, &l);
+ g_assert (p);
+
+ /* Allow type 0 (non-hardware address) to be represented as a string
+ * as long as all the characters are printable.
+ */
+ for (i = 1; (p[0] == 0) && i < l; i++) {
+ if (!g_ascii_isprint (p[i]))
break;
- }
- i++;
}
- /* If the client ID is just hex digits and : then don't use quotes,
- * because dhclient expects either a quoted ASCII string, or a byte
- * array formated as hex octets separated by :
- */
- if (is_octets)
- g_string_append_printf (str, CLIENTID_FORMAT_OCTETS "\n", dhcp_client_id);
- else
- g_string_append_printf (str, CLIENTID_FORMAT "\n", dhcp_client_id);
+ g_string_append (str, CLIENTID_TAG " ");
+ if (i < l) {
+ /* Unprintable; convert to a hex string */
+ for (i = 0; i < l; i++) {
+ if (i > 0)
+ g_string_append_c (str, ':');
+ g_string_append_printf (str, "%02x", (guint8) p[i]);
+ }
+ } else {
+ /* Printable; just add to the line minus the 'type' */
+ g_string_append_c (str, '"');
+ g_string_append_len (str, p + 1, l - 1);
+ g_string_append_c (str, '"');
+ }
+ g_string_append (str, "; # added by NetworkManager\n");
}
- add_hostname (str, HOSTNAME4_FORMAT "\n", hostname);
+ add_hostname4 (str, HOSTNAME4_FORMAT "\n", hostname);
g_string_append_c (str, '\n');
@@ -124,23 +125,81 @@ add_ip4_config (GString *str, const char *dhcp_client_id, const char *hostname)
}
static void
-add_ip6_config (GString *str, const char *hostname)
+add_hostname6 (GString *str, const char *hostname)
{
- add_hostname (str, HOSTNAME6_FORMAT "\n", hostname);
- g_string_append (str,
- "send fqdn.encoded on;\n"
- "send fqdn.no-client-update on;\n"
- "send fqdn.server-update on;\n");
+ /* dhclient only supports the fqdn.fqdn for DHCPv6 and requires a fully-
+ * qualified name for this option, so we must require one here too.
+ */
+ if (hostname && strchr (hostname, '.')) {
+ g_string_append_printf (str, FQDN_FORMAT "\n", hostname);
+ g_string_append (str,
+ "send fqdn.encoded on;\n"
+ "send fqdn.server-update on;\n");
+ g_string_append_c (str, '\n');
+ }
+}
+
+static GBytes *
+read_client_id (const char *str)
+{
+ gs_free char *s = NULL;
+ char *p;
+
+ g_assert (!strncmp (str, CLIENTID_TAG, STRLEN (CLIENTID_TAG)));
+
+ str += STRLEN (CLIENTID_TAG);
+ while (g_ascii_isspace (*str))
+ str++;
+
+ if (*str == '"') {
+ s = g_strdup (str + 1);
+ p = strrchr (s, '"');
+ if (p)
+ *p = '\0';
+ else
+ return NULL;
+ } else
+ s = g_strdup (str);
+
+ g_strchomp (s);
+ if (s[strlen (s) - 1] == ';')
+ s[strlen (s) - 1] = '\0';
+
+ return nm_dhcp_utils_client_id_string_to_bytes (s);
+}
+
+GBytes *
+nm_dhcp_dhclient_get_client_id_from_config_file (const char *path)
+{
+ gs_free char *contents = NULL;
+ gs_strfreev char **lines = NULL;
+ char **line;
+
+ g_return_val_if_fail (path != NULL, NULL);
+
+ if (!g_file_test (path, G_FILE_TEST_EXISTS))
+ return NULL;
+
+ if (!g_file_get_contents (path, &contents, NULL, NULL))
+ return NULL;
+
+ lines = g_strsplit_set (contents, "\n\r", 0);
+ for (line = lines; lines && *line; line++) {
+ if (!strncmp (*line, CLIENTID_TAG, STRLEN (CLIENTID_TAG)))
+ return read_client_id (*line);
+ }
+ return NULL;
}
char *
nm_dhcp_dhclient_create_config (const char *interface,
gboolean is_ip6,
- const char *dhcp_client_id,
+ GBytes *client_id,
const char *anycast_addr,
const char *hostname,
const char *orig_path,
- const char *orig_contents)
+ const char *orig_contents,
+ GBytes **out_new_client_id)
{
GString *new_contents;
GPtrArray *alsoreq;
@@ -164,17 +223,21 @@ nm_dhcp_dhclient_create_config (const char *interface,
if (!strlen (g_strstrip (p)))
continue;
- /* Override config file "dhcp-client-id" and use one from the
- * connection.
- */
- if (dhcp_client_id && !strncmp (p, CLIENTID_TAG, strlen (CLIENTID_TAG)))
- continue;
+ if (!strncmp (p, CLIENTID_TAG, strlen (CLIENTID_TAG))) {
+ /* Override config file "dhcp-client-id" and use one from the connection */
+ if (client_id)
+ continue;
+
+ /* Otherwise capture and return the existing client id */
+ if (out_new_client_id)
+ *out_new_client_id = read_client_id (p);
+ }
/* Override config file hostname and use one from the connection */
if (hostname) {
if (strncmp (p, HOSTNAME4_TAG, strlen (HOSTNAME4_TAG)) == 0)
continue;
- if (strncmp (p, HOSTNAME6_TAG, strlen (HOSTNAME6_TAG)) == 0)
+ if (strncmp (p, FQDN_TAG, strlen (FQDN_TAG)) == 0)
continue;
}
@@ -232,12 +295,12 @@ nm_dhcp_dhclient_create_config (const char *interface,
g_string_append_c (new_contents, '\n');
if (is_ip6) {
- add_ip6_config (new_contents, hostname);
+ add_hostname6 (new_contents, hostname);
add_also_request (alsoreq, "dhcp6.name-servers");
add_also_request (alsoreq, "dhcp6.domain-search");
add_also_request (alsoreq, "dhcp6.client-id");
} else {
- add_ip4_config (new_contents, dhcp_client_id, hostname);
+ add_ip4_config (new_contents, client_id, hostname);
add_also_request (alsoreq, "rfc3442-classless-static-routes");
add_also_request (alsoreq, "ms-classless-static-routes");
add_also_request (alsoreq, "static-routes");
@@ -513,6 +576,7 @@ lease_validity_span (const char *str_expire, GDateTime *now)
/**
* nm_dhcp_dhclient_read_lease_ip_configs:
* @iface: the interface name to match leases with
+ * @ifindex: interface index of @iface
* @contents: the contents of a dhclient leasefile
* @ipv6: whether to read IPv4 or IPv6 leases
* @now: the current UTC date/time; pass %NULL to automatically use current
@@ -526,6 +590,7 @@ lease_validity_span (const char *str_expire, GDateTime *now)
*/
GSList *
nm_dhcp_dhclient_read_lease_ip_configs (const char *iface,
+ int ifindex,
const char *contents,
gboolean ipv6,
GDateTime *now)
@@ -633,7 +698,7 @@ nm_dhcp_dhclient_read_lease_ip_configs (const char *iface,
address.lifetime = address.preferred = expiry;
address.source = NM_IP_CONFIG_SOURCE_DHCP;
- ip4 = nm_ip4_config_new ();
+ ip4 = nm_ip4_config_new (ifindex);
nm_ip4_config_add_address (ip4, &address);
nm_ip4_config_set_gateway (ip4, gw);
diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.h b/src/dhcp-manager/nm-dhcp-dhclient-utils.h
index 3b786a65a6..3cd0f8b832 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient-utils.h
+++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.h
@@ -27,11 +27,12 @@
char *nm_dhcp_dhclient_create_config (const char *interface,
gboolean is_ip6,
- const char *dhcp_client_id,
+ GBytes *client_id,
const char *anycast_addr,
const char *hostname,
const char *orig_path,
- const char *orig_contents);
+ const char *orig_contents,
+ GBytes **out_new_client_id);
char *nm_dhcp_dhclient_escape_duid (const GByteArray *duid);
@@ -44,9 +45,12 @@ gboolean nm_dhcp_dhclient_save_duid (const char *leasefile,
GError **error);
GSList *nm_dhcp_dhclient_read_lease_ip_configs (const char *iface,
+ int ifindex,
const char *contents,
gboolean ipv6,
GDateTime *now);
+GBytes *nm_dhcp_dhclient_get_client_id_from_config_file (const char *path);
+
#endif /* __NETWORKMANAGER_DHCP_DHCLIENT_UTILS_H__ */
diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c
index e4b37377bc..60cddbd30d 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient.c
@@ -18,6 +18,8 @@
* Copyright (C) 2005 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#define _XOPEN_SOURCE
#include <time.h>
#undef _XOPEN_SOURCE
@@ -34,15 +36,14 @@
#include <arpa/inet.h>
#include <ctype.h>
-#include <config.h>
-
#include "nm-dhcp-dhclient.h"
#include "nm-utils.h"
#include "nm-logging.h"
#include "nm-dhcp-dhclient-utils.h"
#include "nm-dhcp-manager.h"
-#include "nm-posix-signals.h"
#include "NetworkManagerUtils.h"
+#include "nm-dhcp-listener.h"
+#include "gsystem-local-alloc.h"
G_DEFINE_TYPE (NMDhcpDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT)
@@ -55,7 +56,7 @@ typedef struct {
char *pid_file;
} NMDhcpDhclientPrivate;
-const char *
+static const char *
nm_dhcp_dhclient_get_path (void)
{
const char *path = NULL;
@@ -122,10 +123,12 @@ get_dhclient_leasefile (const char *iface,
return NULL;
}
-GSList *
+static GSList *
nm_dhcp_dhclient_get_lease_ip_configs (const char *iface,
+ int ifindex,
const char *uuid,
- gboolean ipv6)
+ gboolean ipv6,
+ guint32 default_route_metric)
{
char *contents = NULL;
char *leasefile;
@@ -139,7 +142,7 @@ nm_dhcp_dhclient_get_lease_ip_configs (const char *iface,
&& g_file_get_contents (leasefile, &contents, NULL, NULL)
&& contents
&& contents[0])
- leases = nm_dhcp_dhclient_read_lease_ip_configs (iface, contents, ipv6, NULL);
+ leases = nm_dhcp_dhclient_read_lease_ip_configs (iface, ifindex, contents, ipv6, NULL);
g_free (leasefile);
g_free (contents);
@@ -151,10 +154,11 @@ static gboolean
merge_dhclient_config (const char *iface,
const char *conf_file,
gboolean is_ip6,
- const char *dhcp_client_id,
+ GBytes *client_id,
const char *anycast_addr,
const char *hostname,
const char *orig_path,
+ GBytes **out_new_client_id,
GError **error)
{
char *orig = NULL, *new;
@@ -173,7 +177,7 @@ merge_dhclient_config (const char *iface,
}
}
- new = nm_dhcp_dhclient_create_config (iface, is_ip6, dhcp_client_id, anycast_addr, hostname, orig_path, orig);
+ new = nm_dhcp_dhclient_create_config (iface, is_ip6, client_id, anycast_addr, hostname, orig_path, orig, out_new_client_id);
g_assert (new);
success = g_file_set_contents (conf_file, new, -1, error);
g_free (new);
@@ -257,9 +261,10 @@ static char *
create_dhclient_config (const char *iface,
gboolean is_ip6,
const char *uuid,
- const char *dhcp_client_id,
+ GBytes *client_id,
const char *dhcp_anycast_addr,
- const char *hostname)
+ const char *hostname,
+ GBytes **out_new_client_id)
{
char *orig = NULL, *new = NULL;
GError *error = NULL;
@@ -284,7 +289,7 @@ create_dhclient_config (const char *iface,
}
error = NULL;
- success = merge_dhclient_config (iface, new, is_ip6, dhcp_client_id, dhcp_anycast_addr, hostname, orig, &error);
+ success = merge_dhclient_config (iface, new, is_ip6, client_id, dhcp_anycast_addr, hostname, orig, out_new_client_id, &error);
if (!success) {
nm_log_warn (LOGD_DHCP, "(%s): error creating dhclient%s configuration: %s",
iface, is_ip6 ? "6" : "", error->message);
@@ -296,20 +301,6 @@ create_dhclient_config (const char *iface,
}
-static void
-dhclient_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for dhclient here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
static gboolean
dhclient_start (NMDhcpClient *client,
const char *mode_opt,
@@ -452,7 +443,7 @@ dhclient_start (NMDhcpClient *client,
if (g_spawn_async (NULL, (char **) argv->pdata, NULL,
G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
- &dhclient_child_setup, NULL, &pid, &error)) {
+ nm_utils_setpgid, NULL, &pid, &error)) {
g_assert (pid > 0);
nm_log_info (log_domain, "dhclient started with pid %d", pid);
if (release == FALSE)
@@ -473,41 +464,45 @@ dhclient_start (NMDhcpClient *client,
}
static gboolean
-ip4_start (NMDhcpClient *client,
- const char *dhcp_client_id,
- const char *dhcp_anycast_addr,
- const char *hostname)
+ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last_ip4_address)
{
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client);
- const char *iface, *uuid;
+ GBytes *client_id;
+ gs_unref_bytes GBytes *new_client_id = NULL;
+ const char *iface, *uuid, *hostname;
+ gboolean success = FALSE;
iface = nm_dhcp_client_get_iface (client);
uuid = nm_dhcp_client_get_uuid (client);
+ client_id = nm_dhcp_client_get_client_id (client);
+ hostname = nm_dhcp_client_get_hostname (client);
- priv->conf_file = create_dhclient_config (iface, FALSE, uuid, dhcp_client_id, dhcp_anycast_addr, hostname);
- if (!priv->conf_file) {
+ priv->conf_file = create_dhclient_config (iface, FALSE, uuid, client_id, dhcp_anycast_addr, hostname, &new_client_id);
+ if (priv->conf_file) {
+ if (new_client_id)
+ nm_dhcp_client_set_client_id (client, new_client_id);
+ success = dhclient_start (client, NULL, NULL, FALSE, NULL);
+ } else
nm_log_warn (LOGD_DHCP4, "(%s): error creating dhclient configuration file.", iface);
- return FALSE;
- }
- return dhclient_start (client, NULL, NULL, FALSE, NULL);
+ return success;
}
static gboolean
ip6_start (NMDhcpClient *client,
const char *dhcp_anycast_addr,
- const char *hostname,
gboolean info_only,
NMSettingIP6ConfigPrivacy privacy,
const GByteArray *duid)
{
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client);
- const char *iface, *uuid;
+ const char *iface, *uuid, *hostname;
iface = nm_dhcp_client_get_iface (client);
uuid = nm_dhcp_client_get_uuid (client);
+ hostname = nm_dhcp_client_get_hostname (client);
- priv->conf_file = create_dhclient_config (iface, TRUE, uuid, NULL, dhcp_anycast_addr, hostname);
+ priv->conf_file = create_dhclient_config (iface, TRUE, uuid, NULL, dhcp_anycast_addr, hostname, NULL);
if (!priv->conf_file) {
nm_log_warn (LOGD_DHCP6, "(%s): error creating dhclient6 configuration file.", iface);
return FALSE;
@@ -544,6 +539,24 @@ stop (NMDhcpClient *client, gboolean release, const GByteArray *duid)
}
}
+static void
+state_changed (NMDhcpClient *client,
+ NMDhcpState state,
+ GObject *ip_config,
+ GHashTable *options)
+{
+ NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client);
+ gs_unref_bytes GBytes *client_id = NULL;
+
+ if (nm_dhcp_client_get_client_id (client))
+ return;
+ if (state != NM_DHCP_STATE_BOUND)
+ return;
+
+ client_id = nm_dhcp_dhclient_get_client_id_from_config_file (priv->conf_file);
+ nm_dhcp_client_set_client_id (client, client_id);
+}
+
static GByteArray *
get_duid (NMDhcpClient *client)
{
@@ -612,6 +625,11 @@ nm_dhcp_dhclient_init (NMDhcpDhclient *self)
/* Fallback option */
if (!priv->def_leasefile)
priv->def_leasefile = SYSCONFDIR "/dhclient6.leases";
+
+ g_signal_connect (nm_dhcp_listener_get (),
+ NM_DHCP_LISTENER_EVENT,
+ G_CALLBACK (nm_dhcp_client_handle_event),
+ self);
}
static void
@@ -619,6 +637,10 @@ dispose (GObject *object)
{
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (object);
+ g_signal_handlers_disconnect_by_func (nm_dhcp_listener_get (),
+ G_CALLBACK (nm_dhcp_client_handle_event),
+ NM_DHCP_DHCLIENT (object));
+
g_free (priv->pid_file);
g_free (priv->conf_file);
g_free (priv->lease_file);
@@ -641,5 +663,16 @@ nm_dhcp_dhclient_class_init (NMDhcpDhclientClass *dhclient_class)
client_class->ip6_start = ip6_start;
client_class->stop = stop;
client_class->get_duid = get_duid;
+ client_class->state_changed = state_changed;
+}
+
+static void __attribute__((constructor))
+register_dhcp_dhclient (void)
+{
+ g_type_init ();
+ _nm_dhcp_client_register (NM_TYPE_DHCP_DHCLIENT,
+ "dhclient",
+ nm_dhcp_dhclient_get_path,
+ nm_dhcp_dhclient_get_lease_ip_configs);
}
diff --git a/src/dhcp-manager/nm-dhcp-dhclient.h b/src/dhcp-manager/nm-dhcp-dhclient.h
index 6c58826241..5abcc08ee3 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient.h
+++ b/src/dhcp-manager/nm-dhcp-dhclient.h
@@ -41,11 +41,5 @@ typedef struct {
GType nm_dhcp_dhclient_get_type (void);
-GSList *nm_dhcp_dhclient_get_lease_ip_configs (const char *iface,
- const char *uuid,
- gboolean ipv6);
-
-const char *nm_dhcp_dhclient_get_path (void);
-
#endif /* __NETWORKMANAGER_DHCP_DHCLIENT_H__ */
diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c
index a018c4cd42..86aba4dac1 100644
--- a/src/dhcp-manager/nm-dhcp-dhcpcd.c
+++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c
@@ -21,7 +21,8 @@
*/
-#include <config.h>
+#include "config.h"
+
#include <glib.h>
#include <glib/gi18n.h>
#include <string.h>
@@ -36,8 +37,8 @@
#include "nm-dhcp-manager.h"
#include "nm-utils.h"
#include "nm-logging.h"
-#include "nm-posix-signals.h"
#include "NetworkManagerUtils.h"
+#include "nm-dhcp-listener.h"
G_DEFINE_TYPE (NMDhcpDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_CLIENT)
@@ -47,7 +48,7 @@ typedef struct {
char *pid_file;
} NMDhcpDhcpcdPrivate;
-const char *
+static const char *
nm_dhcp_dhcpcd_get_path (void)
{
const char *path = NULL;
@@ -57,32 +58,15 @@ nm_dhcp_dhcpcd_get_path (void)
return path;
}
-static void
-dhcpcd_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for dhcpcd here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
static gboolean
-ip4_start (NMDhcpClient *client,
- const char *dhcp_client_id,
- const char *dhcp_anycast_addr,
- const char *hostname)
+ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last_ip4_address)
{
NMDhcpDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (client);
GPtrArray *argv = NULL;
pid_t pid = -1;
GError *error = NULL;
char *pid_contents = NULL, *binary_name, *cmd_str;
- const char *iface, *dhcpcd_path = NULL;
+ const char *iface, *dhcpcd_path, *hostname;
g_return_val_if_fail (priv->pid_file == NULL, FALSE);
@@ -129,7 +113,8 @@ ip4_start (NMDhcpClient *client,
g_ptr_array_add (argv, (gpointer) "-4");
#endif
- if (hostname && strlen (hostname)) {
+ hostname = nm_dhcp_client_get_hostname (client);
+ if (hostname) {
g_ptr_array_add (argv, (gpointer) "-h"); /* Send hostname to DHCP server */
g_ptr_array_add (argv, (gpointer) hostname );
}
@@ -143,7 +128,7 @@ ip4_start (NMDhcpClient *client,
if (g_spawn_async (NULL, (char **) argv->pdata, NULL,
G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
- &dhcpcd_child_setup, NULL, &pid, &error)) {
+ nm_utils_setpgid, NULL, &pid, &error)) {
g_assert (pid > 0);
nm_log_info (LOGD_DHCP4, "dhcpcd started with pid %d", pid);
nm_dhcp_client_watch_child (client, pid);
@@ -160,7 +145,6 @@ ip4_start (NMDhcpClient *client,
static gboolean
ip6_start (NMDhcpClient *client,
const char *dhcp_anycast_addr,
- const char *hostname,
gboolean info_only,
NMSettingIP6ConfigPrivacy privacy,
const GByteArray *duid)
@@ -190,6 +174,10 @@ stop (NMDhcpClient *client, gboolean release, const GByteArray *duid)
static void
nm_dhcp_dhcpcd_init (NMDhcpDhcpcd *self)
{
+ g_signal_connect (nm_dhcp_listener_get (),
+ NM_DHCP_LISTENER_EVENT,
+ G_CALLBACK (nm_dhcp_client_handle_event),
+ self);
}
static void
@@ -197,6 +185,10 @@ dispose (GObject *object)
{
NMDhcpDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (object);
+ g_signal_handlers_disconnect_by_func (nm_dhcp_listener_get (),
+ G_CALLBACK (nm_dhcp_client_handle_event),
+ NM_DHCP_DHCPCD (object));
+
g_free (priv->pid_file);
G_OBJECT_CLASS (nm_dhcp_dhcpcd_parent_class)->dispose (object);
@@ -218,3 +210,13 @@ nm_dhcp_dhcpcd_class_init (NMDhcpDhcpcdClass *dhcpcd_class)
client_class->stop = stop;
}
+static void __attribute__((constructor))
+register_dhcp_dhclient (void)
+{
+ g_type_init ();
+ _nm_dhcp_client_register (NM_TYPE_DHCP_DHCPCD,
+ "dhcpcd",
+ nm_dhcp_dhcpcd_get_path,
+ NULL);
+}
+
diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.h b/src/dhcp-manager/nm-dhcp-dhcpcd.h
index 4e3502ab5a..deed70e0f9 100644
--- a/src/dhcp-manager/nm-dhcp-dhcpcd.h
+++ b/src/dhcp-manager/nm-dhcp-dhcpcd.h
@@ -41,7 +41,5 @@ typedef struct {
GType nm_dhcp_dhcpcd_get_type (void);
-const char *nm_dhcp_dhcpcd_get_path (void);
-
#endif /* __NETWORKMANAGER_DHCP_DHCPCD_H__ */
diff --git a/src/dhcp-manager/nm-dhcp-helper.c b/src/dhcp-manager/nm-dhcp-helper.c
index a9c8f396e3..7855f68c96 100644
--- a/src/dhcp-manager/nm-dhcp-helper.c
+++ b/src/dhcp-manager/nm-dhcp-helper.c
@@ -18,7 +18,7 @@
* Copyright (C) 2007 - 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <unistd.h>
#include <stdlib.h>
diff --git a/src/dhcp-manager/nm-dhcp-listener.c b/src/dhcp-manager/nm-dhcp-listener.c
new file mode 100644
index 0000000000..ca57ae595a
--- /dev/null
+++ b/src/dhcp-manager/nm-dhcp-listener.c
@@ -0,0 +1,282 @@
+/* -*- 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 2014 Red Hat, Inc.
+ *
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <dbus/dbus.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "nm-dhcp-listener.h"
+#include "nm-core-internal.h"
+#include "nm-logging.h"
+#include "nm-dbus-manager.h"
+#include "nm-dbus-glib-types.h"
+#include "nm-glib-compat.h"
+#include "NetworkManagerUtils.h"
+
+#define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client"
+#define PRIV_SOCK_PATH NMRUNDIR "/private-dhcp"
+#define PRIV_SOCK_TAG "dhcp"
+
+typedef struct {
+ NMDBusManager * dbus_mgr;
+ guint new_conn_id;
+ guint dis_conn_id;
+ GHashTable * proxies;
+ DBusGProxy * proxy;
+} NMDhcpListenerPrivate;
+
+#define NM_DHCP_LISTENER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_LISTENER, NMDhcpListenerPrivate))
+
+G_DEFINE_TYPE (NMDhcpListener, nm_dhcp_listener, G_TYPE_OBJECT)
+
+enum {
+ EVENT,
+ LAST_SIGNAL
+};
+static guint signals[LAST_SIGNAL] = { 0 };
+
+/***************************************************/
+
+static char *
+garray_to_string (GArray *array, const char *key)
+{
+ GString *str;
+ int i;
+ unsigned char c;
+ char *converted = NULL;
+
+ g_return_val_if_fail (array != NULL, NULL);
+
+ /* Since the DHCP options come through environment variables, they should
+ * already be UTF-8 safe, but just make sure.
+ */
+ str = g_string_sized_new (array->len);
+ for (i = 0; i < array->len; i++) {
+ c = array->data[i];
+
+ /* Convert NULLs to spaces and non-ASCII characters to ? */
+ if (c == '\0')
+ c = ' ';
+ else if (c > 127)
+ c = '?';
+ str = g_string_append_c (str, c);
+ }
+ str = g_string_append_c (str, '\0');
+
+ converted = str->str;
+ if (!g_utf8_validate (converted, -1, NULL))
+ nm_log_warn (LOGD_DHCP, "DHCP option '%s' couldn't be converted to UTF-8", key);
+ g_string_free (str, FALSE);
+ return converted;
+}
+
+static char *
+get_option (GHashTable *hash, const char *key)
+{
+ GValue *value;
+
+ value = g_hash_table_lookup (hash, key);
+ if (value == NULL)
+ return NULL;
+
+ if (G_VALUE_TYPE (value) != DBUS_TYPE_G_UCHAR_ARRAY) {
+ nm_log_warn (LOGD_DHCP, "unexpected key %s value type was not "
+ "DBUS_TYPE_G_UCHAR_ARRAY",
+ (char *) key);
+ return NULL;
+ }
+
+ return garray_to_string ((GArray *) g_value_get_boxed (value), key);
+}
+
+static void
+handle_event (DBusGProxy *proxy,
+ GHashTable *options,
+ gpointer user_data)
+{
+ NMDhcpListener *self = NM_DHCP_LISTENER (user_data);
+ char *iface = NULL;
+ char *pid_str = NULL;
+ char *reason = NULL;
+ gint pid;
+ gboolean handled = FALSE;
+
+ iface = get_option (options, "interface");
+ if (iface == NULL) {
+ nm_log_warn (LOGD_DHCP, "DHCP event: didn't have associated interface.");
+ goto out;
+ }
+
+ pid_str = get_option (options, "pid");
+ pid = _nm_utils_ascii_str_to_int64 (pid_str, 10, 0, G_MAXINT32, -1);
+ if (pid == -1) {
+ nm_log_warn (LOGD_DHCP, "DHCP event: couldn't convert PID '%s' to an integer", pid_str ? pid_str : "(null)");
+ goto out;
+ }
+
+ reason = get_option (options, "reason");
+ if (reason == NULL) {
+ nm_log_warn (LOGD_DHCP, "(pid %d) DHCP event didn't have a reason", pid);
+ goto out;
+ }
+
+ g_signal_emit (self, signals[EVENT], 0, iface, pid, options, reason, &handled);
+ if (!handled) {
+ if (g_ascii_strcasecmp (reason, "RELEASE") == 0) {
+ /* Ignore event when the dhcp client gets killed and we receive its last message */
+ nm_log_dbg (LOGD_DHCP, "(pid %d) unhandled RELEASE DHCP event for interface %s", pid, iface);
+ } else
+ nm_log_warn (LOGD_DHCP, "(pid %d) unhandled DHCP event for interface %s", pid, iface);
+ }
+
+out:
+ g_free (iface);
+ g_free (pid_str);
+ g_free (reason);
+}
+
+#if HAVE_DBUS_GLIB_100
+static void
+new_connection_cb (NMDBusManager *mgr,
+ DBusGConnection *connection,
+ NMDhcpListener *self)
+{
+ DBusGProxy *proxy;
+
+ /* Create a new proxy for the client */
+ proxy = dbus_g_proxy_new_for_peer (connection, "/", NM_DHCP_CLIENT_DBUS_IFACE);
+ dbus_g_proxy_add_signal (proxy, "Event", DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal (proxy, "Event", G_CALLBACK (handle_event), self, NULL);
+
+ g_hash_table_insert (NM_DHCP_LISTENER_GET_PRIVATE (self)->proxies, connection, proxy);
+}
+
+static void
+dis_connection_cb (NMDBusManager *mgr,
+ DBusGConnection *connection,
+ NMDhcpListener *self)
+{
+ NMDhcpListenerPrivate *priv = NM_DHCP_LISTENER_GET_PRIVATE (self);
+ DBusGProxy *proxy;
+
+ proxy = g_hash_table_lookup (priv->proxies, connection);
+ if (proxy) {
+ dbus_g_proxy_disconnect_signal (proxy, "Event", G_CALLBACK (handle_event), self);
+ g_hash_table_remove (priv->proxies, connection);
+ }
+}
+#endif
+
+/***************************************************/
+
+NM_DEFINE_SINGLETON_GETTER (NMDhcpListener, nm_dhcp_listener_get, NM_TYPE_DHCP_LISTENER);
+
+static void
+nm_dhcp_listener_init (NMDhcpListener *self)
+{
+ NMDhcpListenerPrivate *priv = NM_DHCP_LISTENER_GET_PRIVATE (self);
+#if !HAVE_DBUS_GLIB_100
+ DBusGConnection *g_connection;
+#endif
+
+ /* Maps DBusGConnection :: DBusGProxy */
+ priv->proxies = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
+
+ priv->dbus_mgr = nm_dbus_manager_get ();
+
+#if HAVE_DBUS_GLIB_100
+ /* Register the socket our DHCP clients will return lease info on */
+ nm_dbus_manager_private_server_register (priv->dbus_mgr, PRIV_SOCK_PATH, PRIV_SOCK_TAG);
+ priv->new_conn_id = g_signal_connect (priv->dbus_mgr,
+ NM_DBUS_MANAGER_PRIVATE_CONNECTION_NEW "::" PRIV_SOCK_TAG,
+ G_CALLBACK (new_connection_cb),
+ self);
+ priv->dis_conn_id = g_signal_connect (priv->dbus_mgr,
+ NM_DBUS_MANAGER_PRIVATE_CONNECTION_DISCONNECTED "::" PRIV_SOCK_TAG,
+ G_CALLBACK (dis_connection_cb),
+ self);
+#else
+ g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr);
+ priv->proxy = dbus_g_proxy_new_for_name (g_connection,
+ "org.freedesktop.nm_dhcp_client",
+ "/",
+ NM_DHCP_CLIENT_DBUS_IFACE);
+ g_assert (priv->proxy);
+ dbus_g_proxy_add_signal (priv->proxy, "Event", DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal (priv->proxy, "Event", G_CALLBACK (handle_event), self, NULL);
+#endif
+}
+
+static void
+dispose (GObject *object)
+{
+ NMDhcpListenerPrivate *priv = NM_DHCP_LISTENER_GET_PRIVATE (object);
+
+ if (priv->new_conn_id) {
+ g_signal_handler_disconnect (priv->dbus_mgr, priv->new_conn_id);
+ priv->new_conn_id = 0;
+ }
+ if (priv->dis_conn_id) {
+ g_signal_handler_disconnect (priv->dbus_mgr, priv->dis_conn_id);
+ priv->dis_conn_id = 0;
+ }
+ priv->dbus_mgr = NULL;
+
+ if (priv->proxies) {
+ g_hash_table_destroy (priv->proxies);
+ priv->proxies = NULL;
+ }
+ g_clear_object (&priv->proxy);
+
+ G_OBJECT_CLASS (nm_dhcp_listener_parent_class)->dispose (object);
+}
+
+static void
+nm_dhcp_listener_class_init (NMDhcpListenerClass *listener_class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (listener_class);
+
+ g_type_class_add_private (listener_class, sizeof (NMDhcpListenerPrivate));
+
+ /* virtual methods */
+ object_class->dispose = dispose;
+
+ /* signals */
+ signals[EVENT] =
+ g_signal_new (NM_DHCP_LISTENER_EVENT,
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST, 0,
+ g_signal_accumulator_true_handled,
+ NULL, NULL,
+ G_TYPE_BOOLEAN, /* listeners return TRUE if handled */
+ 4,
+ G_TYPE_STRING, /* iface */
+ G_TYPE_INT, /* pid */
+ G_TYPE_HASH_TABLE, /* options */
+ G_TYPE_STRING); /* reason */
+}
diff --git a/src/dhcp-manager/nm-dhcp-listener.h b/src/dhcp-manager/nm-dhcp-listener.h
new file mode 100644
index 0000000000..15ec053109
--- /dev/null
+++ b/src/dhcp-manager/nm-dhcp-listener.h
@@ -0,0 +1,39 @@
+/* -*- 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 2014 Red Hat, Inc.
+ */
+
+#ifndef __NETWORKMANAGER_DHCP_LISTENER_H__
+#define __NETWORKMANAGER_DHCP_LISTENER_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#define NM_TYPE_DHCP_LISTENER (nm_dhcp_listener_get_type ())
+#define NM_DHCP_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_LISTENER, NMDhcpListener))
+#define NM_IS_DHCP_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_LISTENER))
+#define NM_DHCP_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_LISTENER, NMDhcpListenerClass))
+
+#define NM_DHCP_LISTENER_EVENT "event"
+
+typedef GObject NMDhcpListener;
+typedef GObjectClass NMDhcpListenerClass;
+
+GType nm_dhcp_listener_get_type (void);
+
+NMDhcpListener *nm_dhcp_listener_get (void);
+
+#endif /* __NETWORKMANAGER_DHCP_LISTENER_H__ */
diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c
index b19590a69b..fa562e6cf1 100644
--- a/src/dhcp-manager/nm-dhcp-manager.c
+++ b/src/dhcp-manager/nm-dhcp-manager.c
@@ -21,9 +21,9 @@
*/
#include "config.h"
+
#include <glib.h>
#include <glib/gi18n.h>
-#include <dbus/dbus.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <signal.h>
@@ -37,20 +37,15 @@
#include "nm-dhcp-manager.h"
#include "nm-dhcp-dhclient.h"
#include "nm-dhcp-dhcpcd.h"
+#include "nm-dhcp-systemd.h"
#include "nm-logging.h"
-#include "nm-dbus-manager.h"
#include "nm-config.h"
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
#include "NetworkManagerUtils.h"
-#define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client"
-
#define DHCP_TIMEOUT 45 /* default DHCP timeout, in seconds */
-#define PRIV_SOCK_PATH NMRUNDIR "/private-dhcp"
-#define PRIV_SOCK_TAG "dhcp"
-
/* default to installed helper, but can be modified for testing */
const char *nm_dhcp_helper_path = LIBEXECDIR "/nm-dhcp-helper";
@@ -58,78 +53,87 @@ typedef GSList * (*GetLeaseConfigFunc) (const char *iface, const char *uuid, gbo
typedef struct {
GType client_type;
- GetLeaseConfigFunc get_lease_ip_configs_func;
-
- NMDBusManager * dbus_mgr;
- guint new_conn_id;
- guint dis_conn_id;
- GHashTable * proxies;
-
GHashTable * clients;
- DBusGProxy * proxy;
char * default_hostname;
} NMDhcpManagerPrivate;
-
#define NM_DHCP_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_MANAGER, NMDhcpManagerPrivate))
G_DEFINE_TYPE (NMDhcpManager, nm_dhcp_manager, G_TYPE_OBJECT)
-static char *
-garray_to_string (GArray *array, const char *key)
+/***************************************************/
+
+typedef struct {
+ GType gtype;
+ const char *name;
+ NMDhcpClientGetPathFunc get_path_func;
+ NMDhcpClientGetLeaseConfigsFunc get_lease_configs_func;
+} ClientDesc;
+
+static GSList *client_descs = NULL;
+
+void
+_nm_dhcp_client_register (GType gtype,
+ const char *name,
+ NMDhcpClientGetPathFunc get_path_func,
+ NMDhcpClientGetLeaseConfigsFunc get_lease_configs_func)
{
- GString *str;
- int i;
- unsigned char c;
- char *converted = NULL;
+ ClientDesc *desc;
+ GSList *iter;
- g_return_val_if_fail (array != NULL, NULL);
+ g_return_if_fail (gtype != G_TYPE_INVALID);
+ g_return_if_fail (name != NULL);
- /* Since the DHCP options come through environment variables, they should
- * already be UTF-8 safe, but just make sure.
- */
- str = g_string_sized_new (array->len);
- for (i = 0; i < array->len; i++) {
- c = array->data[i];
-
- /* Convert NULLs to spaces and non-ASCII characters to ? */
- if (c == '\0')
- c = ' ';
- else if (c > 127)
- c = '?';
- str = g_string_append_c (str, c);
+ for (iter = client_descs; iter; iter = iter->next) {
+ desc = iter->data;
+ g_return_if_fail (desc->gtype != gtype);
+ g_return_if_fail (strcmp (desc->name, name) != 0);
}
- str = g_string_append_c (str, '\0');
- converted = str->str;
- if (!g_utf8_validate (converted, -1, NULL))
- nm_log_warn (LOGD_DHCP, "DHCP option '%s' couldn't be converted to UTF-8", key);
- g_string_free (str, FALSE);
- return converted;
+ desc = g_slice_new0 (ClientDesc);
+ desc->gtype = gtype;
+ desc->name = name;
+ desc->get_path_func = get_path_func;
+ desc->get_lease_configs_func = get_lease_configs_func;
+ client_descs = g_slist_prepend (client_descs, desc);
}
-static NMDhcpClient *
-get_client_for_pid (NMDhcpManager *manager, GPid pid)
+static ClientDesc *
+find_client_desc (const char *name, GType gtype)
{
- NMDhcpManagerPrivate *priv;
- GHashTableIter iter;
- gpointer value;
-
- g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL);
+ GSList *iter;
- priv = NM_DHCP_MANAGER_GET_PRIVATE (manager);
+ g_return_val_if_fail (name || gtype, NULL);
- g_hash_table_iter_init (&iter, priv->clients);
- while (g_hash_table_iter_next (&iter, NULL, &value)) {
- NMDhcpClient *candidate = NM_DHCP_CLIENT (value);
+ for (iter = client_descs; iter; iter = iter->next) {
+ ClientDesc *desc = iter->data;
- if (nm_dhcp_client_get_pid (candidate) == pid)
- return candidate;
+ if (name && strcmp (desc->name, name) != 0)
+ continue;
+ if (gtype && desc->gtype != gtype)
+ continue;
+ return desc;
}
-
return NULL;
}
+static GType
+is_client_enabled (const char *name, GError **error)
+{
+ ClientDesc *desc;
+
+ desc = find_client_desc (name, G_TYPE_INVALID);
+ if (desc && (!desc->get_path_func || desc->get_path_func()))
+ return desc->gtype;
+
+ g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
+ _("'%s' support not found or not enabled."),
+ name);
+ return G_TYPE_INVALID;
+}
+
+/***************************************************/
+
static NMDhcpClient *
get_client_for_ifindex (NMDhcpManager *manager, int ifindex, gboolean ip6)
{
@@ -154,169 +158,26 @@ get_client_for_ifindex (NMDhcpManager *manager, int ifindex, gboolean ip6)
return NULL;
}
-static char *
-get_option (GHashTable *hash, const char *key)
-{
- GValue *value;
-
- value = g_hash_table_lookup (hash, key);
- if (value == NULL)
- return NULL;
-
- if (G_VALUE_TYPE (value) != DBUS_TYPE_G_UCHAR_ARRAY) {
- nm_log_warn (LOGD_DHCP, "unexpected key %s value type was not "
- "DBUS_TYPE_G_UCHAR_ARRAY",
- (char *) key);
- return NULL;
- }
-
- return garray_to_string ((GArray *) g_value_get_boxed (value), key);
-}
-
-static void
-nm_dhcp_manager_handle_event (DBusGProxy *proxy,
- GHashTable *options,
- gpointer user_data)
-{
- NMDhcpManager *manager = NM_DHCP_MANAGER (user_data);
- NMDhcpClient *client;
- char *iface = NULL;
- char *pid_str = NULL;
- char *reason = NULL;
- long pid;
-
- iface = get_option (options, "interface");
- if (iface == NULL) {
- nm_log_warn (LOGD_DHCP, "DHCP event: didn't have associated interface.");
- goto out;
- }
-
- pid_str = get_option (options, "pid");
- pid = nm_utils_ascii_str_to_int64 (pid_str, 10, 0, LONG_MAX, -1);
- if (pid == -1 || pid != (GPid)pid) {
- nm_log_warn (LOGD_DHCP, "DHCP event: couldn't convert PID '%s' to an integer", pid_str ? pid_str : "(null)");
- goto out;
- }
-
- reason = get_option (options, "reason");
- client = get_client_for_pid (manager, (GPid) pid);
- if (client == NULL) {
- if (reason && g_ascii_strcasecmp (reason, "RELEASE") == 0) {
- /* This happens regularly, when the dhcp client gets killed and we receive its last message.
- * Don't log a warning in this case. */
- nm_log_dbg (LOGD_DHCP, "(pid %ld) unhandled RELEASE DHCP event for interface %s", pid, iface);
- } else
- nm_log_warn (LOGD_DHCP, "(pid %ld) unhandled DHCP event for interface %s", pid, iface);
- goto out;
- }
-
- if (strcmp (iface, nm_dhcp_client_get_iface (client))) {
- nm_log_warn (LOGD_DHCP, "(pid %ld) received DHCP event from unexpected interface '%s' (expected '%s')",
- pid, iface, nm_dhcp_client_get_iface (client));
- goto out;
- }
-
- if (reason == NULL) {
- nm_log_warn (LOGD_DHCP, "(pid %ld) DHCP event didn't have a reason", pid);
- goto out;
- }
-
- nm_dhcp_client_new_options (client, options, reason);
-
-out:
- g_free (iface);
- g_free (pid_str);
- g_free (reason);
-}
-
-#if HAVE_DBUS_GLIB_100
-static void
-new_connection_cb (NMDBusManager *mgr,
- DBusGConnection *connection,
- NMDhcpManager *self)
-{
- NMDhcpManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self);
- DBusGProxy *proxy;
-
- /* Create a new proxy for the client */
- proxy = dbus_g_proxy_new_for_peer (connection, "/", NM_DHCP_CLIENT_DBUS_IFACE);
- dbus_g_proxy_add_signal (proxy,
- "Event",
- DBUS_TYPE_G_MAP_OF_VARIANT,
- G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (proxy,
- "Event",
- G_CALLBACK (nm_dhcp_manager_handle_event),
- self,
- NULL);
- g_hash_table_insert (priv->proxies, connection, proxy);
-}
-
-static void
-dis_connection_cb (NMDBusManager *mgr,
- DBusGConnection *connection,
- NMDhcpManager *self)
-{
- NMDhcpManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self);
- DBusGProxy *proxy;
-
- proxy = g_hash_table_lookup (priv->proxies, connection);
- if (proxy) {
- dbus_g_proxy_disconnect_signal (proxy,
- "Event",
- G_CALLBACK (nm_dhcp_manager_handle_event),
- self);
- g_hash_table_remove (priv->proxies, connection);
- }
-}
-#endif
-
static GType
get_client_type (const char *client, GError **error)
{
- gboolean use_dhclient, use_dhcpcd;
-
- /* If a client was disabled at build-time, these will return FALSE */
- use_dhclient = !!nm_dhcp_dhclient_get_path ();
- use_dhcpcd = !!nm_dhcp_dhcpcd_get_path ();
-
- if (!client) {
- if (use_dhclient)
- return NM_TYPE_DHCP_DHCLIENT;
- else if (use_dhcpcd)
- return NM_TYPE_DHCP_DHCPCD;
- else {
- g_set_error_literal (error,
- NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
- _("no usable DHCP client could be found."));
- return G_TYPE_INVALID;
- }
- }
-
- if (!strcmp (client, "dhclient")) {
- if (!use_dhclient) {
- g_set_error_literal (error,
- NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
- _("'dhclient' could not be found or was disabled."));
- return G_TYPE_INVALID;
- }
- return NM_TYPE_DHCP_DHCLIENT;
- }
-
- if (!strcmp (client, "dhcpcd")) {
- if (!use_dhcpcd) {
- g_set_error_literal (error,
- NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
- _("'dhcpcd' could not be found or was disabled."));
- return G_TYPE_INVALID;
+ GType client_gtype;
+
+ if (client)
+ client_gtype = is_client_enabled (client, error);
+ else {
+ /* Fallbacks */
+ client_gtype = is_client_enabled ("dhclient", NULL);
+ if (client_gtype == G_TYPE_INVALID)
+ client_gtype = is_client_enabled ("dhcpcd", NULL);
+ if (client_gtype == G_TYPE_INVALID)
+ client_gtype = is_client_enabled ("internal", NULL);
+ if (client_gtype == G_TYPE_INVALID) {
+ g_set_error_literal (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
+ _("no usable DHCP client could be found."));
}
- return NM_TYPE_DHCP_DHCPCD;
}
-
- g_set_error (error,
- NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
- _("unsupported DHCP client '%s'"), client);
- return G_TYPE_INVALID;
+ return client_gtype;
}
static void client_state_changed (NMDhcpClient *client,
@@ -355,14 +216,15 @@ client_start (NMDhcpManager *self,
int ifindex,
const GByteArray *hwaddr,
const char *uuid,
- guint priority,
+ guint32 priority,
gboolean ipv6,
const char *dhcp_client_id,
guint32 timeout,
const char *dhcp_anycast_addr,
const char *hostname,
gboolean info_only,
- NMSettingIP6ConfigPrivacy privacy)
+ NMSettingIP6ConfigPrivacy privacy,
+ const char *last_ip4_address)
{
NMDhcpManagerPrivate *priv;
NMDhcpClient *client;
@@ -403,7 +265,7 @@ client_start (NMDhcpManager *self,
if (ipv6)
success = nm_dhcp_client_start_ip6 (client, dhcp_anycast_addr, hostname, info_only, privacy);
else
- success = nm_dhcp_client_start_ip4 (client, dhcp_client_id, dhcp_anycast_addr, hostname);
+ success = nm_dhcp_client_start_ip4 (client, dhcp_client_id, dhcp_anycast_addr, hostname, last_ip4_address);
if (!success) {
remove_client (self, client);
@@ -429,12 +291,13 @@ nm_dhcp_manager_start_ip4 (NMDhcpManager *self,
int ifindex,
const GByteArray *hwaddr,
const char *uuid,
- guint priority,
+ guint32 priority,
gboolean send_hostname,
const char *dhcp_hostname,
const char *dhcp_client_id,
guint32 timeout,
- const char *dhcp_anycast_addr)
+ const char *dhcp_anycast_addr,
+ const char *last_ip_address)
{
const char *hostname = NULL;
@@ -444,7 +307,7 @@ nm_dhcp_manager_start_ip4 (NMDhcpManager *self,
hostname = get_send_hostname (self, dhcp_hostname);
return client_start (self, iface, ifindex, hwaddr, uuid, priority, FALSE,
dhcp_client_id, timeout, dhcp_anycast_addr, hostname,
- FALSE, 0);
+ FALSE, 0, last_ip_address);
}
/* Caller owns a reference to the NMDhcpClient on return */
@@ -454,22 +317,23 @@ nm_dhcp_manager_start_ip6 (NMDhcpManager *self,
int ifindex,
const GByteArray *hwaddr,
const char *uuid,
- guint priority,
+ guint32 priority,
+ gboolean send_hostname,
const char *dhcp_hostname,
guint32 timeout,
const char *dhcp_anycast_addr,
gboolean info_only,
NMSettingIP6ConfigPrivacy privacy)
{
- const char *hostname;
+ const char *hostname = NULL;
g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL);
- hostname = dhcp_hostname ? get_send_hostname (self, dhcp_hostname) : NULL;
-
+ if (send_hostname)
+ hostname = get_send_hostname (self, dhcp_hostname);
return client_start (self, iface, ifindex, hwaddr, uuid, priority, TRUE,
NULL, timeout, dhcp_anycast_addr, hostname, info_only,
- privacy);
+ privacy, NULL);
}
void
@@ -489,91 +353,65 @@ nm_dhcp_manager_set_default_hostname (NMDhcpManager *manager, const char *hostna
GSList *
nm_dhcp_manager_get_lease_ip_configs (NMDhcpManager *self,
const char *iface,
+ int ifindex,
const char *uuid,
- gboolean ipv6)
+ gboolean ipv6,
+ guint32 default_route_metric)
{
- NMDhcpManagerPrivate *priv;
+ ClientDesc *desc;
g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL);
g_return_val_if_fail (iface != NULL, NULL);
+ g_return_val_if_fail (ifindex >= -1, NULL);
g_return_val_if_fail (uuid != NULL, NULL);
- priv = NM_DHCP_MANAGER_GET_PRIVATE (self);
-
- if (priv->get_lease_ip_configs_func)
- return priv->get_lease_ip_configs_func (iface, uuid, ipv6);
+ desc = find_client_desc (NULL, NM_DHCP_MANAGER_GET_PRIVATE (self)->client_type);
+ if (desc && desc->get_lease_configs_func)
+ return desc->get_lease_configs_func (iface, ifindex, uuid, ipv6, default_route_metric);
return NULL;
}
/***************************************************/
-NMDhcpManager *
-nm_dhcp_manager_get (void)
-{
- static NMDhcpManager *singleton = NULL;
-
- if (G_UNLIKELY (singleton == NULL))
- singleton = g_object_new (NM_TYPE_DHCP_MANAGER, NULL);
- g_assert (singleton);
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMDhcpManager, nm_dhcp_manager_get, NM_TYPE_DHCP_MANAGER);
static void
nm_dhcp_manager_init (NMDhcpManager *self)
{
NMDhcpManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self);
+ NMConfig *config = nm_config_get ();
const char *client;
GError *error = NULL;
-#if !HAVE_DBUS_GLIB_100
- DBusGConnection *g_connection;
-#endif
+ GSList *iter;
+
+ for (iter = client_descs; iter; iter = iter->next) {
+ ClientDesc *desc = iter->data;
- /* Maps DBusGConnection :: DBusGProxy */
- priv->proxies = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
+ nm_log_dbg (LOGD_DHCP, "Registered DHCP client '%s' (%s)",
+ desc->name, g_type_name (desc->gtype));
+ }
/* Client-specific setup */
- client = nm_config_get_dhcp_client (nm_config_get ());
- priv->client_type = get_client_type (client, &error);
+ client = nm_config_get_dhcp_client (config);
+ if (nm_config_get_configure_and_quit (config)) {
+ if (g_strcmp0 (client, "internal") != 0)
+ nm_log_warn (LOGD_DHCP, "Using internal DHCP client since configure-and-quit is set.");
+ client = "internal";
+ }
- if (priv->client_type == NM_TYPE_DHCP_DHCLIENT)
- priv->get_lease_ip_configs_func = nm_dhcp_dhclient_get_lease_ip_configs;
- else if (priv->client_type == G_TYPE_INVALID) {
+ priv->client_type = get_client_type (client, &error);
+ if (priv->client_type == G_TYPE_INVALID) {
nm_log_warn (LOGD_DHCP, "No usable DHCP client found (%s)! DHCP configurations will fail.",
error->message);
+ } else {
+ nm_log_dbg (LOGD_DHCP, "Using DHCP client '%s'", find_client_desc (NULL, priv->client_type)->name);
+
}
g_clear_error (&error);
priv->clients = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL,
(GDestroyNotify) g_object_unref);
- g_assert (priv->clients);
-
- priv->dbus_mgr = nm_dbus_manager_get ();
-
-#if HAVE_DBUS_GLIB_100
- /* Register the socket our DHCP clients will return lease info on */
- nm_dbus_manager_private_server_register (priv->dbus_mgr, PRIV_SOCK_PATH, PRIV_SOCK_TAG);
- priv->new_conn_id = g_signal_connect (priv->dbus_mgr,
- NM_DBUS_MANAGER_PRIVATE_CONNECTION_NEW "::" PRIV_SOCK_TAG,
- (GCallback) new_connection_cb,
- self);
- priv->dis_conn_id = g_signal_connect (priv->dbus_mgr,
- NM_DBUS_MANAGER_PRIVATE_CONNECTION_DISCONNECTED "::" PRIV_SOCK_TAG,
- (GCallback) dis_connection_cb,
- self);
-#else
- g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr);
- priv->proxy = dbus_g_proxy_new_for_name (g_connection,
- "org.freedesktop.nm_dhcp_client",
- "/",
- NM_DHCP_CLIENT_DBUS_IFACE);
- g_assert (priv->proxy);
- dbus_g_proxy_add_signal (priv->proxy, "Event", DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->proxy, "Event",
- G_CALLBACK (nm_dhcp_manager_handle_event),
- self,
- NULL);
-#endif
}
static void
@@ -589,23 +427,6 @@ dispose (GObject *object)
g_list_free (values);
}
- if (priv->new_conn_id) {
- g_signal_handler_disconnect (priv->dbus_mgr, priv->new_conn_id);
- priv->new_conn_id = 0;
- }
- if (priv->dis_conn_id) {
- g_signal_handler_disconnect (priv->dbus_mgr, priv->dis_conn_id);
- priv->dis_conn_id = 0;
- }
- priv->dbus_mgr = NULL;
-
- if (priv->proxies) {
- g_hash_table_destroy (priv->proxies);
- priv->proxies = NULL;
- }
- if (priv->proxy)
- g_object_unref (priv->proxy);
-
G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->dispose (object);
}
diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h
index 58fc23d28e..4c9e45de96 100644
--- a/src/dhcp-manager/nm-dhcp-manager.h
+++ b/src/dhcp-manager/nm-dhcp-manager.h
@@ -56,19 +56,21 @@ NMDhcpClient * nm_dhcp_manager_start_ip4 (NMDhcpManager *manager,
int ifindex,
const GByteArray *hwaddr,
const char *uuid,
- guint priority,
+ guint32 priority,
gboolean send_hostname,
const char *dhcp_hostname,
const char *dhcp_client_id,
guint32 timeout,
- const char *dhcp_anycast_addr);
+ const char *dhcp_anycast_addr,
+ const char *last_ip_address);
NMDhcpClient * nm_dhcp_manager_start_ip6 (NMDhcpManager *manager,
const char *iface,
int ifindex,
const GByteArray *hwaddr,
const char *uuid,
- guint priority,
+ guint32 priority,
+ gboolean send_hostname,
const char *dhcp_hostname,
guint32 timeout,
const char *dhcp_anycast_addr,
@@ -77,8 +79,10 @@ NMDhcpClient * nm_dhcp_manager_start_ip6 (NMDhcpManager *manager,
GSList * nm_dhcp_manager_get_lease_ip_configs (NMDhcpManager *self,
const char *iface,
+ int ifindex,
const char *uuid,
- gboolean ipv6);
+ gboolean ipv6,
+ guint32 default_route_metric);
/* For testing only */
extern const char* nm_dhcp_helper_path;
diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c
new file mode 100644
index 0000000000..de5bf2a9be
--- /dev/null
+++ b/src/dhcp-manager/nm-dhcp-systemd.c
@@ -0,0 +1,848 @@
+/* -*- 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 (C) 2014 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <ctype.h>
+#include <net/if_arp.h>
+
+#include "nm-dhcp-systemd.h"
+#include "nm-utils.h"
+#include "nm-logging.h"
+#include "nm-dhcp-utils.h"
+#include "NetworkManagerUtils.h"
+#include "gsystem-local-alloc.h"
+#include "nm-platform.h"
+
+#include "nm-sd-adapt.h"
+
+#include "sd-dhcp-client.h"
+#include "sd-dhcp6-client.h"
+#include "dhcp-protocol.h"
+#include "dhcp-lease-internal.h"
+#include "dhcp6-protocol.h"
+#include "dhcp6-lease-internal.h"
+
+G_DEFINE_TYPE (NMDhcpSystemd, nm_dhcp_systemd, NM_TYPE_DHCP_CLIENT)
+
+#define NM_DHCP_SYSTEMD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_SYSTEMD, NMDhcpSystemdPrivate))
+
+typedef struct {
+ struct sd_dhcp_client *client4;
+ struct sd_dhcp6_client *client6;
+ char *lease_file;
+
+ guint timeout_id;
+ guint request_count;
+
+ gboolean privacy;
+} NMDhcpSystemdPrivate;
+
+/************************************************************/
+
+#define DHCP_OPTION_NIS_DOMAIN 40
+#define DHCP_OPTION_NIS_SERVERS 41
+#define DHCP_OPTION_DOMAIN_SEARCH 119
+#define DHCP_OPTION_RFC3442_ROUTES 121
+#define DHCP_OPTION_MS_ROUTES 249
+#define DHCP_OPTION_WPAD 252
+
+/* Internal values */
+#define DHCP_OPTION_IP_ADDRESS 1024
+#define DHCP_OPTION_EXPIRY 1025
+#define DHCP6_OPTION_IP_ADDRESS 1026
+#define DHCP6_OPTION_PREFIXLEN 1027
+#define DHCP6_OPTION_PREFERRED_LIFE 1028
+#define DHCP6_OPTION_MAX_LIFE 1029
+#define DHCP6_OPTION_STARTS 1030
+#define DHCP6_OPTION_LIFE_STARTS 1031
+#define DHCP6_OPTION_RENEW 1032
+#define DHCP6_OPTION_REBIND 1033
+#define DHCP6_OPTION_IAID 1034
+
+typedef struct {
+ guint num;
+ const char *name;
+ gboolean include;
+} ReqOption;
+
+#define REQPREFIX "requested_"
+
+static const ReqOption dhcp4_requests[] = {
+ { DHCP_OPTION_SUBNET_MASK, REQPREFIX "subnet_mask", TRUE },
+ { DHCP_OPTION_TIME_OFFSET, REQPREFIX "time_offset", TRUE },
+ { DHCP_OPTION_ROUTER, REQPREFIX "routers", TRUE },
+ { DHCP_OPTION_DOMAIN_NAME_SERVER, REQPREFIX "domain_name_servers", TRUE },
+ { DHCP_OPTION_HOST_NAME, REQPREFIX "host_name", TRUE },
+ { DHCP_OPTION_DOMAIN_NAME, REQPREFIX "domain_name", TRUE },
+ { DHCP_OPTION_INTERFACE_MTU, REQPREFIX "interface_mtu", TRUE },
+ { DHCP_OPTION_BROADCAST, REQPREFIX "broadcast_address", TRUE },
+ { DHCP_OPTION_STATIC_ROUTE, REQPREFIX "static_routes", TRUE },
+ { DHCP_OPTION_NIS_DOMAIN, REQPREFIX "nis_domain", TRUE },
+ { DHCP_OPTION_NIS_SERVERS, REQPREFIX "nis_servers", TRUE },
+ { DHCP_OPTION_NTP_SERVER, REQPREFIX "ntp_servers", TRUE },
+ { DHCP_OPTION_SERVER_IDENTIFIER, REQPREFIX "dhcp_server_identifier", TRUE },
+ { DHCP_OPTION_DOMAIN_SEARCH, REQPREFIX "domain_search", TRUE },
+ { DHCP_OPTION_CLASSLESS_STATIC_ROUTE, REQPREFIX "rfc3442_classless_static_routes", TRUE },
+ { DHCP_OPTION_MS_ROUTES, REQPREFIX "ms_classless_static_routes", TRUE },
+ { DHCP_OPTION_WPAD, REQPREFIX "wpad", TRUE },
+
+ /* Internal values */
+ { DHCP_OPTION_IP_ADDRESS_LEASE_TIME, REQPREFIX "expiry", FALSE },
+ { DHCP_OPTION_CLIENT_IDENTIFIER, REQPREFIX "dhcp_client_identifier", FALSE },
+ { DHCP_OPTION_IP_ADDRESS, REQPREFIX "ip_address", FALSE },
+ { 0, NULL, FALSE }
+};
+
+static const ReqOption dhcp6_requests[] = {
+ { DHCP6_OPTION_CLIENTID, REQPREFIX "dhcp6_client_id", TRUE },
+
+ /* Don't request server ID by default; some servers don't reply to
+ * Information Requests that request the Server ID.
+ */
+ { DHCP6_OPTION_SERVERID, REQPREFIX "dhcp6_server_id", FALSE },
+
+ { DHCP6_OPTION_DNS_SERVERS, REQPREFIX "dhcp6_name_servers", TRUE },
+ { DHCP6_OPTION_DOMAIN_LIST, REQPREFIX "dhcp6_domain_search", TRUE },
+ { DHCP6_OPTION_SNTP_SERVERS, REQPREFIX "dhcp6_sntp_servers", TRUE },
+
+ /* Internal values */
+ { DHCP6_OPTION_IP_ADDRESS, REQPREFIX "ip6_address", FALSE },
+ { DHCP6_OPTION_PREFIXLEN, REQPREFIX "ip6_prefixlen", FALSE },
+ { DHCP6_OPTION_PREFERRED_LIFE, REQPREFIX "preferred_life", FALSE },
+ { DHCP6_OPTION_MAX_LIFE, REQPREFIX "max_life", FALSE },
+ { DHCP6_OPTION_STARTS, REQPREFIX "starts", FALSE },
+ { DHCP6_OPTION_LIFE_STARTS, REQPREFIX "life_starts", FALSE },
+ { DHCP6_OPTION_RENEW, REQPREFIX "renew", FALSE },
+ { DHCP6_OPTION_REBIND, REQPREFIX "rebind", FALSE },
+ { DHCP6_OPTION_IAID, REQPREFIX "iaid", FALSE },
+ { 0, NULL, FALSE }
+};
+
+static void
+take_option (GHashTable *options,
+ const ReqOption *requests,
+ guint option,
+ char *value)
+{
+ guint i;
+
+ g_return_if_fail (value != NULL);
+
+ for (i = 0; requests[i].name; i++) {
+ if (requests[i].num == option) {
+ g_hash_table_insert (options,
+ (gpointer) (requests[i].name + STRLEN (REQPREFIX)),
+ value);
+ break;
+ }
+ }
+ /* Option should always be found */
+ g_assert (requests[i].name);
+}
+
+static void
+add_option (GHashTable *options, const ReqOption *requests, guint option, const char *value)
+{
+ if (options)
+ take_option (options, requests, option, g_strdup (value));
+}
+
+static void
+add_option_u32 (GHashTable *options, const ReqOption *requests, guint option, guint32 value)
+{
+ if (options)
+ take_option (options, requests, option, g_strdup_printf ("%u", value));
+}
+
+static void
+add_option_u64 (GHashTable *options, const ReqOption *requests, guint option, guint64 value)
+{
+ if (options)
+ take_option (options, requests, option, g_strdup_printf ("%" G_GUINT64_FORMAT, value));
+}
+
+static void
+add_requests_to_options (GHashTable *options, const ReqOption *requests)
+{
+ guint i;
+
+ for (i = 0; options && requests[i].name; i++) {
+ if (requests[i].include)
+ g_hash_table_insert (options, (gpointer) requests[i].name, g_strdup ("1"));
+ }
+}
+
+#define LOG_LEASE(domain, ...) \
+G_STMT_START { \
+ if (log_lease) { \
+ nm_log (LOGL_INFO, (domain), __VA_ARGS__); \
+ } \
+} G_STMT_END
+
+static NMIP4Config *
+lease_to_ip4_config (const char *iface,
+ int ifindex,
+ sd_dhcp_lease *lease,
+ GHashTable *options,
+ guint32 default_priority,
+ gboolean log_lease,
+ GError **error)
+{
+ NMIP4Config *ip4_config = NULL;
+ struct in_addr tmp_addr;
+ const struct in_addr *addr_list;
+ char buf[INET_ADDRSTRLEN];
+ const char *str;
+ guint32 lifetime = 0, i;
+ NMPlatformIP4Address address;
+ GString *l;
+ struct sd_dhcp_route *routes;
+ guint16 mtu;
+ int r, num;
+ guint64 end_time;
+
+ g_return_val_if_fail (lease != NULL, NULL);
+
+ ip4_config = nm_ip4_config_new (ifindex);
+
+ /* Address */
+ sd_dhcp_lease_get_address (lease, &tmp_addr);
+ memset (&address, 0, sizeof (address));
+ address.address = tmp_addr.s_addr;
+ str = nm_utils_inet4_ntop (tmp_addr.s_addr, NULL);
+ LOG_LEASE (LOGD_DHCP4, " address %s", str);
+ add_option (options, dhcp4_requests, DHCP_OPTION_IP_ADDRESS, str);
+
+ /* Prefix/netmask */
+ sd_dhcp_lease_get_netmask (lease, &tmp_addr);
+ address.plen = nm_utils_ip4_netmask_to_prefix (tmp_addr.s_addr);
+ LOG_LEASE (LOGD_DHCP4, " plen %d", address.plen);
+ add_option (options,
+ dhcp4_requests,
+ DHCP_OPTION_SUBNET_MASK,
+ nm_utils_inet4_ntop (tmp_addr.s_addr, NULL));
+
+ /* Lease time */
+ sd_dhcp_lease_get_lifetime (lease, &lifetime);
+ address.timestamp = nm_utils_get_monotonic_timestamp_s ();
+ address.lifetime = address.preferred = lifetime;
+ end_time = (guint64) time (NULL) + lifetime;
+ LOG_LEASE (LOGD_DHCP4, " expires in %" G_GUINT32_FORMAT " seconds", lifetime);
+ add_option_u64 (options,
+ dhcp4_requests,
+ DHCP_OPTION_IP_ADDRESS_LEASE_TIME,
+ end_time);
+
+ address.source = NM_IP_CONFIG_SOURCE_DHCP;
+ nm_ip4_config_add_address (ip4_config, &address);
+
+ /* Gateway */
+ r = sd_dhcp_lease_get_router (lease, &tmp_addr);
+ if (r == 0) {
+ nm_ip4_config_set_gateway (ip4_config, tmp_addr.s_addr);
+ str = nm_utils_inet4_ntop (tmp_addr.s_addr, NULL);
+ LOG_LEASE (LOGD_DHCP4, " gateway %s", str);
+ add_option (options, dhcp4_requests, DHCP_OPTION_ROUTER, str);
+ }
+
+ /* DNS Servers */
+ num = sd_dhcp_lease_get_dns (lease, &addr_list);
+ if (num > 0) {
+ l = g_string_sized_new (30);
+ for (i = 0; i < num; i++) {
+ if (addr_list[i].s_addr) {
+ nm_ip4_config_add_nameserver (ip4_config, addr_list[i].s_addr);
+ str = nm_utils_inet4_ntop (addr_list[i].s_addr, NULL);
+ LOG_LEASE (LOGD_DHCP4, " nameserver '%s'", str);
+ g_string_append_printf (l, "%s%s", l->len ? " " : "", str);
+ }
+ }
+ if (l->len)
+ add_option (options, dhcp4_requests, DHCP_OPTION_DOMAIN_NAME_SERVER, l->str);
+ g_string_free (l, TRUE);
+ }
+
+ /* Domain Name */
+ r = sd_dhcp_lease_get_domainname (lease, &str);
+ if (r == 0) {
+ /* Multiple domains sometimes stuffed into the option */
+ char **domains = g_strsplit (str, " ", 0);
+ char **s;
+
+ for (s = domains; *s; s++) {
+ LOG_LEASE (LOGD_DHCP4, " domain name '%s'", *s);
+ nm_ip4_config_add_domain (ip4_config, *s);
+ }
+ g_strfreev (domains);
+ add_option (options, dhcp4_requests, DHCP_OPTION_DOMAIN_NAME, str);
+ }
+
+ /* Hostname */
+ r = sd_dhcp_lease_get_hostname (lease, &str);
+ if (r == 0) {
+ LOG_LEASE (LOGD_DHCP4, " hostname '%s'", str);
+ add_option (options, dhcp4_requests, DHCP_OPTION_HOST_NAME, str);
+ }
+
+ /* Routes */
+ num = sd_dhcp_lease_get_routes (lease, &routes);
+ if (num > 0) {
+ l = g_string_sized_new (30);
+ for (i = 0; i < num; i++) {
+ NMPlatformIP4Route route;
+ const char *gw_str;
+
+ memset (&route, 0, sizeof (route));
+ route.network = routes[i].dst_addr.s_addr;
+ route.plen = routes[i].dst_prefixlen;
+ route.gateway = routes[i].gw_addr.s_addr;
+ route.source = NM_IP_CONFIG_SOURCE_DHCP;
+ route.metric = default_priority;
+ nm_ip4_config_add_route (ip4_config, &route);
+
+ str = nm_utils_inet4_ntop (route.network, buf);
+ gw_str = nm_utils_inet4_ntop (route.gateway, NULL);
+ LOG_LEASE (LOGD_DHCP4, " static route %s/%d gw %s", str, route.plen, gw_str);
+
+ g_string_append_printf (l, "%s%s/%d %s", l->len ? " " : "", str, route.plen, gw_str);
+ }
+ add_option (options, dhcp4_requests, DHCP_OPTION_RFC3442_ROUTES, l->str);
+ g_string_free (l, TRUE);
+ }
+
+ /* MTU */
+ r = sd_dhcp_lease_get_mtu (lease, &mtu);
+ if (r == 0 && mtu) {
+ nm_ip4_config_set_mtu (ip4_config, mtu, NM_IP_CONFIG_SOURCE_DHCP);
+ add_option_u32 (options, dhcp4_requests, DHCP_OPTION_INTERFACE_MTU, mtu);
+ LOG_LEASE (LOGD_DHCP4, " mtu %u", mtu);
+ }
+
+ /* NTP servers */
+ num = sd_dhcp_lease_get_ntp (lease, &addr_list);
+ if (num > 0) {
+ l = g_string_sized_new (30);
+ for (i = 0; i < num; i++) {
+ str = nm_utils_inet4_ntop (addr_list[i].s_addr, buf);
+ LOG_LEASE (LOGD_DHCP4, " ntp server '%s'", str);
+ g_string_append_printf (l, "%s%s", l->len ? " " : "", str);
+ }
+ add_option (options, dhcp4_requests, DHCP_OPTION_NTP_SERVER, l->str);
+ g_string_free (l, TRUE);
+ }
+
+ return ip4_config;
+}
+
+/************************************************************/
+
+static char *
+get_leasefile_path (const char *iface, const char *uuid, gboolean ipv6)
+{
+ return g_strdup_printf (NMSTATEDIR "/internal%s-%s-%s.lease",
+ ipv6 ? "6" : "",
+ uuid,
+ iface);
+}
+
+static GSList *
+nm_dhcp_systemd_get_lease_ip_configs (const char *iface,
+ int ifindex,
+ const char *uuid,
+ gboolean ipv6,
+ guint32 default_route_metric)
+{
+ GSList *leases = NULL;
+ gs_free char *path = NULL;
+ sd_dhcp_lease *lease = NULL;
+ NMIP4Config *ip4_config;
+ int r;
+
+ if (ipv6)
+ return NULL;
+
+ path = get_leasefile_path (iface, uuid, FALSE);
+ r = sd_dhcp_lease_load (&lease, path);
+ if (r == 0 && lease) {
+ ip4_config = lease_to_ip4_config (iface, ifindex, lease, NULL, default_route_metric, FALSE, NULL);
+ if (ip4_config)
+ leases = g_slist_append (leases, ip4_config);
+ }
+
+ return leases;
+}
+
+/************************************************************/
+
+static void
+_save_client_id (NMDhcpSystemd *self,
+ uint8_t type,
+ const uint8_t *client_id,
+ size_t len)
+{
+ gs_unref_bytes GBytes *b = NULL;
+ gs_free char *buf = NULL;
+
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (client_id != NULL);
+ g_return_if_fail (len > 0);
+
+ if (!nm_dhcp_client_get_client_id (NM_DHCP_CLIENT (self))) {
+ buf = g_malloc (len + 1);
+ buf[0] = type;
+ memcpy (buf + 1, client_id, len);
+ b = g_bytes_new (buf, len + 1);
+ nm_dhcp_client_set_client_id (NM_DHCP_CLIENT (self), b);
+ }
+}
+
+static void
+bound4_handle (NMDhcpSystemd *self)
+{
+ NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (self);
+ const char *iface = nm_dhcp_client_get_iface (NM_DHCP_CLIENT (self));
+ sd_dhcp_lease *lease;
+ NMIP4Config *ip4_config;
+ GHashTable *options;
+ GError *error = NULL;
+ int r;
+
+ nm_log_dbg (LOGD_DHCP4, "(%s): lease available", iface);
+
+ r = sd_dhcp_client_get_lease (priv->client4, &lease);
+ if (r < 0 || !lease) {
+ nm_log_warn (LOGD_DHCP4, "(%s): no lease!", iface);
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL);
+ return;
+ }
+
+ options = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
+ ip4_config = lease_to_ip4_config (iface,
+ nm_dhcp_client_get_ifindex (NM_DHCP_CLIENT (self)),
+ lease,
+ options,
+ nm_dhcp_client_get_priority (NM_DHCP_CLIENT (self)),
+ TRUE,
+ &error);
+ if (ip4_config) {
+ const uint8_t *client_id = NULL;
+ size_t client_id_len = 0;
+ uint8_t type = 0;
+
+ add_requests_to_options (options, dhcp4_requests);
+ sd_dhcp_lease_save (lease, priv->lease_file);
+
+ sd_dhcp_client_get_client_id(priv->client4, &type, &client_id, &client_id_len);
+ if (client_id)
+ _save_client_id (self, type, client_id, client_id_len);
+
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (self),
+ NM_DHCP_STATE_BOUND,
+ G_OBJECT (ip4_config),
+ options);
+ } else {
+ nm_log_warn (LOGD_DHCP4, "(%s): %s", iface, error->message);
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL);
+ g_clear_error (&error);
+ }
+
+ sd_dhcp_lease_unref (lease);
+ g_hash_table_destroy (options);
+ g_clear_object (&ip4_config);
+}
+
+static void
+dhcp_event_cb (sd_dhcp_client *client, int event, gpointer user_data)
+{
+ NMDhcpSystemd *self = NM_DHCP_SYSTEMD (user_data);
+ NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (self);
+ const char *iface = nm_dhcp_client_get_iface (NM_DHCP_CLIENT (self));
+
+ g_assert (priv->client4 == client);
+
+ nm_log_dbg (LOGD_DHCP4, "(%s): DHCPv4 client event %d", iface, event);
+
+ switch (event) {
+ case DHCP_EVENT_EXPIRED:
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (user_data), NM_DHCP_STATE_EXPIRE, NULL, NULL);
+ break;
+ case DHCP_EVENT_STOP:
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (user_data), NM_DHCP_STATE_FAIL, NULL, NULL);
+ break;
+ case DHCP_EVENT_RENEW:
+ case DHCP_EVENT_IP_CHANGE:
+ case DHCP_EVENT_IP_ACQUIRE:
+ bound4_handle (self);
+ break;
+ default:
+ nm_log_warn (LOGD_DHCP4, "(%s): unhandled DHCP event %d", iface, event);
+ break;
+ }
+}
+
+static guint16
+get_arp_type (const GByteArray *hwaddr)
+{
+ if (hwaddr->len == ETH_ALEN)
+ return ARPHRD_ETHER;
+ else if (hwaddr->len == INFINIBAND_ALEN)
+ return ARPHRD_INFINIBAND;
+ else
+ g_assert_not_reached ();
+}
+
+static gboolean
+ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last_ip4_address)
+{
+ NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (client);
+ const char *iface = nm_dhcp_client_get_iface (client);
+ const GByteArray *hwaddr;
+ sd_dhcp_lease *lease = NULL;
+ GBytes *override_client_id;
+ const uint8_t *client_id = NULL;
+ size_t client_id_len = 0;
+ struct in_addr last_addr = { 0 };
+ const char *hostname;
+ int r, i;
+
+ g_assert (priv->client4 == NULL);
+ g_assert (priv->client6 == NULL);
+
+ g_free (priv->lease_file);
+ priv->lease_file = get_leasefile_path (iface, nm_dhcp_client_get_uuid (client), FALSE);
+
+ r = sd_dhcp_client_new (&priv->client4);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to create DHCPv4 client (%d)", iface, r);
+ return FALSE;
+ }
+
+ r = sd_dhcp_client_attach_event (priv->client4, NULL, 0);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to attach DHCP event (%d)", iface, r);
+ goto error;
+ }
+
+ hwaddr = nm_dhcp_client_get_hw_addr (client);
+ if (hwaddr) {
+ r = sd_dhcp_client_set_mac (priv->client4,
+ hwaddr->data,
+ hwaddr->len,
+ get_arp_type (hwaddr));
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to set DHCP MAC address (%d)", iface, r);
+ goto error;
+ }
+ }
+
+ r = sd_dhcp_client_set_index (priv->client4, nm_dhcp_client_get_ifindex (client));
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to set DHCP ifindex (%d)", iface, r);
+ goto error;
+ }
+
+ r = sd_dhcp_client_set_callback (priv->client4, dhcp_event_cb, client);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to set DHCP callback (%d)", iface, r);
+ goto error;
+ }
+
+ r = sd_dhcp_client_set_request_broadcast (priv->client4, true);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to set DHCP broadcast (%d)", iface, r);
+ goto error;
+ }
+
+ sd_dhcp_lease_load (&lease, priv->lease_file);
+
+ if (last_ip4_address)
+ inet_pton (AF_INET, last_ip4_address, &last_addr);
+ else if (lease)
+ sd_dhcp_lease_get_address (lease, &last_addr);
+
+ if (last_addr.s_addr) {
+ r = sd_dhcp_client_set_request_address (priv->client4, &last_addr);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to set last IPv4 address (%d)", iface, r);
+ goto error;
+ }
+ }
+
+ override_client_id = nm_dhcp_client_get_client_id (client);
+ if (override_client_id) {
+ client_id = g_bytes_get_data (override_client_id, &client_id_len);
+ g_assert (client_id && client_id_len);
+ sd_dhcp_client_set_client_id (priv->client4,
+ client_id[0],
+ client_id + 1,
+ client_id_len - 1);
+ } else if (lease) {
+ r = sd_dhcp_lease_get_client_id (lease, &client_id, &client_id_len);
+ if (r == 0 && client_id_len) {
+ sd_dhcp_client_set_client_id (priv->client4,
+ client_id[0],
+ client_id + 1,
+ client_id_len - 1);
+ _save_client_id (NM_DHCP_SYSTEMD (client),
+ client_id[0],
+ client_id + 1,
+ client_id_len - 1);
+ }
+ }
+
+ if (lease)
+ sd_dhcp_lease_unref (lease);
+
+ /* Add requested options */
+ for (i = 0; dhcp4_requests[i].name; i++) {
+ if (dhcp4_requests[i].include)
+ sd_dhcp_client_set_request_option (priv->client4, dhcp4_requests[i].num);
+ }
+
+ hostname = nm_dhcp_client_get_hostname (client);
+ if (hostname) {
+ r = sd_dhcp_client_set_hostname (priv->client4, hostname);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to set DHCP hostname (%d)", iface, r);
+ goto error;
+ }
+ }
+
+ r = sd_dhcp_client_start (priv->client4);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to start DHCP (%d)", iface, r);
+ goto error;
+ }
+
+ return TRUE;
+
+error:
+ sd_dhcp_client_unref (priv->client4);
+ priv->client4 = NULL;
+ return FALSE;
+}
+
+static void
+bound6_handle (NMDhcpSystemd *self)
+{
+ /* not yet supported... */
+ nm_log_warn (LOGD_DHCP6, "(%s): internal DHCP does not yet support DHCPv6",
+ nm_dhcp_client_get_iface (NM_DHCP_CLIENT (self)));
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL);
+}
+
+static void
+dhcp6_event_cb (sd_dhcp6_client *client, int event, gpointer user_data)
+{
+ NMDhcpSystemd *self = NM_DHCP_SYSTEMD (user_data);
+ NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (self);
+ const char *iface = nm_dhcp_client_get_iface (NM_DHCP_CLIENT (self));
+
+ g_assert (priv->client6 == client);
+
+ nm_log_dbg (LOGD_DHCP6, "(%s): DHCPv6 client event %d", iface, event);
+
+ switch (event) {
+ case DHCP6_EVENT_RETRANS_MAX:
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (user_data), NM_DHCP_STATE_TIMEOUT, NULL, NULL);
+ break;
+ case DHCP6_EVENT_RESEND_EXPIRE:
+ case DHCP6_EVENT_STOP:
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (user_data), NM_DHCP_STATE_FAIL, NULL, NULL);
+ break;
+ case DHCP6_EVENT_IP_ACQUIRE:
+ bound6_handle (self);
+ break;
+ default:
+ nm_log_warn (LOGD_DHCP6, "(%s): unhandled DHCPv6 event %d", iface, event);
+ break;
+ }
+}
+
+static gboolean
+ip6_start (NMDhcpClient *client,
+ const char *dhcp_anycast_addr,
+ gboolean info_only,
+ NMSettingIP6ConfigPrivacy privacy,
+ const GByteArray *duid)
+{
+ NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (client);
+ const char *iface = nm_dhcp_client_get_iface (client);
+ const GByteArray *hwaddr;
+ int r, i;
+
+ g_assert (priv->client4 == NULL);
+ g_assert (priv->client6 == NULL);
+ g_return_val_if_fail (duid != NULL, FALSE);
+
+ g_free (priv->lease_file);
+ priv->lease_file = get_leasefile_path (iface, nm_dhcp_client_get_uuid (client), TRUE);
+
+ r = sd_dhcp6_client_new (&priv->client6);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP6, "(%s): failed to create DHCPv6 client (%d)", iface, r);
+ return FALSE;
+ }
+
+ /* NM stores the entire DUID which includes the uint16 "type", while systemd
+ * wants the type passed separately from the following data.
+ */
+ r = sd_dhcp6_client_set_duid (priv->client6,
+ ntohs (((const guint16 *) duid->data)[0]),
+ duid->data + 2,
+ duid->len - 2);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP6, "(%s): failed to create DHCPv6 client (%d)", iface, r);
+ return FALSE;
+ }
+
+ r = sd_dhcp6_client_attach_event (priv->client6, NULL, 0);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP6, "(%s): failed to attach DHCP event (%d)", iface, r);
+ goto error;
+ }
+
+ hwaddr = nm_dhcp_client_get_hw_addr (client);
+ if (hwaddr) {
+ r = sd_dhcp6_client_set_mac (priv->client6,
+ hwaddr->data,
+ hwaddr->len,
+ get_arp_type (hwaddr));
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP6, "(%s): failed to set DHCP MAC address (%d)", iface, r);
+ goto error;
+ }
+ }
+
+ r = sd_dhcp6_client_set_index (priv->client6, nm_dhcp_client_get_ifindex (client));
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP6, "(%s): failed to set DHCP ifindex (%d)", iface, r);
+ goto error;
+ }
+
+ r = sd_dhcp6_client_set_callback (priv->client6, dhcp6_event_cb, client);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP6, "(%s): failed to set DHCP callback (%d)", iface, r);
+ goto error;
+ }
+
+ /* Add requested options */
+ for (i = 0; dhcp6_requests[i].name; i++) {
+ if (dhcp6_requests[i].include)
+ sd_dhcp6_client_set_request_option (priv->client6, dhcp6_requests[i].num);
+ }
+
+ r = sd_dhcp6_client_start (priv->client6);
+ if (r < 0) {
+ nm_log_warn (LOGD_DHCP6, "(%s): failed to start DHCP (%d)", iface, r);
+ goto error;
+ }
+
+ return TRUE;
+
+error:
+ sd_dhcp6_client_unref (priv->client6);
+ priv->client6 = NULL;
+ return FALSE;
+}
+
+static void
+stop (NMDhcpClient *client, gboolean release, const GByteArray *duid)
+{
+ NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (client);
+ int r = 0;
+
+ if (priv->client4)
+ r = sd_dhcp_client_stop (priv->client4);
+ else if (priv->client6)
+ r = sd_dhcp6_client_stop (priv->client6);
+
+ if (r) {
+ nm_log_warn (priv->client6 ? LOGD_DHCP6 : LOGD_DHCP4,
+ "(%s): failed to stop DHCP client (%d)",
+ nm_dhcp_client_get_iface (client),
+ r);
+ }
+}
+
+/***************************************************/
+
+static void
+nm_dhcp_systemd_init (NMDhcpSystemd *self)
+{
+}
+
+static void
+dispose (GObject *object)
+{
+ NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (object);
+
+ g_clear_pointer (&priv->lease_file, g_free);
+
+ if (priv->client4) {
+ sd_dhcp_client_stop (priv->client4);
+ sd_dhcp_client_unref (priv->client4);
+ priv->client4 = NULL;
+ }
+
+ if (priv->client6) {
+ sd_dhcp6_client_stop (priv->client6);
+ sd_dhcp6_client_unref (priv->client6);
+ priv->client6 = NULL;
+ }
+
+ G_OBJECT_CLASS (nm_dhcp_systemd_parent_class)->dispose (object);
+}
+
+static void
+nm_dhcp_systemd_class_init (NMDhcpSystemdClass *sdhcp_class)
+{
+ NMDhcpClientClass *client_class = NM_DHCP_CLIENT_CLASS (sdhcp_class);
+ GObjectClass *object_class = G_OBJECT_CLASS (sdhcp_class);
+
+ g_type_class_add_private (sdhcp_class, sizeof (NMDhcpSystemdPrivate));
+
+ /* virtual methods */
+ object_class->dispose = dispose;
+
+ client_class->ip4_start = ip4_start;
+ client_class->ip6_start = ip6_start;
+ client_class->stop = stop;
+}
+
+static void __attribute__((constructor))
+register_dhcp_dhclient (void)
+{
+ g_type_init ();
+ _nm_dhcp_client_register (NM_TYPE_DHCP_SYSTEMD,
+ "internal",
+ NULL,
+ nm_dhcp_systemd_get_lease_ip_configs);
+}
+
diff --git a/src/dhcp-manager/nm-dhcp-systemd.h b/src/dhcp-manager/nm-dhcp-systemd.h
new file mode 100644
index 0000000000..2a7a463eb5
--- /dev/null
+++ b/src/dhcp-manager/nm-dhcp-systemd.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, 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) 2014 Red Hat, Inc.
+ */
+
+#ifndef NM_DHCP_SYSTEMD_H
+#define NM_DHCP_SYSTEMD_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "nm-dhcp-client.h"
+
+#define NM_TYPE_DHCP_SYSTEMD (nm_dhcp_systemd_get_type ())
+#define NM_DHCP_SYSTEMD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_SYSTEMD, NMDhcpSystemd))
+#define NM_DHCP_SYSTEMD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_SYSTEMD, NMDhcpSystemdClass))
+#define NM_IS_DHCP_SYSTEMD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_SYSTEMD))
+#define NM_IS_DHCP_SYSTEMD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP_SYSTEMD))
+#define NM_DHCP_SYSTEMD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_SYSTEMD, NMDhcpSystemdClass))
+
+typedef struct {
+ NMDhcpClient parent;
+} NMDhcpSystemd;
+
+typedef struct {
+ NMDhcpClientClass parent;
+} NMDhcpSystemdClass;
+
+GType nm_dhcp_systemd_get_type (void);
+
+#endif /* NM_DHCP_SYSTEMD_H */
+
diff --git a/src/dhcp-manager/nm-dhcp-utils.c b/src/dhcp-manager/nm-dhcp-utils.c
index 014937f6ea..e50b4e3b8b 100644
--- a/src/dhcp-manager/nm-dhcp-utils.c
+++ b/src/dhcp-manager/nm-dhcp-utils.c
@@ -17,11 +17,13 @@
*
*/
-#include <config.h>
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
+#include <arpa/inet.h>
#include "nm-logging.h"
#include "nm-dhcp-utils.h"
@@ -33,7 +35,7 @@
static gboolean
ip4_process_dhcpcd_rfc3442_routes (const char *str,
- guint priority,
+ guint32 priority,
NMIP4Config *ip4_config,
guint32 *gwaddr)
{
@@ -138,6 +140,7 @@ process_dhclient_rfc3442_route (const char **octets,
g_free (str_addr);
goto error;
}
+ g_free (str_addr);
tmp_addr &= nm_utils_ip4_prefix_to_netmask ((guint32) tmp);
route->network = tmp_addr;
}
@@ -160,7 +163,7 @@ error:
static gboolean
ip4_process_dhclient_rfc3442_routes (const char *str,
- guint priority,
+ guint32 priority,
NMIP4Config *ip4_config,
guint32 *gwaddr)
{
@@ -208,7 +211,7 @@ out:
static gboolean
ip4_process_classless_routes (GHashTable *options,
- guint priority,
+ guint32 priority,
NMIP4Config *ip4_config,
guint32 *gwaddr)
{
@@ -271,7 +274,7 @@ ip4_process_classless_routes (GHashTable *options,
}
static void
-process_classful_routes (GHashTable *options, guint priority, NMIP4Config *ip4_config)
+process_classful_routes (GHashTable *options, guint32 priority, NMIP4Config *ip4_config)
{
const char *str;
char **searches, **s;
@@ -371,9 +374,10 @@ ip4_add_domain_search (gpointer data, gpointer user_data)
}
NMIP4Config *
-nm_dhcp_utils_ip4_config_from_options (const char *iface,
+nm_dhcp_utils_ip4_config_from_options (int ifindex,
+ const char *iface,
GHashTable *options,
- guint priority)
+ guint32 priority)
{
NMIP4Config *ip4_config = NULL;
guint32 tmp_addr;
@@ -383,7 +387,7 @@ nm_dhcp_utils_ip4_config_from_options (const char *iface,
g_return_val_if_fail (options != NULL, NULL);
- ip4_config = nm_ip4_config_new ();
+ ip4_config = nm_ip4_config_new (ifindex);
memset (&address, 0, sizeof (address));
address.timestamp = nm_utils_get_monotonic_timestamp_s ();
@@ -588,9 +592,10 @@ ip6_add_domain_search (gpointer data, gpointer user_data)
}
NMIP6Config *
-nm_dhcp_utils_ip6_config_from_options (const char *iface,
+nm_dhcp_utils_ip6_config_from_options (int ifindex,
+ const char *iface,
GHashTable *options,
- guint priority,
+ guint32 priority,
gboolean info_only)
{
NMIP6Config *ip6_config = NULL;
@@ -612,7 +617,7 @@ nm_dhcp_utils_ip6_config_from_options (const char *iface,
iface, (const char *) key, (const char *) value);
}
- ip6_config = nm_ip6_config_new ();
+ ip6_config = nm_ip6_config_new (ifindex);
str = g_hash_table_lookup (options, "max_life");
if (str) {
@@ -692,3 +697,39 @@ nm_dhcp_utils_duid_to_string (const GByteArray *duid)
return g_string_free (s, FALSE);
}
+/**
+ * nm_dhcp_utils_client_id_string_to_bytes:
+ * @client_id: the client ID string
+ *
+ * Accepts either a hex string ("aa:bb:cc") representing a binary client ID
+ * (the first byte is assumed to be the 'type' field per RFC 2132 section 9.14),
+ * or a string representing a non-hardware-address client ID, in which case
+ * the 'type' field is set to 0.
+ *
+ * Returns: the binary client ID suitable for sending over the wire
+ * to the DHCP server.
+ */
+GBytes *
+nm_dhcp_utils_client_id_string_to_bytes (const char *client_id)
+{
+ GBytes *bytes = NULL;
+ guint len;
+ char *c;
+
+ g_return_val_if_fail (client_id && client_id[0], NULL);
+
+ /* Try as hex encoded */
+ if (strchr (client_id, ':'))
+ bytes = nm_utils_hexstr2bin (client_id);
+ if (!bytes) {
+ /* Fall back to string */
+ len = strlen (client_id);
+ c = g_malloc (len + 1);
+ c[0] = 0; /* type: non-hardware address per RFC 2132 section 9.14 */
+ memcpy (c + 1, client_id, len);
+ bytes = g_bytes_new_take (c, len + 1);
+ }
+
+ return bytes;
+}
+
diff --git a/src/dhcp-manager/nm-dhcp-utils.h b/src/dhcp-manager/nm-dhcp-utils.h
index ab9d45fe4b..42cf900f2a 100644
--- a/src/dhcp-manager/nm-dhcp-utils.h
+++ b/src/dhcp-manager/nm-dhcp-utils.h
@@ -24,16 +24,20 @@
#include <nm-ip4-config.h>
#include <nm-ip6-config.h>
-NMIP4Config *nm_dhcp_utils_ip4_config_from_options (const char *iface,
+NMIP4Config *nm_dhcp_utils_ip4_config_from_options (int ifindex,
+ const char *iface,
GHashTable *options,
guint priority);
-NMIP6Config *nm_dhcp_utils_ip6_config_from_options (const char *iface,
+NMIP6Config *nm_dhcp_utils_ip6_config_from_options (int ifindex,
+ const char *iface,
GHashTable *options,
guint priority,
gboolean info_only);
char * nm_dhcp_utils_duid_to_string (const GByteArray *duid);
+GBytes * nm_dhcp_utils_client_id_string_to_bytes (const char *client_id);
+
#endif /* __NETWORKMANAGER_DHCP_UTILS_H__ */
diff --git a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c
new file mode 100644
index 0000000000..a6d817278e
--- /dev/null
+++ b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c
@@ -0,0 +1,209 @@
+/* -*- 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 (C) 2014 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "sd-event.h"
+#include "time-util.h"
+
+struct sd_event_source {
+ guint refcount;
+ guint id;
+ gpointer user_data;
+
+ GIOChannel *channel;
+ sd_event_io_handler_t io_cb;
+
+ uint64_t usec;
+ sd_event_time_handler_t time_cb;
+};
+
+int
+sd_event_source_set_priority (sd_event_source *s, int64_t priority)
+{
+ return 0;
+}
+
+sd_event_source*
+sd_event_source_unref (sd_event_source *s)
+{
+
+ if (!s)
+ return NULL;
+
+ g_return_val_if_fail (s->refcount, NULL);
+
+ s->refcount--;
+ if (s->refcount == 0) {
+ if (s->id)
+ g_source_remove (s->id);
+ if (s->channel) {
+ /* Don't shut down the channel since systemd will soon close
+ * the file descriptor itself, which would cause -EBADF.
+ */
+ g_io_channel_unref (s->channel);
+ }
+ g_free (s);
+ }
+ return NULL;
+}
+
+int
+sd_event_source_set_description(sd_event_source *s, const char *description)
+{
+ if (!s)
+ return -EINVAL;
+
+ g_source_set_name_by_id (s->id, description);
+ return 0;
+}
+
+static gboolean
+io_ready (GIOChannel *channel, GIOCondition condition, struct sd_event_source *source)
+{
+ int r, revents = 0;
+
+ if (condition & G_IO_IN)
+ revents |= EPOLLIN;
+ if (condition & G_IO_OUT)
+ revents |= EPOLLOUT;
+ if (condition & G_IO_PRI)
+ revents |= EPOLLPRI;
+ if (condition & G_IO_ERR)
+ revents |= EPOLLERR;
+ if (condition & G_IO_HUP)
+ revents |= EPOLLHUP;
+
+ r = source->io_cb (source, g_io_channel_unix_get_fd (channel), revents, source->user_data);
+ if (r < 0) {
+ source->id = 0;
+ return G_SOURCE_REMOVE;
+ }
+
+ return G_SOURCE_CONTINUE;
+}
+
+int
+sd_event_add_io (sd_event *e, sd_event_source **s, int fd, uint32_t events, sd_event_io_handler_t callback, void *userdata)
+{
+ struct sd_event_source *source;
+ GIOChannel *channel;
+ GIOCondition condition = 0;
+
+ channel = g_io_channel_unix_new (fd);
+ if (!channel)
+ return -EINVAL;
+
+ source = g_new0 (struct sd_event_source, 1);
+ source->refcount = 1;
+ source->io_cb = callback;
+ source->user_data = userdata;
+ source->channel = channel;
+
+ if (events & EPOLLIN)
+ condition |= G_IO_IN;
+ if (events & EPOLLOUT)
+ condition |= G_IO_OUT;
+ if (events & EPOLLPRI)
+ condition |= G_IO_PRI;
+ if (events & EPOLLERR)
+ condition |= G_IO_ERR;
+ if (events & EPOLLHUP)
+ condition |= G_IO_HUP;
+
+ g_io_channel_set_encoding (source->channel, NULL, NULL);
+ g_io_channel_set_buffered (source->channel, FALSE);
+ source->id = g_io_add_watch (source->channel, condition, (GIOFunc) io_ready, source);
+
+ *s = source;
+ return 0;
+}
+
+static gboolean
+time_ready (struct sd_event_source *source)
+{
+ int r;
+
+ r = source->time_cb (source, source->usec, source->user_data);
+ if (r < 0) {
+ source->id = 0;
+ return G_SOURCE_REMOVE;
+ }
+
+ return G_SOURCE_CONTINUE;
+}
+
+int
+sd_event_add_time(sd_event *e, sd_event_source **s, clockid_t clock, uint64_t usec, uint64_t accuracy, sd_event_time_handler_t callback, void *userdata)
+{
+ struct sd_event_source *source;
+ uint64_t n = now (clock);
+
+ source = g_new0 (struct sd_event_source, 1);
+ source->refcount = 1;
+ source->time_cb = callback;
+ source->user_data = userdata;
+ source->usec = usec;
+
+ if (usec > 1000)
+ usec = n < usec - 1000 ? usec - n : 1000;
+ source->id = g_timeout_add (usec / 1000, (GSourceFunc) time_ready, source);
+
+ *s = source;
+ return 0;
+}
+
+/* sd_event is basically a GMainContext; but since we only
+ * ever use the default context, nothing to do here.
+ */
+
+int
+sd_event_default (sd_event **e)
+{
+ *e = GUINT_TO_POINTER (1);
+ return 0;
+}
+
+sd_event*
+sd_event_ref (sd_event *e)
+{
+ return e;
+}
+
+sd_event*
+sd_event_unref (sd_event *e)
+{
+ return NULL;
+}
+
+int
+sd_event_now (sd_event *e, clockid_t clock, uint64_t *usec)
+{
+ *usec = now (clock);
+ return 0;
+}
+
+int asynchronous_close(int fd) {
+ safe_close(fd);
+ return -1;
+}
+
diff --git a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.h b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.h
new file mode 100644
index 0000000000..06ebcd1b23
--- /dev/null
+++ b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.h
@@ -0,0 +1,113 @@
+/* -*- 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 (C) 2014 Red Hat, Inc.
+ */
+
+#ifndef NM_SD_ADAPT_H
+#define NM_SD_ADAPT_H
+
+#include <config.h>
+
+#include <glib.h>
+
+#include <netinet/in.h>
+#include <stdbool.h>
+#include <syslog.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <elf.h>
+#ifdef HAVE_SYS_AUXV_H
+#include <sys/auxv.h>
+#endif
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#include <net/if_arp.h>
+#include <sys/resource.h>
+
+#include "nm-logging.h"
+
+/*****************************************************************************/
+
+static inline NMLogLevel
+_slog_level_to_nm (int slevel)
+{
+ switch (slevel) {
+ case LOG_DEBUG: return LOGL_DEBUG;
+ case LOG_WARNING: return LOGL_WARN;
+ case LOG_CRIT:
+ case LOG_ERR: return LOGL_ERR;
+ case LOG_INFO:
+ case LOG_NOTICE:
+ default: return LOGL_INFO;
+ }
+}
+
+#define log_internal(level, error, file, line, func, format, ...) \
+({ \
+ int _nm_e = (error); \
+ NMLogLevel _nm_l = _slog_level_to_nm ((level)); \
+ if (nm_logging_enabled (_nm_l, LOGD_DHCP)) { \
+ const char *_nm_location = strrchr ((""file), '/'); \
+ \
+ _nm_log (_nm_location ? _nm_location + 1 : (""file), (line), (func), _nm_l, LOGD_DHCP, _nm_e, ("%s"format), "sd-dhcp: ", ## __VA_ARGS__); \
+ } \
+ (_nm_e > 0 ? -_nm_e : _nm_e); \
+})
+
+#define log_full_errno(level, error, ...) \
+({ \
+ log_internal(level, error, __FILE__, __LINE__, __func__, __VA_ARGS__); \
+})
+
+#define log_assert_failed(text, file, line, func) \
+G_STMT_START { \
+ log_internal (LOG_CRIT, 0, file, line, func, "Assertion '%s' failed at %s:%u, function %s(). Aborting.", text, file, line, func); \
+ g_assert_not_reached (); \
+} G_STMT_END
+
+#define log_assert_failed_return(text, file, line, func) \
+G_STMT_START { \
+ log_internal (LOG_DEBUG, 0, file, line, func, "Assertion '%s' failed at %s:%u, function %s(). Ignoring.", text, file, line, func); \
+ g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, text); \
+} G_STMT_END
+
+
+/*****************************************************************************/
+
+/* Can't include both net/if.h and linux/if.h; so have to define this here */
+#ifndef IFNAMSIZ
+#define IFNAMSIZ 16
+#endif
+
+#ifndef MAX_HANDLE_SZ
+#define MAX_HANDLE_SZ 128
+#endif
+
+#define noreturn G_GNUC_NORETURN
+
+#include "sd-id128.h"
+#include "sparse-endian.h"
+#include "async.h"
+#include "util.h"
+
+static inline pid_t gettid(void) {
+ return (pid_t) syscall(SYS_gettid);
+}
+
+#endif /* NM_SD_ADAPT_H */
+
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c
index f7a1492363..c33761bc13 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c
@@ -19,13 +19,18 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
#include "sd-id128.h"
+#if 0 /* NM_IGNORED a*/
#include "libudev.h"
#include "udev-util.h"
#include "virt.h"
#include "sparse-endian.h"
+#else /* NM_IGNORED */
+#include <net/if.h>
+#endif /* NM_IGNORED */
#include "siphash24.h"
#include "dhcp6-protocol.h"
@@ -59,12 +64,17 @@ int dhcp_identifier_set_duid_en(struct duid *duid, size_t *len) {
int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, uint32_t *_id) {
+#if 0 /* NM_IGNORED */
/* name is a pointer to memory in the udev_device struct, so must
have the same scope */
_cleanup_udev_device_unref_ struct udev_device *device = NULL;
+#else /* NM_IGNORED */
+ char name_buf[IF_NAMESIZE];
+#endif /* NM_IGNORED */
const char *name = NULL;
uint64_t id;
+#if 0 /* NM_IGNORED */
if (detect_container(NULL) <= 0) {
/* not in a container, udev will be around */
_cleanup_udev_unref_ struct udev *udev;
@@ -84,6 +94,9 @@ int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, uint32_t
name = net_get_name(device);
}
}
+#else /* NM_IGNORED */
+ name = if_indextoname(ifindex, name_buf);
+#endif /* NM_IGNORED */
if (name)
siphash24((uint8_t*)&id, name, strlen(name), HASH_KEY.bytes);
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h
index 643d4970d5..5d4da21cb0 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h
@@ -21,6 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
#include "macro.h"
#include "sparse-endian.h"
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h
index 7c60ef123c..b94c43f3b8 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdint.h>
#include <linux/if_packet.h>
#include <net/if_arp.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-lease-internal.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-lease-internal.h
index 9e184ac4b5..2d7bf03bab 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-lease-internal.h
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-lease-internal.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdint.h>
#include <linux/if_packet.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c
index 7f10838de1..0b63028b46 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c
@@ -17,6 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <errno.h>
#include <sys/socket.h>
#include <string.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-option.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-option.c
index b6110c5f16..50ecf87383 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-option.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-option.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdint.h>
#include <string.h>
#include <errno.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c
index cd7f5095ca..bb9bd90491 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c
@@ -18,6 +18,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <errno.h>
#include <string.h>
#include <net/ethernet.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-protocol.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-protocol.h
index abca9422c5..da483feadf 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-protocol.h
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-protocol.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <netinet/udp.h>
#include <netinet/ip.h>
#include <stdint.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-internal.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-internal.h
index 4f54ad89a6..ee4014faab 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-internal.h
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-internal.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <net/ethernet.h>
#include <netinet/in.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-lease-internal.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-lease-internal.h
index 109e0f4f21..9f7826c466 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-lease-internal.h
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-lease-internal.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdint.h>
#include "refcnt.h"
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-network.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-network.c
index fe56c10273..626a4d6a7f 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-network.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-network.c
@@ -17,6 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-option.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-option.c
index ea863f45e4..10872a3159 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-option.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-option.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <netinet/in.h>
#include <errno.h>
#include <string.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-protocol.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-protocol.h
index 3e0f339237..6598d86074 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-protocol.h
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-protocol.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <netinet/ip6.h>
#include <netinet/udp.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.c
index d579755cc8..bc691abf26 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.c
@@ -19,20 +19,29 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <netinet/ether.h>
#include <linux/if.h>
#include <arpa/inet.h>
+#if 0 /* NM_IGNORED */
#include "strv.h"
#include "siphash24.h"
+#endif /* NM_IGNORED */
#include "dhcp-lease-internal.h"
+#if 0 /* NM_IGNORED */
#include "log.h"
#include "utf8.h"
+#endif /* NM_IGNORED */
#include "util.h"
+#if 0 /* NM_IGNORED */
#include "conf-parser.h"
#include "condition.h"
+#endif /* NM_IGNORED */
#include "network-internal.h"
+#if 0 /* NM_IGNORED */
const char *net_get_name(struct udev_device *device) {
const char *name, *field;
@@ -334,6 +343,7 @@ int config_parse_hwaddr(const char *unit,
return 0;
}
+#endif /* NM_IGNORED */
void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) {
unsigned i;
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.h
index 06aba893ce..f94099f57a 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.h
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.h
@@ -21,8 +21,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdbool.h>
+#if 0 /* NM_IGNORED */
#include "udev.h"
#include "condition.h"
@@ -64,6 +67,7 @@ int config_parse_ifalias(const char *unit, const char *filename, unsigned line,
int net_get_unique_predictable_data(struct udev_device *device, uint8_t result[8]);
const char *net_get_name(struct udev_device *device);
+#endif /* NM_IGNORED */
void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
int deserialize_in_addrs(struct in_addr **addresses, const char *string);
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c
index a477cccecb..5d63866cf7 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c
@@ -17,6 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdlib.h>
#include <errno.h>
#include <string.h>
@@ -399,7 +401,7 @@ static void client_stop(sd_dhcp_client *client, int error) {
static int client_message_init(sd_dhcp_client *client, DHCPPacket **ret,
uint8_t type, size_t *_optlen, size_t *_optoffset) {
- _cleanup_free_ DHCPPacket *packet;
+ _cleanup_free_ DHCPPacket *packet = NULL;
size_t optlen, optoffset, size;
be16_t max_size;
usec_t time_now;
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-lease.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-lease.c
index fa1fa112b1..ee6d72dffc 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-lease.c
@@ -18,6 +18,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdlib.h>
#include <errno.h>
#include <string.h>
@@ -670,7 +672,7 @@ int sd_dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) {
r = sd_dhcp_lease_get_client_id(lease, &client_id, &client_id_len);
if (r >= 0) {
- _cleanup_free_ char *client_id_hex;
+ _cleanup_free_ char *client_id_hex = NULL;
client_id_hex = hexmem (client_id, client_id_len);
if (!client_id_hex) {
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c
index 3db1cb09db..8b29898b14 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c
@@ -19,13 +19,17 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/if_infiniband.h>
+#if 0 /* NM_IGNORED */
#include "udev.h"
#include "udev-util.h"
+#endif /* NM_IGNORED */
#include "util.h"
#include "refcnt.h"
@@ -849,7 +853,7 @@ static int client_receive_message(sd_event_source *s, int fd, uint32_t revents,
void *userdata) {
sd_dhcp6_client *client = userdata;
DHCP6_CLIENT_DONT_DESTROY(client);
- _cleanup_free_ DHCP6Message *message;
+ _cleanup_free_ DHCP6Message *message = NULL;
int r, buflen, len;
assert(s);
@@ -1247,3 +1251,4 @@ int sd_dhcp6_client_new(sd_dhcp6_client **ret)
return 0;
}
+
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-lease.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-lease.c
index 2442269a3f..8ac18a7566 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-lease.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-lease.c
@@ -18,6 +18,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <errno.h>
#include "util.h"
diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd/sd-id128/sd-id128.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd/sd-id128/sd-id128.c
index f0ffedc38b..909467d696 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd/sd-id128/sd-id128.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd/sd-id128/sd-id128.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
@@ -27,6 +29,7 @@
#include "macro.h"
#include "sd-id128.h"
+#if 0 /* NM_IGNORED */
_public_ char *sd_id128_to_string(sd_id128_t id, char s[33]) {
unsigned n;
@@ -102,6 +105,7 @@ static sd_id128_t make_v4_uuid(sd_id128_t id) {
return id;
}
+#endif
_public_ int sd_id128_get_machine(sd_id128_t *ret) {
static thread_local sd_id128_t saved_machine_id;
@@ -148,6 +152,7 @@ _public_ int sd_id128_get_machine(sd_id128_t *ret) {
return 0;
}
+#if 0 /* NM_IGNORED */
_public_ int sd_id128_get_boot(sd_id128_t *ret) {
static thread_local sd_id128_t saved_boot_id;
static thread_local bool saved_boot_id_valid = false;
@@ -220,3 +225,4 @@ _public_ int sd_id128_randomize(sd_id128_t *ret) {
*ret = make_v4_uuid(t);
return 0;
}
+#endif /* NM_IGNORED */
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/async.h b/src/dhcp-manager/systemd-dhcp/src/shared/async.h
index 7f1ef79532..44b886a661 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/async.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/async.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
int asynchronous_job(void* (*func)(void *p), void *arg);
int asynchronous_sync(void);
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/fileio.c b/src/dhcp-manager/systemd-dhcp/src/shared/fileio.c
index ff6b1a7ed7..d167c18cce 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/fileio.c
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/fileio.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <unistd.h>
#include "util.h"
@@ -508,7 +510,7 @@ static int parse_env_file_push(
va_list aq, *ap = userdata;
if (!utf8_is_valid(key)) {
- _cleanup_free_ char *p;
+ _cleanup_free_ char *p = NULL;
p = utf8_escape_invalid(key);
log_error("%s:%u: invalid UTF-8 in key '%s', ignoring.", strna(filename), line, p);
@@ -516,7 +518,7 @@ static int parse_env_file_push(
}
if (value && !utf8_is_valid(value)) {
- _cleanup_free_ char *p;
+ _cleanup_free_ char *p = NULL;
p = utf8_escape_invalid(value);
log_error("%s:%u: invalid UTF-8 value for key %s: '%s', ignoring.", strna(filename), line, key, p);
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/fileio.h b/src/dhcp-manager/systemd-dhcp/src/shared/fileio.h
index 5ae51c1e28..fccea7725a 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/fileio.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/fileio.h
@@ -20,6 +20,9 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+
+#include "nm-sd-adapt.h"
+
#include <stddef.h>
#include <stdio.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.c b/src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.c
index d88864b598..488f6d1ebd 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.c
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <arpa/inet.h>
#include "in-addr-util.h"
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.h b/src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.h
index 51af08868c..715ded330f 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <netinet/in.h>
#include "macro.h"
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/list.h b/src/dhcp-manager/systemd-dhcp/src/shared/list.h
index 2939216adb..af121d7009 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/list.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/list.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
/* The head of the linked list. Use this in the structure that shall
* contain the head of the linked list */
#define LIST_HEAD(t,name) \
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/log.h b/src/dhcp-manager/systemd-dhcp/src/shared/log.h
index d6061c05ea..e9cfe1a287 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/log.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/log.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdbool.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -75,6 +77,7 @@ void log_close_console(void);
void log_parse_environment(void);
+#if 0 /* NM_IGNORED */
int log_internal(
int level,
int error,
@@ -162,6 +165,7 @@ void log_assert_failed_return(
? log_internal(_level, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \
: -abs(_e); \
})
+#endif /* NM_IGNORED */
#define log_full(level, ...) log_full_errno(level, 0, __VA_ARGS__)
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/macro.h b/src/dhcp-manager/systemd-dhcp/src/shared/macro.h
index 7f89951d62..d5cb240b3b 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/macro.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/macro.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <assert.h>
#include <sys/param.h>
#include <sys/types.h>
@@ -397,11 +399,11 @@ do { \
#define IN_SET(x, y, ...) \
({ \
const typeof(y) _y = (y); \
- const typeof(_y) _x = (x); \
+ typeof(_y) _x = (x); \
unsigned _i; \
bool _found = false; \
- for (_i = 0; _i < 1 + sizeof((const typeof(_x)[]) { __VA_ARGS__ })/sizeof(const typeof(_x)); _i++) \
- if (((const typeof(_x)[]) { _y, __VA_ARGS__ })[_i] == _x) { \
+ for (_i = 0; _i < 1 + sizeof((typeof(_x)[]) { __VA_ARGS__ })/sizeof(typeof(_x)); _i++) \
+ if (((typeof(_x)[]) { _y, __VA_ARGS__ })[_i] == _x) { \
_found = true; \
break; \
} \
@@ -430,13 +432,14 @@ do { \
* Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__
* see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769
*/
-#if __STDC_VERSION__ >= 201112L && !(defined(__STDC_NO_THREADS__) || (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16))
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !(defined(__STDC_NO_THREADS__) || (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16))
#define thread_local _Thread_local
#else
#define thread_local __thread
#endif
#endif
+#if 0 /* NM_IGNORED */
/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
* compiler versions */
#ifndef noreturn
@@ -450,6 +453,7 @@ do { \
#define UID_INVALID ((uid_t) -1)
#define GID_INVALID ((gid_t) -1)
#define MODE_INVALID ((mode_t) -1)
+#endif /* NM_IGNORED */
#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
static inline void func##p(type *p) { \
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/path-util.c b/src/dhcp-manager/systemd-dhcp/src/shared/path-util.c
index 53c0079760..d6efc1c403 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/path-util.c
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/path-util.c
@@ -19,6 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
+#if 0 /* NM_IGNORED */
#include <string.h>
#include <unistd.h>
#include <errno.h>
@@ -31,7 +34,9 @@
#include "util.h"
#include "log.h"
#include "strv.h"
+#endif /* NM_IGNORED */
#include "path-util.h"
+#if 0 /* NM_IGNORED */
#include "missing.h"
bool path_is_absolute(const char *p) {
@@ -331,6 +336,7 @@ char **path_strv_resolve_uniq(char **l, const char *prefix) {
return strv_uniq(l);
}
+#endif /* NM_IGNORED */
char *path_kill_slashes(char *path) {
char *f, *t;
@@ -367,6 +373,7 @@ char *path_kill_slashes(char *path) {
return path;
}
+#if 0 /* NM_IGNORED */
char* path_startswith(const char *path, const char *prefix) {
assert(path);
assert(prefix);
@@ -697,3 +704,4 @@ int fsck_exists(const char *fstype) {
return 0;
}
+#endif /* NM_IGNORED */
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/path-util.h b/src/dhcp-manager/systemd-dhcp/src/shared/path-util.h
index ca81b49cbf..209881e7dd 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/path-util.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/path-util.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdbool.h>
#include "macro.h"
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/refcnt.h b/src/dhcp-manager/systemd-dhcp/src/shared/refcnt.h
index 0502c20a2e..e6e9a6bd6e 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/refcnt.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/refcnt.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
/* A type-safe atomic refcounter */
typedef struct {
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/siphash24.c b/src/dhcp-manager/systemd-dhcp/src/shared/siphash24.c
index f68bd283a1..a26f8e28ca 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/siphash24.c
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/siphash24.c
@@ -14,6 +14,9 @@
(Minimal changes made by Lennart Poettering, to make clean for inclusion in systemd)
*/
+
+#include "nm-sd-adapt.h"
+
#include <stdint.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/siphash24.h b/src/dhcp-manager/systemd-dhcp/src/shared/siphash24.h
index 62e1168a79..3450d754fe 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/siphash24.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/siphash24.h
@@ -1,5 +1,7 @@
#pragma once
+#include "nm-sd-adapt.h"
+
#include <inttypes.h>
#include <sys/types.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/socket-util.h b/src/dhcp-manager/systemd-dhcp/src/shared/socket-util.h
index 1f4823009e..3cbaf0f982 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/socket-util.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/socket-util.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ether.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/sparse-endian.h b/src/dhcp-manager/systemd-dhcp/src/shared/sparse-endian.h
index c913fda8c5..02de0feca8 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/sparse-endian.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/sparse-endian.h
@@ -21,6 +21,8 @@
#ifndef SPARSE_ENDIAN_H
#define SPARSE_ENDIAN_H
+#include "nm-sd-adapt.h"
+
#include <byteswap.h>
#include <endian.h>
#include <stdint.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/strv.c b/src/dhcp-manager/systemd-dhcp/src/shared/strv.c
index 8c6ba6a633..a983f279e6 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/strv.c
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/strv.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
@@ -278,6 +280,7 @@ char **strv_split_newlines(const char *s) {
return l;
}
+#if 0 /* NM_IGNORED */
int strv_split_quoted(char ***t, const char *s, bool relax) {
size_t n = 0, allocated = 0;
_cleanup_strv_free_ char **l = NULL;
@@ -312,6 +315,7 @@ int strv_split_quoted(char ***t, const char *s, bool relax) {
return 0;
}
+#endif /* NM_IGNORED */
char *strv_join(char **l, const char *separator) {
char *r, *e;
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/strv.h b/src/dhcp-manager/systemd-dhcp/src/shared/strv.h
index a80ccd6427..18e4d257e7 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/strv.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/strv.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdarg.h>
#include <stdbool.h>
#include <fnmatch.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/time-util.c b/src/dhcp-manager/systemd-dhcp/src/shared/time-util.c
index 1c36c577c4..f1e56b6e47 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/time-util.c
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/time-util.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <time.h>
#include <string.h>
#include <sys/timex.h>
@@ -26,7 +28,9 @@
#include "util.h"
#include "time-util.h"
+#if 0 /* NM_IGNORED */
#include "strv.h"
+#endif /* NM_IGNORED */
usec_t now(clockid_t clock_id) {
struct timespec ts;
@@ -118,6 +122,7 @@ struct timespec *timespec_store(struct timespec *ts, usec_t u) {
return ts;
}
+#if 0 /* NM_IGNORED */
usec_t timeval_load(const struct timeval *tv) {
assert(tv);
@@ -272,6 +277,7 @@ char *format_timestamp_relative(char *buf, size_t l, usec_t t) {
buf[l-1] = 0;
return buf;
}
+#endif /* NM_IGNORED */
char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
static const struct {
@@ -383,6 +389,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
return buf;
}
+#if 0 /* NM_IGNORED */
void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) {
assert(f);
@@ -974,6 +981,7 @@ bool timezone_is_valid(const char *name) {
return true;
}
+#endif /* NM_IGNORED */
clockid_t clock_boottime_or_monotonic(void) {
static clockid_t clock = -1;
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/time-util.h b/src/dhcp-manager/systemd-dhcp/src/shared/time-util.h
index fca8a4db9b..5d5aa10db4 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/time-util.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/time-util.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdio.h>
#include <inttypes.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/unaligned.h b/src/dhcp-manager/systemd-dhcp/src/shared/unaligned.h
index d6181dd9a9..3b73a9c682 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/unaligned.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/unaligned.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdint.h>
static inline uint16_t unaligned_read_be16(const void *_u) {
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/utf8.c b/src/dhcp-manager/systemd-dhcp/src/shared/utf8.c
index 013c110f07..7433f9b059 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/utf8.c
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/utf8.c
@@ -43,6 +43,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "nm-sd-adapt.h"
+
#include <errno.h>
#include <stdlib.h>
#include <inttypes.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/utf8.h b/src/dhcp-manager/systemd-dhcp/src/shared/utf8.h
index 77f663438e..1fb132041e 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/utf8.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/utf8.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <stdbool.h>
#include "macro.h"
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/util.c b/src/dhcp-manager/systemd-dhcp/src/shared/util.c
index ad548da82a..03dcfa7779 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/util.c
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/util.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <string.h>
#include <unistd.h>
#include <errno.h>
@@ -77,12 +79,15 @@
#include "config.h"
#include "macro.h"
#include "util.h"
+#if 0 /* NM_IGNORED */
#include "ioprio.h"
#include "missing.h"
#include "log.h"
#include "strv.h"
#include "mkdir.h"
+#endif /* NM_IGNORED */
#include "path-util.h"
+#if 0 /* NM_IGNORED */
#include "exit-status.h"
#include "hashmap.h"
#include "env-util.h"
@@ -93,10 +98,12 @@
#include "virt.h"
#include "def.h"
#include "sparse-endian.h"
+#endif /* NM_IGNORED */
/* Put this test here for a lack of better place */
assert_cc(EAGAIN == EWOULDBLOCK);
+#if 0 /* NM_IGNORED */
int saved_argc = 0;
char **saved_argv = NULL;
@@ -116,6 +123,7 @@ size_t page_size(void) {
pgsz = (size_t) r;
return pgsz;
}
+#endif /* NM_IGNORED */
bool streq_ptr(const char *a, const char *b) {
@@ -293,6 +301,7 @@ int safe_close(int fd) {
return -1;
}
+#if 0 /* NM_IGNORED */
void close_many(const int fds[], unsigned n_fd) {
unsigned i;
@@ -376,6 +385,7 @@ int parse_uid(const char *s, uid_t* ret_uid) {
*ret_uid = uid;
return 0;
}
+#endif /* NM_IGNORED */
int safe_atou(const char *s, unsigned *ret_u) {
char *x = NULL;
@@ -397,6 +407,7 @@ int safe_atou(const char *s, unsigned *ret_u) {
return 0;
}
+#if 0 /* NM_IGNORED */
int safe_atoi(const char *s, int *ret_i) {
char *x = NULL;
long l;
@@ -535,6 +546,7 @@ int safe_atod(const char *s, double *ret_d) {
*ret_d = (double) d;
return 0;
}
+#endif /* NM_IGNORED */
static size_t strcspn_escaped(const char *s, const char *reject) {
bool escaped = false;
@@ -598,6 +610,7 @@ const char* split(const char **state, size_t *l, const char *separator, bool quo
return current;
}
+#if 0 /* NM_IGNORED */
int get_parent_of_pid(pid_t pid, pid_t *_ppid) {
int r;
_cleanup_free_ char *line = NULL;
@@ -640,6 +653,7 @@ int get_parent_of_pid(pid_t pid, pid_t *_ppid) {
return 0;
}
+#endif /* NM_IGNORED */
int fchmod_umask(int fd, mode_t m) {
mode_t u;
@@ -659,6 +673,7 @@ char *truncate_nl(char *s) {
return s;
}
+#if 0 /* NM_IGNORED */
int get_process_state(pid_t pid) {
const char *p;
char state;
@@ -960,6 +975,7 @@ int get_process_environ(pid_t pid, char **env) {
return 0;
}
+#endif /* NM_IGNORED */
char *strnappend(const char *s, const char *suffix, size_t b) {
size_t a;
@@ -996,6 +1012,7 @@ char *strappend(const char *s, const char *suffix) {
return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
}
+#if 0 /* NM_IGNORED */
int readlinkat_malloc(int fd, const char *p, char **ret) {
size_t l = 100;
int r;
@@ -1132,6 +1149,7 @@ int reset_signal_mask(void) {
return 0;
}
+#endif /* NM_IGNORED */
char *strstrip(char *s) {
char *e;
@@ -1150,6 +1168,7 @@ char *strstrip(char *s) {
return s;
}
+#if 0 /* NM_IGNORED */
char *delete_chars(char *s, const char *bad) {
char *f, *t;
@@ -1239,6 +1258,7 @@ int rmdir_parents(const char *path, const char *stop) {
return 0;
}
+#endif /* NM_IGNORED */
char hexchar(int x) {
static const char table[16] = "0123456789abcdef";
@@ -1485,6 +1505,7 @@ char *cunescape_length(const char *s, size_t length) {
return cunescape_length_with_prefix(s, length, NULL);
}
+#if 0 /* NM_IGNORED */
char *cunescape(const char *s) {
assert(s);
@@ -1678,6 +1699,7 @@ int close_all_fds(const int except[], unsigned n_except) {
return r;
}
+#endif /* NM_IGNORED */
bool chars_intersect(const char *a, const char *b) {
const char *p;
@@ -1690,6 +1712,7 @@ bool chars_intersect(const char *a, const char *b) {
return false;
}
+#if 0 /* NM_IGNORED */
bool fstype_is_network(const char *fstype) {
static const char table[] =
"afs\0"
@@ -2289,6 +2312,7 @@ void safe_close_pair(int p[]) {
p[0] = safe_close(p[0]);
p[1] = safe_close(p[1]);
}
+#endif /* NM_IGNORED */
ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) {
uint8_t *p = buf;
@@ -2340,6 +2364,7 @@ int loop_read_exact(int fd, void *buf, size_t nbytes, bool do_poll) {
return 0;
}
+#if 0 /* NM_IGNORED */
int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) {
const uint8_t *p = buf;
@@ -2591,8 +2616,10 @@ char* dirname_malloc(const char *path) {
return dir;
}
+#endif /* NM_IGNORED */
int dev_urandom(void *p, size_t n) {
+#if 0 /* NM_IGNORED */
static int have_syscall = -1;
_cleanup_close_ int fd = -1;
@@ -2633,6 +2660,9 @@ int dev_urandom(void *p, size_t n) {
/* too short read? */
return -ENODATA;
}
+#else /* NM IGNORED */
+ _cleanup_close_ int fd = -1;
+#endif /* NM_IGNORED */
fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd < 0)
@@ -2687,6 +2717,7 @@ void random_bytes(void *p, size_t n) {
*q = rand();
}
+#if 0 /* NM_IGNORED */
void rename_process(const char name[8]) {
assert(name);
@@ -4240,6 +4271,7 @@ char* strshorten(char *s, size_t l) {
return s;
}
+#endif /* NM_IGNORED */
static bool hostname_valid_char(char c) {
return
@@ -4286,6 +4318,7 @@ bool hostname_is_valid(const char *s) {
return true;
}
+#if 0 /* NM_IGNORED */
char* hostname_cleanup(char *s, bool lowercase) {
char *p, *d;
bool dot;
@@ -4346,6 +4379,7 @@ int pipe_eof(int fd) {
return pollfd.revents & POLLHUP;
}
+#endif /* NM_IGNORED */
int fd_wait_for_event(int fd, int event, usec_t t) {
@@ -4399,6 +4433,7 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
return 0;
}
+#if 0 /* NM_IGNORED */
int terminal_vhangup_fd(int fd) {
assert(fd >= 0);
@@ -4880,6 +4915,7 @@ int get_files_in_directory(const char *path, char ***list) {
return n;
}
+#endif /* NM_IGNORED */
char *strjoin(const char *x, ...) {
va_list ap;
@@ -4938,6 +4974,7 @@ char *strjoin(const char *x, ...) {
return r;
}
+#if 0 /* NM_IGNORED */
bool is_main_thread(void) {
static thread_local int cached = 0;
@@ -5248,6 +5285,7 @@ finish:
return buf;
}
+#endif /* NM_IGNORED */
void* memdup(const void *p, size_t l) {
void *r;
@@ -5262,6 +5300,7 @@ void* memdup(const void *p, size_t l) {
return r;
}
+#if 0 /* NM_IGNORED */
int fd_inc_sndbuf(int fd, size_t n) {
int r, value;
socklen_t l = sizeof(value);
@@ -5683,6 +5722,7 @@ int get_shell(char **_s) {
*_s = s;
return 0;
}
+#endif /* NM_IGNORED */
bool filename_is_valid(const char *p) {
@@ -5704,6 +5744,7 @@ bool filename_is_valid(const char *p) {
return true;
}
+#if 0 /* NM_IGNORED */
bool string_is_safe(const char *p) {
const char *t;
@@ -5720,6 +5761,7 @@ bool string_is_safe(const char *p) {
return true;
}
+#endif /* NM_IGNORED */
/**
* Check if a string contains control characters. If 'ok' is non-NULL
@@ -5744,6 +5786,7 @@ bool string_has_cc(const char *p, const char *ok) {
return false;
}
+#if 0 /* NM_IGNORED */
bool path_is_safe(const char *p) {
if (isempty(p))
@@ -6226,6 +6269,7 @@ char *strrep(const char *s, unsigned n) {
*p = 0;
return r;
}
+#endif /* NM_IGNORED */
void* greedy_realloc(void **p, size_t *allocated, size_t need, size_t size) {
size_t a, newalloc;
@@ -6253,6 +6297,7 @@ void* greedy_realloc(void **p, size_t *allocated, size_t need, size_t size) {
return q;
}
+#if 0 /* NM_IGNORED */
void* greedy_realloc0(void **p, size_t *allocated, size_t need, size_t size) {
size_t prev;
uint8_t *q;
@@ -6675,10 +6720,11 @@ int getpeersec(int fd, char **ret) {
*ret = s;
return 0;
}
+#endif /* NM_IGNORED */
/* This is much like like mkostemp() but is subject to umask(). */
int mkostemp_safe(char *pattern, int flags) {
- _cleanup_umask_ mode_t u;
+ _cleanup_umask_ mode_t u = 0;
int fd;
assert(pattern);
@@ -6692,6 +6738,7 @@ int mkostemp_safe(char *pattern, int flags) {
return fd;
}
+#if 0 /* NM_IGNORED */
int open_tmpfile(const char *path, int flags) {
char *p;
int fd;
@@ -7082,6 +7129,7 @@ int bind_remount_recursive(const char *prefix, bool ro) {
}
}
}
+#endif /* NM_IGNORED */
int fflush_and_check(FILE *f) {
assert(f);
@@ -7124,6 +7172,7 @@ int tempfn_xxxxxx(const char *p, char **ret) {
return 0;
}
+#if 0 /* NM_IGNORED */
int tempfn_random(const char *p, char **ret) {
const char *fn;
char *t, *x;
@@ -7194,6 +7243,7 @@ int tempfn_random_child(const char *p, char **ret) {
*ret = path_kill_slashes(t);
return 0;
}
+#endif /* NM_IGNORED */
/* make sure the hostname is not "localhost" */
bool is_localhost(const char *hostname) {
@@ -7212,6 +7262,7 @@ bool is_localhost(const char *hostname) {
endswith(hostname, ".localdomain.");
}
+#if 0 /* NM_IGNORED */
int take_password_lock(const char *root) {
struct flock flock = {
@@ -8122,6 +8173,7 @@ int syslog_parse_priority(const char **p, int *priority, bool with_facility) {
*p += k;
return 1;
}
+#endif /* NM_IGNORED */
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
size_t i;
@@ -8136,6 +8188,7 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
return -1;
}
+#if 0 /* NM_IGNORED */
void cmsg_close_all(struct msghdr *mh) {
struct cmsghdr *cmsg;
@@ -8186,3 +8239,4 @@ int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char
return 0;
}
+#endif /* NM_IGNORED */
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/util.h b/src/dhcp-manager/systemd-dhcp/src/shared/util.h
index 29e85bb7e1..faa91f9288 100644
--- a/src/dhcp-manager/systemd-dhcp/src/shared/util.h
+++ b/src/dhcp-manager/systemd-dhcp/src/shared/util.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <alloca.h>
#include <fcntl.h>
#include <inttypes.h>
@@ -42,6 +44,7 @@
#include <mntent.h>
#include <sys/inotify.h>
+#if 0 /* NM_IGNORED */
#if SIZEOF_PID_T == 4
# define PID_PRI PRIi32
#elif SIZEOF_PID_T == 2
@@ -82,9 +85,12 @@
#else
# error Unknown rlim_t size
#endif
+#endif /* NM_IGNORED */
#include "macro.h"
+#if 0 /* NM_IGNORED */
#include "missing.h"
+#endif /* NM_IGNORED */
#include "time-util.h"
/* What is interpreted as whitespace? */
@@ -975,8 +981,10 @@ int namespace_enter(int pidns_fd, int mntns_fd, int netns_fd, int root_fd);
bool pid_is_alive(pid_t pid);
bool pid_is_unwaited(pid_t pid);
+#if 0 /* NM_IGNORED */
int getpeercred(int fd, struct ucred *ucred);
int getpeersec(int fd, char **ret);
+#endif /* NM_IGNORED */
int writev_safe(int fd, const struct iovec *w, int j);
@@ -992,11 +1000,13 @@ uint64_t physical_memory(void);
void hexdump(FILE *f, const void *p, size_t s);
+#if 0 /* NM_IGNORED */
union file_handle_union {
struct file_handle handle;
char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
};
#define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ }
+#endif /* NM_IGNORED */
int update_reboot_param_file(const char *param);
diff --git a/src/dhcp-manager/systemd-dhcp/src/systemd/_sd-common.h b/src/dhcp-manager/systemd-dhcp/src/systemd/_sd-common.h
index 896a027eb5..abcd57dbe4 100644
--- a/src/dhcp-manager/systemd-dhcp/src/systemd/_sd-common.h
+++ b/src/dhcp-manager/systemd-dhcp/src/systemd/_sd-common.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
/* This is a private header; never even think of including this directly! */
#if __INCLUDE_LEVEL__ <= 1
diff --git a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-client.h b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-client.h
index 951662e56c..527c4239d1 100644
--- a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-client.h
+++ b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-client.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <netinet/in.h>
#include <net/ethernet.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-lease.h b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-lease.h
index 4296b91d8a..80d32134b1 100644
--- a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-lease.h
+++ b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-lease.h
@@ -23,6 +23,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <netinet/in.h>
#include <net/ethernet.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-client.h b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-client.h
index e9663c0c71..e2646cbbc4 100644
--- a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-client.h
+++ b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-client.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <net/ethernet.h>
#include "sd-event.h"
diff --git a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-lease.h b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-lease.h
index 716d7678f1..84008cf590 100644
--- a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-lease.h
+++ b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-lease.h
@@ -23,6 +23,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <netinet/in.h>
typedef struct sd_dhcp6_lease sd_dhcp6_lease;
diff --git a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-event.h b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-event.h
index 565de5495a..aa71baaaa7 100644
--- a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-event.h
+++ b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-event.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <sys/types.h>
#include <sys/signalfd.h>
#include <sys/epoll.h>
diff --git a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-id128.h b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-id128.h
index 9f445278bb..da1bb2fa24 100644
--- a/src/dhcp-manager/systemd-dhcp/src/systemd/sd-id128.h
+++ b/src/dhcp-manager/systemd-dhcp/src/systemd/sd-id128.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "nm-sd-adapt.h"
+
#include <inttypes.h>
#include <string.h>
diff --git a/src/dhcp-manager/tests/Makefile.am b/src/dhcp-manager/tests/Makefile.am
index 9d6e7b97b4..8aa79a29be 100644
--- a/src/dhcp-manager/tests/Makefile.am
+++ b/src/dhcp-manager/tests/Makefile.am
@@ -13,27 +13,32 @@ AM_CPPFLAGS = \
noinst_PROGRAMS = \
test-dhcp-dhclient \
- test-dhcp-options
+ test-dhcp-utils
####### dhclient leases test #######
test_dhcp_dhclient_SOURCES = \
+ $(top_srcdir)/src/dhcp-manager/nm-dhcp-dhclient-utils.h \
+ $(top_srcdir)/src/dhcp-manager/nm-dhcp-dhclient-utils.c \
+ $(top_srcdir)/src/dhcp-manager/nm-dhcp-utils.h \
+ $(top_srcdir)/src/dhcp-manager/nm-dhcp-utils.c \
test-dhcp-dhclient.c
test_dhcp_dhclient_LDADD = \
$(top_builddir)/src/libNetworkManager.la
-####### DHCP options test #######
+####### DHCP utils test #######
-test_dhcp_options_SOURCES = \
- test-dhcp-options.c
+test_dhcp_utils_SOURCES = \
+ test-dhcp-utils.c
-test_dhcp_options_LDADD = \
+test_dhcp_utils_LDADD = \
$(top_builddir)/src/libNetworkManager.la
#################################
-TESTS = test-dhcp-dhclient test-dhcp-options
+@VALGRIND_RULES@
+TESTS = test-dhcp-dhclient test-dhcp-utils
EXTRA_DIST = \
test-dhclient-duid.leases \
diff --git a/src/dhcp-manager/tests/test-dhcp-dhclient.c b/src/dhcp-manager/tests/test-dhcp-dhclient.c
index ab496b38bd..6e084579bd 100644
--- a/src/dhcp-manager/tests/test-dhcp-dhclient.c
+++ b/src/dhcp-manager/tests/test-dhcp-dhclient.c
@@ -18,34 +18,51 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <unistd.h>
+#include <arpa/inet.h>
+#include "gsystem-local-alloc.h"
+#include "NetworkManagerUtils.h"
#include "nm-dhcp-dhclient-utils.h"
+#include "nm-dhcp-utils.h"
#include "nm-utils.h"
#include "nm-ip4-config.h"
#include "nm-platform.h"
+#include "nm-utils-internal.h"
-#define DEBUG 0
+#define DEBUG 1
static void
test_config (const char *orig,
const char *expected,
+ gboolean ipv6,
const char *hostname,
const char *dhcp_client_id,
+ GBytes *expected_new_client_id,
const char *iface,
const char *anycast_addr)
{
- char *new;
+ gs_free char *new = NULL;
+ gs_unref_bytes GBytes *client_id = NULL;
+ gs_unref_bytes GBytes *new_client_id = NULL;
+
+ if (dhcp_client_id) {
+ client_id = nm_dhcp_utils_client_id_string_to_bytes (dhcp_client_id);
+ g_assert (client_id);
+ }
new = nm_dhcp_dhclient_create_config (iface,
- FALSE,
- dhcp_client_id,
+ ipv6,
+ client_id,
anycast_addr,
hostname,
"/path/to/dhclient.conf",
- orig);
+ orig,
+ &new_client_id);
g_assert (new != NULL);
#if DEBUG
@@ -59,9 +76,13 @@ test_config (const char *orig,
new, expected);
}
#endif
- g_assert (strlen (new) == strlen (expected));
- g_assert (strcmp (new, expected) == 0);
- g_free (new);
+ g_assert_cmpstr (new, ==, expected);
+
+ if (expected_new_client_id) {
+ g_assert (new_client_id);
+ g_assert (g_bytes_equal (new_client_id, expected_new_client_id));
+ } else
+ g_assert (new_client_id == NULL);
}
/*******************************************/
@@ -83,11 +104,7 @@ static const char *orig_missing_expected = \
static void
test_orig_missing (void)
{
- test_config (NULL, orig_missing_expected,
- NULL,
- NULL,
- "eth0",
- NULL);
+ test_config (NULL, orig_missing_expected, FALSE, NULL, NULL, NULL, "eth0", NULL);
}
/*******************************************/
@@ -116,8 +133,9 @@ static void
test_override_client_id (void)
{
test_config (override_client_id_orig, override_client_id_expected,
- NULL,
+ FALSE, NULL,
"11:22:33:44:55:66",
+ NULL,
"eth0",
NULL);
}
@@ -144,8 +162,9 @@ static void
test_quote_client_id (void)
{
test_config (NULL, quote_client_id_expected,
- NULL,
+ FALSE, NULL,
"1234",
+ NULL,
"eth0",
NULL);
}
@@ -172,8 +191,9 @@ static void
test_ascii_client_id (void)
{
test_config (NULL, ascii_client_id_expected,
- NULL,
+ FALSE, NULL,
"qb:cd:ef:12:34:56",
+ NULL,
"eth0",
NULL);
}
@@ -183,7 +203,7 @@ test_ascii_client_id (void)
static const char *hex_single_client_id_expected = \
"# Created by NetworkManager\n"
"\n"
- "send dhcp-client-identifier ab:cd:e:12:34:56; # added by NetworkManager\n"
+ "send dhcp-client-identifier ab:cd:0e:12:34:56; # added by NetworkManager\n"
"\n"
"option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n"
"option ms-classless-static-routes code 249 = array of unsigned integer 8;\n"
@@ -200,8 +220,86 @@ static void
test_hex_single_client_id (void)
{
test_config (NULL, hex_single_client_id_expected,
- NULL,
+ FALSE, NULL,
"ab:cd:e:12:34:56",
+ NULL,
+ "eth0",
+ NULL);
+}
+
+/*******************************************/
+
+static const char *existing_hex_client_id_orig = \
+ "send dhcp-client-identifier 00:30:04:20:7A:08;\n";
+
+static const char *existing_hex_client_id_expected = \
+ "# Created by NetworkManager\n"
+ "# Merged from /path/to/dhclient.conf\n"
+ "\n"
+ "send dhcp-client-identifier 00:30:04:20:7A:08;\n"
+ "\n"
+ "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n"
+ "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n"
+ "option wpad code 252 = string;\n"
+ "\n"
+ "also request rfc3442-classless-static-routes;\n"
+ "also request ms-classless-static-routes;\n"
+ "also request static-routes;\n"
+ "also request wpad;\n"
+ "also request ntp-servers;\n"
+ "\n";
+
+static void
+test_existing_hex_client_id (void)
+{
+ gs_unref_bytes GBytes *new_client_id = NULL;
+ const guint8 bytes[] = { 0x00, 0x30, 0x04,0x20, 0x7A, 0x08 };
+
+ new_client_id = g_bytes_new (bytes, sizeof (bytes));
+ test_config (existing_hex_client_id_orig, existing_hex_client_id_expected,
+ FALSE, NULL,
+ NULL,
+ new_client_id,
+ "eth0",
+ NULL);
+}
+
+/*******************************************/
+
+#define EACID "qb:cd:ef:12:34:56"
+
+static const char *existing_ascii_client_id_orig = \
+ "send dhcp-client-identifier \"" EACID "\";\n";
+
+static const char *existing_ascii_client_id_expected = \
+ "# Created by NetworkManager\n"
+ "# Merged from /path/to/dhclient.conf\n"
+ "\n"
+ "send dhcp-client-identifier \"" EACID "\";\n"
+ "\n"
+ "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n"
+ "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n"
+ "option wpad code 252 = string;\n"
+ "\n"
+ "also request rfc3442-classless-static-routes;\n"
+ "also request ms-classless-static-routes;\n"
+ "also request static-routes;\n"
+ "also request wpad;\n"
+ "also request ntp-servers;\n"
+ "\n";
+
+static void
+test_existing_ascii_client_id (void)
+{
+ gs_unref_bytes GBytes *new_client_id = NULL;
+ char buf[STRLEN (EACID) + 1] = { 0 };
+
+ memcpy (buf + 1, EACID, STRLEN (EACID));
+ new_client_id = g_bytes_new (buf, sizeof (buf));
+ test_config (existing_ascii_client_id_orig, existing_ascii_client_id_expected,
+ FALSE, NULL,
+ NULL,
+ new_client_id,
"eth0",
NULL);
}
@@ -232,7 +330,59 @@ static void
test_override_hostname (void)
{
test_config (override_hostname_orig, override_hostname_expected,
- "blahblah",
+ FALSE, "blahblah",
+ NULL,
+ NULL,
+ "eth0",
+ NULL);
+}
+
+/*******************************************/
+
+static const char *override_hostname6_orig = \
+ "send fqdn.fqdn \"foobar\";\n";
+
+static const char *override_hostname6_expected = \
+ "# Created by NetworkManager\n"
+ "# Merged from /path/to/dhclient.conf\n"
+ "\n"
+ "send fqdn.fqdn \"blahblah.local\"; # added by NetworkManager\n"
+ "send fqdn.encoded on;\n"
+ "send fqdn.server-update on;\n"
+ "\n"
+ "also request dhcp6.name-servers;\n"
+ "also request dhcp6.domain-search;\n"
+ "also request dhcp6.client-id;\n"
+ "\n";
+
+static void
+test_override_hostname6 (void)
+{
+ test_config (override_hostname6_orig, override_hostname6_expected,
+ TRUE, "blahblah.local",
+ NULL,
+ NULL,
+ "eth0",
+ NULL);
+}
+
+/*******************************************/
+
+static const char *nonfqdn_hostname6_expected = \
+ "# Created by NetworkManager\n"
+ "\n"
+ "also request dhcp6.name-servers;\n"
+ "also request dhcp6.domain-search;\n"
+ "also request dhcp6.client-id;\n"
+ "\n";
+
+static void
+test_nonfqdn_hostname6 (void)
+{
+ /* Non-FQDN hostname can't be used with dhclient */
+ test_config (NULL, nonfqdn_hostname6_expected,
+ TRUE, "blahblah",
+ NULL,
NULL,
"eth0",
NULL);
@@ -266,6 +416,7 @@ static void
test_existing_alsoreq (void)
{
test_config (existing_alsoreq_orig, existing_alsoreq_expected,
+ FALSE, NULL,
NULL,
NULL,
"eth0",
@@ -304,6 +455,7 @@ static void
test_existing_multiline_alsoreq (void)
{
test_config (existing_multiline_alsoreq_orig, existing_multiline_alsoreq_expected,
+ FALSE, NULL,
NULL,
NULL,
"eth0",
@@ -330,6 +482,9 @@ test_one_duid (const char *escaped, const guint8 *unescaped, guint len)
g_assert (w);
g_assert_cmpint (strlen (escaped), ==, strlen (w));
g_assert_cmpstr (escaped, ==, w);
+
+ g_byte_array_free (t, TRUE);
+ g_free (w);
}
static void
@@ -498,7 +653,7 @@ test_read_lease_ip4_config_basic (void)
/* Date from before the least expiration */
now = g_date_time_new_utc (2013, 11, 1, 19, 55, 32);
- leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", contents, FALSE, now);
+ leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", -1, contents, FALSE, now);
g_assert_cmpint (g_slist_length (leases), ==, 2);
/* IP4Config #1 */
@@ -570,7 +725,7 @@ test_read_lease_ip4_config_expired (void)
/* Date from *after* the lease expiration */
now = g_date_time_new_utc (2013, 12, 1, 19, 55, 32);
- leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", contents, FALSE, now);
+ leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", -1, contents, FALSE, now);
g_assert (leases == NULL);
g_date_time_unref (now);
@@ -592,7 +747,7 @@ test_read_lease_ip4_config_expect_failure (gconstpointer user_data)
/* Date from before the least expiration */
now = g_date_time_new_utc (2013, 11, 1, 1, 1, 1);
- leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", contents, FALSE, now);
+ leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", -1, contents, FALSE, now);
g_assert (leases == NULL);
g_date_time_unref (now);
@@ -615,7 +770,11 @@ main (int argc, char **argv)
g_test_add_func ("/dhcp/dhclient/quote_client_id", test_quote_client_id);
g_test_add_func ("/dhcp/dhclient/ascii_client_id", test_ascii_client_id);
g_test_add_func ("/dhcp/dhclient/hex_single_client_id", test_hex_single_client_id);
+ g_test_add_func ("/dhcp/dhclient/existing-hex-client-id", test_existing_hex_client_id);
+ g_test_add_func ("/dhcp/dhclient/existing-ascii-client-id", test_existing_ascii_client_id);
g_test_add_func ("/dhcp/dhclient/override_hostname", test_override_hostname);
+ g_test_add_func ("/dhcp/dhclient/override_hostname6", test_override_hostname6);
+ g_test_add_func ("/dhcp/dhclient/nonfqdn_hostname6", test_nonfqdn_hostname6);
g_test_add_func ("/dhcp/dhclient/existing_alsoreq", test_existing_alsoreq);
g_test_add_func ("/dhcp/dhclient/existing_multiline_alsoreq", test_existing_multiline_alsoreq);
g_test_add_func ("/dhcp/dhclient/duids", test_duids);
diff --git a/src/dhcp-manager/tests/test-dhcp-options.c b/src/dhcp-manager/tests/test-dhcp-utils.c
index 15f5ee60b5..961bd8a2ed 100644
--- a/src/dhcp-manager/tests/test-dhcp-options.c
+++ b/src/dhcp-manager/tests/test-dhcp-utils.c
@@ -17,6 +17,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -86,7 +88,7 @@ test_generic_options (void)
const char *expected_route2_gw = "10.1.1.1";
options = fill_table (generic_options, NULL);
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
/* IP4 address */
@@ -157,7 +159,7 @@ test_wins_options (void)
options = fill_table (generic_options, NULL);
options = fill_table (data, options);
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
/* IP4 address */
@@ -219,7 +221,7 @@ test_classless_static_routes_1 (void)
options = fill_table (generic_options, NULL);
options = fill_table (data, options);
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
/* IP4 routes */
@@ -247,7 +249,7 @@ test_classless_static_routes_2 (void)
options = fill_table (generic_options, NULL);
options = fill_table (data, options);
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
/* IP4 routes */
@@ -276,7 +278,7 @@ test_fedora_dhclient_classless_static_routes (void)
options = fill_table (generic_options, NULL);
options = fill_table (data, options);
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
/* IP4 routes */
@@ -308,7 +310,7 @@ test_dhclient_invalid_classless_routes_1 (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*ignoring invalid classless static routes*");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_test_assert_expected_messages ();
@@ -339,7 +341,7 @@ test_dhcpcd_invalid_classless_routes_1 (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*ignoring invalid classless static routes*");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_test_assert_expected_messages ();
@@ -372,7 +374,7 @@ test_dhclient_invalid_classless_routes_2 (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*ignoring invalid classless static routes*");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_test_assert_expected_messages ();
@@ -405,7 +407,7 @@ test_dhcpcd_invalid_classless_routes_2 (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*ignoring invalid classless static routes*");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_test_assert_expected_messages ();
@@ -438,7 +440,7 @@ test_dhclient_invalid_classless_routes_3 (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*ignoring invalid classless static routes*");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_test_assert_expected_messages ();
@@ -466,7 +468,7 @@ test_dhcpcd_invalid_classless_routes_3 (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*DHCP provided invalid classless static route*");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_test_assert_expected_messages ();
@@ -492,7 +494,7 @@ test_dhclient_gw_in_classless_routes (void)
options = fill_table (generic_options, NULL);
options = fill_table (data, options);
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
/* IP4 routes */
@@ -520,7 +522,7 @@ test_dhcpcd_gw_in_classless_routes (void)
options = fill_table (generic_options, NULL);
options = fill_table (data, options);
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
/* IP4 routes */
@@ -548,7 +550,7 @@ test_escaped_domain_searches (void)
options = fill_table (generic_options, NULL);
options = fill_table (data, options);
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
/* domain searches */
@@ -575,7 +577,7 @@ test_invalid_escaped_domain_searches (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*invalid domain search*");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_test_assert_expected_messages ();
@@ -596,7 +598,7 @@ test_ip4_missing_prefix (const char *ip, guint32 expected_prefix)
g_hash_table_insert (options, "ip_address", (gpointer) ip);
g_hash_table_remove (options, "subnet_mask");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_assert_cmpint (nm_ip4_config_get_num_addresses (ip4_config), ==, 1);
@@ -641,7 +643,7 @@ test_ip4_prefix_classless (void)
g_hash_table_insert (options, "ip_address", "172.16.54.22");
g_hash_table_insert (options, "subnet_mask", "255.255.252.0");
- ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0);
+ ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0);
g_assert (ip4_config);
g_assert_cmpint (nm_ip4_config_get_num_addresses (ip4_config), ==, 1);
@@ -652,6 +654,42 @@ test_ip4_prefix_classless (void)
g_hash_table_destroy (options);
}
+#define COMPARE_ID(src, is_str, expected, expected_len) \
+G_STMT_START { \
+ gs_unref_bytes GBytes *b = NULL; \
+ const char *p; \
+ gsize l; \
+ \
+ b = nm_dhcp_utils_client_id_string_to_bytes (src); \
+ g_assert (b); \
+ p = g_bytes_get_data (b, &l); \
+ if (is_str) { \
+ g_assert_cmpint (l, ==, expected_len + 1); \
+ g_assert_cmpint (((const char *) p)[0], ==, 0); \
+ g_assert (memcmp (p + 1, expected, expected_len) == 0); \
+ } else { \
+ g_assert_cmpint (l, ==, expected_len); \
+ g_assert (memcmp (p, expected, expected_len) == 0); \
+ } \
+} G_STMT_END
+
+static void
+test_client_id_from_string (void)
+{
+ const char *nothex = "asdfasdfasdfasdfasdfasdfasdf";
+ const char *allhex = "00:11:22:33:4:55:66:77:88";
+ const guint8 allhex_bin[] = { 0x00, 0x11, 0x22, 0x33, 0x04, 0x55, 0x66, 0x77, 0x88 };
+ const char *somehex = "00:11:22:33:44:55:asdfasdfasdf:99:10";
+ const char *nocolons = "0011223344559910";
+ const char *endcolon = "00:11:22:33:44:55:";
+
+ COMPARE_ID (nothex, TRUE, nothex, strlen (nothex));
+ COMPARE_ID (allhex, FALSE, allhex_bin, sizeof (allhex_bin));
+ COMPARE_ID (somehex, TRUE, somehex, strlen (somehex));
+ COMPARE_ID (nocolons, TRUE, nocolons, strlen (nocolons));
+ COMPARE_ID (endcolon, TRUE, endcolon, strlen (endcolon));
+}
+
NMTST_DEFINE ();
int main (int argc, char **argv)
@@ -678,6 +716,7 @@ int main (int argc, char **argv)
g_test_add_func ("/dhcp/ip4-missing-prefix-16", test_ip4_missing_prefix_16);
g_test_add_func ("/dhcp/ip4-missing-prefix-8", test_ip4_missing_prefix_8);
g_test_add_func ("/dhcp/ip4-prefix-classless", test_ip4_prefix_classless);
+ g_test_add_func ("/dhcp/client-id-from-string", test_client_id_from_string);
return g_test_run ();
}
diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c
index 416cfe3b01..f26ccfaa3f 100644
--- a/src/dns-manager/nm-dns-dnsmasq.c
+++ b/src/dns-manager/nm-dns-dnsmasq.c
@@ -18,7 +18,8 @@
*
*/
-#include <config.h>
+#include "config.h"
+
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
index 0d93d8bb41..f9a4fd44ae 100644
--- a/src/dns-manager/nm-dns-manager.c
+++ b/src/dns-manager/nm-dns-manager.c
@@ -27,6 +27,7 @@
#include <fcntl.h>
#include <resolv.h>
#include <stdlib.h>
+#include <sys/stat.h>
#include <sys/ioctl.h>
#include <unistd.h>
@@ -41,7 +42,6 @@
#include "nm-ip6-config.h"
#include "nm-logging.h"
#include "NetworkManagerUtils.h"
-#include "nm-posix-signals.h"
#include "nm-config.h"
#include "nm-dns-plugin.h"
@@ -85,6 +85,8 @@ typedef struct {
NMDnsManagerResolvConfMode resolv_conf_mode;
NMDnsPlugin *plugin;
+ NMConfig *config;
+
gboolean dns_touched;
} NMDnsManagerPrivate;
@@ -223,19 +225,6 @@ merge_one_ip6_config (NMResolvConfData *rc, NMIP6Config *src)
/**********************************/
/* SUSE */
-static void
-netconfig_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for netconfig here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
static GPid
run_netconfig (GError **error, gint *stdin_fd)
{
@@ -253,7 +242,7 @@ run_netconfig (GError **error, gint *stdin_fd)
nm_log_dbg (LOGD_DNS, "spawning '%s'", tmp);
g_free (tmp);
- if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, netconfig_child_setup,
+ if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, NULL,
NULL, &pid, stdin_fd, NULL, NULL, error))
return -1;
@@ -436,53 +425,28 @@ dispatch_resolvconf (char **searches,
}
#endif
+#define MY_RESOLV_CONF NMRUNDIR "/resolv.conf"
+#define MY_RESOLV_CONF_TMP MY_RESOLV_CONF ".tmp"
+#define RESOLV_CONF_TMP "/etc/.resolv.conf.NetworkManager"
+
static gboolean
update_resolv_conf (char **searches,
char **nameservers,
GError **error)
{
- char *tmp_resolv_conf;
- char *tmp_resolv_conf_realpath;
- char *resolv_conf_realpath;
FILE *f;
- int do_rename = 1;
- int old_errno = 0;
+ struct stat st;
g_return_val_if_fail (error != NULL, FALSE);
- /* Find the real path of resolv.conf; it could be a symlink to something */
- resolv_conf_realpath = realpath (_PATH_RESCONF, NULL);
- if (!resolv_conf_realpath)
- resolv_conf_realpath = strdup (_PATH_RESCONF);
-
- /* Build up the real path for the temp resolv.conf that we're about to
- * write out.
- */
- tmp_resolv_conf = g_strdup_printf ("%s.tmp", resolv_conf_realpath);
- tmp_resolv_conf_realpath = realpath (tmp_resolv_conf, NULL);
- if (!tmp_resolv_conf_realpath)
- tmp_resolv_conf_realpath = strdup (tmp_resolv_conf);
- g_free (tmp_resolv_conf);
- tmp_resolv_conf = NULL;
-
- if ((f = fopen (tmp_resolv_conf_realpath, "w")) == NULL) {
- do_rename = 0;
- old_errno = errno;
- if ((f = fopen (_PATH_RESCONF, "w")) == NULL) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "Could not open %s: %s\nCould not open %s: %s\n",
- tmp_resolv_conf_realpath,
- g_strerror (old_errno),
- _PATH_RESCONF,
- g_strerror (errno));
- goto out;
- }
- /* Update tmp_resolv_conf_realpath so the error message on fclose()
- * failure will be correct.
- */
- strcpy (tmp_resolv_conf_realpath, _PATH_RESCONF);
+ if ((f = fopen (MY_RESOLV_CONF_TMP, "w")) == NULL) {
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "Could not open %s: %s\n",
+ MY_RESOLV_CONF_TMP,
+ g_strerror (errno));
+ return FALSE;
}
write_resolv_conf (f, searches, nameservers, error);
@@ -496,28 +460,90 @@ update_resolv_conf (char **searches,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_FAILED,
"Could not close %s: %s\n",
- tmp_resolv_conf_realpath,
+ MY_RESOLV_CONF_TMP,
g_strerror (errno));
}
}
- /* Don't rename the tempfile over top of the existing resolv.conf if there
- * was an error writing it out.
- */
- if (*error == NULL && do_rename) {
- if (rename (tmp_resolv_conf_realpath, resolv_conf_realpath) < 0) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "Could not replace " _PATH_RESCONF ": %s\n",
- g_strerror (errno));
+ if (*error)
+ return FALSE;
+
+ if (rename (MY_RESOLV_CONF_TMP, MY_RESOLV_CONF) < 0) {
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "Could not replace %s: %s\n",
+ MY_RESOLV_CONF,
+ g_strerror (errno));
+ return FALSE;
+ }
+
+ /* Don't overwrite a symbolic link unless it points to MY_RESOLV_CONF. */
+ if (lstat (_PATH_RESCONF, &st) != -1) {
+ /* Don't overwrite a symbolic link. */
+ if (S_ISLNK (st.st_mode)) {
+ if (stat (_PATH_RESCONF, &st) != -1) {
+ char *path = g_file_read_link (_PATH_RESCONF, NULL);
+ gboolean not_ours = g_strcmp0 (path, MY_RESOLV_CONF) != 0;
+
+ g_free (path);
+ if (not_ours)
+ return TRUE;
+ } else {
+ if (errno != ENOENT)
+ return TRUE;
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "Could not stat %s: %s\n",
+ _PATH_RESCONF,
+ g_strerror (errno));
+ return FALSE;
+ }
}
+ } else if (errno != ENOENT) {
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "Could not lstat %s: %s\n",
+ _PATH_RESCONF,
+ g_strerror (errno));
+ return FALSE;
+ }
+
+ if (unlink (RESOLV_CONF_TMP) == -1 && errno != ENOENT) {
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "Could not unlink %s: %s\n",
+ RESOLV_CONF_TMP,
+ g_strerror (errno));
+ return FALSE;
}
-out:
- free (tmp_resolv_conf_realpath);
- free (resolv_conf_realpath);
- return *error ? FALSE : TRUE;
+ if (symlink (MY_RESOLV_CONF, RESOLV_CONF_TMP) == -1) {
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "Could not create symlink %s pointing to %s: %s\n",
+ RESOLV_CONF_TMP,
+ MY_RESOLV_CONF,
+ g_strerror (errno));
+ return FALSE;
+ }
+
+ if (rename (RESOLV_CONF_TMP, _PATH_RESCONF) == -1) {
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "Could not rename %s to %s: %s\n",
+ RESOLV_CONF_TMP,
+ _PATH_RESCONF,
+ g_strerror (errno));
+ return FALSE;
+ }
+
+ return TRUE;
}
static void
@@ -1042,18 +1068,7 @@ nm_dns_manager_end_updates (NMDnsManager *mgr, const char *func)
/******************************************************************/
-NMDnsManager *
-nm_dns_manager_get (void)
-{
- static NMDnsManager * singleton = NULL;
-
- if (!singleton) {
- singleton = NM_DNS_MANAGER (g_object_new (NM_TYPE_DNS_MANAGER, NULL));
- g_assert (singleton);
- }
-
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMDnsManager, nm_dns_manager_get, NM_TYPE_DNS_MANAGER);
static void
init_resolv_conf_mode (NMDnsManager *self)
@@ -1062,6 +1077,8 @@ init_resolv_conf_mode (NMDnsManager *self)
const char *mode;
int fd, flags;
+ g_clear_object (&priv->plugin);
+
fd = open (_PATH_RESCONF, O_RDONLY);
if (fd != -1) {
if (ioctl (fd, FS_IOC_GETFLAGS, &flags) == -1)
@@ -1075,7 +1092,7 @@ init_resolv_conf_mode (NMDnsManager *self)
}
}
- mode = nm_config_get_dns_mode (nm_config_get ());
+ mode = nm_config_data_get_dns_mode (nm_config_get_data (priv->config));
if (!g_strcmp0 (mode, "none")) {
priv->resolv_conf_mode = NM_DNS_MANAGER_RESOLV_CONF_UNMANAGED;
nm_log_info (LOGD_DNS, "DNS: not managing " _PATH_RESCONF);
@@ -1090,6 +1107,31 @@ init_resolv_conf_mode (NMDnsManager *self)
if (mode && g_strcmp0 (mode, "default") != 0)
nm_log_warn (LOGD_DNS, "Unknown DNS mode '%s'", mode);
}
+
+ if (priv->plugin) {
+ nm_log_info (LOGD_DNS, "DNS: loaded plugin %s", nm_dns_plugin_get_name (priv->plugin));
+ g_signal_connect (priv->plugin, NM_DNS_PLUGIN_FAILED, G_CALLBACK (plugin_failed), self);
+ }
+}
+
+static void
+config_changed_cb (NMConfig *config,
+ NMConfigData *config_data,
+ NMConfigChangeFlags changes,
+ NMConfigData *old_data,
+ NMDnsManager *self)
+{
+ GError *error = NULL;
+
+ if (!(changes & NM_CONFIG_CHANGE_DNS_MODE))
+ return;
+
+ init_resolv_conf_mode (self);
+ if (!update_dns (self, TRUE, &error)) {
+ nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s",
+ error->code, error->message);
+ g_clear_error (&error);
+ }
}
static void
@@ -1100,12 +1142,12 @@ nm_dns_manager_init (NMDnsManager *self)
/* Set the initial hash */
compute_hash (self, NM_DNS_MANAGER_GET_PRIVATE (self)->hash);
+ priv->config = g_object_ref (nm_config_get ());
+ g_signal_connect (G_OBJECT (priv->config),
+ NM_CONFIG_SIGNAL_CONFIG_CHANGED,
+ G_CALLBACK (config_changed_cb),
+ self);
init_resolv_conf_mode (self);
-
- if (priv->plugin) {
- nm_log_info (LOGD_DNS, "DNS: loaded plugin %s", nm_dns_plugin_get_name (priv->plugin));
- g_signal_connect (priv->plugin, NM_DNS_PLUGIN_FAILED, G_CALLBACK (plugin_failed), self);
- }
}
static void
@@ -1130,6 +1172,11 @@ dispose (GObject *object)
priv->dns_touched = FALSE;
}
+ if (priv->config) {
+ g_signal_handlers_disconnect_by_func (priv->config, config_changed_cb, self);
+ g_clear_object (&priv->config);
+ }
+
g_slist_free_full (priv->configs, g_object_unref);
priv->configs = NULL;
diff --git a/src/dns-manager/nm-dns-plugin.c b/src/dns-manager/nm-dns-plugin.c
index 62a362105e..3d593cce8d 100644
--- a/src/dns-manager/nm-dns-plugin.c
+++ b/src/dns-manager/nm-dns-plugin.c
@@ -17,7 +17,8 @@
*
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
@@ -27,7 +28,6 @@
#include "nm-dns-plugin.h"
#include "nm-logging.h"
-#include "nm-posix-signals.h"
#include "NetworkManagerUtils.h"
typedef struct {
@@ -135,20 +135,6 @@ watch_cb (GPid pid, gint status, gpointer user_data)
g_signal_emit (self, signals[CHILD_QUIT], 0, status);
}
-static void
-child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for DNS plugin here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
GPid
nm_dns_plugin_child_spawn (NMDnsPlugin *self,
const char **argv,
@@ -182,8 +168,8 @@ nm_dns_plugin_child_spawn (NMDnsPlugin *self,
priv->pid = 0;
if (g_spawn_async (NULL, (char **) argv, NULL,
G_SPAWN_DO_NOT_REAP_CHILD,
- child_setup,
- NULL, &priv->pid,
+ nm_utils_setpgid, NULL,
+ &priv->pid,
&error)) {
nm_log_dbg (LOGD_DNS, "%s started with pid %d", priv->progname, priv->pid);
priv->watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) watch_cb, self);
diff --git a/src/dns-manager/nm-dns-unbound.c b/src/dns-manager/nm-dns-unbound.c
index 137fd20b09..533290c11d 100644
--- a/src/dns-manager/nm-dns-unbound.c
+++ b/src/dns-manager/nm-dns-unbound.c
@@ -17,6 +17,8 @@
* Copyright (C) 2014 Red Hat, Inc.
* Author: Pavel Å imerda <psimerda@redhat.com>
*/
+#include "config.h"
+
#include "nm-dns-unbound.h"
#include "NetworkManagerUtils.h"
diff --git a/src/dns-manager/nm-dns-utils.c b/src/dns-manager/nm-dns-utils.c
index 334866cb69..4a5255a421 100644
--- a/src/dns-manager/nm-dns-utils.c
+++ b/src/dns-manager/nm-dns-utils.c
@@ -17,6 +17,8 @@
*
*/
+#include "config.h"
+
#include <arpa/inet.h>
#include <string.h>
diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c
index 8cc397eac0..a85631bcb1 100644
--- a/src/dnsmasq-manager/nm-dnsmasq-manager.c
+++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c
@@ -18,7 +18,8 @@
* Copyright (C) 2008 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
@@ -31,7 +32,6 @@
#include "nm-dnsmasq-utils.h"
#include "nm-logging.h"
#include "nm-glib-compat.h"
-#include "nm-posix-signals.h"
#include "nm-utils.h"
#include "NetworkManagerUtils.h"
@@ -296,20 +296,6 @@ create_dm_cmd_line (const char *iface,
}
static void
-dm_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for dnsmasq here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
-static void
kill_existing_for_iface (const char *iface, const char *pidfile)
{
char *contents = NULL;
@@ -373,9 +359,9 @@ nm_dnsmasq_manager_start (NMDnsMasqManager *manager,
priv->pid = 0;
if (!g_spawn_async (NULL, (char **) dm_cmd->array->pdata, NULL,
- G_SPAWN_DO_NOT_REAP_CHILD,
- dm_child_setup,
- NULL, &priv->pid, error)) {
+ G_SPAWN_DO_NOT_REAP_CHILD,
+ nm_utils_setpgid, NULL,
+ &priv->pid, error)) {
goto out;
}
diff --git a/src/dnsmasq-manager/nm-dnsmasq-utils.c b/src/dnsmasq-manager/nm-dnsmasq-utils.c
index 7036b40932..4394ae7b55 100644
--- a/src/dnsmasq-manager/nm-dnsmasq-utils.c
+++ b/src/dnsmasq-manager/nm-dnsmasq-utils.c
@@ -18,7 +18,8 @@
* Copyright (C) 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <arpa/inet.h>
diff --git a/src/dnsmasq-manager/tests/Makefile.am b/src/dnsmasq-manager/tests/Makefile.am
index c6ce1cdafc..b51de6aa5d 100644
--- a/src/dnsmasq-manager/tests/Makefile.am
+++ b/src/dnsmasq-manager/tests/Makefile.am
@@ -19,5 +19,6 @@ test_dnsmasq_utils_SOURCES = \
test_dnsmasq_utils_LDADD = \
$(top_builddir)/src/libNetworkManager.la
+@VALGRIND_RULES@
TESTS = test-dnsmasq-utils
diff --git a/src/dnsmasq-manager/tests/test-dnsmasq-utils.c b/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
index 07dbc0f724..f8120ffec3 100644
--- a/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
+++ b/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <arpa/inet.h>
diff --git a/src/main-utils.c b/src/main-utils.c
new file mode 100644
index 0000000000..1d899587ec
--- /dev/null
+++ b/src/main-utils.c
@@ -0,0 +1,259 @@
+/* -*- 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 (C) 2004 - 2012 Red Hat, Inc.
+ * Copyright (C) 2005 - 2008 Novell, Inc.
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <locale.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib-unix.h>
+#include <gmodule.h>
+
+#include "gsystem-local-alloc.h"
+#include "main-utils.h"
+#include "NetworkManagerUtils.h"
+#include "nm-logging.h"
+
+static gboolean
+sighup_handler (gpointer user_data)
+{
+ nm_main_config_reload ();
+ return G_SOURCE_CONTINUE;
+}
+
+static gboolean
+sigint_handler (gpointer user_data)
+{
+ GMainLoop *main_loop = user_data;
+
+ nm_log_info (LOGD_CORE, "caught SIGINT, shutting down normally.");
+ g_main_loop_quit (main_loop);
+
+ return G_SOURCE_REMOVE;
+}
+
+static gboolean
+sigterm_handler (gpointer user_data)
+{
+ GMainLoop *main_loop = user_data;
+
+ nm_log_info (LOGD_CORE, "caught SIGTERM, shutting down normally.");
+ g_main_loop_quit (main_loop);
+
+ return G_SOURCE_REMOVE;
+}
+
+/**
+ * nm_main_utils_setup_signals:
+ * @main_loop: the #GMainLoop to quit when SIGINT or SIGTERM is received
+ *
+ * Sets up signal handling for NetworkManager.
+ */
+void
+nm_main_utils_setup_signals (GMainLoop *main_loop)
+{
+ g_return_if_fail (main_loop != NULL);
+
+ signal (SIGPIPE, SIG_IGN);
+
+ g_unix_signal_add (SIGHUP, sighup_handler, NULL);
+ g_unix_signal_add (SIGINT, sigint_handler, main_loop);
+ g_unix_signal_add (SIGTERM, sigterm_handler, main_loop);
+}
+
+gboolean
+nm_main_utils_write_pidfile (const char *pidfile)
+{
+ char pid[16];
+ int fd;
+ gboolean success = FALSE;
+
+ if ((fd = open (pidfile, O_CREAT|O_WRONLY|O_TRUNC, 00644)) < 0) {
+ fprintf (stderr, _("Opening %s failed: %s\n"), pidfile, strerror (errno));
+ return FALSE;
+ }
+
+ g_snprintf (pid, sizeof (pid), "%d", getpid ());
+ if (write (fd, pid, strlen (pid)) < 0)
+ fprintf (stderr, _("Writing to %s failed: %s\n"), pidfile, strerror (errno));
+ else
+ success = TRUE;
+
+ if (close (fd))
+ fprintf (stderr, _("Closing %s failed: %s\n"), pidfile, strerror (errno));
+
+ return success;
+}
+
+void
+nm_main_utils_ensure_rundir ()
+{
+ /* Setup runtime directory */
+ if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) {
+ fprintf (stderr, _("Cannot create '%s': %s"), NMRUNDIR, strerror (errno));
+ exit (1);
+ }
+}
+
+/**
+ * nm_main_utils_ensure_not_running_pidfile:
+ * @pidfile: the pid file
+ *
+ * Checks whether the pidfile already exists and contains PID of a running
+ * process.
+ *
+ * Exits with code 1 if a conflicting process is running.
+ */
+void
+nm_main_utils_ensure_not_running_pidfile (const char *pidfile)
+{
+ gs_free char *contents = NULL;
+ gs_free char *proc_cmdline = NULL;
+ gsize len = 0;
+ glong pid;
+ const char *process_name;
+ const char *prgname = g_get_prgname ();
+
+ g_return_if_fail (prgname);
+
+ if (!pidfile || !*pidfile)
+ return;
+
+ if (!g_file_get_contents (pidfile, &contents, &len, NULL))
+ return;
+ if (len <= 0)
+ return;
+
+ errno = 0;
+ pid = strtol (contents, NULL, 10);
+ if (pid <= 0 || pid > 65536 || errno)
+ return;
+
+ g_clear_pointer (&contents, g_free);
+ proc_cmdline = g_strdup_printf ("/proc/%ld/cmdline", pid);
+ if (!g_file_get_contents (proc_cmdline, &contents, &len, NULL))
+ return;
+
+ process_name = strrchr (contents, '/');
+ if (process_name)
+ process_name++;
+ else
+ process_name = contents;
+ if (strcmp (process_name, prgname) == 0) {
+ /* Check that the process exists */
+ if (kill (pid, 0) == 0) {
+ fprintf (stderr, _("%s is already running (pid %ld)\n"), prgname, pid);
+ exit (1);
+ }
+ }
+}
+
+void
+nm_main_utils_ensure_root ()
+{
+ if (getuid () != 0) {
+ fprintf (stderr, _("You must be root to run %s!\n"), str_if_set (g_get_prgname (), ""));
+ exit (1);
+ }
+}
+
+gboolean
+nm_main_utils_early_setup (const char *progname,
+ int *argc,
+ char **argv[],
+ GOptionEntry *options,
+ void (*option_context_hook) (gpointer user_data, GOptionContext *opt_ctx),
+ gpointer option_context_hook_data,
+ const char *summary)
+{
+ GOptionContext *opt_ctx = NULL;
+ GError *error = NULL;
+ gboolean success = FALSE;
+ int i;
+ const char *opt_fmt_log_level = NULL, *opt_fmt_log_domains = NULL;
+ const char **opt_loc_log_level = NULL, **opt_loc_log_domains = NULL;
+
+ /* Make GIO ignore the remote VFS service; otherwise it tries to use the
+ * session bus to contact the remote service, and NM shouldn't ever be
+ * talking on the session bus. See rh #588745
+ */
+ setenv ("GIO_USE_VFS", "local", 1);
+
+ /*
+ * Set the umask to 0022, which results in 0666 & ~0022 = 0644.
+ * Otherwise, if root (or an su'ing user) has a wacky umask, we could
+ * write out an unreadable resolv.conf.
+ */
+ umask (022);
+
+ /* Ensure gettext() gets the right environment (bgo #666516) */
+ setlocale (LC_ALL, "");
+ textdomain (GETTEXT_PACKAGE);
+
+ for (i = 0; options[i].long_name; i++) {
+ if (!strcmp (options[i].long_name, "log-level")) {
+ opt_fmt_log_level = options[i].description;
+ opt_loc_log_level = &options[i].description;
+ options[i].description = g_strdup_printf (options[i].description, nm_logging_all_levels_to_string ());
+ } else if (!strcmp (options[i].long_name, "log-domains")) {
+ opt_fmt_log_domains = options[i].description;
+ opt_loc_log_domains = &options[i].description;
+ options[i].description = g_strdup_printf (options[i].description, nm_logging_all_domains_to_string ());
+ }
+ }
+
+ /* Parse options */
+ opt_ctx = g_option_context_new (NULL);
+ g_option_context_set_translation_domain (opt_ctx, GETTEXT_PACKAGE);
+ g_option_context_set_ignore_unknown_options (opt_ctx, FALSE);
+ g_option_context_set_help_enabled (opt_ctx, TRUE);
+ g_option_context_add_main_entries (opt_ctx, options, NULL);
+ g_option_context_set_summary (opt_ctx, summary);
+ if (option_context_hook)
+ option_context_hook (option_context_hook_data, opt_ctx);
+
+ success = g_option_context_parse (opt_ctx, argc, argv, &error);
+ if (!success) {
+ fprintf (stderr, _("%s. Please use --help to see a list of valid options.\n"),
+ error->message);
+ g_clear_error (&error);
+ }
+ g_option_context_free (opt_ctx);
+
+ if (opt_loc_log_level) {
+ g_free ((char *) *opt_loc_log_level);
+ *opt_loc_log_level = opt_fmt_log_level;
+ }
+ if (opt_loc_log_domains) {
+ g_free ((char *) *opt_loc_log_domains);
+ *opt_loc_log_domains = opt_fmt_log_domains;
+ }
+
+ return success;
+}
+
diff --git a/src/main-utils.h b/src/main-utils.h
new file mode 100644
index 0000000000..7adfa94940
--- /dev/null
+++ b/src/main-utils.h
@@ -0,0 +1,49 @@
+/* -*- 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 (C) 2014 Red Hat, Inc.
+ */
+
+#ifndef __MAIN_UTILS_H__
+#define __MAIN_UTILS_H__
+
+#include <glib.h>
+
+void nm_main_utils_ensure_root (void);
+
+void nm_main_utils_setup_signals (GMainLoop *main_loop);
+
+void nm_main_utils_ensure_rundir (void);
+
+gboolean nm_main_utils_write_pidfile (const char *pidfile);
+
+void nm_main_utils_ensure_not_running_pidfile (const char *pidfile);
+
+gboolean nm_main_utils_early_setup (const char *progname,
+ int *argc,
+ char **argv[],
+ GOptionEntry *options,
+ void (*option_context_hook) (gpointer user_data, GOptionContext *opt_ctx),
+ gpointer option_context_hook_data,
+ const char *summary);
+
+/* The following functions are not implemented inside nm-main-utils.c, instead
+ * main.c and nm-iface-helper.c */
+
+void nm_main_config_reload (void);
+
+#endif /* __MAIN_UTILS_H__ */
diff --git a/src/main.c b/src/main.c
index f4f693d1e4..2648a08f41 100644
--- a/src/main.c
+++ b/src/main.c
@@ -19,7 +19,8 @@
* Copyright (C) 2005 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <glib.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
@@ -42,21 +43,19 @@
#include "gsystem-local-alloc.h"
#include "nm-dbus-interface.h"
#include "NetworkManagerUtils.h"
+#include "main-utils.h"
#include "nm-manager.h"
#include "nm-linux-platform.h"
-#include "nm-dns-manager.h"
#include "nm-dbus-manager.h"
-#include "nm-supplicant-manager.h"
+#include "nm-device.h"
#include "nm-dhcp-manager.h"
-#include "nm-firewall-manager.h"
-#include "nm-vpn-manager.h"
#include "nm-logging.h"
#include "nm-config.h"
-#include "nm-posix-signals.h"
#include "nm-session-monitor.h"
#include "nm-dispatcher.h"
#include "nm-settings.h"
#include "nm-auth-manager.h"
+#include "nm-core-internal.h"
#if !defined(NM_DIST_VERSION)
# define NM_DIST_VERSION VERSION
@@ -65,161 +64,22 @@
#define NM_DEFAULT_PID_FILE NMRUNDIR "/NetworkManager.pid"
#define NM_DEFAULT_SYSTEM_STATE_FILE NMSTATEDIR "/NetworkManager.state"
-/*
- * Globals
- */
static GMainLoop *main_loop = NULL;
-static gboolean quit_early = FALSE;
-static sigset_t signal_set;
-
-void *signal_handling_thread (void *arg);
-/*
- * Thread function waiting for signals and processing them.
- * Wait for signals in signal set. The semantics of sigwait() require that all
- * threads (including the thread calling sigwait()) have the signal masked, for
- * reliable operation. Otherwise, a signal that arrives while this thread is
- * not blocked in sigwait() might be delivered to another thread.
- */
-void *
-signal_handling_thread (void *arg)
-{
- int signo;
-
- while (1) {
- sigwait (&signal_set, &signo);
-
- switch (signo) {
- case SIGINT:
- case SIGTERM:
- nm_log_info (LOGD_CORE, "caught signal %d, shutting down normally.", signo);
- quit_early = TRUE; /* for quitting before entering the main loop */
- g_main_loop_quit (main_loop);
- break;
- case SIGHUP:
- /* Reread config stuff like system config files, VPN service files, etc */
- nm_log_info (LOGD_CORE, "caught signal %d, not supported yet.", signo);
- break;
- case SIGPIPE:
- /* silently ignore signal */
- break;
- default:
- nm_log_err (LOGD_CORE, "caught unexpected signal %d", signo);
- break;
- }
- }
- return NULL;
-}
-
-/*
- * Mask the signals we are interested in and create a signal handling thread.
- * Because all threads inherit the signal mask from their creator, all threads
- * in the process will have the signals masked. That's why setup_signals() has
- * to be called before creating other threads.
- */
-static gboolean
-setup_signals (void)
-{
- pthread_t signal_thread_id;
- sigset_t old_sig_mask;
- int status;
-
- sigemptyset (&signal_set);
- sigaddset (&signal_set, SIGHUP);
- sigaddset (&signal_set, SIGINT);
- sigaddset (&signal_set, SIGTERM);
- sigaddset (&signal_set, SIGPIPE);
-
- /* Block all signals of interest. */
- status = pthread_sigmask (SIG_BLOCK, &signal_set, &old_sig_mask);
- if (status != 0) {
- fprintf (stderr, _("Failed to set signal mask: %d"), status);
- return FALSE;
- }
- /* Save original mask so that we could use it for child processes. */
- nm_save_original_signal_mask (old_sig_mask);
-
- /* Create the signal handling thread. */
- status = pthread_create (&signal_thread_id, NULL, signal_handling_thread, NULL);
- if (status != 0) {
- fprintf (stderr, _("Failed to create signal handling thread: %d"), status);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-write_pidfile (const char *pidfile)
-{
- char pid[16];
- int fd;
- gboolean success = FALSE;
-
- if ((fd = open (pidfile, O_CREAT|O_WRONLY|O_TRUNC, 00644)) < 0) {
- fprintf (stderr, _("Opening %s failed: %s\n"), pidfile, strerror (errno));
- return FALSE;
- }
-
- g_snprintf (pid, sizeof (pid), "%d", getpid ());
- if (write (fd, pid, strlen (pid)) < 0)
- fprintf (stderr, _("Writing to %s failed: %s\n"), pidfile, strerror (errno));
- else
- success = TRUE;
-
- if (close (fd))
- fprintf (stderr, _("Closing %s failed: %s\n"), pidfile, strerror (errno));
-
- return success;
-}
-
-/* Check whether the pidfile already exists and contains PID of a running NetworkManager
- * Returns: FALSE - specified pidfile doesn't exist or doesn't contain PID of a running NM process
- * TRUE - specified pidfile already exists and contains PID of a running NM process
- */
-static gboolean
-check_pidfile (const char *pidfile)
-{
- char *contents = NULL;
- gsize len = 0;
- glong pid;
- char *proc_cmdline = NULL;
- gboolean nm_running = FALSE;
- const char *process_name;
-
- if (!g_file_get_contents (pidfile, &contents, &len, NULL))
- return FALSE;
-
- if (len <= 0)
- goto done;
-
- errno = 0;
- pid = strtol (contents, NULL, 10);
- if (pid <= 0 || pid > 65536 || errno)
- goto done;
-
- g_free (contents);
- proc_cmdline = g_strdup_printf ("/proc/%ld/cmdline", pid);
- if (!g_file_get_contents (proc_cmdline, &contents, &len, NULL))
- goto done;
-
- process_name = strrchr (contents, '/');
- if (process_name)
- process_name++;
- else
- process_name = contents;
- if (strcmp (process_name, "NetworkManager") == 0) {
- /* Check that the process exists */
- if (kill (pid, 0) == 0) {
- fprintf (stderr, _("NetworkManager is already running (pid %ld)\n"), pid);
- nm_running = TRUE;
- }
- }
-
-done:
- g_free (proc_cmdline);
- g_free (contents);
- return nm_running;
-}
+static gboolean configure_and_quit = FALSE;
+
+static struct {
+ gboolean show_version;
+ gboolean become_daemon;
+ gboolean debug;
+ gboolean g_fatal_warnings;
+ gboolean run_from_build_dir;
+ char *opt_log_level;
+ char *opt_log_domains;
+ char *pidfile;
+ char *state_file;
+} global_opt = {
+ .become_daemon = TRUE,
+};
static gboolean
parse_state_file (const char *filename,
@@ -330,6 +190,58 @@ _init_nm_debug (const char *debug)
}
}
+void
+nm_main_config_reload ()
+{
+ nm_log_info (LOGD_CORE, "reload configuration...");
+ /* The signal handler thread is only installed after
+ * creating NMConfig instance, and on shut down we
+ * no longer run the mainloop (to reach this point).
+ *
+ * Hence, a NMConfig singleton instance must always be
+ * available. */
+ nm_config_reload (nm_config_get ());
+}
+
+static void
+manager_configure_quit (NMManager *manager, gpointer user_data)
+{
+ nm_log_info (LOGD_CORE, "quitting now that startup is complete");
+ g_main_loop_quit (main_loop);
+ configure_and_quit = TRUE;
+}
+
+static void
+do_early_setup (int *argc, char **argv[], NMConfigCmdLineOptions *config_cli)
+{
+ GOptionEntry options[] = {
+ { "version", 'V', 0, G_OPTION_ARG_NONE, &global_opt.show_version, N_("Print NetworkManager version and exit"), NULL },
+ { "no-daemon", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &global_opt.become_daemon, N_("Don't become a daemon"), NULL },
+ { "debug", 'd', 0, G_OPTION_ARG_NONE, &global_opt.debug, N_("Don't become a daemon, and log to stderr"), NULL },
+ { "log-level", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_level, N_("Log level: one of [%s]"), "INFO" },
+ { "log-domains", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_domains,
+ N_("Log domains separated by ',': any combination of [%s]"),
+ "PLATFORM,RFKILL,WIFI" },
+ { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &global_opt.g_fatal_warnings, N_("Make all warnings fatal"), NULL },
+ { "pid-file", 'p', 0, G_OPTION_ARG_FILENAME, &global_opt.pidfile, N_("Specify the location of a PID file"), N_("filename") },
+ { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &global_opt.state_file, N_("State file location"), N_("/path/to/state.file") },
+ { "run-from-build-dir", 0, 0, G_OPTION_ARG_NONE, &global_opt.run_from_build_dir, "Run from build directory", NULL },
+ {NULL}
+ };
+
+ if (!nm_main_utils_early_setup ("NetworkManager",
+ argc,
+ argv,
+ options,
+ (void (*)(gpointer, GOptionContext *)) nm_config_cmd_line_options_add_to_entries,
+ config_cli,
+ _("NetworkManager monitors all network connections and automatically\nchooses the best connection to use. It also allows the user to\nspecify wireless access points which wireless cards in the computer\nshould associate with.")))
+ exit (1);
+
+ global_opt.pidfile = global_opt.pidfile ? global_opt.pidfile : g_strdup (NM_DEFAULT_PID_FILE);
+ global_opt.state_file = global_opt.state_file ? global_opt.state_file : g_strdup (NM_DEFAULT_SYSTEM_STATE_FILE);
+}
+
/*
* main
*
@@ -337,130 +249,55 @@ _init_nm_debug (const char *debug)
int
main (int argc, char *argv[])
{
- GOptionContext *opt_ctx = NULL;
- char *opt_log_level = NULL;
- char *opt_log_domains = NULL;
- gboolean become_daemon = TRUE, run_from_build_dir = FALSE;
- gboolean debug = FALSE;
- gboolean g_fatal_warnings = FALSE;
- gs_free char *pidfile = NULL;
- gs_free char *state_file = NULL;
gboolean wifi_enabled = TRUE, net_enabled = TRUE, wwan_enabled = TRUE, wimax_enabled = TRUE;
- gboolean success, show_version = FALSE;
- int i;
+ gboolean success = FALSE;
NMManager *manager = NULL;
- gs_unref_object NMVpnManager *vpn_manager = NULL;
- gs_unref_object NMDnsManager *dns_mgr = NULL;
- gs_unref_object NMDBusManager *dbus_mgr = NULL;
- gs_unref_object NMSupplicantManager *sup_mgr = NULL;
- gs_unref_object NMDhcpManager *dhcp_mgr = NULL;
- gs_unref_object NMFirewallManager *fw_mgr = NULL;
gs_unref_object NMSettings *settings = NULL;
- gs_unref_object NMConfig *config = NULL;
- gs_unref_object NMSessionMonitor *session_monitor = NULL;
+ NMConfig *config;
GError *error = NULL;
gboolean wrote_pidfile = FALSE;
char *bad_domains = NULL;
+ NMConfigCmdLineOptions *config_cli;
- GOptionEntry options[] = {
- { "version", 'V', 0, G_OPTION_ARG_NONE, &show_version, N_("Print NetworkManager version and exit"), NULL },
- { "no-daemon", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &become_daemon, N_("Don't become a daemon"), NULL },
- { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, N_("Don't become a daemon, and log to stderr"), NULL },
- { "log-level", 0, 0, G_OPTION_ARG_STRING, &opt_log_level, N_("Log level: one of [%s]"), "INFO" },
- { "log-domains", 0, 0, G_OPTION_ARG_STRING, &opt_log_domains,
- N_("Log domains separated by ',': any combination of [%s]"),
- "PLATFORM,RFKILL,WIFI" },
- { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &g_fatal_warnings, N_("Make all warnings fatal"), NULL },
- { "pid-file", 'p', 0, G_OPTION_ARG_FILENAME, &pidfile, N_("Specify the location of a PID file"), N_("filename") },
- { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &state_file, N_("State file location"), N_("/path/to/state.file") },
- { "run-from-build-dir", 0, 0, G_OPTION_ARG_NONE, &run_from_build_dir, "Run from build directory", NULL },
- {NULL}
- };
-
- /* Make GIO ignore the remote VFS service; otherwise it tries to use the
- * session bus to contact the remote service, and NM shouldn't ever be
- * talking on the session bus. See rh #588745
- */
- setenv ("GIO_USE_VFS", "local", 1);
+#if !GLIB_CHECK_VERSION (2, 35, 0)
+ g_type_init ();
+#endif
- /*
- * Set the umask to 0022, which results in 0666 & ~0022 = 0644.
- * Otherwise, if root (or an su'ing user) has a wacky umask, we could
- * write out an unreadable resolv.conf.
- */
- umask (022);
+ _nm_utils_is_manager_process = TRUE;
- /* Set locale to be able to use environment variables */
- setlocale (LC_ALL, "");
+ main_loop = g_main_loop_new (NULL, FALSE);
- bindtextdomain (GETTEXT_PACKAGE, NMLOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
+ config_cli = nm_config_cmd_line_options_new ();
+ do_early_setup (&argc, &argv, config_cli);
- if (!g_module_supported ()) {
- fprintf (stderr, _("GModules are not supported on your platform!\n"));
- exit (1);
- }
+ if (global_opt.g_fatal_warnings) {
+ GLogLevelFlags fatal_mask;
- if (getuid () != 0) {
- fprintf (stderr, _("You must be root to run NetworkManager!\n"));
- exit (1);
+ fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
+ fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
+ g_log_set_always_fatal (fatal_mask);
}
- for (i = 0; options[i].long_name; i++) {
- if (!strcmp (options[i].long_name, "log-level")) {
- options[i].description = g_strdup_printf (options[i].description,
- nm_logging_all_levels_to_string ());
- } else if (!strcmp (options[i].long_name, "log-domains")) {
- options[i].description = g_strdup_printf (options[i].description,
- nm_logging_all_domains_to_string ());
- }
+ if (global_opt.show_version) {
+ fprintf (stdout, NM_DIST_VERSION "\n");
+ exit (0);
}
- /* Parse options */
- opt_ctx = g_option_context_new (NULL);
- g_option_context_set_translation_domain (opt_ctx, GETTEXT_PACKAGE);
- g_option_context_set_ignore_unknown_options (opt_ctx, FALSE);
- g_option_context_set_help_enabled (opt_ctx, TRUE);
- g_option_context_add_main_entries (opt_ctx, options, NULL);
- g_option_context_add_main_entries (opt_ctx, nm_config_get_options (), NULL);
-
- g_option_context_set_summary (opt_ctx,
- _("NetworkManager monitors all network connections and automatically\nchooses the best connection to use. It also allows the user to\nspecify wireless access points which wireless cards in the computer\nshould associate with."));
+ nm_main_utils_ensure_root ();
- success = g_option_context_parse (opt_ctx, &argc, &argv, &error);
- g_option_context_free (opt_ctx);
+ nm_main_utils_ensure_not_running_pidfile (global_opt.pidfile);
- if (!success) {
- fprintf (stderr, _("%s. Please use --help to see a list of valid options.\n"),
- error->message);
- g_clear_error (&error);
+ /* Ensure state directory exists */
+ if (g_mkdir_with_parents (NMSTATEDIR, 0755) != 0) {
+ fprintf (stderr, "Cannot create '%s': %s", NMSTATEDIR, strerror (errno));
exit (1);
}
- if (show_version) {
- fprintf (stdout, NM_DIST_VERSION "\n");
- exit (0);
- }
-
- if (!nm_logging_setup (opt_log_level,
- opt_log_domains,
- &bad_domains,
- &error)) {
- fprintf (stderr,
- _("%s. Please use --help to see a list of valid options.\n"),
- error->message);
- exit (1);
- } else if (bad_domains) {
- fprintf (stderr,
- _("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"),
- bad_domains);
- g_clear_pointer (&bad_domains, g_free);
- }
+ nm_main_utils_ensure_rundir ();
/* When running from the build directory, determine our build directory
* base and set helper paths in the build tree */
- if (run_from_build_dir) {
+ if (global_opt.run_from_build_dir) {
char *path, *slash;
int g;
@@ -482,27 +319,25 @@ main (int argc, char *argv[])
g_free (path);
}
- /* Setup runtime directory */
- if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) {
- nm_log_err (LOGD_CORE, "Cannot create '%s': %s", NMRUNDIR, strerror (errno));
- exit (1);
- }
-
- /* Ensure state directory exists */
- if (g_mkdir_with_parents (NMSTATEDIR, 0755) != 0) {
- nm_log_err (LOGD_CORE, "Cannot create '%s': %s", NMSTATEDIR, strerror (errno));
+ if (!nm_logging_setup (global_opt.opt_log_level,
+ global_opt.opt_log_domains,
+ &bad_domains,
+ &error)) {
+ fprintf (stderr,
+ _("%s. Please use --help to see a list of valid options.\n"),
+ error->message);
exit (1);
+ } else if (bad_domains) {
+ fprintf (stderr,
+ _("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"),
+ bad_domains);
+ g_clear_pointer (&bad_domains, g_free);
}
- pidfile = pidfile ? pidfile : g_strdup (NM_DEFAULT_PID_FILE);
- state_file = state_file ? state_file : g_strdup (NM_DEFAULT_SYSTEM_STATE_FILE);
-
- /* check pid file */
- if (check_pidfile (pidfile))
- exit (1);
-
/* Read the config file and CLI overrides */
- config = nm_config_new (&error);
+ config = nm_config_setup (config_cli, &error);
+ nm_config_cmd_line_options_free (config_cli);
+ config_cli = NULL;
if (config == NULL) {
fprintf (stderr, _("Failed to read configuration: (%d) %s\n"),
error ? error->code : -1,
@@ -510,10 +345,12 @@ main (int argc, char *argv[])
exit (1);
}
+ _init_nm_debug (nm_config_get_debug (config));
+
/* Initialize logging from config file *only* if not explicitly
* specified by commandline.
*/
- if (opt_log_level == NULL && opt_log_domains == NULL) {
+ if (global_opt.opt_log_level == NULL && global_opt.opt_log_domains == NULL) {
if (!nm_logging_setup (nm_config_get_log_level (config),
nm_config_get_log_domains (config),
&bad_domains,
@@ -529,17 +366,7 @@ main (int argc, char *argv[])
}
}
- /* Parse the state file */
- if (!parse_state_file (state_file, &net_enabled, &wifi_enabled, &wwan_enabled, &wimax_enabled, &error)) {
- fprintf (stderr, _("State file %s parsing failed: (%d) %s\n"),
- state_file,
- error ? error->code : -1,
- (error && error->message) ? error->message : _("unknown"));
- /* Not a hard failure */
- }
- g_clear_error (&error);
-
- if (become_daemon && !debug) {
+ if (global_opt.become_daemon && !global_opt.debug) {
if (daemon (0, 0) < 0) {
int saved_errno;
@@ -549,29 +376,25 @@ main (int argc, char *argv[])
saved_errno);
exit (1);
}
- if (write_pidfile (pidfile))
- wrote_pidfile = TRUE;
+ wrote_pidfile = nm_main_utils_write_pidfile (global_opt.pidfile);
}
- _init_nm_debug (nm_config_get_debug (config));
-
/* Set up unix signal handling - before creating threads, but after daemonizing! */
- if (!setup_signals ())
- exit (1);
+ nm_main_utils_setup_signals (main_loop);
- if (g_fatal_warnings) {
- GLogLevelFlags fatal_mask;
+ nm_logging_syslog_openlog (global_opt.debug);
- fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
- fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
- g_log_set_always_fatal (fatal_mask);
- }
-
- nm_logging_syslog_openlog (debug);
+ nm_log_info (LOGD_CORE, "NetworkManager (version " NM_DIST_VERSION ") is starting...");
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ /* Parse the state file */
+ if (!parse_state_file (global_opt.state_file, &net_enabled, &wifi_enabled, &wwan_enabled, &wimax_enabled, &error)) {
+ nm_log_err (LOGD_CORE, "State file %s parsing failed: (%d) %s",
+ global_opt.state_file,
+ error ? error->code : -1,
+ (error && error->message) ? error->message : _("unknown"));
+ /* Not a hard failure */
+ }
+ g_clear_error (&error);
dbus_threads_init_default ();
@@ -580,10 +403,7 @@ main (int argc, char *argv[])
*/
dbus_glib_global_set_disable_legacy_property_access ();
- nm_log_info (LOGD_CORE, "NetworkManager (version " NM_DIST_VERSION ") is starting...");
- success = FALSE;
-
- nm_log_info (LOGD_CORE, "Read config: %s", nm_config_get_description (config));
+ nm_log_info (LOGD_CORE, "Read config: %s", nm_config_data_get_config_description (nm_config_get_data (config)));
nm_log_info (LOGD_CORE, "WEXT support is %s",
#if HAVE_WEXT
"enabled"
@@ -592,27 +412,26 @@ main (int argc, char *argv[])
#endif
);
- main_loop = g_main_loop_new (NULL, FALSE);
+ if (!nm_dbus_manager_get_connection (nm_dbus_manager_get ())) {
+#if HAVE_DBUS_GLIB_100
+ nm_log_warn (LOGD_CORE, "Failed to connect to D-Bus; only private bus is available");
+#else
+ nm_log_err (LOGD_CORE, "Failed to connect to D-Bus, exiting...");
+ goto done;
+#endif
+ } else {
+ /* Start our DBus service */
+ if (!nm_dbus_manager_start_service (nm_dbus_manager_get ())) {
+ nm_log_err (LOGD_CORE, "failed to start the dbus service.");
+ goto done;
+ }
+ }
/* Set up platform interaction layer */
nm_linux_platform_setup ();
nm_auth_manager_setup (nm_config_get_auth_polkit (config));
- /* Initialize our DBus service & connection */
- dbus_mgr = nm_dbus_manager_get ();
- g_assert (dbus_mgr != NULL);
-
- vpn_manager = nm_vpn_manager_get ();
- g_assert (vpn_manager != NULL);
-
- dns_mgr = nm_dns_manager_get ();
- g_assert (dns_mgr != NULL);
-
- /* Initialize DHCP manager */
- dhcp_mgr = nm_dhcp_manager_get ();
- g_assert (dhcp_mgr != NULL);
-
nm_dispatcher_init ();
settings = nm_settings_new (&error);
@@ -623,7 +442,7 @@ main (int argc, char *argv[])
}
manager = nm_manager_new (settings,
- state_file,
+ global_opt.state_file,
net_enabled,
wifi_enabled,
wwan_enabled,
@@ -635,32 +454,7 @@ main (int argc, char *argv[])
goto done;
}
- /* Initialize the supplicant manager */
- sup_mgr = nm_supplicant_manager_get ();
- g_assert (sup_mgr != NULL);
-
- /* Initialize Firewall manager */
- fw_mgr = nm_firewall_manager_get ();
- g_assert (fw_mgr != NULL);
-
- /* Initialize session monitor */
- session_monitor = nm_session_monitor_get ();
- g_assert (session_monitor != NULL);
-
- if (!nm_dbus_manager_get_connection (dbus_mgr)) {
-#if HAVE_DBUS_GLIB_100
- nm_log_warn (LOGD_CORE, "Failed to connect to D-Bus; only private bus is available");
-#else
- nm_log_err (LOGD_CORE, "Failed to connect to D-Bus, exiting...");
- goto done;
-#endif
- } else {
- /* Start our DBus service */
- if (!nm_dbus_manager_start_service (dbus_mgr)) {
- nm_log_err (LOGD_CORE, "failed to start the dbus service.");
- goto done;
- }
- }
+ g_signal_connect (manager, NM_MANAGER_CONFIGURE_QUIT, G_CALLBACK (manager_configure_quit), config);
nm_manager_start (manager);
@@ -679,19 +473,18 @@ main (int argc, char *argv[])
success = TRUE;
- /* Told to quit before getting to the mainloop by the signal handler */
- if (quit_early == TRUE)
- goto done;
+ if (configure_and_quit == FALSE)
+ g_main_loop_run (main_loop);
- g_main_loop_run (main_loop);
+ nm_manager_stop (manager);
done:
g_clear_object (&manager);
nm_logging_syslog_closelog ();
- if (pidfile && wrote_pidfile)
- unlink (pidfile);
+ if (global_opt.pidfile && wrote_pidfile)
+ unlink (global_opt.pidfile);
nm_log_info (LOGD_CORE, "exiting (%s)", success ? "success" : "error");
exit (success ? 0 : 1);
diff --git a/src/nm-activation-request.c b/src/nm-activation-request.c
index 30ce751522..2c084b874e 100644
--- a/src/nm-activation-request.c
+++ b/src/nm-activation-request.c
@@ -35,7 +35,6 @@
#include "nm-device.h"
#include "nm-active-connection.h"
#include "nm-settings-connection.h"
-#include "nm-posix-signals.h"
#include "nm-auth-subject.h"
G_DEFINE_TYPE (NMActRequest, nm_act_request, NM_TYPE_ACTIVE_CONNECTION)
@@ -196,16 +195,6 @@ clear_share_rules (NMActRequest *req)
priv->share_rules = NULL;
}
-static void
-share_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- nm_unblock_posix_signals (NULL);
-}
-
void
nm_act_request_set_shared (NMActRequest *req, gboolean shared)
{
@@ -243,7 +232,7 @@ nm_act_request_set_shared (NMActRequest *req, gboolean shared)
nm_log_info (LOGD_SHARING, "Executing: %s", cmd);
if (!g_spawn_sync ("/", argv, envp, G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
- share_child_setup, NULL, NULL, NULL, &status, &error)) {
+ NULL, NULL, NULL, NULL, &status, &error)) {
nm_log_warn (LOGD_SHARING, "Error executing command: (%d) %s",
error ? error->code : -1,
(error && error->message) ? error->message : "(unknown)");
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index 73925659df..d0b5b8753f 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include "nm-types.h"
@@ -33,6 +35,7 @@
#include "NetworkManagerUtils.h"
#include "gsystem-local-alloc.h"
#include "nm-active-connection-glue.h"
+#include "nm-glib-compat.h"
/* Base class for anything implementing the Connection.Active D-Bus interface */
G_DEFINE_ABSTRACT_TYPE (NMActiveConnection, nm_active_connection, G_TYPE_OBJECT)
diff --git a/src/nm-auth-manager.c b/src/nm-auth-manager.c
index df849d58d6..c1b352c92c 100644
--- a/src/nm-auth-manager.c
+++ b/src/nm-auth-manager.c
@@ -18,6 +18,8 @@
* Copyright (C) 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include "nm-auth-manager.h"
#include "nm-logging.h"
@@ -35,7 +37,7 @@
if (nm_logging_enabled ((level), (domain))) { \
char __prefix[30] = "auth"; \
\
- if ((self) != _instance) \
+ if ((self) != singleton_instance) \
g_snprintf (__prefix, sizeof (__prefix), "auth[%p]", (self)); \
nm_log ((level), (domain), \
"%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
@@ -74,7 +76,8 @@ typedef struct {
#endif
} NMAuthManagerPrivate;
-static NMAuthManager *_instance = NULL;
+NM_DEFINE_SINGLETON_DESTRUCTOR (NMAuthManager);
+NM_DEFINE_SINGLETON_WEAK_REF (NMAuthManager);
G_DEFINE_TYPE (NMAuthManager, nm_auth_manager, G_TYPE_OBJECT)
@@ -483,9 +486,9 @@ _dbus_new_proxy_cb (GObject *source_object,
NMAuthManager *
nm_auth_manager_get ()
{
- g_return_val_if_fail (_instance, NULL);
+ g_return_val_if_fail (singleton_instance, NULL);
- return _instance;
+ return singleton_instance;
}
NMAuthManager *
@@ -493,14 +496,17 @@ nm_auth_manager_setup (gboolean polkit_enabled)
{
NMAuthManager *self;
- g_return_val_if_fail (!_instance, _instance);
+ g_return_val_if_fail (!singleton_instance, singleton_instance);
self = g_object_new (NM_TYPE_AUTH_MANAGER,
NM_AUTH_MANAGER_POLKIT_ENABLED, polkit_enabled,
NULL);
_LOGD ("set instance");
- return (_instance = self);
+ singleton_instance = self;
+ nm_singleton_instance_weak_ref_register ();
+
+ return self;
}
/*****************************************************************************/
@@ -608,19 +614,6 @@ dispose (GObject *object)
}
static void
-finalize (GObject *object)
-{
- NMAuthManager* self = NM_AUTH_MANAGER (object);
-
- G_OBJECT_CLASS (nm_auth_manager_parent_class)->finalize (object);
-
- if (self == _instance) {
- _instance = NULL;
- _LOGD ("unset instance");
- }
-}
-
-static void
nm_auth_manager_class_init (NMAuthManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -631,7 +624,6 @@ nm_auth_manager_class_init (NMAuthManagerClass *klass)
object_class->set_property = set_property;
object_class->constructed = constructed;
object_class->dispose = dispose;
- object_class->finalize = finalize;
g_object_class_install_property
(object_class, PROP_POLKIT_ENABLED,
diff --git a/src/nm-auth-subject.c b/src/nm-auth-subject.c
index 779b711e63..13133f2777 100644
--- a/src/nm-auth-subject.c
+++ b/src/nm-auth-subject.c
@@ -26,6 +26,8 @@
* makes requests, like process identifier and user UID.
*/
+#include "config.h"
+
#include "nm-auth-subject.h"
#include <string.h>
@@ -36,6 +38,7 @@
#include "nm-enum-types.h"
#include "nm-glib-compat.h"
#include "NetworkManagerUtils.h"
+#include "gsystem-local-alloc.h"
G_DEFINE_TYPE (NMAuthSubject, nm_auth_subject, G_TYPE_OBJECT)
@@ -173,7 +176,7 @@ _new_unix_process (DBusGMethodInvocation *context,
NMAuthSubject *self;
gboolean success = FALSE;
gulong pid = 0, uid = 0;
- char *dbus_sender = NULL;
+ gs_free char *dbus_sender = NULL;
g_return_val_if_fail (context || (connection && message), NULL);
diff --git a/src/nm-auth-utils.c b/src/nm-auth-utils.c
index 77b0fd1088..1e14c7babf 100644
--- a/src/nm-auth-utils.c
+++ b/src/nm-auth-utils.c
@@ -18,7 +18,8 @@
* Copyright (C) 2010 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <gio/gio.h>
@@ -157,17 +158,18 @@ nm_auth_chain_steal_data (NMAuthChain *self, const char *tag)
{
ChainData *tmp;
gpointer value = NULL;
+ void *orig_key;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (tag != NULL, NULL);
- tmp = g_hash_table_lookup (self->data, tag);
- if (tmp) {
+ if (g_hash_table_lookup_extended (self->data, tag, &orig_key, (gpointer)&tmp)) {
g_hash_table_steal (self->data, tag);
value = tmp->data;
/* Make sure the destroy handler isn't called when freeing */
tmp->destroy = NULL;
free_data (tmp);
+ g_free (orig_key);
}
return value;
}
@@ -418,17 +420,14 @@ nm_auth_chain_unref (NMAuthChain *self)
gboolean
nm_auth_is_subject_in_acl (NMConnection *connection,
- NMSessionMonitor *smon,
NMAuthSubject *subject,
char **out_error_desc)
{
NMSettingConnection *s_con;
const char *user = NULL;
- GError *local = NULL;
gulong uid;
g_return_val_if_fail (connection != NULL, FALSE);
- g_return_val_if_fail (smon != NULL, FALSE);
g_return_val_if_fail (NM_IS_AUTH_SUBJECT (subject), FALSE);
g_return_val_if_fail (nm_auth_subject_is_internal (subject) || nm_auth_subject_is_unix_process (subject), FALSE);
@@ -441,18 +440,7 @@ nm_auth_is_subject_in_acl (NMConnection *connection,
if (0 == uid)
return TRUE;
- /* Reject the request if the request comes from no session at all */
- if (!nm_session_monitor_uid_has_session (smon, uid, &user, &local)) {
- if (out_error_desc) {
- *out_error_desc = g_strdup_printf ("No session found for uid %lu (%s)",
- uid,
- local && local->message ? local->message : "unknown");
- }
- g_clear_error (&local);
- return FALSE;
- }
-
- if (!user) {
+ if (!nm_session_monitor_uid_to_user (uid, &user)) {
if (out_error_desc)
*out_error_desc = g_strdup_printf ("Could not determine username for uid %lu", uid);
return FALSE;
diff --git a/src/nm-auth-utils.h b/src/nm-auth-utils.h
index 2ab026d012..138c616d97 100644
--- a/src/nm-auth-utils.h
+++ b/src/nm-auth-utils.h
@@ -89,7 +89,6 @@ void nm_auth_chain_unref (NMAuthChain *chain);
/* Caller must free returned error description */
gboolean nm_auth_is_subject_in_acl (NMConnection *connection,
- NMSessionMonitor *smon,
NMAuthSubject *subect,
char **out_error_desc);
diff --git a/src/nm-config-data.c b/src/nm-config-data.c
new file mode 100644
index 0000000000..45d90b51d2
--- /dev/null
+++ b/src/nm-config-data.c
@@ -0,0 +1,427 @@
+/* -*- 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 (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2013 Thomas Bechtold <thomasbechtold@jpberlin.de>
+ */
+
+#include "nm-config-data.h"
+
+#include <string.h>
+
+#include "nm-config.h"
+#include "gsystem-local-alloc.h"
+
+typedef struct {
+ char *config_main_file;
+ char *config_description;
+
+ GKeyFile *keyfile;
+
+ struct {
+ char *uri;
+ char *response;
+ guint interval;
+ } connectivity;
+
+ struct {
+ char **arr;
+ GSList *specs;
+ } no_auto_default;
+
+ char *dns_mode;
+} NMConfigDataPrivate;
+
+
+enum {
+ PROP_0,
+ PROP_CONFIG_MAIN_FILE,
+ PROP_CONFIG_DESCRIPTION,
+ PROP_KEYFILE,
+ PROP_CONNECTIVITY_URI,
+ PROP_CONNECTIVITY_INTERVAL,
+ PROP_CONNECTIVITY_RESPONSE,
+ PROP_NO_AUTO_DEFAULT,
+
+ LAST_PROP
+};
+
+G_DEFINE_TYPE (NMConfigData, nm_config_data, G_TYPE_OBJECT)
+
+#define NM_CONFIG_DATA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CONFIG_DATA, NMConfigDataPrivate))
+
+/************************************************************************/
+
+const char *
+nm_config_data_get_config_main_file (const NMConfigData *self)
+{
+ g_return_val_if_fail (self, NULL);
+
+ return NM_CONFIG_DATA_GET_PRIVATE (self)->config_main_file;
+}
+
+const char *
+nm_config_data_get_config_description (const NMConfigData *self)
+{
+ g_return_val_if_fail (self, NULL);
+
+ return NM_CONFIG_DATA_GET_PRIVATE (self)->config_description;
+}
+
+char *
+nm_config_data_get_value (const NMConfigData *self, const char *group, const char *key, GError **error)
+{
+ g_return_val_if_fail (self, NULL);
+
+ return g_key_file_get_string (NM_CONFIG_DATA_GET_PRIVATE (self)->keyfile, group, key, error);
+}
+
+const char *
+nm_config_data_get_connectivity_uri (const NMConfigData *self)
+{
+ g_return_val_if_fail (self, NULL);
+
+ return NM_CONFIG_DATA_GET_PRIVATE (self)->connectivity.uri;
+}
+
+const guint
+nm_config_data_get_connectivity_interval (const NMConfigData *self)
+{
+ g_return_val_if_fail (self, 0);
+
+ return MAX (NM_CONFIG_DATA_GET_PRIVATE (self)->connectivity.interval, 0);
+}
+
+const char *
+nm_config_data_get_connectivity_response (const NMConfigData *self)
+{
+ g_return_val_if_fail (self != NULL, NULL);
+
+ return NM_CONFIG_DATA_GET_PRIVATE (self)->connectivity.response;
+}
+
+const char *const*
+nm_config_data_get_no_auto_default (const NMConfigData *self)
+{
+ g_return_val_if_fail (self, FALSE);
+
+ return (const char *const*) NM_CONFIG_DATA_GET_PRIVATE (self)->no_auto_default.arr;
+}
+
+const GSList *
+nm_config_data_get_no_auto_default_list (const NMConfigData *self)
+{
+ g_return_val_if_fail (self, NULL);
+
+ return NM_CONFIG_DATA_GET_PRIVATE (self)->no_auto_default.specs;
+}
+
+const char *
+nm_config_data_get_dns_mode (const NMConfigData *self)
+{
+ g_return_val_if_fail (self, NULL);
+
+ return NM_CONFIG_DATA_GET_PRIVATE (self)->dns_mode;
+}
+
+/************************************************************************/
+
+static gboolean
+_keyfile_a_contains_all_in_b (GKeyFile *kf_a, GKeyFile *kf_b)
+{
+ gs_strfreev char **groups = NULL;
+ guint i, j;
+
+ if (kf_a == kf_b)
+ return TRUE;
+
+ groups = g_key_file_get_groups (kf_a, NULL);
+ for (i = 0; groups && groups[i]; i++) {
+ gs_strfreev char **keys = NULL;
+
+ keys = g_key_file_get_keys (kf_a, groups[i], NULL, NULL);
+ if (keys) {
+ for (j = 0; keys[j]; j++) {
+ gs_free char *key_a = g_key_file_get_value (kf_a, groups[i], keys[j], NULL);
+ gs_free char *key_b = g_key_file_get_value (kf_b, groups[i], keys[j], NULL);
+
+ if (g_strcmp0 (key_a, key_b) != 0)
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+}
+
+NMConfigChangeFlags
+nm_config_data_diff (NMConfigData *old_data, NMConfigData *new_data)
+{
+ NMConfigChangeFlags changes = NM_CONFIG_CHANGE_NONE;
+ NMConfigDataPrivate *priv_old, *priv_new;
+ GSList *spec_old, *spec_new;
+
+ g_return_val_if_fail (NM_IS_CONFIG_DATA (old_data), NM_CONFIG_CHANGE_NONE);
+ g_return_val_if_fail (NM_IS_CONFIG_DATA (new_data), NM_CONFIG_CHANGE_NONE);
+
+ priv_old = NM_CONFIG_DATA_GET_PRIVATE (old_data);
+ priv_new = NM_CONFIG_DATA_GET_PRIVATE (new_data);
+
+ if ( !_keyfile_a_contains_all_in_b (priv_old->keyfile, priv_new->keyfile)
+ || !_keyfile_a_contains_all_in_b (priv_new->keyfile, priv_old->keyfile))
+ changes |= NM_CONFIG_CHANGE_VALUES;
+
+ if ( g_strcmp0 (nm_config_data_get_config_main_file (old_data), nm_config_data_get_config_main_file (new_data)) != 0
+ || g_strcmp0 (nm_config_data_get_config_description (old_data), nm_config_data_get_config_description (new_data)) != 0)
+ changes |= NM_CONFIG_CHANGE_CONFIG_FILES;
+
+ if ( nm_config_data_get_connectivity_interval (old_data) != nm_config_data_get_connectivity_interval (new_data)
+ || g_strcmp0 (nm_config_data_get_connectivity_uri (old_data), nm_config_data_get_connectivity_uri (new_data))
+ || g_strcmp0 (nm_config_data_get_connectivity_response (old_data), nm_config_data_get_connectivity_response (new_data)))
+ changes |= NM_CONFIG_CHANGE_CONNECTIVITY;
+
+ spec_old = priv_old->no_auto_default.specs;
+ spec_new = priv_new->no_auto_default.specs;
+ while (spec_old && spec_new && strcmp (spec_old->data, spec_new->data) == 0) {
+ spec_old = spec_old->next;
+ spec_new = spec_new->next;
+ }
+ if (spec_old || spec_new)
+ changes |= NM_CONFIG_CHANGE_NO_AUTO_DEFAULT;
+
+ if (g_strcmp0 (nm_config_data_get_dns_mode (old_data), nm_config_data_get_dns_mode (new_data)))
+ changes |= NM_CONFIG_CHANGE_DNS_MODE;
+
+ return changes;
+}
+
+/************************************************************************/
+
+static void
+get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ NMConfigData *self = NM_CONFIG_DATA (object);
+
+ switch (prop_id) {
+ case PROP_CONFIG_MAIN_FILE:
+ g_value_set_string (value, nm_config_data_get_config_main_file (self));
+ break;
+ case PROP_CONFIG_DESCRIPTION:
+ g_value_set_string (value, nm_config_data_get_config_description (self));
+ break;
+ case PROP_NO_AUTO_DEFAULT:
+ g_value_take_boxed (value, g_strdupv ((char **) nm_config_data_get_no_auto_default (self)));
+ break;
+ case PROP_CONNECTIVITY_URI:
+ g_value_set_string (value, nm_config_data_get_connectivity_uri (self));
+ break;
+ case PROP_CONNECTIVITY_INTERVAL:
+ g_value_set_uint (value, nm_config_data_get_connectivity_interval (self));
+ break;
+ case PROP_CONNECTIVITY_RESPONSE:
+ g_value_set_string (value, nm_config_data_get_connectivity_response (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ NMConfigData *self = NM_CONFIG_DATA (object);
+ NMConfigDataPrivate *priv = NM_CONFIG_DATA_GET_PRIVATE (self);
+ guint i;
+
+ /* This type is immutable. All properties are construct only. */
+ switch (prop_id) {
+ case PROP_CONFIG_MAIN_FILE:
+ priv->config_main_file = g_value_dup_string (value);
+ break;
+ case PROP_CONFIG_DESCRIPTION:
+ priv->config_description = g_value_dup_string (value);
+ break;
+ case PROP_KEYFILE:
+ priv->keyfile = g_value_dup_boxed (value);
+ if (!priv->keyfile)
+ priv->keyfile = nm_config_create_keyfile ();
+ break;
+ case PROP_NO_AUTO_DEFAULT:
+ priv->no_auto_default.arr = g_strdupv (g_value_get_boxed (value));
+ if (!priv->no_auto_default.arr)
+ priv->no_auto_default.arr = g_new0 (char *, 1);
+ for (i = 0; priv->no_auto_default.arr[i]; i++)
+ priv->no_auto_default.specs = g_slist_prepend (priv->no_auto_default.specs, priv->no_auto_default.arr[i]);
+ priv->no_auto_default.specs = g_slist_reverse (priv->no_auto_default.specs);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+dispose (GObject *object)
+{
+}
+
+static void
+finalize (GObject *gobject)
+{
+ NMConfigDataPrivate *priv = NM_CONFIG_DATA_GET_PRIVATE (gobject);
+
+ g_free (priv->config_main_file);
+ g_free (priv->config_description);
+
+ g_free (priv->connectivity.uri);
+ g_free (priv->connectivity.response);
+
+ g_slist_free (priv->no_auto_default.specs);
+ g_strfreev (priv->no_auto_default.arr);
+
+ g_free (priv->dns_mode);
+
+ g_key_file_unref (priv->keyfile);
+
+ G_OBJECT_CLASS (nm_config_data_parent_class)->finalize (gobject);
+}
+
+static void
+nm_config_data_init (NMConfigData *self)
+{
+}
+
+static void
+constructed (GObject *object)
+{
+ NMConfigData *self = NM_CONFIG_DATA (object);
+ NMConfigDataPrivate *priv = NM_CONFIG_DATA_GET_PRIVATE (self);
+ int interval;
+
+ priv->connectivity.uri = g_key_file_get_value (priv->keyfile, "connectivity", "uri", NULL);
+ priv->connectivity.response = g_key_file_get_value (priv->keyfile, "connectivity", "response", NULL);
+
+ interval = g_key_file_get_integer (priv->keyfile, "connectivity", "interval", NULL);
+ priv->connectivity.interval = MAX (0, interval);
+
+ priv->dns_mode = g_key_file_get_value (priv->keyfile, "main", "dns", NULL);
+
+ G_OBJECT_CLASS (nm_config_data_parent_class)->constructed (object);
+}
+
+NMConfigData *
+nm_config_data_new (const char *config_main_file,
+ const char *config_description,
+ const char *const*no_auto_default,
+ GKeyFile *keyfile)
+{
+ return g_object_new (NM_TYPE_CONFIG_DATA,
+ NM_CONFIG_DATA_CONFIG_MAIN_FILE, config_main_file,
+ NM_CONFIG_DATA_CONFIG_DESCRIPTION, config_description,
+ NM_CONFIG_DATA_KEYFILE, keyfile,
+ NM_CONFIG_DATA_NO_AUTO_DEFAULT, no_auto_default,
+ NULL);
+}
+
+NMConfigData *
+nm_config_data_new_update_no_auto_default (const NMConfigData *base,
+ const char *const*no_auto_default)
+{
+ NMConfigDataPrivate *priv = NM_CONFIG_DATA_GET_PRIVATE (base);
+
+ return g_object_new (NM_TYPE_CONFIG_DATA,
+ NM_CONFIG_DATA_CONFIG_MAIN_FILE, priv->config_main_file,
+ NM_CONFIG_DATA_CONFIG_DESCRIPTION, priv->config_description,
+ NM_CONFIG_DATA_KEYFILE, priv->keyfile, /* the keyfile is unchanged. It's safe to share it. */
+ NM_CONFIG_DATA_NO_AUTO_DEFAULT, no_auto_default,
+ NULL);
+}
+
+static void
+nm_config_data_class_init (NMConfigDataClass *config_class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (config_class);
+
+ g_type_class_add_private (config_class, sizeof (NMConfigDataPrivate));
+
+ object_class->constructed = constructed;
+ object_class->dispose = dispose;
+ object_class->finalize = finalize;
+ object_class->get_property = get_property;
+ object_class->set_property = set_property;
+
+ g_object_class_install_property
+ (object_class, PROP_CONFIG_MAIN_FILE,
+ g_param_spec_string (NM_CONFIG_DATA_CONFIG_MAIN_FILE, "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property
+ (object_class, PROP_CONFIG_DESCRIPTION,
+ g_param_spec_string (NM_CONFIG_DATA_CONFIG_DESCRIPTION, "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property
+ (object_class, PROP_KEYFILE,
+ g_param_spec_boxed (NM_CONFIG_DATA_KEYFILE, "", "",
+ G_TYPE_KEY_FILE,
+ G_PARAM_WRITABLE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property
+ (object_class, PROP_CONNECTIVITY_URI,
+ g_param_spec_string (NM_CONFIG_DATA_CONNECTIVITY_URI, "", "",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property
+ (object_class, PROP_CONNECTIVITY_INTERVAL,
+ g_param_spec_uint (NM_CONFIG_DATA_CONNECTIVITY_INTERVAL, "", "",
+ 0, G_MAXUINT, 0,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property
+ (object_class, PROP_CONNECTIVITY_RESPONSE,
+ g_param_spec_string (NM_CONFIG_DATA_CONNECTIVITY_RESPONSE, "", "",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property
+ (object_class, PROP_NO_AUTO_DEFAULT,
+ g_param_spec_boxed (NM_CONFIG_DATA_NO_AUTO_DEFAULT, "", "",
+ G_TYPE_STRV,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
+}
+
diff --git a/src/nm-config-data.h b/src/nm-config-data.h
new file mode 100644
index 0000000000..f260a73a90
--- /dev/null
+++ b/src/nm-config-data.h
@@ -0,0 +1,95 @@
+/* -*- 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 (C) 2014 Red Hat, Inc.
+ */
+
+#ifndef NM_CONFIG_DATA_H
+#define NM_CONFIG_DATA_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "nm-types.h"
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_CONFIG_DATA (nm_config_data_get_type ())
+#define NM_CONFIG_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONFIG_DATA, NMConfigData))
+#define NM_CONFIG_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CONFIG_DATA, NMConfigDataClass))
+#define NM_IS_CONFIG_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONFIG_DATA))
+#define NM_IS_CONFIG_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_CONFIG_DATA))
+#define NM_CONFIG_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CONFIG_DATA, NMConfigDataClass))
+
+
+#define NM_CONFIG_DATA_CONFIG_MAIN_FILE "config-main-file"
+#define NM_CONFIG_DATA_CONFIG_DESCRIPTION "config-description"
+#define NM_CONFIG_DATA_KEYFILE "keyfile"
+#define NM_CONFIG_DATA_CONNECTIVITY_URI "connectivity-uri"
+#define NM_CONFIG_DATA_CONNECTIVITY_INTERVAL "connectivity-interval"
+#define NM_CONFIG_DATA_CONNECTIVITY_RESPONSE "connectivity-response"
+#define NM_CONFIG_DATA_NO_AUTO_DEFAULT "no-auto-default"
+#define NM_CONFIG_DATA_DNS_MODE "dns"
+
+typedef enum { /*< flags >*/
+ NM_CONFIG_CHANGE_NONE = 0,
+ NM_CONFIG_CHANGE_CONFIG_FILES = (1L << 0),
+ NM_CONFIG_CHANGE_VALUES = (1L << 1),
+ NM_CONFIG_CHANGE_CONNECTIVITY = (1L << 2),
+ NM_CONFIG_CHANGE_NO_AUTO_DEFAULT = (1L << 3),
+ NM_CONFIG_CHANGE_DNS_MODE = (1L << 4),
+
+ _NM_CONFIG_CHANGE_LAST,
+ NM_CONFIG_CHANGE_ALL = ((_NM_CONFIG_CHANGE_LAST - 1) << 1) - 1,
+} NMConfigChangeFlags;
+
+struct _NMConfigData {
+ GObject parent;
+};
+
+typedef struct {
+ GObjectClass parent;
+} NMConfigDataClass;
+
+GType nm_config_data_get_type (void);
+
+NMConfigData *nm_config_data_new (const char *config_main_file,
+ const char *config_description,
+ const char *const*no_auto_default,
+ GKeyFile *keyfile);
+NMConfigData *nm_config_data_new_update_no_auto_default (const NMConfigData *base, const char *const*no_auto_default);
+
+NMConfigChangeFlags nm_config_data_diff (NMConfigData *old_data, NMConfigData *new_data);
+
+const char *nm_config_data_get_config_main_file (const NMConfigData *config_data);
+const char *nm_config_data_get_config_description (const NMConfigData *config_data);
+
+char *nm_config_data_get_value (const NMConfigData *config_data, const char *group, const char *key, GError **error);
+
+const char *nm_config_data_get_connectivity_uri (const NMConfigData *config_data);
+const guint nm_config_data_get_connectivity_interval (const NMConfigData *config_data);
+const char *nm_config_data_get_connectivity_response (const NMConfigData *config_data);
+
+const char *const*nm_config_data_get_no_auto_default (const NMConfigData *config_data);
+const GSList * nm_config_data_get_no_auto_default_list (const NMConfigData *config_data);
+
+const char *nm_config_data_get_dns_mode (const NMConfigData *self);
+
+G_END_DECLS
+
+#endif /* NM_CONFIG_DATA_H */
+
diff --git a/src/nm-config.c b/src/nm-config.c
index 1f41553355..eabb378664 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -19,7 +19,8 @@
* Copyright (C) 2013 Thomas Bechtold <thomasbechtold@jpberlin.de>
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <stdio.h>
@@ -28,6 +29,10 @@
#include "nm-utils.h"
#include "nm-glib-compat.h"
#include "nm-device.h"
+#include "NetworkManagerUtils.h"
+#include "gsystem-local-alloc.h"
+#include "nm-enum-types.h"
+#include "nm-core-internal.h"
#include <gio/gio.h>
#include <glib/gi18n.h>
@@ -37,94 +42,126 @@
#define NM_OLD_SYSTEM_CONF_FILE NMCONFDIR "/nm-system-settings.conf"
#define NM_NO_AUTO_DEFAULT_STATE_FILE NMSTATEDIR "/no-auto-default.state"
+struct NMConfigCmdLineOptions {
+ char *config_main_file;
+ char *config_dir;
+ char *no_auto_default_file;
+ char *plugins;
+ gboolean configure_and_quit;
+ char *connectivity_uri;
+
+ /* We store interval as signed internally to track whether it's
+ * set or not via GOptionEntry
+ */
+ int connectivity_interval;
+ char *connectivity_response;
+};
+
typedef struct {
- char *nm_conf_path;
+ NMConfigCmdLineOptions cli;
+
+ NMConfigData *config_data;
+ NMConfigData *config_data_orig;
+
char *config_dir;
- char *config_description;
char *no_auto_default_file;
- GKeyFile *keyfile;
char **plugins;
gboolean monitor_connection_files;
gboolean auth_polkit;
char *dhcp_client;
- char *dns_mode;
char *log_level;
char *log_domains;
char *debug;
- char *connectivity_uri;
- gint connectivity_interval;
- char *connectivity_response;
+ GSList *ignore_carrier;
- char **no_auto_default;
- char **ignore_carrier;
+ gboolean configure_and_quit;
} NMConfigPrivate;
-static NMConfig *singleton = NULL;
+enum {
+ PROP_0,
+ PROP_CMD_LINE_OPTIONS,
+ LAST_PROP,
+};
-G_DEFINE_TYPE (NMConfig, nm_config, G_TYPE_OBJECT)
+enum {
+ SIGNAL_CONFIG_CHANGED,
-#define NM_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CONFIG, NMConfigPrivate))
+ LAST_SIGNAL
+};
-/************************************************************************/
+static guint signals[LAST_SIGNAL] = { 0 };
-static gboolean
-_parse_bool_str (const char *str, gboolean *out_value)
-{
- gboolean value;
- gsize len;
- char *s = NULL;
+static void nm_config_initable_iface_init (GInitableIface *iface);
- g_return_val_if_fail (str, FALSE);
+G_DEFINE_TYPE_WITH_CODE (NMConfig, nm_config, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, nm_config_initable_iface_init);
+ )
- while (g_ascii_isspace (*str))
- str++;
- if (!*str)
- return FALSE;
+#define NM_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CONFIG, NMConfigPrivate))
- len = strlen (str);
+/************************************************************************/
- if (g_ascii_isspace (str[len-1])) {
- str = s = g_strdup (str);
- g_strchomp (s);
- }
+static void _set_config_data (NMConfig *self, NMConfigData *new_data);
- if (!g_ascii_strcasecmp (str, "true") || !g_ascii_strcasecmp (str, "yes") || !g_ascii_strcasecmp (str, "on") || !g_ascii_strcasecmp (str, "1"))
- value = TRUE;
- else if (!g_ascii_strcasecmp (str, "false") || !g_ascii_strcasecmp (str, "no") || !g_ascii_strcasecmp (str, "off") || !g_ascii_strcasecmp (str, "0"))
- value = FALSE;
- else {
- g_free (s);
- return FALSE;
- }
+/************************************************************************/
- if (out_value)
- *out_value = value;
+static gboolean
+_get_bool_value (GKeyFile *keyfile,
+ const char *section,
+ const char *key,
+ gboolean default_value)
+{
+ gboolean value = default_value;
+ char *str;
+
+ g_return_val_if_fail (keyfile != NULL, default_value);
+ g_return_val_if_fail (section != NULL, default_value);
+ g_return_val_if_fail (key != NULL, default_value);
+
+ str = g_key_file_get_value (keyfile, section, key, NULL);
+ if (!str)
+ return default_value;
+
+ g_strstrip (str);
+ if (str[0]) {
+ if (!g_ascii_strcasecmp (str, "true") || !g_ascii_strcasecmp (str, "yes") || !g_ascii_strcasecmp (str, "on") || !g_ascii_strcasecmp (str, "1"))
+ value = TRUE;
+ else if (!g_ascii_strcasecmp (str, "false") || !g_ascii_strcasecmp (str, "no") || !g_ascii_strcasecmp (str, "off") || !g_ascii_strcasecmp (str, "0"))
+ value = FALSE;
+ else {
+ nm_log_warn (LOGD_CORE, "Unrecognized value for %s.%s: '%s'. Assuming '%s'",
+ section, key, str, default_value ? "true" : "false");
+ }
+ }
- g_free (s);
- return TRUE;
+ g_free (str);
+ return value;
}
/************************************************************************/
-const char *
-nm_config_get_path (NMConfig *config)
+NMConfigData *
+nm_config_get_data (NMConfig *config)
{
g_return_val_if_fail (config != NULL, NULL);
- return NM_CONFIG_GET_PRIVATE (config)->nm_conf_path;
+ return NM_CONFIG_GET_PRIVATE (config)->config_data;
}
-const char *
-nm_config_get_description (NMConfig *config)
+/* The NMConfigData instance is reloadable and will be swapped on reload.
+ * nm_config_get_data_orig() returns the original configuration, when the NMConfig
+ * instance was created. */
+NMConfigData *
+nm_config_get_data_orig (NMConfig *config)
{
g_return_val_if_fail (config != NULL, NULL);
- return NM_CONFIG_GET_PRIVATE (config)->config_description;
+ return NM_CONFIG_GET_PRIVATE (config)->config_data_orig;
}
const char **
@@ -160,14 +197,6 @@ nm_config_get_dhcp_client (NMConfig *config)
}
const char *
-nm_config_get_dns_mode (NMConfig *config)
-{
- g_return_val_if_fail (config != NULL, NULL);
-
- return NM_CONFIG_GET_PRIVATE (config)->dns_mode;
-}
-
-const char *
nm_config_get_log_level (NMConfig *config)
{
g_return_val_if_fail (config != NULL, NULL);
@@ -191,129 +220,88 @@ nm_config_get_debug (NMConfig *config)
return NM_CONFIG_GET_PRIVATE (config)->debug;
}
-const char *
-nm_config_get_connectivity_uri (NMConfig *config)
-{
- g_return_val_if_fail (config != NULL, NULL);
-
- return NM_CONFIG_GET_PRIVATE (config)->connectivity_uri;
-}
-
-guint
-nm_config_get_connectivity_interval (NMConfig *config)
-{
- g_return_val_if_fail (config != NULL, 0);
-
- /* We store interval as signed internally to track whether it's
- * set or not, but report as unsigned to callers.
- */
- return MAX (NM_CONFIG_GET_PRIVATE (config)->connectivity_interval, 0);
-}
-
-const char *
-nm_config_get_connectivity_response (NMConfig *config)
-{
- g_return_val_if_fail (config != NULL, NULL);
-
- return NM_CONFIG_GET_PRIVATE (config)->connectivity_response;
-}
-
-char *
-nm_config_get_value (NMConfig *config, const char *group, const char *key, GError **error)
+gboolean
+nm_config_get_configure_and_quit (NMConfig *config)
{
- NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
-
- return g_key_file_get_string (priv->keyfile, group, key, error);
+ return NM_CONFIG_GET_PRIVATE (config)->configure_and_quit;
}
gboolean
nm_config_get_ignore_carrier (NMConfig *config, NMDevice *device)
{
- NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
- GSList *specs = NULL;
- int i;
- gboolean match;
+ g_return_val_if_fail (NM_IS_CONFIG (config), FALSE);
+ g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
- if (!priv->ignore_carrier)
- return FALSE;
-
- for (i = 0; priv->ignore_carrier[i]; i++)
- specs = g_slist_prepend (specs, priv->ignore_carrier[i]);
-
- match = nm_device_spec_match_list (device, specs);
-
- g_slist_free (specs);
- return match;
+ return nm_device_spec_match_list (device, NM_CONFIG_GET_PRIVATE (config)->ignore_carrier);
}
/************************************************************************/
-static void
-merge_no_auto_default_state (NMConfig *config)
+static char **
+no_auto_default_merge_from_file (const char *no_auto_default_file, const char *const* no_auto_default)
{
- NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
GPtrArray *updated;
char **list;
int i, j;
char *data;
- /* If the config already matches everything, we don't need to do anything else. */
- if (priv->no_auto_default && !g_strcmp0 (priv->no_auto_default[0], "*"))
- return;
-
updated = g_ptr_array_new ();
- if (priv->no_auto_default) {
- for (i = 0; priv->no_auto_default[i]; i++)
- g_ptr_array_add (updated, priv->no_auto_default[i]);
- g_free (priv->no_auto_default);
+ if (no_auto_default) {
+ for (i = 0; no_auto_default[i]; i++)
+ g_ptr_array_add (updated, g_strdup (no_auto_default[i]));
}
- if (g_file_get_contents (priv->no_auto_default_file, &data, NULL, NULL)) {
+ if ( no_auto_default_file
+ && g_file_get_contents (no_auto_default_file, &data, NULL, NULL)) {
list = g_strsplit (data, "\n", -1);
for (i = 0; list[i]; i++) {
if (!*list[i])
- continue;
- for (j = 0; j < updated->len; j++) {
- if (!strcmp (list[i], updated->pdata[j]))
- break;
+ g_free (list[i]);
+ else {
+ for (j = 0; j < updated->len; j++) {
+ if (!strcmp (list[i], updated->pdata[j]))
+ break;
+ }
+ if (j == updated->len)
+ g_ptr_array_add (updated, list[i]);
+ else
+ g_free (list[i]);
}
- if (j == updated->len)
- g_ptr_array_add (updated, list[i]);
}
g_free (list);
g_free (data);
}
g_ptr_array_add (updated, NULL);
- priv->no_auto_default = (char **) g_ptr_array_free (updated, FALSE);
+ return (char **) g_ptr_array_free (updated, FALSE);
}
gboolean
-nm_config_get_ethernet_can_auto_default (NMConfig *config, NMDevice *device)
+nm_config_get_no_auto_default_for_device (NMConfig *self, NMDevice *device)
{
- NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
- GSList *specs = NULL;
- int i;
- gboolean match;
+ NMConfigData *config_data;
- for (i = 0; priv->no_auto_default[i]; i++)
- specs = g_slist_prepend (specs, priv->no_auto_default[i]);
+ g_return_val_if_fail (NM_IS_CONFIG (self), FALSE);
+ g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
- match = nm_device_spec_match_list (device, specs);
-
- g_slist_free (specs);
- return !match;
+ config_data = NM_CONFIG_GET_PRIVATE (self)->config_data;
+ return nm_device_spec_match_list (device, nm_config_data_get_no_auto_default_list (config_data));
}
void
-nm_config_set_ethernet_no_auto_default (NMConfig *config, NMDevice *device)
+nm_config_set_no_auto_default_for_device (NMConfig *self, NMDevice *device)
{
- NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
+ NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (self);
char *current;
GString *updated;
GError *error = NULL;
+ char **no_auto_default;
+ NMConfigData *new_data = NULL;
- if (!nm_config_get_ethernet_can_auto_default (config, device))
+ g_return_if_fail (NM_IS_CONFIG (self));
+ g_return_if_fail (NM_IS_DEVICE (device));
+
+ if (nm_config_get_no_auto_default_for_device (self, device))
return;
updated = g_string_new (NULL);
@@ -335,48 +323,114 @@ nm_config_set_ethernet_no_auto_default (NMConfig *config, NMDevice *device)
g_string_free (updated, TRUE);
- merge_no_auto_default_state (config);
+ no_auto_default = no_auto_default_merge_from_file (priv->no_auto_default_file, nm_config_data_get_no_auto_default (priv->config_data));
+ new_data = nm_config_data_new_update_no_auto_default (priv->config_data, (const char *const*) no_auto_default);
+ g_strfreev (no_auto_default);
+
+ _set_config_data (self, new_data);
}
/************************************************************************/
-static char *cli_config_path;
-static char *cli_config_dir;
-static char *cli_no_auto_default_file;
-static char *cli_plugins;
-static char *cli_connectivity_uri;
-static int cli_connectivity_interval = -1;
-static char *cli_connectivity_response;
-
-static GOptionEntry config_options[] = {
- { "config", 0, 0, G_OPTION_ARG_FILENAME, &cli_config_path, N_("Config file location"), N_("/path/to/config.file") },
- { "config-dir", 0, 0, G_OPTION_ARG_FILENAME, &cli_config_dir, N_("Config directory location"), N_("/path/to/config/dir") },
- { "no-auto-default", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &cli_no_auto_default_file, "no-auto-default.state location", NULL },
- { "plugins", 0, 0, G_OPTION_ARG_STRING, &cli_plugins, N_("List of plugins separated by ','"), N_("plugin1,plugin2") },
-
- /* These three are hidden for now, and should eventually just go away. */
- { "connectivity-uri", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli_connectivity_uri, N_("An http(s) address for checking internet connectivity"), "http://example.com" },
- { "connectivity-interval", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_INT, &cli_connectivity_interval, N_("The interval between connectivity checks (in seconds)"), "60" },
- { "connectivity-response", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli_connectivity_response, N_("The expected start of the response"), N_("Bingo!") },
- {NULL}
-};
-GOptionEntry *
-nm_config_get_options (void)
+static void
+_nm_config_cmd_line_options_clear (NMConfigCmdLineOptions *cli)
{
- return config_options;
+ g_clear_pointer (&cli->config_main_file, g_free);
+ g_clear_pointer (&cli->config_dir, g_free);
+ g_clear_pointer (&cli->no_auto_default_file, g_free);
+ g_clear_pointer (&cli->plugins, g_free);
+ cli->configure_and_quit = FALSE;
+ g_clear_pointer (&cli->connectivity_uri, g_free);
+ g_clear_pointer (&cli->connectivity_response, g_free);
+ cli->connectivity_interval = -1;
+}
+
+static void
+_nm_config_cmd_line_options_copy (const NMConfigCmdLineOptions *cli, NMConfigCmdLineOptions *dst)
+{
+ g_return_if_fail (cli);
+ g_return_if_fail (dst);
+ g_return_if_fail (cli != dst);
+
+ _nm_config_cmd_line_options_clear (dst);
+ dst->config_dir = g_strdup (cli->config_dir);
+ dst->config_main_file = g_strdup (cli->config_main_file);
+ dst->no_auto_default_file = g_strdup (cli->no_auto_default_file);
+ dst->plugins = g_strdup (cli->plugins);
+ dst->configure_and_quit = cli->configure_and_quit;
+ dst->connectivity_uri = g_strdup (cli->connectivity_uri);
+ dst->connectivity_response = g_strdup (cli->connectivity_response);
+ dst->connectivity_interval = cli->connectivity_interval;
+}
+
+NMConfigCmdLineOptions *
+nm_config_cmd_line_options_new ()
+{
+ NMConfigCmdLineOptions *cli = g_new0 (NMConfigCmdLineOptions, 1);
+
+ _nm_config_cmd_line_options_clear (cli);
+ return cli;
+}
+
+void
+nm_config_cmd_line_options_free (NMConfigCmdLineOptions *cli)
+{
+ g_return_if_fail (cli);
+
+ _nm_config_cmd_line_options_clear (cli);
+ g_free (cli);
+}
+
+void
+nm_config_cmd_line_options_add_to_entries (NMConfigCmdLineOptions *cli,
+ GOptionContext *opt_ctx)
+{
+ g_return_if_fail (opt_ctx);
+ g_return_if_fail (cli);
+
+ {
+ GOptionEntry config_options[] = {
+ { "config", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_main_file, N_("Config file location"), N_("/path/to/config.file") },
+ { "config-dir", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_dir, N_("Config directory location"), N_("/path/to/config/dir") },
+ { "no-auto-default", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &cli->no_auto_default_file, "no-auto-default.state location", NULL },
+ { "plugins", 0, 0, G_OPTION_ARG_STRING, &cli->plugins, N_("List of plugins separated by ','"), N_("plugin1,plugin2") },
+ { "configure-and-quit", 0, 0, G_OPTION_ARG_NONE, &cli->configure_and_quit, N_("Quit after initial configuration"), NULL },
+
+ /* These three are hidden for now, and should eventually just go away. */
+ { "connectivity-uri", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_uri, N_("An http(s) address for checking internet connectivity"), "http://example.com" },
+ { "connectivity-interval", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_INT, &cli->connectivity_interval, N_("The interval between connectivity checks (in seconds)"), "60" },
+ { "connectivity-response", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_response, N_("The expected start of the response"), N_("Bingo!") },
+ { 0 },
+ };
+
+ g_option_context_add_main_entries (opt_ctx, config_options, NULL);
+ }
}
/************************************************************************/
+GKeyFile *
+nm_config_create_keyfile ()
+{
+ GKeyFile *keyfile;
+
+ keyfile = g_key_file_new ();
+ g_key_file_set_list_separator (keyfile, ',');
+ return keyfile;
+}
+
static gboolean
-read_config (NMConfig *config, const char *path, GError **error)
+read_config (GKeyFile *keyfile, const char *path, GError **error)
{
- NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
GKeyFile *kf;
char **groups, **keys;
gsize ngroups, nkeys;
int g, k;
+ g_return_val_if_fail (keyfile, FALSE);
+ g_return_val_if_fail (path, FALSE);
+ g_return_val_if_fail (!error || !*error, FALSE);
+
if (g_file_test (path, G_FILE_TEST_EXISTS) == FALSE) {
g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND, "file %s not found", path);
return FALSE;
@@ -384,8 +438,7 @@ read_config (NMConfig *config, const char *path, GError **error)
nm_log_dbg (LOGD_SETTINGS, "Reading config file '%s'", path);
- kf = g_key_file_new ();
- g_key_file_set_list_separator (kf, ',');
+ kf = nm_config_create_keyfile ();
if (!g_key_file_load_from_file (kf, path, G_KEY_FILE_NONE, error)) {
g_key_file_free (kf);
return FALSE;
@@ -399,43 +452,56 @@ read_config (NMConfig *config, const char *path, GError **error)
continue;
for (k = 0; keys[k]; k++) {
int len = strlen (keys[k]);
+ char *v;
+
if (keys[k][len - 1] == '+') {
char *base_key = g_strndup (keys[k], len - 1);
- const char *old_val = g_key_file_get_value (priv->keyfile, groups[g], base_key, NULL);
- const char *new_val = g_key_file_get_value (kf, groups[g], keys[k], NULL);
+ char *old_val = g_key_file_get_value (keyfile, groups[g], base_key, NULL);
+ char *new_val = g_key_file_get_value (kf, groups[g], keys[k], NULL);
if (old_val && *old_val) {
char *combined = g_strconcat (old_val, ",", new_val, NULL);
- g_key_file_set_value (priv->keyfile, groups[g], base_key, combined);
+ g_key_file_set_value (keyfile, groups[g], base_key, combined);
g_free (combined);
} else
- g_key_file_set_value (priv->keyfile, groups[g], base_key, new_val);
+ g_key_file_set_value (keyfile, groups[g], base_key, new_val);
g_free (base_key);
+ g_free (old_val);
+ g_free (new_val);
continue;
}
- g_key_file_set_value (priv->keyfile, groups[g], keys[k],
- g_key_file_get_value (kf, groups[g], keys[k], NULL));
+ g_key_file_set_value (keyfile, groups[g], keys[k],
+ v = g_key_file_get_value (kf, groups[g], keys[k], NULL));
+ g_free (v);
}
+ g_strfreev (keys);
}
+ g_strfreev (groups);
g_key_file_free (kf);
return TRUE;
}
static gboolean
-find_base_config (NMConfig *config, GError **error)
+read_base_config (GKeyFile *keyfile,
+ const char *cli_config_main_file,
+ char **out_config_main_file,
+ GError **error)
{
- NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
GError *my_error = NULL;
+ g_return_val_if_fail (keyfile, FALSE);
+ g_return_val_if_fail (out_config_main_file && !*out_config_main_file, FALSE);
+ g_return_val_if_fail (!error || !*error, FALSE);
+
/* Try a user-specified config file first */
- if (cli_config_path) {
+ if (cli_config_main_file) {
/* Bad user-specific config file path is a hard error */
- if (read_config (config, cli_config_path, error)) {
- priv->nm_conf_path = g_strdup (cli_config_path);
+ if (read_config (keyfile, cli_config_main_file, error)) {
+ *out_config_main_file = g_strdup (cli_config_main_file);
return TRUE;
} else
return FALSE;
@@ -449,8 +515,8 @@ find_base_config (NMConfig *config, GError **error)
*/
/* Try deprecated nm-system-settings.conf first */
- if (read_config (config, NM_OLD_SYSTEM_CONF_FILE, &my_error)) {
- priv->nm_conf_path = g_strdup (NM_OLD_SYSTEM_CONF_FILE);
+ if (read_config (keyfile, NM_OLD_SYSTEM_CONF_FILE, &my_error)) {
+ *out_config_main_file = g_strdup (NM_OLD_SYSTEM_CONF_FILE);
return TRUE;
}
@@ -462,8 +528,8 @@ find_base_config (NMConfig *config, GError **error)
g_clear_error (&my_error);
/* Try the standard config file location next */
- if (read_config (config, NM_DEFAULT_SYSTEM_CONF_FILE, &my_error)) {
- priv->nm_conf_path = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE);
+ if (read_config (keyfile, NM_DEFAULT_SYSTEM_CONF_FILE, &my_error)) {
+ *out_config_main_file = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE);
return TRUE;
}
@@ -479,21 +545,12 @@ find_base_config (NMConfig *config, GError **error)
/* If for some reason no config file exists, use the default
* config file path.
*/
- priv->nm_conf_path = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE);
+ *out_config_main_file = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE);
nm_log_info (LOGD_CORE, "No config file found or given; using %s\n",
NM_DEFAULT_SYSTEM_CONF_FILE);
return TRUE;
}
-/************************************************************************/
-
-NMConfig *
-nm_config_get (void)
-{
- g_assert (singleton);
- return singleton;
-}
-
static int
sort_asciibetically (gconstpointer a, gconstpointer b)
{
@@ -503,46 +560,31 @@ sort_asciibetically (gconstpointer a, gconstpointer b)
return strcmp (s1, s2);
}
-/* call this function only once! */
-NMConfig *
-nm_config_new (GError **error)
+static GPtrArray *
+_get_config_dir_files (const char *config_main_file,
+ const char *config_dir,
+ char **out_config_description)
{
- NMConfigPrivate *priv = NULL;
GFile *dir;
GFileEnumerator *direnum;
GFileInfo *info;
GPtrArray *confs;
- const char *name;
- char *value;
- int i;
GString *config_description;
+ const char *name;
- g_assert (!singleton);
- singleton = NM_CONFIG (g_object_new (NM_TYPE_CONFIG, NULL));
- priv = NM_CONFIG_GET_PRIVATE (singleton);
-
- /* First read the base config file */
- if (!find_base_config (singleton, error)) {
- g_object_unref (singleton);
- singleton = NULL;
- return NULL;
- }
-
- /* Now read the overrides in the config dir */
- if (cli_config_dir)
- priv->config_dir = g_strdup (cli_config_dir);
- else
- priv->config_dir = g_strdup (NM_DEFAULT_SYSTEM_CONF_DIR);
+ g_return_val_if_fail (config_main_file, NULL);
+ g_return_val_if_fail (config_dir, NULL);
+ g_return_val_if_fail (out_config_description && !*out_config_description, NULL);
confs = g_ptr_array_new_with_free_func (g_free);
- config_description = g_string_new (priv->nm_conf_path);
- dir = g_file_new_for_path (priv->config_dir);
+ config_description = g_string_new (config_main_file);
+ dir = g_file_new_for_path (config_dir);
direnum = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, NULL);
if (direnum) {
while ((info = g_file_enumerator_next_file (direnum, NULL, NULL))) {
name = g_file_info_get_name (info);
if (g_str_has_suffix (name, ".conf")) {
- g_ptr_array_add (confs, g_build_filename (priv->config_dir, name, NULL));
+ g_ptr_array_add (confs, g_build_filename (config_dir, name, NULL));
if (confs->len == 1)
g_string_append (config_description, " and conf.d: ");
else
@@ -556,74 +598,292 @@ nm_config_new (GError **error)
g_object_unref (dir);
g_ptr_array_sort (confs, sort_asciibetically);
- priv->config_description = g_string_free (config_description, FALSE);
+
+ *out_config_description = g_string_free (config_description, FALSE);
+ return confs;
+}
+
+static GKeyFile *
+read_entire_config (const NMConfigCmdLineOptions *cli,
+ const char *config_dir,
+ char **out_config_main_file,
+ char **out_config_description,
+ GError **error)
+{
+ GKeyFile *keyfile = nm_config_create_keyfile ();
+ GPtrArray *confs;
+ guint i;
+ char *o_config_main_file = NULL;
+ char *o_config_description = NULL;
+ char **plugins_tmp;
+
+ g_return_val_if_fail (config_dir, NULL);
+ g_return_val_if_fail (out_config_main_file && !*out_config_main_file, FALSE);
+ g_return_val_if_fail (out_config_description && !*out_config_description, NULL);
+ g_return_val_if_fail (!error || !*error, FALSE);
+
+ /* First read the base config file */
+ if ( cli
+ && !read_base_config (keyfile, cli->config_main_file, &o_config_main_file, error)) {
+ g_key_file_free (keyfile);
+ return NULL;
+ }
+
+ g_assert (o_config_main_file);
+
+ confs = _get_config_dir_files (o_config_main_file, config_dir, &o_config_description);
for (i = 0; i < confs->len; i++) {
- if (!read_config (singleton, confs->pdata[i], error)) {
- g_object_unref (singleton);
- singleton = NULL;
- break;
+ if (!read_config (keyfile, confs->pdata[i], error)) {
+ g_key_file_free (keyfile);
+ g_free (o_config_main_file);
+ g_free (o_config_description);
+ g_ptr_array_unref (confs);
+ return NULL;
}
}
g_ptr_array_unref (confs);
- if (!singleton)
- return FALSE;
- /* Handle no-auto-default key and state file */
- priv->no_auto_default = g_key_file_get_string_list (priv->keyfile, "main", "no-auto-default", NULL, NULL);
- if (cli_no_auto_default_file)
- priv->no_auto_default_file = g_strdup (cli_no_auto_default_file);
- else
- priv->no_auto_default_file = g_strdup (NM_NO_AUTO_DEFAULT_STATE_FILE);
- merge_no_auto_default_state (singleton);
-
- /* Now let command-line options override the config files, and fill in priv. */
- if (cli_plugins && cli_plugins[0])
- g_key_file_set_value (priv->keyfile, "main", "plugins", cli_plugins);
- priv->plugins = g_key_file_get_string_list (priv->keyfile, "main", "plugins", NULL, NULL);
- if (!priv->plugins && STRLEN (CONFIG_PLUGINS_DEFAULT) > 0)
- priv->plugins = g_strsplit (CONFIG_PLUGINS_DEFAULT, ",", -1);
-
- value = g_key_file_get_value (priv->keyfile, "main", "monitor-connection-files", NULL);
- priv->monitor_connection_files = FALSE;
- if (value) {
- if (!_parse_bool_str (value, &priv->monitor_connection_files))
- nm_log_warn (LOGD_CORE, "Unrecognized value for main.monitor-connection-files: %s. Assuming 'false'", value);
- g_free (value);
+ /* Merge settings from command line. They overwrite everything read from
+ * config files. */
+
+ if (cli && cli->plugins && cli->plugins[0])
+ g_key_file_set_value (keyfile, "main", "plugins", cli->plugins);
+ plugins_tmp = g_key_file_get_string_list (keyfile, "main", "plugins", NULL, NULL);
+ if (!plugins_tmp) {
+ if (STRLEN (CONFIG_PLUGINS_DEFAULT) > 0)
+ g_key_file_set_value (keyfile, "main", "plugins", CONFIG_PLUGINS_DEFAULT);
+ } else
+ g_strfreev (plugins_tmp);
+
+ if (cli && cli->configure_and_quit)
+ g_key_file_set_value (keyfile, "main", "configure-and-quit", "true");
+
+ if (cli && cli->connectivity_uri && cli->connectivity_uri[0])
+ g_key_file_set_value (keyfile, "connectivity", "uri", cli->connectivity_uri);
+ if (cli && cli->connectivity_interval >= 0)
+ g_key_file_set_integer (keyfile, "connectivity", "interval", cli->connectivity_interval);
+ if (cli && cli->connectivity_response && cli->connectivity_response[0])
+ g_key_file_set_value (keyfile, "connectivity", "response", cli->connectivity_response);
+
+ *out_config_main_file = o_config_main_file;
+ *out_config_description = o_config_description;
+ return keyfile;
+}
+
+GSList *
+nm_config_get_device_match_spec (const GKeyFile *keyfile, const char *group, const char *key)
+{
+ gs_free char *value = NULL;
+
+ value = g_key_file_get_string ((GKeyFile *) keyfile, group, key, NULL);
+ return nm_match_spec_split (value);
+}
+
+/************************************************************************/
+
+void
+nm_config_reload (NMConfig *self)
+{
+ NMConfigPrivate *priv;
+ GError *error = NULL;
+ GKeyFile *keyfile;
+ NMConfigData *new_data = NULL;
+ char *config_main_file = NULL;
+ char *config_description = NULL;
+
+ g_return_if_fail (NM_IS_CONFIG (self));
+
+ priv = NM_CONFIG_GET_PRIVATE (self);
+
+ /* pass on the original command line options. This means, that
+ * options specified at command line cannot ever be reloaded from
+ * file. That seems desirable.
+ */
+ keyfile = read_entire_config (&priv->cli,
+ priv->config_dir,
+ &config_main_file,
+ &config_description,
+ &error);
+ if (!keyfile) {
+ nm_log_err (LOGD_CORE, "Failed to reload the configuration: %s", error->message);
+ g_clear_error (&error);
+ return;
}
+ new_data = nm_config_data_new (config_main_file, config_description, nm_config_data_get_no_auto_default (priv->config_data), keyfile);
+ g_free (config_main_file);
+ g_free (config_description);
+ g_key_file_unref (keyfile);
- value = g_key_file_get_value (priv->keyfile, "main", "auth-polkit", NULL);
- priv->auth_polkit = NM_CONFIG_DEFAULT_AUTH_POLKIT;
- if (value) {
- if (!_parse_bool_str (value, &priv->auth_polkit)) {
- nm_log_warn (LOGD_CORE, "Unrecognized value for main.auth-polkit: %s. Assuming '%s'", value,
- NM_CONFIG_DEFAULT_AUTH_POLKIT ? "true" : "false");
+ _set_config_data (self, new_data);
+}
+
+static const char *
+_change_flags_one_to_string (NMConfigChangeFlags flag)
+{
+ switch (flag) {
+ case NM_CONFIG_CHANGE_CONFIG_FILES:
+ return "config-files";
+ case NM_CONFIG_CHANGE_VALUES:
+ return "values";
+ case NM_CONFIG_CHANGE_CONNECTIVITY:
+ return "connectivity";
+ case NM_CONFIG_CHANGE_NO_AUTO_DEFAULT:
+ return "no-auto-default";
+ case NM_CONFIG_CHANGE_DNS_MODE:
+ return "dns-mode";
+ default:
+ g_return_val_if_reached ("unknown");
+ }
+}
+
+char *
+nm_config_change_flags_to_string (NMConfigChangeFlags flags)
+{
+ GString *str = g_string_new ("");
+ NMConfigChangeFlags s = 0x01;
+
+ while (flags) {
+ if (NM_FLAGS_HAS (flags, s)) {
+ if (str->len)
+ g_string_append_c (str, ',');
+ g_string_append (str, _change_flags_one_to_string (s));
}
- g_free (value);
+ flags = flags & ~s;
+ s <<= 1;
+ }
+ return g_string_free (str, FALSE);
+}
+
+static void
+_set_config_data (NMConfig *self, NMConfigData *new_data)
+{
+ NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (self);
+ NMConfigData *old_data = priv->config_data;
+ NMConfigChangeFlags changes;
+ gs_free char *log_str = NULL;
+
+ changes = nm_config_data_diff (old_data, new_data);
+ if (changes == NM_CONFIG_CHANGE_NONE) {
+ g_object_unref (new_data);
+ return;
}
- priv->dhcp_client = g_key_file_get_value (priv->keyfile, "main", "dhcp", NULL);
- priv->dns_mode = g_key_file_get_value (priv->keyfile, "main", "dns", NULL);
+ nm_log_info (LOGD_CORE, "config: update %s (%s)", nm_config_data_get_config_description (new_data),
+ (log_str = nm_config_change_flags_to_string (changes)));
+ priv->config_data = new_data;
+ g_signal_emit (self, signals[SIGNAL_CONFIG_CHANGED], 0, new_data, changes, old_data);
+ g_object_unref (old_data);
+}
- priv->log_level = g_key_file_get_value (priv->keyfile, "logging", "level", NULL);
- priv->log_domains = g_key_file_get_value (priv->keyfile, "logging", "domains", NULL);
+NM_DEFINE_SINGLETON_DESTRUCTOR (NMConfig);
+NM_DEFINE_SINGLETON_WEAK_REF (NMConfig);
- priv->debug = g_key_file_get_value (priv->keyfile, "main", "debug", NULL);
+NMConfig *
+nm_config_get (void)
+{
+ g_assert (singleton_instance);
+ return singleton_instance;
+}
- if (cli_connectivity_uri && cli_connectivity_uri[0])
- g_key_file_set_value (priv->keyfile, "connectivity", "uri", cli_connectivity_uri);
- priv->connectivity_uri = g_key_file_get_value (priv->keyfile, "connectivity", "uri", NULL);
+NMConfig *
+nm_config_setup (const NMConfigCmdLineOptions *cli, GError **error)
+{
+ g_assert (!singleton_instance);
- if (cli_connectivity_interval >= 0)
- g_key_file_set_integer (priv->keyfile, "connectivity", "interval", cli_connectivity_interval);
- priv->connectivity_interval = g_key_file_get_integer (priv->keyfile, "connectivity", "interval", NULL);
+ singleton_instance = nm_config_new (cli, error);
+ if (singleton_instance)
+ nm_singleton_instance_weak_ref_register ();
+ return singleton_instance;
+}
- if (cli_connectivity_response && cli_connectivity_response[0])
- g_key_file_set_value (priv->keyfile, "connectivity", "response", cli_connectivity_response);
- priv->connectivity_response = g_key_file_get_value (priv->keyfile, "connectivity", "response", NULL);
+static gboolean
+init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
+{
+ NMConfig *self = NM_CONFIG (initable);
+ NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (self);
+ GKeyFile *keyfile;
+ char *config_main_file = NULL;
+ char *config_description = NULL;
+ char **no_auto_default;
+ GSList *no_auto_default_orig_list;
+ GPtrArray *no_auto_default_orig;
+
+ if (priv->config_dir) {
+ /* Object is already initialized. */
+ if (priv->config_data)
+ return TRUE;
+ g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND, "unspecified error");
+ return FALSE;
+ }
+
+ if (priv->cli.config_dir)
+ priv->config_dir = g_strdup (priv->cli.config_dir);
+ else
+ priv->config_dir = g_strdup (NM_DEFAULT_SYSTEM_CONF_DIR);
+
+ keyfile = read_entire_config (&priv->cli,
+ priv->config_dir,
+ &config_main_file,
+ &config_description,
+ error);
+ if (!keyfile)
+ return FALSE;
+
+ /* Initialize read only private members */
+
+ if (priv->cli.no_auto_default_file)
+ priv->no_auto_default_file = g_strdup (priv->cli.no_auto_default_file);
+ else
+ priv->no_auto_default_file = g_strdup (NM_NO_AUTO_DEFAULT_STATE_FILE);
- priv->ignore_carrier = g_key_file_get_string_list (priv->keyfile, "main", "ignore-carrier", NULL, NULL);
+ priv->plugins = g_key_file_get_string_list (keyfile, "main", "plugins", NULL, NULL);
+ if (!priv->plugins)
+ priv->plugins = g_new0 (char *, 1);
- return singleton;
+ priv->monitor_connection_files = _get_bool_value (keyfile, "main", "monitor-connection-files", FALSE);
+
+ priv->auth_polkit = _get_bool_value (keyfile, "main", "auth-polkit", NM_CONFIG_DEFAULT_AUTH_POLKIT);
+
+ priv->dhcp_client = g_key_file_get_value (keyfile, "main", "dhcp", NULL);
+
+ priv->log_level = g_key_file_get_value (keyfile, "logging", "level", NULL);
+ priv->log_domains = g_key_file_get_value (keyfile, "logging", "domains", NULL);
+
+ priv->debug = g_key_file_get_value (keyfile, "main", "debug", NULL);
+
+ priv->ignore_carrier = nm_config_get_device_match_spec (keyfile, "main", "ignore-carrier");
+
+ priv->configure_and_quit = _get_bool_value (keyfile, "main", "configure-and-quit", FALSE);
+
+ no_auto_default_orig_list = nm_config_get_device_match_spec (keyfile, "main", "no-auto-default");
+
+ no_auto_default_orig = _nm_utils_copy_slist_to_array (no_auto_default_orig_list, NULL, NULL);
+ g_ptr_array_add (no_auto_default_orig, NULL);
+ no_auto_default = no_auto_default_merge_from_file (priv->no_auto_default_file, (const char *const *) no_auto_default_orig->pdata);
+ g_ptr_array_unref (no_auto_default_orig);
+
+ g_slist_free_full (no_auto_default_orig_list, g_free);
+
+ priv->config_data_orig = nm_config_data_new (config_main_file, config_description, (const char *const*) no_auto_default, keyfile);
+
+ g_strfreev (no_auto_default);
+
+ priv->config_data = g_object_ref (priv->config_data_orig);
+
+ g_free (config_main_file);
+ g_free (config_description);
+ g_key_file_unref (keyfile);
+ return TRUE;
+}
+
+NMConfig *
+nm_config_new (const NMConfigCmdLineOptions *cli, GError **error)
+{
+ return NM_CONFIG (g_initable_new (NM_TYPE_CONFIG,
+ NULL,
+ error,
+ NM_CONFIG_CMD_LINE_OPTIONS, cli,
+ NULL));
}
static void
@@ -632,11 +892,6 @@ nm_config_init (NMConfig *config)
NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
priv->auth_polkit = NM_CONFIG_DEFAULT_AUTH_POLKIT;
-
- priv->keyfile = g_key_file_new ();
- g_key_file_set_list_separator (priv->keyfile, ',');
-
- priv->connectivity_interval = -1;
}
static void
@@ -644,34 +899,45 @@ finalize (GObject *gobject)
{
NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (gobject);
- g_free (priv->nm_conf_path);
g_free (priv->config_dir);
- g_free (priv->config_description);
g_free (priv->no_auto_default_file);
- g_clear_pointer (&priv->keyfile, g_key_file_unref);
g_strfreev (priv->plugins);
g_free (priv->dhcp_client);
- g_free (priv->dns_mode);
g_free (priv->log_level);
g_free (priv->log_domains);
g_free (priv->debug);
- g_free (priv->connectivity_uri);
- g_free (priv->connectivity_response);
- g_strfreev (priv->no_auto_default);
- g_strfreev (priv->ignore_carrier);
+ g_slist_free_full (priv->ignore_carrier, g_free);
- singleton = NULL;
+ _nm_config_cmd_line_options_clear (&priv->cli);
- g_clear_pointer (&cli_config_path, g_free);
- g_clear_pointer (&cli_config_dir, g_free);
- g_clear_pointer (&cli_no_auto_default_file, g_free);
- g_clear_pointer (&cli_plugins, g_free);
- g_clear_pointer (&cli_connectivity_uri, g_free);
- g_clear_pointer (&cli_connectivity_response, g_free);
+ g_clear_object (&priv->config_data);
+ g_clear_object (&priv->config_data_orig);
G_OBJECT_CLASS (nm_config_parent_class)->finalize (gobject);
}
+static void
+set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ NMConfig *self = NM_CONFIG (object);
+ NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (self);
+ NMConfigCmdLineOptions *cli;
+
+ switch (prop_id) {
+ case PROP_CMD_LINE_OPTIONS:
+ /* construct only */
+ cli = g_value_get_pointer (value);
+ if (!cli)
+ _nm_config_cmd_line_options_clear (&priv->cli);
+ else
+ _nm_config_cmd_line_options_copy (cli, &priv->cli);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
static void
nm_config_class_init (NMConfigClass *config_class)
@@ -680,5 +946,27 @@ nm_config_class_init (NMConfigClass *config_class)
g_type_class_add_private (config_class, sizeof (NMConfigPrivate));
object_class->finalize = finalize;
+ object_class->set_property = set_property;
+
+ g_object_class_install_property
+ (object_class, PROP_CMD_LINE_OPTIONS,
+ g_param_spec_pointer (NM_CONFIG_CMD_LINE_OPTIONS, "", "",
+ G_PARAM_WRITABLE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
+ signals[SIGNAL_CONFIG_CHANGED] =
+ g_signal_new (NM_CONFIG_SIGNAL_CONFIG_CHANGED,
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (NMConfigClass, config_changed),
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 3, NM_TYPE_CONFIG_DATA, NM_TYPE_CONFIG_CHANGE_FLAGS, NM_TYPE_CONFIG_DATA);
+}
+
+static void
+nm_config_initable_iface_init (GInitableIface *iface)
+{
+ iface->init = init_sync;
}
diff --git a/src/nm-config.h b/src/nm-config.h
index 27da4cbbc6..b82dfb3e9f 100644
--- a/src/nm-config.h
+++ b/src/nm-config.h
@@ -26,6 +26,7 @@
#include <glib-object.h>
#include "nm-types.h"
+#include "nm-config-data.h"
G_BEGIN_DECLS
@@ -36,42 +37,59 @@ G_BEGIN_DECLS
#define NM_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_CONFIG))
#define NM_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CONFIG, NMConfigClass))
-typedef struct {
+/* Properties */
+#define NM_CONFIG_CMD_LINE_OPTIONS "cmd-line-options"
+
+/* Signals */
+#define NM_CONFIG_SIGNAL_CONFIG_CHANGED "config-changed"
+
+typedef struct NMConfigCmdLineOptions NMConfigCmdLineOptions;
+
+struct _NMConfig {
GObject parent;
-} NMConfig;
+};
typedef struct {
GObjectClass parent;
+
+ /* Signals */
+ void (*config_changed) (NMConfig *config, GHashTable *changes, NMConfigData *old_data);
} NMConfigClass;
GType nm_config_get_type (void);
NMConfig *nm_config_get (void);
-const char *nm_config_get_path (NMConfig *config);
-const char *nm_config_get_description (NMConfig *config);
+char *nm_config_change_flags_to_string (NMConfigChangeFlags flags);
+
+NMConfigData *nm_config_get_data (NMConfig *config);
+NMConfigData *nm_config_get_data_orig (NMConfig *config);
const char **nm_config_get_plugins (NMConfig *config);
gboolean nm_config_get_monitor_connection_files (NMConfig *config);
gboolean nm_config_get_auth_polkit (NMConfig *config);
const char *nm_config_get_dhcp_client (NMConfig *config);
-const char *nm_config_get_dns_mode (NMConfig *config);
const char *nm_config_get_log_level (NMConfig *config);
const char *nm_config_get_log_domains (NMConfig *config);
const char *nm_config_get_debug (NMConfig *config);
-const char *nm_config_get_connectivity_uri (NMConfig *config);
-guint nm_config_get_connectivity_interval (NMConfig *config);
-const char *nm_config_get_connectivity_response (NMConfig *config);
-
-gboolean nm_config_get_ethernet_can_auto_default (NMConfig *config, NMDevice *device);
-void nm_config_set_ethernet_no_auto_default (NMConfig *config, NMDevice *device);
+gboolean nm_config_get_configure_and_quit (NMConfig *config);
gboolean nm_config_get_ignore_carrier (NMConfig *config, NMDevice *device);
-char *nm_config_get_value (NMConfig *config, const char *group, const char *key, GError **error);
-
/* for main.c only */
-GOptionEntry *nm_config_get_options (void);
-NMConfig *nm_config_new (GError **error);
+NMConfigCmdLineOptions *nm_config_cmd_line_options_new (void);
+void nm_config_cmd_line_options_free (NMConfigCmdLineOptions *cli);
+void nm_config_cmd_line_options_add_to_entries (NMConfigCmdLineOptions *cli,
+ GOptionContext *opt_ctx);
+
+gboolean nm_config_get_no_auto_default_for_device (NMConfig *config, NMDevice *device);
+void nm_config_set_no_auto_default_for_device (NMConfig *config, NMDevice *device);
+
+NMConfig *nm_config_new (const NMConfigCmdLineOptions *cli, GError **error);
+NMConfig *nm_config_setup (const NMConfigCmdLineOptions *cli, GError **error);
+void nm_config_reload (NMConfig *config);
+
+GKeyFile *nm_config_create_keyfile (void);
+GSList *nm_config_get_device_match_spec (const GKeyFile *keyfile, const char *group, const char *key);
G_END_DECLS
diff --git a/src/nm-connection-provider.c b/src/nm-connection-provider.c
index f6ee7454d9..51caf400f1 100644
--- a/src/nm-connection-provider.c
+++ b/src/nm-connection-provider.c
@@ -13,6 +13,8 @@
* Copyright (C) 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include "nm-connection-provider.h"
#include "nm-utils.h"
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
index fee62e4fcd..ecb9c0f5c1 100644
--- a/src/nm-connectivity.c
+++ b/src/nm-connectivity.c
@@ -19,7 +19,7 @@
* Copyright (C) 2011 Dan Williams <dcbw@redhat.com>
*/
-#include <config.h>
+#include "config.h"
#include <string.h>
#if WITH_CONCHECK
@@ -28,7 +28,6 @@
#include "nm-connectivity.h"
#include "nm-logging.h"
-#include "nm-config.h"
G_DEFINE_TYPE (NMConnectivity, nm_connectivity, G_TYPE_OBJECT)
@@ -37,14 +36,32 @@ G_DEFINE_TYPE (NMConnectivity, nm_connectivity, G_TYPE_OBJECT)
#define DEFAULT_RESPONSE "NetworkManager is online" /* NOT LOCALIZED */
+#define _LOG_DEFAULT_DOMAIN LOGD_CONCHECK
+
+#define _LOG(level, domain, ...) \
+ G_STMT_START { \
+ nm_log ((level), (domain), \
+ "%s" _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
+ "connectivity: " \
+ _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
+ } G_STMT_END
+
+#define _LOGT(...) _LOG (LOGL_TRACE, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+#define _LOGD(...) _LOG (LOGL_DEBUG, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+#define _LOGI(...) _LOG (LOGL_INFO, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+#define _LOGW(...) _LOG (LOGL_WARN, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+#define _LOGE(...) _LOG (LOGL_ERR, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+
+
typedef struct {
char *uri;
char *response;
guint interval;
+ gboolean online; /* whether periodic connectivity checking is enabled. */
#if WITH_CONCHECK
SoupSession *soup_session;
- gboolean running;
+ gboolean initial_check_obsoleted;
guint check_id;
#endif
@@ -69,34 +86,66 @@ nm_connectivity_get_state (NMConnectivity *connectivity)
return NM_CONNECTIVITY_GET_PRIVATE (connectivity)->state;
}
+const char *
+nm_connectivity_state_to_string (NMConnectivityState state)
+{
+ switch (state) {
+ case NM_CONNECTIVITY_UNKNOWN:
+ return "UNKNOWN";
+ case NM_CONNECTIVITY_NONE:
+ return "NONE";
+ case NM_CONNECTIVITY_LIMITED:
+ return "LIMITED";
+ case NM_CONNECTIVITY_PORTAL:
+ return "PORTAL";
+ case NM_CONNECTIVITY_FULL:
+ return "FULL";
+ default:
+ g_return_val_if_reached ("???");
+ }
+}
+
static void
update_state (NMConnectivity *self, NMConnectivityState state)
{
NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
if (priv->state != state) {
+ _LOGD ("state changed from %s to %s",
+ nm_connectivity_state_to_string (priv->state),
+ nm_connectivity_state_to_string (state));
priv->state = state;
g_object_notify (G_OBJECT (self), NM_CONNECTIVITY_STATE);
}
}
#if WITH_CONCHECK
+typedef struct {
+ GSimpleAsyncResult *simple;
+ char *uri;
+ char *response;
+ guint check_id_when_scheduled;
+} ConCheckCbData;
+
static void
nm_connectivity_check_cb (SoupSession *session, SoupMessage *msg, gpointer user_data)
{
- GSimpleAsyncResult *simple = user_data;
NMConnectivity *self;
NMConnectivityPrivate *priv;
+ ConCheckCbData *cb_data = user_data;
+ GSimpleAsyncResult *simple = cb_data->simple;
NMConnectivityState new_state;
const char *nm_header;
+ const char *uri = cb_data->uri;
+ const char *response = cb_data->response ? cb_data->response : DEFAULT_RESPONSE;
self = NM_CONNECTIVITY (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
+ /* it is safe to unref @self here, @simple holds yet another reference. */
g_object_unref (self);
priv = NM_CONNECTIVITY_GET_PRIVATE (self);
if (SOUP_STATUS_IS_TRANSPORT_ERROR (msg->status_code)) {
- nm_log_info (LOGD_CONCHECK, "Connectivity check for uri '%s' failed with '%s'.",
- priv->uri, msg->reason_phrase);
+ _LOGI ("check for uri '%s' failed with '%s'", uri, msg->reason_phrase);
new_state = NM_CONNECTIVITY_LIMITED;
goto done;
}
@@ -104,45 +153,59 @@ nm_connectivity_check_cb (SoupSession *session, SoupMessage *msg, gpointer user_
/* Check headers; if we find the NM-specific one we're done */
nm_header = soup_message_headers_get_one (msg->response_headers, "X-NetworkManager-Status");
if (g_strcmp0 (nm_header, "online") == 0) {
- nm_log_dbg (LOGD_CONCHECK, "Connectivity check for uri '%s' with Status header successful.", priv->uri);
+ _LOGD ("check for uri '%s' with Status header successful.", uri);
new_state = NM_CONNECTIVITY_FULL;
} else if (msg->status_code == SOUP_STATUS_OK) {
/* check response */
- if (msg->response_body->data && (g_str_has_prefix (msg->response_body->data, priv->response))) {
- nm_log_dbg (LOGD_CONCHECK, "Connectivity check for uri '%s' successful.",
- priv->uri);
+ if (msg->response_body->data && g_str_has_prefix (msg->response_body->data, response)) {
+ _LOGD ("check for uri '%s' successful.", uri);
new_state = NM_CONNECTIVITY_FULL;
} else {
- nm_log_info (LOGD_CONCHECK, "Connectivity check for uri '%s' did not match expected response '%s'; assuming captive portal.",
- priv->uri, priv->response);
+ _LOGI ("check for uri '%s' did not match expected response '%s'; assuming captive portal.",
+ uri, response);
new_state = NM_CONNECTIVITY_PORTAL;
}
} else {
- nm_log_info (LOGD_CONCHECK, "Connectivity check for uri '%s' returned status '%d %s'; assuming captive portal.",
- priv->uri, msg->status_code, msg->reason_phrase);
+ _LOGI ("check for uri '%s' returned status '%d %s'; assuming captive portal.",
+ uri, msg->status_code, msg->reason_phrase);
new_state = NM_CONNECTIVITY_PORTAL;
}
done:
+ /* Only update the state, if the call was done from external, or if the periodic check
+ * is still the one that called this async check. */
+ if (!cb_data->check_id_when_scheduled || cb_data->check_id_when_scheduled == priv->check_id) {
+ /* Only update the state, if the URI and response parameters did not change
+ * since invocation.
+ * The interval does not matter for exernal calls, and for internal calls
+ * we don't reach this line if the interval changed. */
+ if ( !g_strcmp0 (cb_data->uri, priv->uri)
+ && !g_strcmp0 (cb_data->response, priv->response))
+ update_state (self, new_state);
+ }
+
g_simple_async_result_set_op_res_gssize (simple, new_state);
g_simple_async_result_complete (simple);
+ g_object_unref (simple);
- update_state (self, new_state);
+ g_free (cb_data->uri);
+ g_free (cb_data->response);
+ g_slice_free (ConCheckCbData, cb_data);
}
+#define IS_PERIODIC_CHECK(callback) (callback == run_check_complete)
+
static void
run_check_complete (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
NMConnectivity *self = NM_CONNECTIVITY (object);
- NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
GError *error = NULL;
nm_connectivity_check_finish (self, result, &error);
- priv->running = FALSE;
if (error) {
- nm_log_err (LOGD_CONCHECK, "Connectivity check failed: %s", error->message);
+ _LOGE ("check failed: %s", error->message);
g_error_free (error);
}
}
@@ -151,40 +214,66 @@ static gboolean
run_check (gpointer user_data)
{
NMConnectivity *self = NM_CONNECTIVITY (user_data);
- NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
nm_connectivity_check_async (self, run_check_complete, NULL);
- priv->running = TRUE;
- nm_log_dbg (LOGD_CONCHECK, "Connectivity check with uri '%s' started.", priv->uri);
-
return TRUE;
}
-#endif
-void
-nm_connectivity_set_online (NMConnectivity *self,
- gboolean online)
+static gboolean
+idle_start_periodic_checks (gpointer user_data)
{
-#if WITH_CONCHECK
+ NMConnectivity *self = user_data;
NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
- if (online && priv->uri && priv->interval) {
- if (!priv->check_id)
- priv->check_id = g_timeout_add_seconds (priv->interval, run_check, self);
- if (!priv->running)
- run_check (self);
+ priv->check_id = g_timeout_add_seconds (priv->interval, run_check, self);
+ if (!priv->initial_check_obsoleted)
+ run_check (self);
- return;
- } else if (priv->check_id) {
- g_source_remove (priv->check_id);
- priv->check_id = 0;
+ return FALSE;
+}
+#endif
+
+static void
+_reschedule_periodic_checks (NMConnectivity *self, gboolean force_reschedule)
+{
+ NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
+
+#if WITH_CONCHECK
+ if (priv->online && priv->uri && priv->interval) {
+ if (force_reschedule || !priv->check_id) {
+ if (priv->check_id)
+ g_source_remove (priv->check_id);
+ priv->check_id = g_timeout_add (0, idle_start_periodic_checks, self);
+ priv->initial_check_obsoleted = FALSE;
+ }
+ } else {
+ if (priv->check_id) {
+ g_source_remove (priv->check_id);
+ priv->check_id = 0;
+ }
}
+ if (priv->check_id)
+ return;
#endif
/* Either @online is %TRUE but we aren't checking connectivity, or
* @online is %FALSE. Either way we can update our status immediately.
*/
- update_state (self, online ? NM_CONNECTIVITY_FULL : NM_CONNECTIVITY_NONE);
+ update_state (self, priv->online ? NM_CONNECTIVITY_FULL : NM_CONNECTIVITY_NONE);
+}
+
+void
+nm_connectivity_set_online (NMConnectivity *self,
+ gboolean online)
+{
+ NMConnectivityPrivate *priv= NM_CONNECTIVITY_GET_PRIVATE (self);
+
+ online = !!online;
+ if (priv->online != online) {
+ _LOGD ("set %s", online ? "online" : "offline");
+ priv->online = online;
+ _reschedule_periodic_checks (self, FALSE);
+ }
}
void
@@ -193,9 +282,6 @@ nm_connectivity_check_async (NMConnectivity *self,
gpointer user_data)
{
NMConnectivityPrivate *priv;
-#if WITH_CONCHECK
- SoupMessage *msg;
-#endif
GSimpleAsyncResult *simple;
g_return_if_fail (NM_IS_CONNECTIVITY (self));
@@ -206,19 +292,39 @@ nm_connectivity_check_async (NMConnectivity *self,
#if WITH_CONCHECK
if (priv->uri && priv->interval) {
+ SoupMessage *msg;
+ ConCheckCbData *cb_data = g_slice_new (ConCheckCbData);
+
msg = soup_message_new ("GET", priv->uri);
soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
+ /* Disable HTTP/1.1 keepalive; the connection should not persist */
+ soup_message_headers_append (msg->request_headers, "Connection", "close");
+ cb_data->simple = simple;
+ cb_data->uri = g_strdup (priv->uri);
+ cb_data->response = g_strdup (priv->response);
+
+ /* For internal calls (periodic), remember the check-id at time of scheduling. */
+ cb_data->check_id_when_scheduled = IS_PERIODIC_CHECK (callback) ? priv->check_id : 0;
+
soup_session_queue_message (priv->soup_session,
msg,
nm_connectivity_check_cb,
- simple);
+ cb_data);
+ priv->initial_check_obsoleted = TRUE;
+ _LOGD ("check: send %srequest to '%s'", IS_PERIODIC_CHECK (callback) ? "periodic " : "", priv->uri);
return;
+ } else {
+ g_warn_if_fail (!IS_PERIODIC_CHECK (callback));
+ _LOGD ("check: faking request. Connectivity check disabled");
}
+#else
+ _LOGD ("check: faking request. Compiled without connectivity-check support");
#endif
g_simple_async_result_set_op_res_gssize (simple, priv->state);
g_simple_async_result_complete_in_idle (simple);
+ g_object_unref (simple);
}
NMConnectivityState
@@ -236,38 +342,18 @@ nm_connectivity_check_finish (NMConnectivity *self,
return (NMConnectivityState) g_simple_async_result_get_op_res_gssize (simple);
}
+/**************************************************************************/
NMConnectivity *
-nm_connectivity_new (void)
+nm_connectivity_new (const char *uri,
+ guint interval,
+ const char *response)
{
- NMConnectivity *self;
- NMConfig *config;
- const char *check_response;
-
- config = nm_config_get ();
- check_response = nm_config_get_connectivity_response (config);
-
- self = g_object_new (NM_TYPE_CONNECTIVITY,
- NM_CONNECTIVITY_URI, nm_config_get_connectivity_uri (config),
- NM_CONNECTIVITY_INTERVAL, nm_config_get_connectivity_interval (config),
- NM_CONNECTIVITY_RESPONSE, check_response ? check_response : DEFAULT_RESPONSE,
+ return g_object_new (NM_TYPE_CONNECTIVITY,
+ NM_CONNECTIVITY_URI, uri,
+ NM_CONNECTIVITY_INTERVAL, interval,
+ NM_CONNECTIVITY_RESPONSE, response,
NULL);
- g_return_val_if_fail (self != NULL, NULL);
- update_state (self, NM_CONNECTIVITY_NONE);
-
- return self;
-}
-
-static char *
-get_non_empty_string_value (const GValue *val)
-{
- const char *s;
-
- s = g_value_get_string (val);
- if (s && s[0])
- return g_strdup (s);
- else
- return NULL;
}
static void
@@ -276,30 +362,48 @@ set_property (GObject *object, guint property_id,
{
NMConnectivity *self = NM_CONNECTIVITY (object);
NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
+ const char *uri, *response;
+ guint interval;
switch (property_id) {
case PROP_URI:
- g_free (priv->uri);
- priv->uri = get_non_empty_string_value (value);
-
+ uri = g_value_get_string (value);
+ if (uri && !*uri)
+ uri = NULL;
#if WITH_CONCHECK
- if (priv->uri) {
- SoupURI *uri = soup_uri_new (priv->uri);
+ if (uri) {
+ SoupURI *soup_uri = soup_uri_new (uri);
- if (!uri || !SOUP_URI_VALID_FOR_HTTP (uri)) {
- nm_log_err (LOGD_CONCHECK, "Invalid uri '%s' for connectivity check.", priv->uri);
- g_free (priv->uri);
- priv->uri = NULL;
+ if (!soup_uri || !SOUP_URI_VALID_FOR_HTTP (soup_uri)) {
+ _LOGE ("invalid uri '%s' for connectivity check.", uri);
+ uri = NULL;
}
+ if (soup_uri)
+ soup_uri_free (soup_uri);
}
#endif
+ if (g_strcmp0 (uri, priv->uri) != 0) {
+ g_free (priv->uri);
+ priv->uri = g_strdup (uri);
+ _reschedule_periodic_checks (self, TRUE);
+ }
break;
case PROP_INTERVAL:
- priv->interval = g_value_get_uint (value);
+ interval = g_value_get_uint (value);
+ if (priv->interval != interval) {
+ priv->interval = interval;
+ _reschedule_periodic_checks (self, TRUE);
+ }
break;
case PROP_RESPONSE:
- g_free (priv->response);
- priv->response = get_non_empty_string_value (value);
+ response = g_value_get_string (value);
+ if (g_strcmp0 (response, priv->response) != 0) {
+ /* a response %NULL means, DEFAULT_RESPONSE. Any other response
+ * (including "") is accepted. */
+ g_free (priv->response);
+ priv->response = g_strdup (response);
+ _reschedule_periodic_checks (self, TRUE);
+ }
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -322,7 +426,10 @@ get_property (GObject *object, guint property_id,
g_value_set_uint (value, priv->interval);
break;
case PROP_RESPONSE:
- g_value_set_string (value, priv->response);
+ if (priv->response)
+ g_value_set_string (value, priv->response);
+ else
+ g_value_set_static_string (value, DEFAULT_RESPONSE);
break;
case PROP_STATE:
g_value_set_uint (value, priv->state);
@@ -337,11 +444,12 @@ get_property (GObject *object, guint property_id,
static void
nm_connectivity_init (NMConnectivity *self)
{
-#if WITH_CONCHECK
NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
+#if WITH_CONCHECK
priv->soup_session = soup_session_async_new_with_options (SOUP_SESSION_TIMEOUT, 15, NULL);
#endif
+ priv->state = NM_CONNECTIVITY_NONE;
}
@@ -351,8 +459,8 @@ dispose (GObject *object)
NMConnectivity *self = NM_CONNECTIVITY (object);
NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
- g_free (priv->uri);
- g_free (priv->response);
+ g_clear_pointer (&priv->uri, g_free);
+ g_clear_pointer (&priv->response, g_free);
#if WITH_CONCHECK
if (priv->soup_session) {
@@ -381,31 +489,34 @@ nm_connectivity_class_init (NMConnectivityClass *klass)
/* properties */
g_object_class_install_property
- (object_class, PROP_URI,
- g_param_spec_string (NM_CONNECTIVITY_URI, "", "",
- NULL,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
+ (object_class, PROP_URI,
+ g_param_spec_string (NM_CONNECTIVITY_URI, "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property
- (object_class, PROP_INTERVAL,
- g_param_spec_uint (NM_CONNECTIVITY_INTERVAL, "", "",
- 0, G_MAXUINT, 300,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
+ (object_class, PROP_INTERVAL,
+ g_param_spec_uint (NM_CONNECTIVITY_INTERVAL, "", "",
+ 0, G_MAXUINT, 300,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property
- (object_class, PROP_RESPONSE,
- g_param_spec_string (NM_CONNECTIVITY_RESPONSE, "", "",
- DEFAULT_RESPONSE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
+ (object_class, PROP_RESPONSE,
+ g_param_spec_string (NM_CONNECTIVITY_RESPONSE, "", "",
+ DEFAULT_RESPONSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property
- (object_class, PROP_STATE,
- g_param_spec_uint (NM_CONNECTIVITY_STATE, "", "",
- NM_CONNECTIVITY_UNKNOWN, NM_CONNECTIVITY_FULL, NM_CONNECTIVITY_UNKNOWN,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
+ (object_class, PROP_STATE,
+ g_param_spec_uint (NM_CONNECTIVITY_STATE, "", "",
+ NM_CONNECTIVITY_UNKNOWN, NM_CONNECTIVITY_FULL, NM_CONNECTIVITY_UNKNOWN,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
}
diff --git a/src/nm-connectivity.h b/src/nm-connectivity.h
index 771abdc237..fc584d5fed 100644
--- a/src/nm-connectivity.h
+++ b/src/nm-connectivity.h
@@ -51,7 +51,11 @@ typedef struct {
GType nm_connectivity_get_type (void);
-NMConnectivity *nm_connectivity_new (void);
+const char *nm_connectivity_state_to_string (NMConnectivityState state);
+
+NMConnectivity *nm_connectivity_new (const char *uri,
+ guint interval,
+ const char *response);
void nm_connectivity_set_online (NMConnectivity *self,
gboolean online);
diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c
index 1dcdfb8dad..88b65885fd 100644
--- a/src/nm-dbus-manager.c
+++ b/src/nm-dbus-manager.c
@@ -20,6 +20,7 @@
*/
#include "config.h"
+
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -77,20 +78,33 @@ static void nm_dbus_manager_cleanup (NMDBusManager *self, gboolean dispose);
static void start_reconnection_timeout (NMDBusManager *self);
static void object_destroyed (NMDBusManager *self, gpointer object);
+NM_DEFINE_SINGLETON_DESTRUCTOR (NMDBusManager);
+NM_DEFINE_SINGLETON_WEAK_REF (NMDBusManager);
+
NMDBusManager *
nm_dbus_manager_get (void)
{
- static NMDBusManager *singleton = NULL;
- static gsize once = 0;
-
- if (g_once_init_enter (&once)) {
- singleton = (NMDBusManager *) g_object_new (NM_TYPE_DBUS_MANAGER, NULL);
- g_assert (singleton);
- if (!nm_dbus_manager_init_bus (singleton))
- start_reconnection_timeout (singleton);
- g_once_init_leave (&once, 1);
+ if (G_UNLIKELY (!singleton_instance)) {
+ nm_dbus_manager_setup (g_object_new (NM_TYPE_DBUS_MANAGER, NULL));
+ if (!nm_dbus_manager_init_bus (singleton_instance))
+ start_reconnection_timeout (singleton_instance);
}
- return singleton;
+ return singleton_instance;
+}
+
+void
+nm_dbus_manager_setup (NMDBusManager *instance)
+{
+ static char already_setup = FALSE;
+
+ g_assert (NM_IS_DBUS_MANAGER (instance));
+ g_assert (!already_setup);
+ g_assert (!singleton_instance);
+
+ already_setup = TRUE;
+ singleton_instance = instance;
+ nm_singleton_instance_weak_ref_register ();
+ nm_log_dbg (LOGD_CORE, "create %s singleton (%p)", "NMDBusManager", singleton_instance);
}
/**************************************************************/
@@ -198,6 +212,7 @@ private_server_new (const char *path,
nm_log_warn (LOGD_CORE, "(%s) failed to set up private socket %s: %s",
tag, address, error.message);
dbus_error_free (&error);
+ g_free (address);
return NULL;
}
@@ -479,7 +494,7 @@ private_server_setup (NMDBusManager *self)
return;
/* Set up our main private DBus socket */
- if (mkdir (NMRUNDIR, 0700) == -1) {
+ if (mkdir (NMRUNDIR, 0755) == -1) {
if (errno != EEXIST)
nm_log_warn (LOGD_CORE, "Error creating directory \"%s\": %d (%s)", NMRUNDIR, errno, g_strerror (errno));
}
diff --git a/src/nm-dbus-manager.h b/src/nm-dbus-manager.h
index cc7f3210fd..c87ee02455 100644
--- a/src/nm-dbus-manager.h
+++ b/src/nm-dbus-manager.h
@@ -73,6 +73,7 @@ typedef struct {
GType nm_dbus_manager_get_type (void);
NMDBusManager * nm_dbus_manager_get (void);
+void nm_dbus_manager_setup (NMDBusManager *instance);
char * nm_dbus_manager_get_name_owner (NMDBusManager *self,
const char *name,
diff --git a/src/nm-dcb.c b/src/nm-dcb.c
index 3dfa306c4c..0b18ca7f2b 100644
--- a/src/nm-dcb.c
+++ b/src/nm-dcb.c
@@ -18,7 +18,8 @@
* Copyright (C) 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <sys/wait.h>
#include <string.h>
@@ -26,7 +27,6 @@
#include "nm-dcb.h"
#include "nm-platform.h"
#include "NetworkManagerUtils.h"
-#include "nm-posix-signals.h"
#include "nm-logging.h"
static const char *helper_names[] = { "dcbtool", "fcoeadm" };
@@ -304,7 +304,7 @@ run_helper (char **argv, guint which, gpointer user_data, GError **error)
nm_log_dbg (LOGD_DCB, "%s", cmdline);
success = g_spawn_sync ("/", argv, NULL, 0 /*G_SPAWN_DEFAULT*/,
- nm_unblock_posix_signals, NULL,
+ NULL, NULL,
&outmsg, &errmsg, &exit_status, error);
/* Log any stderr output */
if (success && WIFEXITED (exit_status) && WEXITSTATUS (exit_status) && (errmsg || outmsg)) {
diff --git a/src/nm-default-route-manager.c b/src/nm-default-route-manager.c
new file mode 100644
index 0000000000..27b5d783a9
--- /dev/null
+++ b/src/nm-default-route-manager.c
@@ -0,0 +1,1412 @@
+/* -*- 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 (C) 2014 Red Hat, Inc.
+ */
+
+
+#include "config.h"
+
+#include "nm-default-route-manager.h"
+
+#include "string.h"
+
+#include "nm-logging.h"
+#include "nm-device.h"
+#include "nm-vpn-connection.h"
+#include "nm-platform.h"
+#include "nm-manager.h"
+#include "nm-ip4-config.h"
+#include "nm-ip6-config.h"
+#include "nm-activation-request.h"
+
+typedef struct {
+ GPtrArray *entries_ip4;
+ GPtrArray *entries_ip6;
+ struct {
+ guint guard;
+ guint backoff_wait_time_ms;
+ guint idle_handle;
+ gboolean has_v4_changes;
+ gboolean has_v6_changes;
+ } resync;
+
+ /* During disposing, we unref the sources of all entries. This happens usually
+ * during shutdown, which might call the final deletion of the object. That
+ * again might cause calls back into NMDefaultRouteManager, which finds dangling
+ * pointers.
+ * Guard every publicly accessible function to return early if the instance
+ * is already disposing. */
+ gboolean disposed;
+
+ NMPlatform *platform;
+} NMDefaultRouteManagerPrivate;
+
+#define NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEFAULT_ROUTE_MANAGER, NMDefaultRouteManagerPrivate))
+
+G_DEFINE_TYPE (NMDefaultRouteManager, nm_default_route_manager, G_TYPE_OBJECT)
+
+NM_DEFINE_SINGLETON_GETTER (NMDefaultRouteManager, nm_default_route_manager_get, NM_TYPE_DEFAULT_ROUTE_MANAGER);
+
+#define _LOG(level, addr_family, ...) \
+ G_STMT_START { \
+ int __addr_family = (addr_family); \
+ guint64 __domain = __addr_family == AF_INET ? LOGD_IP4 : LOGD_IP6; \
+ \
+ if (nm_logging_enabled ((level), (__domain))) { \
+ char __ch = __addr_family == AF_INET ? '4' : (__addr_family == AF_INET6 ? '6' : '-'); \
+ char __prefix[30] = "default-route"; \
+ \
+ if ((self) != singleton_instance) \
+ g_snprintf (__prefix, sizeof (__prefix), "default-route%c[%p]", __ch, (self)); \
+ else \
+ __prefix[STRLEN ("default-route")] = __ch; \
+ nm_log ((level), (__domain), \
+ "%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
+ __prefix _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
+ } \
+ } G_STMT_END
+
+#define _LOGD(addr_family, ...) _LOG (LOGL_DEBUG, addr_family, __VA_ARGS__)
+#define _LOGI(addr_family, ...) _LOG (LOGL_INFO , addr_family, __VA_ARGS__)
+#define _LOGW(addr_family, ...) _LOG (LOGL_WARN , addr_family, __VA_ARGS__)
+#define _LOGE(addr_family, ...) _LOG (LOGL_ERR , addr_family, __VA_ARGS__)
+
+#define LOG_ENTRY_FMT "entry[%u/%s:%p:%s:%c:%csync]"
+#define LOG_ENTRY_ARGS(entry_idx, entry) \
+ (entry_idx), \
+ NM_IS_DEVICE ((entry)->source.pointer) ? "dev" : "vpn", \
+ (entry)->source.pointer, \
+ NM_IS_DEVICE ((entry)->source.pointer) ? nm_device_get_iface ((entry)->source.device) : nm_vpn_connection_get_connection_id ((entry)->source.vpn), \
+ ((entry)->never_default ? '0' : '1'), \
+ ((entry)->synced ? '+' : '-')
+
+/***********************************************************************************/
+
+static void _resync_idle_cancel (NMDefaultRouteManager *self);
+
+/***********************************************************************************/
+
+typedef struct {
+ union {
+ void *pointer;
+ GObject *object;
+ NMDevice *device;
+ NMVpnConnection *vpn;
+ } source;
+ NMPlatformIPXRoute route;
+
+ /* Whether the route is synced to platform and has a default route.
+ *
+ * ( synced && !never_default): the interface gets a default route that
+ * is enforced and managed by NMDefaultRouteManager.
+ *
+ * (!synced && !never_default): the interface has this route, but it is assumed.
+ * Assumed interfaces are those that have no tracked entry or that only have
+ * (!synced && !never_default) entries. NMDefaultRouteManager will not touch
+ * default routes on these interfaces.
+ * This combination makes only sense for device sources.
+ * They are tracked so that assumed devices can also be the best device.
+ *
+ * ( synced && never_default): entries of this kind are a placeholder
+ * to indicate that the ifindex is managed but has no default-route.
+ * Missing entries also indicate that a certain ifindex has no default-route.
+ * The difference is that missing entries are considered assumed while on
+ * (synced && never_default) entries the absence of the default route
+ * is enforced. NMDefaultRouteManager will actively remove any default
+ * route on such ifindexes.
+ * Also, for VPN sources in addition we track them so that a never-default
+ * VPN connection can be choosen by get_best_config() to receive the DNS configuration.
+ *
+ * (!synced && never_default): this combination makes no sense.
+ */
+ gboolean synced;
+ gboolean never_default;
+
+ guint32 effective_metric;
+} Entry;
+
+typedef struct {
+ int addr_family;
+ GPtrArray *(*get_entries) (NMDefaultRouteManagerPrivate *priv);
+ const char *(*platform_route_to_string) (const NMPlatformIPRoute *route);
+ GArray *(*platform_route_get_all) (int ifindex, NMPlatformGetRouteMode mode);
+ gboolean (*platform_route_delete_default) (int ifindex, guint32 metric);
+ guint32 (*route_metric_normalize) (guint32 metric);
+} VTableIP;
+
+static const VTableIP vtable_ip4, vtable_ip6;
+
+#define VTABLE_IS_IP4 (vtable->addr_family == AF_INET)
+
+static NMPlatformIPRoute *
+_vt_route_index (const VTableIP *vtable, GArray *routes, guint index)
+{
+ if (VTABLE_IS_IP4)
+ return (NMPlatformIPRoute *) &g_array_index (routes, NMPlatformIP4Route, index);
+ else
+ return (NMPlatformIPRoute *) &g_array_index (routes, NMPlatformIP6Route, index);
+}
+
+static gboolean
+_vt_routes_has_entry (const VTableIP *vtable, GArray *routes, const Entry *entry)
+{
+ guint i;
+ NMPlatformIPXRoute route = entry->route;
+
+ route.rx.metric = entry->effective_metric;
+
+ if (VTABLE_IS_IP4) {
+ for (i = 0; i < routes->len; i++) {
+ NMPlatformIP4Route *r = &g_array_index (routes, NMPlatformIP4Route, i);
+
+ route.rx.source = r->source;
+ if (nm_platform_ip4_route_cmp (r, &route.r4) == 0)
+ return TRUE;
+ }
+ } else {
+ for (i = 0; i < routes->len; i++) {
+ NMPlatformIP6Route *r = &g_array_index (routes, NMPlatformIP6Route, i);
+
+ route.rx.source = r->source;
+ if (nm_platform_ip6_route_cmp (r, &route.r6) == 0)
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static void
+_entry_free (Entry *entry)
+{
+ if (entry) {
+ g_object_unref (entry->source.object);
+ g_slice_free (Entry, entry);
+ }
+}
+
+static Entry *
+_entry_find_by_source (GPtrArray *entries, gpointer source, guint *out_idx)
+{
+ guint i;
+
+ for (i = 0; i < entries->len; i++) {
+ Entry *e = g_ptr_array_index (entries, i);
+
+ if (e->source.pointer == source) {
+ if (out_idx)
+ *out_idx = i;
+ return e;
+ }
+ }
+
+ if (out_idx)
+ *out_idx = G_MAXUINT;
+ return NULL;
+}
+
+static gboolean
+_platform_route_sync_add (const VTableIP *vtable, NMDefaultRouteManager *self, guint32 metric)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ GPtrArray *entries = vtable->get_entries (priv);
+ guint i;
+ Entry *entry_unsynced = NULL;
+ Entry *entry = NULL;
+ gboolean success;
+
+ /* Find the entries for the given metric.
+ * The effective metric for synced entries is choosen in a way that it
+ * is unique (except for G_MAXUINT32, where a clash is not solvable). */
+ for (i = 0; i < entries->len; i++) {
+ Entry *e = g_ptr_array_index (entries, i);
+
+ if (e->never_default)
+ continue;
+
+ if (e->effective_metric != metric)
+ continue;
+
+ if (e->synced) {
+ g_assert (!entry || metric == G_MAXUINT32);
+ if (!entry)
+ entry = e;
+ } else
+ entry_unsynced = e;
+ }
+
+ /* We don't expect to have an unsynced *and* a synced entry for the same metric.
+ * Unless, (a) their metric is G_MAXUINT32, in which case we could not find an unused effective metric,
+ * or (b) if we have an unsynced and a synced entry for the same ifindex.
+ * The latter case happens for example when activating an openvpn connection (synced) and
+ * assuming the corresponding tun0 interface (unsynced). */
+ g_assert (!entry || !entry_unsynced || (entry->route.rx.ifindex == entry_unsynced->route.rx.ifindex) || metric == G_MAXUINT32);
+
+ /* we only add the route, if we have an (to be synced) entry for it. */
+ if (!entry)
+ return FALSE;
+
+ if (VTABLE_IS_IP4) {
+ success = nm_platform_ip4_route_add (entry->route.rx.ifindex,
+ entry->route.rx.source,
+ 0,
+ 0,
+ entry->route.r4.gateway,
+ 0,
+ entry->effective_metric,
+ entry->route.rx.mss);
+ } else {
+ success = nm_platform_ip6_route_add (entry->route.rx.ifindex,
+ entry->route.rx.source,
+ in6addr_any,
+ 0,
+ entry->route.r6.gateway,
+ entry->effective_metric,
+ entry->route.rx.mss);
+ }
+ if (!success) {
+ _LOGW (vtable->addr_family, "failed to add default route %s with effective metric %u",
+ vtable->platform_route_to_string (&entry->route.rx), (guint) entry->effective_metric);
+ }
+ return TRUE;
+}
+
+static gboolean
+_platform_route_sync_flush (const VTableIP *vtable, NMDefaultRouteManager *self, int ifindex_to_flush)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ GPtrArray *entries = vtable->get_entries (priv);
+ GArray *routes;
+ guint i, j;
+ gboolean changed = FALSE;
+
+ /* prune all other default routes from this device. */
+ routes = vtable->platform_route_get_all (0, NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT);
+
+ for (i = 0; i < routes->len; i++) {
+ const NMPlatformIPRoute *route;
+ gboolean has_ifindex_synced = FALSE;
+ Entry *entry = NULL;
+
+ route = _vt_route_index (vtable, routes, i);
+
+ /* look at all entries and see if the route for this ifindex pair is
+ * a known entry. */
+ for (j = 0; j < entries->len; j++) {
+ Entry *e = g_ptr_array_index (entries, j);
+
+ if ( e->route.rx.ifindex == route->ifindex
+ && e->synced) {
+ has_ifindex_synced = TRUE;
+ if ( !e->never_default
+ && e->effective_metric == route->metric)
+ entry = e;
+ }
+ }
+
+ /* we only delete the route if we don't have a matching entry,
+ * and there is at least one entry that references this ifindex
+ * (indicating that the ifindex is managed by us -- not assumed).
+ *
+ * Otherwise, don't delete the route because it's configured
+ * externally (and will be assumed -- or already is assumed).
+ */
+ if ( !entry
+ && (has_ifindex_synced || ifindex_to_flush == route->ifindex)) {
+ vtable->platform_route_delete_default (route->ifindex, route->metric);
+ changed = TRUE;
+ }
+ }
+ g_array_free (routes, TRUE);
+ return changed;
+}
+
+static int
+_sort_entries_cmp (gconstpointer a, gconstpointer b, gpointer user_data)
+{
+ guint32 m_a, m_b;
+ const Entry *e_a = *((const Entry **) a);
+ const Entry *e_b = *((const Entry **) b);
+
+ /* when comparing routes, we consider the (original) metric. */
+ m_a = e_a->route.rx.metric;
+ m_b = e_b->route.rx.metric;
+
+ /* we normalize route.metric already in _ipx_update_default_route().
+ * so we can just compare the metrics numerically */
+
+ if (m_a != m_b)
+ return (m_a < m_b) ? -1 : 1;
+
+ /* If the metrics are equal, we prefer the one that is !never_default */
+ if (!!e_a->never_default != !!e_b->never_default)
+ return e_a->never_default ? 1 : -1;
+
+ /* If the metrics are equal, we prefer the one that is assumed (!synced).
+ * Entries that we sync, can be modified so that only the best
+ * entry has a (deterministically) lowest metric.
+ * With assumed devices we cannot increase/change the metric.
+ * For example: two devices, both metric 0. One is assumed the other is
+ * synced.
+ * If we would choose the synced entry as best, we cannot
+ * increase the metric of the assumed one and we would have non-determinism.
+ * If we instead prefer the assumed device, we can increase the metric
+ * of the synced device and the assumed device is (deterministically)
+ * prefered.
+ * If both devices are assumed, we also have non-determinism, but also
+ * we don't reorder either.
+ */
+ if (!!e_a->synced != !!e_b->synced)
+ return e_a->synced ? 1 : -1;
+
+ /* otherwise, do not reorder */
+ return 0;
+}
+
+static GHashTable *
+_get_assumed_interface_metrics (const VTableIP *vtable, NMDefaultRouteManager *self, GArray *routes)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ GPtrArray *entries;
+ guint i, j;
+ GHashTable *result;
+
+ /* create a list of all metrics that are currently assigned on an interface
+ * that is *not* already covered by one of our synced entries.
+ * IOW, returns the metrics that are in use by assumed interfaces
+ * that we want to preserve. */
+
+ entries = vtable->get_entries (priv);
+
+ result = g_hash_table_new (NULL, NULL);
+
+ for (i = 0; i < routes->len; i++) {
+ gboolean ifindex_has_synced_entry = FALSE;
+ const NMPlatformIPRoute *route;
+
+ route = _vt_route_index (vtable, routes, i);
+
+ for (j = 0; j < entries->len; j++) {
+ Entry *e = g_ptr_array_index (entries, j);
+
+ if ( e->synced
+ && e->route.rx.ifindex == route->ifindex) {
+ ifindex_has_synced_entry = TRUE;
+ break;
+ }
+ }
+
+ if (!ifindex_has_synced_entry)
+ g_hash_table_add (result, GUINT_TO_POINTER (vtable->route_metric_normalize (route->metric)));
+ }
+
+ return result;
+}
+
+static int
+_sort_metrics_ascending_fcn (gconstpointer a, gconstpointer b)
+{
+ guint32 m_a = *((guint32 *) a);
+ guint32 m_b = *((guint32 *) b);
+
+ if (m_a < m_b)
+ return -1;
+ return m_a == m_b ? 0 : 1;
+}
+
+static gboolean
+_resync_all (const VTableIP *vtable, NMDefaultRouteManager *self, const Entry *changed_entry, const Entry *old_entry, gboolean external_change)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ Entry *entry;
+ guint i, j;
+ gint64 last_metric = -1;
+ guint32 expected_metric;
+ GPtrArray *entries;
+ GArray *changed_metrics = g_array_new (FALSE, FALSE, sizeof (guint32));
+ GHashTable *assumed_metrics;
+ GArray *routes;
+ gboolean changed = FALSE;
+ int ifindex_to_flush = 0;
+
+ g_assert (priv->resync.guard == 0);
+ priv->resync.guard++;
+
+ if (!external_change) {
+ if (VTABLE_IS_IP4)
+ priv->resync.has_v4_changes = FALSE;
+ else
+ priv->resync.has_v6_changes = FALSE;
+ if (!priv->resync.has_v4_changes && !priv->resync.has_v6_changes)
+ _resync_idle_cancel (self);
+ }
+
+ entries = vtable->get_entries (priv);
+
+ routes = vtable->platform_route_get_all (0, NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT);
+
+ assumed_metrics = _get_assumed_interface_metrics (vtable, self, routes);
+
+ if (old_entry && old_entry->synced && !old_entry->never_default) {
+ /* The old version obviously changed. */
+ g_array_append_val (changed_metrics, old_entry->effective_metric);
+ }
+
+ /* first iterate over all entries and adjust the effective metrics. */
+ for (i = 0; i < entries->len; i++) {
+ entry = g_ptr_array_index (entries, i);
+
+ g_assert (entry != old_entry);
+
+ if (entry->never_default)
+ continue;
+
+ if (!entry->synced) {
+ gboolean has_synced_entry = FALSE;
+
+ /* A non synced entry is completely ignored, if we have
+ * a synced entry for the same if index.
+ * Otherwise the metric of the entry is still remembered as
+ * last_metric to avoid reusing it. */
+ for (j = 0; j < entries->len; j++) {
+ const Entry *e = g_ptr_array_index (entries, j);
+
+ if ( e->synced
+ && e->route.rx.ifindex == entry->route.rx.ifindex) {
+ has_synced_entry = TRUE;
+ break;
+ }
+ }
+ if (!has_synced_entry)
+ last_metric = MAX (last_metric, (gint64) entry->effective_metric);
+ continue;
+ }
+
+ expected_metric = entry->route.rx.metric;
+ if ((gint64) expected_metric <= last_metric)
+ expected_metric = last_metric == G_MAXUINT32 ? G_MAXUINT32 : last_metric + 1;
+
+ while ( expected_metric < G_MAXUINT32
+ && g_hash_table_contains (assumed_metrics, GUINT_TO_POINTER (expected_metric))) {
+ gboolean has_metric_for_ifindex = FALSE;
+
+ /* Check if there are assumed devices that have default routes with this metric.
+ * If there are any, we have to pick another effective_metric. */
+
+ /* However, if there is a matching route (ifindex+metric) for our current entry, we are done. */
+ for (j = 0; j < routes->len; j++) {
+ const NMPlatformIPRoute *r = _vt_route_index (vtable, routes, i);
+
+ if ( r->metric == expected_metric
+ && r->ifindex == entry->route.rx.ifindex) {
+ has_metric_for_ifindex = TRUE;
+ break;
+ }
+ }
+ if (has_metric_for_ifindex)
+ break;
+ expected_metric++;
+ }
+
+ if (changed_entry == entry) {
+ /* for the changed entry, the previous metric was either old_entry->effective_metric,
+ * or none. Hence, we only have to remember what is going to change. */
+ g_array_append_val (changed_metrics, expected_metric);
+ if (old_entry) {
+ _LOGD (vtable->addr_family, LOG_ENTRY_FMT": update %s (%u -> %u)", LOG_ENTRY_ARGS (i, entry),
+ vtable->platform_route_to_string (&entry->route.rx), (guint) old_entry->effective_metric,
+ (guint) expected_metric);
+ } else {
+ _LOGD (vtable->addr_family, LOG_ENTRY_FMT": add %s (%u)", LOG_ENTRY_ARGS (i, entry),
+ vtable->platform_route_to_string (&entry->route.rx), (guint) expected_metric);
+ }
+ } else if (entry->effective_metric != expected_metric) {
+ g_array_append_val (changed_metrics, entry->effective_metric);
+ g_array_append_val (changed_metrics, expected_metric);
+ _LOGD (vtable->addr_family, LOG_ENTRY_FMT": resync metric %s (%u -> %u)", LOG_ENTRY_ARGS (i, entry),
+ vtable->platform_route_to_string (&entry->route.rx), (guint) entry->effective_metric,
+ (guint) expected_metric);
+ } else {
+ if (!_vt_routes_has_entry (vtable, routes, entry)) {
+ g_array_append_val (changed_metrics, entry->effective_metric);
+ _LOGD (vtable->addr_family, LOG_ENTRY_FMT": readd route %s (%u -> %u)", LOG_ENTRY_ARGS (i, entry),
+ vtable->platform_route_to_string (&entry->route.rx), (guint) entry->effective_metric,
+ (guint) entry->effective_metric);
+ }
+ }
+
+ if (entry->effective_metric != expected_metric) {
+ entry->effective_metric = expected_metric;
+ changed = TRUE;
+ }
+ last_metric = expected_metric;
+ }
+
+ g_array_free (routes, TRUE);
+
+ g_array_sort (changed_metrics, _sort_metrics_ascending_fcn);
+ last_metric = -1;
+ for (j = 0; j < changed_metrics->len; j++) {
+ expected_metric = g_array_index (changed_metrics, guint32, j);
+
+ if (last_metric == (gint64) expected_metric) {
+ /* skip duplicates. */
+ continue;
+ }
+ changed |= _platform_route_sync_add (vtable, self, expected_metric);
+ last_metric = expected_metric;
+ }
+
+ if ( old_entry
+ && !changed_entry
+ && old_entry->synced
+ && !old_entry->never_default) {
+ /* If we entriely remove an entry that was synced before, we must make
+ * sure to flush routes for this ifindex too. Otherwise they linger
+ * around as "assumed" routes */
+ ifindex_to_flush = old_entry->route.rx.ifindex;
+ }
+
+ changed |= _platform_route_sync_flush (vtable, self, ifindex_to_flush);
+
+ g_array_free (changed_metrics, TRUE);
+ g_hash_table_unref (assumed_metrics);
+
+ priv->resync.guard--;
+ return changed;
+}
+
+static void
+_entry_at_idx_update (const VTableIP *vtable, NMDefaultRouteManager *self, guint entry_idx, const Entry *old_entry)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ Entry *entry;
+ GPtrArray *entries;
+
+ entries = vtable->get_entries (priv);
+ g_assert (entry_idx < entries->len);
+
+ entry = g_ptr_array_index (entries, entry_idx);
+
+ g_assert ( !old_entry
+ || (entry->source.pointer == old_entry->source.pointer && entry->route.rx.ifindex == old_entry->route.rx.ifindex));
+
+ if (!entry->synced && !entry->never_default)
+ entry->effective_metric = entry->route.rx.metric;
+
+ _LOGD (vtable->addr_family, LOG_ENTRY_FMT": %s %s",
+ LOG_ENTRY_ARGS (entry_idx, entry),
+ old_entry ? "update" : "add",
+ vtable->platform_route_to_string (&entry->route.rx));
+
+ g_ptr_array_sort_with_data (entries, _sort_entries_cmp, NULL);
+
+ _resync_all (vtable, self, entry, old_entry, FALSE);
+}
+
+static void
+_entry_at_idx_remove (const VTableIP *vtable, NMDefaultRouteManager *self, guint entry_idx)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ Entry *entry;
+ GPtrArray *entries;
+
+ entries = vtable->get_entries (priv);
+
+ g_assert (entry_idx < entries->len);
+
+ entry = g_ptr_array_index (entries, entry_idx);
+
+ _LOGD (vtable->addr_family, LOG_ENTRY_FMT": remove %s (%u)", LOG_ENTRY_ARGS (entry_idx, entry),
+ vtable->platform_route_to_string (&entry->route.rx), (guint) entry->effective_metric);
+
+ /* Remove the entry from the list (but don't free it yet) */
+ g_ptr_array_index (entries, entry_idx) = NULL;
+ g_ptr_array_remove_index (entries, entry_idx);
+
+ _resync_all (vtable, self, NULL, entry, FALSE);
+
+ _entry_free (entry);
+}
+
+/***********************************************************************************/
+
+static void
+_ipx_update_default_route (const VTableIP *vtable, NMDefaultRouteManager *self, gpointer source)
+{
+ NMDefaultRouteManagerPrivate *priv;
+ Entry *entry;
+ guint entry_idx;
+ const NMPlatformIPRoute *default_route = NULL;
+ NMPlatformIPXRoute rt;
+ int ip_ifindex;
+ GPtrArray *entries;
+ NMDevice *device = NULL;
+ NMVpnConnection *vpn = NULL;
+ gboolean never_default = FALSE;
+ gboolean synced = FALSE;
+
+ g_return_if_fail (NM_IS_DEFAULT_ROUTE_MANAGER (self));
+
+ priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ if (priv->disposed)
+ return;
+
+ if (NM_IS_DEVICE (source))
+ device = source;
+ else if (NM_IS_VPN_CONNECTION (source))
+ vpn = source;
+ else
+ g_return_if_reached ();
+
+ if (device)
+ ip_ifindex = nm_device_get_ip_ifindex (device);
+ else {
+ ip_ifindex = nm_vpn_connection_get_ip_ifindex (vpn);
+
+ if (ip_ifindex <= 0) {
+ NMDevice *parent = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (vpn));
+
+ if (parent)
+ ip_ifindex = nm_device_get_ip_ifindex (parent);
+ }
+ }
+
+ entries = vtable->get_entries (priv);
+ entry = _entry_find_by_source (entries, source, &entry_idx);
+
+ if ( entry
+ && entry->route.rx.ifindex != ip_ifindex) {
+ /* Strange... the ifindex changed... Remove the device and start again. */
+ _LOGD (vtable->addr_family, "ifindex of "LOG_ENTRY_FMT" changed: %d -> %d",
+ LOG_ENTRY_ARGS (entry_idx, entry),
+ entry->route.rx.ifindex, ip_ifindex);
+
+ g_object_freeze_notify (G_OBJECT (self));
+ _entry_at_idx_remove (vtable, self, entry_idx);
+ g_assert (!_entry_find_by_source (entries, source, NULL));
+ _ipx_update_default_route (vtable, self, source);
+ g_object_thaw_notify (G_OBJECT (self));
+ return;
+ }
+
+ /* get the @default_route from the device. */
+ if (ip_ifindex > 0) {
+ if (device) {
+ gboolean is_assumed;
+
+ if (VTABLE_IS_IP4)
+ default_route = (const NMPlatformIPRoute *) nm_device_get_ip4_default_route (device, &is_assumed);
+ else
+ default_route = (const NMPlatformIPRoute *) nm_device_get_ip6_default_route (device, &is_assumed);
+ if (!default_route && !is_assumed) {
+ /* the device has no default route, but it is not assumed. That means, NMDefaultRouteManager
+ * enforces that the device has no default route.
+ *
+ * Hence we have to keep track of this entry, otherwise a missing entry tells us
+ * that the interface is assumed and NM would not remove the default routes on
+ * the device. */
+ memset (&rt, 0, sizeof (rt));
+ rt.rx.ifindex = ip_ifindex;
+ rt.rx.source = NM_IP_CONFIG_SOURCE_UNKNOWN;
+ rt.rx.metric = G_MAXUINT32;
+ default_route = &rt.rx;
+
+ never_default = TRUE;
+ synced = TRUE;
+ } else
+ synced = default_route && !is_assumed;
+ } else {
+ NMConnection *connection = nm_active_connection_get_connection ((NMActiveConnection *) vpn);
+
+ if ( connection
+ && nm_vpn_connection_get_vpn_state (vpn) == NM_VPN_CONNECTION_STATE_ACTIVATED) {
+
+ memset (&rt, 0, sizeof (rt));
+ if (VTABLE_IS_IP4) {
+ NMIP4Config *vpn_config;
+
+ vpn_config = nm_vpn_connection_get_ip4_config (vpn);
+ if (vpn_config) {
+ never_default = nm_ip4_config_get_never_default (vpn_config);
+ rt.r4.ifindex = ip_ifindex;
+ rt.r4.source = NM_IP_CONFIG_SOURCE_VPN;
+ rt.r4.gateway = nm_vpn_connection_get_ip4_internal_gateway (vpn);
+ rt.r4.metric = nm_vpn_connection_get_ip4_route_metric (vpn);
+ rt.r4.mss = nm_ip4_config_get_mss (vpn_config);
+ default_route = &rt.rx;
+ }
+ } else {
+ NMIP6Config *vpn_config;
+
+ vpn_config = nm_vpn_connection_get_ip6_config (vpn);
+ if (vpn_config) {
+ const struct in6_addr *int_gw = nm_vpn_connection_get_ip6_internal_gateway (vpn);
+
+ never_default = nm_ip6_config_get_never_default (vpn_config);
+ rt.r6.ifindex = ip_ifindex;
+ rt.r6.source = NM_IP_CONFIG_SOURCE_VPN;
+ rt.r6.gateway = int_gw ? *int_gw : in6addr_any;
+ rt.r6.metric = nm_vpn_connection_get_ip6_route_metric (vpn);
+ rt.r6.mss = nm_ip6_config_get_mss (vpn_config);
+ default_route = &rt.rx;
+ }
+ }
+ }
+ synced = TRUE;
+ }
+ }
+ g_assert (!default_route || default_route->plen == 0);
+
+ if (!entry && !default_route)
+ /* nothing to do */;
+ else if (!entry) {
+ /* add */
+ entry = g_slice_new0 (Entry);
+ entry->source.object = g_object_ref (source);
+
+ if (VTABLE_IS_IP4)
+ entry->route.r4 = *((const NMPlatformIP4Route *) default_route);
+ else
+ entry->route.r6 = *((const NMPlatformIP6Route *) default_route);
+
+ /* only use normalized metrics */
+ entry->route.rx.metric = vtable->route_metric_normalize (entry->route.rx.metric);
+ entry->route.rx.ifindex = ip_ifindex;
+ entry->never_default = never_default;
+ entry->effective_metric = entry->route.rx.metric;
+ entry->synced = synced;
+
+ g_ptr_array_add (entries, entry);
+ _entry_at_idx_update (vtable, self, entries->len - 1, NULL);
+ } else if (default_route) {
+ /* update */
+ Entry old_entry, new_entry;
+
+ new_entry = *entry;
+ if (VTABLE_IS_IP4)
+ new_entry.route.r4 = *((const NMPlatformIP4Route *) default_route);
+ else
+ new_entry.route.r6 = *((const NMPlatformIP6Route *) default_route);
+ /* only use normalized metrics */
+ new_entry.route.rx.metric = vtable->route_metric_normalize (new_entry.route.rx.metric);
+ new_entry.route.rx.ifindex = ip_ifindex;
+ new_entry.never_default = never_default;
+ new_entry.synced = synced;
+
+ if (memcmp (entry, &new_entry, sizeof (new_entry)) == 0)
+ return;
+
+ old_entry = *entry;
+ *entry = new_entry;
+ _entry_at_idx_update (vtable, self, entry_idx, &old_entry);
+ } else {
+ /* delete */
+ _entry_at_idx_remove (vtable, self, entry_idx);
+ }
+}
+
+void
+nm_default_route_manager_ip4_update_default_route (NMDefaultRouteManager *self, gpointer source)
+{
+ _ipx_update_default_route (&vtable_ip4, self, source);
+}
+
+void
+nm_default_route_manager_ip6_update_default_route (NMDefaultRouteManager *self, gpointer source)
+{
+ _ipx_update_default_route (&vtable_ip6, self, source);
+}
+
+/***********************************************************************************/
+
+static gboolean
+_ipx_connection_has_default_route (const VTableIP *vtable, NMDefaultRouteManager *self, NMConnection *connection)
+{
+ const char *method;
+ NMSettingIPConfig *s_ip;
+
+ g_return_val_if_fail (NM_IS_DEFAULT_ROUTE_MANAGER (self), FALSE);
+ g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
+
+ if (VTABLE_IS_IP4)
+ s_ip = nm_connection_get_setting_ip4_config (connection);
+ else
+ s_ip = nm_connection_get_setting_ip6_config (connection);
+ if (!s_ip || nm_setting_ip_config_get_never_default (s_ip))
+ return FALSE;
+
+ if (VTABLE_IS_IP4) {
+ method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG);
+ if ( !method
+ || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)
+ || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL))
+ return FALSE;
+ } else {
+ method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG);
+ if ( !method
+ || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)
+ || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+gboolean
+nm_default_route_manager_ip4_connection_has_default_route (NMDefaultRouteManager *self, NMConnection *connection)
+{
+ return _ipx_connection_has_default_route (&vtable_ip4, self, connection);
+}
+
+gboolean
+nm_default_route_manager_ip6_connection_has_default_route (NMDefaultRouteManager *self, NMConnection *connection)
+{
+ return _ipx_connection_has_default_route (&vtable_ip6, self, connection);
+}
+
+/***********************************************************************************/
+
+static NMDevice *
+_ipx_get_best_device (const VTableIP *vtable, NMDefaultRouteManager *self, const GSList *devices)
+{
+ NMDefaultRouteManagerPrivate *priv;
+ GPtrArray *entries;
+ guint i;
+
+ g_return_val_if_fail (NM_IS_DEFAULT_ROUTE_MANAGER (self), NULL);
+
+ if (!devices)
+ return NULL;
+
+ priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ if (priv->disposed)
+ return NULL;
+ entries = vtable->get_entries (priv);
+
+ for (i = 0; i < entries->len; i++) {
+ Entry *entry = g_ptr_array_index (entries, i);
+ NMDeviceState state;
+
+ if (!NM_IS_DEVICE (entry->source.pointer))
+ continue;
+
+ if (entry->never_default)
+ continue;
+
+ state = nm_device_get_state (entry->source.device);
+ if ( state <= NM_DEVICE_STATE_DISCONNECTED
+ || state >= NM_DEVICE_STATE_DEACTIVATING) {
+ /* FIXME: we also track unmanaged devices with assumed default routes.
+ * Skip them, they are (currently) no candidates for best-device.
+ *
+ * Later we also want to properly assume connections for unmanaged devices.
+ *
+ * Also, we don't want to have DEACTIVATING devices returned as best_device(). */
+ continue;
+ }
+
+ if (g_slist_find ((GSList *) devices, entry->source.device)) {
+ g_return_val_if_fail (nm_device_get_act_request (entry->source.pointer), entry->source.pointer);
+ return entry->source.pointer;
+ }
+ }
+ return NULL;
+}
+
+/** _ipx_get_best_activating_device:
+ * @vtable: the virtual table
+ * @self: #NMDefaultRouteManager
+ * @devices: list of devices to be searched. Only devices from this list will be considered
+ * @fully_activated: if #TRUE, only search for devices that are fully activated. Otherwise,
+ * search if there is a best device going to be activated. In the latter case, this will
+ * return NULL if the best device is already activated.
+ * @preferred_device: if not-NULL, this device is preferred if there are more devices with
+ * the same priority.
+ **/
+static NMDevice *
+_ipx_get_best_activating_device (const VTableIP *vtable, NMDefaultRouteManager *self, const GSList *devices, NMDevice *preferred_device)
+{
+ NMDefaultRouteManagerPrivate *priv;
+ const GSList *iter;
+ NMDevice *best_device = NULL;
+ guint32 best_prio = G_MAXUINT32;
+ NMDevice *best_activated_device;
+
+ g_return_val_if_fail (NM_IS_DEFAULT_ROUTE_MANAGER (self), NULL);
+
+ priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ if (priv->disposed)
+ return NULL;
+
+ best_activated_device = _ipx_get_best_device (vtable, self, devices);
+
+ for (iter = devices; iter; iter = g_slist_next (iter)) {
+ NMDevice *device = NM_DEVICE (iter->data);
+ guint32 prio;
+ Entry *entry;
+
+ entry = _entry_find_by_source (vtable->get_entries (priv), device, NULL);
+
+ if (entry) {
+ /* of all the device that have an entry, we already know that best_activated_device
+ * is the best. entry cannot be better. */
+ if (entry->source.device != best_activated_device)
+ continue;
+ prio = entry->effective_metric;
+ } else {
+ NMDeviceState state = nm_device_get_state (device);
+
+ if ( state <= NM_DEVICE_STATE_DISCONNECTED
+ || state >= NM_DEVICE_STATE_DEACTIVATING)
+ continue;
+
+ if (!_ipx_connection_has_default_route (vtable, self, nm_device_get_connection (device)))
+ continue;
+
+ prio = nm_device_get_ip4_route_metric (device);
+ }
+ prio = vtable->route_metric_normalize (prio);
+
+ if ( !best_device
+ || prio < best_prio
+ || (prio == best_prio && preferred_device == device)) {
+ best_device = device;
+ best_prio = prio;
+ }
+ }
+
+ /* There's only a best activating device if the best device
+ * among all activating and already-activated devices is a
+ * still-activating one.
+ */
+ if (best_device && nm_device_get_state (best_device) >= NM_DEVICE_STATE_SECONDARIES)
+ return NULL;
+ return best_device;
+}
+
+NMDevice *
+nm_default_route_manager_ip4_get_best_device (NMDefaultRouteManager *self, const GSList *devices, gboolean fully_activated, NMDevice *preferred_device)
+{
+ if (fully_activated)
+ return _ipx_get_best_device (&vtable_ip4, self, devices);
+ else
+ return _ipx_get_best_activating_device (&vtable_ip4, self, devices, preferred_device);
+}
+
+NMDevice *
+nm_default_route_manager_ip6_get_best_device (NMDefaultRouteManager *self, const GSList *devices, gboolean fully_activated, NMDevice *preferred_device)
+{
+ if (fully_activated)
+ return _ipx_get_best_device (&vtable_ip6, self, devices);
+ else
+ return _ipx_get_best_activating_device (&vtable_ip6, self, devices, preferred_device);
+}
+
+/***********************************************************************************/
+
+static gpointer
+_ipx_get_best_config (const VTableIP *vtable,
+ NMDefaultRouteManager *self,
+ gboolean ignore_never_default,
+ const char **out_ip_iface,
+ NMActiveConnection **out_ac,
+ NMDevice **out_device,
+ NMVpnConnection **out_vpn)
+{
+ NMDefaultRouteManagerPrivate *priv;
+ GPtrArray *entries;
+ guint i;
+ gpointer config_result = NULL;
+
+ g_return_val_if_fail (NM_IS_DEFAULT_ROUTE_MANAGER (self), NULL);
+
+ if (out_ip_iface)
+ *out_ip_iface = NULL;
+ if (out_ac)
+ *out_ac = NULL;
+ if (out_device)
+ *out_device = NULL;
+ if (out_vpn)
+ *out_vpn = NULL;
+
+ priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ if (priv->disposed)
+ return NULL;
+
+ g_return_val_if_fail (NM_IS_DEFAULT_ROUTE_MANAGER (self), NULL);
+
+ priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+ entries = vtable->get_entries (priv);
+
+ for (i = 0; i < entries->len; i++) {
+ Entry *entry = g_ptr_array_index (entries, i);
+
+ if (!NM_IS_DEVICE (entry->source.pointer)) {
+ NMVpnConnection *vpn = NM_VPN_CONNECTION (entry->source.vpn);
+
+ if (entry->never_default && !ignore_never_default)
+ continue;
+
+ if (VTABLE_IS_IP4)
+ config_result = nm_vpn_connection_get_ip4_config (vpn);
+ else
+ config_result = nm_vpn_connection_get_ip6_config (vpn);
+ g_assert (config_result);
+
+ if (out_vpn)
+ *out_vpn = vpn;
+ if (out_ac)
+ *out_ac = NM_ACTIVE_CONNECTION (vpn);
+ if (out_ip_iface)
+ *out_ip_iface = nm_vpn_connection_get_ip_iface (vpn);
+ } else {
+ NMDevice *device = entry->source.device;
+ NMActRequest *req;
+ NMDeviceState state;
+
+ if (entry->never_default)
+ continue;
+
+ state = nm_device_get_state (device);
+ if ( state <= NM_DEVICE_STATE_DISCONNECTED
+ || state >= NM_DEVICE_STATE_DEACTIVATING) {
+ /* FIXME: the device has a default route, but we ignore it due to
+ * unexpected state. That happens for example for unmanaged devices.
+ *
+ * In the future, we want unmanaged devices also assume a connection
+ * if they are activated externally.
+ *
+ * Also, we don't want to have DEACTIVATING devices returned as best_config(). */
+ continue;
+ }
+
+ if (VTABLE_IS_IP4)
+ config_result = nm_device_get_ip4_config (device);
+ else
+ config_result = nm_device_get_ip6_config (device);
+ g_assert (config_result);
+ req = nm_device_get_act_request (device);
+ g_assert (req);
+
+ if (out_device)
+ *out_device = device;
+ if (out_ac)
+ *out_ac = NM_ACTIVE_CONNECTION (req);
+ if (out_ip_iface)
+ *out_ip_iface = nm_device_get_ip_iface (device);
+ }
+ break;
+ }
+
+ return config_result;
+}
+
+NMIP4Config *
+nm_default_route_manager_ip4_get_best_config (NMDefaultRouteManager *self,
+ gboolean ignore_never_default,
+ const char **out_ip_iface,
+ NMActiveConnection **out_ac,
+ NMDevice **out_device,
+ NMVpnConnection **out_vpn)
+{
+ return _ipx_get_best_config (&vtable_ip4,
+ self,
+ ignore_never_default,
+ out_ip_iface,
+ out_ac,
+ out_device,
+ out_vpn);
+}
+
+NMIP6Config *
+nm_default_route_manager_ip6_get_best_config (NMDefaultRouteManager *self,
+ gboolean ignore_never_default,
+ const char **out_ip_iface,
+ NMActiveConnection **out_ac,
+ NMDevice **out_device,
+ NMVpnConnection **out_vpn)
+{
+ return _ipx_get_best_config (&vtable_ip6,
+ self,
+ ignore_never_default,
+ out_ip_iface,
+ out_ac,
+ out_device,
+ out_vpn);
+}
+
+/***********************************************************************************/
+
+static GPtrArray *
+_v4_get_entries (NMDefaultRouteManagerPrivate *priv)
+{
+ return priv->entries_ip4;
+}
+
+static GPtrArray *
+_v6_get_entries (NMDefaultRouteManagerPrivate *priv)
+{
+ return priv->entries_ip6;
+}
+
+static gboolean
+_v4_platform_route_delete_default (int ifindex, guint32 metric)
+{
+ return nm_platform_ip4_route_delete (ifindex, 0, 0, metric);
+}
+
+static gboolean
+_v6_platform_route_delete_default (int ifindex, guint32 metric)
+{
+ return nm_platform_ip6_route_delete (ifindex, in6addr_any, 0, metric);
+}
+
+static guint32
+_v4_route_metric_normalize (guint32 metric)
+{
+ return metric;
+}
+
+static const VTableIP vtable_ip4 = {
+ .addr_family = AF_INET,
+ .get_entries = _v4_get_entries,
+ .platform_route_to_string = (const char *(*)(const NMPlatformIPRoute *)) nm_platform_ip4_route_to_string,
+ .platform_route_get_all = nm_platform_ip4_route_get_all,
+ .platform_route_delete_default = _v4_platform_route_delete_default,
+ .route_metric_normalize = _v4_route_metric_normalize,
+};
+
+static const VTableIP vtable_ip6 = {
+ .addr_family = AF_INET6,
+ .get_entries = _v6_get_entries,
+ .platform_route_to_string = (const char *(*)(const NMPlatformIPRoute *)) nm_platform_ip6_route_to_string,
+ .platform_route_get_all = nm_platform_ip6_route_get_all,
+ .platform_route_delete_default = _v6_platform_route_delete_default,
+ .route_metric_normalize = nm_utils_ip6_route_metric_normalize,
+};
+
+/***********************************************************************************/
+
+static gboolean
+_resync_idle_now (NMDefaultRouteManager *self)
+{
+ gboolean has_v4_changes, has_v6_changes;
+ gboolean changed = FALSE;
+
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+
+ has_v4_changes = priv->resync.has_v4_changes;
+ has_v6_changes = priv->resync.has_v6_changes;
+
+ _LOGD (0, "resync: sync now (%u) (IPv4 changes: %s, IPv6 changes: %s)", priv->resync.idle_handle,
+ has_v4_changes ? "yes" : "no", has_v6_changes ? "yes" : "no");
+
+ priv->resync.has_v4_changes = FALSE;
+ priv->resync.has_v6_changes = FALSE;
+ priv->resync.idle_handle = 0;
+ priv->resync.backoff_wait_time_ms =
+ priv->resync.backoff_wait_time_ms == 0
+ ? 100
+ : priv->resync.backoff_wait_time_ms * 2;
+
+ if (has_v4_changes)
+ changed |= _resync_all (&vtable_ip4, self, NULL, NULL, TRUE);
+
+ if (has_v6_changes)
+ changed |= _resync_all (&vtable_ip6, self, NULL, NULL, TRUE);
+
+ if (!changed) {
+ /* Nothing changed: reset the backoff wait time */
+ _resync_idle_cancel (self);
+ }
+
+ return G_SOURCE_REMOVE;
+}
+
+static void
+_resync_idle_cancel (NMDefaultRouteManager *self)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+
+ if (priv->resync.idle_handle) {
+ _LOGD (0, "resync: cancelled (%u)", priv->resync.idle_handle);
+ g_source_remove (priv->resync.idle_handle);
+ priv->resync.idle_handle = 0;
+ }
+ priv->resync.backoff_wait_time_ms = 0;
+ priv->resync.has_v4_changes = FALSE;
+ priv->resync.has_v6_changes = FALSE;
+}
+
+static void
+_resync_idle_reschedule (NMDefaultRouteManager *self)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+
+ /* since we react on external changes and readd/remove default routes for
+ * the interfaces we manage, there could be the erronous situation where two applications
+ * fight over a certain default route.
+ * Avoid this, by increasingly wait longer to touch the system (backoff wait time). */
+
+ if (priv->resync.backoff_wait_time_ms == 0) {
+ /* for scheduling idle, always reschedule (to process all other events first) */
+ if (priv->resync.idle_handle)
+ g_source_remove (priv->resync.idle_handle);
+ else
+ _LOGD (0, "resync: schedule on idle");
+ priv->resync.idle_handle = g_idle_add ((GSourceFunc) _resync_idle_now, self);
+ } else if (!priv->resync.idle_handle) {
+ priv->resync.idle_handle = g_timeout_add (priv->resync.backoff_wait_time_ms, (GSourceFunc) _resync_idle_now, self);
+ _LOGD (0, "resync: schedule in %u.%03u seconds (%u)", priv->resync.backoff_wait_time_ms/1000,
+ priv->resync.backoff_wait_time_ms%1000, priv->resync.idle_handle);
+ }
+}
+
+static void
+_platform_ipx_route_changed_cb (const VTableIP *vtable,
+ NMDefaultRouteManager *self,
+ const NMPlatformIPRoute *route)
+{
+ NMDefaultRouteManagerPrivate *priv;
+
+ if (route && !NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)) {
+ /* we only care about address changes or changes of default route. */
+ return;
+ }
+
+ priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+
+ if (priv->resync.guard) {
+ /* callbacks while executing _resync_all() are ignored. */
+ return;
+ }
+
+ if (VTABLE_IS_IP4)
+ priv->resync.has_v4_changes = TRUE;
+ else
+ priv->resync.has_v6_changes = TRUE;
+
+ _resync_idle_reschedule (self);
+}
+
+static void
+_platform_ip4_address_changed_cb (NMPlatform *platform,
+ int ifindex,
+ gpointer platform_object,
+ NMPlatformSignalChangeType change_type,
+ NMPlatformReason reason,
+ NMDefaultRouteManager *self)
+{
+ _platform_ipx_route_changed_cb (&vtable_ip4, self, NULL);
+}
+
+static void
+_platform_ip6_address_changed_cb (NMPlatform *platform,
+ int ifindex,
+ gpointer platform_object,
+ NMPlatformSignalChangeType change_type,
+ NMPlatformReason reason,
+ NMDefaultRouteManager *self)
+{
+ _platform_ipx_route_changed_cb (&vtable_ip6, self, NULL);
+}
+
+static void
+_platform_ip4_route_changed_cb (NMPlatform *platform,
+ int ifindex,
+ gpointer platform_object,
+ NMPlatformSignalChangeType change_type,
+ NMPlatformReason reason,
+ NMDefaultRouteManager *self)
+{
+ _platform_ipx_route_changed_cb (&vtable_ip4, self, platform_object);
+}
+
+static void
+_platform_ip6_route_changed_cb (NMPlatform *platform,
+ int ifindex,
+ gpointer platform_object,
+ NMPlatformSignalChangeType change_type,
+ NMPlatformReason reason,
+ NMDefaultRouteManager *self)
+{
+ _platform_ipx_route_changed_cb (&vtable_ip6, self, platform_object);
+}
+
+/***********************************************************************************/
+
+static void
+nm_default_route_manager_init (NMDefaultRouteManager *self)
+{
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+
+ priv->entries_ip4 = g_ptr_array_new_full (0, (GDestroyNotify) _entry_free);
+ priv->entries_ip6 = g_ptr_array_new_full (0, (GDestroyNotify) _entry_free);
+
+ priv->platform = g_object_ref (nm_platform_get ());
+ g_signal_connect (priv->platform, NM_PLATFORM_SIGNAL_IP4_ADDRESS_CHANGED, G_CALLBACK (_platform_ip4_address_changed_cb), self);
+ g_signal_connect (priv->platform, NM_PLATFORM_SIGNAL_IP6_ADDRESS_CHANGED, G_CALLBACK (_platform_ip6_address_changed_cb), self);
+ g_signal_connect (priv->platform, NM_PLATFORM_SIGNAL_IP4_ROUTE_CHANGED, G_CALLBACK (_platform_ip4_route_changed_cb), self);
+ g_signal_connect (priv->platform, NM_PLATFORM_SIGNAL_IP6_ROUTE_CHANGED, G_CALLBACK (_platform_ip6_route_changed_cb), self);
+}
+
+static void
+dispose (GObject *object)
+{
+ NMDefaultRouteManager *self = NM_DEFAULT_ROUTE_MANAGER (object);
+ NMDefaultRouteManagerPrivate *priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self);
+
+ priv->disposed = TRUE;
+
+ if (priv->platform) {
+ g_signal_handlers_disconnect_by_data (priv->platform, self);
+ g_clear_object (&priv->platform);
+ }
+
+ _resync_idle_cancel (self);
+
+ /* g_ptr_array_free() invokes the free function for all entries without actually
+ * removing them and having dangling pointers in the process. _entry_free()
+ * will unref the source, which might cause the destruction of the object, which
+ * might trigger calling into @self again. This is guarded by priv->dispose.
+ * If you remove priv->dispose, you must refactor the lines below to remove enties
+ * one-by-one.
+ */
+ if (priv->entries_ip4) {
+ g_ptr_array_free (priv->entries_ip4, TRUE);
+ priv->entries_ip4 = NULL;
+ }
+ if (priv->entries_ip6) {
+ g_ptr_array_free (priv->entries_ip6, TRUE);
+ priv->entries_ip6 = NULL;
+ }
+
+ G_OBJECT_CLASS (nm_default_route_manager_parent_class)->dispose (object);
+}
+
+static void
+nm_default_route_manager_class_init (NMDefaultRouteManagerClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (NMDefaultRouteManagerPrivate));
+
+ /* virtual methods */
+ object_class->dispose = dispose;
+}
+
diff --git a/src/nm-default-route-manager.h b/src/nm-default-route-manager.h
new file mode 100644
index 0000000000..d8e422735e
--- /dev/null
+++ b/src/nm-default-route-manager.h
@@ -0,0 +1,74 @@
+/* -*- 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 (C) 2014 Red Hat, Inc.
+ */
+
+#include <glib-object.h>
+
+#include "nm-connection.h"
+#include "nm-types.h"
+
+#ifndef __NETWORKMANAGER_DEFAULT_ROUTE_MANAGER_H__
+#define __NETWORKMANAGER_DEFAULT_ROUTE_MANAGER_H__
+
+
+#define NM_TYPE_DEFAULT_ROUTE_MANAGER (nm_default_route_manager_get_type ())
+#define NM_DEFAULT_ROUTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEFAULT_ROUTE_MANAGER, NMDefaultRouteManager))
+#define NM_DEFAULT_ROUTE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEFAULT_ROUTE_MANAGER, NMDefaultRouteManagerClass))
+#define NM_IS_DEFAULT_ROUTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEFAULT_ROUTE_MANAGER))
+#define NM_IS_DEFAULT_ROUTE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEFAULT_ROUTE_MANAGER))
+#define NM_DEFAULT_ROUTE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEFAULT_ROUTE_MANAGER, NMDefaultRouteManagerClass))
+
+
+
+struct _NMDefaultRouteManager {
+ GObject parent;
+};
+
+typedef struct {
+ GObjectClass parent;
+} NMDefaultRouteManagerClass;
+
+GType nm_default_route_manager_get_type (void);
+
+NMDefaultRouteManager *nm_default_route_manager_get (void);
+
+void nm_default_route_manager_ip4_update_default_route (NMDefaultRouteManager *manager, gpointer source);
+void nm_default_route_manager_ip6_update_default_route (NMDefaultRouteManager *manager, gpointer source);
+
+gboolean nm_default_route_manager_ip4_connection_has_default_route (NMDefaultRouteManager *manager, NMConnection *connection);
+gboolean nm_default_route_manager_ip6_connection_has_default_route (NMDefaultRouteManager *manager, NMConnection *connection);
+
+NMDevice *nm_default_route_manager_ip4_get_best_device (NMDefaultRouteManager *manager, const GSList *devices, gboolean fully_activated, NMDevice *preferred_device);
+NMDevice *nm_default_route_manager_ip6_get_best_device (NMDefaultRouteManager *manager, const GSList *devices, gboolean fully_activated, NMDevice *preferred_device);
+
+NMIP4Config *nm_default_route_manager_ip4_get_best_config (NMDefaultRouteManager *manager,
+ gboolean ignore_never_default,
+ const char **out_ip_iface,
+ NMActiveConnection **out_ac,
+ NMDevice **out_device,
+ NMVpnConnection **out_vpn);
+NMIP6Config *nm_default_route_manager_ip6_get_best_config (NMDefaultRouteManager *manager,
+ gboolean ignore_never_default,
+ const char **out_ip_iface,
+ NMActiveConnection **out_ac,
+ NMDevice **out_device,
+ NMVpnConnection **out_vpn);
+
+#endif /* NM_DEFAULT_ROUTE_MANAGER_H */
+
diff --git a/src/nm-dhcp4-config.c b/src/nm-dhcp4-config.c
index 45cf5c5cf2..096cf16d99 100644
--- a/src/nm-dhcp4-config.c
+++ b/src/nm-dhcp4-config.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
diff --git a/src/nm-dhcp6-config.c b/src/nm-dhcp6-config.c
index 6a644a95f7..f93e9644c4 100644
--- a/src/nm-dhcp6-config.c
+++ b/src/nm-dhcp6-config.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
diff --git a/src/nm-dispatcher.c b/src/nm-dispatcher.c
index e77cca6f5d..8fdb43dfbe 100644
--- a/src/nm-dispatcher.c
+++ b/src/nm-dispatcher.c
@@ -19,6 +19,8 @@
* Copyright (C) 2005 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <gio/gio.h>
#include <string.h>
@@ -35,6 +37,7 @@
#include "nm-dhcp6-config.h"
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
+#include "nm-settings-connection.h"
#define CALL_TIMEOUT (1000 * 60 * 10) /* 10 minutes for all scripts */
@@ -369,7 +372,7 @@ static const char *action_table[] = {
static const char *
action_to_string (DispatcherAction action)
{
- g_assert (action >= 0 && action < G_N_ELEMENTS (action_table));
+ g_assert ((gsize) action < G_N_ELEMENTS (action_table));
return action_table[action];
}
@@ -472,6 +475,7 @@ _dispatcher_call (DispatcherAction action,
if (connection) {
GVariant *connection_dict;
+ const char *filename;
connection_dict = nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_NO_SECRETS);
connection_hash = nm_utils_connection_dict_to_hash (connection_dict);
@@ -481,6 +485,17 @@ _dispatcher_call (DispatcherAction action,
value_hash_add_object_path (connection_props,
NMD_CONNECTION_PROPS_PATH,
nm_connection_get_path (connection));
+ filename = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection));
+ if (filename) {
+ value_hash_add_str (connection_props,
+ NMD_CONNECTION_PROPS_FILENAME,
+ filename);
+ }
+ if (nm_settings_connection_get_nm_generated_assumed (NM_SETTINGS_CONNECTION (connection))) {
+ value_hash_add_bool (connection_props,
+ NMD_CONNECTION_PROPS_EXTERNAL,
+ TRUE);
+ }
} else {
connection_hash = value_hash_create ();
connection_props = value_hash_create ();
diff --git a/src/firewall-manager/nm-firewall-manager.c b/src/nm-firewall-manager.c
index d3e3777d44..4d302e9d2f 100644
--- a/src/firewall-manager/nm-firewall-manager.c
+++ b/src/nm-firewall-manager.c
@@ -18,8 +18,11 @@
* Copyright (C) 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
+#include <gio/gio.h>
#include <dbus/dbus.h>
#include "nm-firewall-manager.h"
@@ -44,6 +47,8 @@ typedef struct {
guint name_owner_id;
DBusGProxy * proxy;
gboolean running;
+
+ GSList *pending_calls;
} NMFirewallManagerPrivate;
enum {
@@ -56,44 +61,89 @@ static guint signals[LAST_SIGNAL] = { 0 };
/********************************************************************/
+#define PENDING_CALL_DUMMY ((NMFirewallPendingCall) GUINT_TO_POINTER(1))
+#define PENDING_CALL_FROM_INFO(info) ((NMFirewallPendingCall) info)
+
typedef struct {
+ NMFirewallManager *self;
char *iface;
FwAddToZoneFunc callback;
gpointer user_data;
guint id;
gboolean completed;
+
+ guint idle_id;
+ DBusGProxyCall *dbus_call;
} CBInfo;
static void
-cb_info_free (CBInfo *info)
+_cb_info_free (CBInfo *info)
{
+ NMFirewallManagerPrivate *priv;
+
g_return_if_fail (info != NULL);
- if (!info->completed)
+ if (!info->completed) {
nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone call cancelled [%u]", info->iface, info->id);
+ if (info->callback) {
+ GError *error;
+ error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED,
+ "Operation was cancelled");
+ info->callback (error, info->user_data);
+ g_error_free (error);
+ }
+ }
g_free (info->iface);
- g_free (info);
+
+ priv = NM_FIREWALL_MANAGER_GET_PRIVATE (info->self);
+ priv->pending_calls = g_slist_remove (priv->pending_calls, info);
+ g_object_unref (info->self);
+
+ g_slice_free (CBInfo, info);
}
static CBInfo *
-_cb_info_create (const char *iface, FwAddToZoneFunc callback, gpointer user_data)
+_cb_info_create (NMFirewallManager *self, const char *iface, FwAddToZoneFunc callback, gpointer user_data)
{
+ NMFirewallManagerPrivate *priv = NM_FIREWALL_MANAGER_GET_PRIVATE (self);
static guint id;
CBInfo *info;
- info = g_malloc (sizeof (CBInfo));
+ info = g_slice_new0 (CBInfo);
if (++id == 0)
++id;
+ info->self = g_object_ref (self);
info->id = id;
info->iface = g_strdup (iface);
info->completed = FALSE;
info->callback = callback;
info->user_data = user_data;
+ priv->pending_calls = g_slist_prepend (priv->pending_calls, info);
return info;
}
+static gboolean
+add_or_change_idle_cb (gpointer user_data)
+{
+ CBInfo *info = user_data;
+
+ if (info->idle_id == 0) {
+ /* operation was cancelled. _cb_info_free will invoke callback. */
+ } else {
+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone call pretends success [%u]",
+ info->iface, info->id);
+ if (info->callback)
+ info->callback (NULL, info->user_data);
+ info->completed = TRUE;
+ info->idle_id = 0;
+ }
+
+ _cb_info_free (info);
+ return G_SOURCE_REMOVE;
+}
+
static void
add_or_change_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
{
@@ -117,14 +167,15 @@ add_or_change_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data
info->iface, info->id);
}
- info->callback (error, info->user_data);
+ if (info->callback)
+ info->callback (error, info->user_data);
info->completed = TRUE;
g_free (zone);
g_clear_error (&error);
}
-gpointer
+NMFirewallPendingCall
nm_firewall_manager_add_or_change_zone (NMFirewallManager *self,
const char *iface,
const char *zone,
@@ -136,24 +187,32 @@ nm_firewall_manager_add_or_change_zone (NMFirewallManager *self,
CBInfo *info;
if (priv->running == FALSE) {
- nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone add/change skipped (not running)", iface);
- callback (NULL, user_data);
- return NULL;
+ if (callback) {
+ info = _cb_info_create (self, iface, callback, user_data);
+ info->idle_id = g_idle_add (add_or_change_idle_cb, info);
+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone %s -> %s%s%s [%u] (not running, simulate success)", iface, add ? "add" : "change",
+ zone?"\"":"", zone ? zone : "default", zone?"\"":"", info->id);
+ return PENDING_CALL_FROM_INFO (info);
+ } else {
+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone add/change skipped (not running)", iface);
+ return PENDING_CALL_DUMMY;
+ }
}
- info = _cb_info_create (iface, callback, user_data);
+ info = _cb_info_create (self, iface, callback, user_data);
nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone %s -> %s%s%s [%u]", iface, add ? "add" : "change",
zone?"\"":"", zone ? zone : "default", zone?"\"":"", info->id);
- return dbus_g_proxy_begin_call_with_timeout (priv->proxy,
- add ? "addInterface" : "changeZone",
- add_or_change_cb,
- info,
- (GDestroyNotify) cb_info_free,
- 10000, /* timeout */
- G_TYPE_STRING, zone ? zone : "",
- G_TYPE_STRING, iface,
- G_TYPE_INVALID);
+ info->dbus_call = dbus_g_proxy_begin_call_with_timeout (priv->proxy,
+ add ? "addInterface" : "changeZone",
+ add_or_change_cb,
+ info,
+ (GDestroyNotify) _cb_info_free,
+ 10000, /* timeout */
+ G_TYPE_STRING, zone ? zone : "",
+ G_TYPE_STRING, iface,
+ G_TYPE_INVALID);
+ return PENDING_CALL_FROM_INFO (info);
}
static void
@@ -185,7 +244,7 @@ remove_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
g_clear_error (&error);
}
-gpointer
+NMFirewallPendingCall
nm_firewall_manager_remove_from_zone (NMFirewallManager *self,
const char *iface,
const char *zone)
@@ -195,29 +254,49 @@ nm_firewall_manager_remove_from_zone (NMFirewallManager *self,
if (priv->running == FALSE) {
nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone remove skipped (not running)", iface);
- return NULL;
+ return PENDING_CALL_DUMMY;
}
- info = _cb_info_create (iface, NULL, NULL);
+ info = _cb_info_create (self, iface, NULL, NULL);
nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone remove -> %s%s%s [%u]", iface,
zone?"\"":"", zone ? zone : "*", zone?"\"":"", info->id);
- return dbus_g_proxy_begin_call_with_timeout (priv->proxy,
- "removeInterface",
- remove_cb,
- info,
- (GDestroyNotify) cb_info_free,
- 10000, /* timeout */
- G_TYPE_STRING, zone ? zone : "",
- G_TYPE_STRING, iface,
- G_TYPE_INVALID);
+ info->dbus_call = dbus_g_proxy_begin_call_with_timeout (priv->proxy,
+ "removeInterface",
+ remove_cb,
+ info,
+ (GDestroyNotify) _cb_info_free,
+ 10000, /* timeout */
+ G_TYPE_STRING, zone ? zone : "",
+ G_TYPE_STRING, iface,
+ G_TYPE_INVALID);
+ return PENDING_CALL_FROM_INFO (info);
}
-void nm_firewall_manager_cancel_call (NMFirewallManager *self, gpointer call)
+void nm_firewall_manager_cancel_call (NMFirewallManager *self, NMFirewallPendingCall call)
{
+ NMFirewallManagerPrivate *priv = NM_FIREWALL_MANAGER_GET_PRIVATE (self);
+ GSList *pending;
+ CBInfo *info;
+
g_return_if_fail (NM_IS_FIREWALL_MANAGER (self));
- dbus_g_proxy_cancel_call (NM_FIREWALL_MANAGER_GET_PRIVATE (self)->proxy,
- (DBusGProxyCall *) call);
+
+ if (call == PENDING_CALL_DUMMY)
+ return;
+
+ pending = g_slist_find (priv->pending_calls, call);
+
+ if (!pending)
+ return;
+ priv->pending_calls = g_slist_remove_link (priv->pending_calls, pending);
+
+ info = (CBInfo *) call;
+ if (info->idle_id)
+ info->idle_id = 0;
+ else {
+ dbus_g_proxy_cancel_call (NM_FIREWALL_MANAGER_GET_PRIVATE (self)->proxy,
+ info->dbus_call);
+ }
}
static void
@@ -258,18 +337,7 @@ name_owner_changed (NMDBusManager *dbus_mgr,
/*******************************************************************/
-NMFirewallManager *
-nm_firewall_manager_get (void)
-{
- static NMFirewallManager *singleton = NULL;
-
- if (G_UNLIKELY (!singleton)) {
- singleton = NM_FIREWALL_MANAGER (g_object_new (NM_TYPE_FIREWALL_MANAGER, NULL));
- g_assert (singleton);
- }
-
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMFirewallManager, nm_firewall_manager_get, NM_TYPE_FIREWALL_MANAGER);
static void
nm_firewall_manager_init (NMFirewallManager * self)
@@ -316,6 +384,8 @@ dispose (GObject *object)
{
NMFirewallManagerPrivate *priv = NM_FIREWALL_MANAGER_GET_PRIVATE (object);
+ g_assert (priv->pending_calls == NULL);
+
if (priv->dbus_mgr) {
g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id);
priv->name_owner_id = 0;
diff --git a/src/firewall-manager/nm-firewall-manager.h b/src/nm-firewall-manager.h
index 5ccbc72341..84cb5498ae 100644
--- a/src/firewall-manager/nm-firewall-manager.h
+++ b/src/nm-firewall-manager.h
@@ -40,6 +40,9 @@ G_BEGIN_DECLS
#define NM_FIREWALL_MANAGER_AVAILABLE "available"
+struct _NMFirewallPendingCall;
+typedef struct _NMFirewallPendingCall *NMFirewallPendingCall;
+
typedef struct {
GObject parent;
} NMFirewallManager;
@@ -57,16 +60,16 @@ NMFirewallManager *nm_firewall_manager_get (void);
typedef void (*FwAddToZoneFunc) (GError *error, gpointer user_data);
-gpointer nm_firewall_manager_add_or_change_zone (NMFirewallManager *mgr,
- const char *iface,
- const char *zone,
- gboolean add,
- FwAddToZoneFunc callback,
- gpointer user_data);
-gpointer nm_firewall_manager_remove_from_zone (NMFirewallManager *mgr,
- const char *iface,
- const char *zone);
-
-void nm_firewall_manager_cancel_call (NMFirewallManager *mgr, gpointer fw_call);
+NMFirewallPendingCall nm_firewall_manager_add_or_change_zone (NMFirewallManager *mgr,
+ const char *iface,
+ const char *zone,
+ gboolean add,
+ FwAddToZoneFunc callback,
+ gpointer user_data);
+NMFirewallPendingCall nm_firewall_manager_remove_from_zone (NMFirewallManager *mgr,
+ const char *iface,
+ const char *zone);
+
+void nm_firewall_manager_cancel_call (NMFirewallManager *mgr, NMFirewallPendingCall fw_call);
#endif /* __NETWORKMANAGER_FIREWALL_MANAGER_H__ */
diff --git a/src/nm-iface-helper.c b/src/nm-iface-helper.c
new file mode 100644
index 0000000000..4892ddb006
--- /dev/null
+++ b/src/nm-iface-helper.c
@@ -0,0 +1,556 @@
+/* -*- 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 (C) 2014 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib-unix.h>
+#include <getopt.h>
+#include <locale.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <glib/gi18n.h>
+#include <string.h>
+#include <sys/resource.h>
+#include <sys/stat.h>
+#include <signal.h>
+
+/* Cannot include <net/if.h> due to conflict with <linux/if.h>.
+ * Forward declare if_nametoindex. */
+extern unsigned int if_nametoindex (const char *__ifname);
+
+#include "gsystem-local-alloc.h"
+#include "NetworkManagerUtils.h"
+#include "nm-linux-platform.h"
+#include "nm-dhcp-manager.h"
+#include "nm-logging.h"
+#include "main-utils.h"
+#include "nm-rdisc.h"
+#include "nm-lndp-rdisc.h"
+#include "nm-utils.h"
+
+#if !defined(NM_DIST_VERSION)
+# define NM_DIST_VERSION VERSION
+#endif
+
+#define NMIH_PID_FILE_FMT NMRUNDIR "/nm-iface-helper-%d.pid"
+
+static GMainLoop *main_loop = NULL;
+static int ifindex = -1;
+
+static struct {
+ gboolean slaac;
+ gboolean show_version;
+ gboolean become_daemon;
+ gboolean debug;
+ gboolean g_fatal_warnings;
+ gboolean slaac_required;
+ gboolean dhcp4_required;
+ int tempaddr;
+ char *ifname;
+ char *uuid;
+ char *dhcp4_address;
+ char *dhcp4_clientid;
+ char *dhcp4_hostname;
+ char *iid_str;
+ char *opt_log_level;
+ char *opt_log_domains;
+ guint32 priority_v4;
+ guint32 priority_v6;
+} global_opt = {
+ .tempaddr = NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN,
+ .priority_v4 = NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP4,
+ .priority_v6 = NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6,
+};
+
+static void
+dhcp4_state_changed (NMDhcpClient *client,
+ NMDhcpState state,
+ NMIP4Config *ip4_config,
+ GHashTable *options,
+ gpointer user_data)
+{
+ static NMIP4Config *last_config = NULL;
+ NMIP4Config *existing;
+
+ g_return_if_fail (!ip4_config || NM_IS_IP4_CONFIG (ip4_config));
+
+ nm_log_dbg (LOGD_DHCP4, "(%s): new DHCPv4 client state %d", global_opt.ifname, state);
+
+ switch (state) {
+ case NM_DHCP_STATE_BOUND:
+ g_assert (ip4_config);
+ existing = nm_ip4_config_capture (ifindex, FALSE);
+ if (last_config)
+ nm_ip4_config_subtract (existing, last_config);
+
+ nm_ip4_config_merge (existing, ip4_config);
+ if (!nm_ip4_config_commit (existing, ifindex, global_opt.priority_v4))
+ nm_log_warn (LOGD_DHCP4, "(%s): failed to apply DHCPv4 config", global_opt.ifname);
+
+ if (last_config) {
+ g_object_unref (last_config);
+ last_config = nm_ip4_config_new (nm_dhcp_client_get_ifindex (client));
+ nm_ip4_config_replace (last_config, ip4_config, NULL);
+ }
+ break;
+ case NM_DHCP_STATE_TIMEOUT:
+ case NM_DHCP_STATE_DONE:
+ case NM_DHCP_STATE_FAIL:
+ if (global_opt.dhcp4_required) {
+ nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 timed out or failed, quitting...", global_opt.ifname);
+ g_main_loop_quit (main_loop);
+ } else
+ nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 timed out or failed", global_opt.ifname);
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, gpointer user_data)
+{
+ static NMIP6Config *last_config = NULL;
+ NMIP6Config *existing;
+ NMIP6Config *ip6_config;
+ static int system_support = -1;
+ guint ifa_flags = 0x00;
+ int i;
+
+ if (system_support == -1) {
+ /*
+ * Check, if both libnl and the kernel are recent enough,
+ * to help user space handling RA. If it's not supported,
+ * we have no ipv6-privacy and must add autoconf addresses
+ * as /128. The reason for the /128 is to prevent the kernel
+ * from adding a prefix route for this address.
+ **/
+ system_support = nm_platform_check_support_libnl_extended_ifa_flags () &&
+ nm_platform_check_support_kernel_extended_ifa_flags ();
+ }
+
+ if (system_support)
+ ifa_flags = IFA_F_NOPREFIXROUTE;
+ if (global_opt.tempaddr == NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR
+ || global_opt.tempaddr == NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR)
+ {
+ /* without system_support, this flag will be ignored. Still set it, doesn't seem to do any harm. */
+ ifa_flags |= IFA_F_MANAGETEMPADDR;
+ }
+
+ ip6_config = nm_ip6_config_new (ifindex);
+
+ if (changed & NM_RDISC_CONFIG_GATEWAYS) {
+ /* Use the first gateway as ordered in router discovery cache. */
+ if (rdisc->gateways->len) {
+ NMRDiscGateway *gateway = &g_array_index (rdisc->gateways, NMRDiscGateway, 0);
+
+ nm_ip6_config_set_gateway (ip6_config, &gateway->address);
+ } else
+ nm_ip6_config_set_gateway (ip6_config, NULL);
+ }
+
+ if (changed & NM_RDISC_CONFIG_ADDRESSES) {
+ /* Rebuild address list from router discovery cache. */
+ nm_ip6_config_reset_addresses (ip6_config);
+
+ /* rdisc->addresses contains at most max_addresses entries.
+ * This is different from what the kernel does, which
+ * also counts static and temporary addresses when checking
+ * max_addresses.
+ **/
+ for (i = 0; i < rdisc->addresses->len; i++) {
+ NMRDiscAddress *discovered_address = &g_array_index (rdisc->addresses, NMRDiscAddress, i);
+ NMPlatformIP6Address address;
+
+ memset (&address, 0, sizeof (address));
+ address.address = discovered_address->address;
+ address.plen = system_support ? 64 : 128;
+ address.timestamp = discovered_address->timestamp;
+ address.lifetime = discovered_address->lifetime;
+ address.preferred = discovered_address->preferred;
+ if (address.preferred > address.lifetime)
+ address.preferred = address.lifetime;
+ address.source = NM_IP_CONFIG_SOURCE_RDISC;
+ address.flags = ifa_flags;
+
+ nm_ip6_config_add_address (ip6_config, &address);
+ }
+ }
+
+ if (changed & NM_RDISC_CONFIG_ROUTES) {
+ /* Rebuild route list from router discovery cache. */
+ nm_ip6_config_reset_routes (ip6_config);
+
+ for (i = 0; i < rdisc->routes->len; i++) {
+ NMRDiscRoute *discovered_route = &g_array_index (rdisc->routes, NMRDiscRoute, i);
+ NMPlatformIP6Route route;
+
+ /* Only accept non-default routes. The router has no idea what the
+ * local configuration or user preferences are, so sending routes
+ * with a prefix length of 0 is quite rude and thus ignored.
+ */
+ if (discovered_route->plen > 0) {
+ memset (&route, 0, sizeof (route));
+ route.network = discovered_route->network;
+ route.plen = discovered_route->plen;
+ route.gateway = discovered_route->gateway;
+ route.source = NM_IP_CONFIG_SOURCE_RDISC;
+ route.metric = global_opt.priority_v6;
+
+ nm_ip6_config_add_route (ip6_config, &route);
+ }
+ }
+ }
+
+ if (changed & NM_RDISC_CONFIG_DHCP_LEVEL) {
+ /* Unsupported until systemd DHCPv6 is ready */
+ }
+
+ /* hop_limit == 0 is a special value "unspecified", so do not touch
+ * in this case */
+ if (changed & NM_RDISC_CONFIG_HOP_LIMIT && rdisc->hop_limit > 0) {
+ char val[16];
+
+ g_snprintf (val, sizeof (val), "%d", rdisc->hop_limit);
+ nm_platform_sysctl_set (nm_utils_ip6_property_path (global_opt.ifname, "hop_limit"), val);
+ }
+
+ if (changed & NM_RDISC_CONFIG_MTU) {
+ char val[16];
+
+ g_snprintf (val, sizeof (val), "%d", rdisc->mtu);
+ nm_platform_sysctl_set (nm_utils_ip6_property_path (global_opt.ifname, "mtu"), val);
+ }
+
+ existing = nm_ip6_config_capture (ifindex, FALSE, global_opt.tempaddr);
+ if (last_config)
+ nm_ip6_config_subtract (existing, last_config);
+
+ nm_ip6_config_merge (existing, ip6_config);
+ if (!nm_ip6_config_commit (existing, ifindex))
+ nm_log_warn (LOGD_IP6, "(%s): failed to apply IPv6 config", global_opt.ifname);
+
+ if (last_config) {
+ g_object_unref (last_config);
+ last_config = nm_ip6_config_new (ifindex);
+ nm_ip6_config_replace (last_config, ip6_config, NULL);
+ }
+}
+
+static void
+rdisc_ra_timeout (NMRDisc *rdisc, gpointer user_data)
+{
+ if (global_opt.slaac_required) {
+ nm_log_warn (LOGD_IP6, "(%s): IPv6 timed out or failed, quitting...", global_opt.ifname);
+ g_main_loop_quit (main_loop);
+ } else
+ nm_log_warn (LOGD_IP6, "(%s): IPv6 timed out or failed", global_opt.ifname);
+}
+
+static gboolean
+quit_handler (gpointer user_data)
+{
+ g_main_loop_quit (main_loop);
+ return G_SOURCE_REMOVE;
+}
+
+static void
+setup_signals (void)
+{
+ signal (SIGPIPE, SIG_IGN);
+ g_unix_signal_add (SIGINT, quit_handler, NULL);
+ g_unix_signal_add (SIGTERM, quit_handler, NULL);
+}
+
+static void
+do_early_setup (int *argc, char **argv[])
+{
+ gint64 priority64_v4 = -1;
+ gint64 priority64_v6 = -1;
+ GOptionEntry options[] = {
+ /* Interface/IP config */
+ { "ifname", 'i', 0, G_OPTION_ARG_STRING, &global_opt.ifname, N_("The interface to manage"), N_("eth0") },
+ { "uuid", 'u', 0, G_OPTION_ARG_STRING, &global_opt.uuid, N_("Connection UUID"), N_("661e8cd0-b618-46b8-9dc9-31a52baaa16b") },
+ { "slaac", 's', 0, G_OPTION_ARG_NONE, &global_opt.slaac, N_("Whether to manage IPv6 SLAAC"), NULL },
+ { "slaac-required", '6', 0, G_OPTION_ARG_NONE, &global_opt.slaac_required, N_("Whether SLAAC must be successful"), NULL },
+ { "slaac-tempaddr", 't', 0, G_OPTION_ARG_INT, &global_opt.tempaddr, N_("Use an IPv6 temporary privacy address"), NULL },
+ { "dhcp4", 'd', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_address, N_("Current DHCPv4 address"), NULL },
+ { "dhcp4-required", '4', 0, G_OPTION_ARG_NONE, &global_opt.dhcp4_required, N_("Whether DHCPv4 must be successful"), NULL },
+ { "dhcp4-clientid", 'c', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_clientid, N_("Hex-encoded DHCPv4 client ID"), NULL },
+ { "dhcp4-hostname", 'h', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_hostname, N_("Hostname to send to DHCP server"), N_("barbar") },
+ { "priority4", '\0', 0, G_OPTION_ARG_INT64, &priority64_v4, N_("Route priority for IPv4"), N_("0") },
+ { "priority6", '\0', 0, G_OPTION_ARG_INT64, &priority64_v6, N_("Route priority for IPv6"), N_("1024") },
+ { "iid", 'e', 0, G_OPTION_ARG_STRING, &global_opt.iid_str, N_("Hex-encoded Interface Identifier"), N_("") },
+
+ /* Logging/debugging */
+ { "version", 'V', 0, G_OPTION_ARG_NONE, &global_opt.show_version, N_("Print NetworkManager version and exit"), NULL },
+ { "no-daemon", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &global_opt.become_daemon, N_("Don't become a daemon"), NULL },
+ { "debug", 'b', 0, G_OPTION_ARG_NONE, &global_opt.debug, N_("Don't become a daemon, and log to stderr"), NULL },
+ { "log-level", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_level, N_("Log level: one of [%s]"), "INFO" },
+ { "log-domains", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_domains,
+ N_("Log domains separated by ',': any combination of [%s]"),
+ "PLATFORM,RFKILL,WIFI" },
+ { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &global_opt.g_fatal_warnings, N_("Make all warnings fatal"), NULL },
+ {NULL}
+ };
+
+#if !GLIB_CHECK_VERSION (2, 35, 0)
+ g_type_init ();
+#endif
+
+ if (!nm_main_utils_early_setup ("nm-iface-helper",
+ argc,
+ argv,
+ options,
+ NULL,
+ NULL,
+ _("nm-iface-helper is a small, standalone process that manages a single network interface.")))
+ exit (1);
+
+ if (priority64_v4 >= 0 && priority64_v4 <= G_MAXUINT32)
+ global_opt.priority_v4 = (guint32) priority64_v4;
+ if (priority64_v6 >= 0 && priority64_v6 <= G_MAXUINT32)
+ global_opt.priority_v6 = (guint32) priority64_v6;
+}
+
+int
+main (int argc, char *argv[])
+{
+ char *bad_domains = NULL;
+ GError *error = NULL;
+ gboolean wrote_pidfile = FALSE;
+ gs_free char *pidfile = NULL;
+ gs_unref_object NMDhcpClient *dhcp4_client = NULL;
+ gs_unref_object NMRDisc *rdisc = NULL;
+ GByteArray *hwaddr = NULL;
+ size_t hwaddr_len = 0;
+ gconstpointer tmp;
+ gs_free NMUtilsIPv6IfaceId *iid = NULL;
+
+#if !GLIB_CHECK_VERSION (2, 35, 0)
+ g_type_init ();
+#endif
+
+ setpgid (getpid (), getpid ());
+
+ do_early_setup (&argc, &argv);
+
+ if (global_opt.g_fatal_warnings) {
+ GLogLevelFlags fatal_mask;
+
+ fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
+ fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
+ g_log_set_always_fatal (fatal_mask);
+ }
+
+ if (global_opt.show_version) {
+ fprintf (stdout, NM_DIST_VERSION "\n");
+ exit (0);
+ }
+
+ nm_main_utils_ensure_root ();
+
+ if (!global_opt.ifname || !global_opt.uuid) {
+ fprintf (stderr, _("An interface name and UUID are required\n"));
+ exit (1);
+ }
+
+ ifindex = if_nametoindex (global_opt.ifname);
+ if (ifindex <= 0) {
+ fprintf (stderr, _("Failed to find interface index for %s (%s)\n"), global_opt.ifname, strerror (errno));
+ exit (1);
+ }
+ pidfile = g_strdup_printf (NMIH_PID_FILE_FMT, ifindex);
+ nm_main_utils_ensure_not_running_pidfile (pidfile);
+
+ nm_main_utils_ensure_rundir ();
+
+ if (!nm_logging_setup (global_opt.opt_log_level,
+ global_opt.opt_log_domains,
+ &bad_domains,
+ &error)) {
+ fprintf (stderr,
+ _("%s. Please use --help to see a list of valid options.\n"),
+ error->message);
+ exit (1);
+ } else if (bad_domains) {
+ fprintf (stderr,
+ _("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"),
+ bad_domains);
+ g_clear_pointer (&bad_domains, g_free);
+ }
+
+ if (global_opt.become_daemon && !global_opt.debug) {
+ if (daemon (0, 0) < 0) {
+ int saved_errno;
+
+ saved_errno = errno;
+ fprintf (stderr, _("Could not daemonize: %s [error %u]\n"),
+ g_strerror (saved_errno),
+ saved_errno);
+ exit (1);
+ }
+ if (nm_main_utils_write_pidfile (pidfile))
+ wrote_pidfile = TRUE;
+ }
+
+ /* Set up unix signal handling - before creating threads, but after daemonizing! */
+ main_loop = g_main_loop_new (NULL, FALSE);
+ setup_signals ();
+
+ nm_logging_syslog_openlog (global_opt.debug);
+
+ nm_log_info (LOGD_CORE, "nm-iface-helper (version " NM_DIST_VERSION ") is starting...");
+
+ /* Set up platform interaction layer */
+ nm_linux_platform_setup ();
+
+ tmp = nm_platform_link_get_address (ifindex, &hwaddr_len);
+ if (tmp) {
+ hwaddr = g_byte_array_sized_new (hwaddr_len);
+ g_byte_array_append (hwaddr, tmp, hwaddr_len);
+ }
+
+ if (global_opt.iid_str) {
+ GBytes *bytes;
+ gsize ignored = 0;
+
+ bytes = nm_utils_hexstr2bin (global_opt.iid_str);
+ if (!bytes || g_bytes_get_size (bytes) != sizeof (*iid)) {
+ fprintf (stderr, _("(%s): Invalid IID %s\n"), global_opt.ifname, global_opt.iid_str);
+ exit (1);
+ }
+ iid = g_bytes_unref_to_data (bytes, &ignored);
+ }
+
+ if (global_opt.dhcp4_address) {
+ nm_platform_sysctl_set (nm_utils_ip4_property_path (global_opt.ifname, "promote_secondaries"), "1");
+
+ dhcp4_client = nm_dhcp_manager_start_ip4 (nm_dhcp_manager_get (),
+ global_opt.ifname,
+ ifindex,
+ hwaddr,
+ global_opt.uuid,
+ global_opt.priority_v4,
+ !!global_opt.dhcp4_hostname,
+ global_opt.dhcp4_hostname,
+ global_opt.dhcp4_clientid,
+ 45,
+ NULL,
+ global_opt.dhcp4_address);
+ g_assert (dhcp4_client);
+ g_signal_connect (dhcp4_client,
+ NM_DHCP_CLIENT_SIGNAL_STATE_CHANGED,
+ G_CALLBACK (dhcp4_state_changed),
+ NULL);
+ }
+
+ if (global_opt.slaac) {
+ nm_platform_link_set_user_ipv6ll_enabled (ifindex, TRUE);
+
+ rdisc = nm_lndp_rdisc_new (ifindex, global_opt.ifname);
+ g_assert (rdisc);
+
+ if (iid)
+ nm_rdisc_set_iid (rdisc, *iid);
+
+ nm_platform_sysctl_set (nm_utils_ip6_property_path (global_opt.ifname, "accept_ra"), "1");
+ nm_platform_sysctl_set (nm_utils_ip6_property_path (global_opt.ifname, "accept_ra_defrtr"), "0");
+ nm_platform_sysctl_set (nm_utils_ip6_property_path (global_opt.ifname, "accept_ra_pinfo"), "0");
+ nm_platform_sysctl_set (nm_utils_ip6_property_path (global_opt.ifname, "accept_ra_rtr_pref"), "0");
+
+ g_signal_connect (rdisc,
+ NM_RDISC_CONFIG_CHANGED,
+ G_CALLBACK (rdisc_config_changed),
+ NULL);
+ g_signal_connect (rdisc,
+ NM_RDISC_RA_TIMEOUT,
+ G_CALLBACK (rdisc_ra_timeout),
+ NULL);
+ nm_rdisc_start (rdisc);
+ }
+
+ g_main_loop_run (main_loop);
+
+ g_clear_pointer (&hwaddr, g_byte_array_unref);
+
+ nm_logging_syslog_closelog ();
+
+ if (pidfile && wrote_pidfile)
+ unlink (pidfile);
+
+ nm_log_info (LOGD_CORE, "exiting");
+ exit (0);
+}
+
+/*******************************************************/
+/* Stub functions */
+
+void
+nm_main_config_reload ()
+{
+ nm_log_info (LOGD_CORE, "reloading configuration not supported");
+}
+
+gconstpointer nm_config_get (void);
+const char *nm_config_get_dhcp_client (gpointer unused);
+gboolean nm_config_get_configure_and_quit (gpointer unused);
+gconstpointer nm_dbus_manager_get (void);
+void nm_dbus_manager_register_exported_type (gpointer unused, GType gtype, gconstpointer unused2);
+void nm_dbus_manager_register_object (gpointer unused, const char *path, gpointer object);
+
+gconstpointer
+nm_config_get (void)
+{
+ return GUINT_TO_POINTER (1);
+}
+
+const char *
+nm_config_get_dhcp_client (gpointer unused)
+{
+ return "internal";
+}
+
+gboolean
+nm_config_get_configure_and_quit (gpointer unused)
+{
+ return TRUE;
+}
+
+gconstpointer
+nm_dbus_manager_get (void)
+{
+ return GUINT_TO_POINTER (1);
+}
+
+void
+nm_dbus_manager_register_exported_type (gpointer unused, GType gtype, gconstpointer unused2)
+{
+}
+
+void
+nm_dbus_manager_register_object (gpointer unused, const char *path, gpointer object)
+{
+}
+
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index 343aabcd0b..10e2b62c62 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -19,16 +19,21 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
+#include <arpa/inet.h>
#include "nm-ip4-config.h"
#include "nm-utils.h"
+#include "nm-platform.h"
#include "nm-dbus-manager.h"
#include "nm-dbus-glib-types.h"
#include "nm-ip4-config-glue.h"
#include "NetworkManagerUtils.h"
#include "nm-core-internal.h"
+#include "nm-route-manager.h"
G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, G_TYPE_OBJECT)
@@ -50,6 +55,7 @@ typedef struct {
GArray *wins;
guint32 mtu;
NMIPConfigSource mtu_source;
+ int ifindex;
} NMIP4ConfigPrivate;
/* internal guint32 are assigned to gobject properties of type uint. Ensure, that uint is large enough */
@@ -58,9 +64,12 @@ G_STATIC_ASSERT (G_MAXUINT >= 0xFFFFFFFF);
enum {
PROP_0,
- PROP_GATEWAY,
+ PROP_IFINDEX,
+ PROP_ADDRESS_DATA,
PROP_ADDRESSES,
+ PROP_ROUTE_DATA,
PROP_ROUTES,
+ PROP_GATEWAY,
PROP_NAMESERVERS,
PROP_DOMAINS,
PROP_SEARCHES,
@@ -71,14 +80,15 @@ enum {
static GParamSpec *obj_properties[LAST_PROP] = { NULL, };
#define _NOTIFY(config, prop) G_STMT_START { g_object_notify_by_pspec (G_OBJECT (config), obj_properties[prop]); } G_STMT_END
-
NMIP4Config *
-nm_ip4_config_new (void)
+nm_ip4_config_new (int ifindex)
{
- return (NMIP4Config *) g_object_new (NM_TYPE_IP4_CONFIG, NULL);
+ g_return_val_if_fail (ifindex >= -1, NULL);
+ return (NMIP4Config *) g_object_new (NM_TYPE_IP4_CONFIG,
+ NM_IP4_CONFIG_IFINDEX, ifindex,
+ NULL);
}
-
void
nm_ip4_config_export (NMIP4Config *config)
{
@@ -99,6 +109,12 @@ nm_ip4_config_get_dbus_path (const NMIP4Config *config)
return priv->path;
}
+int
+nm_ip4_config_get_ifindex (const NMIP4Config *config)
+{
+ return NM_IP4_CONFIG_GET_PRIVATE (config)->ifindex;
+}
+
static gboolean
same_prefix (guint32 address1, guint32 address2, int plen)
{
@@ -175,7 +191,7 @@ nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf)
NMIP4Config *config;
NMIP4ConfigPrivate *priv;
guint i;
- guint lowest_metric = G_MAXUINT;
+ guint32 lowest_metric = G_MAXUINT32;
guint32 old_gateway = 0;
gboolean has_gateway = FALSE;
@@ -183,14 +199,14 @@ nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf)
if (nm_platform_link_get_master (ifindex) > 0)
return NULL;
- config = nm_ip4_config_new ();
+ config = nm_ip4_config_new (ifindex);
priv = NM_IP4_CONFIG_GET_PRIVATE (config);
g_array_unref (priv->addresses);
g_array_unref (priv->routes);
priv->addresses = nm_platform_ip4_address_get_all (ifindex);
- priv->routes = nm_platform_ip4_route_get_all (ifindex, TRUE);
+ priv->routes = nm_platform_ip4_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
/* Extract gateway from default route */
old_gateway = priv->gateway;
@@ -234,6 +250,8 @@ nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf)
}
/* actually, nobody should be connected to the signal, just to be sure, notify */
+ _NOTIFY (config, PROP_ADDRESS_DATA);
+ _NOTIFY (config, PROP_ROUTE_DATA);
_NOTIFY (config, PROP_ADDRESSES);
_NOTIFY (config, PROP_ROUTES);
if (priv->gateway != old_gateway)
@@ -243,17 +261,16 @@ nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf)
}
gboolean
-nm_ip4_config_commit (const NMIP4Config *config, int ifindex)
+nm_ip4_config_commit (const NMIP4Config *config, int ifindex, guint32 default_route_metric)
{
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
- int mtu = nm_ip4_config_get_mtu (config);
int i;
g_return_val_if_fail (ifindex > 0, FALSE);
g_return_val_if_fail (config != NULL, FALSE);
/* Addresses */
- nm_platform_ip4_address_sync (ifindex, priv->addresses);
+ nm_platform_ip4_address_sync (ifindex, priv->addresses, default_route_metric);
/* Routes */
{
@@ -272,31 +289,20 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex)
&& nm_ip4_config_destination_is_direct (config, route->network, route->plen))
continue;
- /* Don't add the default route if the connection
- * is never supposed to be the default connection.
- */
- if ( nm_ip4_config_get_never_default (config)
- && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
- continue;
-
g_array_append_vals (routes, route, 1);
}
- success = nm_platform_ip4_route_sync (ifindex, routes);
+ success = nm_route_manager_ip4_route_sync (nm_route_manager_get (), ifindex, routes);
g_array_unref (routes);
if (!success)
return FALSE;
}
- /* MTU */
- if (mtu && mtu != nm_platform_link_get_mtu (ifindex))
- nm_platform_link_set_mtu (ifindex, mtu);
-
return TRUE;
}
void
-nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIP4Config *setting, int default_route_metric)
+nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIPConfig *setting, guint32 default_route_metric)
{
guint naddresses, nroutes, nnameservers, nsearches;
int i;
@@ -304,65 +310,71 @@ nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIP4Config *setting, i
if (!setting)
return;
+ g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
+
g_object_freeze_notify (G_OBJECT (config));
- naddresses = nm_setting_ip4_config_get_num_addresses (setting);
- nroutes = nm_setting_ip4_config_get_num_routes (setting);
- nnameservers = nm_setting_ip4_config_get_num_dns (setting);
- nsearches = nm_setting_ip4_config_get_num_dns_searches (setting);
+ naddresses = nm_setting_ip_config_get_num_addresses (setting);
+ nroutes = nm_setting_ip_config_get_num_routes (setting);
+ nnameservers = nm_setting_ip_config_get_num_dns (setting);
+ nsearches = nm_setting_ip_config_get_num_dns_searches (setting);
/* Gateway */
- if (nm_setting_ip4_config_get_never_default (setting))
+ if (nm_setting_ip_config_get_never_default (setting))
nm_ip4_config_set_never_default (config, TRUE);
- else if (nm_setting_ip4_config_get_ignore_auto_routes (setting))
+ else if (nm_setting_ip_config_get_ignore_auto_routes (setting))
nm_ip4_config_set_never_default (config, FALSE);
- for (i = 0; i < naddresses; i++) {
- guint32 gateway = nm_ip4_address_get_gateway (nm_setting_ip4_config_get_address (setting, i));
+ if (nm_setting_ip_config_get_gateway (setting)) {
+ guint32 gateway;
- if (gateway) {
- nm_ip4_config_set_gateway (config, gateway);
- break;
- }
+ inet_pton (AF_INET, nm_setting_ip_config_get_gateway (setting), &gateway);
+ nm_ip4_config_set_gateway (config, gateway);
}
/* Addresses */
for (i = 0; i < naddresses; i++) {
- NMIP4Address *s_addr = nm_setting_ip4_config_get_address (setting, i);
- const char *label = _nm_setting_ip4_config_get_address_label (setting, i);
+ NMIPAddress *s_addr = nm_setting_ip_config_get_address (setting, i);
+ GVariant *label;
NMPlatformIP4Address address;
memset (&address, 0, sizeof (address));
- address.address = nm_ip4_address_get_address (s_addr);
- address.plen = nm_ip4_address_get_prefix (s_addr);
+ nm_ip_address_get_address_binary (s_addr, &address.address);
+ address.plen = nm_ip_address_get_prefix (s_addr);
address.lifetime = NM_PLATFORM_LIFETIME_PERMANENT;
address.preferred = NM_PLATFORM_LIFETIME_PERMANENT;
address.source = NM_IP_CONFIG_SOURCE_USER;
- g_strlcpy (address.label, label, sizeof (address.label));
+
+ label = nm_ip_address_get_attribute (s_addr, "label");
+ if (label)
+ g_strlcpy (address.label, g_variant_get_string (label, NULL), sizeof (address.label));
nm_ip4_config_add_address (config, &address);
}
/* Routes */
- if (nm_setting_ip4_config_get_ignore_auto_routes (setting))
+ if (nm_setting_ip_config_get_ignore_auto_routes (setting))
nm_ip4_config_reset_routes (config);
for (i = 0; i < nroutes; i++) {
- NMIP4Route *s_route = nm_setting_ip4_config_get_route (setting, i);
+ NMIPRoute *s_route = nm_setting_ip_config_get_route (setting, i);
NMPlatformIP4Route route;
memset (&route, 0, sizeof (route));
- route.network = nm_ip4_route_get_dest (s_route);
- route.plen = nm_ip4_route_get_prefix (s_route);
- route.gateway = nm_ip4_route_get_next_hop (s_route);
- route.metric = nm_ip4_route_get_metric (s_route);
- if (!route.metric)
+ nm_ip_route_get_dest_binary (s_route, &route.network);
+ route.plen = nm_ip_route_get_prefix (s_route);
+ nm_ip_route_get_next_hop_binary (s_route, &route.gateway);
+ if (nm_ip_route_get_metric (s_route) == -1)
route.metric = default_route_metric;
+ else
+ route.metric = nm_ip_route_get_metric (s_route);
route.source = NM_IP_CONFIG_SOURCE_USER;
+ g_assert (route.plen > 0);
+
nm_ip4_config_add_route (config, &route);
}
/* DNS */
- if (nm_setting_ip4_config_get_ignore_auto_dns (setting)) {
+ if (nm_setting_ip_config_get_ignore_auto_dns (setting)) {
nm_ip4_config_reset_nameservers (config);
nm_ip4_config_reset_domains (config);
nm_ip4_config_reset_searches (config);
@@ -370,11 +382,11 @@ nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIP4Config *setting, i
for (i = 0; i < nnameservers; i++) {
guint32 ip;
- if (inet_pton (AF_INET, nm_setting_ip4_config_get_dns (setting, i), &ip) == 1)
+ if (inet_pton (AF_INET, nm_setting_ip_config_get_dns (setting, i), &ip) == 1)
nm_ip4_config_add_nameserver (config, ip);
}
for (i = 0; i < nsearches; i++)
- nm_ip4_config_add_search (config, nm_setting_ip4_config_get_dns_search (setting, i));
+ nm_ip4_config_add_search (config, nm_setting_ip_config_get_dns_search (setting, i));
g_object_thaw_notify (G_OBJECT (config));
}
@@ -382,17 +394,17 @@ nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIP4Config *setting, i
NMSetting *
nm_ip4_config_create_setting (const NMIP4Config *config)
{
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
guint32 gateway;
guint naddresses, nroutes, nnameservers, nsearches;
const char *method = NULL;
int i;
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
if (!config) {
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
NULL);
return NM_SETTING (s_ip4);
}
@@ -406,7 +418,7 @@ nm_ip4_config_create_setting (const NMIP4Config *config)
/* Addresses */
for (i = 0; i < naddresses; i++) {
const NMPlatformIP4Address *address = nm_ip4_config_get_address (config, i);
- NMIP4Address *s_addr;
+ NMIPAddress *s_addr;
/* Detect dynamic address */
if (address->lifetime != NM_PLATFORM_LIFETIME_PERMANENT) {
@@ -418,29 +430,31 @@ nm_ip4_config_create_setting (const NMIP4Config *config)
if (!method)
method = NM_SETTING_IP4_CONFIG_METHOD_MANUAL;
- s_addr = nm_ip4_address_new ();
+ s_addr = nm_ip_address_new_binary (AF_INET, &address->address, address->plen, NULL);
+ if (*address->label)
+ nm_ip_address_set_attribute (s_addr, "label", g_variant_new_string (address->label));
- nm_ip4_address_set_address (s_addr, address->address);
- nm_ip4_address_set_prefix (s_addr, address->plen);
- /* For backwards compatibility, attach the gateway to an address if it's
- * in the same subnet.
- */
- if (same_prefix (address->address, gateway, address->plen))
- nm_ip4_address_set_gateway (s_addr, gateway);
+ nm_setting_ip_config_add_address (s_ip4, s_addr);
+ nm_ip_address_unref (s_addr);
+ }
- _nm_setting_ip4_config_add_address_with_label (s_ip4, s_addr, address->label);
- nm_ip4_address_unref (s_addr);
+ /* Gateway */
+ if ( gateway
+ && nm_setting_ip_config_get_num_addresses (s_ip4) > 0) {
+ g_object_set (s_ip4,
+ NM_SETTING_IP_CONFIG_GATEWAY, nm_utils_inet4_ntop (gateway, NULL),
+ NULL);
}
/* Use 'disabled' if the method wasn't previously set */
if (!method)
method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, method, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, method, NULL);
/* Routes */
for (i = 0; i < nroutes; i++) {
const NMPlatformIP4Route *route = nm_ip4_config_get_route (config, i);
- NMIP4Route *s_route;
+ NMIPRoute *s_route;
/* Ignore default route. */
if (!route->plen)
@@ -450,26 +464,24 @@ nm_ip4_config_create_setting (const NMIP4Config *config)
if (route->source != NM_IP_CONFIG_SOURCE_USER)
continue;
- s_route = nm_ip4_route_new ();
- nm_ip4_route_set_dest (s_route, route->network);
- nm_ip4_route_set_prefix (s_route, route->plen);
- nm_ip4_route_set_next_hop (s_route, route->gateway);
- nm_ip4_route_set_metric (s_route, route->metric);
-
- nm_setting_ip4_config_add_route (s_ip4, s_route);
- nm_ip4_route_unref (s_route);
+ s_route = nm_ip_route_new_binary (AF_INET,
+ &route->network, route->plen,
+ &route->gateway, route->metric,
+ NULL);
+ nm_setting_ip_config_add_route (s_ip4, s_route);
+ nm_ip_route_unref (s_route);
}
/* DNS */
for (i = 0; i < nnameservers; i++) {
guint32 nameserver = nm_ip4_config_get_nameserver (config, i);
- nm_setting_ip4_config_add_dns (s_ip4, nm_utils_inet4_ntop (nameserver, NULL));
+ nm_setting_ip_config_add_dns (s_ip4, nm_utils_inet4_ntop (nameserver, NULL));
}
for (i = 0; i < nsearches; i++) {
const char *search = nm_ip4_config_get_search (config, i);
- nm_setting_ip4_config_add_dns_search (s_ip4, search);
+ nm_setting_ip_config_add_dns_search (s_ip4, search);
}
return NM_SETTING (s_ip4);
@@ -534,6 +546,117 @@ nm_ip4_config_merge (NMIP4Config *dst, const NMIP4Config *src)
g_object_thaw_notify (G_OBJECT (dst));
}
+/*******************************************************************************/
+
+static int
+_addresses_get_index (const NMIP4Config *self, const NMPlatformIP4Address *addr)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->addresses->len; i++) {
+ const NMPlatformIP4Address *a = &g_array_index (priv->addresses, NMPlatformIP4Address, i);
+
+ if (addr->address == a->address &&
+ addr->plen == a->plen)
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_nameservers_get_index (const NMIP4Config *self, guint32 ns)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->nameservers->len; i++) {
+ guint32 n = g_array_index (priv->nameservers, guint32, i);
+
+ if (ns == n)
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_routes_get_index (const NMIP4Config *self, const NMPlatformIP4Route *route)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->routes->len; i++) {
+ const NMPlatformIP4Route *r = &g_array_index (priv->routes, NMPlatformIP4Route, i);
+
+ if ( route->network == r->network
+ && route->plen == r->plen)
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_domains_get_index (const NMIP4Config *self, const char *domain)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->domains->len; i++) {
+ const char *d = g_ptr_array_index (priv->domains, i);
+
+ if (g_strcmp0 (domain, d) == 0)
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_searches_get_index (const NMIP4Config *self, const char *search)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->searches->len; i++) {
+ const char *s = g_ptr_array_index (priv->searches, i);
+
+ if (g_strcmp0 (search, s) == 0)
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_nis_servers_get_index (const NMIP4Config *self, guint32 nis_server)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->nis->len; i++) {
+ guint32 n = g_array_index (priv->nis, guint32, i);
+
+ if (n == nis_server)
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_wins_get_index (const NMIP4Config *self, guint32 wins_server)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->wins->len; i++) {
+ guint32 n = g_array_index (priv->wins, guint32, i);
+
+ if (n == wins_server)
+ return (int) i;
+ }
+ return -1;
+}
+
+/*******************************************************************************/
+
/**
* nm_ip4_config_subtract:
* @dst: config from which to remove everything in @src
@@ -544,7 +667,8 @@ nm_ip4_config_merge (NMIP4Config *dst, const NMIP4Config *src)
void
nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src)
{
- guint32 i, j;
+ guint32 i;
+ gint idx;
g_return_if_fail (src != NULL);
g_return_if_fail (dst != NULL);
@@ -553,77 +677,44 @@ nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src)
/* addresses */
for (i = 0; i < nm_ip4_config_get_num_addresses (src); i++) {
- const NMPlatformIP4Address *src_addr = nm_ip4_config_get_address (src, i);
-
- for (j = 0; j < nm_ip4_config_get_num_addresses (dst); j++) {
- const NMPlatformIP4Address *dst_addr = nm_ip4_config_get_address (dst, j);
-
- if (src_addr->address == dst_addr->address &&
- src_addr->plen == dst_addr->plen) {
- nm_ip4_config_del_address (dst, j);
- break;
- }
- }
+ idx = _addresses_get_index (dst, nm_ip4_config_get_address (src, i));
+ if (idx >= 0)
+ nm_ip4_config_del_address (dst, idx);
}
/* nameservers */
for (i = 0; i < nm_ip4_config_get_num_nameservers (src); i++) {
- guint32 src_ns = nm_ip4_config_get_nameserver (src, i);
-
- for (j = 0; j < nm_ip4_config_get_num_nameservers (dst); j++) {
- guint32 dst_ns = nm_ip4_config_get_nameserver (dst, j);
-
- if (dst_ns == src_ns) {
- nm_ip4_config_del_nameserver (dst, j);
- break;
- }
- }
+ idx = _nameservers_get_index (dst, nm_ip4_config_get_nameserver (src, i));
+ if (idx >= 0)
+ nm_ip4_config_del_nameserver (dst, idx);
}
/* default gateway */
if (nm_ip4_config_get_gateway (src) == nm_ip4_config_get_gateway (dst))
nm_ip4_config_set_gateway (dst, 0);
+ if (!nm_ip4_config_get_num_addresses (dst))
+ nm_ip4_config_set_gateway (dst, 0);
+
/* routes */
for (i = 0; i < nm_ip4_config_get_num_routes (src); i++) {
- const NMPlatformIP4Route *src_route = nm_ip4_config_get_route (src, i);
-
- for (j = 0; j < nm_ip4_config_get_num_routes (dst); j++) {
- const NMPlatformIP4Route *dst_route = nm_ip4_config_get_route (dst, j);
-
- if (src_route->network == dst_route->network && src_route->plen == dst_route->plen) {
- nm_ip4_config_del_route (dst, j);
- break;
- }
- }
+ idx = _routes_get_index (dst, nm_ip4_config_get_route (src, i));
+ if (idx >= 0)
+ nm_ip4_config_del_route (dst, idx);
}
/* domains */
for (i = 0; i < nm_ip4_config_get_num_domains (src); i++) {
- const char *src_domain = nm_ip4_config_get_domain (src, i);
-
- for (j = 0; j < nm_ip4_config_get_num_domains (dst); j++) {
- const char *dst_domain = nm_ip4_config_get_domain (dst, j);
-
- if (g_strcmp0 (src_domain, dst_domain) == 0) {
- nm_ip4_config_del_domain (dst, j);
- break;
- }
- }
+ idx = _domains_get_index (dst, nm_ip4_config_get_domain (src, i));
+ if (idx >= 0)
+ nm_ip4_config_del_domain (dst, idx);
}
/* dns searches */
for (i = 0; i < nm_ip4_config_get_num_searches (src); i++) {
- const char *src_search = nm_ip4_config_get_search (src, i);
-
- for (j = 0; j < nm_ip4_config_get_num_searches (dst); j++) {
- const char *dst_search = nm_ip4_config_get_search (dst, j);
-
- if (g_strcmp0 (src_search, dst_search) == 0) {
- nm_ip4_config_del_search (dst, j);
- break;
- }
- }
+ idx = _searches_get_index (dst, nm_ip4_config_get_search (src, i));
+ if (idx >= 0)
+ nm_ip4_config_del_search (dst, idx);
}
/* MSS */
@@ -636,16 +727,9 @@ nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src)
/* NIS */
for (i = 0; i < nm_ip4_config_get_num_nis_servers (src); i++) {
- guint32 src_nis = nm_ip4_config_get_nis_server (src, i);
-
- for (j = 0; j < nm_ip4_config_get_num_nis_servers (dst); j++) {
- guint32 dst_nis = nm_ip4_config_get_nis_server (dst, j);
-
- if (dst_nis == src_nis) {
- nm_ip4_config_del_nis_server (dst, j);
- break;
- }
- }
+ idx = _nis_servers_get_index (dst, nm_ip4_config_get_nis_server (src, i));
+ if (idx >= 0)
+ nm_ip4_config_del_nis_server (dst, idx);
}
if (g_strcmp0 (nm_ip4_config_get_nis_domain (src), nm_ip4_config_get_nis_domain (dst)) == 0)
@@ -653,18 +737,55 @@ nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src)
/* WINS */
for (i = 0; i < nm_ip4_config_get_num_wins (src); i++) {
- guint32 src_wins = nm_ip4_config_get_wins (src, i);
+ idx = _wins_get_index (dst, nm_ip4_config_get_wins (src, i));
+ if (idx >= 0)
+ nm_ip4_config_del_wins (dst, idx);
+ }
- for (j = 0; j < nm_ip4_config_get_num_wins (dst); j++) {
- guint32 dst_wins = nm_ip4_config_get_wins (dst, j);
+ g_object_thaw_notify (G_OBJECT (dst));
+}
- if (dst_wins == src_wins) {
- nm_ip4_config_del_wins (dst, j);
- break;
- }
- }
+void
+nm_ip4_config_intersect (NMIP4Config *dst, const NMIP4Config *src)
+{
+ guint32 i;
+ gint idx;
+
+ g_return_if_fail (src != NULL);
+ g_return_if_fail (dst != NULL);
+
+ g_object_freeze_notify (G_OBJECT (dst));
+
+ /* addresses */
+ for (i = 0; i < nm_ip4_config_get_num_addresses (dst); ) {
+ idx = _addresses_get_index (src, nm_ip4_config_get_address (dst, i));
+ if (idx < 0)
+ nm_ip4_config_del_address (dst, i);
+ else
+ i++;
+ }
+
+ /* ignore nameservers */
+
+ /* default gateway */
+ if ( !nm_ip4_config_get_num_addresses (dst)
+ || (nm_ip4_config_get_gateway (src) != nm_ip4_config_get_gateway (dst)))
+ nm_ip4_config_set_gateway (dst, 0);
+
+ /* routes */
+ for (i = 0; i < nm_ip4_config_get_num_routes (dst); ) {
+ idx = _routes_get_index (src, nm_ip4_config_get_route (dst, i));
+ if (idx < 0)
+ nm_ip4_config_del_route (dst, i);
+ else
+ i++;
}
+ /* ignore domains */
+ /* ignore dns searches */
+ /* ignore NIS */
+ /* ignore WINS */
+
g_object_thaw_notify (G_OBJECT (dst));
}
@@ -708,6 +829,12 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev
g_object_freeze_notify (G_OBJECT (dst));
+ /* ifindex */
+ if (src_priv->ifindex != dst_priv->ifindex) {
+ dst_priv->ifindex = src_priv->ifindex;
+ has_minor_changes = TRUE;
+ }
+
/* never_default */
if (src_priv->never_default != dst_priv->never_default) {
dst_priv->never_default = src_priv->never_default;
@@ -928,8 +1055,8 @@ nm_ip4_config_dump (const NMIP4Config *config, const char *detail)
for (i = 0; i < nm_ip4_config_get_num_searches (config); i++)
g_message (" search: %s", nm_ip4_config_get_search (config, i));
- g_message (" mss: %u", nm_ip4_config_get_mss (config));
- g_message (" mtu: %u", nm_ip4_config_get_mtu (config));
+ g_message (" mss: %"G_GUINT32_FORMAT, nm_ip4_config_get_mss (config));
+ g_message (" mtu: %"G_GUINT32_FORMAT, nm_ip4_config_get_mtu (config));
/* NIS */
for (i = 0; i < nm_ip4_config_get_num_nis_servers (config); i++) {
@@ -937,7 +1064,7 @@ nm_ip4_config_dump (const NMIP4Config *config, const char *detail)
g_message (" nis: %s", nm_utils_inet4_ntop (tmp, NULL));
}
- g_message (" nisdmn: %s", nm_ip4_config_get_nis_domain (config));
+ g_message (" nisdmn: %s", str_if_set (nm_ip4_config_get_nis_domain (config), "(none)"));
/* WINS */
for (i = 0; i < nm_ip4_config_get_num_wins (config); i++) {
@@ -1010,6 +1137,7 @@ nm_ip4_config_reset_addresses (NMIP4Config *config)
if (priv->addresses->len != 0) {
g_array_set_size (priv->addresses, 0);
+ _NOTIFY (config, PROP_ADDRESS_DATA);
_NOTIFY (config, PROP_ADDRESSES);
}
}
@@ -1067,6 +1195,7 @@ nm_ip4_config_add_address (NMIP4Config *config, const NMPlatformIP4Address *new)
g_array_append_val (priv->addresses, *new);
NOTIFY:
+ _NOTIFY (config, PROP_ADDRESS_DATA);
_NOTIFY (config, PROP_ADDRESSES);
}
@@ -1078,6 +1207,7 @@ nm_ip4_config_del_address (NMIP4Config *config, guint i)
g_return_if_fail (i < priv->addresses->len);
g_array_remove_index (priv->addresses, i);
+ _NOTIFY (config, PROP_ADDRESS_DATA);
_NOTIFY (config, PROP_ADDRESSES);
}
@@ -1122,6 +1252,7 @@ nm_ip4_config_reset_routes (NMIP4Config *config)
if (priv->routes->len != 0) {
g_array_set_size (priv->routes, 0);
+ _NOTIFY (config, PROP_ROUTE_DATA);
_NOTIFY (config, PROP_ROUTES);
}
}
@@ -1144,6 +1275,8 @@ nm_ip4_config_add_route (NMIP4Config *config, const NMPlatformIP4Route *new)
int i;
g_return_if_fail (new != NULL);
+ g_return_if_fail (new->plen > 0);
+ g_assert (priv->ifindex);
for (i = 0; i < priv->routes->len; i++ ) {
NMPlatformIP4Route *item = &g_array_index (priv->routes, NMPlatformIP4Route, i);
@@ -1160,7 +1293,9 @@ nm_ip4_config_add_route (NMIP4Config *config, const NMPlatformIP4Route *new)
}
g_array_append_val (priv->routes, *new);
+ g_array_index (priv->routes, NMPlatformIP4Route, priv->routes->len - 1).ifindex = priv->ifindex;
NOTIFY:
+ _NOTIFY (config, PROP_ROUTE_DATA);
_NOTIFY (config, PROP_ROUTES);
}
@@ -1172,6 +1307,7 @@ nm_ip4_config_del_route (NMIP4Config *config, guint i)
g_return_if_fail (i < priv->routes->len);
g_array_remove_index (priv->routes, i);
+ _NOTIFY (config, PROP_ROUTE_DATA);
_NOTIFY (config, PROP_ROUTES);
}
@@ -1195,12 +1331,12 @@ const NMPlatformIP4Route *
nm_ip4_config_get_direct_route_for_host (const NMIP4Config *config, guint32 host)
{
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
- int i;
+ guint i;
NMPlatformIP4Route *best_route = NULL;
g_return_val_if_fail (host, NULL);
- for (i = 0; i < priv->routes->len; i++ ) {
+ for (i = 0; i < priv->routes->len; i++) {
NMPlatformIP4Route *item = &g_array_index (priv->routes, NMPlatformIP4Route, i);
if (item->gateway != 0)
@@ -1221,6 +1357,28 @@ nm_ip4_config_get_direct_route_for_host (const NMIP4Config *config, guint32 host
return best_route;
}
+const NMPlatformIP4Address *
+nm_ip4_config_get_subnet_for_host (const NMIP4Config *config, guint32 host)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
+ guint i;
+ NMPlatformIP4Address *subnet = NULL;
+
+ g_return_val_if_fail (host, NULL);
+
+ for (i = 0; i < priv->addresses->len; i++) {
+ NMPlatformIP4Address *item = &g_array_index (priv->addresses, NMPlatformIP4Address, i);
+
+ if (subnet && subnet->plen >= item->plen)
+ continue;
+ if (nm_utils_ip4_address_clear_host_address (host, item->plen) != nm_utils_ip4_address_clear_host_address (item->address, item->plen))
+ continue;
+ subnet = item;
+ }
+
+ return subnet;
+}
+
/******************************************************************/
void
@@ -1682,6 +1840,8 @@ finalize (GObject *object)
{
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
+ g_free (priv->path);
+
g_array_unref (priv->addresses);
g_array_unref (priv->routes);
g_array_unref (priv->nameservers);
@@ -1695,6 +1855,15 @@ finalize (GObject *object)
}
static void
+gvalue_destroy (gpointer data)
+{
+ GValue *value = (GValue *) data;
+
+ g_value_unset (value);
+ g_slice_free (GValue, value);
+}
+
+static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
@@ -1702,11 +1871,44 @@ get_property (GObject *object, guint prop_id,
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
switch (prop_id) {
- case PROP_GATEWAY:
- if (priv->gateway)
- g_value_set_string (value, nm_utils_inet4_ntop (priv->gateway, NULL));
- else
- g_value_set_string (value, NULL);
+ case PROP_IFINDEX:
+ g_value_set_int (value, priv->ifindex);
+ break;
+ case PROP_ADDRESS_DATA:
+ {
+ GPtrArray *addresses = g_ptr_array_new ();
+ int naddr = nm_ip4_config_get_num_addresses (config);
+ int i;
+
+ for (i = 0; i < naddr; i++) {
+ const NMPlatformIP4Address *address = nm_ip4_config_get_address (config, i);
+ GHashTable *addr_hash;
+ GValue *val;
+
+ addr_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gvalue_destroy);
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_STRING);
+ g_value_set_string (val, nm_utils_inet4_ntop (address->address, NULL));
+ g_hash_table_insert (addr_hash, "address", val);
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_UINT);
+ g_value_set_uint (val, address->plen);
+ g_hash_table_insert (addr_hash, "prefix", val);
+
+ if (*address->label) {
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_STRING);
+ g_value_set_string (val, address->label);
+ g_hash_table_insert (addr_hash, "label", val);
+ }
+
+ g_ptr_array_add (addresses, addr_hash);
+ }
+
+ g_value_take_boxed (value, addresses);
+ }
break;
case PROP_ADDRESSES:
{
@@ -1717,10 +1919,11 @@ get_property (GObject *object, guint prop_id,
for (i = 0; i < naddr; i++) {
const NMPlatformIP4Address *address = nm_ip4_config_get_address (config, i);
GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3);
+ guint32 gateway = i == 0 ? priv->gateway : 0;
g_array_append_val (array, address->address);
g_array_append_val (array, address->plen);
- g_array_append_val (array, priv->gateway);
+ g_array_append_val (array, gateway);
g_ptr_array_add (addresses, array);
}
@@ -1728,6 +1931,47 @@ get_property (GObject *object, guint prop_id,
g_value_take_boxed (value, addresses);
}
break;
+ case PROP_ROUTE_DATA:
+ {
+ GPtrArray *routes = g_ptr_array_new ();
+ guint nroutes = nm_ip4_config_get_num_routes (config);
+ int i;
+
+ for (i = 0; i < nroutes; i++) {
+ const NMPlatformIP4Route *route = nm_ip4_config_get_route (config, i);
+ GHashTable *route_hash;
+ GValue *val;
+
+ route_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gvalue_destroy);
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_STRING);
+ g_value_set_string (val, nm_utils_inet4_ntop (route->network, NULL));
+ g_hash_table_insert (route_hash, "dest", val);
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_UINT);
+ g_value_set_uint (val, route->plen);
+ g_hash_table_insert (route_hash, "prefix", val);
+
+ if (route->gateway) {
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_STRING);
+ g_value_set_string (val, nm_utils_inet4_ntop (route->gateway, NULL));
+ g_hash_table_insert (route_hash, "next-hop", val);
+ }
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_UINT);
+ g_value_set_uint (val, route->metric);
+ g_hash_table_insert (route_hash, "metric", val);
+
+ g_ptr_array_add (routes, route_hash);
+ }
+
+ g_value_take_boxed (value, routes);
+ }
+ break;
case PROP_ROUTES:
{
GPtrArray *routes = g_ptr_array_new ();
@@ -1736,8 +1980,14 @@ get_property (GObject *object, guint prop_id,
for (i = 0; i < nroutes; i++) {
const NMPlatformIP4Route *route = nm_ip4_config_get_route (config, i);
- GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 4);
+ GArray *array;
+ /* legacy versions of nm_ip4_route_set_prefix() in libnm-util assert that the
+ * plen is positive. Skip the default routes not to break older clients. */
+ if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
+ continue;
+
+ array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 4);
g_array_append_val (array, route->network);
g_array_append_val (array, route->plen);
g_array_append_val (array, route->gateway);
@@ -1749,6 +1999,12 @@ get_property (GObject *object, guint prop_id,
g_value_take_boxed (value, routes);
}
break;
+ case PROP_GATEWAY:
+ if (priv->gateway)
+ g_value_set_string (value, nm_utils_inet4_ntop (priv->gateway, NULL));
+ else
+ g_value_set_string (value, NULL);
+ break;
case PROP_NAMESERVERS:
g_value_set_boxed (value, priv->nameservers);
break;
@@ -1768,6 +2024,24 @@ get_property (GObject *object, guint prop_id,
}
static void
+set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_IFINDEX:
+ priv->ifindex = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
nm_ip4_config_class_init (NMIP4ConfigClass *config_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (config_class);
@@ -1775,21 +2049,38 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class)
g_type_class_add_private (config_class, sizeof (NMIP4ConfigPrivate));
object_class->get_property = get_property;
+ object_class->set_property = set_property;
object_class->finalize = finalize;
- obj_properties[PROP_GATEWAY] =
- g_param_spec_string (NM_IP4_CONFIG_GATEWAY, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_IFINDEX] =
+ g_param_spec_int (NM_IP4_CONFIG_IFINDEX, "", "",
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_ADDRESS_DATA] =
+ g_param_spec_boxed (NM_IP4_CONFIG_ADDRESS_DATA, "", "",
+ DBUS_TYPE_NM_IP_ADDRESSES,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS);
obj_properties[PROP_ADDRESSES] =
- g_param_spec_boxed (NM_IP4_CONFIG_ADDRESSES, "", "",
- DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT,
+ g_param_spec_boxed (NM_IP4_CONFIG_ADDRESSES, "", "",
+ DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_ROUTE_DATA] =
+ g_param_spec_boxed (NM_IP4_CONFIG_ROUTE_DATA, "", "",
+ DBUS_TYPE_NM_IP_ROUTES,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
obj_properties[PROP_ROUTES] =
- g_param_spec_boxed (NM_IP4_CONFIG_ROUTES, "", "",
- DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT,
+ g_param_spec_boxed (NM_IP4_CONFIG_ROUTES, "", "",
+ DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_GATEWAY] =
+ g_param_spec_string (NM_IP4_CONFIG_GATEWAY, "", "",
+ NULL,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
obj_properties[PROP_NAMESERVERS] =
diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h
index 16372be5cd..3e551950d3 100644
--- a/src/nm-ip4-config.h
+++ b/src/nm-ip4-config.h
@@ -41,18 +41,25 @@ typedef struct {
GObjectClass parent;
} NMIP4ConfigClass;
+#define NM_IP4_CONFIG_IFINDEX "ifindex"
+#define NM_IP4_CONFIG_ADDRESS_DATA "address-data"
+#define NM_IP4_CONFIG_ROUTE_DATA "route-data"
#define NM_IP4_CONFIG_GATEWAY "gateway"
-#define NM_IP4_CONFIG_ADDRESSES "addresses"
-#define NM_IP4_CONFIG_ROUTES "routes"
#define NM_IP4_CONFIG_NAMESERVERS "nameservers"
#define NM_IP4_CONFIG_DOMAINS "domains"
#define NM_IP4_CONFIG_SEARCHES "searches"
#define NM_IP4_CONFIG_WINS_SERVERS "wins-servers"
+/* deprecated */
+#define NM_IP4_CONFIG_ADDRESSES "addresses"
+#define NM_IP4_CONFIG_ROUTES "routes"
+
GType nm_ip4_config_get_type (void);
-NMIP4Config * nm_ip4_config_new (void);
+NMIP4Config * nm_ip4_config_new (int ifindex);
+
+int nm_ip4_config_get_ifindex (const NMIP4Config *config);
/* D-Bus integration */
void nm_ip4_config_export (NMIP4Config *config);
@@ -60,13 +67,14 @@ const char * nm_ip4_config_get_dbus_path (const NMIP4Config *config);
/* Integration with nm-platform and nm-setting */
NMIP4Config *nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf);
-gboolean nm_ip4_config_commit (const NMIP4Config *config, int ifindex);
-void nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIP4Config *setting, int default_route_metric);
+gboolean nm_ip4_config_commit (const NMIP4Config *config, int ifindex, guint32 default_route_metric);
+void nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIPConfig *setting, guint32 default_route_metric);
NMSetting *nm_ip4_config_create_setting (const NMIP4Config *config);
/* Utility functions */
void nm_ip4_config_merge (NMIP4Config *dst, const NMIP4Config *src);
void nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src);
+void nm_ip4_config_intersect (NMIP4Config *dst, const NMIP4Config *src);
gboolean nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relevant_changes);
gboolean nm_ip4_config_destination_is_direct (const NMIP4Config *config, guint32 dest, int plen);
void nm_ip4_config_dump (const NMIP4Config *config, const char *detail);
@@ -93,6 +101,7 @@ guint32 nm_ip4_config_get_num_routes (const NMIP4Config *config);
const NMPlatformIP4Route *nm_ip4_config_get_route (const NMIP4Config *config, guint32 i);
const NMPlatformIP4Route *nm_ip4_config_get_direct_route_for_host (const NMIP4Config *config, guint32 host);
+const NMPlatformIP4Address *nm_ip4_config_get_subnet_for_host (const NMIP4Config *config, guint32 host);
/* Nameservers */
void nm_ip4_config_reset_nameservers (NMIP4Config *config);
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
index d18b35c6a3..4df7e2996f 100644
--- a/src/nm-ip6-config.c
+++ b/src/nm-ip6-config.c
@@ -19,15 +19,20 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
+#include <arpa/inet.h>
#include "nm-ip6-config.h"
#include "nm-glib-compat.h"
#include "nm-utils.h"
+#include "nm-platform.h"
#include "nm-dbus-manager.h"
#include "nm-dbus-glib-types.h"
#include "nm-ip6-config-glue.h"
+#include "nm-route-manager.h"
#include "NetworkManagerUtils.h"
G_DEFINE_TYPE (NMIP6Config, nm_ip6_config, G_TYPE_OBJECT)
@@ -45,14 +50,18 @@ typedef struct {
GPtrArray *domains;
GPtrArray *searches;
guint32 mss;
+ int ifindex;
} NMIP6ConfigPrivate;
enum {
PROP_0,
- PROP_GATEWAY,
+ PROP_IFINDEX,
+ PROP_ADDRESS_DATA,
PROP_ADDRESSES,
+ PROP_ROUTE_DATA,
PROP_ROUTES,
+ PROP_GATEWAY,
PROP_NAMESERVERS,
PROP_DOMAINS,
PROP_SEARCHES,
@@ -64,9 +73,12 @@ static GParamSpec *obj_properties[LAST_PROP] = { NULL, };
NMIP6Config *
-nm_ip6_config_new (void)
+nm_ip6_config_new (int ifindex)
{
- return (NMIP6Config *) g_object_new (NM_TYPE_IP6_CONFIG, NULL);
+ g_return_val_if_fail (ifindex >= -1, NULL);
+ return (NMIP6Config *) g_object_new (NM_TYPE_IP6_CONFIG,
+ NM_IP6_CONFIG_IFINDEX, ifindex,
+ NULL);
}
void
@@ -89,6 +101,12 @@ nm_ip6_config_get_dbus_path (const NMIP6Config *config)
return priv->path;
}
+int
+nm_ip6_config_get_ifindex (const NMIP6Config *config)
+{
+ return NM_IP6_CONFIG_GET_PRIVATE (config)->ifindex;
+}
+
/******************************************************************/
static gboolean
@@ -167,7 +185,9 @@ static gboolean
routes_are_duplicate (const NMPlatformIP6Route *a, const NMPlatformIP6Route *b, gboolean consider_gateway_and_metric)
{
return IN6_ARE_ADDR_EQUAL (&a->network, &b->network) && a->plen == b->plen &&
- (!consider_gateway_and_metric || (IN6_ARE_ADDR_EQUAL (&a->gateway, &b->gateway) && a->metric == b->metric));
+ ( !consider_gateway_and_metric
+ || ( IN6_ARE_ADDR_EQUAL (&a->gateway, &b->gateway)
+ && nm_utils_ip6_route_metric_normalize (a->metric) == nm_utils_ip6_route_metric_normalize (b->metric)));
}
static gint
@@ -270,6 +290,7 @@ nm_ip6_config_addresses_sort (NMIP6Config *self, NMSettingIP6ConfigPrivacy use_t
g_free (data_pre);
if (changed) {
+ _NOTIFY (self, PROP_ADDRESS_DATA);
_NOTIFY (self, PROP_ADDRESSES);
return TRUE;
}
@@ -283,7 +304,7 @@ nm_ip6_config_capture (int ifindex, gboolean capture_resolv_conf, NMSettingIP6Co
NMIP6Config *config;
NMIP6ConfigPrivate *priv;
guint i;
- guint lowest_metric = G_MAXUINT;
+ guint32 lowest_metric = G_MAXUINT32;
struct in6_addr old_gateway = IN6ADDR_ANY_INIT;
gboolean has_gateway = FALSE;
gboolean notify_nameservers = FALSE;
@@ -292,14 +313,14 @@ nm_ip6_config_capture (int ifindex, gboolean capture_resolv_conf, NMSettingIP6Co
if (nm_platform_link_get_master (ifindex) > 0)
return NULL;
- config = nm_ip6_config_new ();
+ config = nm_ip6_config_new (ifindex);
priv = NM_IP6_CONFIG_GET_PRIVATE (config);
g_array_unref (priv->addresses);
g_array_unref (priv->routes);
priv->addresses = nm_platform_ip6_address_get_all (ifindex);
- priv->routes = nm_platform_ip6_route_get_all (ifindex, TRUE);
+ priv->routes = nm_platform_ip6_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
/* Extract gateway from default route */
old_gateway = priv->gateway;
@@ -345,7 +366,9 @@ nm_ip6_config_capture (int ifindex, gboolean capture_resolv_conf, NMSettingIP6Co
/* actually, nobody should be connected to the signal, just to be sure, notify */
if (notify_nameservers)
_NOTIFY (config, PROP_NAMESERVERS);
+ _NOTIFY (config, PROP_ADDRESS_DATA);
_NOTIFY (config, PROP_ADDRESSES);
+ _NOTIFY (config, PROP_ROUTE_DATA);
_NOTIFY (config, PROP_ROUTES);
if (!IN6_ARE_ADDR_EQUAL (&priv->gateway, &old_gateway))
_NOTIFY (config, PROP_GATEWAY);
@@ -364,7 +387,7 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
g_return_val_if_fail (config != NULL, FALSE);
/* Addresses */
- nm_platform_ip6_address_sync (ifindex, priv->addresses);
+ nm_platform_ip6_address_sync (ifindex, priv->addresses, TRUE);
/* Routes */
{
@@ -382,17 +405,10 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
&& nm_ip6_config_destination_is_direct (config, &route->network, route->plen))
continue;
- /* Don't add the default route if the connection
- * is never supposed to be the default connection.
- */
- if ( nm_ip6_config_get_never_default (config)
- && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
- continue;
-
g_array_append_vals (routes, route, 1);
}
- success = nm_platform_ip6_route_sync (ifindex, routes);
+ success = nm_route_manager_ip6_route_sync (nm_route_manager_get (), ifindex, routes);
g_array_unref (routes);
}
@@ -400,43 +416,45 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
}
void
-nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIP6Config *setting, int default_route_metric)
+nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIPConfig *setting, guint32 default_route_metric)
{
guint naddresses, nroutes, nnameservers, nsearches;
+ const char *gateway_str;
int i;
if (!setting)
return;
- naddresses = nm_setting_ip6_config_get_num_addresses (setting);
- nroutes = nm_setting_ip6_config_get_num_routes (setting);
- nnameservers = nm_setting_ip6_config_get_num_dns (setting);
- nsearches = nm_setting_ip6_config_get_num_dns_searches (setting);
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ naddresses = nm_setting_ip_config_get_num_addresses (setting);
+ nroutes = nm_setting_ip_config_get_num_routes (setting);
+ nnameservers = nm_setting_ip_config_get_num_dns (setting);
+ nsearches = nm_setting_ip_config_get_num_dns_searches (setting);
g_object_freeze_notify (G_OBJECT (config));
/* Gateway */
- if (nm_setting_ip6_config_get_never_default (setting))
+ if (nm_setting_ip_config_get_never_default (setting))
nm_ip6_config_set_never_default (config, TRUE);
- else if (nm_setting_ip6_config_get_ignore_auto_routes (setting))
+ else if (nm_setting_ip_config_get_ignore_auto_routes (setting))
nm_ip6_config_set_never_default (config, FALSE);
- for (i = 0; i < naddresses; i++) {
- const struct in6_addr *gateway = nm_ip6_address_get_gateway (nm_setting_ip6_config_get_address (setting, i));
+ gateway_str = nm_setting_ip_config_get_gateway (setting);
+ if (gateway_str) {
+ struct in6_addr gateway;
- if (gateway && !IN6_IS_ADDR_UNSPECIFIED (gateway)) {
- nm_ip6_config_set_gateway (config, gateway);
- break;
- }
+ inet_pton (AF_INET6, gateway_str, &gateway);
+ nm_ip6_config_set_gateway (config, &gateway);
}
/* Addresses */
for (i = 0; i < naddresses; i++) {
- NMIP6Address *s_addr = nm_setting_ip6_config_get_address (setting, i);
+ NMIPAddress *s_addr = nm_setting_ip_config_get_address (setting, i);
NMPlatformIP6Address address;
memset (&address, 0, sizeof (address));
- address.address = *nm_ip6_address_get_address (s_addr);
- address.plen = nm_ip6_address_get_prefix (s_addr);
+ nm_ip_address_get_address_binary (s_addr, &address.address);
+ address.plen = nm_ip_address_get_prefix (s_addr);
address.lifetime = NM_PLATFORM_LIFETIME_PERMANENT;
address.preferred = NM_PLATFORM_LIFETIME_PERMANENT;
address.source = NM_IP_CONFIG_SOURCE_USER;
@@ -445,26 +463,29 @@ nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIP6Config *setting, i
}
/* Routes */
- if (nm_setting_ip6_config_get_ignore_auto_routes (setting))
+ if (nm_setting_ip_config_get_ignore_auto_routes (setting))
nm_ip6_config_reset_routes (config);
for (i = 0; i < nroutes; i++) {
- NMIP6Route *s_route = nm_setting_ip6_config_get_route (setting, i);
+ NMIPRoute *s_route = nm_setting_ip_config_get_route (setting, i);
NMPlatformIP6Route route;
memset (&route, 0, sizeof (route));
- route.network = *nm_ip6_route_get_dest (s_route);
- route.plen = nm_ip6_route_get_prefix (s_route);
- route.gateway = *nm_ip6_route_get_next_hop (s_route);
- route.metric = nm_ip6_route_get_metric (s_route);
- if (!route.metric)
+ nm_ip_route_get_dest_binary (s_route, &route.network);
+ route.plen = nm_ip_route_get_prefix (s_route);
+ nm_ip_route_get_next_hop_binary (s_route, &route.gateway);
+ if (nm_ip_route_get_metric (s_route) == -1)
route.metric = default_route_metric;
+ else
+ route.metric = nm_ip_route_get_metric (s_route);
route.source = NM_IP_CONFIG_SOURCE_USER;
+ g_assert (route.plen > 0);
+
nm_ip6_config_add_route (config, &route);
}
/* DNS */
- if (nm_setting_ip6_config_get_ignore_auto_dns (setting)) {
+ if (nm_setting_ip_config_get_ignore_auto_dns (setting)) {
nm_ip6_config_reset_nameservers (config);
nm_ip6_config_reset_domains (config);
nm_ip6_config_reset_searches (config);
@@ -472,11 +493,11 @@ nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIP6Config *setting, i
for (i = 0; i < nnameservers; i++) {
struct in6_addr ip;
- if (inet_pton (AF_INET6, nm_setting_ip6_config_get_dns (setting, i), &ip) == 1)
+ if (inet_pton (AF_INET6, nm_setting_ip_config_get_dns (setting, i), &ip) == 1)
nm_ip6_config_add_nameserver (config, &ip);
}
for (i = 0; i < nsearches; i++)
- nm_ip6_config_add_search (config, nm_setting_ip6_config_get_dns_search (setting, i));
+ nm_ip6_config_add_search (config, nm_setting_ip_config_get_dns_search (setting, i));
g_object_thaw_notify (G_OBJECT (config));
}
@@ -484,17 +505,17 @@ nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIP6Config *setting, i
NMSetting *
nm_ip6_config_create_setting (const NMIP6Config *config)
{
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
const struct in6_addr *gateway;
guint naddresses, nroutes, nnameservers, nsearches;
const char *method = NULL;
int i;
- s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ());
+ s_ip6 = NM_SETTING_IP_CONFIG (nm_setting_ip6_config_new ());
if (!config) {
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
NULL);
return NM_SETTING (s_ip6);
}
@@ -508,7 +529,7 @@ nm_ip6_config_create_setting (const NMIP6Config *config)
/* Addresses */
for (i = 0; i < naddresses; i++) {
const NMPlatformIP6Address *address = nm_ip6_config_get_address (config, i);
- NMIP6Address *s_addr;
+ NMIPAddress *s_addr;
/* Ignore link-local address. */
if (IN6_IS_ADDR_LINKLOCAL (&address->address)) {
@@ -527,26 +548,28 @@ nm_ip6_config_create_setting (const NMIP6Config *config)
if (!method || strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0)
method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
- s_addr = nm_ip6_address_new ();
-
- nm_ip6_address_set_address (s_addr, &address->address);
- nm_ip6_address_set_prefix (s_addr, address->plen);
- if (gateway)
- nm_ip6_address_set_gateway (s_addr, gateway);
+ s_addr = nm_ip_address_new_binary (AF_INET6, &address->address, address->plen, NULL);
+ nm_setting_ip_config_add_address (s_ip6, s_addr);
+ nm_ip_address_unref (s_addr);
+ }
- nm_setting_ip6_config_add_address (s_ip6, s_addr);
- nm_ip6_address_unref (s_addr);
+ /* Gateway */
+ if ( gateway
+ && nm_setting_ip_config_get_num_addresses (s_ip6) > 0) {
+ g_object_set (s_ip6,
+ NM_SETTING_IP_CONFIG_GATEWAY, nm_utils_inet6_ntop (gateway, NULL),
+ NULL);
}
/* Use 'ignore' if the method wasn't previously set */
if (!method)
method = NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
- g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, method, NULL);
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_METHOD, method, NULL);
/* Routes */
for (i = 0; i < nroutes; i++) {
const NMPlatformIP6Route *route = nm_ip6_config_get_route (config, i);
- NMIP6Route *s_route;
+ NMIPRoute *s_route;
/* Ignore link-local route. */
if (IN6_IS_ADDR_LINKLOCAL (&route->network))
@@ -560,26 +583,24 @@ nm_ip6_config_create_setting (const NMIP6Config *config)
if (route->source != NM_IP_CONFIG_SOURCE_USER)
continue;
- s_route = nm_ip6_route_new ();
- nm_ip6_route_set_dest (s_route, &route->network);
- nm_ip6_route_set_prefix (s_route, route->plen);
- nm_ip6_route_set_next_hop (s_route, &route->gateway);
- nm_ip6_route_set_metric (s_route, route->metric);
-
- nm_setting_ip6_config_add_route (s_ip6, s_route);
- nm_ip6_route_unref (s_route);
+ s_route = nm_ip_route_new_binary (AF_INET6,
+ &route->network, route->plen,
+ &route->gateway, route->metric,
+ NULL);
+ nm_setting_ip_config_add_route (s_ip6, s_route);
+ nm_ip_route_unref (s_route);
}
/* DNS */
for (i = 0; i < nnameservers; i++) {
const struct in6_addr *nameserver = nm_ip6_config_get_nameserver (config, i);
- nm_setting_ip6_config_add_dns (s_ip6, nm_utils_inet6_ntop (nameserver, NULL));
+ nm_setting_ip_config_add_dns (s_ip6, nm_utils_inet6_ntop (nameserver, NULL));
}
for (i = 0; i < nsearches; i++) {
const char *search = nm_ip6_config_get_search (config, i);
- nm_setting_ip6_config_add_dns_search (s_ip6, search);
+ nm_setting_ip_config_add_dns_search (s_ip6, search);
}
return NM_SETTING (s_ip6);
@@ -644,6 +665,85 @@ nm_ip6_config_destination_is_direct (const NMIP6Config *config, const struct in6
return FALSE;
}
+/*******************************************************************************/
+
+static int
+_addresses_get_index (const NMIP6Config *self, const NMPlatformIP6Address *addr)
+{
+ NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->addresses->len; i++) {
+ const NMPlatformIP6Address *a = &g_array_index (priv->addresses, NMPlatformIP6Address, i);
+
+ if (IN6_ARE_ADDR_EQUAL (&addr->address, &a->address))
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_nameservers_get_index (const NMIP6Config *self, const struct in6_addr *ns)
+{
+ NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->nameservers->len; i++) {
+ const struct in6_addr *n = &g_array_index (priv->nameservers, struct in6_addr, i);
+
+ if (IN6_ARE_ADDR_EQUAL (ns, n))
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_routes_get_index (const NMIP6Config *self, const NMPlatformIP6Route *route)
+{
+ NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->routes->len; i++) {
+ const NMPlatformIP6Route *r = &g_array_index (priv->routes, NMPlatformIP6Route, i);
+
+ if (routes_are_duplicate (route, r, FALSE))
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_domains_get_index (const NMIP6Config *self, const char *domain)
+{
+ NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->domains->len; i++) {
+ const char *d = g_ptr_array_index (priv->domains, i);
+
+ if (g_strcmp0 (domain, d) == 0)
+ return (int) i;
+ }
+ return -1;
+}
+
+static int
+_searches_get_index (const NMIP6Config *self, const char *search)
+{
+ NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (self);
+ guint i;
+
+ for (i = 0; i < priv->searches->len; i++) {
+ const char *s = g_ptr_array_index (priv->searches, i);
+
+ if (g_strcmp0 (search, s) == 0)
+ return (int) i;
+ }
+ return -1;
+}
+
+/*******************************************************************************/
+
/**
* nm_ip6_config_subtract:
* @dst: config from which to remove everything in @src
@@ -654,7 +754,8 @@ nm_ip6_config_destination_is_direct (const NMIP6Config *config, const struct in6
void
nm_ip6_config_subtract (NMIP6Config *dst, const NMIP6Config *src)
{
- guint32 i, j;
+ guint i;
+ gint idx;
const struct in6_addr *dst_tmp, *src_tmp;
g_return_if_fail (src != NULL);
@@ -664,30 +765,16 @@ nm_ip6_config_subtract (NMIP6Config *dst, const NMIP6Config *src)
/* addresses */
for (i = 0; i < nm_ip6_config_get_num_addresses (src); i++) {
- const NMPlatformIP6Address *src_addr = nm_ip6_config_get_address (src, i);
-
- for (j = 0; j < nm_ip6_config_get_num_addresses (dst); j++) {
- const NMPlatformIP6Address *dst_addr = nm_ip6_config_get_address (dst, j);
-
- if (IN6_ARE_ADDR_EQUAL (&src_addr->address, &dst_addr->address)) {
- nm_ip6_config_del_address (dst, j);
- break;
- }
- }
+ idx = _addresses_get_index (dst, nm_ip6_config_get_address (src, i));
+ if (idx >= 0)
+ nm_ip6_config_del_address (dst, idx);
}
/* nameservers */
for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++) {
- const struct in6_addr *src_ns = nm_ip6_config_get_nameserver (src, i);
-
- for (j = 0; j < nm_ip6_config_get_num_nameservers (dst); j++) {
- const struct in6_addr *dst_ns = nm_ip6_config_get_nameserver (dst, j);
-
- if (IN6_ARE_ADDR_EQUAL (src_ns, dst_ns)) {
- nm_ip6_config_del_nameserver (dst, j);
- break;
- }
- }
+ idx = _nameservers_get_index (dst, nm_ip6_config_get_nameserver (src, i));
+ if (idx >= 0)
+ nm_ip6_config_del_nameserver (dst, idx);
}
/* default gateway */
@@ -696,46 +783,28 @@ nm_ip6_config_subtract (NMIP6Config *dst, const NMIP6Config *src)
if (src_tmp && dst_tmp && IN6_ARE_ADDR_EQUAL (src_tmp, dst_tmp))
nm_ip6_config_set_gateway (dst, NULL);
+ if (!nm_ip6_config_get_num_addresses (dst))
+ nm_ip6_config_set_gateway (dst, NULL);
+
/* routes */
for (i = 0; i < nm_ip6_config_get_num_routes (src); i++) {
- const NMPlatformIP6Route *src_route = nm_ip6_config_get_route (src, i);
-
- for (j = 0; j < nm_ip6_config_get_num_routes (dst); j++) {
- const NMPlatformIP6Route *dst_route = nm_ip6_config_get_route (dst, j);
-
- if (routes_are_duplicate (src_route, dst_route, FALSE)) {
- nm_ip6_config_del_route (dst, j);
- break;
- }
- }
+ idx = _routes_get_index (dst, nm_ip6_config_get_route (src, i));
+ if (idx >= 0)
+ nm_ip6_config_del_route (dst, idx);
}
/* domains */
for (i = 0; i < nm_ip6_config_get_num_domains (src); i++) {
- const char *src_domain = nm_ip6_config_get_domain (src, i);
-
- for (j = 0; j < nm_ip6_config_get_num_domains (dst); j++) {
- const char *dst_domain = nm_ip6_config_get_domain (dst, j);
-
- if (g_strcmp0 (src_domain, dst_domain) == 0) {
- nm_ip6_config_del_domain (dst, j);
- break;
- }
- }
+ idx = _domains_get_index (dst, nm_ip6_config_get_domain (src, i));
+ if (idx >= 0)
+ nm_ip6_config_del_domain (dst, idx);
}
/* dns searches */
for (i = 0; i < nm_ip6_config_get_num_searches (src); i++) {
- const char *src_search = nm_ip6_config_get_search (src, i);
-
- for (j = 0; j < nm_ip6_config_get_num_searches (dst); j++) {
- const char *dst_search = nm_ip6_config_get_search (dst, j);
-
- if (g_strcmp0 (src_search, dst_search) == 0) {
- nm_ip6_config_del_search (dst, j);
- break;
- }
- }
+ idx = _searches_get_index (dst, nm_ip6_config_get_search (src, i));
+ if (idx >= 0)
+ nm_ip6_config_del_search (dst, idx);
}
if (nm_ip6_config_get_mss (src) == nm_ip6_config_get_mss (dst))
@@ -744,6 +813,54 @@ nm_ip6_config_subtract (NMIP6Config *dst, const NMIP6Config *src)
g_object_thaw_notify (G_OBJECT (dst));
}
+void
+nm_ip6_config_intersect (NMIP6Config *dst, const NMIP6Config *src)
+{
+ guint i;
+ gint idx;
+ const struct in6_addr *dst_tmp, *src_tmp;
+
+ g_return_if_fail (src != NULL);
+ g_return_if_fail (dst != NULL);
+
+ g_object_freeze_notify (G_OBJECT (dst));
+
+ /* addresses */
+ for (i = 0; i < nm_ip6_config_get_num_addresses (dst); ) {
+ idx = _addresses_get_index (src, nm_ip6_config_get_address (dst, i));
+ if (idx < 0)
+ nm_ip6_config_del_address (dst, i);
+ else
+ i++;
+ }
+
+ /* ignore nameservers */
+
+ /* default gateway */
+ dst_tmp = nm_ip6_config_get_gateway (dst);
+ if (dst_tmp) {
+ src_tmp = nm_ip6_config_get_gateway (src);
+ if ( !nm_ip6_config_get_num_addresses (dst)
+ || !src_tmp
+ || !IN6_ARE_ADDR_EQUAL (src_tmp, dst_tmp))
+ nm_ip6_config_set_gateway (dst, NULL);
+ }
+
+ /* routes */
+ for (i = 0; i < nm_ip6_config_get_num_routes (dst); ) {
+ idx = _routes_get_index (src, nm_ip6_config_get_route (dst, i));
+ if (idx < 0)
+ nm_ip6_config_del_route (dst, i);
+ else
+ i++;
+ }
+
+ /* ignore domains */
+ /* ignore dns searches */
+
+ g_object_thaw_notify (G_OBJECT (dst));
+}
+
/**
* nm_ip6_config_replace:
* @dst: config which will be replaced with everything in @src
@@ -783,6 +900,12 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev
g_object_freeze_notify (G_OBJECT (dst));
+ /* ifindex */
+ if (src_priv->ifindex != dst_priv->ifindex) {
+ dst_priv->ifindex = src_priv->ifindex;
+ has_minor_changes = TRUE;
+ }
+
/* never_default */
if (src_priv->never_default != dst_priv->never_default) {
dst_priv->never_default = src_priv->never_default;
@@ -958,7 +1081,7 @@ nm_ip6_config_dump (const NMIP6Config *config, const char *detail)
for (i = 0; i < nm_ip6_config_get_num_searches (config); i++)
g_message (" search: %s", nm_ip6_config_get_search (config, i));
- g_message (" mss: %u", nm_ip6_config_get_mss (config));
+ g_message (" mss: %"G_GUINT32_FORMAT, nm_ip6_config_get_mss (config));
g_message (" n-dflt: %d", nm_ip6_config_get_never_default (config));
}
@@ -1014,6 +1137,7 @@ nm_ip6_config_reset_addresses (NMIP6Config *config)
if (priv->addresses->len != 0) {
g_array_set_size (priv->addresses, 0);
+ _NOTIFY (config, PROP_ADDRESS_DATA);
_NOTIFY (config, PROP_ADDRESSES);
}
}
@@ -1071,6 +1195,7 @@ nm_ip6_config_add_address (NMIP6Config *config, const NMPlatformIP6Address *new)
g_array_append_val (priv->addresses, *new);
NOTIFY:
+ _NOTIFY (config, PROP_ADDRESS_DATA);
_NOTIFY (config, PROP_ADDRESSES);
}
@@ -1082,6 +1207,7 @@ nm_ip6_config_del_address (NMIP6Config *config, guint i)
g_return_if_fail (i < priv->addresses->len);
g_array_remove_index (priv->addresses, i);
+ _NOTIFY (config, PROP_ADDRESS_DATA);
_NOTIFY (config, PROP_ADDRESSES);
}
@@ -1127,6 +1253,7 @@ nm_ip6_config_reset_routes (NMIP6Config *config)
if (priv->routes->len != 0) {
g_array_set_size (priv->routes, 0);
+ _NOTIFY (config, PROP_ROUTE_DATA);
_NOTIFY (config, PROP_ROUTES);
}
}
@@ -1149,6 +1276,8 @@ nm_ip6_config_add_route (NMIP6Config *config, const NMPlatformIP6Route *new)
int i;
g_return_if_fail (new != NULL);
+ g_return_if_fail (new->plen > 0);
+ g_assert (priv->ifindex);
for (i = 0; i < priv->routes->len; i++ ) {
NMPlatformIP6Route *item = &g_array_index (priv->routes, NMPlatformIP6Route, i);
@@ -1165,7 +1294,9 @@ nm_ip6_config_add_route (NMIP6Config *config, const NMPlatformIP6Route *new)
}
g_array_append_val (priv->routes, *new);
+ g_array_index (priv->routes, NMPlatformIP6Route, priv->routes->len - 1).ifindex = priv->ifindex;
NOTIFY:
+ _NOTIFY (config, PROP_ROUTE_DATA);
_NOTIFY (config, PROP_ROUTES);
}
@@ -1177,6 +1308,7 @@ nm_ip6_config_del_route (NMIP6Config *config, guint i)
g_return_if_fail (i < priv->routes->len);
g_array_remove_index (priv->routes, i);
+ _NOTIFY (config, PROP_ROUTE_DATA);
_NOTIFY (config, PROP_ROUTES);
}
@@ -1200,13 +1332,13 @@ const NMPlatformIP6Route *
nm_ip6_config_get_direct_route_for_host (const NMIP6Config *config, const struct in6_addr *host)
{
NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config);
- int i;
+ guint i;
struct in6_addr network2, host2;
NMPlatformIP6Route *best_route = NULL;
g_return_val_if_fail (host && !IN6_IS_ADDR_UNSPECIFIED (host), NULL);
- for (i = 0; i < priv->routes->len; i++ ) {
+ for (i = 0; i < priv->routes->len; i++) {
NMPlatformIP6Route *item = &g_array_index (priv->routes, NMPlatformIP6Route, i);
if (!IN6_IS_ADDR_UNSPECIFIED (&item->gateway))
@@ -1231,6 +1363,33 @@ nm_ip6_config_get_direct_route_for_host (const NMIP6Config *config, const struct
return best_route;
}
+const NMPlatformIP6Address *
+nm_ip6_config_get_subnet_for_host (const NMIP6Config *config, const struct in6_addr *host)
+{
+ NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config);
+ guint i;
+ NMPlatformIP6Address *subnet = NULL;
+ struct in6_addr subnet2, host2;
+
+ g_return_val_if_fail (host && !IN6_IS_ADDR_UNSPECIFIED (host), NULL);
+
+ for (i = 0; i < priv->addresses->len; i++) {
+ NMPlatformIP6Address *item = &g_array_index (priv->addresses, NMPlatformIP6Address, i);
+
+ if (subnet && subnet->plen >= item->plen)
+ continue;
+
+ nm_utils_ip6_address_clear_host_address (&host2, host, item->plen);
+ nm_utils_ip6_address_clear_host_address (&subnet2, &item->address, item->plen);
+
+ if (IN6_ARE_ADDR_EQUAL (&subnet2, &host2))
+ subnet = item;
+ }
+
+ return subnet;
+}
+
+
/******************************************************************/
void
@@ -1538,6 +1697,8 @@ finalize (GObject *object)
{
NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object);
+ g_free (priv->path);
+
g_array_unref (priv->addresses);
g_array_unref (priv->routes);
g_array_unref (priv->nameservers);
@@ -1569,6 +1730,15 @@ nameservers_to_gvalue (GArray *array, GValue *value)
}
static void
+gvalue_destroy (gpointer data)
+{
+ GValue *value = (GValue *) data;
+
+ g_value_unset (value);
+ g_slice_free (GValue, value);
+}
+
+static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
@@ -1576,11 +1746,37 @@ get_property (GObject *object, guint prop_id,
NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object);
switch (prop_id) {
- case PROP_GATEWAY:
- if (!IN6_IS_ADDR_UNSPECIFIED (&priv->gateway))
- g_value_set_string (value, nm_utils_inet6_ntop (&priv->gateway, NULL));
- else
- g_value_set_string (value, NULL);
+ case PROP_IFINDEX:
+ g_value_set_int (value, priv->ifindex);
+ break;
+ case PROP_ADDRESS_DATA:
+ {
+ GPtrArray *addresses = g_ptr_array_new ();
+ int naddr = nm_ip6_config_get_num_addresses (config);
+ int i;
+
+ for (i = 0; i < naddr; i++) {
+ const NMPlatformIP6Address *address = nm_ip6_config_get_address (config, i);
+ GHashTable *addr_hash;
+ GValue *val;
+
+ addr_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gvalue_destroy);
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_STRING);
+ g_value_set_string (val, nm_utils_inet6_ntop (&address->address, NULL));
+ g_hash_table_insert (addr_hash, "address", val);
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_UINT);
+ g_value_set_uint (val, address->plen);
+ g_hash_table_insert (addr_hash, "prefix", val);
+
+ g_ptr_array_add (addresses, addr_hash);
+ }
+
+ g_value_take_boxed (value, addresses);
+ }
break;
case PROP_ADDRESSES:
{
@@ -1613,7 +1809,7 @@ get_property (GObject *object, guint prop_id,
/* Gateway */
g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY);
ba = g_byte_array_new ();
- g_byte_array_append (ba, (guint8 *) (gateway ? gateway : &in6addr_any), sizeof (*gateway));
+ g_byte_array_append (ba, (guint8 *) (i == 0 && gateway ? gateway : &in6addr_any), sizeof (*gateway));
g_value_take_boxed (&element, ba);
g_value_array_append (array, &element);
g_value_unset (&element);
@@ -1624,6 +1820,47 @@ get_property (GObject *object, guint prop_id,
g_value_take_boxed (value, addresses);
}
break;
+ case PROP_ROUTE_DATA:
+ {
+ GPtrArray *routes = g_ptr_array_new ();
+ guint nroutes = nm_ip6_config_get_num_routes (config);
+ int i;
+
+ for (i = 0; i < nroutes; i++) {
+ const NMPlatformIP6Route *route = nm_ip6_config_get_route (config, i);
+ GHashTable *route_hash;
+ GValue *val;
+
+ route_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gvalue_destroy);
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_STRING);
+ g_value_set_string (val, nm_utils_inet6_ntop (&route->network, NULL));
+ g_hash_table_insert (route_hash, "dest", val);
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_UINT);
+ g_value_set_uint (val, route->plen);
+ g_hash_table_insert (route_hash, "prefix", val);
+
+ if (!IN6_IS_ADDR_UNSPECIFIED (&route->gateway)) {
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_STRING);
+ g_value_set_string (val, nm_utils_inet6_ntop (&route->gateway, NULL));
+ g_hash_table_insert (route_hash, "next-hop", val);
+ }
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_UINT);
+ g_value_set_uint (val, route->metric);
+ g_hash_table_insert (route_hash, "metric", val);
+
+ g_ptr_array_add (routes, route_hash);
+ }
+
+ g_value_take_boxed (value, routes);
+ }
+ break;
case PROP_ROUTES:
{
GPtrArray *routes = g_ptr_array_new ();
@@ -1631,12 +1868,18 @@ get_property (GObject *object, guint prop_id,
int i;
for (i = 0; i < nroutes; i++) {
+ GValueArray *array;
const NMPlatformIP6Route *route = nm_ip6_config_get_route (config, i);
-
- GValueArray *array = g_value_array_new (4);
GByteArray *ba;
GValue element = G_VALUE_INIT;
+ /* legacy versions of nm_ip6_route_set_prefix() in libnm-util assert that the
+ * plen is positive. Skip the default routes not to break older clients. */
+ if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
+ continue;
+
+ array = g_value_array_new (4);
+
g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY);
ba = g_byte_array_new ();
g_byte_array_append (ba, (guint8 *) &route->network, sizeof (route->network));
@@ -1667,6 +1910,12 @@ get_property (GObject *object, guint prop_id,
g_value_take_boxed (value, routes);
}
break;
+ case PROP_GATEWAY:
+ if (!IN6_IS_ADDR_UNSPECIFIED (&priv->gateway))
+ g_value_set_string (value, nm_utils_inet6_ntop (&priv->gateway, NULL));
+ else
+ g_value_set_string (value, NULL);
+ break;
case PROP_NAMESERVERS:
nameservers_to_gvalue (priv->nameservers, value);
break;
@@ -1683,6 +1932,24 @@ get_property (GObject *object, guint prop_id,
}
static void
+set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object);
+
+ switch (prop_id) {
+ case PROP_IFINDEX:
+ priv->ifindex = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
nm_ip6_config_class_init (NMIP6ConfigClass *config_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (config_class);
@@ -1691,24 +1958,41 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class)
/* virtual methods */
object_class->get_property = get_property;
+ object_class->set_property = set_property;
object_class->finalize = finalize;
/* properties */
- obj_properties[PROP_GATEWAY] =
- g_param_spec_string (NM_IP6_CONFIG_GATEWAY, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS);
- obj_properties[PROP_ADDRESSES] =
- g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, "", "",
- DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS,
+ obj_properties[PROP_IFINDEX] =
+ g_param_spec_int (NM_IP6_CONFIG_IFINDEX, "", "",
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_ADDRESS_DATA] =
+ g_param_spec_boxed (NM_IP6_CONFIG_ADDRESS_DATA, "", "",
+ DBUS_TYPE_NM_IP_ADDRESSES,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_ADDRESSES] =
+ g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, "", "",
+ DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_ROUTE_DATA] =
+ g_param_spec_boxed (NM_IP6_CONFIG_ROUTE_DATA, "", "",
+ DBUS_TYPE_NM_IP_ROUTES,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS);
obj_properties[PROP_ROUTES] =
g_param_spec_boxed (NM_IP6_CONFIG_ROUTES, "", "",
DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_GATEWAY] =
+ g_param_spec_string (NM_IP6_CONFIG_GATEWAY, "", "",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS);
obj_properties[PROP_NAMESERVERS] =
g_param_spec_boxed (NM_IP6_CONFIG_NAMESERVERS, "", "",
DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR,
diff --git a/src/nm-ip6-config.h b/src/nm-ip6-config.h
index 60a82b0f72..e0527e5e55 100644
--- a/src/nm-ip6-config.h
+++ b/src/nm-ip6-config.h
@@ -22,6 +22,7 @@
#define __NETWORKMANAGER_IP6_CONFIG_H__
#include <glib-object.h>
+#include <netinet/in.h>
#include "nm-types.h"
#include "nm-setting-ip6-config.h"
@@ -41,17 +42,24 @@ typedef struct {
GObjectClass parent;
} NMIP6ConfigClass;
+#define NM_IP6_CONFIG_IFINDEX "ifindex"
+#define NM_IP6_CONFIG_ADDRESS_DATA "address-data"
+#define NM_IP6_CONFIG_ROUTE_DATA "route-data"
#define NM_IP6_CONFIG_GATEWAY "gateway"
-#define NM_IP6_CONFIG_ADDRESSES "addresses"
-#define NM_IP6_CONFIG_ROUTES "routes"
#define NM_IP6_CONFIG_NAMESERVERS "nameservers"
#define NM_IP6_CONFIG_DOMAINS "domains"
#define NM_IP6_CONFIG_SEARCHES "searches"
+/* deprecated */
+#define NM_IP6_CONFIG_ADDRESSES "addresses"
+#define NM_IP6_CONFIG_ROUTES "routes"
+
GType nm_ip6_config_get_type (void);
-NMIP6Config * nm_ip6_config_new (void);
+NMIP6Config * nm_ip6_config_new (int ifindex);
+
+int nm_ip6_config_get_ifindex (const NMIP6Config *config);
/* D-Bus integration */
void nm_ip6_config_export (NMIP6Config *config);
@@ -60,12 +68,13 @@ const char * nm_ip6_config_get_dbus_path (const NMIP6Config *config);
/* Integration with nm-platform and nm-setting */
NMIP6Config *nm_ip6_config_capture (int ifindex, gboolean capture_resolv_conf, NMSettingIP6ConfigPrivacy use_temporary);
gboolean nm_ip6_config_commit (const NMIP6Config *config, int ifindex);
-void nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIP6Config *setting, int default_route_metric);
+void nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIPConfig *setting, guint32 default_route_metric);
NMSetting *nm_ip6_config_create_setting (const NMIP6Config *config);
/* Utility functions */
void nm_ip6_config_merge (NMIP6Config *dst, const NMIP6Config *src);
void nm_ip6_config_subtract (NMIP6Config *dst, const NMIP6Config *src);
+void nm_ip6_config_intersect (NMIP6Config *dst, const NMIP6Config *src);
gboolean nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relevant_changes);
int nm_ip6_config_destination_is_direct (const NMIP6Config *config, const struct in6_addr *dest, int plen);
void nm_ip6_config_dump (const NMIP6Config *config, const char *detail);
@@ -94,6 +103,7 @@ guint32 nm_ip6_config_get_num_routes (const NMIP6Config *config);
const NMPlatformIP6Route *nm_ip6_config_get_route (const NMIP6Config *config, guint32 i);
const NMPlatformIP6Route *nm_ip6_config_get_direct_route_for_host (const NMIP6Config *config, const struct in6_addr *host);
+const NMPlatformIP6Address *nm_ip6_config_get_subnet_for_host (const NMIP6Config *config, const struct in6_addr *host);
/* Nameservers */
void nm_ip6_config_reset_nameservers (NMIP6Config *config);
diff --git a/src/nm-logging.c b/src/nm-logging.c
index c32c2d364a..1e9d422f2a 100644
--- a/src/nm-logging.c
+++ b/src/nm-logging.c
@@ -104,6 +104,9 @@ static const LogDesc domain_descs[] = {
{ 0, NULL }
};
+/* We have more then 32 logging domains. Assert that it compiles to a 64 bit sized enum */
+G_STATIC_ASSERT (sizeof (NMLogDomain) >= sizeof (guint64));
+
/* Combined domains */
#define LOGD_ALL_STRING "ALL"
#define LOGD_DEFAULT_STRING "DEFAULT"
@@ -357,10 +360,12 @@ nm_logging_enabled (NMLogLevel level, NMLogDomain domain)
}
void
-_nm_log (const char *loc,
+_nm_log (const char *file,
+ guint line,
const char *func,
NMLogLevel level,
NMLogDomain domain,
+ int error,
const char *fmt,
...)
{
@@ -378,6 +383,10 @@ _nm_log (const char *loc,
if (!(logging[level] & domain))
return;
+ /* Make sure that %m maps to the specified error */
+ if (error != 0)
+ errno = error;
+
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
@@ -387,13 +396,13 @@ _nm_log (const char *loc,
g_get_current_time (&tv);
syslog_level = LOG_DEBUG;
g_log_level = G_LOG_LEVEL_DEBUG;
- fullmsg = g_strdup_printf ("<trace> [%ld.%06ld] [%s] %s(): %s", tv.tv_sec, tv.tv_usec, loc, func, msg);
+ fullmsg = g_strdup_printf ("<trace> [%ld.%06ld] [%s:%u] %s(): %s", tv.tv_sec, tv.tv_usec, file, line, func, msg);
break;
case LOGL_DEBUG:
g_get_current_time (&tv);
syslog_level = LOG_INFO;
g_log_level = G_LOG_LEVEL_DEBUG;
- fullmsg = g_strdup_printf ("<debug> [%ld.%06ld] [%s] %s(): %s", tv.tv_sec, tv.tv_usec, loc, func, msg);
+ fullmsg = g_strdup_printf ("<debug> [%ld.%06ld] [%s:%u] %s(): %s", tv.tv_sec, tv.tv_usec, file, line, func, msg);
break;
case LOGL_INFO:
syslog_level = LOG_INFO;
@@ -410,7 +419,7 @@ _nm_log (const char *loc,
/* g_log_level is still WARNING, because ERROR is fatal */
g_log_level = G_LOG_LEVEL_WARNING;
g_get_current_time (&tv);
- fullmsg = g_strdup_printf ("<error> [%ld.%06ld] [%s] %s(): %s", tv.tv_sec, tv.tv_usec, loc, func, msg);
+ fullmsg = g_strdup_printf ("<error> [%ld.%06ld] [%s:%u] %s(): %s", tv.tv_sec, tv.tv_usec, file, line, func, msg);
break;
default:
g_assert_not_reached ();
diff --git a/src/nm-logging.h b/src/nm-logging.h
index 60ddb1e511..4ae9c02687 100644
--- a/src/nm-logging.h
+++ b/src/nm-logging.h
@@ -105,7 +105,7 @@ typedef enum { /*< skip >*/
#define nm_log(level, domain, ...) \
G_STMT_START { \
if (nm_logging_enabled ((level), (domain))) { \
- _nm_log (G_STRLOC, G_STRFUNC, (level), (domain), __VA_ARGS__); \
+ _nm_log (__FILE__, __LINE__, G_STRFUNC, (level), (domain), 0, __VA_ARGS__); \
} \
} G_STMT_END
@@ -116,11 +116,13 @@ typedef enum { /*< skip >*/
/* log a message for an object (with providing a generic @self pointer) */
#define nm_log_ptr(level, domain, self, ...) \
G_STMT_START { \
+ NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare") \
if ((level) <= LOGL_DEBUG) { \
_nm_log_ptr ((level), (domain), (self), __VA_ARGS__); \
} else { \
nm_log ((level), (domain), __VA_ARGS__); \
} \
+ NM_PRAGMA_WARNING_REENABLE \
} G_STMT_END
@@ -134,12 +136,14 @@ typedef enum { /*< skip >*/
nm_log_ptr ((level), (domain), (self), __VA_ARGS__)
-void _nm_log (const char *loc,
+void _nm_log (const char *file,
+ guint line,
const char *func,
NMLogLevel level,
NMLogDomain domain,
+ int error,
const char *fmt,
- ...) __attribute__((__format__ (__printf__, 5, 6)));
+ ...) __attribute__((__format__ (__printf__, 7, 8)));
const char *nm_logging_level_to_string (void);
const char *nm_logging_domains_to_string (void);
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 459d531a97..9ccb7e44d2 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -19,7 +19,7 @@
* Copyright (C) 2007 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <stdlib.h>
#include <fcntl.h>
@@ -33,6 +33,7 @@
#include <gio/gio.h>
#include <glib/gi18n.h>
+#include "gsystem-local-alloc.h"
#include "nm-glib-compat.h"
#include "nm-manager.h"
#include "nm-logging.h"
@@ -58,6 +59,7 @@
#include "nm-session-monitor.h"
#include "nm-activation-request.h"
#include "nm-core-internal.h"
+#include "nm-config.h"
#define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd"
#define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd"
@@ -165,6 +167,7 @@ typedef struct {
GSList *devices;
NMState state;
+ NMConfig *config;
NMConnectivity *connectivity;
int ignore_link_added_cb;
@@ -213,6 +216,7 @@ enum {
USER_PERMISSIONS_CHANGED,
ACTIVE_CONNECTION_ADDED,
ACTIVE_CONNECTION_REMOVED,
+ CONFIGURE_QUIT,
LAST_SIGNAL
};
@@ -460,6 +464,18 @@ active_connection_get_by_path (NMManager *manager, const char *path)
/************************************************************************/
+static void
+_config_changed_cb (NMConfig *config, NMConfigData *config_data, NMConfigChangeFlags changes, NMConfigData *old_data, NMManager *self)
+{
+ g_object_set (NM_MANAGER_GET_PRIVATE (self)->connectivity,
+ NM_CONNECTIVITY_URI, nm_config_data_get_connectivity_uri (config_data),
+ NM_CONNECTIVITY_INTERVAL, nm_config_data_get_connectivity_interval (config_data),
+ NM_CONNECTIVITY_RESPONSE, nm_config_data_get_connectivity_response (config_data),
+ NULL);
+}
+
+/************************************************************************/
+
static NMDevice *
nm_manager_get_device_by_udi (NMManager *manager, const char *udi)
{
@@ -575,7 +591,7 @@ checked_connectivity (GObject *object, GAsyncResult *result, gpointer user_data)
}
static NMState
-find_best_device_state (NMManager *manager, gboolean *want_connectivity_check)
+find_best_device_state (NMManager *manager)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
NMState best_state = NM_STATE_DISCONNECTED;
@@ -589,14 +605,10 @@ find_best_device_state (NMManager *manager, gboolean *want_connectivity_check)
case NM_ACTIVE_CONNECTION_STATE_ACTIVATED:
if ( nm_active_connection_get_default (ac)
|| nm_active_connection_get_default6 (ac)) {
- nm_connectivity_set_online (priv->connectivity, TRUE);
- if (nm_connectivity_get_state (priv->connectivity) == NM_CONNECTIVITY_FULL) {
- *want_connectivity_check = FALSE;
+ if (nm_connectivity_get_state (priv->connectivity) == NM_CONNECTIVITY_FULL)
return NM_STATE_CONNECTED_GLOBAL;
- }
- best_state = NM_STATE_CONNECTING;
- *want_connectivity_check = TRUE;
+ best_state = NM_STATE_CONNECTED_SITE;
} else {
if (best_state < NM_STATE_CONNECTING)
best_state = NM_STATE_CONNECTED_LOCAL;
@@ -627,7 +639,6 @@ nm_manager_update_state (NMManager *manager)
{
NMManagerPrivate *priv;
NMState new_state = NM_STATE_DISCONNECTED;
- gboolean want_connectivity_check = FALSE;
g_return_if_fail (NM_IS_MANAGER (manager));
@@ -636,16 +647,16 @@ nm_manager_update_state (NMManager *manager)
if (manager_sleeping (manager))
new_state = NM_STATE_ASLEEP;
else
- new_state = find_best_device_state (manager, &want_connectivity_check);
+ new_state = find_best_device_state (manager);
- if (new_state == NM_STATE_CONNECTING && want_connectivity_check) {
+ nm_connectivity_set_online (priv->connectivity, new_state >= NM_STATE_CONNECTED_LOCAL);
+
+ if (new_state == NM_STATE_CONNECTED_SITE) {
nm_connectivity_check_async (priv->connectivity,
checked_connectivity,
g_object_ref (manager));
- return;
}
- nm_connectivity_set_online (priv->connectivity, new_state >= NM_STATE_CONNECTED_LOCAL);
set_state (manager, new_state);
}
@@ -684,6 +695,11 @@ check_if_startup_complete (NMManager *self)
if (!priv->startup)
return;
+ if (!nm_settings_get_startup_complete (priv->settings)) {
+ nm_log_dbg (LOGD_CORE, "check_if_startup_complete returns FALSE because of NMSettings");
+ return;
+ }
+
for (iter = priv->devices; iter; iter = iter->next) {
NMDevice *dev = iter->data;
@@ -705,6 +721,9 @@ check_if_startup_complete (NMManager *self)
g_signal_handlers_disconnect_by_func (dev, G_CALLBACK (device_has_pending_action_changed), self);
}
+
+ if (nm_config_get_configure_and_quit (nm_config_get ()))
+ g_signal_emit (self, signals[CONFIGURE_QUIT], 0);
}
static void
@@ -716,6 +735,14 @@ device_has_pending_action_changed (NMDevice *device,
}
static void
+settings_startup_complete_changed (NMSettings *settings,
+ GParamSpec *pspec,
+ NMManager *self)
+{
+ check_if_startup_complete (self);
+}
+
+static void
remove_device (NMManager *manager,
NMDevice *device,
gboolean quitting,
@@ -723,6 +750,9 @@ remove_device (NMManager *manager,
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
+ nm_log_dbg (LOGD_DEVICE, "(%s): removing device (allow_unmanage %d, managed %d)",
+ nm_device_get_iface (device), allow_unmanage, nm_device_get_managed (device));
+
if (allow_unmanage && nm_device_get_managed (device)) {
NMActRequest *req = nm_device_get_act_request (device);
gboolean unmanage = FALSE;
@@ -744,6 +774,8 @@ remove_device (NMManager *manager,
nm_device_set_unmanaged_quitting (device);
else
nm_device_set_unmanaged (device, NM_UNMANAGED_INTERNAL, TRUE, NM_DEVICE_STATE_REASON_REMOVED);
+ } else if (quitting && nm_config_get_configure_and_quit (nm_config_get ())) {
+ nm_device_spawn_iface_helper (device);
}
}
@@ -754,6 +786,7 @@ remove_device (NMManager *manager,
g_signal_emit (manager, signals[DEVICE_REMOVED], 0, device);
g_object_notify (G_OBJECT (manager), NM_MANAGER_DEVICES);
+ nm_device_removed (device);
nm_dbus_manager_unregister_object (priv->dbus_mgr, device);
g_object_unref (device);
@@ -1008,6 +1041,7 @@ get_virtual_iface_name (NMManager *self,
* system_create_virtual_device:
* @self: the #NMManager
* @connection: the connection which might require a virtual device
+ * @error: the error set when return value is NULL
*
* If @connection requires a virtual device and one does not yet exist for it,
* creates that device.
@@ -1015,19 +1049,27 @@ get_virtual_iface_name (NMManager *self,
* Returns: the #NMDevice if successfully created, %NULL if not
*/
static NMDevice *
-system_create_virtual_device (NMManager *self, NMConnection *connection)
+system_create_virtual_device (NMManager *self, NMConnection *connection, GError **error)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
- GError *error = NULL;
+ GError *local_err = NULL;
GSList *iter;
char *iface = NULL;
NMDevice *device = NULL, *parent = NULL;
gboolean nm_owned = FALSE;
+ g_return_val_if_fail (NM_IS_MANAGER (self), NULL);
+ g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
iface = get_virtual_iface_name (self, connection, &parent);
if (!iface) {
nm_log_dbg (LOGD_DEVICE, "(%s) failed to determine virtual interface name",
nm_connection_get_id (connection));
+ g_set_error_literal (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "failed to determine virtual interface name");
return NULL;
}
@@ -1036,8 +1078,15 @@ system_create_virtual_device (NMManager *self, NMConnection *connection)
NMDevice *candidate = iter->data;
if ( g_strcmp0 (nm_device_get_iface (candidate), iface) == 0
- || nm_device_check_connection_compatible (candidate, connection))
+ || nm_device_check_connection_compatible (candidate, connection)) {
+ nm_log_dbg (LOGD_DEVICE, "(%s) already created virtual interface name %s",
+ nm_connection_get_id (connection), iface);
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "interface name '%s' already created", iface);
goto out;
+ }
}
/* Block notification of link added since we're creating the device
@@ -1052,14 +1101,15 @@ system_create_virtual_device (NMManager *self, NMConnection *connection)
device = nm_device_factory_create_virtual_device_for_connection (NM_DEVICE_FACTORY (iter->data),
connection,
parent,
- &error);
- if (device || error) {
+ &local_err);
+ if (device || local_err) {
if (device)
- g_assert_no_error (error);
+ g_assert_no_error (local_err);
else {
nm_log_err (LOGD_DEVICE, "(%s) failed to create virtual device: %s",
- nm_connection_get_id (connection), error ? error->message : "(unknown error)");
- g_clear_error (&error);
+ nm_connection_get_id (connection),
+ local_err ? local_err->message : "(unknown error)");
+ g_propagate_error (error, local_err);
}
break;
}
@@ -1075,6 +1125,16 @@ system_create_virtual_device (NMManager *self, NMConnection *connection)
add_device (self, device, !nm_owned);
g_object_unref (device);
+ } else {
+ if (error && !*error)
+ nm_log_err (LOGD_DEVICE, "(%s:%s) NetworkManager plugin for '%s' unavailable",
+ nm_connection_get_id (connection), iface,
+ nm_connection_get_connection_type (connection));
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "NetworkManager plugin for '%s' unavailable",
+ nm_connection_get_connection_type (connection));
}
priv->ignore_link_added_cb--;
@@ -1099,7 +1159,7 @@ system_create_virtual_devices (NMManager *self)
/* We only create a virtual interface if the connection can autoconnect */
if ( nm_connection_is_virtual (connection)
&& nm_settings_connection_can_autoconnect (NM_SETTINGS_CONNECTION (connection)))
- system_create_virtual_device (self, connection);
+ system_create_virtual_device (self, connection, NULL);
}
g_slist_free (connections);
}
@@ -1116,7 +1176,7 @@ connection_added (NMSettings *settings,
g_assert (s_con);
if (nm_setting_connection_get_autoconnect (s_con))
- system_create_virtual_device (manager, connection);
+ system_create_virtual_device (manager, connection, NULL);
}
}
@@ -1450,7 +1510,6 @@ device_auth_request_cb (NMDevice *device,
/* Ensure the subject has permissions for this connection */
if (connection && !nm_auth_is_subject_in_acl (connection,
- nm_session_monitor_get (),
subject,
&error_desc)) {
error = g_error_new_literal (NM_MANAGER_ERROR,
@@ -1486,6 +1545,9 @@ done:
static gboolean
match_connection_filter (NMConnection *connection, gpointer user_data)
{
+ if (nm_settings_connection_get_nm_generated_assumed (NM_SETTINGS_CONNECTION (connection)))
+ return FALSE;
+
return nm_device_check_connection_compatible (NM_DEVICE (user_data), connection);
}
@@ -1644,7 +1706,14 @@ recheck_assume_connection (NMDevice *device, gpointer user_data)
if (manager_sleeping (self))
return FALSE;
- if (nm_device_get_unmanaged_flag (device, NM_UNMANAGED_USER))
+ if (nm_device_get_unmanaged_flag (device, NM_UNMANAGED_USER) ||
+ nm_device_get_unmanaged_flag (device, NM_UNMANAGED_INTERNAL) ||
+ nm_device_get_unmanaged_flag (device, NM_UNMANAGED_EXTERNAL_DOWN) ||
+ nm_device_get_unmanaged_flag (device, NM_UNMANAGED_PARENT))
+ return FALSE;
+
+ state = nm_device_get_state (device);
+ if (state > NM_DEVICE_STATE_DISCONNECTED)
return FALSE;
connection = get_existing_connection (self, device, &generated);
@@ -1654,11 +1723,6 @@ recheck_assume_connection (NMDevice *device, gpointer user_data)
return FALSE;
}
- state = nm_device_get_state (device);
-
- if (state > NM_DEVICE_STATE_DISCONNECTED)
- return FALSE;
-
if (state == NM_DEVICE_STATE_UNMANAGED) {
was_unmanaged = TRUE;
nm_device_state_changed (device,
@@ -1731,7 +1795,7 @@ add_device (NMManager *self, NMDevice *device, gboolean try_assume)
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
const char *iface, *driver, *type_desc;
const GSList *unmanaged_specs;
- gboolean user_unmanaged, sleeping;
+ gboolean user_unmanaged, sleeping, platform_unmanaged;
gboolean enabled = FALSE;
RfKillType rtype;
GSList *iter, *remove = NULL;
@@ -1807,10 +1871,14 @@ add_device (NMManager *self, NMDevice *device, gboolean try_assume)
user_unmanaged = nm_device_spec_match_list (device, unmanaged_specs);
nm_device_set_initial_unmanaged_flag (device, NM_UNMANAGED_USER, user_unmanaged);
+ if (nm_platform_link_get_unmanaged (nm_device_get_ifindex (device), &platform_unmanaged))
+ nm_device_set_initial_unmanaged_flag (device, NM_UNMANAGED_DEFAULT, platform_unmanaged);
+
sleeping = manager_sleeping (self);
nm_device_set_initial_unmanaged_flag (device, NM_UNMANAGED_INTERNAL, sleeping);
nm_device_dbus_export (device);
+ nm_device_finish_init (device);
if (try_assume) {
connection_assumed = recheck_assume_connection (device, self);
@@ -2476,7 +2544,7 @@ ensure_master_active_connection (NMManager *self,
if (!is_compatible_with_slave (candidate, connection))
continue;
- if (nm_device_connection_is_available (master_device, candidate, TRUE)) {
+ if (nm_device_check_connection_available (master_device, candidate, NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST, NULL)) {
master_ac = nm_manager_activate_connection (self,
candidate,
NULL,
@@ -2517,7 +2585,7 @@ ensure_master_active_connection (NMManager *self,
continue;
}
- if (!nm_device_connection_is_available (candidate, master_connection, TRUE))
+ if (!nm_device_check_connection_available (candidate, master_connection, NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST, NULL))
continue;
found_device = TRUE;
@@ -2586,6 +2654,7 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError *
NMConnection *connection;
NMConnection *master_connection = NULL;
NMActiveConnection *master_ac = NULL;
+ GError *local_err = NULL;
g_return_val_if_fail (NM_IS_MANAGER (self), FALSE);
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (active), FALSE);
@@ -2610,12 +2679,14 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError *
return FALSE;
}
- device = system_create_virtual_device (self, connection);
+ device = system_create_virtual_device (self, connection, &local_err);
if (!device) {
- g_set_error_literal (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_UNKNOWN_DEVICE,
- "Failed to create virtual interface");
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_UNKNOWN_DEVICE,
+ "Failed to create virtual interface: %s",
+ local_err ? local_err->message : "(unknown)");
+ g_clear_error (&local_err);
return FALSE;
}
@@ -2631,7 +2702,7 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError *
* in the UNAVAILABLE state here. To ensure it can be activated
* immediately, we transition it to DISCONNECTED.
*/
- if ( nm_device_is_available (device)
+ if ( nm_device_is_available (device, NM_DEVICE_CHECK_DEV_AVAILABLE_NONE)
&& (nm_device_get_state (device) == NM_DEVICE_STATE_UNAVAILABLE)) {
nm_device_state_changed (device,
NM_DEVICE_STATE_DISCONNECTED,
@@ -2651,7 +2722,6 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError *
subject = nm_active_connection_get_subject (active);
if (existing_connection &&
!nm_auth_is_subject_in_acl (existing_connection,
- nm_session_monitor_get (),
subject,
&error_desc)) {
g_set_error (error,
@@ -2665,7 +2735,7 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError *
}
/* Final connection must be available on device */
- if (!nm_device_connection_is_available (device, connection, TRUE)) {
+ if (!nm_device_check_connection_available (device, connection, NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST, NULL)) {
g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_CONNECTION,
"Connection '%s' is not available on the device %s at this time.",
nm_connection_get_id (connection), nm_device_get_iface (device));
@@ -2943,7 +3013,6 @@ nm_manager_activate_connection (NMManager *self,
/* Ensure the subject has permissions for this connection */
if (!nm_auth_is_subject_in_acl (connection,
- nm_session_monitor_get (),
subject,
&error_desc)) {
g_set_error_literal (error,
@@ -2997,7 +3066,6 @@ validate_activation_request (NMManager *self,
/* Ensure the subject has permissions for this connection */
if (!nm_auth_is_subject_in_acl (connection,
- nm_session_monitor_get (),
subject,
&error_desc)) {
g_set_error_literal (error,
@@ -3008,6 +3076,18 @@ validate_activation_request (NMManager *self,
goto error;
}
+ /* Not implemented yet, we want to fail early */
+ if ( nm_connection_get_setting_connection (connection)
+ && nm_connection_get_setting_ip6_config (connection)
+ && !strcmp (nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG),
+ NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
+ g_set_error_literal (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_CONNECTION_NOT_AVAILABLE,
+ "Sharing IPv6 connections is not supported yet.");
+ return NULL;
+ }
+
/* Check whether it's a VPN or not */
if ( nm_connection_get_setting_vpn (connection)
|| nm_connection_is_type (connection, NM_SETTING_VPN_SETTING_NAME))
@@ -3527,7 +3607,6 @@ impl_manager_deactivate_connection (NMManager *self,
/* Ensure the subject has permissions for this connection */
if (!nm_auth_is_subject_in_acl (connection,
- nm_session_monitor_get (),
subject,
&error_desc)) {
error = g_error_new_literal (NM_MANAGER_ERROR,
@@ -4166,6 +4245,16 @@ nm_manager_start (NMManager *self)
check_if_startup_complete (self);
}
+void
+nm_manager_stop (NMManager *self)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+
+ /* Remove all devices */
+ while (priv->devices)
+ remove_device (self, NM_DEVICE (priv->devices->data), TRUE, TRUE);
+}
+
static gboolean
handle_firmware_changed (gpointer user_data)
{
@@ -4204,12 +4293,9 @@ connectivity_changed (NMConnectivity *connectivity,
gpointer user_data)
{
NMManager *self = NM_MANAGER (user_data);
- NMConnectivityState state;
- static const char *connectivity_states[] = { "UNKNOWN", "NONE", "PORTAL", "LIMITED", "FULL" };
- state = nm_connectivity_get_state (connectivity);
nm_log_dbg (LOGD_CORE, "connectivity checking indicates %s",
- connectivity_states[state]);
+ nm_connectivity_state_to_string (nm_connectivity_get_state (connectivity)));
nm_manager_update_state (self);
g_object_notify (G_OBJECT (self), NM_MANAGER_CONNECTIVITY);
@@ -4652,6 +4738,7 @@ nm_manager_new (NMSettings *settings,
NMManagerPrivate *priv;
DBusGConnection *bus;
DBusConnection *dbus_connection;
+ NMConfigData *config_data;
g_assert (settings);
@@ -4683,7 +4770,16 @@ nm_manager_new (NMSettings *settings,
g_signal_connect (priv->policy, "notify::" NM_POLICY_ACTIVATING_IP6_DEVICE,
G_CALLBACK (policy_activating_device_changed), singleton);
- priv->connectivity = nm_connectivity_new ();
+ priv->config = g_object_ref (nm_config_get ());
+ g_signal_connect (G_OBJECT (priv->config),
+ NM_CONFIG_SIGNAL_CONFIG_CHANGED,
+ G_CALLBACK (_config_changed_cb),
+ singleton);
+
+ config_data = nm_config_get_data (priv->config);
+ priv->connectivity = nm_connectivity_new (nm_config_data_get_connectivity_uri (config_data),
+ nm_config_data_get_connectivity_interval (config_data),
+ nm_config_data_get_connectivity_response (config_data));
g_signal_connect (priv->connectivity, "notify::" NM_CONNECTIVITY_STATE,
G_CALLBACK (connectivity_changed), singleton);
@@ -4696,6 +4792,8 @@ nm_manager_new (NMSettings *settings,
priv->prop_filter_added = TRUE;
priv->settings = g_object_ref (settings);
+ g_signal_connect (priv->settings, "notify::" NM_SETTINGS_STARTUP_COMPLETE,
+ G_CALLBACK (settings_startup_complete_changed), singleton);
priv->state_file = g_strdup (state_file);
@@ -4770,7 +4868,7 @@ nm_manager_init (NMManager *manager)
priv->radio_states[RFKILL_TYPE_WWAN].rtype = RFKILL_TYPE_WWAN;
priv->radio_states[RFKILL_TYPE_WIMAX].user_enabled = TRUE;
- priv->radio_states[RFKILL_TYPE_WIMAX].key = "WiMAXEnabled";
+ priv->radio_states[RFKILL_TYPE_WIMAX].key = "WimaxEnabled";
priv->radio_states[RFKILL_TYPE_WIMAX].prop = NM_MANAGER_WIMAX_ENABLED;
priv->radio_states[RFKILL_TYPE_WIMAX].hw_prop = NM_MANAGER_WIMAX_HARDWARE_ENABLED;
priv->radio_states[RFKILL_TYPE_WIMAX].desc = "WiMAX";
@@ -4789,7 +4887,7 @@ nm_manager_init (NMManager *manager)
G_CALLBACK (dbus_connection_changed_cb),
manager);
- priv->vpn_manager = nm_vpn_manager_get ();
+ priv->vpn_manager = g_object_ref (nm_vpn_manager_get ());
g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr);
@@ -4817,10 +4915,10 @@ nm_manager_init (NMManager *manager)
nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy");
/* sleep/wake handling */
- priv->sleep_monitor = nm_sleep_monitor_get ();
- g_signal_connect (priv->sleep_monitor, "sleeping",
+ priv->sleep_monitor = g_object_ref (nm_sleep_monitor_get ());
+ g_signal_connect (priv->sleep_monitor, NM_SLEEP_MONITOR_SLEEPING,
G_CALLBACK (sleeping_cb), manager);
- g_signal_connect (priv->sleep_monitor, "resuming",
+ g_signal_connect (priv->sleep_monitor, NM_SLEEP_MONITOR_RESUMING,
G_CALLBACK (resuming_cb), manager);
/* Listen for authorization changes */
@@ -4989,9 +5087,7 @@ dispose (GObject *object)
G_CALLBACK (authority_changed_cb),
manager);
- /* Remove all devices */
- while (priv->devices)
- remove_device (manager, NM_DEVICE (priv->devices->data), TRUE, TRUE);
+ g_assert (priv->devices == NULL);
if (priv->ac_cleanup_id) {
g_source_remove (priv->ac_cleanup_id);
@@ -5004,7 +5100,14 @@ dispose (GObject *object)
g_clear_object (&priv->primary_connection);
g_clear_object (&priv->activating_connection);
- g_clear_object (&priv->connectivity);
+ if (priv->config) {
+ g_signal_handlers_disconnect_by_func (priv->config, _config_changed_cb, manager);
+ g_clear_object (&priv->config);
+ }
+ if (priv->connectivity) {
+ g_signal_handlers_disconnect_by_func (priv->connectivity, connectivity_changed, manager);
+ g_clear_object (&priv->connectivity);
+ }
g_free (priv->hostname);
@@ -5015,6 +5118,7 @@ dispose (GObject *object)
}
g_clear_object (&priv->settings);
+ g_free (priv->state_file);
g_clear_object (&priv->vpn_manager);
/* Unregister property filter */
@@ -5032,7 +5136,11 @@ dispose (GObject *object)
}
g_clear_object (&priv->aipd_proxy);
- g_clear_object (&priv->sleep_monitor);
+ if (priv->sleep_monitor) {
+ g_signal_handlers_disconnect_by_func (priv->sleep_monitor, sleeping_cb, manager);
+ g_signal_handlers_disconnect_by_func (priv->sleep_monitor, resuming_cb, manager);
+ g_clear_object (&priv->sleep_monitor);
+ }
if (priv->fw_monitor) {
g_signal_handlers_disconnect_by_func (priv->fw_monitor, firmware_dir_changed, manager);
@@ -5257,6 +5365,13 @@ nm_manager_class_init (NMManagerClass *manager_class)
0, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_OBJECT);
+ signals[CONFIGURE_QUIT] =
+ g_signal_new (NM_MANAGER_CONFIGURE_QUIT,
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
+
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (manager_class),
&dbus_glib_nm_manager_object_info);
diff --git a/src/nm-manager.h b/src/nm-manager.h
index f623516159..3b00e8053a 100644
--- a/src/nm-manager.h
+++ b/src/nm-manager.h
@@ -59,6 +59,7 @@
/* Internal signals */
#define NM_MANAGER_ACTIVE_CONNECTION_ADDED "active-connection-added"
#define NM_MANAGER_ACTIVE_CONNECTION_REMOVED "active-connection-removed"
+#define NM_MANAGER_CONFIGURE_QUIT "configure-quit"
struct _NMManager {
@@ -88,6 +89,7 @@ NMManager * nm_manager_new (NMSettings *settings,
NMManager * nm_manager_get (void);
void nm_manager_start (NMManager *manager);
+void nm_manager_stop (NMManager *manager);
NMState nm_manager_get_state (NMManager *manager);
const GSList *nm_manager_get_active_connections (NMManager *manager);
GSList * nm_manager_get_activatable_connections (NMManager *manager);
diff --git a/src/nm-policy.c b/src/nm-policy.c
index e21df28a9c..d995421a33 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -19,7 +19,8 @@
* Copyright (C) 2007 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <unistd.h>
#include <errno.h>
@@ -32,6 +33,7 @@
#include "nm-activation-request.h"
#include "nm-logging.h"
#include "nm-device.h"
+#include "nm-default-route-manager.h"
#include "nm-dbus-manager.h"
#include "nm-setting-ip4-config.h"
#include "nm-setting-connection.h"
@@ -100,164 +102,22 @@ static NMDevice *
get_best_ip4_device (NMPolicy *self, gboolean fully_activated)
{
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self);
- const GSList *iter;
- NMDevice *best = NULL;
- int best_prio = G_MAXINT;
-
- for (iter = nm_manager_get_devices (priv->manager); iter; iter = g_slist_next (iter)) {
- NMDevice *dev = NM_DEVICE (iter->data);
- NMDeviceType devtype = nm_device_get_device_type (dev);
- NMDeviceState state = nm_device_get_state (dev);
- NMActRequest *req;
- NMConnection *connection;
- NMSettingIP4Config *s_ip4;
- int prio;
- const char *method = NULL;
-
- if ( state <= NM_DEVICE_STATE_DISCONNECTED
- || state >= NM_DEVICE_STATE_DEACTIVATING)
- continue;
-
- if (fully_activated && state < NM_DEVICE_STATE_SECONDARIES)
- continue;
-
- if (fully_activated) {
- NMIP4Config *ip4_config;
-
- ip4_config = nm_device_get_ip4_config (dev);
- if (!ip4_config)
- continue;
-
- /* Make sure the device has a gateway */
- if (!nm_ip4_config_get_gateway (ip4_config) && (devtype != NM_DEVICE_TYPE_MODEM))
- continue;
-
- /* 'never-default' devices can't ever be the default */
- if (nm_ip4_config_get_never_default (ip4_config))
- continue;
- }
-
- req = nm_device_get_act_request (dev);
- g_assert (req);
- connection = nm_act_request_get_connection (req);
- g_assert (connection);
-
- method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG);
- /* If IPv4 is disabled or link-local-only, it can't be the default */
- if ( !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)
- || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL))
- continue;
- /* 'never-default' devices can't ever be the default */
- s_ip4 = nm_connection_get_setting_ip4_config (connection);
- g_assert (s_ip4);
- if (nm_setting_ip4_config_get_never_default (s_ip4))
- continue;
-
- prio = nm_device_get_priority (dev);
- if ( prio < best_prio
- || (priv->default_device4 == dev && prio == best_prio)
- || !best) {
- best = dev;
- best_prio = prio;
- }
- }
-
- if (!best)
- return NULL;
-
- if (!fully_activated) {
- NMDeviceState state = nm_device_get_state (best);
-
- /* There's only a best activating device if the best device
- * among all activating and already-activated devices is a
- * still-activating one.
- */
- if (state >= NM_DEVICE_STATE_SECONDARIES)
- return NULL;
- }
-
- return best;
+ return nm_default_route_manager_ip4_get_best_device (nm_default_route_manager_get (),
+ nm_manager_get_devices (priv->manager),
+ fully_activated,
+ priv->default_device4);
}
static NMDevice *
get_best_ip6_device (NMPolicy *self, gboolean fully_activated)
{
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self);
- const GSList *iter;
- NMDevice *best = NULL;
- int best_prio = G_MAXINT;
- for (iter = nm_manager_get_devices (priv->manager); iter; iter = g_slist_next (iter)) {
- NMDevice *dev = NM_DEVICE (iter->data);
- NMDeviceType devtype = nm_device_get_device_type (dev);
- NMDeviceState state = nm_device_get_state (dev);
- NMActRequest *req;
- NMConnection *connection;
- NMSettingIP6Config *s_ip6;
- int prio;
- const char *method = NULL;
-
- if ( state <= NM_DEVICE_STATE_DISCONNECTED
- || state >= NM_DEVICE_STATE_DEACTIVATING)
- continue;
-
- if (fully_activated && state < NM_DEVICE_STATE_SECONDARIES)
- continue;
-
- if (fully_activated) {
- NMIP6Config *ip6_config;
-
- ip6_config = nm_device_get_ip6_config (dev);
- if (!ip6_config)
- continue;
-
- if (!nm_ip6_config_get_gateway (ip6_config) && (devtype != NM_DEVICE_TYPE_MODEM))
- continue;
-
- if (nm_ip6_config_get_never_default (ip6_config))
- continue;
- }
-
- req = nm_device_get_act_request (dev);
- g_assert (req);
- connection = nm_act_request_get_connection (req);
- g_assert (connection);
-
- method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG);
- if ( !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)
- || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL))
- continue;
-
- s_ip6 = nm_connection_get_setting_ip6_config (connection);
- g_assert (s_ip6);
- if (nm_setting_ip6_config_get_never_default (s_ip6))
- continue;
-
- prio = nm_device_get_priority (dev);
- if ( prio < best_prio
- || (priv->default_device6 == dev && prio == best_prio)
- || !best) {
- best = dev;
- best_prio = prio;
- }
- }
-
- if (!best)
- return NULL;
-
- if (!fully_activated) {
- NMDeviceState state = nm_device_get_state (best);
-
- /* There's only a best activating device if the best device
- * among all activating and already-activated devices is an
- * activating one.
- */
- if (state >= NM_DEVICE_STATE_SECONDARIES)
- return NULL;
- }
-
- return best;
+ return nm_default_route_manager_ip6_get_best_device (nm_default_route_manager_get (),
+ nm_manager_get_devices (priv->manager),
+ fully_activated,
+ priv->default_device6);
}
#define FALLBACK_HOSTNAME4 "localhost.localdomain"
@@ -473,12 +333,14 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6)
const NMPlatformIP4Address *addr4;
addr4 = nm_ip4_config_get_address (ip4_config, 0);
+ g_clear_object (&priv->lookup_addr);
priv->lookup_addr = g_inet_address_new_from_bytes ((guint8 *) &addr4->address,
G_SOCKET_FAMILY_IPV4);
} else if (ip6_config && nm_ip6_config_get_num_addresses (ip6_config) > 0) {
const NMPlatformIP6Address *addr6;
addr6 = nm_ip6_config_get_address (ip6_config, 0);
+ g_clear_object (&priv->lookup_addr);
priv->lookup_addr = g_inet_address_new_from_bytes ((guint8 *) &addr6->address,
G_SOCKET_FAMILY_IPV6);
} else {
@@ -518,90 +380,19 @@ update_default_ac (NMPolicy *policy,
}
static NMIP4Config *
-get_best_ip4_config (NMPolicy *policy,
+get_best_ip4_config (NMPolicy *self,
gboolean ignore_never_default,
const char **out_ip_iface,
- int *out_ip_ifindex,
NMActiveConnection **out_ac,
NMDevice **out_device,
NMVpnConnection **out_vpn)
{
- NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy);
- const GSList *connections, *iter;
- NMDevice *device;
- NMActRequest *req = NULL;
- NMIP4Config *ip4_config = NULL;
-
- /* If a VPN connection is active, it is preferred */
- connections = nm_manager_get_active_connections (priv->manager);
- for (iter = connections; iter; iter = g_slist_next (iter)) {
- NMActiveConnection *active = NM_ACTIVE_CONNECTION (iter->data);
- NMVpnConnection *candidate;
- NMIP4Config *vpn_ip4;
- NMConnection *tmp;
- NMSettingIP4Config *s_ip4;
- NMVpnConnectionState vpn_state;
-
- if (!NM_IS_VPN_CONNECTION (active))
- continue;
-
- candidate = NM_VPN_CONNECTION (active);
-
- tmp = nm_active_connection_get_connection (active);
- g_assert (tmp);
-
- vpn_state = nm_vpn_connection_get_vpn_state (candidate);
- if (vpn_state != NM_VPN_CONNECTION_STATE_ACTIVATED)
- continue;
-
- vpn_ip4 = nm_vpn_connection_get_ip4_config (candidate);
- if (!vpn_ip4)
- continue;
-
- if (ignore_never_default == FALSE) {
- /* Check for a VPN-provided config never-default */
- if (nm_ip4_config_get_never_default (vpn_ip4))
- continue;
-
- /* Check the user's preference from the NMConnection */
- s_ip4 = nm_connection_get_setting_ip4_config (tmp);
- if (nm_setting_ip4_config_get_never_default (s_ip4))
- continue;
- }
-
- ip4_config = vpn_ip4;
- if (out_vpn)
- *out_vpn = candidate;
- if (out_ac)
- *out_ac = active;
- if (out_ip_iface)
- *out_ip_iface = nm_vpn_connection_get_ip_iface (candidate);
- if (out_ip_ifindex)
- *out_ip_ifindex = nm_vpn_connection_get_ip_ifindex (candidate);
- break;
- }
-
- /* If no VPN connections, we use the best device instead */
- if (!ip4_config) {
- device = get_best_ip4_device (policy, TRUE);
- if (device) {
- ip4_config = nm_device_get_ip4_config (device);
- g_assert (ip4_config);
- req = nm_device_get_act_request (device);
- g_assert (req);
-
- if (out_device)
- *out_device = device;
- if (out_ac)
- *out_ac = NM_ACTIVE_CONNECTION (req);
- if (out_ip_iface)
- *out_ip_iface = nm_device_get_ip_iface (device);
- if (out_ip_ifindex)
- *out_ip_ifindex = nm_device_get_ip_ifindex (device);
- }
- }
-
- return ip4_config;
+ return nm_default_route_manager_ip4_get_best_config (nm_default_route_manager_get (),
+ ignore_never_default,
+ out_ip_iface,
+ out_ac,
+ out_device,
+ out_vpn);
}
static void
@@ -612,7 +403,7 @@ update_ip4_dns (NMPolicy *policy, NMDnsManager *dns_mgr)
NMVpnConnection *vpn = NULL;
NMDnsIPConfigType dns_type = NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE;
- ip4_config = get_best_ip4_config (policy, TRUE, &ip_iface, NULL, NULL, NULL, &vpn);
+ ip4_config = get_best_ip4_config (policy, TRUE, &ip_iface, NULL, NULL, &vpn);
if (ip4_config) {
if (vpn)
dns_type = NM_DNS_IP_CONFIG_TYPE_VPN;
@@ -632,16 +423,12 @@ update_ip4_routing (NMPolicy *policy, gboolean force_update)
NMConnection *connection = NULL;
NMVpnConnection *vpn = NULL;
NMActiveConnection *best_ac = NULL;
- NMIP4Config *ip4_config = NULL;
const char *ip_iface = NULL;
- int ip_ifindex = -1;
- guint32 gw_addr = 0;
/* Note that we might have an IPv4 VPN tunneled over an IPv6-only device,
* so we can get (vpn != NULL && best == NULL).
*/
- ip4_config = get_best_ip4_config (policy, FALSE, &ip_iface, &ip_ifindex, &best_ac, &best, &vpn);
- if (!ip4_config) {
+ if (!get_best_ip4_config (policy, FALSE, &ip_iface, &best_ac, &best, &vpn)) {
gboolean changed;
changed = (priv->default_device4 != NULL);
@@ -656,8 +443,6 @@ update_ip4_routing (NMPolicy *policy, gboolean force_update)
if (!force_update && best && (best == priv->default_device4))
return;
- gw_addr = nm_ip4_config_get_gateway (ip4_config);
-
if (best) {
const GSList *connections, *iter;
@@ -672,50 +457,10 @@ update_ip4_routing (NMPolicy *policy, gboolean force_update)
}
}
- if (vpn) {
- NMDevice *parent = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (vpn));
- int parent_ifindex = nm_device_get_ip_ifindex (parent);
- NMIP4Config *parent_ip4 = nm_device_get_ip4_config (parent);
- guint32 parent_mss = parent_ip4 ? nm_ip4_config_get_mss (parent_ip4) : 0;
- in_addr_t int_gw = nm_vpn_connection_get_ip4_internal_gateway (vpn);
- int mss = nm_ip4_config_get_mss (ip4_config);
-
- /* If no VPN interface, use the parent interface */
- if (ip_ifindex <= 0)
- ip_ifindex = parent_ifindex;
-
- if (!nm_platform_ip4_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_VPN,
- 0, 0, int_gw,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss)) {
- (void) nm_platform_ip4_route_add (parent_ifindex, NM_IP_CONFIG_SOURCE_VPN,
- gw_addr, 32, 0,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, parent_mss);
- if (!nm_platform_ip4_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_VPN,
- 0, 0, int_gw,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss))
- nm_log_err (LOGD_IP4 | LOGD_VPN, "Failed to set default route.");
- }
-
+ if (vpn)
default_device = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (vpn));
- } else {
- int mss = nm_ip4_config_get_mss (ip4_config);
-
- g_assert (ip_iface);
- if (!nm_platform_ip4_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_USER,
- 0, 0, gw_addr,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss)) {
- (void) nm_platform_ip4_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_USER,
- gw_addr, 32, 0,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss);
- if (!nm_platform_ip4_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_USER,
- 0, 0, gw_addr,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss)) {
- nm_log_err (LOGD_IP4, "Failed to set default route.");
- }
- }
-
+ else
default_device = best;
- }
update_default_ac (policy, best_ac, nm_active_connection_set_default);
@@ -730,90 +475,19 @@ update_ip4_routing (NMPolicy *policy, gboolean force_update)
}
static NMIP6Config *
-get_best_ip6_config (NMPolicy *policy,
+get_best_ip6_config (NMPolicy *self,
gboolean ignore_never_default,
const char **out_ip_iface,
- int *out_ip_ifindex,
NMActiveConnection **out_ac,
NMDevice **out_device,
NMVpnConnection **out_vpn)
{
- NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy);
- const GSList *connections, *iter;
- NMDevice *device;
- NMActRequest *req = NULL;
- NMIP6Config *ip6_config = NULL;
-
- /* If a VPN connection is active, it is preferred */
- connections = nm_manager_get_active_connections (priv->manager);
- for (iter = connections; iter; iter = g_slist_next (iter)) {
- NMActiveConnection *active = NM_ACTIVE_CONNECTION (iter->data);
- NMVpnConnection *candidate;
- NMIP6Config *vpn_ip6;
- NMConnection *tmp;
- NMSettingIP6Config *s_ip6;
- NMVpnConnectionState vpn_state;
-
- if (!NM_IS_VPN_CONNECTION (active))
- continue;
-
- candidate = NM_VPN_CONNECTION (active);
-
- tmp = nm_active_connection_get_connection (active);
- g_assert (tmp);
-
- vpn_state = nm_vpn_connection_get_vpn_state (candidate);
- if (vpn_state != NM_VPN_CONNECTION_STATE_ACTIVATED)
- continue;
-
- vpn_ip6 = nm_vpn_connection_get_ip6_config (candidate);
- if (!vpn_ip6)
- continue;
-
- if (ignore_never_default == FALSE) {
- /* Check for a VPN-provided config never-default */
- if (nm_ip6_config_get_never_default (vpn_ip6))
- continue;
-
- /* Check the user's preference from the NMConnection */
- s_ip6 = nm_connection_get_setting_ip6_config (tmp);
- if (nm_setting_ip6_config_get_never_default (s_ip6))
- continue;
- }
-
- ip6_config = vpn_ip6;
- if (out_vpn)
- *out_vpn = candidate;
- if (out_ac)
- *out_ac = NM_ACTIVE_CONNECTION (candidate);
- if (out_ip_iface)
- *out_ip_iface = nm_vpn_connection_get_ip_iface (candidate);
- if (out_ip_ifindex)
- *out_ip_ifindex = nm_vpn_connection_get_ip_ifindex (candidate);
- break;
- }
-
- /* If no VPN connections, we use the best device instead */
- if (!ip6_config) {
- device = get_best_ip6_device (policy, TRUE);
- if (device) {
- req = nm_device_get_act_request (device);
- g_assert (req);
- ip6_config = nm_device_get_ip6_config (device);
- g_assert (ip6_config);
-
- if (out_device)
- *out_device = device;
- if (out_ac)
- *out_ac = NM_ACTIVE_CONNECTION (req);
- if (out_ip_iface)
- *out_ip_iface = nm_device_get_ip_iface (device);
- if (out_ip_ifindex)
- *out_ip_ifindex = nm_device_get_ip_ifindex (device);
- }
- }
-
- return ip6_config;
+ return nm_default_route_manager_ip6_get_best_config (nm_default_route_manager_get (),
+ ignore_never_default,
+ out_ip_iface,
+ out_ac,
+ out_device,
+ out_vpn);
}
static void
@@ -824,7 +498,7 @@ update_ip6_dns (NMPolicy *policy, NMDnsManager *dns_mgr)
NMVpnConnection *vpn = NULL;
NMDnsIPConfigType dns_type = NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE;
- ip6_config = get_best_ip6_config (policy, TRUE, &ip_iface, NULL, NULL, NULL, &vpn);
+ ip6_config = get_best_ip6_config (policy, TRUE, &ip_iface, NULL, NULL, &vpn);
if (ip6_config) {
if (vpn)
dns_type = NM_DNS_IP_CONFIG_TYPE_VPN;
@@ -844,16 +518,12 @@ update_ip6_routing (NMPolicy *policy, gboolean force_update)
NMConnection *connection = NULL;
NMVpnConnection *vpn = NULL;
NMActiveConnection *best_ac = NULL;
- NMIP6Config *ip6_config = NULL;
const char *ip_iface = NULL;
- int ip_ifindex = -1;
- const struct in6_addr *gw_addr;
/* Note that we might have an IPv6 VPN tunneled over an IPv4-only device,
* so we can get (vpn != NULL && best == NULL).
*/
- ip6_config = get_best_ip6_config (policy, FALSE, &ip_iface, &ip_ifindex, &best_ac, &best, &vpn);
- if (!ip6_config) {
+ if (!get_best_ip6_config (policy, FALSE, &ip_iface, &best_ac, &best, &vpn)) {
gboolean changed;
changed = (priv->default_device6 != NULL);
@@ -868,13 +538,6 @@ update_ip6_routing (NMPolicy *policy, gboolean force_update)
if (!force_update && best && (best == priv->default_device6))
return;
- /* If no better gateway is found, use ::; not all configurations will
- * have a gateway, especially WWAN/Point-to-Point connections.
- */
- gw_addr = nm_ip6_config_get_gateway (ip6_config);
- if (!gw_addr)
- gw_addr = &in6addr_any;
-
if (best) {
const GSList *connections, *iter;
@@ -889,52 +552,10 @@ update_ip6_routing (NMPolicy *policy, gboolean force_update)
}
}
- if (vpn) {
- NMDevice *parent = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (vpn));
- int parent_ifindex = nm_device_get_ip_ifindex (parent);
- NMIP6Config *parent_ip6 = nm_device_get_ip6_config (parent);
- guint32 parent_mss = parent_ip6 ? nm_ip6_config_get_mss (parent_ip6) : 0;
- const struct in6_addr *int_gw = nm_vpn_connection_get_ip6_internal_gateway (vpn);
- int mss = nm_ip6_config_get_mss (ip6_config);
-
- if (!int_gw)
- int_gw = &in6addr_any;
-
- /* If no VPN interface, use the parent interface */
- if (ip_ifindex <= 0)
- ip_ifindex = parent_ifindex;
-
- if (!nm_platform_ip6_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_VPN,
- in6addr_any, 0, *int_gw,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss)) {
- (void) nm_platform_ip6_route_add (parent_ifindex, NM_IP_CONFIG_SOURCE_VPN,
- *gw_addr, 128, in6addr_any,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, parent_mss);
- if (!nm_platform_ip6_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_VPN,
- in6addr_any, 0, *int_gw,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss)) {
- nm_log_err (LOGD_IP6 | LOGD_VPN, "Failed to set default route.");
- }
- }
-
+ if (vpn)
default_device6 = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (vpn));
- } else {
- int mss = nm_ip6_config_get_mss (ip6_config);
-
- if (!nm_platform_ip6_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_USER,
- in6addr_any, 0, *gw_addr,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss)) {
- (void) nm_platform_ip6_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_USER,
- *gw_addr, 128, in6addr_any,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss);
- if (!nm_platform_ip6_route_add (ip_ifindex, NM_IP_CONFIG_SOURCE_USER,
- in6addr_any, 0, *gw_addr,
- NM_PLATFORM_ROUTE_METRIC_DEFAULT, mss))
- nm_log_err (LOGD_IP6, "Failed to set default route.");
- }
-
+ else
default_device6 = best;
- }
update_default_ac (policy, best_ac, nm_active_connection_set_default6);
@@ -1955,7 +1576,8 @@ firewall_update_zone (NMPolicy *policy, NMConnection *connection)
NMDevice *dev = NM_DEVICE (iter->data);
if ( (nm_device_get_connection (dev) == connection)
- && (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED)) {
+ && (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED)
+ && !nm_device_uses_assumed_connection (dev)) {
nm_firewall_manager_add_or_change_zone (nm_firewall_manager_get (),
nm_device_get_ip_iface (dev),
nm_setting_connection_get_zone (s_con),
@@ -1985,7 +1607,8 @@ firewall_started (NMFirewallManager *manager,
continue;
s_con = nm_connection_get_setting_connection (connection);
- if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) {
+ if ( nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED
+ && !nm_device_uses_assumed_connection (dev)) {
nm_firewall_manager_add_or_change_zone (nm_firewall_manager_get (),
nm_device_get_ip_iface (dev),
nm_setting_connection_get_zone (s_con),
@@ -2015,9 +1638,10 @@ dns_config_changed (NMDnsManager *dns_manager, gpointer user_data)
/* Re-start the hostname lookup thread if we don't have hostname yet. */
if (priv->lookup_addr) {
- char *str = g_inet_address_to_string (priv->lookup_addr);
+ char *str = NULL;
- nm_log_dbg (LOGD_DNS, "restarting reverse-lookup thread for address %s", str);
+ nm_log_dbg (LOGD_DNS, "restarting reverse-lookup thread for address %s",
+ (str = g_inet_address_to_string (priv->lookup_addr)));
g_free (str);
priv->lookup_cancellable = g_cancellable_new ();
@@ -2164,7 +1788,7 @@ nm_policy_new (NMManager *manager, NMSettings *settings)
priv->fw_started_id = g_signal_connect (nm_firewall_manager_get (), "started",
G_CALLBACK (firewall_started), policy);
- priv->dns_manager = nm_dns_manager_get ();
+ priv->dns_manager = g_object_ref (nm_dns_manager_get ());
nm_dns_manager_set_initial_hostname (priv->dns_manager, priv->orig_hostname);
priv->config_changed_id = g_signal_connect (priv->dns_manager, "config-changed",
G_CALLBACK (dns_config_changed), policy);
@@ -2275,7 +1899,7 @@ dispose (GObject *object)
if (priv->dns_manager) {
g_signal_handler_disconnect (priv->dns_manager, priv->config_changed_id);
- priv->dns_manager = NULL;
+ g_clear_object (&priv->dns_manager);
}
for (iter = priv->manager_ids; iter; iter = g_slist_next (iter))
diff --git a/src/nm-posix-signals.c b/src/nm-posix-signals.c
deleted file mode 100644
index 22fed83103..0000000000
--- a/src/nm-posix-signals.c
+++ /dev/null
@@ -1,62 +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 (C) 2012 Red Hat, Inc.
- */
-
-#include "config.h"
-
-#include <signal.h>
-
-#include "nm-posix-signals.h"
-
-
-/* Stores the original signal mask of NetworkManager process */
-static sigset_t nm_original_signal_mask;
-
-void
-nm_save_original_signal_mask (sigset_t sig_mask)
-{
- nm_original_signal_mask = sig_mask;
-}
-
-const sigset_t *
-nm_get_original_signal_mask (void)
-{
- return &nm_original_signal_mask;
-}
-
-/*
- * Unblock signals.
- * If a signal set is passed, those signals are unblocked. If user_data is NULL
- * the process' signal mask is set to the saved original mask.
- * Note: This function can be used in g_spawn_* as GSpawnChildSetupFunc()
- * callback.
- */
-void
-nm_unblock_posix_signals (gpointer user_data)
-{
- sigset_t *user_sigset = (sigset_t *) user_data;
-
- if (user_sigset != NULL) {
- pthread_sigmask (SIG_UNBLOCK, user_sigset, NULL);
- } else {
- const sigset_t *orig_sig_mask = nm_get_original_signal_mask ();
- pthread_sigmask (SIG_SETMASK, orig_sig_mask, NULL);
- }
-}
-
diff --git a/src/nm-properties-changed-signal.c b/src/nm-properties-changed-signal.c
index 6e07c25709..c6dbb3d532 100644
--- a/src/nm-properties-changed-signal.c
+++ b/src/nm-properties-changed-signal.c
@@ -19,6 +19,8 @@
* Copyright (C) 2008 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <stdio.h>
@@ -146,8 +148,8 @@ notify (GObject *object, GParamSpec *pspec)
break;
}
if (!dbus_property_name) {
- nm_log_dbg (LOGD_DBUS_PROPS, "ignoring notification for prop %s on type %s",
- pspec->name, G_OBJECT_TYPE_NAME (object));
+ nm_log_trace (LOGD_DBUS_PROPS, "ignoring notification for prop %s on type %s",
+ pspec->name, G_OBJECT_TYPE_NAME (object));
return;
}
@@ -226,16 +228,21 @@ nm_properties_changed_signal_add_property (GType type,
if (!classinfo)
classinfo = nm_properties_changed_signal_setup_type (type);
+ g_assert (!g_hash_table_contains (classinfo->exported_props, (char *) gobject_property_name));
g_hash_table_insert (classinfo->exported_props,
(char *) gobject_property_name,
(char *) dbus_property_name);
+ if (!strchr (gobject_property_name, '_'))
+ return;
hyphen_name = g_strdup (gobject_property_name);
for (p = hyphen_name; *p; p++) {
if (*p == '_')
*p = '-';
}
+ g_assert (!g_hash_table_contains (classinfo->exported_props, hyphen_name));
g_hash_table_insert (classinfo->exported_props,
- hyphen_name,
+ (char *) g_intern_string (hyphen_name),
(char *) dbus_property_name);
+ g_free (hyphen_name);
}
diff --git a/src/nm-rfkill-manager.c b/src/nm-rfkill-manager.c
index b02f85f549..27f3ca0124 100644
--- a/src/nm-rfkill-manager.c
+++ b/src/nm-rfkill-manager.c
@@ -18,7 +18,7 @@
* Copyright (C) 2009 - 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <string.h>
#include <gudev/gudev.h>
diff --git a/src/nm-route-manager.c b/src/nm-route-manager.c
new file mode 100644
index 0000000000..94f0cbbf3f
--- /dev/null
+++ b/src/nm-route-manager.c
@@ -0,0 +1,376 @@
+/* -*- 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 (C) 2015 Red Hat, Inc.
+ */
+
+#include <string.h>
+
+#include "config.h"
+
+#include "nm-route-manager.h"
+#include "nm-platform.h"
+#include "nm-logging.h"
+
+#include "NetworkManagerUtils.h"
+
+typedef struct {
+ GArray *ip4_routes;
+ GArray *ip6_routes;
+} NMRouteManagerPrivate;
+
+#define NM_ROUTE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ROUTE_MANAGER, NMRouteManagerPrivate))
+
+G_DEFINE_TYPE (NMRouteManager, nm_route_manager, G_TYPE_OBJECT)
+
+static const NMPlatformIP4Route *
+array_get_ip4_route (const GArray *routes, int ifindex, const NMPlatformIP4Route *route)
+{
+ guint len = routes ? routes->len : 0;
+ guint i;
+
+ for (i = 0; i < len; i++) {
+ NMPlatformIP4Route *c = &g_array_index (routes, NMPlatformIP4Route, i);
+
+ if (ifindex) {
+ /* Looking for a specific route. */
+ if ( c->ifindex != ifindex
+ || route->mss != c->mss
+ || route->gateway != c->gateway)
+ continue;
+ }
+
+ if (route->network == c->network &&
+ route->plen == c->plen &&
+ route->metric == c->metric)
+ return c;
+ }
+
+ return NULL;
+}
+
+static const NMPlatformIP6Route *
+array_get_ip6_route (const GArray *routes, int ifindex, const NMPlatformIP6Route *route)
+{
+ guint len = routes ? routes->len : 0;
+ guint i;
+
+ for (i = 0; i < len; i++) {
+ NMPlatformIP6Route *c = &g_array_index (routes, NMPlatformIP6Route, i);
+ int route_metric = nm_utils_ip6_route_metric_normalize (route->metric);
+ int c_metric = nm_utils_ip6_route_metric_normalize (c->metric);
+
+ if (ifindex) {
+ /* Looking for a specific route. */
+ if ( c->ifindex != ifindex
+ || route->mss != c->mss
+ || !IN6_ARE_ADDR_EQUAL (&route->gateway, &c->gateway))
+ continue;
+ }
+
+ if (IN6_ARE_ADDR_EQUAL (&route->network, &c->network) &&
+ route->plen == c->plen &&
+ route_metric == c_metric)
+ return c;
+ }
+
+ return NULL;
+}
+
+
+/**
+ * nm_route_manager_ip4_route_sync:
+ * @ifindex: Interface index
+ * @known_routes: List of routes
+ *
+ * A convenience function to synchronize routes for a specific interface
+ * with the least possible disturbance. It simply removes routes that are
+ * not listed and adds routes that are.
+ * Default routes are ignored (both in @known_routes and those already
+ * configured on the device).
+ *
+ * Returns: %TRUE on success.
+ */
+gboolean
+nm_route_manager_ip4_route_sync (NMRouteManager *self, int ifindex, const GArray *known_routes)
+{
+ NMRouteManagerPrivate *priv = NM_ROUTE_MANAGER_GET_PRIVATE (self);
+ GArray *plat_routes, *routes = priv->ip4_routes;
+ NMPlatformIP4Route route;
+ const NMPlatformIP4Route *known_route;
+ const NMPlatformIP4Route *existing;
+ gboolean success;
+ int i, i_type;
+
+ /* Learn about routes that platform knows but we don't. */
+ plat_routes = nm_platform_ip4_route_get_all (0, NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT);
+ for (i = 0; i < plat_routes->len; i++) {
+ existing = &g_array_index (plat_routes, NMPlatformIP4Route, i);
+ if (!array_get_ip4_route (routes, existing->ifindex, existing))
+ g_array_append_val (routes, *existing);
+ }
+
+ /* Delete unknown routes */
+ for (i = 0; i < routes->len;) {
+ route = g_array_index (routes, NMPlatformIP4Route, i);
+
+ if (route.ifindex == ifindex) {
+ /* Our route. Keep it? */
+ if (array_get_ip4_route (known_routes, route.ifindex, &route)) {
+ i++;
+ continue;
+ }
+
+ g_array_remove_index (routes, i);
+ } else {
+ i++;
+ }
+
+ existing = array_get_ip4_route (routes, 0, &route);
+ if ( existing
+ && !array_get_ip4_route (plat_routes, existing->ifindex, existing)) {
+ /* The route that should already exist is not there.
+ * Try to add it. */
+ nm_platform_ip4_route_add (existing->ifindex,
+ existing->source,
+ existing->network,
+ existing->plen,
+ existing->gateway,
+ 0,
+ existing->metric,
+ existing->mss);
+
+ /* It's now hopefully in platform. Take a note so that we
+ * don't attempt to add it again. */
+ g_array_append_val (plat_routes, *existing);
+ }
+
+ if (route.ifindex == ifindex) {
+ /* Clean up. */
+ nm_platform_ip4_route_delete (route.ifindex,
+ route.network,
+ route.plen,
+ route.metric);
+ }
+ }
+
+ g_array_unref (plat_routes);
+
+ if (!known_routes)
+ return TRUE;
+
+ /* Add missing routes */
+ for (i_type = 0, success = TRUE; i_type < 2 && success; i_type++) {
+ for (i = 0; i < known_routes->len && success; i++) {
+ known_route = &g_array_index (known_routes, NMPlatformIP4Route, i);
+
+ g_assert (known_route->ifindex);
+
+ if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (known_route))
+ continue;
+
+ if ( (i_type == 0 && known_route->gateway != 0)
+ || (i_type == 1 && known_route->gateway == 0)) {
+ /* Make two runs over the list of routes. On the first, only add
+ * device routes, on the second the others (gateway routes). */
+ continue;
+ }
+
+ /* Ignore routes that already exist */
+ if (!array_get_ip4_route (routes, 0, known_route)) {
+ success = nm_platform_ip4_route_add (known_route->ifindex,
+ known_route->source,
+ known_route->network,
+ known_route->plen,
+ known_route->gateway,
+ 0,
+ known_route->metric,
+ known_route->mss);
+ if (!success && known_route->source < NM_IP_CONFIG_SOURCE_USER) {
+ nm_log_dbg (LOGD_CORE, "ignore error adding IPv4 route to kernel: %s",
+ nm_platform_ip4_route_to_string (known_route));
+ success = TRUE;
+ }
+ }
+
+ if (!array_get_ip4_route (routes, known_route->ifindex, known_route))
+ g_array_append_val (routes, *known_route);
+ }
+ }
+
+ return success;
+}
+
+/**
+ * nm_route_manager_ip6_route_sync:
+ * @ifindex: Interface index
+ * @known_routes: List of routes
+ *
+ * A convenience function to synchronize routes for a specific interface
+ * with the least possible disturbance. It simply removes routes that are
+ * not listed and adds routes that are.
+ * Default routes are ignored (both in @known_routes and those already
+ * configured on the device).
+ *
+ * Returns: %TRUE on success.
+ */
+gboolean
+nm_route_manager_ip6_route_sync (NMRouteManager *self, int ifindex, const GArray *known_routes)
+{
+ NMRouteManagerPrivate *priv = NM_ROUTE_MANAGER_GET_PRIVATE (self);
+ GArray *plat_routes, *routes = priv->ip6_routes;
+ NMPlatformIP6Route route;
+ const NMPlatformIP6Route *known_route;
+ const NMPlatformIP6Route *existing;
+ gboolean success;
+ int i, i_type;
+
+ /* Learn about routes that platform knows but we don't. */
+ plat_routes = nm_platform_ip6_route_get_all (0, NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT);
+ for (i = 0; i < plat_routes->len; i++) {
+ existing = &g_array_index (plat_routes, NMPlatformIP6Route, i);
+ if (!array_get_ip6_route (routes, existing->ifindex, existing))
+ g_array_append_val (routes, *existing);
+ }
+
+ for (i = 0; i < routes->len;) {
+ route = g_array_index (routes, NMPlatformIP6Route, i);
+
+ if (route.ifindex == ifindex) {
+ /* Our route. Keep it? */
+ if (array_get_ip6_route (known_routes, route.ifindex, &route)) {
+ i++;
+ continue;
+ }
+
+ g_array_remove_index (routes, i);
+ } else {
+ i++;
+ }
+
+ existing = array_get_ip6_route (routes, 0, &route);
+ if ( existing
+ && !array_get_ip6_route (plat_routes, existing->ifindex, existing)) {
+ /* The route that should already exist is not there.
+ * Try to add it. */
+ nm_platform_ip6_route_add (existing->ifindex,
+ existing->source,
+ existing->network,
+ existing->plen,
+ existing->gateway,
+ existing->metric,
+ existing->mss);
+
+ /* It's now hopefully in platform. Take a note so that we
+ * don't attempt to add it again. */
+ g_array_append_val (plat_routes, *existing);
+ }
+
+ if (route.ifindex == ifindex) {
+ /* Clean up. */
+ nm_platform_ip6_route_delete (route.ifindex,
+ route.network,
+ route.plen,
+ route.metric);
+ }
+ }
+
+ g_array_unref (plat_routes);
+
+ if (!known_routes)
+ return TRUE;
+
+ /* Add missing routes */
+ for (i_type = 0, success = TRUE; i_type < 2 && success; i_type++) {
+ for (i = 0; i < known_routes->len && success; i++) {
+ known_route = &g_array_index (known_routes, NMPlatformIP6Route, i);
+
+ g_assert (known_route->ifindex);
+
+ if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (known_route))
+ continue;
+
+ if ( (i_type == 0 && !IN6_IS_ADDR_UNSPECIFIED (&known_route->gateway))
+ || (i_type == 1 && IN6_IS_ADDR_UNSPECIFIED (&known_route->gateway))) {
+ /* Make two runs over the list of routes. On the first, only add
+ * device routes, on the second the others (gateway routes). */
+ continue;
+ }
+
+ /* Ignore routes that already exist */
+ if (!array_get_ip6_route (routes, 0, known_route)) {
+ success = nm_platform_ip6_route_add (known_route->ifindex,
+ known_route->source,
+ known_route->network,
+ known_route->plen,
+ known_route->gateway,
+ known_route->metric,
+ known_route->mss);
+ if (!success && known_route->source < NM_IP_CONFIG_SOURCE_USER) {
+ nm_log_dbg (LOGD_CORE, "ignore error adding IPv6 route to kernel: %s",
+ nm_platform_ip6_route_to_string (known_route));
+ success = TRUE;
+ }
+ }
+
+ if (!array_get_ip6_route (routes, known_route->ifindex, known_route))
+ g_array_append_val (routes, *known_route);
+ }
+ }
+
+ return success;
+}
+
+gboolean
+nm_route_manager_route_flush (NMRouteManager *self, int ifindex)
+{
+ return nm_route_manager_ip4_route_sync (self, ifindex, NULL)
+ && nm_route_manager_ip6_route_sync (self, ifindex, NULL);
+}
+
+NM_DEFINE_SINGLETON_GETTER (NMRouteManager, nm_route_manager_get, NM_TYPE_ROUTE_MANAGER);
+
+static void
+nm_route_manager_init (NMRouteManager *self)
+{
+ NMRouteManagerPrivate *priv = NM_ROUTE_MANAGER_GET_PRIVATE (self);
+
+ priv->ip4_routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route));
+ priv->ip6_routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP6Route));
+}
+
+static void
+finalize (GObject *object)
+{
+ NMRouteManagerPrivate *priv = NM_ROUTE_MANAGER_GET_PRIVATE (object);
+
+ g_array_free (priv->ip4_routes, TRUE);
+ g_array_free (priv->ip6_routes, TRUE);
+
+ G_OBJECT_CLASS (nm_route_manager_parent_class)->finalize (object);
+}
+
+static void
+nm_route_manager_class_init (NMRouteManagerClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (NMRouteManagerPrivate));
+
+ /* virtual methods */
+ object_class->finalize = finalize;
+}
diff --git a/src/nm-route-manager.h b/src/nm-route-manager.h
new file mode 100644
index 0000000000..4c66ffcd94
--- /dev/null
+++ b/src/nm-route-manager.h
@@ -0,0 +1,51 @@
+/* -*- 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 (C) 2015 Red Hat, Inc.
+ */
+
+#include <glib-object.h>
+
+#include "nm-types.h"
+
+#ifndef __NETWORKMANAGER_ROUTE_MANAGER_H__
+#define __NETWORKMANAGER_ROUTE_MANAGER_H__
+
+#define NM_TYPE_ROUTE_MANAGER (nm_route_manager_get_type ())
+#define NM_ROUTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ROUTE_MANAGER, NMRouteManager))
+#define NM_ROUTE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ROUTE_MANAGER, NMRouteManagerClass))
+#define NM_IS_ROUTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_ROUTE_MANAGER))
+#define NM_IS_ROUTE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_ROUTE_MANAGER))
+#define NM_ROUTE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_ROUTE_MANAGER, NMRouteManagerClass))
+
+struct _NMRouteManager {
+ GObject parent;
+};
+
+typedef struct {
+ GObjectClass parent;
+} NMRouteManagerClass;
+
+GType nm_route_manager_get_type (void);
+
+gboolean nm_route_manager_ip4_route_sync (NMRouteManager *self, int ifindex, const GArray *known_routes);
+gboolean nm_route_manager_ip6_route_sync (NMRouteManager *self, int ifindex, const GArray *known_routes);
+gboolean nm_route_manager_route_flush (NMRouteManager *self, int ifindex);
+
+NMRouteManager *nm_route_manager_get (void);
+
+#endif /* NM_ROUTE_MANAGER_H */
diff --git a/src/nm-session-monitor-ck.c b/src/nm-session-monitor-ck.c
deleted file mode 100644
index 6b8f66f042..0000000000
--- a/src/nm-session-monitor-ck.c
+++ /dev/null
@@ -1,502 +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.
- *
- * (C) Copyright 2008 - 2010 Red Hat, Inc.
- * Author: David Zeuthen <davidz@redhat.com>
- * Author: Dan Williams <dcbw@redhat.com>
- */
-
-#include "config.h"
-#include <errno.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <gio/gio.h>
-#include "nm-logging.h"
-
-#include "nm-session-utils.h"
-#include "nm-session-monitor.h"
-#include "nm-errors.h"
-
-/* <internal>
- * SECTION:nm-session-monitor
- * @title: NMSessionMonitor
- * @short_description: Monitor sessions
- *
- * The #NMSessionMonitor class is a utility class to track and monitor sessions.
- */
-
-struct _NMSessionMonitor {
- GObject parent_instance;
-
- GKeyFile *database;
- GFileMonitor *database_monitor;
- time_t database_mtime;
- GHashTable *sessions_by_uid;
- GHashTable *sessions_by_user;
-};
-
-struct _NMSessionMonitorClass {
- GObjectClass parent_class;
-
- void (*changed) (NMSessionMonitor *monitor);
-};
-
-
-enum {
- CHANGED,
- LAST_SIGNAL,
-};
-static guint signals[LAST_SIGNAL] = {0};
-
-G_DEFINE_TYPE (NMSessionMonitor, nm_session_monitor, G_TYPE_OBJECT);
-
-/********************************************************************/
-
-typedef struct {
- char *user;
- uid_t uid;
- gboolean local;
- gboolean active;
-} Session;
-
-static void
-session_free (Session *s)
-{
- g_free (s->user);
- memset (s, 0, sizeof (Session));
- g_free (s);
-}
-
-static gboolean
-check_key (GKeyFile *keyfile, const char *group, const char *key, GError **error)
-{
- if (g_key_file_has_key (keyfile, group, key, error))
- return TRUE;
-
- if (!error) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "ConsoleKit database " CKDB_PATH " group '%s' had no '%s' key",
- group, key);
- }
- return FALSE;
-}
-
-static Session *
-session_new (GKeyFile *keyfile, const char *group, GError **error)
-{
- GError *local = NULL;
- Session *s;
- const char *uname = NULL;
-
- s = g_new0 (Session, 1);
- g_assert (s);
-
- s->uid = G_MAXUINT; /* paranoia */
- if (!check_key (keyfile, group, "uid", &local))
- goto error;
- s->uid = (uid_t) g_key_file_get_integer (keyfile, group, "uid", &local);
- if (local)
- goto error;
-
- if (!check_key (keyfile, group, "is_active", &local))
- goto error;
- s->active = g_key_file_get_boolean (keyfile, group, "is_active", &local);
- if (local)
- goto error;
-
- if (!check_key (keyfile, group, "is_local", &local))
- goto error;
- s->local = g_key_file_get_boolean (keyfile, group, "is_local", &local);
- if (local)
- goto error;
-
- if (!nm_session_uid_to_user (s->uid, &uname, error))
- return FALSE;
- s->user = g_strdup (uname);
-
- return s;
-
-error:
- session_free (s);
- g_propagate_error (error, local);
- return NULL;
-}
-
-static void
-session_merge (Session *src, Session *dest)
-{
- g_return_if_fail (src != NULL);
- g_return_if_fail (dest != NULL);
-
- g_warn_if_fail (g_strcmp0 (src->user, dest->user) == 0);
- g_warn_if_fail (src->uid == dest->uid);
-
- dest->local = (dest->local || src->local);
- dest->active = (dest->active || src->active);
-}
-
-/********************************************************************/
-
-static void
-free_database (NMSessionMonitor *self)
-{
- if (self->database != NULL) {
- g_key_file_free (self->database);
- self->database = NULL;
- }
-
- g_hash_table_remove_all (self->sessions_by_uid);
- g_hash_table_remove_all (self->sessions_by_user);
-}
-
-static gboolean
-reload_database (NMSessionMonitor *self, GError **error)
-{
- struct stat statbuf;
- char **groups = NULL;
- gsize len = 0, i;
- Session *s;
-
- free_database (self);
-
- errno = 0;
- if (stat (CKDB_PATH, &statbuf) != 0) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "Error statting file " CKDB_PATH ": %s",
- strerror (errno));
- goto error;
- }
- self->database_mtime = statbuf.st_mtime;
-
- self->database = g_key_file_new ();
- if (!g_key_file_load_from_file (self->database, CKDB_PATH, G_KEY_FILE_NONE, error))
- goto error;
-
- groups = g_key_file_get_groups (self->database, &len);
- if (!groups) {
- g_set_error_literal (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "Could not load groups from " CKDB_PATH "");
- goto error;
- }
-
- for (i = 0; i < len; i++) {
- Session *found;
-
- if (!g_str_has_prefix (groups[i], "Session "))
- continue;
-
- s = session_new (self->database, groups[i], error);
- if (!s)
- goto error;
-
- found = g_hash_table_lookup (self->sessions_by_user, (gpointer) s->user);
- if (found) {
- session_merge (s, found);
- session_free (s);
- } else {
- /* Entirely new user */
- g_hash_table_insert (self->sessions_by_user, (gpointer) s->user, s);
- g_hash_table_insert (self->sessions_by_uid, GUINT_TO_POINTER (s->uid), s);
- }
- }
-
- g_strfreev (groups);
- return TRUE;
-
-error:
- if (groups)
- g_strfreev (groups);
- free_database (self);
- return FALSE;
-}
-
-static gboolean
-ensure_database (NMSessionMonitor *self, GError **error)
-{
- gboolean ret = FALSE;
-
- if (self->database != NULL) {
- struct stat statbuf;
-
- errno = 0;
- if (stat (CKDB_PATH, &statbuf) != 0) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "Error statting file " CKDB_PATH " to check timestamp: %s",
- strerror (errno));
- goto out;
- }
-
- if (statbuf.st_mtime == self->database_mtime) {
- ret = TRUE;
- goto out;
- }
- }
-
- ret = reload_database (self, error);
-
-out:
- return ret;
-}
-
-static void
-on_file_monitor_changed (GFileMonitor * file_monitor,
- GFile * file,
- GFile * other_file,
- GFileMonitorEvent event_type,
- gpointer user_data)
-{
- NMSessionMonitor *self = NM_SESSION_MONITOR (user_data);
-
- /* throw away cache */
- free_database (self);
-
- g_signal_emit (self, signals[CHANGED], 0);
-}
-
-static void
-nm_session_monitor_init (NMSessionMonitor *self)
-{
- GError *error = NULL;
- GFile *file;
-
- /* Sessions-by-user is responsible for destroying the Session objects */
- self->sessions_by_user = g_hash_table_new_full (g_str_hash, g_str_equal,
- NULL, (GDestroyNotify) session_free);
- self->sessions_by_uid = g_hash_table_new (g_direct_hash, g_direct_equal);
-
-
- if (!ensure_database (self, &error)) {
- nm_log_dbg (LOGD_CORE, "Error loading " CKDB_PATH ": %s", error->message);
-
- /* Ignore the first error, the CK database might not exist yet */
- g_error_free (error);
- error = NULL;
- }
-
- file = g_file_new_for_path (CKDB_PATH);
- self->database_monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, &error);
- g_object_unref (file);
- if (self->database_monitor == NULL) {
- nm_log_err (LOGD_CORE, "Error monitoring " CKDB_PATH ": %s", error->message);
- g_error_free (error);
- } else {
- g_signal_connect (self->database_monitor,
- "changed",
- G_CALLBACK (on_file_monitor_changed),
- self);
- }
-}
-
-static void
-finalize (GObject *object)
-{
- NMSessionMonitor *self = NM_SESSION_MONITOR (object);
-
- if (self->database_monitor != NULL)
- g_object_unref (self->database_monitor);
-
- free_database (self);
-
- if (G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize != NULL)
- G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize (object);
-}
-
-static void
-nm_session_monitor_class_init (NMSessionMonitorClass *klass)
-{
- GObjectClass *gobject_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
-
- gobject_class->finalize = finalize;
-
- /**
- * NMSessionMonitor::changed:
- * @monitor: A #NMSessionMonitor
- *
- * Emitted when something changes.
- */
- signals[CHANGED] = g_signal_new (NM_SESSION_MONITOR_CHANGED,
- NM_TYPE_SESSION_MONITOR,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NMSessionMonitorClass, changed),
- NULL, /* accumulator */
- NULL, /* accumulator data */
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-}
-
-NMSessionMonitor *
-nm_session_monitor_get (void)
-{
- static NMSessionMonitor *singleton = NULL;
-
- if (!singleton)
- singleton = NM_SESSION_MONITOR (g_object_new (NM_TYPE_SESSION_MONITOR, NULL));
- return singleton;
-}
-
-/* ---------------------------------------------------------------------------------------------------- */
-
-/**
- * nm_session_monitor_user_has_session:
- * @monitor: A #NMSessionMonitor.
- * @username: A username.
- * @error: Return location for error.
- *
- * Checks whether the given @username is logged into a session or not.
- *
- * Returns: %FALSE if @error is set otherwise %TRUE if the given @username is
- * currently logged into a session.
- */
-gboolean
-nm_session_monitor_user_has_session (NMSessionMonitor *monitor,
- const char *username,
- uid_t *out_uid,
- GError **error)
-{
- Session *s;
-
- if (!ensure_database (monitor, error))
- return FALSE;
-
- s = g_hash_table_lookup (monitor->sessions_by_user, (gpointer) username);
- if (!s) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "No session found for user '%s'",
- username);
- return FALSE;
- }
-
- if (out_uid)
- *out_uid = s->uid;
- return TRUE;
-}
-
-/**
- * nm_session_monitor_uid_has_session:
- * @monitor: A #NMSessionMonitor.
- * @uid: A user ID.
- * @error: Return location for error.
- *
- * Checks whether the given @uid is logged into a session or not.
- *
- * Returns: %FALSE if @error is set otherwise %TRUE if the given @uid is
- * currently logged into a session.
- */
-gboolean
-nm_session_monitor_uid_has_session (NMSessionMonitor *monitor,
- uid_t uid,
- const char **out_user,
- GError **error)
-{
- Session *s;
-
- if (!ensure_database (monitor, error))
- return FALSE;
-
- s = g_hash_table_lookup (monitor->sessions_by_uid, GUINT_TO_POINTER (uid));
- if (!s) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "No session found for uid %d",
- uid);
- return FALSE;
- }
-
- if (out_user)
- *out_user = s->user;
- return TRUE;
-}
-
-/**
- * nm_session_monitor_user_active:
- * @monitor: A #NMSessionMonitor.
- * @username: A username.
- * @error: Return location for error.
- *
- * Checks whether the given @username is logged into a active session or not.
- *
- * Returns: %FALSE if @error is set otherwise %TRUE if the given @username is
- * logged into an active session.
- */
-gboolean
-nm_session_monitor_user_active (NMSessionMonitor *monitor,
- const char *username,
- GError **error)
-{
- Session *s;
-
- if (!ensure_database (monitor, error))
- return FALSE;
-
- s = g_hash_table_lookup (monitor->sessions_by_user, (gpointer) username);
- if (!s) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "No session found for user '%s'",
- username);
- return FALSE;
- }
-
- return s->active;
-}
-
-/**
- * nm_session_monitor_uid_active:
- * @monitor: A #NMSessionMonitor.
- * @uid: A user ID.
- * @error: Return location for error.
- *
- * Checks whether the given @uid is logged into a active session or not.
- *
- * Returns: %FALSE if @error is set otherwise %TRUE if the given @uid is
- * logged into an active session.
- */
-gboolean
-nm_session_monitor_uid_active (NMSessionMonitor *monitor,
- uid_t uid,
- GError **error)
-{
- Session *s;
-
- if (!ensure_database (monitor, error))
- return FALSE;
-
- s = g_hash_table_lookup (monitor->sessions_by_uid, GUINT_TO_POINTER (uid));
- if (!s) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "No session found for uid '%d'",
- uid);
- return FALSE;
- }
-
- return s->active;
-}
-
diff --git a/src/nm-session-monitor-null.c b/src/nm-session-monitor-null.c
deleted file mode 100644
index 5d8ecaaf1a..0000000000
--- a/src/nm-session-monitor-null.c
+++ /dev/null
@@ -1,168 +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.
- *
- * (C) Copyright 2008 - 2010 Red Hat, Inc.
- * Author: David Zeuthen <davidz@redhat.com>
- * Author: Dan Williams <dcbw@redhat.com>
- */
-
-#include "config.h"
-#include <string.h>
-#include "nm-logging.h"
-
-#include "nm-session-utils.h"
-#include "nm-session-monitor.h"
-
-/* <internal>
- * SECTION:nm-session-monitor
- * @title: NMSessionMonitor
- * @short_description: Monitor sessions
- *
- * The #NMSessionMonitor class is a utility class to track and monitor sessions.
- */
-
-struct _NMSessionMonitor {
- GObject parent_instance;
-};
-
-struct _NMSessionMonitorClass {
- GObjectClass parent_class;
-
- void (*changed) (NMSessionMonitor *monitor);
-};
-
-
-enum {
- CHANGED,
- LAST_SIGNAL,
-};
-static guint signals[LAST_SIGNAL] = {0};
-
-G_DEFINE_TYPE (NMSessionMonitor, nm_session_monitor, G_TYPE_OBJECT);
-
-/********************************************************************/
-
-static void
-nm_session_monitor_init (NMSessionMonitor *self)
-{
-}
-
-static void
-nm_session_monitor_class_init (NMSessionMonitorClass *klass)
-{
- /**
- * NMSessionMonitor::changed:
- * @monitor: A #NMSessionMonitor
- *
- * Emitted when something changes.
- */
- signals[CHANGED] = g_signal_new (NM_SESSION_MONITOR_CHANGED,
- NM_TYPE_SESSION_MONITOR,
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-}
-
-NMSessionMonitor *
-nm_session_monitor_get (void)
-{
- static NMSessionMonitor *singleton = NULL;
-
- if (!singleton)
- singleton = g_object_new (NM_TYPE_SESSION_MONITOR, NULL);
- return singleton;
-}
-
-/* ---------------------------------------------------------------------------------------------------- */
-
-/**
- * nm_session_monitor_user_has_session:
- * @monitor: A #NMSessionMonitor.
- * @username: A username.
- * @error: Return location for error.
- *
- * Checks whether the given @username is logged into a session or not.
- *
- * Returns: %FALSE if @error is set otherwise %TRUE if the given @username is
- * currently logged into a session.
- */
-gboolean
-nm_session_monitor_user_has_session (NMSessionMonitor *monitor,
- const char *username,
- uid_t *out_uid,
- GError **error)
-{
- return nm_session_user_to_uid (username, out_uid, error);
-}
-
-/**
- * nm_session_monitor_uid_has_session:
- * @monitor: A #NMSessionMonitor.
- * @uid: A user ID.
- * @error: Return location for error.
- *
- * Checks whether the given @uid is logged into a session or not.
- *
- * Returns: %FALSE if @error is set otherwise %TRUE if the given @uid is
- * currently logged into a session.
- */
-gboolean
-nm_session_monitor_uid_has_session (NMSessionMonitor *monitor,
- uid_t uid,
- const char **out_user,
- GError **error)
-{
- return nm_session_uid_to_user (uid, out_user, error);
-}
-
-/**
- * nm_session_monitor_user_active:
- * @monitor: A #NMSessionMonitor.
- * @username: A username.
- * @error: Return location for error.
- *
- * Checks whether the given @username is logged into a active session or not.
- *
- * Returns: %FALSE if @error is set otherwise %TRUE if the given @username is
- * logged into an active session.
- */
-gboolean
-nm_session_monitor_user_active (NMSessionMonitor *monitor,
- const char *username,
- GError **error)
-{
- return TRUE;
-}
-
-/**
- * nm_session_monitor_uid_active:
- * @monitor: A #NMSessionMonitor.
- * @uid: A user ID.
- * @error: Return location for error.
- *
- * Checks whether the given @uid is logged into a active session or not.
- *
- * Returns: %FALSE if @error is set otherwise %TRUE if the given @uid is
- * logged into an active session.
- */
-gboolean
-nm_session_monitor_uid_active (NMSessionMonitor *monitor,
- uid_t uid,
- GError **error)
-{
- return TRUE;
-}
-
diff --git a/src/nm-session-monitor-systemd.c b/src/nm-session-monitor-systemd.c
deleted file mode 100644
index f195c1e775..0000000000
--- a/src/nm-session-monitor-systemd.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * Copyright (C) 2011 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * Author: Matthias Clasen
- */
-
-#include "config.h"
-#include <errno.h>
-#include <pwd.h>
-#include <grp.h>
-#include <string.h>
-#include <glib/gstdio.h>
-#include <systemd/sd-login.h>
-#include <stdlib.h>
-
-#include "nm-session-utils.h"
-#include "nm-session-monitor.h"
-#include "nm-logging.h"
-
-/********************************************************************/
-
-typedef struct {
- GSource source;
- GPollFD pollfd;
- sd_login_monitor *monitor;
-} SdSource;
-
-static gboolean
-sd_source_prepare (GSource *source, gint *timeout)
-{
- *timeout = -1;
- return FALSE;
-}
-
-static gboolean
-sd_source_check (GSource *source)
-{
- SdSource *sd_source = (SdSource *) source;
-
- return sd_source->pollfd.revents != 0;
-}
-
-static gboolean
-sd_source_dispatch (GSource *source,
- GSourceFunc callback,
- gpointer user_data)
-
-{
- SdSource *sd_source = (SdSource *)source;
- gboolean ret;
-
- g_warn_if_fail (callback != NULL);
- ret = (*callback) (user_data);
- sd_login_monitor_flush (sd_source->monitor);
- return ret;
-}
-
-static void
-sd_source_finalize (GSource *source)
-{
- SdSource *sd_source = (SdSource*) source;
-
- sd_login_monitor_unref (sd_source->monitor);
-}
-
-static GSourceFuncs sd_source_funcs = {
- sd_source_prepare,
- sd_source_check,
- sd_source_dispatch,
- sd_source_finalize
-};
-
-static GSource *
-sd_source_new (void)
-{
- GSource *source;
- SdSource *sd_source;
- int ret;
-
- source = g_source_new (&sd_source_funcs, sizeof (SdSource));
- sd_source = (SdSource *)source;
-
- ret = sd_login_monitor_new (NULL, &sd_source->monitor);
- if (ret < 0)
- g_printerr ("Error getting login monitor: %d", ret);
- else {
- sd_source->pollfd.fd = sd_login_monitor_get_fd (sd_source->monitor);
- sd_source->pollfd.events = G_IO_IN;
- g_source_add_poll (source, &sd_source->pollfd);
- }
-
- return source;
-}
-
-struct _NMSessionMonitor {
- GObject parent_instance;
-
- GSource *sd_source;
-};
-
-struct _NMSessionMonitorClass {
- GObjectClass parent_class;
-
- void (*changed) (NMSessionMonitor *monitor);
-};
-
-
-enum {
- CHANGED_SIGNAL,
- LAST_SIGNAL,
-};
-static guint signals[LAST_SIGNAL] = {0};
-
-G_DEFINE_TYPE (NMSessionMonitor, nm_session_monitor, G_TYPE_OBJECT);
-
-/* ---------------------------------------------------------------------------------------------------- */
-
-static gboolean
-sessions_changed (gpointer user_data)
-{
- NMSessionMonitor *monitor = NM_SESSION_MONITOR (user_data);
-
- g_signal_emit (monitor, signals[CHANGED_SIGNAL], 0);
- return TRUE;
-}
-
-
-static void
-nm_session_monitor_init (NMSessionMonitor *monitor)
-{
- monitor->sd_source = sd_source_new ();
- g_source_set_callback (monitor->sd_source, sessions_changed, monitor, NULL);
- g_source_attach (monitor->sd_source, NULL);
-}
-
-static void
-nm_session_monitor_finalize (GObject *object)
-{
- NMSessionMonitor *monitor = NM_SESSION_MONITOR (object);
-
- if (monitor->sd_source != NULL) {
- g_source_destroy (monitor->sd_source);
- g_source_unref (monitor->sd_source);
- }
-
- if (G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize != NULL)
- G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize (object);
-}
-
-static void
-nm_session_monitor_class_init (NMSessionMonitorClass *klass)
-{
- GObjectClass *gobject_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = nm_session_monitor_finalize;
-
- /**
- * NMSessionMonitor::changed:
- * @monitor: A #NMSessionMonitor
- *
- * Emitted when something changes.
- */
- signals[CHANGED_SIGNAL] = g_signal_new ("changed",
- NM_TYPE_SESSION_MONITOR,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NMSessionMonitorClass, changed),
- NULL, /* accumulator */
- NULL, /* accumulator data */
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-}
-
-NMSessionMonitor *
-nm_session_monitor_get (void)
-{
- static NMSessionMonitor *singleton = NULL;
-
- if (!singleton)
- singleton = g_object_new (NM_TYPE_SESSION_MONITOR, NULL);
- return singleton;
-}
-
-gboolean
-nm_session_monitor_user_has_session (NMSessionMonitor *monitor,
- const char *username,
- uid_t *out_uid,
- GError **error)
-{
- uid_t uid;
-
- if (!nm_session_user_to_uid (username, &uid, error))
- return FALSE;
-
- if (out_uid)
- *out_uid = uid;
-
- return nm_session_monitor_uid_has_session (monitor, uid, NULL, error);
-}
-
-gboolean
-nm_session_monitor_user_active (NMSessionMonitor *monitor,
- const char *username,
- GError **error)
-{
- uid_t uid;
-
- if (!nm_session_user_to_uid (username, &uid, error))
- return FALSE;
-
- return nm_session_monitor_uid_active (monitor, uid, error);
-}
-
-gboolean
-nm_session_monitor_uid_has_session (NMSessionMonitor *monitor,
- uid_t uid,
- const char **out_user,
- GError **error)
-{
- int num_sessions;
-
- if (!nm_session_uid_to_user (uid, out_user, error))
- return FALSE;
-
- /* Get all sessions (including inactive ones) for the user */
- num_sessions = sd_uid_get_sessions (uid, 0, NULL);
- if (num_sessions < 0) {
- nm_log_warn (LOGD_CORE, "Failed to get systemd sessions for uid %d: %d",
- uid, num_sessions);
- return FALSE;
- }
- return num_sessions > 0;
-}
-
-gboolean
-nm_session_monitor_uid_active (NMSessionMonitor *monitor,
- uid_t uid,
- GError **error)
-{
- int num_sessions;
-
- /* Get active sessions for the user */
- num_sessions = sd_uid_get_sessions (uid, 1, NULL);
- if (num_sessions < 0) {
- nm_log_warn (LOGD_CORE, "Failed to get active systemd sessions for uid %d: %d",
- uid, num_sessions);
- return FALSE;
- }
- return num_sessions > 0;
-}
diff --git a/src/nm-session-monitor.c b/src/nm-session-monitor.c
new file mode 100644
index 0000000000..80d0bcc456
--- /dev/null
+++ b/src/nm-session-monitor.c
@@ -0,0 +1,443 @@
+/* -*- 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.
+ *
+ * (C) Copyright 2008 - 2015 Red Hat, Inc.
+ * Author: David Zeuthen <davidz@redhat.com>
+ * Author: Dan Williams <dcbw@redhat.com>
+ * Author: Matthias Clasen
+ * Author: Pavel Å imerda <psimerda@redhat.com>
+ */
+#include "config.h"
+
+#include <pwd.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <gio/gio.h>
+
+#include "nm-glib-compat.h"
+#include "nm-session-monitor.h"
+#include "nm-logging.h"
+
+#ifdef SESSION_TRACKING_SYSTEMD
+#include <systemd/sd-login.h>
+#endif
+
+/********************************************************************/
+
+/* <internal>
+ * SECTION:nm-session-monitor
+ * @title: NMSessionMonitor
+ * @short_description: Monitor sessions
+ *
+ * The #NMSessionMonitor class is a utility class to track and monitor sessions.
+ */
+struct _NMSessionMonitor {
+ GObject parent_instance;
+
+#ifdef SESSION_TRACKING_SYSTEMD
+ struct {
+ sd_login_monitor *monitor;
+ guint watch;
+ } sd;
+#endif
+
+#ifdef SESSION_TRACKING_CONSOLEKIT
+ struct {
+ GFileMonitor *monitor;
+ GHashTable *cache;
+ time_t timestamp;
+ } ck;
+#endif
+};
+
+struct _NMSessionMonitorClass {
+ GObjectClass parent_class;
+
+ void (*changed) (NMSessionMonitor *monitor);
+};
+
+G_DEFINE_TYPE (NMSessionMonitor, nm_session_monitor, G_TYPE_OBJECT);
+
+enum {
+ CHANGED,
+ LAST_SIGNAL,
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+/********************************************************************/
+
+#ifdef SESSION_TRACKING_SYSTEMD
+static gboolean
+sd_session_exists (NMSessionMonitor *monitor, uid_t uid, gboolean active)
+{
+ int status;
+
+ if (!monitor->sd.monitor)
+ return FALSE;
+
+ status = sd_uid_get_sessions (uid, active, NULL);
+
+ if (status < 0)
+ nm_log_err (LOGD_CORE, "Failed to get systemd sessions for uid %d: %d",
+ uid, status);
+
+ return status > 0;
+}
+
+static gboolean
+sd_changed (GIOChannel *stream, GIOCondition condition, gpointer user_data)
+{
+ NMSessionMonitor *monitor = user_data;
+
+ g_signal_emit (monitor, signals[CHANGED], 0);
+
+ sd_login_monitor_flush (monitor->sd.monitor);
+
+ return TRUE;
+}
+
+static void
+sd_init (NMSessionMonitor *monitor)
+{
+ int status;
+ GIOChannel *stream;
+
+ if (!g_file_test ("/run/systemd/seats/", G_FILE_TEST_EXISTS))
+ return;
+
+ if ((status = sd_login_monitor_new (NULL, &monitor->sd.monitor)) < 0) {
+ nm_log_err (LOGD_CORE, "Failed to create systemd login monitor: %d", status);
+ return;
+ }
+
+ stream = g_io_channel_unix_new (sd_login_monitor_get_fd (monitor->sd.monitor));
+ monitor->sd.watch = g_io_add_watch (stream, G_IO_IN, sd_changed, monitor);
+
+ g_io_channel_unref (stream);
+}
+
+static void
+sd_finalize (NMSessionMonitor *monitor)
+{
+ g_clear_pointer (&monitor->sd.monitor, sd_login_monitor_unref);
+ g_source_remove (monitor->sd.watch);
+}
+#endif /* SESSION_TRACKING_SYSTEMD */
+
+/********************************************************************/
+
+#ifdef SESSION_TRACKING_CONSOLEKIT
+typedef struct {
+ gboolean active;
+} CkSession;
+
+static gboolean
+ck_load_cache (GHashTable *cache)
+{
+ GKeyFile *keyfile = g_key_file_new ();
+ char **groups = NULL;
+ GError *error = NULL;
+ gsize i, len;
+ gboolean finished = FALSE;
+
+ if (!g_key_file_load_from_file (keyfile, CKDB_PATH, G_KEY_FILE_NONE, &error))
+ goto out;
+
+ if (!(groups = g_key_file_get_groups (keyfile, &len))) {
+ nm_log_err (LOGD_CORE, "Could not load groups from " CKDB_PATH);
+ goto out;
+ }
+
+ g_hash_table_remove_all (cache);
+
+ for (i = 0; i < len; i++) {
+ guint uid = G_MAXUINT;
+ CkSession session = { .active = FALSE };
+
+ if (!g_str_has_prefix (groups[i], "CkSession "))
+ continue;
+
+ uid = g_key_file_get_integer (keyfile, groups[i], "uid", &error);
+ if (error)
+ goto out;
+
+ session.active = g_key_file_get_boolean (keyfile, groups[i], "is_active", &error);
+ if (error)
+ goto out;
+
+ g_hash_table_insert (cache, GUINT_TO_POINTER (uid), g_memdup (&session, sizeof session));
+ }
+
+ finished = TRUE;
+out:
+ if (error)
+ nm_log_err (LOGD_CORE, "ConsoleKit: Failed to load database: %s", error->message);
+ g_clear_error (&error);
+ g_clear_pointer (&groups, g_strfreev);
+ g_clear_pointer (&keyfile, g_key_file_free);
+
+ return finished;
+}
+
+static gboolean
+ck_update_cache (NMSessionMonitor *monitor)
+{
+ struct stat statbuf;
+
+ if (!monitor->ck.cache)
+ return FALSE;
+
+ /* Check the database file */
+ if (stat (CKDB_PATH, &statbuf) != 0) {
+ nm_log_err (LOGD_CORE, "Failed to check ConsoleKit timestamp: %s", strerror (errno));
+ return FALSE;
+ }
+ if (statbuf.st_mtime == monitor->ck.timestamp)
+ return TRUE;
+
+ /* Update the cache */
+ if (!ck_load_cache (monitor->ck.cache))
+ return FALSE;
+
+ monitor->ck.timestamp = statbuf.st_mtime;
+
+ return TRUE;
+}
+
+static gboolean
+ck_session_exists (NMSessionMonitor *monitor, uid_t uid, gboolean active)
+{
+ CkSession *session;
+
+ if (!ck_update_cache (monitor))
+ return FALSE;
+
+ session = g_hash_table_lookup (monitor->ck.cache, GUINT_TO_POINTER (uid));
+
+ if (!session)
+ return FALSE;
+ if (active && !session->active)
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+ck_changed (GFileMonitor * file_monitor,
+ GFile * file,
+ GFile * other_file,
+ GFileMonitorEvent event_type,
+ gpointer user_data)
+{
+ g_signal_emit (user_data, signals[CHANGED], 0);
+}
+
+static void
+ck_init (NMSessionMonitor *monitor)
+{
+ GFile *file = g_file_new_for_path (CKDB_PATH);
+ GError *error = NULL;
+
+ if (g_file_query_exists (file, NULL)) {
+ if ((monitor->ck.monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, &error))) {
+ monitor->ck.cache = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
+ g_signal_connect (monitor->ck.monitor,
+ "changed",
+ G_CALLBACK (ck_changed),
+ monitor);
+ } else {
+ nm_log_err (LOGD_CORE, "Error monitoring " CKDB_PATH ": %s", error->message);
+ g_clear_error (&error);
+ }
+ }
+
+ g_object_unref (file);
+}
+
+static void
+ck_finalize (NMSessionMonitor *monitor)
+{
+ g_clear_pointer (&monitor->ck.cache, g_hash_table_unref);
+ g_clear_object (&monitor->ck.monitor);
+}
+#endif /* SESSION_TRACKING_CONSOLEKIT */
+
+/********************************************************************/
+
+NMSessionMonitor *nm_session_monitor_get(void);
+
+NM_DEFINE_SINGLETON_GETTER (NMSessionMonitor, nm_session_monitor_get, NM_TYPE_SESSION_MONITOR);
+
+/**
+ * nm_session_monitor_connect:
+ * @callback: The callback.
+ * @user_data: User data for the callback.
+ *
+ * Connect a callback to the session monitor.
+ *
+ * Returns: Handler ID to be used with nm_session_monitor_disconnect().
+ */
+gulong
+nm_session_monitor_connect (NMSessionCallback callback, gpointer user_data)
+{
+ return g_signal_connect (nm_session_monitor_get (),
+ NM_SESSION_MONITOR_CHANGED,
+ G_CALLBACK (callback),
+ user_data);
+}
+
+/**
+ * nm_session_monitor_disconnect:
+ * @handler_id: Handler ID returned by nm_session_monitor-connect().
+ *
+ * Disconnect callback from the session handler.
+ */
+void
+nm_session_monitor_disconnect (gulong handler_id)
+{
+ g_signal_handler_disconnect (nm_session_monitor_get (), handler_id);
+}
+
+/**
+ * nm_session_monitor_uid_to_user:
+ * @uid: UID.
+ * @out_user: Return location for user name.
+ *
+ * Translates a UID to a user name.
+ */
+gboolean
+nm_session_monitor_uid_to_user (uid_t uid, const char **out_user)
+{
+ struct passwd *pw = getpwuid (uid);
+
+ g_assert (out_user);
+
+ if (!pw)
+ return FALSE;
+
+ *out_user = pw->pw_name;
+
+ return TRUE;
+}
+
+/**
+ * nm_session_monitor_user_to_uid:
+ * @user: User naee.
+ * @out_uid: Return location for UID.
+ *
+ * Translates a user name to a UID.
+ */
+gboolean
+nm_session_monitor_user_to_uid (const char *user, uid_t *out_uid)
+{
+ struct passwd *pw = getpwnam (user);
+
+ g_assert (out_uid);
+
+ if (!pw)
+ return FALSE;
+
+ *out_uid = pw->pw_uid;
+
+ return TRUE;
+}
+
+/**
+ * nm_session_monitor_session_exists:
+ * @uid: A user ID.
+ * @active: Ignore inactive sessions.
+ *
+ * Checks whether the given @uid is logged into an active session. Don't
+ * use this feature for security purposes. It is there just to allow you
+ * to prefer an agent from an active session over an agent from an
+ * inactive one.
+ *
+ * Returns: %FALSE if @error is set otherwise %TRUE if the given @uid is
+ * logged into an active session.
+ */
+gboolean
+nm_session_monitor_session_exists (uid_t uid, gboolean active)
+{
+#if defined(SESSION_TRACKING_SYSTEMD) || defined(SESSION_TRACKING_CONSOLEKIT)
+ NMSessionMonitor *monitor = nm_session_monitor_get ();
+#endif
+
+#ifdef SESSION_TRACKING_SYSTEMD
+ if (sd_session_exists (monitor, uid, active))
+ return TRUE;
+#endif
+
+#ifdef SESSION_TRACKING_CONSOLEKIT
+ if (ck_session_exists (monitor, uid, active))
+ return TRUE;
+#endif
+
+ return FALSE;
+}
+
+/********************************************************************/
+
+static void
+nm_session_monitor_init (NMSessionMonitor *monitor)
+{
+#ifdef SESSION_TRACKING_SYSTEMD
+ sd_init (monitor);
+#endif
+
+#ifdef SESSION_TRACKING_CONSOLEKIT
+ ck_init (monitor);
+#endif
+}
+
+static void
+nm_session_monitor_finalize (GObject *object)
+{
+#ifdef SESSION_TRACKING_SYSTEMD
+ sd_finalize (NM_SESSION_MONITOR (object));
+#endif
+
+#ifdef SESSION_TRACKING_CONSOLEKIT
+ ck_finalize (NM_SESSION_MONITOR (object));
+#endif
+
+ if (G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize != NULL)
+ G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize (object);
+}
+
+static void
+nm_session_monitor_class_init (NMSessionMonitorClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->finalize = nm_session_monitor_finalize;
+
+ /**
+ * NMSessionMonitor::changed:
+ * @monitor: A #NMSessionMonitor
+ *
+ * Emitted when something changes.
+ */
+ signals[CHANGED] = g_signal_new (NM_SESSION_MONITOR_CHANGED,
+ NM_TYPE_SESSION_MONITOR,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (NMSessionMonitorClass, changed),
+ NULL, /* accumulator */
+ NULL, /* accumulator data */
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+}
diff --git a/src/nm-session-monitor.h b/src/nm-session-monitor.h
index 3efe6eca6b..32f747f231 100644
--- a/src/nm-session-monitor.h
+++ b/src/nm-session-monitor.h
@@ -38,26 +38,16 @@ G_BEGIN_DECLS
typedef struct _NMSessionMonitorClass NMSessionMonitorClass;
-GType nm_session_monitor_get_type (void) G_GNUC_CONST;
-NMSessionMonitor *nm_session_monitor_get (void);
+typedef void (*NMSessionCallback) (NMSessionMonitor *monitor, gpointer user_data);
-gboolean nm_session_monitor_user_has_session (NMSessionMonitor *monitor,
- const char *username,
- uid_t *out_uid,
- GError **error);
+GType nm_session_monitor_get_type (void) G_GNUC_CONST;
-gboolean nm_session_monitor_uid_has_session (NMSessionMonitor *monitor,
- uid_t uid,
- const char **out_user,
- GError **error);
+gulong nm_session_monitor_connect (NMSessionCallback callback, gpointer user_data);
+void nm_session_monitor_disconnect (gulong handler_id);
-gboolean nm_session_monitor_user_active (NMSessionMonitor *monitor,
- const char *username,
- GError **error);
-
-gboolean nm_session_monitor_uid_active (NMSessionMonitor *monitor,
- uid_t uid,
- GError **error);
+gboolean nm_session_monitor_uid_to_user (uid_t uid, const char **out_user);
+gboolean nm_session_monitor_user_to_uid (const char *user, uid_t *out_uid);
+gboolean nm_session_monitor_session_exists (uid_t uid, gboolean active);
G_END_DECLS
diff --git a/src/nm-session-utils.c b/src/nm-session-utils.c
deleted file mode 100644
index e70f69ed1d..0000000000
--- a/src/nm-session-utils.c
+++ /dev/null
@@ -1,68 +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 (C) 2012 Red Hat, Inc.
- * Author: Dan Williams <dcbw@redhat.com>
- */
-
-#include <pwd.h>
-#include <sys/types.h>
-
-#include "nm-session-utils.h"
-#include "nm-errors.h"
-
-/********************************************************************/
-
-gboolean
-nm_session_uid_to_user (uid_t uid, const char **out_user, GError **error)
-{
- struct passwd *pw;
-
- pw = getpwuid (uid);
- if (!pw) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "Could not get username for UID %d",
- uid);
- return FALSE;
- }
-
- if (out_user)
- *out_user = pw->pw_name;
- return TRUE;
-}
-
-gboolean
-nm_session_user_to_uid (const char *user, uid_t *out_uid, GError **error)
-{
- struct passwd *pw;
-
- pw = getpwnam (user);
- if (!pw) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "Could not get UID for username '%s'",
- user);
- return FALSE;
- }
-
- /* Ugly, but hey, use ConsoleKit */
- if (out_uid)
- *out_uid = pw->pw_uid;
- return TRUE;
-}
-
diff --git a/src/nm-sleep-monitor-systemd.c b/src/nm-sleep-monitor-systemd.c
index d3dfaa52e7..44523a4a21 100644
--- a/src/nm-sleep-monitor-systemd.c
+++ b/src/nm-sleep-monitor-systemd.c
@@ -18,6 +18,7 @@
*/
#include "config.h"
+
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
@@ -147,24 +148,59 @@ signal_cb (GDBusProxy *proxy,
}
static void
-sleep_setup (NMSleepMonitor *self)
+name_owner_cb (GObject *object,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ GDBusProxy *proxy = G_DBUS_PROXY (object);
+ NMSleepMonitor *self = NM_SLEEP_MONITOR (user_data);
+ char *owner;
+
+ g_assert (proxy == self->sd_proxy);
+
+ owner = g_dbus_proxy_get_name_owner (proxy);
+ if (owner)
+ take_inhibitor (self);
+ else
+ drop_inhibitor (self);
+ g_free (owner);
+}
+
+static void
+on_proxy_acquired (GObject *object,
+ GAsyncResult *res,
+ NMSleepMonitor *self)
{
- GDBusConnection *bus;
+ GError *error = NULL;
+ char *owner;
- bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
- self->sd_proxy = g_dbus_proxy_new_sync (bus, 0, NULL,
- SD_NAME, SD_PATH, SD_INTERFACE,
- NULL, NULL);
- g_object_unref (bus);
+ self->sd_proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (!self->sd_proxy) {
+ nm_log_warn (LOGD_SUSPEND, "Failed to acquire logind proxy: %s", error->message);
+ g_clear_error (&error);
+ return;
+ }
+
+ g_signal_connect (self->sd_proxy, "notify::g-name-owner", G_CALLBACK (name_owner_cb), self);
g_signal_connect (self->sd_proxy, "g-signal", G_CALLBACK (signal_cb), self);
+
+ owner = g_dbus_proxy_get_name_owner (self->sd_proxy);
+ if (owner)
+ take_inhibitor (self);
+ g_free (owner);
}
static void
nm_sleep_monitor_init (NMSleepMonitor *self)
{
self->inhibit_fd = -1;
- sleep_setup (self);
- take_inhibitor (self);
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START |
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
+ NULL,
+ SD_NAME, SD_PATH, SD_INTERFACE,
+ NULL,
+ (GAsyncReadyCallback) on_proxy_acquired, self);
}
static void
@@ -207,16 +243,6 @@ nm_sleep_monitor_class_init (NMSleepMonitorClass *klass)
G_TYPE_NONE, 0);
}
-NMSleepMonitor *
-nm_sleep_monitor_get (void)
-{
- static NMSleepMonitor *singleton = NULL;
-
- if (singleton)
- return g_object_ref (singleton);
-
- singleton = NM_SLEEP_MONITOR (g_object_new (NM_TYPE_SLEEP_MONITOR, NULL));
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMSleepMonitor, nm_sleep_monitor_get, NM_TYPE_SLEEP_MONITOR);
/* ---------------------------------------------------------------------------------------------------- */
diff --git a/src/nm-sleep-monitor-upower.c b/src/nm-sleep-monitor-upower.c
index 58402abd42..0c46ae10fc 100644
--- a/src/nm-sleep-monitor-upower.c
+++ b/src/nm-sleep-monitor-upower.c
@@ -18,6 +18,7 @@
*/
#include "config.h"
+
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
@@ -132,16 +133,6 @@ nm_sleep_monitor_class_init (NMSleepMonitorClass *klass)
G_TYPE_NONE, 0);
}
-NMSleepMonitor *
-nm_sleep_monitor_get (void)
-{
- static NMSleepMonitor *singleton = NULL;
-
- if (singleton)
- return g_object_ref (singleton);
-
- singleton = NM_SLEEP_MONITOR (g_object_new (NM_TYPE_SLEEP_MONITOR, NULL));
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMSleepMonitor, nm_sleep_monitor_get, NM_TYPE_SLEEP_MONITOR);
/* ---------------------------------------------------------------------------------------------------- */
diff --git a/src/nm-types.h b/src/nm-types.h
index e67ae20527..f22272d91f 100644
--- a/src/nm-types.h
+++ b/src/nm-types.h
@@ -23,11 +23,15 @@
/* core */
typedef struct _NMActiveConnection NMActiveConnection;
+typedef struct _NMVpnConnection NMVpnConnection;
typedef struct _NMActRequest NMActRequest;
typedef struct _NMAuthSubject NMAuthSubject;
+typedef struct _NMConfig NMConfig;
+typedef struct _NMConfigData NMConfigData;
typedef struct _NMConnectionProvider NMConnectionProvider;
typedef struct _NMConnectivity NMConnectivity;
typedef struct _NMDBusManager NMDBusManager;
+typedef struct _NMDefaultRouteManager NMDefaultRouteManager;
typedef struct _NMDevice NMDevice;
typedef struct _NMDhcp4Config NMDhcp4Config;
typedef struct _NMDhcp6Config NMDhcp6Config;
@@ -36,6 +40,7 @@ typedef struct _NMIP6Config NMIP6Config;
typedef struct _NMManager NMManager;
typedef struct _NMPolicy NMPolicy;
typedef struct _NMRfkillManager NMRfkillManager;
+typedef struct _NMRouteManager NMRouteManager;
typedef struct _NMSessionMonitor NMSessionMonitor;
typedef struct _NMSleepMonitor NMSleepMonitor;
@@ -60,10 +65,56 @@ typedef struct _NMPlatformIP6Address NMPlatformIP6Address;
typedef struct _NMPlatformIP6Route NMPlatformIP6Route;
typedef struct _NMPlatformLink NMPlatformLink;
+typedef enum {
+ /* Please don't interpret type numbers outside nm-platform and use functions
+ * like nm_platform_link_is_software() and nm_platform_supports_slaves().
+ *
+ * type & 0x10000 -> Software device type
+ * type & 0x20000 -> Type supports slaves
+ */
+
+ /* No type, used as error value */
+ NM_LINK_TYPE_NONE,
+
+ /* Unknown type */
+ NM_LINK_TYPE_UNKNOWN,
+
+ /* Hardware types */
+ NM_LINK_TYPE_ETHERNET,
+ NM_LINK_TYPE_INFINIBAND,
+ NM_LINK_TYPE_OLPC_MESH,
+ NM_LINK_TYPE_WIFI,
+ NM_LINK_TYPE_WWAN_ETHERNET, /* WWAN pseudo-ethernet */
+ NM_LINK_TYPE_WIMAX,
+
+ /* Software types */
+ NM_LINK_TYPE_DUMMY = 0x10000,
+ NM_LINK_TYPE_GRE,
+ NM_LINK_TYPE_GRETAP,
+ NM_LINK_TYPE_IFB,
+ NM_LINK_TYPE_LOOPBACK,
+ NM_LINK_TYPE_MACVLAN,
+ NM_LINK_TYPE_MACVTAP,
+ NM_LINK_TYPE_OPENVSWITCH,
+ NM_LINK_TYPE_TAP,
+ NM_LINK_TYPE_TUN,
+ NM_LINK_TYPE_VETH,
+ NM_LINK_TYPE_VLAN,
+ NM_LINK_TYPE_VXLAN,
+
+ /* Software types with slaves */
+ NM_LINK_TYPE_BRIDGE = 0x10000 | 0x20000,
+ NM_LINK_TYPE_BOND,
+ NM_LINK_TYPE_TEAM,
+} NMLinkType;
+
/* settings */
typedef struct _NMAgentManager NMAgentManager;
typedef struct _NMSecretAgent NMSecretAgent;
typedef struct _NMSettings NMSettings;
typedef struct _NMSettingsConnection NMSettingsConnection;
+/* utils */
+typedef struct _NMUtilsIPv6IfaceId NMUtilsIPv6IfaceId;
+
#endif /* NM_TYPES_H */
diff --git a/src/org.freedesktop.NetworkManager.conf b/src/org.freedesktop.NetworkManager.conf
index bdfe3e6773..fafa8f5bb5 100644
--- a/src/org.freedesktop.NetworkManager.conf
+++ b/src/org.freedesktop.NetworkManager.conf
@@ -25,6 +25,7 @@
<allow send_destination="org.freedesktop.NetworkManager.vpnc"/>
<allow send_destination="org.freedesktop.NetworkManager.ssh"/>
<allow send_destination="org.freedesktop.NetworkManager.iodine"/>
+ <allow send_interface="org.freedesktop.NetworkManager.VPN.Plugin"/>
</policy>
<policy context="default">
<deny own="org.freedesktop.NetworkManager"/>
diff --git a/src/platform/nm-fake-platform.c b/src/platform/nm-fake-platform.c
index 9e376e5035..7194707b29 100644
--- a/src/platform/nm-fake-platform.c
+++ b/src/platform/nm-fake-platform.c
@@ -18,11 +18,14 @@
* Copyright (C) 2012–2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <errno.h>
#include <unistd.h>
#include <netinet/icmp6.h>
#include <netinet/in.h>
+#include "gsystem-local-alloc.h"
#include "NetworkManagerUtils.h"
#include "nm-fake-platform.h"
#include "nm-logging.h"
@@ -46,6 +49,11 @@ typedef struct {
int vlan_id;
} NMFakePlatformLink;
+typedef struct {
+ int ifindex;
+ NMPlatform *platform;
+} NMFakePlatformLinkData;
+
#define NM_FAKE_PLATFORM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_FAKE_PLATFORM, NMFakePlatformPrivate))
G_DEFINE_TYPE (NMFakePlatform, nm_fake_platform, NM_TYPE_PLATFORM)
@@ -172,6 +180,23 @@ _nm_platform_link_get (NMPlatform *platform, int ifindex, NMPlatformLink *l)
}
static gboolean
+_link_announce (NMFakePlatformLinkData *data)
+{
+ NMFakePlatformLink *device = link_get (data->platform, data->ifindex);
+
+ if (device)
+ g_signal_emit_by_name (data->platform,
+ NM_PLATFORM_SIGNAL_LINK_CHANGED,
+ device->link.ifindex,
+ device,
+ NM_PLATFORM_SIGNAL_ADDED,
+ NM_PLATFORM_REASON_INTERNAL);
+ g_free (data);
+
+ return FALSE;
+}
+
+static gboolean
link_add (NMPlatform *platform, const char *name, NMLinkType type, const void *address, size_t address_len)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
@@ -181,8 +206,12 @@ link_add (NMPlatform *platform, const char *name, NMLinkType type, const void *a
g_array_append_val (priv->links, device);
- if (device.link.ifindex)
- g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_LINK_CHANGED, device.link.ifindex, &device, NM_PLATFORM_SIGNAL_ADDED, NM_PLATFORM_REASON_INTERNAL);
+ if (device.link.ifindex) {
+ NMFakePlatformLinkData *data = g_new (NMFakePlatformLinkData, 1);
+ data->ifindex = device.link.ifindex;
+ data->platform = platform;
+ g_idle_add ((GSourceFunc) _link_announce, data);
+ }
return TRUE;
}
@@ -270,6 +299,12 @@ link_get_type_name (NMPlatform *platform, int ifindex)
return type_to_type_name (link_get_type (platform, ifindex));
}
+static gboolean
+link_get_unmanaged (NMPlatform *platform, int ifindex, gboolean *managed)
+{
+ return FALSE;
+}
+
static void
link_changed (NMPlatform *platform, NMFakePlatformLink *device)
{
@@ -979,31 +1014,37 @@ ip6_address_exists (NMPlatform *platform, int ifindex, struct in6_addr addr, int
return FALSE;
}
+static gboolean
+ip4_check_reinstall_device_route (NMPlatform *platform, int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric)
+{
+ return FALSE;
+}
+
/******************************************************************/
static GArray *
-ip4_route_get_all (NMPlatform *platform, int ifindex, gboolean include_default)
+ip4_route_get_all (NMPlatform *platform, int ifindex, NMPlatformGetRouteMode mode)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
GArray *routes;
NMPlatformIP4Route *route;
- int count = 0, i;
+ guint i;
- /* Count routes */
- for (i = 0; i < priv->ip4_routes->len; i++) {
- route = &g_array_index (priv->ip4_routes, NMPlatformIP4Route, i);
- if (route && route->ifindex == ifindex)
- count++;
- }
+ g_return_val_if_fail (NM_IN_SET (mode, NM_PLATFORM_GET_ROUTE_MODE_ALL, NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT, NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT), NULL);
- routes = g_array_sized_new (TRUE, TRUE, sizeof (NMPlatformIP4Route), count);
+ routes = g_array_new (TRUE, TRUE, sizeof (NMPlatformIP4Route));
/* Fill routes */
for (i = 0; i < priv->ip4_routes->len; i++) {
route = &g_array_index (priv->ip4_routes, NMPlatformIP4Route, i);
- if (route && route->ifindex == ifindex) {
- if (route->plen != 0 || include_default)
- g_array_append_val (routes, *route);
+ if (route && (!ifindex || route->ifindex == ifindex)) {
+ if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)) {
+ if (mode != NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT)
+ g_array_append_val (routes, *route);
+ } else {
+ if (mode != NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT)
+ g_array_append_val (routes, *route);
+ }
}
}
@@ -1011,28 +1052,28 @@ ip4_route_get_all (NMPlatform *platform, int ifindex, gboolean include_default)
}
static GArray *
-ip6_route_get_all (NMPlatform *platform, int ifindex, gboolean include_default)
+ip6_route_get_all (NMPlatform *platform, int ifindex, NMPlatformGetRouteMode mode)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
GArray *routes;
NMPlatformIP6Route *route;
- int count = 0, i;
+ guint i;
- /* Count routes */
- for (i = 0; i < priv->ip6_routes->len; i++) {
- route = &g_array_index (priv->ip6_routes, NMPlatformIP6Route, i);
- if (route && route->ifindex == ifindex)
- count++;
- }
+ g_return_val_if_fail (NM_IN_SET (mode, NM_PLATFORM_GET_ROUTE_MODE_ALL, NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT, NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT), NULL);
- routes = g_array_sized_new (TRUE, TRUE, sizeof (NMPlatformIP6Route), count);
+ routes = g_array_new (TRUE, TRUE, sizeof (NMPlatformIP6Route));
/* Fill routes */
for (i = 0; i < priv->ip6_routes->len; i++) {
route = &g_array_index (priv->ip6_routes, NMPlatformIP6Route, i);
- if (route && route->ifindex == ifindex) {
- if (route->plen != 0 || include_default)
- g_array_append_val (routes, *route);
+ if (route && (!ifindex || route->ifindex == ifindex)) {
+ if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)) {
+ if (mode != NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT)
+ g_array_append_val (routes, *route);
+ } else {
+ if (mode != NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT)
+ g_array_append_val (routes, *route);
+ }
}
}
@@ -1040,9 +1081,59 @@ ip6_route_get_all (NMPlatform *platform, int ifindex, gboolean include_default)
}
static gboolean
+ip4_route_delete (NMPlatform *platform, int ifindex, in_addr_t network, int plen, guint32 metric)
+{
+ NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
+ int i;
+
+ for (i = 0; i < priv->ip4_routes->len; i++) {
+ NMPlatformIP4Route *route = &g_array_index (priv->ip4_routes, NMPlatformIP4Route, i);
+ NMPlatformIP4Route deleted_route;
+
+ if ( route->ifindex != ifindex
+ || route->network != network
+ || route->plen != plen
+ || route->metric != metric)
+ continue;
+
+ memcpy (&deleted_route, route, sizeof (deleted_route));
+ g_array_remove_index (priv->ip4_routes, i);
+ g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_IP4_ROUTE_CHANGED, ifindex, &deleted_route, NM_PLATFORM_SIGNAL_REMOVED, NM_PLATFORM_REASON_INTERNAL);
+ }
+
+ return TRUE;
+}
+
+static gboolean
+ip6_route_delete (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, guint32 metric)
+{
+ NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
+ int i;
+
+ metric = nm_utils_ip6_route_metric_normalize (metric);
+
+ for (i = 0; i < priv->ip6_routes->len; i++) {
+ NMPlatformIP6Route *route = &g_array_index (priv->ip6_routes, NMPlatformIP6Route, i);
+ NMPlatformIP6Route deleted_route;
+
+ if ( route->ifindex != ifindex
+ || !IN6_ARE_ADDR_EQUAL (&route->network, &network)
+ || route->plen != plen
+ || route->metric != metric)
+ continue;
+
+ memcpy (&deleted_route, route, sizeof (deleted_route));
+ g_array_remove_index (priv->ip6_routes, i);
+ g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_IP6_ROUTE_CHANGED, ifindex, &deleted_route, NM_PLATFORM_SIGNAL_REMOVED, NM_PLATFORM_REASON_INTERNAL);
+ }
+
+ return TRUE;
+}
+
+static gboolean
ip4_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
in_addr_t network, int plen, in_addr_t gateway,
- int metric, int mss)
+ guint32 pref_src, guint32 metric, guint32 mss)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
NMPlatformIP4Route route;
@@ -1058,15 +1149,38 @@ ip4_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
route.metric = metric;
route.mss = mss;
+ if (gateway) {
+ for (i = 0; i < priv->ip4_routes->len; i++) {
+ NMPlatformIP4Route *item = &g_array_index (priv->ip4_routes,
+ NMPlatformIP4Route, i);
+ guint32 gate = ntohl (item->network) >> (32 - item->plen);
+ guint32 host = ntohl (gateway) >> (32 - item->plen);
+
+ if (ifindex == item->ifindex && gate == host)
+ break;
+ }
+ if (i == priv->ip4_routes->len) {
+ g_warning ("Fake platform: error adding %s: Network Unreachable",
+ nm_platform_ip4_route_to_string (&route));
+ return FALSE;
+ }
+ }
+
for (i = 0; i < priv->ip4_routes->len; i++) {
NMPlatformIP4Route *item = &g_array_index (priv->ip4_routes, NMPlatformIP4Route, i);
- if (item->ifindex != route.ifindex)
- continue;
if (item->network != route.network)
continue;
if (item->plen != route.plen)
continue;
+ if (item->metric != metric)
+ continue;
+
+ if (item->ifindex != route.ifindex) {
+ ip4_route_delete (platform, item->ifindex, item->network, item->plen, item->metric);
+ i--;
+ continue;
+ }
memcpy (item, &route, sizeof (route));
g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_IP4_ROUTE_CHANGED, ifindex, &route, NM_PLATFORM_SIGNAL_CHANGED, NM_PLATFORM_REASON_INTERNAL);
@@ -1082,12 +1196,14 @@ ip4_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
static gboolean
ip6_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
struct in6_addr network, int plen, struct in6_addr gateway,
- int metric, int mss)
+ guint32 metric, guint32 mss)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
NMPlatformIP6Route route;
guint i;
+ metric = nm_utils_ip6_route_metric_normalize (metric);
+
memset (&route, 0, sizeof (route));
route.source = NM_IP_CONFIG_SOURCE_KERNEL;
route.ifindex = ifindex;
@@ -1098,15 +1214,40 @@ ip6_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
route.metric = metric;
route.mss = mss;
+ if (!IN6_IS_ADDR_UNSPECIFIED(&gateway)) {
+ for (i = 0; i < priv->ip6_routes->len; i++) {
+ NMPlatformIP6Route *item = &g_array_index (priv->ip6_routes,
+ NMPlatformIP6Route, i);
+ guint8 gate_bits = gateway.s6_addr[item->plen / 8] >> (8 - item->plen % 8);
+ guint8 host_bits = item->network.s6_addr[item->plen / 8] >> (8 - item->plen % 8);
+
+ if ( ifindex == item->ifindex
+ && memcmp (&gateway, &item->network, item->plen / 8) == 0
+ && gate_bits == host_bits)
+ break;
+ }
+ if (i == priv->ip6_routes->len) {
+ g_warning ("Fake platform: error adding %s: Network Unreachable",
+ nm_platform_ip6_route_to_string (&route));
+ return FALSE;
+ }
+ }
+
for (i = 0; i < priv->ip6_routes->len; i++) {
NMPlatformIP6Route *item = &g_array_index (priv->ip6_routes, NMPlatformIP6Route, i);
- if (item->ifindex != route.ifindex)
- continue;
if (!IN6_ARE_ADDR_EQUAL (&item->network, &route.network))
continue;
if (item->plen != route.plen)
continue;
+ if (item->metric != metric)
+ continue;
+
+ if (item->ifindex != route.ifindex) {
+ ip6_route_delete (platform, item->ifindex, item->network, item->plen, item->metric);
+ i--;
+ continue;
+ }
memcpy (item, &route, sizeof (route));
g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_IP6_ROUTE_CHANGED, ifindex, &route, NM_PLATFORM_SIGNAL_CHANGED, NM_PLATFORM_REASON_INTERNAL);
@@ -1120,7 +1261,7 @@ ip6_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
}
static NMPlatformIP4Route *
-ip4_route_get (NMPlatform *platform, int ifindex, in_addr_t network, int plen, int metric)
+ip4_route_get (NMPlatform *platform, int ifindex, in_addr_t network, int plen, guint32 metric)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
int i;
@@ -1139,11 +1280,13 @@ ip4_route_get (NMPlatform *platform, int ifindex, in_addr_t network, int plen, i
}
static NMPlatformIP6Route *
-ip6_route_get (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, int metric)
+ip6_route_get (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, guint32 metric)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
int i;
+ metric = nm_utils_ip6_route_metric_normalize (metric);
+
for (i = 0; i < priv->ip6_routes->len; i++) {
NMPlatformIP6Route *route = &g_array_index (priv->ip6_routes, NMPlatformIP6Route, i);
@@ -1158,43 +1301,13 @@ ip6_route_get (NMPlatform *platform, int ifindex, struct in6_addr network, int p
}
static gboolean
-ip4_route_delete (NMPlatform *platform, int ifindex, in_addr_t network, int plen, int metric)
-{
- NMPlatformIP4Route *route = ip4_route_get (platform, ifindex, network, plen, metric);
- NMPlatformIP4Route deleted_route;
-
- if (route) {
- memcpy (&deleted_route, route, sizeof (deleted_route));
- memset (route, 0, sizeof (*route));
- g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_IP4_ROUTE_CHANGED, ifindex, &deleted_route, NM_PLATFORM_SIGNAL_REMOVED, NM_PLATFORM_REASON_INTERNAL);
- }
-
- return TRUE;
-}
-
-static gboolean
-ip6_route_delete (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, int metric)
-{
- NMPlatformIP6Route *route = ip6_route_get (platform, ifindex, network, plen, metric);
- NMPlatformIP6Route deleted_route;
-
- if (route) {
- memcpy (&deleted_route, route, sizeof (deleted_route));
- memset (route, 0, sizeof (*route));
- g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_IP6_ROUTE_CHANGED, ifindex, &deleted_route, NM_PLATFORM_SIGNAL_REMOVED, NM_PLATFORM_REASON_INTERNAL);
- }
-
- return TRUE;
-}
-
-static gboolean
-ip4_route_exists (NMPlatform *platform, int ifindex, in_addr_t network, int plen, int metric)
+ip4_route_exists (NMPlatform *platform, int ifindex, in_addr_t network, int plen, guint32 metric)
{
return !!ip4_route_get (platform, ifindex, network, plen, metric);
}
static gboolean
-ip6_route_exists (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, int metric)
+ip6_route_exists (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, guint32 metric)
{
return !!ip6_route_get (platform, ifindex, network, plen, metric);
}
@@ -1277,6 +1390,7 @@ nm_fake_platform_class_init (NMFakePlatformClass *klass)
platform_class->link_get_name = link_get_name;
platform_class->link_get_type = link_get_type;
platform_class->link_get_type_name = link_get_type_name;
+ platform_class->link_get_unmanaged = link_get_unmanaged;
platform_class->link_set_up = link_set_up;
platform_class->link_set_down = link_set_down;
@@ -1342,6 +1456,8 @@ nm_fake_platform_class_init (NMFakePlatformClass *klass)
platform_class->ip4_address_exists = ip4_address_exists;
platform_class->ip6_address_exists = ip6_address_exists;
+ platform_class->ip4_check_reinstall_device_route = ip4_check_reinstall_device_route;
+
platform_class->ip4_route_get_all = ip4_route_get_all;
platform_class->ip6_route_get_all = ip6_route_get_all;
platform_class->ip4_route_add = ip4_route_add;
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index ef5537d897..3a0bbe4d1c 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -17,7 +17,7 @@
*
* Copyright (C) 2012-2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <errno.h>
#include <unistd.h>
@@ -44,9 +44,9 @@
#include <netlink/route/route.h>
#include <gudev/gudev.h>
-#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
+#if HAVE_LIBNL_INET6_ADDR_GEN_MODE || HAVE_LIBNL_INET6_TOKEN
#include <netlink/route/link/inet6.h>
-#if HAVE_KERNEL_INET6_ADDR_GEN_MODE
+#if HAVE_LIBNL_INET6_ADDR_GEN_MODE && HAVE_KERNEL_INET6_ADDR_GEN_MODE
#include <linux/if_link.h>
#else
#define IN6_ADDR_GEN_MODE_EUI64 0
@@ -54,6 +54,8 @@
#endif
#endif
+#include "gsystem-local-alloc.h"
+#include "nm-core-internal.h"
#include "NetworkManagerUtils.h"
#include "nm-linux-platform.h"
#include "NetworkManagerUtils.h"
@@ -102,7 +104,7 @@ G_DEFINE_TYPE (NMLinuxPlatform, nm_linux_platform, NM_TYPE_PLATFORM)
static const char *to_string_object (NMPlatform *platform, struct nl_object *obj);
static gboolean _address_match (struct rtnl_addr *addr, int family, int ifindex);
-static gboolean _route_match (struct rtnl_route *rtnlroute, int family, int ifindex);
+static gboolean _route_match (struct rtnl_route *rtnlroute, int family, int ifindex, gboolean include_proto_kernel);
void
nm_linux_platform_setup (void)
@@ -765,7 +767,7 @@ link_type_from_udev (NMPlatform *platform, int ifindex, const char *ifname, int
prop = g_udev_device_get_property (udev_device, "DEVTYPE");
sysfs_path = g_udev_device_get_sysfs_path (udev_device);
- if (g_strcmp0 (prop, "wlan") == 0 || wifi_utils_is_wifi (ifname, sysfs_path))
+ if (wifi_utils_is_wifi (ifname, sysfs_path, prop))
return_type (NM_LINK_TYPE_WIFI, "wifi");
else if (g_strcmp0 (prop, "wwan") == 0)
return_type (NM_LINK_TYPE_WWAN_ETHERNET, "wwan");
@@ -778,41 +780,6 @@ link_type_from_udev (NMPlatform *platform, int ifindex, const char *ifname, int
return_type (NM_LINK_TYPE_UNKNOWN, "unknown");
}
-static gboolean
-link_is_software (struct rtnl_link *rtnllink)
-{
- const char *type;
-
- /* FIXME: replace somehow with NMLinkType or nm_platform_is_software(), but
- * solve the infinite callstack problems that getting the type of a TUN/TAP
- * device causes.
- */
-
- if ( rtnl_link_get_arptype (rtnllink) == ARPHRD_INFINIBAND
- && strchr (rtnl_link_get_name (rtnllink), '.'))
- return TRUE;
-
- type = rtnl_link_get_type (rtnllink);
- if (type == NULL)
- return FALSE;
-
- if (!strcmp (type, "dummy") ||
- !strcmp (type, "gre") ||
- !strcmp (type, "gretap") ||
- !strcmp (type, "macvlan") ||
- !strcmp (type, "macvtap") ||
- !strcmp (type, "tun") ||
- !strcmp (type, "veth") ||
- !strcmp (type, "vlan") ||
- !strcmp (type, "vxlan") ||
- !strcmp (type, "bridge") ||
- !strcmp (type, "bond") ||
- !strcmp (type, "team"))
- return TRUE;
-
- return FALSE;
-}
-
static const char *
ethtool_get_driver (const char *ifname)
{
@@ -835,10 +802,6 @@ link_is_announceable (NMPlatform *platform, struct rtnl_link *rtnllink)
{
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
- /* Software devices are always visible outside the platform */
- if (link_is_software (rtnllink))
- return TRUE;
-
/* Hardware devices must be found by udev so rules get run and tags set */
if (g_hash_table_lookup (priv->udev_devices,
GINT_TO_POINTER (rtnl_link_get_ifindex (rtnllink))))
@@ -1007,7 +970,7 @@ init_link (NMPlatform *platform, NMPlatformLink *info, struct rtnl_link *rtnllin
if (udev_device) {
info->driver = udev_get_driver (platform, udev_device, info->ifindex);
if (!info->driver)
- info->driver = rtnl_link_get_type (rtnllink);
+ info->driver = g_intern_string (rtnl_link_get_type (rtnllink));
if (!info->driver)
info->driver = ethtool_get_driver (info->name);
if (!info->driver)
@@ -1297,6 +1260,16 @@ rtprot_to_source (guint rtprot)
}
static gboolean
+_rtnl_route_is_default (const struct rtnl_route *rtnlroute)
+{
+ struct nl_addr *dst;
+
+ return rtnlroute
+ && (dst = rtnl_route_get_dst ((struct rtnl_route *) rtnlroute))
+ && nl_addr_get_prefixlen (dst) == 0;
+}
+
+static gboolean
init_ip4_route (NMPlatformIP4Route *route, struct rtnl_route *rtnlroute)
{
struct nl_addr *dst, *gw;
@@ -1575,7 +1548,7 @@ announce_object (NMPlatform *platform, const struct nl_object *object, NMPlatfor
if (!init_link (platform, &device, rtnl_link))
return;
- /* Skip hardware devices not yet discovered by udev. They will be
+ /* Skip devices not yet discovered by udev. They will be
* announced by udev_device_added(). This doesn't apply to removed
* devices, as those come either from udev_device_removed(),
* event_notification() or link_delete() which block the announcment
@@ -1584,7 +1557,7 @@ announce_object (NMPlatform *platform, const struct nl_object *object, NMPlatfor
switch (change_type) {
case NM_PLATFORM_SIGNAL_ADDED:
case NM_PLATFORM_SIGNAL_CHANGED:
- if (!link_is_software (rtnl_link) && !device.driver)
+ if (!device.driver)
return;
break;
default:
@@ -1657,7 +1630,10 @@ announce_object (NMPlatform *platform, const struct nl_object *object, NMPlatfor
{
NMPlatformIP4Route route;
- if (!_route_match ((struct rtnl_route *) object, AF_INET, 0)) {
+ if (reason == _NM_PLATFORM_REASON_CACHE_CHECK_INTERNAL)
+ return;
+
+ if (!_route_match ((struct rtnl_route *) object, AF_INET, 0, FALSE)) {
nm_log_dbg (LOGD_PLATFORM, "skip announce unmatching IP4 route %s", to_string_ip4_route ((struct rtnl_route *) object));
return;
}
@@ -1669,7 +1645,10 @@ announce_object (NMPlatform *platform, const struct nl_object *object, NMPlatfor
{
NMPlatformIP6Route route;
- if (!_route_match ((struct rtnl_route *) object, AF_INET6, 0)) {
+ if (reason == _NM_PLATFORM_REASON_CACHE_CHECK_INTERNAL)
+ return;
+
+ if (!_route_match ((struct rtnl_route *) object, AF_INET6, 0, FALSE)) {
nm_log_dbg (LOGD_PLATFORM, "skip announce unmatching IP6 route %s", to_string_ip6_route ((struct rtnl_route *) object));
return;
}
@@ -1708,9 +1687,15 @@ refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed
announce_object (platform, cached_object, NM_PLATFORM_SIGNAL_REMOVED, reason);
}
} else {
+ ObjectType type;
+
if (!kernel_object)
return FALSE;
+ /* Unsupported object types should never have reached the caches */
+ type = object_type_from_nl_object (kernel_object);
+ g_assert (type != OBJECT_TYPE_UNKNOWN);
+
hack_empty_master_iff_lower_up (platform, kernel_object);
if (cached_object)
@@ -1724,7 +1709,7 @@ refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed
announce_object (platform, kernel_object, cached_object ? NM_PLATFORM_SIGNAL_CHANGED : NM_PLATFORM_SIGNAL_ADDED, reason);
/* Refresh the master device (even on enslave/release) */
- if (object_type_from_nl_object (kernel_object) == OBJECT_TYPE_LINK) {
+ if (type == OBJECT_TYPE_LINK) {
int kernel_master = rtnl_link_get_master ((struct rtnl_link *) kernel_object);
int cached_master = cached_object ? rtnl_link_get_master ((struct rtnl_link *) cached_object) : 0;
struct nl_object *master_object;
@@ -1869,6 +1854,64 @@ _rtnl_addr_timestamps_equal_fuzzy (guint32 ts1, guint32 ts2)
return diff <= 2;
}
+static gboolean
+nm_nl_object_diff (ObjectType type, struct nl_object *_a, struct nl_object *_b)
+{
+ if (nl_object_diff (_a, _b)) {
+ /* libnl thinks objects are different*/
+ return TRUE;
+ }
+
+#if HAVE_LIBNL_INET6_TOKEN
+ /* libnl ignores PROTINFO changes in object without AF assigned */
+ if (type == OBJECT_TYPE_LINK) {
+ struct rtnl_addr *a = (struct rtnl_addr *) _a;
+ struct rtnl_addr *b = (struct rtnl_addr *) _b;
+ auto_nl_addr struct nl_addr *token_a = NULL;
+ auto_nl_addr struct nl_addr *token_b = NULL;
+
+ if (rtnl_link_inet6_get_token ((struct rtnl_link *) a, &token_a) != 0)
+ token_a = NULL;
+ if (rtnl_link_inet6_get_token ((struct rtnl_link *) b, &token_b) != 0)
+ token_b = NULL;
+
+ if (token_a && token_b) {
+ if (nl_addr_get_family (token_a) == AF_INET6 &&
+ nl_addr_get_family (token_b) == AF_INET6 &&
+ nl_addr_get_len (token_a) == sizeof (struct in6_addr) &&
+ nl_addr_get_len (token_b) == sizeof (struct in6_addr) &&
+ memcmp (nl_addr_get_binary_addr (token_a),
+ nl_addr_get_binary_addr (token_b),
+ sizeof (struct in6_addr))) {
+ /* Token changed */
+ return TRUE;
+ }
+ } else if (token_a != token_b) {
+ /* Token added or removed (?). */
+ return TRUE;
+ }
+ }
+#endif
+
+ if (type == OBJECT_TYPE_IP4_ADDRESS || type == OBJECT_TYPE_IP6_ADDRESS) {
+ struct rtnl_addr *a = (struct rtnl_addr *) _a;
+ struct rtnl_addr *b = (struct rtnl_addr *) _b;
+
+ /* libnl nl_object_diff() ignores differences in timestamp. Let's care about
+ * them (if they are large enough).
+ *
+ * Note that these valid and preferred timestamps are absolute, after
+ * _rtnl_addr_hack_lifetimes_rel_to_abs(). */
+ if ( !_rtnl_addr_timestamps_equal_fuzzy (rtnl_addr_get_preferred_lifetime (a),
+ rtnl_addr_get_preferred_lifetime (b))
+ || !_rtnl_addr_timestamps_equal_fuzzy (rtnl_addr_get_valid_lifetime (a),
+ rtnl_addr_get_valid_lifetime (b)))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/* This function does all the magic to avoid race conditions caused
* by concurrent usage of synchronous commands and an asynchronous cache. This
* might be a nice future addition to libnl but it requires to do all operations
@@ -1959,6 +2002,11 @@ event_notification (struct nl_msg *msg, gpointer user_data)
*/
if (!kernel_object)
return NL_OK;
+
+ /* Ignore unsupported object types (e.g. AF_PHONET family addresses) */
+ if (type == OBJECT_TYPE_UNKNOWN)
+ return NL_OK;
+
/* Handle external addition */
if (!cached_object) {
nle = nl_cache_add (cache, kernel_object);
@@ -1974,24 +2022,9 @@ event_notification (struct nl_msg *msg, gpointer user_data)
* This also catches notifications for internal addition or change, unless
* another action occured very soon after it.
*/
- if (!nl_object_diff (kernel_object, cached_object)) {
- if (type == OBJECT_TYPE_IP4_ADDRESS || type == OBJECT_TYPE_IP6_ADDRESS) {
- struct rtnl_addr *c = (struct rtnl_addr *) cached_object;
- struct rtnl_addr *k = (struct rtnl_addr *) kernel_object;
-
- /* libnl nl_object_diff() ignores differences in timestamp. Let's care about
- * them (if they are large enough).
- *
- * Note that these valid and preferred timestamps are absolute, after
- * _rtnl_addr_hack_lifetimes_rel_to_abs(). */
- if ( _rtnl_addr_timestamps_equal_fuzzy (rtnl_addr_get_preferred_lifetime (c),
- rtnl_addr_get_preferred_lifetime (k))
- && _rtnl_addr_timestamps_equal_fuzzy (rtnl_addr_get_valid_lifetime (c),
- rtnl_addr_get_valid_lifetime (k)))
- return NL_OK;
- } else
- return NL_OK;
- }
+ if (!nm_nl_object_diff (type, kernel_object, cached_object))
+ return NL_OK;
+
/* Handle external change */
nl_cache_remove (cached_object);
nle = nl_cache_add (cache, kernel_object);
@@ -2227,7 +2260,6 @@ build_rtnl_link (int ifindex, const char *name, NMLinkType type)
static gboolean
link_add (NMPlatform *platform, const char *name, NMLinkType type, const void *address, size_t address_len)
{
- int r;
struct nl_object *l;
if (type == NM_LINK_TYPE_BOND) {
@@ -2239,8 +2271,7 @@ link_add (NMPlatform *platform, const char *name, NMLinkType type, const void *a
* bond0 automatically.
*/
if (!g_file_test ("/sys/class/net/bonding_masters", G_FILE_TEST_EXISTS))
- /* Ignore return value to shut up the compiler */
- r = system ("modprobe bonding max_bonds=0");
+ nm_utils_modprobe (NULL, "bonding", "max_bonds=0", NULL);
}
debug ("link: add link '%s' of type '%s' (%d)",
@@ -2364,6 +2395,20 @@ link_get_type_name (NMPlatform *platform, int ifindex)
return type;
}
+static gboolean
+link_get_unmanaged (NMPlatform *platform, int ifindex, gboolean *managed)
+{
+ NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
+ GUdevDevice *udev_device = g_hash_table_lookup (priv->udev_devices, GINT_TO_POINTER (ifindex));
+
+ if (g_udev_device_get_property (udev_device, "NM_UNMANAGED")) {
+ *managed = g_udev_device_get_property_as_boolean (udev_device, "NM_UNMANAGED");
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static guint32
link_get_flags (NMPlatform *platform, int ifindex)
{
@@ -2446,6 +2491,38 @@ link_set_noarp (NMPlatform *platform, int ifindex)
}
static gboolean
+link_get_ipv6_token (NMPlatform *platform, int ifindex, NMUtilsIPv6IfaceId *iid)
+{
+#if HAVE_LIBNL_INET6_TOKEN
+ auto_nl_object struct rtnl_link *rtnllink = link_get (platform, ifindex);
+ struct nl_addr *nladdr;
+ struct in6_addr *addr;
+
+ if (rtnllink &&
+ (rtnl_link_inet6_get_token (rtnllink, &nladdr)) == 0) {
+ if (nl_addr_get_family (nladdr) != AF_INET6 ||
+ nl_addr_get_len (nladdr) != sizeof (struct in6_addr)) {
+ nl_addr_put (nladdr);
+ return FALSE;
+ }
+
+ addr = nl_addr_get_binary_addr (nladdr);
+ iid->id_u8[7] = addr->s6_addr[15];
+ iid->id_u8[6] = addr->s6_addr[14];
+ iid->id_u8[5] = addr->s6_addr[13];
+ iid->id_u8[4] = addr->s6_addr[12];
+ iid->id_u8[3] = addr->s6_addr[11];
+ iid->id_u8[2] = addr->s6_addr[10];
+ iid->id_u8[1] = addr->s6_addr[9];
+ iid->id_u8[0] = addr->s6_addr[8];
+ nl_addr_put (nladdr);
+ return TRUE;
+ }
+#endif
+ return FALSE;
+}
+
+static gboolean
link_get_user_ipv6ll_enabled (NMPlatform *platform, int ifindex)
{
#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
@@ -2924,7 +3001,7 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties *
val = nm_platform_sysctl_get (path);
g_free (path);
if (val) {
- props->owner = nm_utils_ascii_str_to_int64 (val, 10, -1, G_MAXINT64, -1);
+ props->owner = _nm_utils_ascii_str_to_int64 (val, 10, -1, G_MAXINT64, -1);
if (errno)
success = FALSE;
g_free (val);
@@ -2935,7 +3012,7 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties *
val = nm_platform_sysctl_get (path);
g_free (path);
if (val) {
- props->group = nm_utils_ascii_str_to_int64 (val, 10, -1, G_MAXINT64, -1);
+ props->group = _nm_utils_ascii_str_to_int64 (val, 10, -1, G_MAXINT64, -1);
if (errno)
success = FALSE;
g_free (val);
@@ -2948,12 +3025,12 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties *
if (val) {
gint64 flags;
- flags = nm_utils_ascii_str_to_int64 (val, 16, 0, G_MAXINT64, 0);
+ flags = _nm_utils_ascii_str_to_int64 (val, 16, 0, G_MAXINT64, 0);
if (!errno) {
#ifndef IFF_MULTI_QUEUE
const int IFF_MULTI_QUEUE = 0x0100;
#endif
- props->mode = ((flags & TUN_TYPE_MASK) == TUN_TUN_DEV) ? "tun" : "tap";
+ props->mode = ((flags & (IFF_TUN | IFF_TAP)) == IFF_TUN) ? "tun" : "tap";
props->no_pi = !!(flags & IFF_NO_PI);
props->vnet_hdr = !!(flags & IFF_VNET_HDR);
props->multi_queue = !!(flags & IFF_MULTI_QUEUE);
@@ -3334,6 +3411,15 @@ wifi_set_mode (NMPlatform *platform, int ifindex, NM80211Mode mode)
wifi_utils_set_mode (wifi_data, mode);
}
+static void
+wifi_set_powersave (NMPlatform *platform, int ifindex, guint32 powersave)
+{
+ WifiData *wifi_data = wifi_get_wifi_data (platform, ifindex);
+
+ if (wifi_data)
+ wifi_utils_set_powersave (wifi_data, powersave);
+}
+
static guint32
wifi_find_frequency (NMPlatform *platform, int ifindex, const guint32 *freqs)
{
@@ -3621,10 +3707,53 @@ ip6_address_exists (NMPlatform *platform, int ifindex, struct in6_addr addr, int
return ip_address_exists (platform, AF_INET6, ifindex, &addr, plen);
}
+static gboolean
+ip4_check_reinstall_device_route (NMPlatform *platform, int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric)
+{
+ NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
+ NMPlatformIP4Address addr_candidate;
+ NMPlatformIP4Route route_candidate;
+ struct nl_object *object;
+ guint32 device_network;
+
+ for (object = nl_cache_get_first (priv->address_cache); object; object = nl_cache_get_next (object)) {
+ if (_address_match ((struct rtnl_addr *) object, AF_INET, 0)) {
+ if (init_ip4_address (&addr_candidate, (struct rtnl_addr *) object))
+ if ( addr_candidate.plen == address->plen
+ && addr_candidate.address == address->address) {
+ /* If we already have the same address installed on any interface,
+ * we back off.
+ * Perform this check first, as we expect to have significantly less
+ * addresses to search. */
+ return FALSE;
+ }
+ }
+ }
+
+ device_network = nm_utils_ip4_address_clear_host_address (address->address, address->plen);
+
+ for (object = nl_cache_get_first (priv->route_cache); object; object = nl_cache_get_next (object)) {
+ if (_route_match ((struct rtnl_route *) object, AF_INET, 0, TRUE)) {
+ if (init_ip4_route (&route_candidate, (struct rtnl_route *) object)) {
+ if ( route_candidate.network == device_network
+ && route_candidate.plen == address->plen
+ && ( route_candidate.metric == 0
+ || route_candidate.metric == device_route_metric)) {
+ /* There is already any route with metric 0 or the metric we want to install
+ * for the same subnet. */
+ return FALSE;
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
/******************************************************************/
static gboolean
-_route_match (struct rtnl_route *rtnlroute, int family, int ifindex)
+_route_match (struct rtnl_route *rtnlroute, int family, int ifindex, gboolean include_proto_kernel)
{
struct rtnl_nexthop *nexthop;
@@ -3632,7 +3761,7 @@ _route_match (struct rtnl_route *rtnlroute, int family, int ifindex)
if (rtnl_route_get_type (rtnlroute) != RTN_UNICAST ||
rtnl_route_get_table (rtnlroute) != RT_TABLE_MAIN ||
- rtnl_route_get_protocol (rtnlroute) == RTPROT_KERNEL ||
+ (!include_proto_kernel && rtnl_route_get_protocol (rtnlroute) == RTPROT_KERNEL) ||
rtnl_route_get_family (rtnlroute) != family ||
rtnl_route_get_nnexthops (rtnlroute) != 1 ||
rtnl_route_get_flags (rtnlroute) & RTM_F_CLONED)
@@ -3646,21 +3775,28 @@ _route_match (struct rtnl_route *rtnlroute, int family, int ifindex)
}
static GArray *
-ip4_route_get_all (NMPlatform *platform, int ifindex, gboolean include_default)
+ip4_route_get_all (NMPlatform *platform, int ifindex, NMPlatformGetRouteMode mode)
{
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
GArray *routes;
NMPlatformIP4Route route;
struct nl_object *object;
+ g_return_val_if_fail (NM_IN_SET (mode, NM_PLATFORM_GET_ROUTE_MODE_ALL, NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT, NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT), NULL);
+
routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route));
for (object = nl_cache_get_first (priv->route_cache); object; object = nl_cache_get_next (object)) {
- if (_route_match ((struct rtnl_route *) object, AF_INET, ifindex)) {
- if (init_ip4_route (&route, (struct rtnl_route *) object)) {
- if (!NM_PLATFORM_IP_ROUTE_IS_DEFAULT (&route) || include_default)
- g_array_append_val (routes, route);
+ if (_route_match ((struct rtnl_route *) object, AF_INET, ifindex, FALSE)) {
+ if (_rtnl_route_is_default ((struct rtnl_route *) object)) {
+ if (mode == NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT)
+ continue;
+ } else {
+ if (mode == NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT)
+ continue;
}
+ if (init_ip4_route (&route, (struct rtnl_route *) object))
+ g_array_append_val (routes, route);
}
}
@@ -3668,21 +3804,28 @@ ip4_route_get_all (NMPlatform *platform, int ifindex, gboolean include_default)
}
static GArray *
-ip6_route_get_all (NMPlatform *platform, int ifindex, gboolean include_default)
+ip6_route_get_all (NMPlatform *platform, int ifindex, NMPlatformGetRouteMode mode)
{
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
GArray *routes;
NMPlatformIP6Route route;
struct nl_object *object;
+ g_return_val_if_fail (NM_IN_SET (mode, NM_PLATFORM_GET_ROUTE_MODE_ALL, NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT, NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT), NULL);
+
routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP6Route));
for (object = nl_cache_get_first (priv->route_cache); object; object = nl_cache_get_next (object)) {
- if (_route_match ((struct rtnl_route *) object, AF_INET6, ifindex)) {
- if (init_ip6_route (&route, (struct rtnl_route *) object)) {
- if (!NM_PLATFORM_IP_ROUTE_IS_DEFAULT (&route) || include_default)
- g_array_append_val (routes, route);
+ if (_route_match ((struct rtnl_route *) object, AF_INET6, ifindex, FALSE)) {
+ if (_rtnl_route_is_default ((struct rtnl_route *) object)) {
+ if (mode == NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT)
+ continue;
+ } else {
+ if (mode == NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT)
+ continue;
}
+ if (init_ip6_route (&route, (struct rtnl_route *) object))
+ g_array_append_val (routes, route);
}
}
@@ -3710,7 +3853,8 @@ clear_host_address (int family, const void *network, int plen, void *dst)
static struct nl_object *
build_rtnl_route (int family, int ifindex, NMIPConfigSource source,
gconstpointer network, int plen, gconstpointer gateway,
- int metric, int mss)
+ gconstpointer pref_src,
+ guint32 metric, guint32 mss)
{
guint32 network_clean[4];
struct rtnl_route *rtnlroute;
@@ -3719,6 +3863,7 @@ build_rtnl_route (int family, int ifindex, NMIPConfigSource source,
/* Workaround a libnl bug by using zero destination address length for default routes */
auto_nl_addr struct nl_addr *dst = NULL;
auto_nl_addr struct nl_addr *gw = gateway ? _nm_nl_addr_build (family, gateway, addrlen) : NULL;
+ auto_nl_addr struct nl_addr *pref_src_nl = pref_src ? _nm_nl_addr_build (family, pref_src, addrlen) : NULL;
/* There seem to be problems adding a route with non-zero host identifier.
* Adding IPv6 routes is simply ignored, without error message.
@@ -3740,6 +3885,8 @@ build_rtnl_route (int family, int ifindex, NMIPConfigSource source,
rtnl_route_nh_set_ifindex (nexthop, ifindex);
if (gw && !nl_addr_iszero (gw))
rtnl_route_nh_set_gateway (nexthop, gw);
+ if (pref_src_nl)
+ rtnl_route_set_pref_src (rtnlroute, pref_src_nl);
rtnl_route_add_nexthop (rtnlroute, nexthop);
if (mss > 0)
@@ -3751,21 +3898,23 @@ build_rtnl_route (int family, int ifindex, NMIPConfigSource source,
static gboolean
ip4_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
in_addr_t network, int plen, in_addr_t gateway,
- int metric, int mss)
+ guint32 pref_src, guint32 metric, guint32 mss)
{
- return add_object (platform, build_rtnl_route (AF_INET, ifindex, source, &network, plen, &gateway, metric, mss));
+ return add_object (platform, build_rtnl_route (AF_INET, ifindex, source, &network, plen, &gateway, pref_src ? &pref_src : NULL, metric, mss));
}
static gboolean
ip6_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
struct in6_addr network, int plen, struct in6_addr gateway,
- int metric, int mss)
+ guint32 metric, guint32 mss)
{
- return add_object (platform, build_rtnl_route (AF_INET6, ifindex, source, &network, plen, &gateway, metric, mss));
+ metric = nm_utils_ip6_route_metric_normalize (metric);
+
+ return add_object (platform, build_rtnl_route (AF_INET6, ifindex, source, &network, plen, &gateway, NULL, metric, mss));
}
static struct rtnl_route *
-route_search_cache (struct nl_cache *cache, int family, int ifindex, const void *network, int plen, int metric)
+route_search_cache (struct nl_cache *cache, int family, int ifindex, const void *network, int plen, guint32 metric)
{
guint32 network_clean[4], dst_clean[4];
struct nl_object *object;
@@ -3776,10 +3925,10 @@ route_search_cache (struct nl_cache *cache, int family, int ifindex, const void
struct nl_addr *dst;
struct rtnl_route *rtnlroute = (struct rtnl_route *) object;
- if (!_route_match (rtnlroute, family, ifindex))
+ if (!_route_match (rtnlroute, family, ifindex, FALSE))
continue;
- if (metric && metric != rtnl_route_get_priority (rtnlroute))
+ if (metric != rtnl_route_get_priority (rtnlroute))
continue;
dst = rtnl_route_get_dst (rtnlroute);
@@ -3788,7 +3937,14 @@ route_search_cache (struct nl_cache *cache, int family, int ifindex, const void
|| nl_addr_get_prefixlen (dst) != plen)
continue;
- clear_host_address (family, nl_addr_get_binary_addr (dst), plen, dst_clean);
+ /* plen = 0 means all host bits, so all bits should be cleared.
+ * Likewise if the binary address is not present or all zeros.
+ */
+ if (plen == 0 || nl_addr_iszero (dst))
+ memset (dst_clean, 0, sizeof (dst_clean));
+ else
+ clear_host_address (family, nl_addr_get_binary_addr (dst), plen, dst_clean);
+
if (memcmp (dst_clean, network_clean,
family == AF_INET ? sizeof (guint32) : sizeof (struct in6_addr)) != 0)
continue;
@@ -3800,7 +3956,7 @@ route_search_cache (struct nl_cache *cache, int family, int ifindex, const void
}
static gboolean
-refresh_route (NMPlatform *platform, int family, int ifindex, const void *network, int plen, int metric)
+refresh_route (NMPlatform *platform, int family, int ifindex, const void *network, int plen, guint32 metric)
{
struct nl_cache *cache;
auto_nl_object struct rtnl_route *cached_object = NULL;
@@ -3814,11 +3970,11 @@ refresh_route (NMPlatform *platform, int family, int ifindex, const void *networ
}
static gboolean
-ip4_route_delete (NMPlatform *platform, int ifindex, in_addr_t network, int plen, int metric)
+ip4_route_delete (NMPlatform *platform, int ifindex, in_addr_t network, int plen, guint32 metric)
{
in_addr_t gateway = 0;
struct rtnl_route *cached_object;
- struct nl_object *route = build_rtnl_route (AF_INET, ifindex, NM_IP_CONFIG_SOURCE_UNKNOWN, &network, plen, &gateway, metric, 0);
+ struct nl_object *route = build_rtnl_route (AF_INET, ifindex, NM_IP_CONFIG_SOURCE_UNKNOWN, &network, plen, &gateway, NULL, metric, 0);
uint8_t scope = RT_SCOPE_NOWHERE;
struct nl_cache *cache;
@@ -3826,6 +3982,19 @@ ip4_route_delete (NMPlatform *platform, int ifindex, in_addr_t network, int plen
cache = choose_cache_by_type (platform, OBJECT_TYPE_IP4_ROUTE);
+ if (metric == 0) {
+ /* Deleting an IPv4 route with metric 0 does not only delete an exectly matching route.
+ * If no route with metric 0 exists, it might delete another route to the same destination.
+ * For nm_platform_ip4_route_delete() we don't want this semantic.
+ *
+ * Instead, re-fetch the route from kernel, and if that fails, there is nothing to do.
+ * On success, there is still a race that we might end up deleting the wrong route. */
+ if (!refresh_object (platform, (struct nl_object *) route, FALSE, _NM_PLATFORM_REASON_CACHE_CHECK_INTERNAL)) {
+ rtnl_route_put ((struct rtnl_route *) route);
+ return TRUE;
+ }
+ }
+
/* when deleting an IPv4 route, several fields of the provided route must match.
* Lookup in the cache so that we hopefully get the right values. */
cached_object = (struct rtnl_route *) nl_cache_search (cache, route);
@@ -3874,20 +4043,22 @@ ip4_route_delete (NMPlatform *platform, int ifindex, in_addr_t network, int plen
}
static gboolean
-ip6_route_delete (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, int metric)
+ip6_route_delete (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, guint32 metric)
{
struct in6_addr gateway = IN6ADDR_ANY_INIT;
- return delete_object (platform, build_rtnl_route (AF_INET6, ifindex, NM_IP_CONFIG_SOURCE_UNKNOWN ,&network, plen, &gateway, metric, 0), FALSE) &&
+ metric = nm_utils_ip6_route_metric_normalize (metric);
+
+ return delete_object (platform, build_rtnl_route (AF_INET6, ifindex, NM_IP_CONFIG_SOURCE_UNKNOWN ,&network, plen, &gateway, NULL, metric, 0), FALSE) &&
refresh_route (platform, AF_INET6, ifindex, &network, plen, metric);
}
static gboolean
-ip_route_exists (NMPlatform *platform, int family, int ifindex, gpointer network, int plen, int metric)
+ip_route_exists (NMPlatform *platform, int family, int ifindex, gpointer network, int plen, guint32 metric)
{
auto_nl_object struct nl_object *object = build_rtnl_route (family, ifindex,
NM_IP_CONFIG_SOURCE_UNKNOWN,
- network, plen, NULL, metric, 0);
+ network, plen, NULL, NULL, metric, 0);
struct nl_cache *cache = choose_cache (platform, object);
auto_nl_object struct nl_object *cached_object = nl_cache_search (cache, object);
@@ -3897,19 +4068,153 @@ ip_route_exists (NMPlatform *platform, int family, int ifindex, gpointer network
}
static gboolean
-ip4_route_exists (NMPlatform *platform, int ifindex, in_addr_t network, int plen, int metric)
+ip4_route_exists (NMPlatform *platform, int ifindex, in_addr_t network, int plen, guint32 metric)
{
return ip_route_exists (platform, AF_INET, ifindex, &network, plen, metric);
}
static gboolean
-ip6_route_exists (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, int metric)
+ip6_route_exists (NMPlatform *platform, int ifindex, struct in6_addr network, int plen, guint32 metric)
{
+ metric = nm_utils_ip6_route_metric_normalize (metric);
+
return ip_route_exists (platform, AF_INET6, ifindex, &network, plen, metric);
}
/******************************************************************/
+/* Initialize the link cache while ensuring all links are of AF_UNSPEC,
+ * family (even though the kernel might set AF_BRIDGE for bridges).
+ * See also: _nl_link_family_unset() */
+static void
+init_link_cache (NMPlatform *platform)
+{
+ NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
+ struct nl_object *object = NULL;
+
+ rtnl_link_alloc_cache (priv->nlh, AF_UNSPEC, &priv->link_cache);
+
+ do {
+ for (object = nl_cache_get_first (priv->link_cache); object; object = nl_cache_get_next (object)) {
+ if (rtnl_link_get_family ((struct rtnl_link *)object) != AF_UNSPEC)
+ break;
+ }
+
+ if (object) {
+ /* A non-AF_UNSPEC object encoutnered */
+ struct nl_object *existing;
+
+ nl_object_get (object);
+ nl_cache_remove (object);
+ rtnl_link_set_family ((struct rtnl_link *)object, AF_UNSPEC);
+ existing = nl_cache_search (priv->link_cache, object);
+ if (existing)
+ nl_object_put (existing);
+ else
+ nl_cache_add (priv->link_cache, object);
+ nl_object_put (object);
+ }
+ } while (object);
+}
+
+/* Calls announce_object with appropriate arguments for all objects
+ * which are not coherent between old and new caches and deallocates
+ * the old cache. */
+static void
+cache_announce_changes (NMPlatform *platform, struct nl_cache *new, struct nl_cache *old)
+{
+ struct nl_object *object;
+
+ if (!old)
+ return;
+
+ for (object = nl_cache_get_first (new); object; object = nl_cache_get_next (object)) {
+ struct nl_object *cached_object = nm_nl_cache_search (old, object);
+
+ if (cached_object) {
+ ObjectType type = object_type_from_nl_object (object);
+ if (nm_nl_object_diff (type, object, cached_object))
+ announce_object (platform, object, NM_PLATFORM_SIGNAL_CHANGED, NM_PLATFORM_REASON_EXTERNAL);
+ nl_object_put (cached_object);
+ } else
+ announce_object (platform, object, NM_PLATFORM_SIGNAL_ADDED, NM_PLATFORM_REASON_EXTERNAL);
+ }
+ for (object = nl_cache_get_first (old); object; object = nl_cache_get_next (object)) {
+ struct nl_object *cached_object = nm_nl_cache_search (new, object);
+ if (cached_object)
+ nl_object_put (cached_object);
+ else
+ announce_object (platform, object, NM_PLATFORM_SIGNAL_REMOVED, NM_PLATFORM_REASON_EXTERNAL);
+ }
+
+ nl_cache_free (old);
+}
+
+/* The cache should always avoid containing objects not handled by NM, like
+ * e.g. addresses of the AF_PHONET family. */
+static void
+cache_remove_unknown (struct nl_cache *cache)
+{
+ GPtrArray *objects_to_remove = NULL;
+ struct nl_object *object;
+
+ for (object = nl_cache_get_first (cache); object; object = nl_cache_get_next (object)) {
+ if (object_type_from_nl_object (object) == OBJECT_TYPE_UNKNOWN) {
+ if (!objects_to_remove)
+ objects_to_remove = g_ptr_array_new_with_free_func ((GDestroyNotify) nl_object_put);
+ nl_object_get (object);
+ g_ptr_array_add (objects_to_remove, object);
+ }
+ }
+
+ if (objects_to_remove) {
+ guint i;
+
+ for (i = 0; i < objects_to_remove->len; i++)
+ nl_cache_remove (g_ptr_array_index (objects_to_remove, i));
+
+ g_ptr_array_free (objects_to_remove, TRUE);
+ }
+}
+
+/* Creates and populates the netlink object caches. Called upon platform init and
+ * when we run out of sync (out of buffer space, netlink congestion control). In case
+ * the caches already exist, it finds changed, added and removed objects, announces
+ * them and destroys the old caches. */
+static void
+cache_repopulate_all (NMPlatform *platform)
+{
+ NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
+ struct nl_cache *old_link_cache = priv->link_cache;
+ struct nl_cache *old_address_cache = priv->address_cache;
+ struct nl_cache *old_route_cache = priv->route_cache;
+ struct nl_object *object;
+
+ debug ("platform: %spopulate platform cache", old_link_cache ? "re" : "");
+
+ /* Allocate new netlink caches */
+ init_link_cache (platform);
+ rtnl_addr_alloc_cache (priv->nlh, &priv->address_cache);
+ rtnl_route_alloc_cache (priv->nlh, AF_UNSPEC, 0, &priv->route_cache);
+ g_assert (priv->link_cache && priv->address_cache && priv->route_cache);
+
+ /* Remove all unknown objects from the caches */
+ cache_remove_unknown (priv->link_cache);
+ cache_remove_unknown (priv->address_cache);
+ cache_remove_unknown (priv->route_cache);
+
+ for (object = nl_cache_get_first (priv->address_cache); object; object = nl_cache_get_next (object)) {
+ _rtnl_addr_hack_lifetimes_rel_to_abs ((struct rtnl_addr *) object);
+ }
+
+ /* Make sure all changes we've missed are announced. */
+ cache_announce_changes (platform, priv->link_cache, old_link_cache);
+ cache_announce_changes (platform, priv->address_cache, old_address_cache);
+ cache_announce_changes (platform, priv->route_cache, old_route_cache);
+}
+
+/******************************************************************/
+
#define EVENT_CONDITIONS ((GIOCondition) (G_IO_IN | G_IO_PRI))
#define ERROR_CONDITIONS ((GIOCondition) (G_IO_ERR | G_IO_NVAL))
#define DISCONNECT_CONDITIONS ((GIOCondition) (G_IO_HUP))
@@ -3936,7 +4241,8 @@ event_handler (GIOChannel *channel,
GIOCondition io_condition,
gpointer user_data)
{
- NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (user_data);
+ NMPlatform *platform = NM_PLATFORM (user_data);
+ NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
int nle;
nle = nl_recvmsgs_default (priv->nlh_event);
@@ -3948,6 +4254,23 @@ event_handler (GIOChannel *channel,
* and can happen easily. */
debug ("Uncritical failure to retrieve incoming events: %s (%d)", nl_geterror (nle), nle);
break;
+ case -NLE_NOMEM:
+ warning ("Too many netlink events. Need to resynchronize platform cache");
+ /* Drain the event queue, we've lost events and are out of sync anyway and we'd
+ * like to free up some space. We'll read in the status synchronously. */
+ nl_socket_modify_cb (priv->nlh_event, NL_CB_VALID, NL_CB_DEFAULT, NULL, NULL);
+ do {
+ errno = 0;
+
+ nle = nl_recvmsgs_default (priv->nlh_event);
+
+ /* Work around a libnl bug fixed in 3.2.22 (375a6294) */
+ if (nle == 0 && (errno == EAGAIN || errno == EWOULDBLOCK))
+ nle = -NLE_AGAIN;
+ } while (nle != -NLE_AGAIN);
+ nl_socket_modify_cb (priv->nlh_event, NL_CB_VALID, NL_CB_CUSTOM, event_notification, user_data);
+ cache_repopulate_all (platform);
+ break;
default:
error ("Failed to retrieve incoming events: %s (%d)", nl_geterror (nle), nle);
break;
@@ -3979,6 +4302,12 @@ setup_socket (gboolean event, gpointer user_data)
nle = nl_socket_set_passcred (sock, 1);
g_assert (!nle);
+ /* No blocking for event socket, so that we can drain it safely. */
+ if (event) {
+ nle = nl_socket_set_nonblocking (sock);
+ g_assert (!nle);
+ }
+
return sock;
}
@@ -3993,7 +4322,6 @@ udev_device_added (NMPlatform *platform,
const char *ifname;
int ifindex;
gboolean was_announceable = FALSE;
- int nle;
ifname = g_udev_device_get_name (udev_device);
if (!ifname) {
@@ -4024,12 +4352,6 @@ udev_device_added (NMPlatform *platform,
g_hash_table_insert (priv->udev_devices, GINT_TO_POINTER (ifindex),
g_object_ref (udev_device));
- /* Grow the netlink socket buffer beyond 128k if we have more that 32 interfaces. */
- nle = nl_socket_set_buffer_size (priv->nlh_event,
- MAX (131072, 4096 * g_hash_table_size (priv->udev_devices)), 0);
- if (nle)
- warning ("udev-add: failed to adjust netlink socket buffer size");
-
/* Announce devices only if they also have been discovered via Netlink. */
if (rtnllink && link_is_announceable (platform, rtnllink))
announce_object (platform, (struct nl_object *) rtnllink, was_announceable ? NM_PLATFORM_SIGNAL_CHANGED : NM_PLATFORM_SIGNAL_ADDED, NM_PLATFORM_REASON_EXTERNAL);
@@ -4124,7 +4446,9 @@ setup (NMPlatform *platform)
int channel_flags;
gboolean status;
int nle;
+#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
struct nl_object *object;
+#endif
/* Initialize netlink socket for requests */
priv->nlh = setup_socket (FALSE, platform);
@@ -4160,14 +4484,7 @@ setup (NMPlatform *platform)
(EVENT_CONDITIONS | ERROR_CONDITIONS | DISCONNECT_CONDITIONS),
event_handler, platform);
- /* Allocate netlink caches */
- rtnl_link_alloc_cache (priv->nlh, AF_UNSPEC, &priv->link_cache);
- rtnl_addr_alloc_cache (priv->nlh, &priv->address_cache);
- rtnl_route_alloc_cache (priv->nlh, AF_UNSPEC, 0, &priv->route_cache);
- g_assert (priv->link_cache && priv->address_cache && priv->route_cache);
-
- for (object = nl_cache_get_first (priv->address_cache); object; object = nl_cache_get_next (object))
- _rtnl_addr_hack_lifetimes_rel_to_abs ((struct rtnl_addr *) object);
+ cache_repopulate_all (platform);
#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
/* Initial check for user IPv6LL support once the link cache is allocated
@@ -4195,7 +4512,12 @@ setup (NMPlatform *platform)
/* And read initial device list */
enumerator = g_udev_enumerator_new (priv->udev_client);
g_udev_enumerator_add_match_subsystem (enumerator, "net");
- g_udev_enumerator_add_match_is_initialized (enumerator);
+
+ /* Demand that the device is initialized (udev rules ran,
+ * device has a stable name now) in case udev is running
+ * (not in a container). */
+ if (access ("/sys", W_OK) == 0)
+ g_udev_enumerator_add_match_is_initialized (enumerator);
devices = g_udev_enumerator_execute (enumerator);
for (iter = devices; iter; iter = g_list_next (iter)) {
@@ -4263,6 +4585,7 @@ nm_linux_platform_class_init (NMLinuxPlatformClass *klass)
platform_class->link_get_name = link_get_name;
platform_class->link_get_type = link_get_type;
platform_class->link_get_type_name = link_get_type_name;
+ platform_class->link_get_unmanaged = link_get_unmanaged;
platform_class->link_refresh = link_refresh;
@@ -4274,6 +4597,8 @@ nm_linux_platform_class_init (NMLinuxPlatformClass *klass)
platform_class->link_is_connected = link_is_connected;
platform_class->link_uses_arp = link_uses_arp;
+ platform_class->link_get_ipv6_token = link_get_ipv6_token;
+
platform_class->link_get_user_ipv6ll_enabled = link_get_user_ipv6ll_enabled;
platform_class->link_set_user_ipv6ll_enabled = link_set_user_ipv6ll_enabled;
@@ -4317,6 +4642,7 @@ nm_linux_platform_class_init (NMLinuxPlatformClass *klass)
platform_class->wifi_get_rate = wifi_get_rate;
platform_class->wifi_get_mode = wifi_get_mode;
platform_class->wifi_set_mode = wifi_set_mode;
+ platform_class->wifi_set_powersave = wifi_set_powersave;
platform_class->wifi_find_frequency = wifi_find_frequency;
platform_class->wifi_indicate_addressing_running = wifi_indicate_addressing_running;
@@ -4333,6 +4659,8 @@ nm_linux_platform_class_init (NMLinuxPlatformClass *klass)
platform_class->ip4_address_exists = ip4_address_exists;
platform_class->ip6_address_exists = ip6_address_exists;
+ platform_class->ip4_check_reinstall_device_route = ip4_check_reinstall_device_route;
+
platform_class->ip4_route_get_all = ip4_route_get_all;
platform_class->ip6_route_get_all = ip6_route_get_all;
platform_class->ip4_route_add = ip4_route_add;
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 1aa72a4dba..d51c142e04 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -18,6 +18,8 @@
* Copyright (C) 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
@@ -26,12 +28,14 @@
#include <string.h>
#include <netlink/route/addr.h>
+#include "gsystem-local-alloc.h"
#include "NetworkManagerUtils.h"
#include "nm-utils.h"
#include "nm-platform.h"
#include "NetworkManagerUtils.h"
#include "nm-logging.h"
#include "nm-enum-types.h"
+#include "nm-core-internal.h"
#define debug(...) nm_log_dbg (LOGD_PLATFORM, __VA_ARGS__)
@@ -319,7 +323,7 @@ nm_platform_sysctl_get_int_checked (const char *path, guint base, gint64 min, gi
return fallback;
}
- ret = nm_utils_ascii_str_to_int64 (value, base, min, max, fallback);
+ ret = _nm_utils_ascii_str_to_int64 (value, base, min, max, fallback);
g_free (value);
return ret;
}
@@ -649,6 +653,25 @@ nm_platform_link_get_type_name (int ifindex)
}
/**
+ * nm_platform_link_get_unmanaged:
+ * @ifindex: Interface index.
+ * @managed: Management status in case %TRUE is returned
+ *
+ * Returns: %TRUE if platform overrides whether the device ought
+ * to be managed by default. %FALSE with @managed unmodified
+ * otherwise.
+ */
+gboolean
+nm_platform_link_get_unmanaged (int ifindex, gboolean *managed)
+{
+ reset_error ();
+
+ g_return_val_if_fail (klass->link_get_unmanaged, FALSE);
+
+ return klass->link_get_unmanaged (platform, ifindex, managed);
+}
+
+/**
* nm_platform_link_is_software:
* @ifindex: Interface index.
*
@@ -745,6 +768,31 @@ nm_platform_link_uses_arp (int ifindex)
}
/**
+ * nm_platform_link_get_ipv6_token:
+ * @ifindex: Interface index
+ * @iid: Tokenized interface identifier
+ *
+ * Returns IPv6 tokenized interface identifier. If the platform or OS doesn't
+ * support IPv6 tokenized interface identifiers, or the token is not set
+ * this call will fail and return %FALSE.
+ *
+ * Returns: %TRUE a tokenized identifier was available
+ */
+gboolean
+nm_platform_link_get_ipv6_token (int ifindex, NMUtilsIPv6IfaceId *iid)
+{
+ reset_error ();
+
+ g_return_val_if_fail (ifindex >= 0, FALSE);
+ g_return_val_if_fail (iid, FALSE);
+
+ if (klass->link_get_ipv6_token)
+ return klass->link_get_ipv6_token (platform, ifindex, iid);
+ return FALSE;
+}
+
+
+/**
* nm_platform_link_get_user_ip6vll_enabled:
* @ifindex: Interface index
*
@@ -1396,6 +1444,22 @@ nm_platform_wifi_set_mode (int ifindex, NM80211Mode mode)
klass->wifi_set_mode (platform, ifindex, mode);
}
+static void
+wifi_set_powersave (NMPlatform *p, int ifindex, guint32 powersave)
+{
+ /* empty */
+}
+
+void
+nm_platform_wifi_set_powersave (int ifindex, guint32 powersave)
+{
+ reset_error ();
+
+ g_return_if_fail (ifindex > 0);
+
+ klass->wifi_set_powersave (platform, ifindex, powersave);
+}
+
guint32
nm_platform_wifi_find_frequency (int ifindex, const guint32 *freqs)
{
@@ -1703,6 +1767,11 @@ _address_get_lifetime (const NMPlatformIPAddress *address, guint32 now, guint32
if (address->lifetime == 0) {
*out_lifetime = NM_PLATFORM_LIFETIME_PERMANENT;
*out_preferred = NM_PLATFORM_LIFETIME_PERMANENT;
+
+ /* We treat lifetime==0 as permanent addresses to allow easy creation of such addresses
+ * (without requiring to set the lifetime fields to NM_PLATFORM_LIFETIME_PERMANENT).
+ * In that case we also expect that the other fields (timestamp and preferred) are left unset. */
+ g_return_val_if_fail (address->timestamp == 0 && address->preferred == 0, TRUE);
} else {
lifetime = _rebase_relative_time_on_now (address->timestamp, address->lifetime, now, padding);
if (!lifetime)
@@ -1724,10 +1793,31 @@ _address_get_lifetime (const NMPlatformIPAddress *address, guint32 now, guint32
return TRUE;
}
+gboolean
+nm_platform_ip4_check_reinstall_device_route (int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric)
+{
+ g_return_val_if_fail (address, FALSE);
+
+ if ( ifindex <= 0
+ || address->plen <= 0
+ || address->plen >= 32)
+ return FALSE;
+
+ if (device_route_metric == NM_PLATFORM_ROUTE_METRIC_IP4_DEVICE_ROUTE) {
+ /* The automatically added route would be already our desired priority.
+ * Nothing to do. */
+ return FALSE;
+ }
+
+ return klass->ip4_check_reinstall_device_route (platform, ifindex, address, device_route_metric);
+}
+
/**
* nm_platform_ip4_address_sync:
* @ifindex: Interface index
* @known_addresses: List of addresses
+ * @device_route_metric: the route metric for adding subnet routes (replaces
+ * the kernel added routes).
*
* A convenience function to synchronize addresses for a specific interface
* with the least possible disturbance. It simply removes addresses that are
@@ -1736,7 +1826,7 @@ _address_get_lifetime (const NMPlatformIPAddress *address, guint32 now, guint32
* Returns: %TRUE on success.
*/
gboolean
-nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses)
+nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint32 device_route_metric)
{
GArray *addresses;
NMPlatformIP4Address *address;
@@ -1760,13 +1850,34 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses)
for (i = 0; i < known_addresses->len; i++) {
const NMPlatformIP4Address *known_address = &g_array_index (known_addresses, NMPlatformIP4Address, i);
guint32 lifetime, preferred;
+ guint32 network;
+ gboolean reinstall_device_route = FALSE;
/* add a padding of 5 seconds to avoid potential races. */
if (!_address_get_lifetime ((NMPlatformIPAddress *) known_address, now, 5, &lifetime, &preferred))
continue;
+ if (nm_platform_ip4_check_reinstall_device_route (ifindex, known_address, device_route_metric))
+ reinstall_device_route = TRUE;
+
if (!nm_platform_ip4_address_add (ifindex, known_address->address, known_address->peer_address, known_address->plen, lifetime, preferred, known_address->label))
return FALSE;
+
+ if (reinstall_device_route) {
+ /* Kernel automatically adds a device route for us with metric 0. That is not what we want.
+ * Remove it, and re-add it.
+ *
+ * In face of having the same subnets on two different interfaces with the same metric,
+ * this is a problem. Surprisingly, kernel is able to add two routes for the same subnet/prefix,metric
+ * to different interfaces. We cannot. Adding one, would replace the other. This is avoided
+ * by the above nm_platform_ip4_check_reinstall_device_route() check.
+ */
+ network = nm_utils_ip4_address_clear_host_address (known_address->address, known_address->plen);
+ (void) nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_KERNEL, network, known_address->plen,
+ 0, known_address->address, device_route_metric, 0);
+ (void) nm_platform_ip4_route_delete (ifindex, network, known_address->plen,
+ NM_PLATFORM_ROUTE_METRIC_IP4_DEVICE_ROUTE);
+ }
}
return TRUE;
@@ -1776,6 +1887,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses)
* nm_platform_ip6_address_sync:
* @ifindex: Interface index
* @known_addresses: List of addresses
+ * @keep_link_local: Don't remove link-local address
*
* A convenience function to synchronize addresses for a specific interface
* with the least possible disturbance. It simply removes addresses that are
@@ -1784,7 +1896,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses)
* Returns: %TRUE on success.
*/
gboolean
-nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
+nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local)
{
GArray *addresses;
NMPlatformIP6Address *address;
@@ -1797,7 +1909,7 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
address = &g_array_index (addresses, NMPlatformIP6Address, i);
/* Leave link local address management to the kernel */
- if (IN6_IS_ADDR_LINKLOCAL (&address->address))
+ if (keep_link_local && IN6_IS_ADDR_LINKLOCAL (&address->address))
continue;
if (!array_contains_ip6_address (known_addresses, address))
@@ -1829,49 +1941,49 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
gboolean
nm_platform_address_flush (int ifindex)
{
- return nm_platform_ip4_address_sync (ifindex, NULL)
- && nm_platform_ip6_address_sync (ifindex, NULL);
+ return nm_platform_ip4_address_sync (ifindex, NULL, 0)
+ && nm_platform_ip6_address_sync (ifindex, NULL, FALSE);
}
/******************************************************************/
GArray *
-nm_platform_ip4_route_get_all (int ifindex, gboolean include_default)
+nm_platform_ip4_route_get_all (int ifindex, NMPlatformGetRouteMode mode)
{
reset_error ();
- g_return_val_if_fail (ifindex > 0, NULL);
+ g_return_val_if_fail (ifindex >= 0, NULL);
g_return_val_if_fail (klass->ip4_route_get_all, NULL);
- return klass->ip4_route_get_all (platform, ifindex, include_default);
+ return klass->ip4_route_get_all (platform, ifindex, mode);
}
GArray *
-nm_platform_ip6_route_get_all (int ifindex, gboolean include_default)
+nm_platform_ip6_route_get_all (int ifindex, NMPlatformGetRouteMode mode)
{
reset_error ();
- g_return_val_if_fail (ifindex > 0, NULL);
+ g_return_val_if_fail (ifindex >= 0, NULL);
g_return_val_if_fail (klass->ip6_route_get_all, NULL);
- return klass->ip6_route_get_all (platform, ifindex, include_default);
+ return klass->ip6_route_get_all (platform, ifindex, mode);
}
gboolean
nm_platform_ip4_route_add (int ifindex, NMIPConfigSource source,
in_addr_t network, int plen,
- in_addr_t gateway, int metric, int mss)
+ in_addr_t gateway, guint32 pref_src,
+ guint32 metric, guint32 mss)
{
reset_error ();
g_return_val_if_fail (platform, FALSE);
g_return_val_if_fail (0 <= plen && plen <= 32, FALSE);
- g_return_val_if_fail (metric >= 0, FALSE);
- g_return_val_if_fail (mss >= 0, FALSE);
g_return_val_if_fail (klass->ip4_route_add, FALSE);
if (nm_logging_enabled (LOGL_DEBUG, LOGD_PLATFORM)) {
NMPlatformIP4Route route = { 0 };
+ char pref_src_buf[NM_UTILS_INET_ADDRSTRLEN];
route.ifindex = ifindex;
route.source = source;
@@ -1881,20 +1993,21 @@ nm_platform_ip4_route_add (int ifindex, NMIPConfigSource source,
route.metric = metric;
route.mss = mss;
- debug ("route: adding or updating IPv4 route: %s", nm_platform_ip4_route_to_string (&route));
+ debug ("route: adding or updating IPv4 route: %s%s%s%s", nm_platform_ip4_route_to_string (&route),
+ pref_src ? " (src: " : "",
+ pref_src ? nm_utils_inet4_ntop (pref_src, pref_src_buf) : "",
+ pref_src ? ")" : "");
}
- return klass->ip4_route_add (platform, ifindex, source, network, plen, gateway, metric, mss);
+ return klass->ip4_route_add (platform, ifindex, source, network, plen, gateway, pref_src, metric, mss);
}
gboolean
nm_platform_ip6_route_add (int ifindex, NMIPConfigSource source,
struct in6_addr network, int plen, struct in6_addr gateway,
- int metric, int mss)
+ guint32 metric, guint32 mss)
{
g_return_val_if_fail (platform, FALSE);
g_return_val_if_fail (0 <= plen && plen <= 128, FALSE);
- g_return_val_if_fail (metric >= 0, FALSE);
- g_return_val_if_fail (mss >= 0, FALSE);
g_return_val_if_fail (klass->ip6_route_add, FALSE);
if (nm_logging_enabled (LOGL_DEBUG, LOGD_PLATFORM)) {
@@ -1914,7 +2027,7 @@ nm_platform_ip6_route_add (int ifindex, NMIPConfigSource source,
}
gboolean
-nm_platform_ip4_route_delete (int ifindex, in_addr_t network, int plen, int metric)
+nm_platform_ip4_route_delete (int ifindex, in_addr_t network, int plen, guint32 metric)
{
char str_dev[TO_STRING_DEV_BUF_SIZE];
@@ -1923,14 +2036,14 @@ nm_platform_ip4_route_delete (int ifindex, in_addr_t network, int plen, int metr
g_return_val_if_fail (platform, FALSE);
g_return_val_if_fail (klass->ip4_route_delete, FALSE);
- debug ("route: deleting IPv4 route %s/%d, metric=%d, ifindex %d%s",
+ debug ("route: deleting IPv4 route %s/%d, metric=%"G_GUINT32_FORMAT", ifindex %d%s",
nm_utils_inet4_ntop (network, NULL), plen, metric, ifindex,
_to_string_dev (ifindex, str_dev, sizeof (str_dev)));
return klass->ip4_route_delete (platform, ifindex, network, plen, metric);
}
gboolean
-nm_platform_ip6_route_delete (int ifindex, struct in6_addr network, int plen, int metric)
+nm_platform_ip6_route_delete (int ifindex, struct in6_addr network, int plen, guint32 metric)
{
char str_dev[TO_STRING_DEV_BUF_SIZE];
@@ -1939,14 +2052,14 @@ nm_platform_ip6_route_delete (int ifindex, struct in6_addr network, int plen, in
g_return_val_if_fail (platform, FALSE);
g_return_val_if_fail (klass->ip6_route_delete, FALSE);
- debug ("route: deleting IPv6 route %s/%d, metric=%d, ifindex %d%s",
+ debug ("route: deleting IPv6 route %s/%d, metric=%"G_GUINT32_FORMAT", ifindex %d%s",
nm_utils_inet6_ntop (&network, NULL), plen, metric, ifindex,
_to_string_dev (ifindex, str_dev, sizeof (str_dev)));
return klass->ip6_route_delete (platform, ifindex, network, plen, metric);
}
gboolean
-nm_platform_ip4_route_exists (int ifindex, in_addr_t network, int plen, int metric)
+nm_platform_ip4_route_exists (int ifindex, in_addr_t network, int plen, guint32 metric)
{
reset_error ();
@@ -1957,7 +2070,7 @@ nm_platform_ip4_route_exists (int ifindex, in_addr_t network, int plen, int metr
}
gboolean
-nm_platform_ip6_route_exists (int ifindex, struct in6_addr network, int plen, int metric)
+nm_platform_ip6_route_exists (int ifindex, struct in6_addr network, int plen, guint32 metric)
{
reset_error ();
@@ -1967,198 +2080,6 @@ nm_platform_ip6_route_exists (int ifindex, struct in6_addr network, int plen, in
return klass->ip6_route_exists (platform, ifindex, network, plen, metric);
}
-static gboolean
-array_contains_ip4_route (const GArray *routes, const NMPlatformIP4Route *route)
-{
- guint len = routes ? routes->len : 0;
- guint i;
-
- for (i = 0; i < len; i++) {
- NMPlatformIP4Route *c = &g_array_index (routes, NMPlatformIP4Route, i);
-
- if (route->network == c->network &&
- route->plen == c->plen &&
- route->gateway == c->gateway &&
- route->metric == c->metric)
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-array_contains_ip6_route (const GArray *routes, const NMPlatformIP6Route *route)
-{
- guint len = routes ? routes->len : 0;
- guint i;
-
- for (i = 0; i < len; i++) {
- NMPlatformIP6Route *c = &g_array_index (routes, NMPlatformIP6Route, i);
-
- if (IN6_ARE_ADDR_EQUAL (&route->network, &c->network) &&
- route->plen == c->plen &&
- IN6_ARE_ADDR_EQUAL (&route->gateway, &c->gateway) &&
- route->metric == c->metric)
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- * nm_platform_ip4_route_sync:
- * @ifindex: Interface index
- * @known_routes: List of routes
- *
- * A convenience function to synchronize routes for a specific interface
- * with the least possible disturbance. It simply removes routes that are
- * not listed and adds routes that are.
- *
- * @known_routes should not contain a default route; if it does, it will be
- * ignored.
- *
- * Returns: %TRUE on success.
- */
-gboolean
-nm_platform_ip4_route_sync (int ifindex, const GArray *known_routes)
-{
- GArray *routes;
- NMPlatformIP4Route *route;
- const NMPlatformIP4Route *known_route;
- gboolean success;
- int i, i_type;
-
- /* Delete unknown routes */
- routes = nm_platform_ip4_route_get_all (ifindex, FALSE);
- for (i = 0; i < routes->len; i++) {
- route = &g_array_index (routes, NMPlatformIP4Route, i);
-
- if (!array_contains_ip4_route (known_routes, route))
- nm_platform_ip4_route_delete (ifindex, route->network, route->plen, route->metric);
- }
-
- if (!known_routes) {
- g_array_free (routes, TRUE);
- return TRUE;
- }
-
- /* Add missing routes */
- for (i_type = 0, success = TRUE; i_type < 2 && success; i_type++) {
- for (i = 0; i < known_routes->len && success; i++) {
- known_route = &g_array_index (known_routes, NMPlatformIP4Route, i);
-
- if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (known_route))
- continue;
-
- if ((known_route->gateway == 0) ^ (i_type != 0)) {
- /* Make two runs over the list of routes. On the first, only add
- * device routes, on the second the others (gateway routes). */
- continue;
- }
-
- /* Ignore routes that already exist */
- if (!array_contains_ip4_route (routes, known_route)) {
- success = nm_platform_ip4_route_add (ifindex,
- known_route->source,
- known_route->network,
- known_route->plen,
- known_route->gateway,
- known_route->metric,
- known_route->mss);
- if (!success && known_route->source < NM_IP_CONFIG_SOURCE_USER) {
- nm_log_dbg (LOGD_PLATFORM, "ignore error adding IPv4 route to kernel: %s",
- nm_platform_ip4_route_to_string (known_route));
- success = TRUE;
- }
- }
- }
- }
-
- g_array_free (routes, TRUE);
- return success;
-}
-
-/**
- * nm_platform_ip6_route_sync:
- * @ifindex: Interface index
- * @known_routes: List of routes
- *
- * A convenience function to synchronize routes for a specific interface
- * with the least possible disturbance. It simply removes routes that are
- * not listed and adds routes that are.
- *
- * @known_routes should not contain a default route; if it does, it will be
- * ignored.
- *
- * Returns: %TRUE on success.
- */
-gboolean
-nm_platform_ip6_route_sync (int ifindex, const GArray *known_routes)
-{
- GArray *routes;
- NMPlatformIP6Route *route;
- const NMPlatformIP6Route *known_route;
- gboolean success;
- int i, i_type;
-
- /* Delete unknown routes */
- routes = nm_platform_ip6_route_get_all (ifindex, FALSE);
- for (i = 0; i < routes->len; i++) {
- route = &g_array_index (routes, NMPlatformIP6Route, i);
- route->ifindex = 0;
-
- if (!array_contains_ip6_route (known_routes, route))
- nm_platform_ip6_route_delete (ifindex, route->network, route->plen, route->metric);
- }
-
- if (!known_routes) {
- g_array_free (routes, TRUE);
- return TRUE;
- }
-
- /* Add missing routes */
- for (i_type = 0, success = TRUE; i_type < 2 && success; i_type++) {
- for (i = 0; i < known_routes->len && success; i++) {
- known_route = &g_array_index (known_routes, NMPlatformIP6Route, i);
-
- if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (known_route))
- continue;
-
- if (IN6_IS_ADDR_UNSPECIFIED (&known_route->gateway) ^ (i_type != 0)) {
- /* Make two runs over the list of routes. On the first, only add
- * device routes, on the second the others (gateway routes). */
- continue;
- }
-
- /* Ignore routes that already exist */
- if (!array_contains_ip6_route (routes, known_route)) {
- success = nm_platform_ip6_route_add (ifindex,
- known_route->source,
- known_route->network,
- known_route->plen,
- known_route->gateway,
- known_route->metric,
- known_route->mss);
- if (!success && known_route->source < NM_IP_CONFIG_SOURCE_USER) {
- nm_log_dbg (LOGD_PLATFORM, "ignore error adding IPv6 route to kernel: %s",
- nm_platform_ip6_route_to_string (known_route));
- success = TRUE;
- }
- }
- }
- }
-
- g_array_free (routes, TRUE);
- return success;
-}
-
-gboolean
-nm_platform_route_flush (int ifindex)
-{
- return nm_platform_ip4_route_sync (ifindex, NULL)
- && nm_platform_ip6_route_sync (ifindex, NULL);
-}
-
/******************************************************************/
static const char *
@@ -2427,7 +2348,7 @@ nm_platform_ip4_route_to_string (const NMPlatformIP4Route *route)
_to_string_dev (route->ifindex, str_dev, sizeof (str_dev));
- g_snprintf (to_string_buffer, sizeof (to_string_buffer), "%s/%d via %s%s metric %u mss %u src %s",
+ g_snprintf (to_string_buffer, sizeof (to_string_buffer), "%s/%d via %s%s metric %"G_GUINT32_FORMAT" mss %"G_GUINT32_FORMAT" src %s",
s_network, route->plen, s_gateway,
str_dev,
route->metric, route->mss,
@@ -2460,7 +2381,7 @@ nm_platform_ip6_route_to_string (const NMPlatformIP6Route *route)
_to_string_dev (route->ifindex, str_dev, sizeof (str_dev));
- g_snprintf (to_string_buffer, sizeof (to_string_buffer), "%s/%d via %s%s metric %u mss %u src %s",
+ g_snprintf (to_string_buffer, sizeof (to_string_buffer), "%s/%d via %s%s metric %"G_GUINT32_FORMAT" mss %"G_GUINT32_FORMAT" src %s",
s_network, route->plen, s_gateway,
str_dev,
route->metric, route->mss,
@@ -2706,6 +2627,8 @@ nm_platform_class_init (NMPlatformClass *platform_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (platform_class);
+ platform_class->wifi_set_powersave = wifi_set_powersave;
+
/* Signals */
SIGNAL (SIGNAL_LINK_CHANGED, log_link)
SIGNAL (SIGNAL_IP4_ADDRESS_CHANGED, log_ip4_address)
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
index 13e25affbd..bc7b84c9ff 100644
--- a/src/platform/nm-platform.h
+++ b/src/platform/nm-platform.h
@@ -28,7 +28,6 @@
#include <linux/if_addr.h>
#include <nm-dbus-interface.h>
-#include "gsystem-local-alloc.h"
#include "nm-types.h"
#define NM_TYPE_PLATFORM (nm_platform_get_type ())
@@ -70,51 +69,11 @@ typedef enum {
/* Event came from the kernel. */
NM_PLATFORM_REASON_EXTERNAL,
/* Event is a result of cache checking and cleanups. */
- NM_PLATFORM_REASON_CACHE_CHECK
-} NMPlatformReason;
+ NM_PLATFORM_REASON_CACHE_CHECK,
-typedef enum {
- /* Please don't interpret type numbers outside nm-platform and use functions
- * like nm_platform_link_is_software() and nm_platform_supports_slaves().
- *
- * type & 0x10000 -> Software device type
- * type & 0x20000 -> Type supports slaves
- */
-
- /* No type, used as error value */
- NM_LINK_TYPE_NONE,
-
- /* Unknown type */
- NM_LINK_TYPE_UNKNOWN,
-
- /* Hardware types */
- NM_LINK_TYPE_ETHERNET,
- NM_LINK_TYPE_INFINIBAND,
- NM_LINK_TYPE_OLPC_MESH,
- NM_LINK_TYPE_WIFI,
- NM_LINK_TYPE_WWAN_ETHERNET, /* WWAN pseudo-ethernet */
- NM_LINK_TYPE_WIMAX,
-
- /* Software types */
- NM_LINK_TYPE_DUMMY = 0x10000,
- NM_LINK_TYPE_GRE,
- NM_LINK_TYPE_GRETAP,
- NM_LINK_TYPE_IFB,
- NM_LINK_TYPE_LOOPBACK,
- NM_LINK_TYPE_MACVLAN,
- NM_LINK_TYPE_MACVTAP,
- NM_LINK_TYPE_OPENVSWITCH,
- NM_LINK_TYPE_TAP,
- NM_LINK_TYPE_TUN,
- NM_LINK_TYPE_VETH,
- NM_LINK_TYPE_VLAN,
- NM_LINK_TYPE_VXLAN,
-
- /* Software types with slaves */
- NM_LINK_TYPE_BRIDGE = 0x10000 | 0x20000,
- NM_LINK_TYPE_BOND,
- NM_LINK_TYPE_TEAM,
-} NMLinkType;
+ /* Internal reason to suppress announcing change events */
+ _NM_PLATFORM_REASON_CACHE_CHECK_INTERNAL,
+} NMPlatformReason;
#define __NMPlatformObject_COMMON \
int ifindex; \
@@ -143,6 +102,12 @@ typedef enum {
#define NM_PLATFORM_LIFETIME_PERMANENT G_MAXUINT32
+typedef enum {
+ NM_PLATFORM_GET_ROUTE_MODE_ALL,
+ NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT,
+ NM_PLATFORM_GET_ROUTE_MODE_ONLY_DEFAULT,
+} NMPlatformGetRouteMode;
+
typedef struct {
__NMPlatformObject_COMMON;
} NMPlatformObject;
@@ -213,19 +178,35 @@ struct _NMPlatformIP6Address {
};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Address, address));
+typedef union {
+ NMPlatformIPAddress ax;
+ NMPlatformIP4Address a4;
+ NMPlatformIP6Address a6;
+} NMPlatformIPXAddress;
+
#undef __NMPlatformIPAddress_COMMON
-/* Adding an IPv6 route with metric 0, kernel translates to IP6_RT_PRIO_USER (1024).
- * Thus, the value is not choosen arbitraily, but matches kernel IPv6 default. */
-#define NM_PLATFORM_ROUTE_METRIC_DEFAULT 1024
+/* Default value for adding an IPv4 route. This is also what iproute2 does.
+ * Note that contrary to IPv6, you can add routes with metric 0 and it is even
+ * the default.
+ */
+#define NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP4 0
+
+/* Default value for adding an IPv6 route. This is also what iproute2 does.
+ * Adding an IPv6 route with metric 0, kernel translates to IP6_RT_PRIO_USER (1024). */
+#define NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6 1024
+
+/* For IPv4, kernel adds a device route (subnet routes) with metric 0 when user
+ * configures addresses. */
+#define NM_PLATFORM_ROUTE_METRIC_IP4_DEVICE_ROUTE 0
#define __NMPlatformIPRoute_COMMON \
__NMPlatformObject_COMMON; \
NMIPConfigSource source; \
int plen; \
- guint metric; \
- guint mss; \
+ guint32 metric; \
+ guint32 mss; \
;
typedef struct {
@@ -253,6 +234,12 @@ struct _NMPlatformIP6Route {
};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Route, network));
+typedef union {
+ NMPlatformIPRoute rx;
+ NMPlatformIP4Route r4;
+ NMPlatformIP6Route r6;
+} NMPlatformIPXRoute;
+
#undef __NMPlatformIPRoute_COMMON
@@ -364,6 +351,7 @@ typedef struct {
const char *(*link_get_name) (NMPlatform *, int ifindex);
NMLinkType (*link_get_type) (NMPlatform *, int ifindex);
const char *(*link_get_type_name) (NMPlatform *, int ifindex);
+ gboolean (*link_get_unmanaged) (NMPlatform *, int ifindex, gboolean *managed);
gboolean (*link_refresh) (NMPlatform *, int ifindex);
@@ -375,6 +363,8 @@ typedef struct {
gboolean (*link_is_connected) (NMPlatform *, int ifindex);
gboolean (*link_uses_arp) (NMPlatform *, int ifindex);
+ gboolean (*link_get_ipv6_token) (NMPlatform *, int ifindex, NMUtilsIPv6IfaceId *iid);
+
gboolean (*link_get_user_ipv6ll_enabled) (NMPlatform *, int ifindex);
gboolean (*link_set_user_ipv6ll_enabled) (NMPlatform *, int ifindex, gboolean enabled);
@@ -418,6 +408,7 @@ typedef struct {
guint32 (*wifi_get_rate) (NMPlatform *, int ifindex);
NM80211Mode (*wifi_get_mode) (NMPlatform *, int ifindex);
void (*wifi_set_mode) (NMPlatform *, int ifindex, NM80211Mode mode);
+ void (*wifi_set_powersave) (NMPlatform *, int ifindex, guint32 powersave);
guint32 (*wifi_find_frequency) (NMPlatform *, int ifindex, const guint32 *freqs);
void (*wifi_indicate_addressing_running) (NMPlatform *, int ifindex, gboolean running);
@@ -439,18 +430,20 @@ typedef struct {
gboolean (*ip4_address_exists) (NMPlatform *, int ifindex, in_addr_t address, int plen);
gboolean (*ip6_address_exists) (NMPlatform *, int ifindex, struct in6_addr address, int plen);
- GArray * (*ip4_route_get_all) (NMPlatform *, int ifindex, gboolean include_default);
- GArray * (*ip6_route_get_all) (NMPlatform *, int ifindex, gboolean include_default);
+ gboolean (*ip4_check_reinstall_device_route) (NMPlatform *, int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric);
+
+ GArray * (*ip4_route_get_all) (NMPlatform *, int ifindex, NMPlatformGetRouteMode mode);
+ GArray * (*ip6_route_get_all) (NMPlatform *, int ifindex, NMPlatformGetRouteMode mode);
gboolean (*ip4_route_add) (NMPlatform *, int ifindex, NMIPConfigSource source,
in_addr_t network, int plen, in_addr_t gateway,
- int prio, int mss);
+ guint32 pref_src, guint32 metric, guint32 mss);
gboolean (*ip6_route_add) (NMPlatform *, int ifindex, NMIPConfigSource source,
struct in6_addr network, int plen, struct in6_addr gateway,
- int prio, int mss);
- gboolean (*ip4_route_delete) (NMPlatform *, int ifindex, in_addr_t network, int plen, int metric);
- gboolean (*ip6_route_delete) (NMPlatform *, int ifindex, struct in6_addr network, int plen, int metric);
- gboolean (*ip4_route_exists) (NMPlatform *, int ifindex, in_addr_t network, int plen, int metric);
- gboolean (*ip6_route_exists) (NMPlatform *, int ifindex, struct in6_addr network, int plen, int metric);
+ guint32 metric, guint32 mss);
+ gboolean (*ip4_route_delete) (NMPlatform *, int ifindex, in_addr_t network, int plen, guint32 metric);
+ gboolean (*ip6_route_delete) (NMPlatform *, int ifindex, struct in6_addr network, int plen, guint32 metric);
+ gboolean (*ip4_route_exists) (NMPlatform *, int ifindex, in_addr_t network, int plen, guint32 metric);
+ gboolean (*ip6_route_exists) (NMPlatform *, int ifindex, struct in6_addr network, int plen, guint32 metric);
gboolean (*check_support_kernel_extended_ifa_flags) (NMPlatform *);
gboolean (*check_support_user_ipv6ll) (NMPlatform *);
@@ -506,6 +499,7 @@ int nm_platform_link_get_ifindex (const char *name);
const char *nm_platform_link_get_name (int ifindex);
NMLinkType nm_platform_link_get_type (int ifindex);
const char *nm_platform_link_get_type_name (int ifindex);
+gboolean nm_platform_link_get_unmanaged (int ifindex, gboolean *managed);
gboolean nm_platform_link_is_software (int ifindex);
gboolean nm_platform_link_supports_slaves (int ifindex);
@@ -519,6 +513,8 @@ gboolean nm_platform_link_is_up (int ifindex);
gboolean nm_platform_link_is_connected (int ifindex);
gboolean nm_platform_link_uses_arp (int ifindex);
+gboolean nm_platform_link_get_ipv6_token (int ifindex, NMUtilsIPv6IfaceId *iid);
+
gboolean nm_platform_link_get_user_ipv6ll_enabled (int ifindex);
gboolean nm_platform_link_set_user_ipv6ll_enabled (int ifindex, gboolean enabled);
@@ -562,6 +558,7 @@ int nm_platform_wifi_get_quality (int ifindex);
guint32 nm_platform_wifi_get_rate (int ifindex);
NM80211Mode nm_platform_wifi_get_mode (int ifindex);
void nm_platform_wifi_set_mode (int ifindex, NM80211Mode mode);
+void nm_platform_wifi_set_powersave (int ifindex, guint32 powersave);
guint32 nm_platform_wifi_find_frequency (int ifindex, const guint32 *freqs);
void nm_platform_wifi_indicate_addressing_running (int ifindex, gboolean running);
@@ -582,26 +579,24 @@ gboolean nm_platform_ip4_address_delete (int ifindex, in_addr_t address, int ple
gboolean nm_platform_ip6_address_delete (int ifindex, struct in6_addr address, int plen);
gboolean nm_platform_ip4_address_exists (int ifindex, in_addr_t address, int plen);
gboolean nm_platform_ip6_address_exists (int ifindex, struct in6_addr address, int plen);
-gboolean nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses);
-gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses);
+gboolean nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint32 device_route_metric);
+gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local);
gboolean nm_platform_address_flush (int ifindex);
-GArray *nm_platform_ip4_route_get_all (int ifindex, gboolean include_default);
-GArray *nm_platform_ip6_route_get_all (int ifindex, gboolean include_default);
-gboolean nm_platform_route_set_metric (int ifindex, int metric);
+gboolean nm_platform_ip4_check_reinstall_device_route (int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric);
+
+GArray *nm_platform_ip4_route_get_all (int ifindex, NMPlatformGetRouteMode mode);
+GArray *nm_platform_ip6_route_get_all (int ifindex, NMPlatformGetRouteMode mode);
gboolean nm_platform_ip4_route_add (int ifindex, NMIPConfigSource source,
in_addr_t network, int plen, in_addr_t gateway,
- int metric, int mss);
+ guint32 pref_src, guint32 metric, guint32 mss);
gboolean nm_platform_ip6_route_add (int ifindex, NMIPConfigSource source,
struct in6_addr network, int plen, struct in6_addr gateway,
- int metric, int mss);
-gboolean nm_platform_ip4_route_delete (int ifindex, in_addr_t network, int plen, int metric);
-gboolean nm_platform_ip6_route_delete (int ifindex, struct in6_addr network, int plen, int metric);
-gboolean nm_platform_ip4_route_exists (int ifindex, in_addr_t network, int plen, int metric);
-gboolean nm_platform_ip6_route_exists (int ifindex, struct in6_addr network, int plen, int metric);
-gboolean nm_platform_ip4_route_sync (int ifindex, const GArray *known_routes);
-gboolean nm_platform_ip6_route_sync (int ifindex, const GArray *known_routes);
-gboolean nm_platform_route_flush (int ifindex);
+ guint32 metric, guint32 mss);
+gboolean nm_platform_ip4_route_delete (int ifindex, in_addr_t network, int plen, guint32 metric);
+gboolean nm_platform_ip6_route_delete (int ifindex, struct in6_addr network, int plen, guint32 metric);
+gboolean nm_platform_ip4_route_exists (int ifindex, in_addr_t network, int plen, guint32 metric);
+gboolean nm_platform_ip6_route_exists (int ifindex, struct in6_addr network, int plen, guint32 metric);
const char *nm_platform_link_to_string (const NMPlatformLink *link);
const char *nm_platform_ip4_address_to_string (const NMPlatformIP4Address *address);
diff --git a/src/platform/tests/Makefile.am b/src/platform/tests/Makefile.am
index b06e25e0ca..c10600eb51 100644
--- a/src/platform/tests/Makefile.am
+++ b/src/platform/tests/Makefile.am
@@ -109,7 +109,7 @@ test_cleanup_linux_CPPFLAGS = \
-DKERNEL_HACKS=1
test_cleanup_linux_LDADD = $(PLATFORM_LDADD)
-#@VALGRIND_RULES@
+@VALGRIND_RULES@
TESTS = test-link-fake test-address-fake test-route-fake test-cleanup-fake test-address-linux test-route-linux test-cleanup-linux
diff --git a/src/platform/tests/dump.c b/src/platform/tests/dump.c
index e97ef138cb..3bb61da415 100644
--- a/src/platform/tests/dump.c
+++ b/src/platform/tests/dump.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
@@ -83,8 +85,8 @@ dump_interface (NMPlatformLink *link)
g_array_unref (ip4_addresses);
g_array_unref (ip6_addresses);
- ip4_routes = nm_platform_ip4_route_get_all (link->ifindex, TRUE);
- ip6_routes = nm_platform_ip6_route_get_all (link->ifindex, TRUE);
+ ip4_routes = nm_platform_ip4_route_get_all (link->ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
+ ip6_routes = nm_platform_ip6_route_get_all (link->ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
g_assert (ip4_routes);
g_assert (ip6_routes);
diff --git a/src/platform/tests/monitor.c b/src/platform/tests/monitor.c
index d56cc2bf82..9aff104763 100644
--- a/src/platform/tests/monitor.c
+++ b/src/platform/tests/monitor.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include <stdlib.h>
#include <syslog.h>
diff --git a/src/platform/tests/platform.c b/src/platform/tests/platform.c
index 469652c55f..eea6610d37 100644
--- a/src/platform/tests/platform.c
+++ b/src/platform/tests/platform.c
@@ -18,12 +18,15 @@
* Copyright (C) 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <netlink/route/addr.h>
+#include "gsystem-local-alloc.h"
#include "nm-platform.h"
#include "nm-linux-platform.h"
#include "nm-fake-platform.h"
@@ -630,7 +633,7 @@ do_ip4_route_get_all (char **argv)
int i;
if (ifindex) {
- routes = nm_platform_ip4_route_get_all (ifindex, TRUE);
+ routes = nm_platform_ip4_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
for (i = 0; i < routes->len; i++) {
route = &g_array_index (routes, NMPlatformIP4Route, i);
inet_ntop (AF_INET, &route->network, networkstr, sizeof (networkstr));
@@ -654,7 +657,7 @@ do_ip6_route_get_all (char **argv)
int i;
if (ifindex) {
- routes = nm_platform_ip6_route_get_all (ifindex, TRUE);
+ routes = nm_platform_ip6_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
for (i = 0; i < routes->len; i++) {
route = &g_array_index (routes, NMPlatformIP6Route, i);
inet_ntop (AF_INET6, &route->network, networkstr, sizeof (networkstr));
@@ -681,7 +684,7 @@ do_ip4_route_add (char **argv)
mss = strtol (*argv++, NULL, 10);
return nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER,
- network, plen, gateway,
+ network, plen, gateway, 0,
metric, mss);
}
diff --git a/src/platform/tests/test-address.c b/src/platform/tests/test-address.c
index 8d297e501c..902b33ee59 100644
--- a/src/platform/tests/test-address.c
+++ b/src/platform/tests/test-address.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include "test-common.h"
#define DEVICE_NAME "nm-test-device"
@@ -252,7 +254,7 @@ setup_tests (void)
nm_platform_link_delete (nm_platform_link_get_ifindex (DEVICE_NAME));
g_assert (!nm_platform_link_exists (DEVICE_NAME));
g_assert (nm_platform_dummy_add (DEVICE_NAME));
- accept_signal (link_added);
+ wait_signal (link_added);
free_signal (link_added);
g_test_add_func ("/address/internal/ip4", test_ip4_address);
diff --git a/src/platform/tests/test-cleanup.c b/src/platform/tests/test-cleanup.c
index 646fb8a8db..5d789d1bdf 100644
--- a/src/platform/tests/test-cleanup.c
+++ b/src/platform/tests/test-cleanup.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include "test-common.h"
#define DEVICE_NAME "nm-test-device"
@@ -34,7 +36,7 @@ test_cleanup_internal (void)
/* Create and set up device */
g_assert (nm_platform_dummy_add (DEVICE_NAME));
- accept_signal (link_added);
+ wait_signal (link_added);
free_signal (link_added);
g_assert (nm_platform_link_set_up (nm_platform_link_get_ifindex (DEVICE_NAME)));
ifindex = nm_platform_link_get_ifindex (DEVICE_NAME);
@@ -43,17 +45,17 @@ test_cleanup_internal (void)
/* Add routes and addresses */
g_assert (nm_platform_ip4_address_add (ifindex, addr4, 0, plen4, lifetime, preferred, NULL));
g_assert (nm_platform_ip6_address_add (ifindex, addr6, in6addr_any, plen6, lifetime, preferred, flags));
- g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, gateway4, 32, INADDR_ANY, metric, mss));
- g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network4, plen4, gateway4, metric, mss));
- g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, 0, 0, gateway4, metric, mss));
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, gateway4, 32, INADDR_ANY, 0, metric, mss));
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network4, plen4, gateway4, 0, metric, mss));
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, 0, 0, gateway4, 0, metric, mss));
g_assert (nm_platform_ip6_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, gateway6, 128, in6addr_any, metric, mss));
g_assert (nm_platform_ip6_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network6, plen6, gateway6, metric, mss));
g_assert (nm_platform_ip6_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, in6addr_any, 0, gateway6, metric, mss));
addresses4 = nm_platform_ip4_address_get_all (ifindex);
addresses6 = nm_platform_ip6_address_get_all (ifindex);
- routes4 = nm_platform_ip4_route_get_all (ifindex, TRUE);
- routes6 = nm_platform_ip6_route_get_all (ifindex, TRUE);
+ routes4 = nm_platform_ip4_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
+ routes6 = nm_platform_ip6_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
g_assert_cmpint (addresses4->len, ==, 1);
g_assert_cmpint (addresses6->len, ==, 1);
@@ -70,8 +72,8 @@ test_cleanup_internal (void)
addresses4 = nm_platform_ip4_address_get_all (ifindex);
addresses6 = nm_platform_ip6_address_get_all (ifindex);
- routes4 = nm_platform_ip4_route_get_all (ifindex, TRUE);
- routes6 = nm_platform_ip6_route_get_all (ifindex, TRUE);
+ routes4 = nm_platform_ip4_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
+ routes6 = nm_platform_ip6_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
g_assert_cmpint (addresses4->len, ==, 0);
g_assert_cmpint (addresses6->len, ==, 0);
diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c
index 59a770c63f..d8e8775f82 100644
--- a/src/platform/tests/test-common.c
+++ b/src/platform/tests/test-common.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include "test-common.h"
#include "nm-test-utils.h"
@@ -123,6 +125,113 @@ link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received, NMPl
g_error ("Added/changed link not found in the local cache.");
}
+gboolean
+ip4_route_exists (const char *ifname, guint32 network, int plen, guint32 metric)
+{
+ gs_free char *arg_network = NULL;
+ const char *argv[] = {
+ NULL,
+ "route",
+ "list",
+ "dev",
+ ifname,
+ "exact",
+ NULL,
+ NULL,
+ };
+ int exit_status;
+ gs_free char *std_out = NULL, *std_err = NULL;
+ char *out;
+ gboolean success;
+ gs_free_error GError *error = NULL;
+ gs_free char *metric_pattern = NULL;
+
+ g_assert (ifname && nm_utils_iface_valid_name (ifname));
+ g_assert (!strstr (ifname, " metric "));
+ g_assert (plen >= 0 && plen <= 32);
+
+ if (!NM_IS_LINUX_PLATFORM (nm_platform_get ())) {
+ /* If we don't test against linux-platform, we don't actually configure any
+ * routes in the system. */
+ return -1;
+ }
+
+ argv[0] = nm_utils_file_search_in_paths ("ip", NULL,
+ (const char *[]) { "/sbin", "/usr/sbin", NULL },
+ G_FILE_TEST_IS_EXECUTABLE, NULL, NULL, NULL);
+ argv[6] = arg_network = g_strdup_printf ("%s/%d", nm_utils_inet4_ntop (network, NULL), plen);
+
+ if (!argv[0]) {
+ /* Hm. There is no 'ip' binary. Return *unknown* */
+ return -1;
+ }
+
+ success = g_spawn_sync (NULL,
+ (char **) argv,
+ (char *[]) { NULL },
+ 0,
+ NULL,
+ NULL,
+ &std_out,
+ &std_err,
+ &exit_status,
+ &error);
+ g_assert_no_error (error);
+ g_assert (success);
+ g_assert_cmpstr (std_err, ==, "");
+ g_assert (std_out);
+
+ metric_pattern = g_strdup_printf (" metric %u", metric);
+ out = std_out;
+ while (out) {
+ char *eol = strchr (out, '\n');
+ gs_free char *line = eol ? g_strndup (out, eol - out) : g_strdup (out);
+ const char *p;
+
+ out = eol ? &eol[1] : NULL;
+ if (!line[0])
+ continue;
+
+ if (metric == 0) {
+ if (!strstr (line, " metric "))
+ return TRUE;
+ }
+ p = strstr (line, metric_pattern);
+ if (p && NM_IN_SET (p[strlen (metric_pattern)], ' ', '\0'))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void
+_assert_ip4_route_exists (const char *file, guint line, const char *func, gboolean exists, const char *ifname, guint32 network, int plen, guint32 metric)
+{
+ int ifindex;
+ gboolean exists_checked;
+
+ /* Check for existance of the route by spawning iproute2. Do this because platform
+ * code might be entirely borked, but we expect ip-route to give a correct result.
+ * If the ip command cannot be found, we accept this as success. */
+ exists_checked = ip4_route_exists (ifname, network, plen, metric);
+ if (exists_checked != -1 && !exists_checked != !exists) {
+ g_error ("[%s:%u] %s(): We expect the ip4 route %s/%d metric %u %s, but it %s",
+ file, line, func,
+ nm_utils_inet4_ntop (network, NULL), plen, metric,
+ exists ? "to exist" : "not to exist",
+ exists ? "doesn't" : "does");
+ }
+
+ ifindex = nm_platform_link_get_ifindex (ifname);
+ g_assert (ifindex > 0);
+ if (!nm_platform_ip4_route_exists (ifindex, network, plen, metric) != !exists) {
+ g_error ("[%s:%u] %s(): The ip4 route %s/%d metric %u %s, but platform thinks %s",
+ file, line, func,
+ nm_utils_inet4_ntop (network, NULL), plen, metric,
+ exists ? "exists" : "does not exist",
+ exists ? "it doesn't" : "it does");
+ }
+}
+
void
run_command (const char *format, ...)
{
@@ -148,6 +257,7 @@ main (int argc, char **argv)
nmtst_init_with_logging (&argc, &argv, NULL, "ALL");
+ NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare")
if (SETUP == nm_linux_platform_setup && getuid() != 0) {
/* Try to exec as sudo, this function does not return, if a sudo-cmd is set. */
nmtst_reexec_sudo ();
@@ -160,6 +270,7 @@ main (int argc, char **argv)
return 77;
#endif
}
+ NM_PRAGMA_WARNING_REENABLE
SETUP ();
diff --git a/src/platform/tests/test-common.h b/src/platform/tests/test-common.h
index 8f6b391266..17c4029d8c 100644
--- a/src/platform/tests/test-common.h
+++ b/src/platform/tests/test-common.h
@@ -34,6 +34,11 @@ void accept_signal (SignalData *data);
void wait_signal (SignalData *data);
void free_signal (SignalData *data);
+gboolean ip4_route_exists (const char *ifname, guint32 network, int plen, guint32 metric);
+
+void _assert_ip4_route_exists (const char *file, guint line, const char *func, gboolean exists, const char *ifname, guint32 network, int plen, guint32 metric);
+#define assert_ip4_route_exists(exists, ifname, network, plen, metric) _assert_ip4_route_exists (__FILE__, __LINE__, G_STRFUNC, exists, ifname, network, plen, metric)
+
void link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received, NMPlatformSignalChangeType change_type, NMPlatformReason reason, SignalData *data);
void run_command (const char *format, ...);
diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c
index 66ee51a819..0643b052cd 100644
--- a/src/platform/tests/test-link.c
+++ b/src/platform/tests/test-link.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include "test-common.h"
#include "nm-test-utils.h"
@@ -113,7 +115,7 @@ software_add (NMLinkType link_type, const char *name)
/* Don't call link_callback for the bridge interface */
parent_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, PARENT_NAME);
if (nm_platform_bridge_add (PARENT_NAME, NULL, 0))
- accept_signal (parent_added);
+ wait_signal (parent_added);
free_signal (parent_added);
{
@@ -146,7 +148,7 @@ test_slave (int master, int type, SignalData *master_changed)
g_assert (ifindex > 0);
link_changed = add_signal_ifindex (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_CHANGED, link_callback, ifindex);
link_removed = add_signal_ifindex (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_REMOVED, link_callback, ifindex);
- accept_signal (link_added);
+ wait_signal (link_added);
/* Set the slave up to see whether master's IFF_LOWER_UP is set correctly.
*
@@ -261,7 +263,7 @@ test_software (NMLinkType link_type, const char *link_typename)
link_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, DEVICE_NAME);
g_assert (software_add (link_type, DEVICE_NAME));
no_error ();
- accept_signal (link_added);
+ wait_signal (link_added);
g_assert (nm_platform_link_exists (DEVICE_NAME));
ifindex = nm_platform_link_get_ifindex (DEVICE_NAME);
g_assert (ifindex >= 0);
@@ -363,12 +365,14 @@ test_bridge (void)
static void
test_bond (void)
{
+ NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare")
if (SETUP == nm_linux_platform_setup &&
!g_file_test ("/proc/1/net/bonding", G_FILE_TEST_IS_DIR) &&
system("modprobe --show bonding") != 0) {
g_test_skip ("Skipping test for bonding: bonding module not available");
return;
}
+ NM_PRAGMA_WARNING_REENABLE
test_software (NM_LINK_TYPE_BOND, "bond");
}
@@ -403,7 +407,7 @@ test_internal (void)
/* Add device */
g_assert (nm_platform_dummy_add (DEVICE_NAME));
no_error ();
- accept_signal (link_added);
+ wait_signal (link_added);
/* Try to add again */
g_assert (!nm_platform_dummy_add (DEVICE_NAME));
diff --git a/src/platform/tests/test-route.c b/src/platform/tests/test-route.c
index 44598f4c78..b6e99ab9fb 100644
--- a/src/platform/tests/test-route.c
+++ b/src/platform/tests/test-route.c
@@ -1,5 +1,8 @@
+#include "config.h"
+
#include "test-common.h"
#include "nm-test-utils.h"
+#include "NetworkManagerUtils.h"
#define DEVICE_NAME "nm-test-device"
@@ -48,6 +51,75 @@ ip6_route_callback (NMPlatform *platform, int ifindex, NMPlatformIP6Route *recei
}
static void
+test_ip4_route_metric0 (void)
+{
+ int ifindex = nm_platform_link_get_ifindex (DEVICE_NAME);
+ SignalData *route_added = add_signal (NM_PLATFORM_SIGNAL_IP4_ROUTE_CHANGED, NM_PLATFORM_SIGNAL_ADDED, ip4_route_callback);
+ SignalData *route_changed = add_signal (NM_PLATFORM_SIGNAL_IP4_ROUTE_CHANGED, NM_PLATFORM_SIGNAL_CHANGED, ip4_route_callback);
+ SignalData *route_removed = add_signal (NM_PLATFORM_SIGNAL_IP4_ROUTE_CHANGED, NM_PLATFORM_SIGNAL_REMOVED, ip4_route_callback);
+ in_addr_t network = nmtst_inet4_from_string ("192.0.2.5"); /* from 192.0.2.0/24 (TEST-NET-1) (rfc5737) */
+ int plen = 32;
+ int metric = 22987;
+ int mss = 1000;
+
+ /* No routes initially */
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0);
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, metric);
+
+ /* add the first route */
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, INADDR_ANY, 0, metric, mss));
+ no_error ();
+ accept_signal (route_added);
+
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0);
+ assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric);
+
+ /* Deleting route with metric 0 does nothing */
+ g_assert (nm_platform_ip4_route_delete (ifindex, network, plen, 0));
+ no_error ();
+ g_assert (!route_removed->received);
+
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0);
+ assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric);
+
+ /* add the second route */
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, INADDR_ANY, 0, 0, mss));
+ no_error ();
+ accept_signal (route_added);
+
+ assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, 0);
+ assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric);
+
+ /* Delete route with metric 0 */
+ g_assert (nm_platform_ip4_route_delete (ifindex, network, plen, 0));
+ no_error ();
+ accept_signal (route_removed);
+
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0);
+ assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric);
+
+ /* Delete route with metric 0 again (we expect nothing to happen) */
+ g_assert (nm_platform_ip4_route_delete (ifindex, network, plen, 0));
+ no_error ();
+ g_assert (!route_removed->received);
+
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0);
+ assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric);
+
+ /* Delete the other route */
+ g_assert (nm_platform_ip4_route_delete (ifindex, network, plen, metric));
+ no_error ();
+ accept_signal (route_removed);
+
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0);
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, metric);
+
+ free_signal (route_added);
+ free_signal (route_changed);
+ free_signal (route_removed);
+}
+
+static void
test_ip4_route (void)
{
int ifindex = nm_platform_link_get_ifindex (DEVICE_NAME);
@@ -59,47 +131,48 @@ test_ip4_route (void)
in_addr_t network;
int plen = 24;
in_addr_t gateway;
- int metric = 20;
+ /* Choose a high metric so that we hopefully don't conflict. */
+ int metric = 22986;
int mss = 1000;
inet_pton (AF_INET, "192.0.3.0", &network);
inet_pton (AF_INET, "198.51.100.1", &gateway);
/* Add route to gateway */
- g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, gateway, 32, INADDR_ANY, metric, mss));
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, gateway, 32, INADDR_ANY, 0, metric, mss));
no_error ();
accept_signal (route_added);
/* Add route */
- g_assert (!nm_platform_ip4_route_exists (ifindex, network, plen, metric));
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, metric);
no_error ();
- g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, gateway, metric, mss));
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, gateway, 0, metric, mss));
no_error ();
- g_assert (nm_platform_ip4_route_exists (ifindex, network, plen, metric));
+ assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric);
no_error ();
accept_signal (route_added);
/* Add route again */
- g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, gateway, metric, mss));
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, gateway, 0, metric, mss));
no_error ();
accept_signal (route_changed);
/* Add default route */
- g_assert (!nm_platform_ip4_route_exists (ifindex, 0, 0, metric));
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, 0, 0, metric);
no_error ();
- g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, 0, 0, gateway, metric, mss));
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, 0, 0, gateway, 0, metric, mss));
no_error ();
- g_assert (nm_platform_ip4_route_exists (ifindex, 0, 0, metric));
+ assert_ip4_route_exists (TRUE, DEVICE_NAME, 0, 0, metric);
no_error ();
accept_signal (route_added);
/* Add default route again */
- g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, 0, 0, gateway, metric, mss));
+ g_assert (nm_platform_ip4_route_add (ifindex, NM_IP_CONFIG_SOURCE_USER, 0, 0, gateway, 0, metric, mss));
no_error ();
accept_signal (route_changed);
/* Test route listing */
- routes = nm_platform_ip4_route_get_all (ifindex, TRUE);
+ routes = nm_platform_ip4_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
memset (rts, 0, sizeof (rts));
rts[0].source = NM_IP_CONFIG_SOURCE_USER;
rts[0].network = gateway;
@@ -130,7 +203,7 @@ test_ip4_route (void)
/* Remove route */
g_assert (nm_platform_ip4_route_delete (ifindex, network, plen, metric));
no_error ();
- g_assert (!nm_platform_ip4_route_exists (ifindex, network, plen, metric));
+ assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, metric);
accept_signal (route_removed);
/* Remove route again */
@@ -154,7 +227,8 @@ test_ip6_route (void)
struct in6_addr network;
int plen = 64;
struct in6_addr gateway;
- int metric = 20;
+ /* Choose a high metric so that we hopefully don't conflict. */
+ int metric = 22987;
int mss = 1000;
inet_pton (AF_INET6, "2001:db8:a:b:0:0:0:0", &network);
@@ -194,28 +268,28 @@ test_ip6_route (void)
accept_signal (route_changed);
/* Test route listing */
- routes = nm_platform_ip6_route_get_all (ifindex, TRUE);
+ routes = nm_platform_ip6_route_get_all (ifindex, NM_PLATFORM_GET_ROUTE_MODE_ALL);
memset (rts, 0, sizeof (rts));
rts[0].source = NM_IP_CONFIG_SOURCE_USER;
rts[0].network = gateway;
rts[0].plen = 128;
rts[0].ifindex = ifindex;
rts[0].gateway = in6addr_any;
- rts[0].metric = metric;
+ rts[0].metric = nm_utils_ip6_route_metric_normalize (metric);
rts[0].mss = mss;
rts[1].source = NM_IP_CONFIG_SOURCE_USER;
rts[1].network = network;
rts[1].plen = plen;
rts[1].ifindex = ifindex;
rts[1].gateway = gateway;
- rts[1].metric = metric;
+ rts[1].metric = nm_utils_ip6_route_metric_normalize (metric);
rts[1].mss = mss;
rts[2].source = NM_IP_CONFIG_SOURCE_USER;
rts[2].network = in6addr_any;
rts[2].plen = 0;
rts[2].ifindex = ifindex;
rts[2].gateway = gateway;
- rts[2].metric = metric;
+ rts[2].metric = nm_utils_ip6_route_metric_normalize (metric);
rts[2].mss = mss;
g_assert_cmpint (routes->len, ==, 3);
g_assert (!memcmp (routes->data, rts, sizeof (rts)));
@@ -245,11 +319,12 @@ setup_tests (void)
nm_platform_link_delete (nm_platform_link_get_ifindex (DEVICE_NAME));
g_assert (!nm_platform_link_exists (DEVICE_NAME));
g_assert (nm_platform_dummy_add (DEVICE_NAME));
- accept_signal (link_added);
+ wait_signal (link_added);
free_signal (link_added);
g_assert (nm_platform_link_set_up (nm_platform_link_get_ifindex (DEVICE_NAME)));
g_test_add_func ("/route/ip4", test_ip4_route);
g_test_add_func ("/route/ip6", test_ip6_route);
+ g_test_add_func ("/route/ip4_metric0", test_ip4_route_metric0);
}
diff --git a/src/platform/wifi/wifi-utils-nl80211.c b/src/platform/wifi/wifi-utils-nl80211.c
index 722f4e9c54..fd69d17a71 100644
--- a/src/platform/wifi/wifi-utils-nl80211.c
+++ b/src/platform/wifi/wifi-utils-nl80211.c
@@ -20,7 +20,8 @@
* Copyright (C) 2011 Intel Corporation. All rights reserved.
*/
-#include <config.h>
+#include "config.h"
+
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
@@ -264,6 +265,24 @@ wifi_nl80211_set_mode (WifiData *data, const NM80211Mode mode)
return FALSE;
}
+static gboolean
+wifi_nl80211_set_powersave (WifiData *data, guint32 powersave)
+{
+ WifiDataNl80211 *nl80211 = (WifiDataNl80211 *) data;
+ struct nl_msg *msg;
+ int err;
+
+ msg = nl80211_alloc_msg (nl80211, NL80211_CMD_SET_POWER_SAVE, 0);
+ NLA_PUT_U32 (msg, NL80211_ATTR_PS_STATE,
+ powersave == 1 ? NL80211_PS_ENABLED : NL80211_PS_DISABLED);
+ err = nl80211_send_and_recv (nl80211, msg, NULL, NULL);
+ return err ? FALSE : TRUE;
+
+nla_put_failure:
+ nlmsg_free (msg);
+ return FALSE;
+}
+
/* @divisor: pass what value @xbm should be divided by to get dBm */
static guint32
nl80211_xbm_to_percent (gint32 xbm, guint32 divisor)
@@ -841,6 +860,7 @@ wifi_nl80211_init (const char *iface, int ifindex)
nl80211 = wifi_data_new (iface, ifindex, sizeof (*nl80211));
nl80211->parent.get_mode = wifi_nl80211_get_mode;
nl80211->parent.set_mode = wifi_nl80211_set_mode;
+ nl80211->parent.set_powersave = wifi_nl80211_set_powersave;
nl80211->parent.get_freq = wifi_nl80211_get_freq;
nl80211->parent.find_freq = wifi_nl80211_find_freq;
nl80211->parent.get_ssid = wifi_nl80211_get_ssid;
@@ -933,48 +953,3 @@ error:
return NULL;
}
-gboolean
-wifi_nl80211_is_wifi (const char *iface)
-{
- struct nl_sock *nl_sock;
- struct nl_cb *nl_cb = NULL;
- struct nl_msg *msg = NULL;
- int id, ifindex;
- struct nl80211_iface_info iface_info = {
- .mode = NM_802_11_MODE_UNKNOWN,
- };
- gboolean is_wifi = FALSE;
-
- nl_sock = nl_socket_alloc ();
- if (nl_sock == NULL)
- return FALSE;
-
- if (genl_connect (nl_sock))
- goto error;
-
- ifindex = nm_platform_link_get_ifindex (iface);
- if (ifindex < 0)
- goto error;
-
- id = genl_ctrl_resolve (nl_sock, "nl80211");
- if (id < 0)
- goto error;
-
- nl_cb = nl_cb_alloc (NL_CB_DEFAULT);
- if (nl_cb) {
- msg = _nl80211_alloc_msg (id, ifindex, -1, NL80211_CMD_GET_INTERFACE, 0);
- if (_nl80211_send_and_recv (nl_sock,
- nl_cb,
- msg,
- nl80211_iface_info_handler,
- &iface_info) >= 0)
- is_wifi = (iface_info.mode != NM_802_11_MODE_UNKNOWN);
- }
-
- error:
- if (nl_cb)
- nl_cb_put (nl_cb);
- nl_socket_free (nl_sock);
- return is_wifi;
-}
-
diff --git a/src/platform/wifi/wifi-utils-nl80211.h b/src/platform/wifi/wifi-utils-nl80211.h
index f34e960de3..b3e8c8976d 100644
--- a/src/platform/wifi/wifi-utils-nl80211.h
+++ b/src/platform/wifi/wifi-utils-nl80211.h
@@ -25,6 +25,4 @@
WifiData *wifi_nl80211_init (const char *iface, int ifindex);
-gboolean wifi_nl80211_is_wifi (const char *iface);
-
#endif /* __WIFI_UTILS_NL80211_H__ */
diff --git a/src/platform/wifi/wifi-utils-private.h b/src/platform/wifi/wifi-utils-private.h
index aaedd5b7a7..9d9af69248 100644
--- a/src/platform/wifi/wifi-utils-private.h
+++ b/src/platform/wifi/wifi-utils-private.h
@@ -35,6 +35,9 @@ struct WifiData {
gboolean (*set_mode) (WifiData *data, const NM80211Mode mode);
+ /* Set power saving mode on an interface */
+ gboolean (*set_powersave) (WifiData *data, guint32 powersave);
+
/* Return current frequency in MHz (really associated BSS frequency) */
guint32 (*get_freq) (WifiData *data);
diff --git a/src/platform/wifi/wifi-utils-wext.c b/src/platform/wifi/wifi-utils-wext.c
index 73dc7f0118..8be36770ef 100644
--- a/src/platform/wifi/wifi-utils-wext.c
+++ b/src/platform/wifi/wifi-utils-wext.c
@@ -19,7 +19,8 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
@@ -164,6 +165,30 @@ wifi_wext_set_mode (WifiData *data, const NM80211Mode mode)
return TRUE;
}
+static gboolean
+wifi_wext_set_powersave (WifiData *data, guint32 powersave)
+{
+ WifiDataWext *wext = (WifiDataWext *) data;
+ struct iwreq wrq;
+
+ memset (&wrq, 0, sizeof (struct iwreq));
+ if (powersave == 1) {
+ wrq.u.power.flags = IW_POWER_ALL_R;
+ } else
+ wrq.u.power.disabled = 1;
+
+ strncpy (wrq.ifr_name, wext->parent.iface, IFNAMSIZ);
+ if (ioctl (wext->fd, SIOCSIWPOWER, &wrq) < 0) {
+ if (errno != ENODEV) {
+ nm_log_err (LOGD_HW | LOGD_WIFI, "(%s): error setting powersave %" G_GUINT32_FORMAT,
+ wext->parent.iface, powersave);
+ }
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
static guint32
wifi_wext_get_freq (WifiData *data)
{
@@ -572,6 +597,7 @@ wifi_wext_init (const char *iface, int ifindex, gboolean check_scan)
wext = wifi_data_new (iface, ifindex, sizeof (*wext));
wext->parent.get_mode = wifi_wext_get_mode;
wext->parent.set_mode = wifi_wext_set_mode;
+ wext->parent.set_powersave = wifi_wext_set_powersave;
wext->parent.get_freq = wifi_wext_get_freq;
wext->parent.find_freq = wifi_wext_find_freq;
wext->parent.get_ssid = wifi_wext_get_ssid;
diff --git a/src/platform/wifi/wifi-utils.c b/src/platform/wifi/wifi-utils.c
index 679b17a041..a67a7b05c9 100644
--- a/src/platform/wifi/wifi-utils.c
+++ b/src/platform/wifi/wifi-utils.c
@@ -19,7 +19,8 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
@@ -97,6 +98,14 @@ wifi_utils_set_mode (WifiData *data, const NM80211Mode mode)
return data->set_mode ? data->set_mode (data, mode) : TRUE;
}
+gboolean
+wifi_utils_set_powersave (WifiData *data, guint32 powersave)
+{
+ g_return_val_if_fail (data != NULL, FALSE);
+
+ return data->set_powersave ? data->set_powersave (data, powersave) : TRUE;
+}
+
guint32
wifi_utils_get_freq (WifiData *data)
{
@@ -161,13 +170,20 @@ wifi_utils_deinit (WifiData *data)
}
gboolean
-wifi_utils_is_wifi (const char *iface, const char *sysfs_path)
+wifi_utils_is_wifi (const char *iface, const char *sysfs_path, const char *devtype)
{
char phy80211_path[255];
struct stat s;
g_return_val_if_fail (iface != NULL, FALSE);
+ if (g_strcmp0 (devtype, "wlan") == 0) {
+ /* All Wi-Fi drivers should set DEVTYPE=wlan. Since the kernel's
+ * cfg80211/nl80211 stack does, this check should match any nl80211
+ * capable driver (including mac82011-based ones). */
+ return TRUE;
+ }
+
if (sysfs_path) {
/* Check for nl80211 sysfs paths */
g_snprintf (phy80211_path, sizeof (phy80211_path), "%s/phy80211", sysfs_path);
@@ -175,9 +191,6 @@ wifi_utils_is_wifi (const char *iface, const char *sysfs_path)
return TRUE;
}
- if (wifi_nl80211_is_wifi (iface))
- return TRUE;
-
#if HAVE_WEXT
if (wifi_wext_is_wifi (iface))
return TRUE;
diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
index 984dee775e..ea58f89043 100644
--- a/src/platform/wifi/wifi-utils.h
+++ b/src/platform/wifi/wifi-utils.h
@@ -29,7 +29,7 @@
typedef struct WifiData WifiData;
-gboolean wifi_utils_is_wifi (const char *iface, const char *sysfs_path);
+gboolean wifi_utils_is_wifi (const char *iface, const char *sysfs_path, const char *devtype);
WifiData *wifi_utils_init (const char *iface, int ifindex, gboolean check_scan);
@@ -65,6 +65,8 @@ gboolean wifi_utils_indicate_addressing_running (WifiData *data, gboolean runnin
/* Returns true if WoWLAN is enabled on device */
gboolean wifi_utils_get_wowlan (WifiData *data);
+gboolean wifi_utils_set_powersave (WifiData *data, guint32 powersave);
+
/* OLPC Mesh-only functions */
guint32 wifi_utils_get_mesh_channel (WifiData *data);
diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c
index 2118589ffe..4a186dc815 100644
--- a/src/ppp-manager/nm-ppp-manager.c
+++ b/src/ppp-manager/nm-ppp-manager.c
@@ -19,7 +19,8 @@
* Copyright (C) 2008 - 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
@@ -45,7 +46,6 @@
#include "nm-ppp-manager.h"
#include "nm-dbus-manager.h"
#include "nm-logging.h"
-#include "nm-posix-signals.h"
#include "nm-platform.h"
#include "nm-core-internal.h"
@@ -67,6 +67,7 @@ static gboolean impl_ppp_manager_set_ip6_config (NMPPPManager *manager,
#include "nm-ppp-manager-glue.h"
static void _ppp_cleanup (NMPPPManager *manager);
+static void _ppp_kill (NMPPPManager *manager);
#define NM_PPPD_PLUGIN PPPD_PLUGIN_DIR "/nm-pppd-plugin.so"
#define PPP_MANAGER_SECRET_TRIES "ppp-manager-secret-tries"
@@ -138,6 +139,7 @@ dispose (GObject *object)
NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object);
_ppp_cleanup (NM_PPP_MANAGER (object));
+ _ppp_kill (NM_PPP_MANAGER (object));
g_clear_object (&priv->act_req);
@@ -544,7 +546,8 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager,
remove_timeout_handler (manager);
- config = nm_ip4_config_new ();
+ config = nm_ip4_config_new (nm_platform_link_get_ifindex (priv->ip_iface));
+
memset (&address, 0, sizeof (address));
address.plen = 32;
@@ -648,7 +651,7 @@ impl_ppp_manager_set_ip6_config (NMPPPManager *manager,
remove_timeout_handler (manager);
- config = nm_ip6_config_new ();
+ config = nm_ip6_config_new (nm_platform_link_get_ifindex (priv->ip_iface));
memset (&addr, 0, sizeof (addr));
addr.plen = 64;
@@ -835,6 +838,7 @@ pppd_timed_out (gpointer data)
nm_log_warn (LOGD_PPP, "pppd timed out or didn't initialize our dbus module");
_ppp_cleanup (manager);
+ _ppp_kill (manager);
g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD);
@@ -1026,20 +1030,6 @@ create_pppd_cmd_line (NMPPPManager *self,
}
static void
-pppd_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for pppd here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
-static void
pppoe_fill_defaults (NMSettingPpp *setting)
{
if (!nm_setting_ppp_get_mtu (setting))
@@ -1082,7 +1072,6 @@ nm_ppp_manager_start (NMPPPManager *manager,
NMCmdLine *ppp_cmd;
char *cmd_str;
struct stat st;
- int ignored;
g_return_val_if_fail (NM_IS_PPP_MANAGER (manager), FALSE);
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
@@ -1102,7 +1091,7 @@ nm_ppp_manager_start (NMPPPManager *manager,
/* Make sure /dev/ppp exists (bgo #533064) */
if (stat ("/dev/ppp", &st) || !S_ISCHR (st.st_mode))
- ignored = system ("/sbin/modprobe ppp_generic");
+ nm_utils_modprobe (NULL, "ppp_generic", NULL);
connection = nm_act_request_get_connection (req);
g_assert (connection);
@@ -1137,8 +1126,8 @@ nm_ppp_manager_start (NMPPPManager *manager,
priv->pid = 0;
if (!g_spawn_async (NULL, (char **) ppp_cmd->array->pdata, NULL,
G_SPAWN_DO_NOT_REAP_CHILD,
- pppd_child_setup,
- NULL, &priv->pid, err)) {
+ nm_utils_setpgid, NULL,
+ &priv->pid, err)) {
goto out;
}
@@ -1159,6 +1148,21 @@ out:
}
static void
+_ppp_kill (NMPPPManager *manager)
+{
+ NMPPPManagerPrivate *priv;
+
+ g_return_if_fail (NM_IS_PPP_MANAGER (manager));
+
+ priv = NM_PPP_MANAGER_GET_PRIVATE (manager);
+
+ if (priv->pid) {
+ nm_utils_kill_child_async (priv->pid, SIGTERM, LOGD_PPP, "pppd", 2000, NULL, NULL);
+ priv->pid = 0;
+ }
+}
+
+static void
_ppp_cleanup (NMPPPManager *manager)
{
NMPPPManagerPrivate *priv;
@@ -1190,9 +1194,96 @@ _ppp_cleanup (NMPPPManager *manager)
g_source_remove (priv->ppp_watch_id);
priv->ppp_watch_id = 0;
}
+}
- if (priv->pid) {
- nm_utils_kill_child_async (priv->pid, SIGTERM, LOGD_PPP, "pppd", 2000, NULL, NULL);
- priv->pid = 0;
+/***********************************************************/
+
+typedef struct {
+ NMPPPManager *manager;
+ GSimpleAsyncResult *result;
+ GCancellable *cancellable;
+} StopContext;
+
+static void
+stop_context_complete (StopContext *ctx)
+{
+ if (ctx->cancellable)
+ g_object_unref (ctx->cancellable);
+ g_simple_async_result_complete_in_idle (ctx->result);
+ g_object_unref (ctx->result);
+ g_object_unref (ctx->manager);
+ g_slice_free (StopContext, ctx);
+}
+
+static gboolean
+stop_context_complete_if_cancelled (StopContext *ctx)
+{
+ GError *error = NULL;
+
+ if (g_cancellable_set_error_if_cancelled (ctx->cancellable, &error)) {
+ g_simple_async_result_take_error (ctx->result, error);
+ stop_context_complete (ctx);
+ return TRUE;
}
+ return FALSE;
+}
+
+gboolean
+nm_ppp_manager_stop_finish (NMPPPManager *manager,
+ GAsyncResult *res,
+ GError **error)
+{
+ return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+}
+
+static void
+kill_child_ready (pid_t pid,
+ gboolean success,
+ int child_status,
+ StopContext *ctx)
+{
+ if (stop_context_complete_if_cancelled (ctx))
+ return;
+ stop_context_complete (ctx);
+}
+
+void
+nm_ppp_manager_stop (NMPPPManager *manager,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager);
+ StopContext *ctx;
+
+ ctx = g_slice_new0 (StopContext);
+ ctx->manager = g_object_ref (manager);
+ ctx->result = g_simple_async_result_new (G_OBJECT (manager),
+ callback,
+ user_data,
+ nm_ppp_manager_stop);
+
+ /* Setup cancellable */
+ ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
+ if (stop_context_complete_if_cancelled (ctx))
+ return;
+
+ /* Cleanup internals */
+ _ppp_cleanup (manager);
+
+ /* If no pppd running, we're done */
+ if (!priv->pid) {
+ stop_context_complete (ctx);
+ return;
+ }
+
+ /* No cancellable operation, so just wait until it returns always */
+ nm_utils_kill_child_async (priv->pid,
+ SIGTERM,
+ LOGD_PPP,
+ "pppd",
+ 2000,
+ (NMUtilsKillChildAsyncCb) kill_child_ready,
+ ctx);
+ priv->pid = 0;
}
diff --git a/src/ppp-manager/nm-ppp-manager.h b/src/ppp-manager/nm-ppp-manager.h
index 84be76d044..f8cbda1365 100644
--- a/src/ppp-manager/nm-ppp-manager.h
+++ b/src/ppp-manager/nm-ppp-manager.h
@@ -24,6 +24,7 @@
#include <glib.h>
#include <glib-object.h>
+#include <gio/gio.h>
#include "nm-ppp-status.h"
#include "nm-activation-request.h"
@@ -69,5 +70,12 @@ gboolean nm_ppp_manager_start (NMPPPManager *manager,
guint32 timeout_secs,
GError **err);
+void nm_ppp_manager_stop (NMPPPManager *manager,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean nm_ppp_manager_stop_finish (NMPPPManager *manager,
+ GAsyncResult *res,
+ GError **error);
#endif /* __NETWORKMANAGER_PPP_MANAGER_H__ */
diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c
index 183f5dbe00..d5e8d70725 100644
--- a/src/ppp-manager/nm-pppd-plugin.c
+++ b/src/ppp-manager/nm-pppd-plugin.c
@@ -19,7 +19,8 @@
* Copyright (C) 2008 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <pppd/pppd.h>
#include <pppd/fsm.h>
diff --git a/src/rdisc/nm-fake-rdisc.c b/src/rdisc/nm-fake-rdisc.c
index bdd207ca46..e631f28d65 100644
--- a/src/rdisc/nm-fake-rdisc.c
+++ b/src/rdisc/nm-fake-rdisc.c
@@ -18,6 +18,8 @@
* Copyright (C) 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <arpa/inet.h>
diff --git a/src/rdisc/nm-lndp-rdisc.c b/src/rdisc/nm-lndp-rdisc.c
index d265076999..922cb3dd76 100644
--- a/src/rdisc/nm-lndp-rdisc.c
+++ b/src/rdisc/nm-lndp-rdisc.c
@@ -18,6 +18,8 @@
* Copyright (C) 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <arpa/inet.h>
/* stdarg.h included because of a bug in ndp.h */
@@ -718,6 +720,7 @@ dispose (GObject *object)
g_clear_pointer (&priv->event_channel, g_io_channel_unref);
if (priv->ndp) {
+ ndp_msgrcv_handler_unregister (priv->ndp, receive_ra, NDP_MSG_RA, NM_RDISC (rdisc)->ifindex, rdisc);
ndp_close (priv->ndp);
priv->ndp = NULL;
}
diff --git a/src/rdisc/nm-rdisc.c b/src/rdisc/nm-rdisc.c
index a326e6f03f..58040c9d43 100644
--- a/src/rdisc/nm-rdisc.c
+++ b/src/rdisc/nm-rdisc.c
@@ -18,6 +18,8 @@
* Copyright (C) 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <arpa/inet.h>
@@ -40,12 +42,38 @@ static guint signals[LAST_SIGNAL] = { 0 };
/******************************************************************/
-void
+/**
+ * nm_rdisc_set_iid:
+ * @rdisc: the #NMRDisc
+ * @iid: the new interface ID
+ *
+ * Sets the "Modified EUI-64" interface ID to be used when generating
+ * IPv6 addresses using received prefixes. Identifiers are either generated
+ * from the hardware addresses or manually set by the operator with
+ * "ip token" command.
+ *
+ * Upon token change (or initial setting) all addresses generated using
+ * the old identifier are removed. The caller should ensure the addresses
+ * will be reset by soliciting router advertisements.
+ *
+ * Returns: %TRUE if the token was changed, %FALSE otherwise.
+ **/
+gboolean
nm_rdisc_set_iid (NMRDisc *rdisc, const NMUtilsIPv6IfaceId iid)
{
- g_return_if_fail (NM_IS_RDISC (rdisc));
+ g_return_val_if_fail (NM_IS_RDISC (rdisc), FALSE);
+
+ if (rdisc->iid.id != iid.id) {
+ rdisc->iid = iid;
+ if (rdisc->addresses->len) {
+ debug ("(%s) IPv6 interface identifier changed, flushing addresses", rdisc->ifname);
+ g_array_remove_range (rdisc->addresses, 0, rdisc->addresses->len);
+ g_signal_emit_by_name (rdisc, NM_RDISC_CONFIG_CHANGED, NM_RDISC_CONFIG_ADDRESSES);
+ }
+ return TRUE;
+ }
- rdisc->iid = iid;
+ return FALSE;
}
void
diff --git a/src/rdisc/nm-rdisc.h b/src/rdisc/nm-rdisc.h
index 2d83f0f020..8864c22f72 100644
--- a/src/rdisc/nm-rdisc.h
+++ b/src/rdisc/nm-rdisc.h
@@ -139,7 +139,7 @@ typedef struct {
GType nm_rdisc_get_type (void);
-void nm_rdisc_set_iid (NMRDisc *rdisc, const NMUtilsIPv6IfaceId iid);
+gboolean nm_rdisc_set_iid (NMRDisc *rdisc, const NMUtilsIPv6IfaceId iid);
void nm_rdisc_start (NMRDisc *rdisc);
#endif /* __NETWORKMANAGER_RDISC_H__ */
diff --git a/src/rdisc/tests/rdisc.c b/src/rdisc/tests/rdisc.c
index 26237093df..d577a63ae4 100644
--- a/src/rdisc/tests/rdisc.c
+++ b/src/rdisc/tests/rdisc.c
@@ -18,6 +18,8 @@
* Copyright (C) 2013 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <syslog.h>
diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c
index 3028e42871..99602d9483 100644
--- a/src/settings/nm-agent-manager.c
+++ b/src/settings/nm-agent-manager.c
@@ -18,7 +18,8 @@
* Copyright (C) 2010 - 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <pwd.h>
@@ -49,9 +50,8 @@ G_DEFINE_TYPE (NMAgentManager, nm_agent_manager, G_TYPE_OBJECT)
NMAgentManagerPrivate))
typedef struct {
- gboolean disposed;
-
NMDBusManager *dbus_mgr;
+ NMAuthManager *auth_mgr;
/* Auth chains for checking agent permissions */
GSList *chains;
@@ -272,7 +272,7 @@ impl_agent_manager_register_with_capabilities (NMAgentManager *self,
NMAgentManagerPrivate *priv = NM_AGENT_MANAGER_GET_PRIVATE (self);
NMAuthSubject *subject;
gulong sender_uid = G_MAXULONG;
- GError *error = NULL, *local = NULL;
+ GError *error = NULL;
NMSecretAgent *agent;
NMAuthChain *chain;
@@ -285,17 +285,6 @@ impl_agent_manager_register_with_capabilities (NMAgentManager *self,
}
sender_uid = nm_auth_subject_get_unix_process_uid (subject);
- if ( 0 != sender_uid
- && !nm_session_monitor_uid_has_session (nm_session_monitor_get (),
- sender_uid,
- NULL,
- &local)) {
- error = g_error_new_literal (NM_AGENT_MANAGER_ERROR,
- NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED,
- local && local->message ? local->message : "Session not found");
- goto done;
- }
-
/* Validate the identifier */
if (!validate_identifier (identifier, &error))
goto done;
@@ -329,6 +318,7 @@ impl_agent_manager_register_with_capabilities (NMAgentManager *self,
priv->chains = g_slist_append (priv->chains, chain);
} else {
+ g_object_unref (agent);
error = g_error_new_literal (NM_AGENT_MANAGER_ERROR,
NM_AGENT_MANAGER_ERROR_FAILED,
"Unable to start agent authentication.");
@@ -338,7 +328,6 @@ done:
if (error)
dbus_g_method_return_error (context, error);
g_clear_error (&error);
- g_clear_error (&local);
g_clear_object (&subject);
}
@@ -529,12 +518,8 @@ agent_compare_func (gconstpointer aa, gconstpointer bb, gpointer user_data)
}
/* Prefer agents in active sessions */
- a_active = nm_session_monitor_uid_active (nm_session_monitor_get (),
- nm_secret_agent_get_owner_uid (a),
- NULL);
- b_active = nm_session_monitor_uid_active (nm_session_monitor_get (),
- nm_secret_agent_get_owner_uid (b),
- NULL);
+ a_active = nm_session_monitor_session_exists (nm_secret_agent_get_owner_uid (a), TRUE);
+ b_active = nm_session_monitor_session_exists (nm_secret_agent_get_owner_uid (b), TRUE);
if (a_active && !b_active)
return -1;
else if (a_active == b_active)
@@ -601,11 +586,12 @@ request_next_agent (Request *req)
{
GError *error = NULL;
+ req->current_call_id = NULL;
+ if (req->current)
+ g_object_unref (req->current);
+
if (req->pending) {
/* Send the request to the next agent */
- req->current_call_id = NULL;
- if (req->current)
- g_object_unref (req->current);
req->current = req->pending->data;
req->pending = g_slist_remove (req->pending, req->current);
@@ -615,7 +601,6 @@ request_next_agent (Request *req)
req->next_callback (req);
} else {
- req->current_call_id = NULL;
req->current = NULL;
/* No more secret agents are available to fulfill this secrets request */
@@ -704,7 +689,7 @@ connection_request_add_agent (Request *parent, NMSecretAgent *agent)
/* Ensure the caller's username exists in the connection's permissions,
* or that the permissions is empty (ie, visible by everyone).
*/
- if (!nm_auth_is_subject_in_acl (req->connection, nm_session_monitor_get (), subject, NULL)) {
+ if (!nm_auth_is_subject_in_acl (req->connection, subject, NULL)) {
nm_log_dbg (LOGD_AGENTS, "(%s) agent ignored for secrets request %p/%s (not in ACL)",
nm_secret_agent_get_description (agent),
parent, parent->detail);
@@ -1106,7 +1091,13 @@ get_start (gpointer user_data)
req, parent->detail, req->setting_name);
/* We don't, so ask some agents for additional secrets */
- request_next_agent (parent);
+ if ( req->flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS
+ && !parent->pending) {
+ /* The request initiated from GetSecrets() via DBus,
+ * don't error out if any secrets are missing. */
+ req_complete_success (parent, req->existing_secrets, NULL, NULL);
+ } else
+ request_next_agent (parent);
}
}
g_variant_unref (secrets_dict);
@@ -1538,35 +1529,7 @@ authority_changed_cb (NMAuthManager *auth_manager, NMAgentManager *self)
/*************************************************************/
-NMAgentManager *
-nm_agent_manager_get (void)
-{
- static NMAgentManager *singleton = NULL;
- NMAgentManagerPrivate *priv;
-
- if (singleton)
- return g_object_ref (singleton);
-
- singleton = (NMAgentManager *) g_object_new (NM_TYPE_AGENT_MANAGER, NULL);
- g_assert (singleton);
-
- priv = NM_AGENT_MANAGER_GET_PRIVATE (singleton);
- priv->dbus_mgr = nm_dbus_manager_get ();
-
- nm_dbus_manager_register_object (priv->dbus_mgr, NM_DBUS_PATH_AGENT_MANAGER, singleton);
-
- g_signal_connect (priv->dbus_mgr,
- NM_DBUS_MANAGER_NAME_OWNER_CHANGED,
- G_CALLBACK (name_owner_changed_cb),
- singleton);
-
- g_signal_connect (nm_auth_manager_get (),
- NM_AUTH_MANAGER_SIGNAL_CHANGED,
- G_CALLBACK (authority_changed_cb),
- singleton);
-
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMAgentManager, nm_agent_manager_get, NM_TYPE_AGENT_MANAGER);
static void
nm_agent_manager_init (NMAgentManager *self)
@@ -1581,23 +1544,57 @@ nm_agent_manager_init (NMAgentManager *self)
}
static void
-dispose (GObject *object)
+constructed (GObject *object)
{
NMAgentManagerPrivate *priv = NM_AGENT_MANAGER_GET_PRIVATE (object);
- if (!priv->disposed) {
- priv->disposed = TRUE;
+ G_OBJECT_CLASS (nm_agent_manager_parent_class)->constructed (object);
- g_signal_handlers_disconnect_by_func (nm_auth_manager_get (),
- G_CALLBACK (authority_changed_cb),
- object);
+ priv->dbus_mgr = g_object_ref (nm_dbus_manager_get ());
+ priv->auth_mgr = g_object_ref (nm_auth_manager_get ());
+
+ nm_dbus_manager_register_object (priv->dbus_mgr, NM_DBUS_PATH_AGENT_MANAGER, object);
+
+ g_signal_connect (priv->dbus_mgr,
+ NM_DBUS_MANAGER_NAME_OWNER_CHANGED,
+ G_CALLBACK (name_owner_changed_cb),
+ object);
- g_slist_free_full (priv->chains, (GDestroyNotify) nm_auth_chain_unref);
+ g_signal_connect (priv->auth_mgr,
+ NM_AUTH_MANAGER_SIGNAL_CHANGED,
+ G_CALLBACK (authority_changed_cb),
+ object);
+}
+static void
+dispose (GObject *object)
+{
+ NMAgentManagerPrivate *priv = NM_AGENT_MANAGER_GET_PRIVATE (object);
+
+ g_slist_free_full (priv->chains, (GDestroyNotify) nm_auth_chain_unref);
+ priv->chains = NULL;
+
+ if (priv->agents) {
g_hash_table_destroy (priv->agents);
+ priv->agents = NULL;
+ }
+ if (priv->requests) {
g_hash_table_destroy (priv->requests);
+ priv->requests = NULL;
+ }
- priv->dbus_mgr = NULL;
+ if (priv->auth_mgr) {
+ g_signal_handlers_disconnect_by_func (priv->auth_mgr,
+ G_CALLBACK (authority_changed_cb),
+ object);
+ g_clear_object (&priv->auth_mgr);
+ }
+ if (priv->dbus_mgr) {
+ g_signal_handlers_disconnect_by_func (priv->dbus_mgr,
+ G_CALLBACK (name_owner_changed_cb),
+ object);
+ nm_dbus_manager_unregister_object (priv->dbus_mgr, object);
+ g_clear_object (&priv->dbus_mgr);
}
G_OBJECT_CLASS (nm_agent_manager_parent_class)->dispose (object);
@@ -1611,6 +1608,7 @@ nm_agent_manager_class_init (NMAgentManagerClass *agent_manager_class)
g_type_class_add_private (agent_manager_class, sizeof (NMAgentManagerPrivate));
/* virtual methods */
+ object_class->constructed = constructed;
object_class->dispose = dispose;
/* Signals */
diff --git a/src/settings/nm-inotify-helper.c b/src/settings/nm-inotify-helper.c
index 7231b57ec8..3732e77a39 100644
--- a/src/settings/nm-inotify-helper.c
+++ b/src/settings/nm-inotify-helper.c
@@ -18,10 +18,13 @@
* (C) Copyright 2008 Red Hat, Inc.
*/
+#include "config.h"
+
#include <unistd.h>
#include <string.h>
#include <sys/inotify.h>
#include <glib.h>
+#include <errno.h>
#include "nm-inotify-helper.h"
#include "nm-logging.h"
@@ -53,9 +56,10 @@ nm_inotify_helper_add_watch (NMInotifyHelper *self, const char *path)
{
NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (self);
int wd;
- guint32 refcount;
+ guint refcount;
- g_return_val_if_fail (priv->ifd >= 0, -1);
+ if (priv->ifd < 0)
+ return -1;
/* We only care about modifications since we're just trying to get change
* notifications on hardlinks.
@@ -76,9 +80,10 @@ void
nm_inotify_helper_remove_watch (NMInotifyHelper *self, int wd)
{
NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (self);
- guint32 refcount;
+ guint refcount;
- g_return_if_fail (priv->ifd >= 0);
+ if (priv->ifd < 0)
+ return;
refcount = GPOINTER_TO_UINT (g_hash_table_lookup (priv->wd_refs, GINT_TO_POINTER (wd)));
if (!refcount)
@@ -126,7 +131,9 @@ init_inotify (NMInotifyHelper *self)
priv->ifd = inotify_init ();
if (priv->ifd == -1) {
- nm_log_warn (LOGD_SETTINGS, "couldn't initialize inotify");
+ int errsv = errno;
+
+ nm_log_warn (LOGD_SETTINGS, "couldn't initialize inotify: %s (%d)", strerror (errsv), errsv);
return FALSE;
}
@@ -143,24 +150,7 @@ init_inotify (NMInotifyHelper *self)
return TRUE;
}
-NMInotifyHelper *
-nm_inotify_helper_get (void)
-{
- static NMInotifyHelper *singleton = NULL;
-
- if (!singleton) {
- singleton = (NMInotifyHelper *) g_object_new (NM_TYPE_INOTIFY_HELPER, NULL);
-
- if (!init_inotify (singleton)) {
- g_clear_object (&singleton);
- return NULL;
- }
- } else
- g_object_ref (singleton);
-
- g_assert (singleton);
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMInotifyHelper, nm_inotify_helper_get, NM_TYPE_INOTIFY_HELPER);
static void
nm_inotify_helper_init (NMInotifyHelper *self)
@@ -171,6 +161,14 @@ nm_inotify_helper_init (NMInotifyHelper *self)
}
static void
+constructed (GObject *object)
+{
+ G_OBJECT_CLASS (nm_inotify_helper_parent_class)->constructed (object);
+
+ init_inotify (NM_INOTIFY_HELPER (object));
+}
+
+static void
finalize (GObject *object)
{
NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (object);
@@ -191,6 +189,7 @@ nm_inotify_helper_class_init (NMInotifyHelperClass *klass)
g_type_class_add_private (klass, sizeof (NMInotifyHelperPrivate));
/* Virtual methods */
+ object_class->constructed = constructed;
object_class->finalize = finalize;
/* Signals */
diff --git a/src/settings/nm-secret-agent.c b/src/settings/nm-secret-agent.c
index 3099f4518b..69a5cea226 100644
--- a/src/settings/nm-secret-agent.c
+++ b/src/settings/nm-secret-agent.c
@@ -18,7 +18,7 @@
* Copyright (C) 2010 - 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
#include <sys/types.h>
#include <pwd.h>
@@ -299,8 +299,9 @@ nm_secret_agent_get_secrets (NMSecretAgent *self,
hash = nm_utils_connection_dict_to_hash (dict);
g_variant_unref (dict);
- /* Mask off the private ONLY_SYSTEM flag if present */
+ /* Mask off the private flags if present */
flags &= ~NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM;
+ flags &= ~NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS;
r = request_new (self, nm_connection_get_path (connection), setting_name, callback, callback_data);
r->call = dbus_g_proxy_begin_call_with_timeout (priv->proxy,
diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c
index 6a71c02036..9285dfbfa5 100644
--- a/src/settings/nm-settings-connection.c
+++ b/src/settings/nm-settings-connection.c
@@ -37,6 +37,7 @@
#include "NetworkManagerUtils.h"
#include "nm-properties-changed-signal.h"
#include "nm-core-internal.h"
+#include "nm-glib-compat.h"
#define SETTINGS_TIMESTAMPS_FILE NMSTATEDIR "/timestamps"
#define SETTINGS_SEEN_BSSIDS_FILE NMSTATEDIR "/seen-bssids"
@@ -81,7 +82,9 @@ enum {
PROP_0 = 0,
PROP_VISIBLE,
PROP_UNSAVED,
+ PROP_READY,
PROP_FLAGS,
+ PROP_FILENAME,
};
enum {
@@ -94,10 +97,10 @@ static guint signals[LAST_SIGNAL] = { 0 };
typedef struct {
NMAgentManager *agent_mgr;
- NMSessionMonitor *session_monitor;
guint session_changed_id;
NMSettingsConnectionFlags flags;
+ gboolean ready;
guint updated_idle_id;
@@ -128,6 +131,8 @@ typedef struct {
gint32 autoconnect_retry_time;
NMDeviceStateReason autoconnect_blocked_reason;
+ char *filename;
+
} NMSettingsConnectionPrivate;
/**************************************************************/
@@ -261,14 +266,18 @@ nm_settings_connection_recheck_visibility (NMSettingsConnection *self)
}
for (i = 0; i < num; i++) {
- const char *puser;
+ const char *user;
+ uid_t uid;
- if (nm_setting_connection_get_permission (s_con, i, NULL, &puser, NULL)) {
- if (nm_session_monitor_user_has_session (priv->session_monitor, puser, NULL, NULL)) {
- set_visible (self, TRUE);
- return;
- }
- }
+ if (!nm_setting_connection_get_permission (s_con, i, NULL, &user, NULL))
+ continue;
+ if (!nm_session_monitor_user_to_uid (user, &uid))
+ continue;
+ if (!nm_session_monitor_session_exists (uid, FALSE))
+ continue;
+
+ set_visible (self, TRUE);
+ return;
}
set_visible (self, FALSE);
@@ -441,6 +450,7 @@ gboolean
nm_settings_connection_replace_settings (NMSettingsConnection *self,
NMConnection *new_connection,
gboolean update_unsaved,
+ const char *log_diff_name,
GError **error)
{
NMSettingsConnectionPrivate *priv;
@@ -454,6 +464,15 @@ nm_settings_connection_replace_settings (NMSettingsConnection *self,
if (!nm_connection_normalize (new_connection, NULL, NULL, error))
return FALSE;
+ if ( nm_connection_get_path (NM_CONNECTION (self))
+ && g_strcmp0 (nm_connection_get_uuid (NM_CONNECTION (self)), nm_connection_get_uuid (new_connection)) != 0) {
+ /* Updating the UUID is not allowed once the path is exported. */
+ g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+ "connection %s cannot change the UUID from %s to %s", nm_connection_get_id (NM_CONNECTION (self)),
+ nm_connection_get_uuid (NM_CONNECTION (self)), nm_connection_get_uuid (new_connection));
+ return FALSE;
+ }
+
/* Do nothing if there's nothing to update */
if (nm_connection_compare (NM_CONNECTION (self),
new_connection,
@@ -466,7 +485,8 @@ nm_settings_connection_replace_settings (NMSettingsConnection *self,
*/
g_signal_handlers_block_by_func (self, G_CALLBACK (changed_cb), GUINT_TO_POINTER (TRUE));
- nm_utils_log_connection_diff (new_connection, NM_CONNECTION (self), LOGL_DEBUG, LOGD_CORE, "update connection", "++ ");
+ if (log_diff_name)
+ nm_utils_log_connection_diff (new_connection, NM_CONNECTION (self), LOGL_DEBUG, LOGD_CORE, log_diff_name, "++ ");
nm_connection_replace_settings_from_connection (NM_CONNECTION (self), new_connection);
nm_settings_connection_set_flags (self,
@@ -518,24 +538,34 @@ ignore_cb (NMSettingsConnection *connection,
* subsystems watching this connection. Before returning, 'callback' is run
* with the given 'user_data' along with any errors encountered.
*/
+static void
+replace_and_commit (NMSettingsConnection *self,
+ NMConnection *new_connection,
+ NMSettingsConnectionCommitFunc callback,
+ gpointer user_data)
+{
+ GError *error = NULL;
+
+ if (nm_settings_connection_replace_settings (self, new_connection, TRUE, "replace-and-commit-disk", &error))
+ nm_settings_connection_commit_changes (self, callback, user_data);
+ else {
+ g_assert (error);
+ if (callback)
+ callback (self, error, user_data);
+ g_clear_error (&error);
+ }
+}
+
void
nm_settings_connection_replace_and_commit (NMSettingsConnection *self,
NMConnection *new_connection,
NMSettingsConnectionCommitFunc callback,
gpointer user_data)
{
- GError *error = NULL;
-
g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self));
g_return_if_fail (NM_IS_CONNECTION (new_connection));
- if (nm_settings_connection_replace_settings (self, new_connection, TRUE, &error)) {
- nm_settings_connection_commit_changes (self, callback, user_data);
- } else {
- if (callback)
- callback (self, error, user_data);
- g_clear_error (&error);
- }
+ NM_SETTINGS_CONNECTION_GET_CLASS (self)->replace_and_commit (self, new_connection, callback, user_data);
}
static void
@@ -1066,7 +1096,6 @@ auth_start (NMSettingsConnection *self,
/* Ensure the caller can view this connection */
if (!nm_auth_is_subject_in_acl (NM_CONNECTION (self),
- priv->session_monitor,
subject,
&error_desc)) {
error = g_error_new_literal (NM_SETTINGS_ERROR,
@@ -1228,6 +1257,12 @@ has_some_secrets_cb (NMSetting *setting,
{
GParamSpec *pspec;
+ if (NM_IS_SETTING_VPN (setting)) {
+ if (nm_setting_vpn_get_num_secrets (NM_SETTING_VPN(setting)))
+ *((gboolean *) user_data) = TRUE;
+ return;
+ }
+
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (setting)), key);
if (pspec) {
if ( (flags & NM_SETTING_PARAM_SECRET)
@@ -1343,11 +1378,8 @@ update_auth_cb (NMSettingsConnection *self,
con_update_cb,
info);
} else {
- /* Do nothing if there's nothing to update */
- if (!nm_connection_compare (NM_CONNECTION (self), info->new_settings, NM_SETTING_COMPARE_FLAG_EXACT)) {
- if (!nm_settings_connection_replace_settings (self, info->new_settings, TRUE, &local))
- g_assert (local);
- }
+ if (!nm_settings_connection_replace_settings (self, info->new_settings, TRUE, "replace-and-commit-memory", &local))
+ g_assert (local);
con_update_cb (self, local, info);
g_clear_error (&local);
}
@@ -1423,7 +1455,6 @@ impl_settings_connection_update_helper (NMSettingsConnection *self,
* invisible to yourself.
*/
if (!nm_auth_is_subject_in_acl (tmp ? tmp : NM_CONNECTION (self),
- priv->session_monitor,
subject,
&error_desc)) {
error = g_error_new_literal (NM_SETTINGS_ERROR,
@@ -1603,7 +1634,8 @@ dbus_get_secrets_auth_cb (NMSettingsConnection *self,
call_id = nm_settings_connection_get_secrets (self,
subject,
setting_name,
- NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED,
+ NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED
+ | NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS,
NULL,
dbus_get_agent_secrets_cb,
context,
@@ -2158,6 +2190,64 @@ nm_settings_connection_get_nm_generated_assumed (NMSettingsConnection *connectio
return NM_FLAGS_HAS (nm_settings_connection_get_flags (connection), NM_SETTINGS_CONNECTION_FLAGS_NM_GENERATED_ASSUMED);
}
+gboolean
+nm_settings_connection_get_ready (NMSettingsConnection *connection)
+{
+ return NM_SETTINGS_CONNECTION_GET_PRIVATE (connection)->ready;
+}
+
+void
+nm_settings_connection_set_ready (NMSettingsConnection *connection,
+ gboolean ready)
+{
+ NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (connection);
+
+ ready = !!ready;
+ if (priv->ready != ready) {
+ priv->ready = ready;
+ g_object_notify (G_OBJECT (connection), NM_SETTINGS_CONNECTION_READY);
+ }
+}
+
+/**
+ * nm_settings_connection_set_filename:
+ * @connection: an #NMSettingsConnection
+ * @filename: @connection's filename
+ *
+ * Called by a backend to sets the filename that @connection is read
+ * from/written to.
+ */
+void
+nm_settings_connection_set_filename (NMSettingsConnection *connection,
+ const char *filename)
+{
+ NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (connection);
+
+ if (g_strcmp0 (filename, priv->filename) != 0) {
+ g_free (priv->filename);
+ priv->filename = g_strdup (filename);
+ g_object_notify (G_OBJECT (connection), NM_SETTINGS_CONNECTION_FILENAME);
+ }
+}
+
+/**
+ * nm_settings_connection_get_filename:
+ * @connection: an #NMSettingsConnection
+ *
+ * Gets the filename that @connection was read from/written to. This may be
+ * %NULL if @connection is unsaved, or if it is associated with a backend that
+ * does not store each connection in a separate file.
+ *
+ * Returns: @connection's filename.
+ */
+const char *
+nm_settings_connection_get_filename (NMSettingsConnection *connection)
+{
+ NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (connection);
+
+ return priv->filename;
+}
+
/**************************************************************/
static void
@@ -2166,14 +2256,11 @@ nm_settings_connection_init (NMSettingsConnection *self)
NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self);
priv->visible = FALSE;
+ priv->ready = TRUE;
- priv->session_monitor = nm_session_monitor_get ();
- priv->session_changed_id = g_signal_connect (priv->session_monitor,
- NM_SESSION_MONITOR_CHANGED,
- G_CALLBACK (session_changed_cb),
- self);
+ priv->session_changed_id = nm_session_monitor_connect (session_changed_cb, self);
- priv->agent_mgr = nm_agent_manager_get ();
+ priv->agent_mgr = g_object_ref (nm_agent_manager_get ());
priv->seen_bssids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@@ -2222,11 +2309,13 @@ dispose (GObject *object)
set_visible (self, FALSE);
if (priv->session_changed_id) {
- g_signal_handler_disconnect (priv->session_monitor, priv->session_changed_id);
+ nm_session_monitor_disconnect (priv->session_changed_id);
priv->session_changed_id = 0;
}
g_clear_object (&priv->agent_mgr);
+ g_clear_pointer (&priv->filename, g_free);
+
G_OBJECT_CLASS (nm_settings_connection_parent_class)->dispose (object);
}
@@ -2244,9 +2333,15 @@ get_property (GObject *object, guint prop_id,
case PROP_UNSAVED:
g_value_set_boolean (value, nm_settings_connection_get_unsaved (self));
break;
+ case PROP_READY:
+ g_value_set_boolean (value, nm_settings_connection_get_ready (self));
+ break;
case PROP_FLAGS:
g_value_set_uint (value, nm_settings_connection_get_flags (self));
break;
+ case PROP_FILENAME:
+ g_value_set_string (value, nm_settings_connection_get_filename (self));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -2260,9 +2355,15 @@ set_property (GObject *object, guint prop_id,
NMSettingsConnection *self = NM_SETTINGS_CONNECTION (object);
switch (prop_id) {
+ case PROP_READY:
+ nm_settings_connection_set_ready (self, g_value_get_boolean (value));
+ break;
case PROP_FLAGS:
nm_settings_connection_set_flags_all (self, g_value_get_uint (value));
break;
+ case PROP_FILENAME:
+ nm_settings_connection_set_filename (self, g_value_get_string (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -2281,6 +2382,7 @@ nm_settings_connection_class_init (NMSettingsConnectionClass *class)
object_class->get_property = get_property;
object_class->set_property = set_property;
+ class->replace_and_commit = replace_and_commit;
class->commit_changes = commit_changes;
class->delete = do_delete;
class->supports_secrets = supports_secrets;
@@ -2301,6 +2403,13 @@ nm_settings_connection_class_init (NMSettingsConnectionClass *class)
G_PARAM_STATIC_STRINGS));
g_object_class_install_property
+ (object_class, PROP_READY,
+ g_param_spec_boolean (NM_SETTINGS_CONNECTION_READY, "", "",
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property
(object_class, PROP_FLAGS,
g_param_spec_uint (NM_SETTINGS_CONNECTION_FLAGS, "", "",
NM_SETTINGS_CONNECTION_FLAGS_NONE,
@@ -2309,6 +2418,13 @@ nm_settings_connection_class_init (NMSettingsConnectionClass *class)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property
+ (object_class, PROP_FILENAME,
+ g_param_spec_string (NM_SETTINGS_CONNECTION_FILENAME, "", "",
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
/* Signals */
/* Emitted when the connection is changed for any reason */
diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h
index 254e927bfd..49661f38c6 100644
--- a/src/settings/nm-settings-connection.h
+++ b/src/settings/nm-settings-connection.h
@@ -46,9 +46,11 @@ G_BEGIN_DECLS
#define NM_SETTINGS_CONNECTION_UPDATED_BY_USER "updated-by-user"
/* Properties */
-#define NM_SETTINGS_CONNECTION_VISIBLE "visible"
-#define NM_SETTINGS_CONNECTION_UNSAVED "unsaved"
-#define NM_SETTINGS_CONNECTION_FLAGS "flags"
+#define NM_SETTINGS_CONNECTION_VISIBLE "visible"
+#define NM_SETTINGS_CONNECTION_UNSAVED "unsaved"
+#define NM_SETTINGS_CONNECTION_READY "ready"
+#define NM_SETTINGS_CONNECTION_FLAGS "flags"
+#define NM_SETTINGS_CONNECTION_FILENAME "filename"
/**
@@ -95,6 +97,11 @@ struct _NMSettingsConnectionClass {
GObjectClass parent;
/* virtual methods */
+ void (*replace_and_commit) (NMSettingsConnection *connection,
+ NMConnection *new_connection,
+ NMSettingsConnectionCommitFunc callback,
+ gpointer user_data);
+
void (*commit_changes) (NMSettingsConnection *connection,
NMSettingsConnectionCommitFunc callback,
gpointer user_data);
@@ -116,6 +123,7 @@ void nm_settings_connection_commit_changes (NMSettingsConnection *connection,
gboolean nm_settings_connection_replace_settings (NMSettingsConnection *self,
NMConnection *new_connection,
gboolean update_unsaved,
+ const char *log_diff_name,
GError **error);
void nm_settings_connection_replace_and_commit (NMSettingsConnection *self,
@@ -196,6 +204,14 @@ gboolean nm_settings_connection_can_autoconnect (NMSettingsConnection *connectio
gboolean nm_settings_connection_get_nm_generated (NMSettingsConnection *connection);
gboolean nm_settings_connection_get_nm_generated_assumed (NMSettingsConnection *connection);
+gboolean nm_settings_connection_get_ready (NMSettingsConnection *connection);
+void nm_settings_connection_set_ready (NMSettingsConnection *connection,
+ gboolean ready);
+
+void nm_settings_connection_set_filename (NMSettingsConnection *connection,
+ const char *filename);
+const char *nm_settings_connection_get_filename (NMSettingsConnection *connection);
+
G_END_DECLS
#endif /* __NETWORKMANAGER_SETTINGS_CONNECTION_H__ */
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index bd90668203..9319470456 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -34,6 +34,7 @@
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
+#include "gsystem-local-alloc.h"
#include <nm-dbus-interface.h>
#include <nm-connection.h>
#include <nm-setting-8021x.h>
@@ -150,6 +151,8 @@ typedef struct {
GSList *unmanaged_specs;
GSList *unrecognized_specs;
GSList *get_connections_cache;
+
+ gboolean startup_complete;
} NMSettingsPrivate;
#define NM_SETTINGS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTINGS, NMSettingsPrivate))
@@ -174,11 +177,43 @@ enum {
PROP_HOSTNAME,
PROP_CAN_MODIFY,
PROP_CONNECTIONS,
+ PROP_STARTUP_COMPLETE,
LAST_PROP
};
static void
+check_startup_complete (NMSettings *self)
+{
+ NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
+ GHashTableIter iter;
+ NMSettingsConnection *conn;
+
+ if (priv->startup_complete)
+ return;
+
+ g_hash_table_iter_init (&iter, priv->connections);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &conn)) {
+ if (!nm_settings_connection_get_ready (conn))
+ return;
+ }
+
+ priv->startup_complete = TRUE;
+ g_object_notify (G_OBJECT (self), NM_SETTINGS_STARTUP_COMPLETE);
+}
+
+static void
+connection_ready_changed (NMSettingsConnection *conn,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ NMSettings *self = NM_SETTINGS (user_data);
+
+ if (nm_settings_connection_get_ready (conn))
+ check_startup_complete (self);
+}
+
+static void
plugin_connection_added (NMSystemConfigInterface *config,
NMSettingsConnection *connection,
gpointer user_data)
@@ -305,7 +340,6 @@ impl_settings_get_connection_by_uuid (NMSettings *self,
}
if (!nm_auth_is_subject_in_acl (NM_CONNECTION (connection),
- nm_session_monitor_get (),
subject,
&error_desc)) {
error = g_error_new_literal (NM_SETTINGS_ERROR,
@@ -569,7 +603,7 @@ add_plugin (NMSettings *self, NMSystemConfigInterface *plugin)
priv->plugins = g_slist_append (priv->plugins, g_object_ref (plugin));
- g_signal_connect (plugin, "notify::hostname", G_CALLBACK (hostname_changed), self);
+ g_signal_connect (plugin, "notify::"NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME, G_CALLBACK (hostname_changed), self);
nm_system_config_interface_init (plugin, NULL);
@@ -771,6 +805,7 @@ connection_removed (NMSettingsConnection *connection, gpointer user_data)
g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_updated), self);
g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_updated_by_user), self);
g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_visibility_changed), self);
+ g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_ready_changed), self);
/* Forget about the connection internally */
g_hash_table_remove (NM_SETTINGS_GET_PRIVATE (user_data)->connections,
@@ -783,6 +818,8 @@ connection_removed (NMSettingsConnection *connection, gpointer user_data)
g_signal_emit_by_name (self, NM_CP_SIGNAL_CONNECTION_REMOVED, connection);
g_object_notify (G_OBJECT (self), NM_SETTINGS_CONNECTIONS);
+ check_startup_complete (self);
+
g_object_unref (connection);
}
@@ -849,6 +886,7 @@ claim_connection (NMSettings *self,
GHashTableIter iter;
gpointer data;
char *path;
+ NMSettingsConnection *existing;
g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection));
g_return_if_fail (nm_connection_get_path (NM_CONNECTION (connection)) == NULL);
@@ -867,6 +905,23 @@ claim_connection (NMSettings *self,
return;
}
+ existing = nm_settings_get_connection_by_uuid (self, nm_connection_get_uuid (NM_CONNECTION (connection)));
+ if (existing) {
+ /* Cannot add duplicate connections per UUID. Just return without action and
+ * log a warning.
+ *
+ * This means, that plugins must not provide duplicate connections (UUID).
+ * In fact, none of the plugins currently would do that.
+ *
+ * But globaly, over different setting plugins, there could be duplicates
+ * without the individual plugins being aware. Don't handle that at all, just
+ * error out. That should not happen unless the admin misconfigured the system
+ * to create conflicting connections. */
+ nm_log_warn (LOGD_SETTINGS, "plugin provided duplicate connection with UUID %s",
+ nm_connection_get_uuid (NM_CONNECTION (connection)));
+ return;
+ }
+
/* Read timestamp from look-aside file and put it into the connection's data */
nm_settings_connection_read_and_fill_timestamp (connection);
@@ -888,6 +943,11 @@ claim_connection (NMSettings *self,
g_signal_connect (connection, "notify::" NM_SETTINGS_CONNECTION_VISIBLE,
G_CALLBACK (connection_visibility_changed),
self);
+ if (!priv->startup_complete) {
+ g_signal_connect (connection, "notify::" NM_SETTINGS_CONNECTION_READY,
+ G_CALLBACK (connection_ready_changed),
+ self);
+ }
/* Export the connection over D-Bus */
g_warn_if_fail (nm_connection_get_path (NM_CONNECTION (connection)) == NULL);
@@ -1182,7 +1242,6 @@ nm_settings_add_connection_dbus (NMSettings *self,
* or that the permissions is empty (ie, visible by everyone).
*/
if (!nm_auth_is_subject_in_acl (connection,
- nm_session_monitor_get (),
subject,
&error_desc)) {
error = g_error_new_literal (NM_SETTINGS_ERROR,
@@ -1610,7 +1669,7 @@ default_wired_clear_tag (NMSettings *self,
g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (default_wired_connection_updated_by_user_cb), self);
if (add_to_no_auto_default)
- nm_config_set_ethernet_no_auto_default (NM_SETTINGS_GET_PRIVATE (self)->config, device);
+ nm_config_set_no_auto_default_for_device (NM_SETTINGS_GET_PRIVATE (self)->config, device);
}
void
@@ -1779,6 +1838,16 @@ cp_get_connection_by_uuid (NMConnectionProvider *provider, const char *uuid)
/***************************************************************/
+gboolean
+nm_settings_get_startup_complete (NMSettings *self)
+{
+ NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
+
+ return priv->startup_complete;
+}
+
+/***************************************************************/
+
NMSettings *
nm_settings_new (GError **error)
{
@@ -1799,6 +1868,7 @@ nm_settings_new (GError **error)
}
load_connections (self);
+ check_startup_complete (self);
nm_dbus_manager_register_object (priv->dbus_mgr, NM_DBUS_PATH_SETTINGS, self);
return self;
@@ -1825,7 +1895,7 @@ nm_settings_init (NMSettings *self)
* transient, and we don't want the agent manager to get destroyed and
* recreated often.
*/
- priv->agent_mgr = nm_agent_manager_get ();
+ priv->agent_mgr = g_object_ref (nm_agent_manager_get ());
g_signal_connect (priv->agent_mgr, "agent-registered", G_CALLBACK (secret_agent_registered), self);
}
@@ -1899,6 +1969,9 @@ get_property (GObject *object, guint prop_id,
g_ptr_array_add (array, g_strdup (path));
g_value_take_boxed (value, array);
break;
+ case PROP_STARTUP_COMPLETE:
+ g_value_set_boolean (value, nm_settings_get_startup_complete (self));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff --git a/src/settings/nm-settings.h b/src/settings/nm-settings.h
index 520c4ec34c..9c0a4c835e 100644
--- a/src/settings/nm-settings.h
+++ b/src/settings/nm-settings.h
@@ -37,10 +37,11 @@
#define NM_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTINGS))
#define NM_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS, NMSettingsClass))
-#define NM_SETTINGS_UNMANAGED_SPECS "unmanaged-specs"
-#define NM_SETTINGS_HOSTNAME "hostname"
-#define NM_SETTINGS_CAN_MODIFY "can-modify"
-#define NM_SETTINGS_CONNECTIONS "connections"
+#define NM_SETTINGS_UNMANAGED_SPECS "unmanaged-specs"
+#define NM_SETTINGS_HOSTNAME "hostname"
+#define NM_SETTINGS_CAN_MODIFY "can-modify"
+#define NM_SETTINGS_CONNECTIONS "connections"
+#define NM_SETTINGS_STARTUP_COMPLETE "connections"
#define NM_SETTINGS_SIGNAL_CONNECTION_ADDED "connection-added"
#define NM_SETTINGS_SIGNAL_CONNECTION_UPDATED "connection-updated"
@@ -120,4 +121,6 @@ void nm_settings_device_removed (NMSettings *self, NMDevice *device, gboolean qu
gint nm_settings_sort_connections (gconstpointer a, gconstpointer b);
+gboolean nm_settings_get_startup_complete (NMSettings *self);
+
#endif /* __NM_SETTINGS_H__ */
diff --git a/src/settings/nm-system-config-interface.c b/src/settings/nm-system-config-interface.c
index 4ab16e24b8..637c301e3f 100644
--- a/src/settings/nm-system-config-interface.c
+++ b/src/settings/nm-system-config-interface.c
@@ -19,6 +19,8 @@
* Copyright (C) 2008 Novell, Inc.
*/
+#include "config.h"
+
#include "nm-system-config-interface.h"
#include "nm-settings-connection.h"
diff --git a/src/settings/plugins/example/nm-example-connection.c b/src/settings/plugins/example/nm-example-connection.c
index 858c67f216..e125961130 100644
--- a/src/settings/plugins/example/nm-example-connection.c
+++ b/src/settings/plugins/example/nm-example-connection.c
@@ -18,6 +18,8 @@
* Copyright (C) 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib/gstdio.h>
#include <nm-dbus-interface.h>
@@ -80,6 +82,7 @@ nm_example_connection_new (const char *full_path,
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object),
tmp,
TRUE,
+ NULL,
error)) {
g_object_unref (object);
object = NULL;
diff --git a/src/settings/plugins/example/plugin.c b/src/settings/plugins/example/plugin.c
index bc5c06e99d..0bcb38fcf3 100644
--- a/src/settings/plugins/example/plugin.c
+++ b/src/settings/plugins/example/plugin.c
@@ -18,7 +18,8 @@
* Copyright (C) 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
@@ -846,7 +847,7 @@ nm_system_config_factory (void)
priv = SC_PLUGIN_EXAMPLE_GET_PRIVATE (singleton);
/* Cache the config file path */
- priv->conf_file = nm_config_get_path (nm_config_get ());
+ priv->conf_file = nm_config_data_get_config_main_file (nm_config_get_data (nm_config_get ()));
} else {
/* This function should never be called twice */
g_assert_not_reached ();
diff --git a/src/settings/plugins/example/reader.c b/src/settings/plugins/example/reader.c
index 23f37c74e6..ee45440a53 100644
--- a/src/settings/plugins/example/reader.c
+++ b/src/settings/plugins/example/reader.c
@@ -18,7 +18,8 @@
* Copyright (C) 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <glib.h>
#include <nm-connection.h>
diff --git a/src/settings/plugins/example/writer.c b/src/settings/plugins/example/writer.c
index f0a9ea2102..41e5c498de 100644
--- a/src/settings/plugins/example/writer.c
+++ b/src/settings/plugins/example/writer.c
@@ -18,7 +18,8 @@
* Copyright (C) 2012 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <glib.h>
#include <nm-connection.h>
diff --git a/src/settings/plugins/ibft/nm-ibft-connection.c b/src/settings/plugins/ibft/nm-ibft-connection.c
index 5558f0e7ab..c6a9054e47 100644
--- a/src/settings/plugins/ibft/nm-ibft-connection.c
+++ b/src/settings/plugins/ibft/nm-ibft-connection.c
@@ -18,6 +18,8 @@
* Copyright 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <net/ethernet.h>
#include <netinet/ether.h>
@@ -44,6 +46,7 @@ nm_ibft_connection_new (const GPtrArray *block, GError **error)
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object),
source,
FALSE,
+ NULL,
error))
g_clear_object (&object);
diff --git a/src/settings/plugins/ibft/plugin.c b/src/settings/plugins/ibft/plugin.c
index 54af90503f..303971e05b 100644
--- a/src/settings/plugins/ibft/plugin.c
+++ b/src/settings/plugins/ibft/plugin.c
@@ -18,7 +18,8 @@
* Copyright 2014 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <unistd.h>
#include <errno.h>
diff --git a/src/settings/plugins/ibft/reader.c b/src/settings/plugins/ibft/reader.c
index aac7715a7a..9bc6346278 100644
--- a/src/settings/plugins/ibft/reader.c
+++ b/src/settings/plugins/ibft/reader.c
@@ -18,7 +18,8 @@
* Copyright 2014 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@ -35,7 +36,6 @@
#include "nm-core-internal.h"
#include "nm-platform.h"
-#include "nm-posix-signals.h"
#include "NetworkManagerUtils.h"
#include "nm-logging.h"
@@ -43,22 +43,6 @@
#define PARSE_WARNING(msg...) nm_log_warn (LOGD_SETTINGS, " " msg)
-static void
-iscsiadm_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process here; set a different process group to
- * ensure signal isolation between child and parent.
- */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for iscsiadm here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
/* Removes trailing whitespace and whitespace before and immediately after the '=' */
static char *
remove_most_whitespace (const char *src)
@@ -125,7 +109,7 @@ read_ibft_blocks (const char *iscsiadm_path,
g_return_val_if_fail (out_blocks != NULL && *out_blocks == NULL, FALSE);
if (!g_spawn_sync ("/", (char **) argv, (char **) envp, 0,
- iscsiadm_child_setup, NULL, &out, &err, &status, error))
+ NULL, NULL, &out, &err, &status, error))
goto done;
if (!WIFEXITED (status)) {
@@ -135,6 +119,15 @@ read_ibft_blocks (const char *iscsiadm_path,
}
if (WEXITSTATUS (status) != 0) {
+ if (err) {
+ char *nl;
+
+ /* the error message contains newlines. concatenate the lines with whitespace */
+ for (nl = err; *nl; nl++) {
+ if (*nl == '\n')
+ *nl = ' ';
+ }
+ }
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
"iBFT: %s exited with error %d. Message: '%s'",
iscsiadm_path, WEXITSTATUS (status), err ? err : "(none)");
@@ -185,6 +178,7 @@ done:
if (lines)
g_strfreev (lines);
g_free (out);
+ g_free (err);
if (success)
*out_blocks = blocks;
else
@@ -267,19 +261,15 @@ ip4_setting_add_from_block (const GPtrArray *block,
NMConnection *connection,
GError **error)
{
- NMSettingIP4Config *s_ip4 = NULL;
- NMIP4Address *addr;
+ NMSettingIPConfig *s_ip4 = NULL;
+ NMIPAddress *addr;
const char *s_method = NULL;
const char *s_ipaddr = NULL;
const char *s_gateway = NULL;
const char *s_dns1 = NULL;
const char *s_dns2 = NULL;
const char *s_netmask = NULL;
- guint32 ipaddr = 0;
guint32 netmask = 0;
- guint32 gateway = 0;
- guint32 dns1 = 0;
- guint32 dns2 = 0;
guint32 prefix;
g_assert (block);
@@ -300,10 +290,10 @@ ip4_setting_add_from_block (const GPtrArray *block,
goto error;
}
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
if (!g_ascii_strcasecmp (s_method, "dhcp")) {
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
goto success;
} else if (g_ascii_strcasecmp (s_method, "static") != 0) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
@@ -313,10 +303,10 @@ ip4_setting_add_from_block (const GPtrArray *block,
}
/* Static configuration stuff */
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
/* IP address */
- if (!s_ipaddr || inet_pton (AF_INET, s_ipaddr, &ipaddr) != 1) {
+ if (!s_ipaddr || !nm_utils_ipaddr_valid (AF_INET, s_ipaddr)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"iBFT: malformed iscsiadm record: invalid IP address '%s'.",
s_ipaddr);
@@ -332,38 +322,42 @@ ip4_setting_add_from_block (const GPtrArray *block,
}
prefix = nm_utils_ip4_netmask_to_prefix (netmask);
- if (s_gateway && inet_pton (AF_INET, s_gateway, &gateway) != 1) {
+ if (s_gateway && !nm_utils_ipaddr_valid (AF_INET, s_gateway)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"iBFT: malformed iscsiadm record: invalid IP gateway '%s'.",
s_gateway);
goto error;
}
- if (s_dns1 && inet_pton (AF_INET, s_dns1, &dns1) != 1) {
+ if (s_dns1 && !nm_utils_ipaddr_valid (AF_INET, s_dns1)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"iBFT: malformed iscsiadm record: invalid DNS1 address '%s'.",
s_dns1);
goto error;
}
- if (s_dns2 && inet_pton (AF_INET, s_dns2, &dns2) != 1) {
+ if (s_dns2 && !nm_utils_ipaddr_valid (AF_INET, s_dns2)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"iBFT: malformed iscsiadm record: invalid DNS2 address '%s'.",
s_dns2);
goto error;
}
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ipaddr);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gateway);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, s_ipaddr, prefix, error);
+ if (!addr) {
+ g_prefix_error (error, "iBFT: malformed iscsiadm record: ");
+ goto error;
+ }
+
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
+
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_GATEWAY, s_gateway, NULL);
if (s_dns1)
- nm_setting_ip4_config_add_dns (s_ip4, s_dns1);
+ nm_setting_ip_config_add_dns (s_ip4, s_dns1);
if (s_dns2)
- nm_setting_ip4_config_add_dns (s_ip4, s_dns2);
+ nm_setting_ip_config_add_dns (s_ip4, s_dns2);
success:
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
@@ -383,7 +377,7 @@ connection_setting_add (const GPtrArray *block,
GError **error)
{
NMSetting *s_con;
- char *id, *uuid, *uuid_data;
+ char *id, *uuid;
const char *s_hwaddr = NULL, *s_ip4addr = NULL, *s_vlanid;
if (!parse_ibft_config (block, error,
@@ -403,12 +397,13 @@ connection_setting_add (const GPtrArray *block,
prefix ? prefix : "",
iface);
- uuid_data = g_strdup_printf ("%s%s%s",
- s_vlanid ? s_vlanid : "0",
- s_hwaddr,
- s_ip4addr ? s_ip4addr : "DHCP");
- uuid = nm_utils_uuid_generate_from_string (uuid_data);
- g_free (uuid_data);
+ uuid = _nm_utils_uuid_generate_from_strings ("ibft",
+ s_hwaddr,
+ s_vlanid ? "V" : "v",
+ s_vlanid ? s_vlanid : "",
+ s_ip4addr ? "A" : "DHCP",
+ s_ip4addr ? s_ip4addr : "",
+ NULL);
s_con = nm_setting_connection_new ();
g_object_set (s_con,
@@ -436,7 +431,7 @@ is_ibft_vlan_device (const GPtrArray *block)
/* VLAN 0 is normally a valid VLAN ID, but in the iBFT case it
* means "no VLAN".
*/
- if (nm_utils_ascii_str_to_int64 (s_vlan_id, 10, 1, 4095, -1) != -1)
+ if (_nm_utils_ascii_str_to_int64 (s_vlan_id, 10, 1, 4095, -1) != -1)
return TRUE;
}
return FALSE;
@@ -463,7 +458,7 @@ vlan_setting_add_from_block (const GPtrArray *block,
g_assert (vlan_id_str);
/* VLAN 0 is normally a valid VLAN ID, but in the iBFT case it means "no VLAN" */
- vlan_id = nm_utils_ascii_str_to_int64 (vlan_id_str, 10, 1, 4095, -1);
+ vlan_id = _nm_utils_ascii_str_to_int64 (vlan_id_str, 10, 1, 4095, -1);
if (vlan_id == -1) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid VLAN_ID '%s'", vlan_id_str);
diff --git a/src/settings/plugins/ibft/tests/Makefile.am b/src/settings/plugins/ibft/tests/Makefile.am
index dd72220a76..3c7c94accd 100644
--- a/src/settings/plugins/ibft/tests/Makefile.am
+++ b/src/settings/plugins/ibft/tests/Makefile.am
@@ -32,6 +32,7 @@ test_ibft_SOURCES = \
test_ibft_LDADD = \
$(top_builddir)/src/libNetworkManager.la
+@VALGRIND_RULES@
TESTS = test-ibft
endif
diff --git a/src/settings/plugins/ibft/tests/test-ibft.c b/src/settings/plugins/ibft/tests/test-ibft.c
index 3fb64ac4bd..d5da9ec022 100644
--- a/src/settings/plugins/ibft/tests/test-ibft.c
+++ b/src/settings/plugins/ibft/tests/test-ibft.c
@@ -18,6 +18,8 @@
* Copyright 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
@@ -61,7 +63,7 @@ read_block (const char *iscsiadm_path, const char *expected_mac)
}
g_assert (block);
- g_slist_foreach (blocks, (GFunc) g_ptr_array_unref, NULL);
+ g_slist_free_full (blocks, (GDestroyNotify) g_ptr_array_unref);
return block;
}
@@ -71,7 +73,7 @@ test_read_ibft_dhcp (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *mac_address;
const char *expected_mac_address = "00:33:21:98:b9:f1";
@@ -105,9 +107,10 @@ test_read_ibft_dhcp (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
g_object_unref (connection);
+ g_ptr_array_unref (block);
}
static void
@@ -116,11 +119,11 @@ test_read_ibft_static (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *mac_address;
const char *expected_mac_address = "00:33:21:98:b9:f0";
- NMIP4Address *ip4_addr;
+ NMIPAddress *ip4_addr;
GPtrArray *block;
block = read_block (TEST_IBFT_DIR "/iscsiadm-test-static", expected_mac_address);
@@ -151,18 +154,19 @@ test_read_ibft_static (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
- g_assert_cmpint (nm_setting_ip4_config_get_num_dns (s_ip4), ==, 2);
- g_assert_cmpstr (nm_setting_ip4_config_get_dns (s_ip4, 0), ==, "10.16.255.2");
- g_assert_cmpstr (nm_setting_ip4_config_get_dns (s_ip4, 1), ==, "10.16.255.3");
+ g_assert_cmpint (nm_setting_ip_config_get_num_dns (s_ip4), ==, 2);
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip4, 0), ==, "10.16.255.2");
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip4, 1), ==, "10.16.255.3");
- g_assert_cmpint (nm_setting_ip4_config_get_num_addresses (s_ip4), ==, 1);
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 1);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
g_assert (ip4_addr);
- nmtst_assert_ip4_address_equals (nm_ip4_address_get_address (ip4_addr), "192.168.32.72");
- g_assert_cmpint (nm_ip4_address_get_prefix (ip4_addr), ==, 22);
- nmtst_assert_ip4_address_equals (nm_ip4_address_get_gateway (ip4_addr), "192.168.35.254");
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "192.168.32.72");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 22);
+
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.35.254");
g_object_unref (connection);
g_ptr_array_unref (block);
@@ -217,10 +221,10 @@ test_read_ibft_vlan (void)
NMSettingConnection *s_con;
NMSettingWired *s_wired;
NMSettingVlan *s_vlan;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
const char *mac_address;
const char *expected_mac_address = "00:33:21:98:b9:f0";
- NMIP4Address *ip4_addr;
+ NMIPAddress *ip4_addr;
GError *error = NULL;
GPtrArray *block;
@@ -250,19 +254,20 @@ test_read_ibft_vlan (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
- g_assert_cmpint (nm_setting_ip4_config_get_num_dns (s_ip4), ==, 0);
+ g_assert_cmpint (nm_setting_ip_config_get_num_dns (s_ip4), ==, 0);
- g_assert_cmpint (nm_setting_ip4_config_get_num_addresses (s_ip4), ==, 1);
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 1);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
g_assert (ip4_addr);
- nmtst_assert_ip4_address_equals (nm_ip4_address_get_address (ip4_addr), "192.168.6.200");
- g_assert_cmpint (nm_ip4_address_get_prefix (ip4_addr), ==, 24);
- nmtst_assert_ip4_address_equals (nm_ip4_address_get_gateway (ip4_addr), "0.0.0.0");
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "192.168.6.200");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
+
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, NULL);
g_object_unref (connection);
- g_ptr_array_ref (block);
+ g_ptr_array_unref (block);
}
NMTST_DEFINE ();
diff --git a/src/settings/plugins/ifcfg-rh/common.h b/src/settings/plugins/ifcfg-rh/common.h
index d78f375250..0ec355ee4e 100644
--- a/src/settings/plugins/ifcfg-rh/common.h
+++ b/src/settings/plugins/ifcfg-rh/common.h
@@ -26,7 +26,9 @@
#define IFCFG_TAG "ifcfg-"
#define KEYS_TAG "keys-"
#define ROUTE_TAG "route-"
+#define RULE_TAG "rule-"
#define ROUTE6_TAG "route6-"
+#define RULE6_TAG "rule6-"
#define BAK_TAG ".bak"
#define TILDE_TAG "~"
@@ -39,7 +41,7 @@
#define IFCFG_DIR SYSCONFDIR"/sysconfig/network-scripts"
#define IFCFG_PLUGIN_NAME "ifcfg-rh"
-#define IFCFG_PLUGIN_INFO "(c) 2007 - 2013 Red Hat, Inc. To report bugs please use the NetworkManager mailing list."
+#define IFCFG_PLUGIN_INFO "(c) 2007 - 2015 Red Hat, Inc. To report bugs please use the NetworkManager mailing list."
#define TYPE_ETHERNET "Ethernet"
#define TYPE_WIRELESS "Wireless"
diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
index a10743d64b..9005a375f0 100644
--- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
+++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib/gstdio.h>
@@ -31,6 +33,8 @@
#include <nm-setting-pppoe.h>
#include <nm-setting-wireless-security.h>
#include <nm-setting-8021x.h>
+#include <nm-platform.h>
+#include <nm-logging.h>
#include "common.h"
#include "nm-config.h"
@@ -47,7 +51,6 @@ G_DEFINE_TYPE (NMIfcfgConnection, nm_ifcfg_connection, NM_TYPE_SETTINGS_CONNECTI
typedef struct {
gulong ih_event_id;
- char *path;
int file_wd;
char *keyfile;
@@ -61,6 +64,9 @@ typedef struct {
char *unmanaged_spec;
char *unrecognized_spec;
+
+ gulong devtimeout_link_changed_handler;
+ guint devtimeout_timeout_id;
} NMIfcfgConnectionPrivate;
enum {
@@ -78,6 +84,97 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
+static gboolean
+devtimeout_ready (gpointer user_data)
+{
+ NMIfcfgConnection *self = user_data;
+ NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (self);
+
+ priv->devtimeout_timeout_id = 0;
+ nm_settings_connection_set_ready (NM_SETTINGS_CONNECTION (self), TRUE);
+ return FALSE;
+}
+
+static void
+link_changed (NMPlatform *platform, int ifindex, NMPlatformLink *link,
+ NMPlatformSignalChangeType change_type, NMPlatformReason reason,
+ NMConnection *self)
+{
+ NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (self);
+ const char *ifname;
+
+ ifname = nm_connection_get_interface_name (self);
+ if (g_strcmp0 (link->name, ifname) != 0)
+ return;
+
+ /* Shouldn't happen, but... */
+ if (change_type == NM_PLATFORM_SIGNAL_REMOVED)
+ return;
+
+ nm_log_info (LOGD_SETTINGS, "Device %s appeared; connection '%s' now ready",
+ ifname, nm_connection_get_id (self));
+
+ g_signal_handler_disconnect (platform, priv->devtimeout_link_changed_handler);
+ priv->devtimeout_link_changed_handler = 0;
+ g_source_remove (priv->devtimeout_timeout_id);
+
+ /* Don't declare the connection ready right away, since NMManager may not have
+ * started processing the device yet.
+ */
+ priv->devtimeout_timeout_id = g_idle_add (devtimeout_ready, self);
+}
+
+static gboolean
+devtimeout_expired (gpointer user_data)
+{
+ NMIfcfgConnection *self = user_data;
+ NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (self);
+
+ nm_log_info (LOGD_SETTINGS, "Device for connection '%s' did not appear before timeout",
+ nm_connection_get_id (NM_CONNECTION (self)));
+
+ g_signal_handler_disconnect (nm_platform_get (), priv->devtimeout_link_changed_handler);
+ priv->devtimeout_link_changed_handler = 0;
+ priv->devtimeout_timeout_id = 0;
+
+ nm_settings_connection_set_ready (NM_SETTINGS_CONNECTION (self), TRUE);
+ return FALSE;
+}
+
+static void
+nm_ifcfg_connection_check_devtimeout (NMIfcfgConnection *self)
+{
+ NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (self);
+ NMSettingConnection *s_con;
+ const char *ifname;
+ guint devtimeout;
+
+ s_con = nm_connection_get_setting_connection (NM_CONNECTION (self));
+
+ if (!nm_setting_connection_get_autoconnect (s_con))
+ return;
+ ifname = nm_setting_connection_get_interface_name (s_con);
+ if (!ifname)
+ return;
+ devtimeout = devtimeout_from_file (nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (self)));
+ if (!devtimeout)
+ return;
+
+ if (nm_platform_link_get_ifindex (ifname) != 0)
+ return;
+
+ /* ONBOOT=yes, DEVICE and DEVTIMEOUT are set, but device is not present */
+ nm_settings_connection_set_ready (NM_SETTINGS_CONNECTION (self), FALSE);
+
+ nm_log_info (LOGD_SETTINGS, "Waiting %u seconds for %s to appear for connection '%s'",
+ devtimeout, ifname, nm_connection_get_id (NM_CONNECTION (self)));
+
+ priv->devtimeout_link_changed_handler =
+ g_signal_connect (nm_platform_get (), NM_PLATFORM_SIGNAL_LINK_CHANGED,
+ G_CALLBACK (link_changed), self);
+ priv->devtimeout_timeout_id = g_timeout_add_seconds (devtimeout, devtimeout_expired, self);
+}
+
static void
files_changed_cb (NMInotifyHelper *ih,
struct inotify_event *evt,
@@ -100,8 +197,7 @@ files_changed_cb (NMInotifyHelper *ih,
NMIfcfgConnection *
nm_ifcfg_connection_new (NMConnection *source,
const char *full_path,
- GError **error,
- gboolean *ignore_error)
+ GError **error)
{
GObject *object;
NMConnection *tmp;
@@ -115,18 +211,9 @@ nm_ifcfg_connection_new (NMConnection *source,
if (source)
tmp = g_object_ref (source);
else {
- char *keyfile = NULL, *routefile = NULL, *route6file = NULL;
-
- tmp = connection_from_file (full_path, NULL, NULL,
+ tmp = connection_from_file (full_path,
&unhandled_spec,
- &keyfile,
- &routefile,
- &route6file,
- error,
- ignore_error);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
+ error);
if (!tmp)
return NULL;
@@ -140,6 +227,7 @@ nm_ifcfg_connection_new (NMConnection *source,
unrecognized_spec = unhandled_spec + strlen ("unrecognized:");
object = (GObject *) g_object_new (NM_TYPE_IFCFG_CONNECTION,
+ NM_SETTINGS_CONNECTION_FILENAME, full_path,
NM_IFCFG_CONNECTION_UNMANAGED_SPEC, unmanaged_spec,
NM_IFCFG_CONNECTION_UNRECOGNIZED_SPEC, unrecognized_spec,
NULL);
@@ -147,11 +235,10 @@ nm_ifcfg_connection_new (NMConnection *source,
if (nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object),
tmp,
update_unsaved,
- error)) {
- /* Set the path and start monitoring */
- if (full_path)
- nm_ifcfg_connection_set_path (NM_IFCFG_CONNECTION (object), full_path);
- } else
+ NULL,
+ error))
+ nm_ifcfg_connection_check_devtimeout (NM_IFCFG_CONNECTION (object));
+ else
g_clear_object (&object);
g_object_unref (tmp);
@@ -159,14 +246,6 @@ nm_ifcfg_connection_new (NMConnection *source,
return (NMIfcfgConnection *) object;
}
-const char *
-nm_ifcfg_connection_get_path (NMIfcfgConnection *self)
-{
- g_return_val_if_fail (NM_IS_IFCFG_CONNECTION (self), NULL);
-
- return NM_IFCFG_CONNECTION_GET_PRIVATE (self)->path;
-}
-
static void
path_watch_stop (NMIfcfgConnection *self)
{
@@ -207,17 +286,21 @@ path_watch_stop (NMIfcfgConnection *self)
}
}
-void
-nm_ifcfg_connection_set_path (NMIfcfgConnection *self, const char *ifcfg_path)
+static void
+filename_changed (GObject *object,
+ GParamSpec *pspec,
+ gpointer user_data)
{
+ NMIfcfgConnection *self = NM_IFCFG_CONNECTION (object);
NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (self);
-
- g_return_if_fail (ifcfg_path != NULL);
+ const char *ifcfg_path;
path_watch_stop (self);
- g_free (priv->path);
- priv->path = g_strdup (ifcfg_path);
+ ifcfg_path = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (self));
+ if (!ifcfg_path)
+ return;
+
priv->keyfile = utils_get_keys_path (ifcfg_path);
priv->routefile = utils_get_route_path (ifcfg_path);
priv->route6file = utils_get_route6_path (ifcfg_path);
@@ -250,6 +333,28 @@ nm_ifcfg_connection_get_unrecognized_spec (NMIfcfgConnection *self)
}
static void
+replace_and_commit (NMSettingsConnection *connection,
+ NMConnection *new_connection,
+ NMSettingsConnectionCommitFunc callback,
+ gpointer user_data)
+{
+ const char *filename;
+ GError *error = NULL;
+
+ filename = nm_settings_connection_get_filename (connection);
+ if (filename && utils_has_complex_routes (filename)) {
+ if (callback) {
+ error = g_error_new_literal (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+ "Cannot modify a connection that has an associated 'rule-' or 'rule6-' file");
+ callback (connection, error, user_data);
+ g_clear_error (&error);
+ }
+ }
+
+ NM_SETTINGS_CONNECTION_CLASS (nm_ifcfg_connection_parent_class)->replace_and_commit (connection, new_connection, callback, user_data);
+}
+
+static void
commit_changes (NMSettingsConnection *connection,
NMSettingsConnectionCommitFunc callback,
gpointer user_data)
@@ -259,16 +364,15 @@ commit_changes (NMSettingsConnection *connection,
NMConnection *reread;
gboolean same = FALSE, success = FALSE;
char *ifcfg_path = NULL;
+ const char *filename;
/* To ensure we don't rewrite files that are only changed from other
* processes on-disk, read the existing connection back in and only rewrite
* it if it's really changed.
*/
- if (priv->path) {
- reread = connection_from_file (priv->path, NULL, NULL,
- NULL, NULL, NULL, NULL,
- &error, NULL);
- g_clear_error (&error);
+ filename = nm_settings_connection_get_filename (connection);
+ if (filename) {
+ reread = connection_from_file (filename, NULL, NULL);
if (reread) {
same = nm_connection_compare (NM_CONNECTION (connection),
reread,
@@ -286,7 +390,7 @@ commit_changes (NMSettingsConnection *connection,
success = writer_update_connection (NM_CONNECTION (connection),
IFCFG_DIR,
- priv->path,
+ filename,
priv->keyfile,
&error);
} else {
@@ -295,7 +399,7 @@ commit_changes (NMSettingsConnection *connection,
&ifcfg_path,
&error);
if (success) {
- nm_ifcfg_connection_set_path (NM_IFCFG_CONNECTION (connection), ifcfg_path);
+ nm_settings_connection_set_filename (connection, ifcfg_path);
g_free (ifcfg_path);
}
}
@@ -316,14 +420,15 @@ do_delete (NMSettingsConnection *connection,
gpointer user_data)
{
NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (connection);
+ const char *filename;
- if (priv->path) {
- g_unlink (priv->path);
+ filename = nm_settings_connection_get_filename (connection);
+ if (filename) {
+ g_unlink (filename);
if (priv->keyfile)
g_unlink (priv->keyfile);
if (priv->routefile)
g_unlink (priv->routefile);
-
if (priv->route6file)
g_unlink (priv->route6file);
}
@@ -336,6 +441,8 @@ do_delete (NMSettingsConnection *connection,
static void
nm_ifcfg_connection_init (NMIfcfgConnection *connection)
{
+ g_signal_connect (connection, "notify::" NM_SETTINGS_CONNECTION_FILENAME,
+ G_CALLBACK (filename_changed), NULL);
}
static void
@@ -379,17 +486,21 @@ get_property (GObject *object, guint prop_id,
static void
dispose (GObject *object)
{
- path_watch_stop (NM_IFCFG_CONNECTION (object));
+ NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (object);
- G_OBJECT_CLASS (nm_ifcfg_connection_parent_class)->dispose (object);
-}
+ path_watch_stop (NM_IFCFG_CONNECTION (object));
-static void
-finalize (GObject *object)
-{
- g_free (NM_IFCFG_CONNECTION_GET_PRIVATE (object)->path);
+ if (priv->devtimeout_link_changed_handler) {
+ g_signal_handler_disconnect (nm_platform_get (),
+ priv->devtimeout_link_changed_handler);
+ priv->devtimeout_link_changed_handler = 0;
+ }
+ if (priv->devtimeout_timeout_id) {
+ g_source_remove (priv->devtimeout_timeout_id);
+ priv->devtimeout_timeout_id = 0;
+ }
- G_OBJECT_CLASS (nm_ifcfg_connection_parent_class)->finalize (object);
+ G_OBJECT_CLASS (nm_ifcfg_connection_parent_class)->dispose (object);
}
static void
@@ -404,8 +515,8 @@ nm_ifcfg_connection_class_init (NMIfcfgConnectionClass *ifcfg_connection_class)
object_class->set_property = set_property;
object_class->get_property = get_property;
object_class->dispose = dispose;
- object_class->finalize = finalize;
settings_class->delete = do_delete;
+ settings_class->replace_and_commit = replace_and_commit;
settings_class->commit_changes = commit_changes;
/* Properties */
diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h
index 37eacaf0d3..328e58f5f2 100644
--- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h
+++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h
@@ -48,13 +48,7 @@ GType nm_ifcfg_connection_get_type (void);
NMIfcfgConnection *nm_ifcfg_connection_new (NMConnection *source,
const char *full_path,
- GError **error,
- gboolean *ignore_error);
-
-const char *nm_ifcfg_connection_get_path (NMIfcfgConnection *self);
-
-void nm_ifcfg_connection_set_path (NMIfcfgConnection *self,
- const char *ifcfg_path);
+ GError **error);
const char *nm_ifcfg_connection_get_unmanaged_spec (NMIfcfgConnection *self);
const char *nm_ifcfg_connection_get_unrecognized_spec (NMIfcfgConnection *self);
diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c
index 097ad0c902..b7efa8643a 100644
--- a/src/settings/plugins/ifcfg-rh/plugin.c
+++ b/src/settings/plugins/ifcfg-rh/plugin.c
@@ -21,7 +21,8 @@
* Copyright (C) 2007 - 2011 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <unistd.h>
#include <errno.h>
@@ -57,10 +58,31 @@
#include "reader.h"
#include "writer.h"
#include "utils.h"
+#include "gsystem-local-alloc.h"
#define DBUS_SERVICE_NAME "com.redhat.ifcfgrh1"
#define DBUS_OBJECT_PATH "/com/redhat/ifcfgrh1"
+
+#define _LOG_DEFAULT_DOMAIN LOGD_SETTINGS
+
+#define _LOG(level, domain, ...) \
+ G_STMT_START { \
+ nm_log ((level), (domain), \
+ "%s" _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
+ "ifcfg-rh: " \
+ _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
+ } G_STMT_END
+
+#define _LOGT(...) _LOG (LOGL_TRACE, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+#define _LOGD(...) _LOG (LOGL_DEBUG, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+#define _LOGI(...) _LOG (LOGL_INFO, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+#define _LOGW(...) _LOG (LOGL_WARN, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+#define _LOGE(...) _LOG (LOGL_ERR, _LOG_DEFAULT_DOMAIN, __VA_ARGS__)
+
+#define ERR_GET_MSG(err) (((err) && (err)->message) ? (err)->message : "(unknown)")
+
+
static gboolean impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin,
const char *in_ifcfg,
const char **out_uuid,
@@ -69,10 +91,13 @@ static gboolean impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin,
#include "nm-ifcfg-rh-glue.h"
-static void connection_new_or_changed (SCPluginIfcfg *plugin,
- const char *path,
- NMIfcfgConnection *existing,
- char **out_old_path);
+static NMIfcfgConnection *update_connection (SCPluginIfcfg *plugin,
+ NMConnection *source,
+ const char *full_path,
+ NMIfcfgConnection *connection,
+ gboolean protect_existing_connection,
+ GHashTable *protected_connections,
+ GError **error);
static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class);
@@ -103,13 +128,22 @@ typedef struct {
static void
connection_ifcfg_changed (NMIfcfgConnection *connection, gpointer user_data)
{
- SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (user_data);
+ SCPluginIfcfg *self = SC_PLUGIN_IFCFG (user_data);
+ SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self);
const char *path;
- path = nm_ifcfg_connection_get_path (connection);
+ path = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection));
g_return_if_fail (path != NULL);
- connection_new_or_changed (plugin, path, connection, NULL);
+
+ if (!priv->ifcfg_monitor) {
+ _LOGD ("connection_ifcfg_changed("NM_IFCFG_CONNECTION_LOG_FMTD"): %s", NM_IFCFG_CONNECTION_LOG_ARGD (connection), "ignore event");
+ return;
+ }
+
+ _LOGD ("connection_ifcfg_changed("NM_IFCFG_CONNECTION_LOG_FMTD"): %s", NM_IFCFG_CONNECTION_LOG_ARGD (connection), "reload");
+
+ update_connection (self, NULL, path, connection, TRUE, NULL, NULL);
}
static void
@@ -119,69 +153,6 @@ connection_removed_cb (NMSettingsConnection *obj, gpointer user_data)
nm_connection_get_uuid (NM_CONNECTION (obj)));
}
-static NMIfcfgConnection *
-_internal_new_connection (SCPluginIfcfg *self,
- const char *path,
- NMConnection *source,
- GError **error)
-{
- SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self);
- NMIfcfgConnection *connection;
- const char *cid;
- GError *local = NULL;
- gboolean ignore_error = FALSE;
-
- if (!source)
- nm_log_info (LOGD_SETTINGS, "parsing %s ... ", path);
-
- connection = nm_ifcfg_connection_new (source, path, &local, &ignore_error);
- if (!connection) {
- if (!ignore_error)
- nm_log_warn (LOGD_SETTINGS, " %s", (local && local->message) ? local->message : "(unknown)");
- if (local)
- g_propagate_error (error, local);
- else
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "(unknown)");
- return NULL;
- }
-
- cid = nm_connection_get_id (NM_CONNECTION (connection));
- g_assert (cid);
-
- g_hash_table_insert (priv->connections,
- g_strdup (nm_connection_get_uuid (NM_CONNECTION (connection))),
- connection);
- nm_log_info (LOGD_SETTINGS, " read connection '%s'", cid);
- g_signal_connect (connection, NM_SETTINGS_CONNECTION_REMOVED,
- G_CALLBACK (connection_removed_cb),
- self);
-
- if (nm_ifcfg_connection_get_unmanaged_spec (connection)) {
- const char *spec;
- const char *device_id;
-
- spec = nm_ifcfg_connection_get_unmanaged_spec (connection);
- device_id = strchr (spec, ':');
- if (device_id)
- device_id++;
- else
- device_id = spec;
- nm_log_warn (LOGD_SETTINGS, " Ignoring connection '%s' / device '%s' due to NM_CONTROLLED=no.",
- cid, device_id);
- } else if (nm_ifcfg_connection_get_unrecognized_spec (connection)) {
- nm_log_warn (LOGD_SETTINGS, " Ignoring connection '%s' of unrecognized type.", cid);
- }
-
- /* watch changes of ifcfg hardlinks */
- g_signal_connect (G_OBJECT (connection), "ifcfg-changed",
- G_CALLBACK (connection_ifcfg_changed), self);
-
- return connection;
-}
-
-/* Monitoring */
-
static void
remove_connection (SCPluginIfcfg *self, NMIfcfgConnection *connection)
{
@@ -191,6 +162,8 @@ remove_connection (SCPluginIfcfg *self, NMIfcfgConnection *connection)
g_return_if_fail (self != NULL);
g_return_if_fail (connection != NULL);
+ _LOGI ("remove "NM_IFCFG_CONNECTION_LOG_FMT, NM_IFCFG_CONNECTION_LOG_ARG (connection));
+
unmanaged = !!nm_ifcfg_connection_get_unmanaged_spec (connection);
unrecognized = !!nm_ifcfg_connection_get_unrecognized_spec (connection);
@@ -211,160 +184,233 @@ find_by_path (SCPluginIfcfg *self, const char *path)
{
SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self);
GHashTableIter iter;
- NMIfcfgConnection *candidate = NULL;
+ NMSettingsConnection *candidate = NULL;
g_return_val_if_fail (path != NULL, NULL);
g_hash_table_iter_init (&iter, priv->connections);
while (g_hash_table_iter_next (&iter, NULL, (gpointer) &candidate)) {
- if (g_strcmp0 (path, nm_ifcfg_connection_get_path (candidate)) == 0)
- return candidate;
+ if (g_strcmp0 (path, nm_settings_connection_get_filename (candidate)) == 0)
+ return NM_IFCFG_CONNECTION (candidate);
}
return NULL;
}
static NMIfcfgConnection *
-find_by_uuid_from_path (SCPluginIfcfg *self, const char *path)
+update_connection (SCPluginIfcfg *self,
+ NMConnection *source,
+ const char *full_path,
+ NMIfcfgConnection *connection,
+ gboolean protect_existing_connection,
+ GHashTable *protected_connections,
+ GError **error)
{
SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self);
- char *uuid;
-
- g_return_val_if_fail (path != NULL, NULL);
+ NMIfcfgConnection *connection_new;
+ NMIfcfgConnection *connection_by_uuid;
+ GError *local = NULL;
+ const char *new_unmanaged = NULL, *old_unmanaged = NULL;
+ const char *new_unrecognized = NULL, *old_unrecognized = NULL;
+ gboolean unmanaged_changed = FALSE, unrecognized_changed = FALSE;
+ const char *uuid;
- uuid = uuid_from_file (path);
- if (uuid)
- return g_hash_table_lookup (priv->connections, uuid);
- else
+ g_return_val_if_fail (!source || NM_IS_CONNECTION (source), NULL);
+ g_return_val_if_fail (full_path || source, NULL);
+
+ if (full_path)
+ _LOGD ("loading from file \"%s\"...", full_path);
+
+ /* Create a NMIfcfgConnection instance, either by reading from @full_path or
+ * based on @source. */
+ connection_new = nm_ifcfg_connection_new (source, full_path, error);
+ if (!connection_new) {
+ /* Unexpected failure. Probably the file is invalid? */
+ if ( connection
+ && !protect_existing_connection
+ && (!protected_connections || !g_hash_table_contains (protected_connections, connection)))
+ remove_connection (self, connection);
return NULL;
-}
+ }
-static void
-connection_new_or_changed (SCPluginIfcfg *self,
- const char *path,
- NMIfcfgConnection *existing,
- char **out_old_path)
-{
- SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self);
- NMIfcfgConnection *new;
- GError *error = NULL;
- gboolean ignore_error = FALSE;
- const char *new_unmanaged = NULL, *old_unmanaged = NULL;
- const char *new_unrecognized = NULL, *old_unrecognized = NULL;
- gboolean unmanaged_changed, unrecognized_changed;
+ uuid = nm_connection_get_uuid (NM_CONNECTION (connection_new));
+ connection_by_uuid = g_hash_table_lookup (priv->connections, uuid);
- g_return_if_fail (self != NULL);
- g_return_if_fail (path != NULL);
+ if ( connection
+ && connection != connection_by_uuid) {
- if (out_old_path)
- *out_old_path = NULL;
-
- if (!existing) {
- /* See if it's a rename */
- existing = find_by_uuid_from_path (self, path);
- if (existing) {
- const char *old_path = nm_ifcfg_connection_get_path (existing);
- nm_log_info (LOGD_SETTINGS, "renaming %s -> %s", old_path, path);
- if (out_old_path)
- *out_old_path = g_strdup (old_path);
- nm_ifcfg_connection_set_path (existing, path);
- }
- }
+ if ( (protect_existing_connection && connection_by_uuid != NULL)
+ || (protected_connections && g_hash_table_contains (protected_connections, connection))) {
+ NMIfcfgConnection *conflicting = (protect_existing_connection && connection_by_uuid != NULL) ? connection_by_uuid : connection;
- if (!existing) {
- /* New connection */
- new = _internal_new_connection (self, path, NULL, NULL);
- if (new) {
- if (nm_ifcfg_connection_get_unmanaged_spec (new))
- g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED);
- else if (nm_ifcfg_connection_get_unrecognized_spec (new))
- g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNRECOGNIZED_SPECS_CHANGED);
+ if (source)
+ _LOGW ("cannot update protected connection "NM_IFCFG_CONNECTION_LOG_FMT" due to conflicting UUID %s", NM_IFCFG_CONNECTION_LOG_ARG (conflicting), uuid);
else
- g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, new);
+ _LOGW ("cannot load %s due to conflicting UUID for "NM_IFCFG_CONNECTION_LOG_FMT, full_path, NM_IFCFG_CONNECTION_LOG_ARG (conflicting));
+ g_object_unref (connection_new);
+ g_set_error_literal (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+ "Cannot update protected connection due to conflicting UUID");
+ return NULL;
}
- return;
- }
- new = (NMIfcfgConnection *) nm_ifcfg_connection_new (NULL, path, &error, &ignore_error);
- if (!new) {
- /* errors reading connection; remove it */
- if (!ignore_error)
- nm_log_warn (LOGD_SETTINGS, " %s", (error && error->message) ? error->message : "(unknown)");
- g_clear_error (&error);
-
- nm_log_info (LOGD_SETTINGS, "removed %s.", path);
- remove_connection (self, existing);
- return;
+ /* The new connection has a different UUID then the original one that we
+ * are about to update. Remove @connection. */
+ remove_connection (self, connection);
}
- /* Successfully read connection changes */
+ /* Check if the found connection with the same UUID is not protected from updating. */
+ if ( connection_by_uuid
+ && ( (!connection && protect_existing_connection)
+ || (protected_connections && g_hash_table_contains (protected_connections, connection_by_uuid)))) {
+ if (source)
+ _LOGW ("cannot update connection due to conflicting UUID for "NM_IFCFG_CONNECTION_LOG_FMT, NM_IFCFG_CONNECTION_LOG_ARG (connection_by_uuid));
+ else
+ _LOGW ("cannot load %s due to conflicting UUID for "NM_IFCFG_CONNECTION_LOG_FMT, full_path, NM_IFCFG_CONNECTION_LOG_ARG (connection_by_uuid));
+ g_object_unref (connection_new);
+ g_set_error_literal (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+ "Skip updating protected connection during reload");
+ return NULL;
+ }
- old_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (existing));
- new_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (new));
+ /* Evaluate unmanaged/unrecognized flags. */
+ if (connection_by_uuid)
+ old_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (connection_by_uuid);
+ new_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (connection_new);
unmanaged_changed = g_strcmp0 (old_unmanaged, new_unmanaged);
- old_unrecognized = nm_ifcfg_connection_get_unrecognized_spec (NM_IFCFG_CONNECTION (existing));
- new_unrecognized = nm_ifcfg_connection_get_unrecognized_spec (NM_IFCFG_CONNECTION (new));
+ if (connection_by_uuid)
+ old_unrecognized = nm_ifcfg_connection_get_unrecognized_spec (connection_by_uuid);
+ new_unrecognized = nm_ifcfg_connection_get_unrecognized_spec (connection_new);
unrecognized_changed = g_strcmp0 (old_unrecognized, new_unrecognized);
- if ( !unmanaged_changed
- && !unrecognized_changed
- && nm_connection_compare (NM_CONNECTION (existing),
- NM_CONNECTION (new),
- NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS |
- NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS)) {
- g_object_unref (new);
- return;
- }
+ if (connection_by_uuid) {
+ const char *old_path;
+
+ old_path = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection_by_uuid));
+
+ if ( !unmanaged_changed
+ && !unrecognized_changed
+ && nm_connection_compare (NM_CONNECTION (connection_by_uuid),
+ NM_CONNECTION (connection_new),
+ NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS |
+ NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS)) {
+ if (old_path && g_strcmp0 (old_path, full_path) != 0)
+ _LOGI ("rename \"%s\" to "NM_IFCFG_CONNECTION_LOG_FMT" without other changes", nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection_by_uuid)), NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+ } else {
+
+ /*******************************************************
+ * UPDATE
+ *******************************************************/
+
+ if (source)
+ _LOGI ("update "NM_IFCFG_CONNECTION_LOG_FMT" from %s", NM_IFCFG_CONNECTION_LOG_ARG (connection_new), NM_IFCFG_CONNECTION_LOG_PATH (old_path));
+ else if (!g_strcmp0 (old_path, nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection_new))))
+ _LOGI ("update "NM_IFCFG_CONNECTION_LOG_FMT, NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+ else if (old_path)
+ _LOGI ("rename \"%s\" to "NM_IFCFG_CONNECTION_LOG_FMT, old_path, NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+ else
+ _LOGI ("update and persist "NM_IFCFG_CONNECTION_LOG_FMT, NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+
+ g_object_set (connection_by_uuid,
+ NM_IFCFG_CONNECTION_UNMANAGED_SPEC, new_unmanaged,
+ NM_IFCFG_CONNECTION_UNRECOGNIZED_SPEC, new_unrecognized,
+ NULL);
+
+ if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (connection_by_uuid),
+ NM_CONNECTION (connection_new),
+ FALSE, /* don't set Unsaved */
+ "ifcfg-update",
+ &local)) {
+ /* Shouldn't ever get here as 'connection_new' was verified by the reader already
+ * and the UUID did not change. */
+ g_assert_not_reached ();
+ }
+ g_assert_no_error (local);
+
+ if (new_unmanaged || new_unrecognized) {
+ if (!old_unmanaged && !old_unrecognized) {
+ g_object_ref (connection_by_uuid);
+ /* Unexport the connection by telling the settings service it's
+ * been removed.
+ */
+ nm_settings_connection_signal_remove (NM_SETTINGS_CONNECTION (connection_by_uuid));
+ /* Remove the path so that claim_connection() doesn't complain later when
+ * interface gets managed and connection is re-added. */
+ nm_connection_set_path (NM_CONNECTION (connection_by_uuid), NULL);
+
+ /* signal_remove() will end up removing the connection from our hash,
+ * so add it back now.
+ */
+ g_hash_table_insert (priv->connections,
+ g_strdup (nm_connection_get_uuid (NM_CONNECTION (connection_by_uuid))),
+ connection_by_uuid);
+ }
+ } else {
+ if (old_unmanaged /* && !new_unmanaged */) {
+ _LOGI ("Managing connection "NM_IFCFG_CONNECTION_LOG_FMT" and its device because NM_CONTROLLED was true.",
+ NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+ g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection_by_uuid);
+ } else if (old_unrecognized /* && !new_unrecognized */) {
+ _LOGI ("Managing connection "NM_IFCFG_CONNECTION_LOG_FMT" because it is now a recognized type.",
+ NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+ g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection_by_uuid);
+ }
+ }
- nm_log_info (LOGD_SETTINGS, "updating %s", path);
- g_object_set (existing,
- NM_IFCFG_CONNECTION_UNMANAGED_SPEC, new_unmanaged,
- NM_IFCFG_CONNECTION_UNRECOGNIZED_SPEC, new_unrecognized,
- NULL);
-
- if (new_unmanaged || new_unrecognized) {
- if (!old_unmanaged && !old_unrecognized) {
- g_object_ref (existing);
- /* Unexport the connection by telling the settings service it's
- * been removed.
- */
- nm_settings_connection_signal_remove (NM_SETTINGS_CONNECTION (existing));
- /* Remove the path so that claim_connection() doesn't complain later when
- * interface gets managed and connection is re-added. */
- nm_connection_set_path (NM_CONNECTION (existing), NULL);
-
- /* signal_remove() will end up removing the connection from our hash,
- * so add it back now.
- */
- g_hash_table_insert (priv->connections,
- g_strdup (nm_connection_get_uuid (NM_CONNECTION (existing))),
- existing);
+ if (unmanaged_changed)
+ g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED);
+ if (unrecognized_changed)
+ g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNRECOGNIZED_SPECS_CHANGED);
}
+ nm_settings_connection_set_filename (NM_SETTINGS_CONNECTION (connection_by_uuid), full_path);
+ g_object_unref (connection_new);
+ return connection_by_uuid;
} else {
- const char *cid = nm_connection_get_id (NM_CONNECTION (new));
-
- if (old_unmanaged /* && !new_unmanaged */) {
- nm_log_info (LOGD_SETTINGS, "Managing connection '%s' and its device because NM_CONTROLLED was true.", cid);
- g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, existing);
- } else if (old_unrecognized /* && !new_unrecognized */) {
- nm_log_info (LOGD_SETTINGS, "Managing connection '%s' because it is now a recognized type.", cid);
- g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, existing);
- }
- if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (existing),
- NM_CONNECTION (new),
- FALSE, /* don't set Unsaved */
- &error)) {
- /* Shouldn't ever get here as 'new' was verified by the reader already */
- g_assert_no_error (error);
+ /*******************************************************
+ * ADD
+ *******************************************************/
+
+ if (source)
+ _LOGI ("add connection "NM_IFCFG_CONNECTION_LOG_FMT, NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+ else
+ _LOGI ("new connection "NM_IFCFG_CONNECTION_LOG_FMT, NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+ g_hash_table_insert (priv->connections, g_strdup (uuid), connection_new);
+
+ g_signal_connect (connection_new, NM_SETTINGS_CONNECTION_REMOVED,
+ G_CALLBACK (connection_removed_cb),
+ self);
+
+ if (nm_ifcfg_connection_get_unmanaged_spec (connection_new)) {
+ const char *spec;
+ const char *device_id;
+
+ spec = nm_ifcfg_connection_get_unmanaged_spec (connection_new);
+ device_id = strchr (spec, ':');
+ if (device_id)
+ device_id++;
+ else
+ device_id = spec;
+ _LOGW ("Ignoring connection "NM_IFCFG_CONNECTION_LOG_FMT" / device '%s' due to NM_CONTROLLED=no.",
+ NM_IFCFG_CONNECTION_LOG_ARG (connection_new), device_id);
+ } else if (nm_ifcfg_connection_get_unrecognized_spec (connection_new))
+ _LOGW ("Ignoring connection "NM_IFCFG_CONNECTION_LOG_FMT" of unrecognized type.", NM_IFCFG_CONNECTION_LOG_ARG (connection_new));
+
+ /* watch changes of ifcfg hardlinks */
+ g_signal_connect (G_OBJECT (connection_new), "ifcfg-changed",
+ G_CALLBACK (connection_ifcfg_changed), self);
+
+ if (!source) {
+ /* Only raise the signal if we were called without source, i.e. if we read the connection from file.
+ * Otherwise, we were called by add_connection() which does not expect the signal. */
+ if (nm_ifcfg_connection_get_unmanaged_spec (connection_new))
+ g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED);
+ else if (nm_ifcfg_connection_get_unrecognized_spec (connection_new))
+ g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNRECOGNIZED_SPECS_CHANGED);
+ else
+ g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection_new);
}
+ return connection_new;
}
- g_object_unref (new);
-
- if (unmanaged_changed)
- g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED);
- if (unrecognized_changed)
- g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNRECOGNIZED_SPECS_CHANGED);
}
static void
@@ -384,6 +430,8 @@ ifcfg_dir_changed (GFileMonitor *monitor,
return;
}
+ _LOGD ("ifcfg_dir_changed(%s) = %d", path, event_type);
+
base = g_file_get_basename (file);
if (utils_is_ifcfg_alias_file (base, NULL)) {
/* Alias file changed. Get the base ifcfg file from it */
@@ -396,14 +444,13 @@ ifcfg_dir_changed (GFileMonitor *monitor,
connection = find_by_path (plugin, ifcfg_path);
switch (event_type) {
case G_FILE_MONITOR_EVENT_DELETED:
- nm_log_info (LOGD_SETTINGS, "removed %s.", ifcfg_path);
if (connection)
remove_connection (plugin, connection);
break;
case G_FILE_MONITOR_EVENT_CREATED:
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
/* Update or new */
- connection_new_or_changed (plugin, ifcfg_path, connection, NULL);
+ update_connection (plugin, NULL, ifcfg_path, connection, TRUE, NULL, NULL);
break;
default:
break;
@@ -432,6 +479,43 @@ setup_ifcfg_monitoring (SCPluginIfcfg *plugin)
}
}
+static GHashTable *
+_paths_from_connections (GHashTable *connections)
+{
+ GHashTableIter iter;
+ NMIfcfgConnection *connection;
+ GHashTable *paths = g_hash_table_new (g_str_hash, g_str_equal);
+
+ g_hash_table_iter_init (&iter, connections);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &connection)) {
+ const char *path = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection));
+
+ if (path)
+ g_hash_table_add (paths, (void *) path);
+ }
+ return paths;
+}
+
+static int
+_sort_paths (const char **f1, const char **f2, GHashTable *paths)
+{
+ struct stat st;
+ gboolean c1, c2;
+ gint64 m1, m2;
+
+ c1 = !!g_hash_table_contains (paths, *f1);
+ c2 = !!g_hash_table_contains (paths, *f2);
+ if (c1 != c2)
+ return c1 ? -1 : 1;
+
+ m1 = stat (*f1, &st) == 0 ? (gint64) st.st_mtime : G_MININT64;
+ m2 = stat (*f2, &st) == 0 ? (gint64) st.st_mtime : G_MININT64;
+ if (m1 != m2)
+ return m1 > m2 ? -1 : 1;
+
+ return strcmp (*f1, *f2);
+}
+
static void
read_connections (SCPluginIfcfg *plugin)
{
@@ -439,28 +523,26 @@ read_connections (SCPluginIfcfg *plugin)
GDir *dir;
GError *err = NULL;
const char *item;
- GHashTable *oldconns;
+ GHashTable *alive_connections;
GHashTableIter iter;
- gpointer key, value;
NMIfcfgConnection *connection;
+ GPtrArray *dead_connections = NULL;
+ guint i;
+ GPtrArray *filenames;
+ GHashTable *paths;
dir = g_dir_open (IFCFG_DIR, 0, &err);
if (!dir) {
- nm_log_warn (LOGD_SETTINGS, "Could not read directory '%s': %s", IFCFG_DIR, err->message);
+ _LOGW ("Could not read directory '%s': %s", IFCFG_DIR, err->message);
g_error_free (err);
return;
}
- oldconns = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- g_hash_table_iter_init (&iter, priv->connections);
- while (g_hash_table_iter_next (&iter, NULL, &value)) {
- const char *ifcfg_path = nm_ifcfg_connection_get_path (value);
- if (ifcfg_path)
- g_hash_table_insert (oldconns, g_strdup (ifcfg_path), value);
- }
+ alive_connections = g_hash_table_new (NULL, NULL);
+ filenames = g_ptr_array_new_with_free_func (g_free);
while ((item = g_dir_read_name (dir))) {
- char *full_path, *old_path;
+ char *full_path;
if (utils_should_ignore_file (item, TRUE))
continue;
@@ -469,31 +551,45 @@ read_connections (SCPluginIfcfg *plugin)
full_path = g_build_filename (IFCFG_DIR, item, NULL);
if (!utils_get_ifcfg_name (full_path, TRUE))
- goto next;
+ g_free (full_path);
+ else
+ g_ptr_array_add (filenames, full_path);
+ }
+ g_dir_close (dir);
- connection = g_hash_table_lookup (oldconns, full_path);
- g_hash_table_remove (oldconns, full_path);
- connection_new_or_changed (plugin, full_path, connection, &old_path);
+ /* While reloading, we don't replace connections that we already loaded while
+ * iterating over the files.
+ *
+ * To have sensible, reproducible behavior, sort the paths by last modification
+ * time prefering older files.
+ */
+ paths = _paths_from_connections (priv->connections);
+ g_ptr_array_sort_with_data (filenames, (GCompareDataFunc) _sort_paths, paths);
+ g_hash_table_destroy (paths);
+
+ for (i = 0; i < filenames->len; i++) {
+ connection = update_connection (plugin, NULL, filenames->pdata[i], NULL, FALSE, alive_connections, NULL);
+ if (connection)
+ g_hash_table_add (alive_connections, connection);
+ }
+ g_ptr_array_free (filenames, TRUE);
- if (old_path) {
- g_hash_table_remove (oldconns, old_path);
- g_free (old_path);
+ g_hash_table_iter_init (&iter, priv->connections);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &connection)) {
+ if ( !g_hash_table_contains (alive_connections, connection)
+ && nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection))) {
+ if (!dead_connections)
+ dead_connections = g_ptr_array_new ();
+ g_ptr_array_add (dead_connections, connection);
}
-
- next:
- g_free (full_path);
}
+ g_hash_table_destroy (alive_connections);
- g_dir_close (dir);
-
- g_hash_table_iter_init (&iter, oldconns);
- while (g_hash_table_iter_next (&iter, &key, &value)) {
- nm_log_info (LOGD_SETTINGS, "removed %s.", (char *)key);
- g_hash_table_iter_remove (&iter);
- remove_connection (plugin, value);
+ if (dead_connections) {
+ for (i = 0; i < dead_connections->len; i++)
+ remove_connection (plugin, dead_connections->pdata[i]);
+ g_ptr_array_free (dead_connections, TRUE);
}
-
- g_hash_table_destroy (oldconns);
}
static GSList *
@@ -539,7 +635,7 @@ load_connection (NMSystemConfigInterface *config,
return FALSE;
connection = find_by_path (plugin, filename);
- connection_new_or_changed (plugin, filename, connection, NULL);
+ update_connection (plugin, NULL, filename, connection, TRUE, NULL, NULL);
if (!connection)
connection = find_by_path (plugin, filename);
@@ -604,8 +700,7 @@ add_connection (NMSystemConfigInterface *config,
GError **error)
{
SCPluginIfcfg *self = SC_PLUGIN_IFCFG (config);
- NMIfcfgConnection *added = NULL;
- char *path = NULL;
+ gs_free char *path = NULL;
/* Ensure we reject attempts to add the connection long before we're
* asked to write it to disk.
@@ -617,10 +712,7 @@ add_connection (NMSystemConfigInterface *config,
if (!writer_new_connection (connection, IFCFG_DIR, &path, error))
return NULL;
}
-
- added = _internal_new_connection (self, path, connection, error);
- g_free (path);
- return (NMSettingsConnection *) added;
+ return NM_SETTINGS_CONNECTION (update_connection (self, connection, path, NULL, FALSE, NULL, error));
}
#define SC_NETWORK_FILE "/etc/sysconfig/network"
@@ -640,7 +732,7 @@ plugin_get_hostname (SCPluginIfcfg *plugin)
network = svOpenFile (SC_NETWORK_FILE, NULL);
if (!network) {
- nm_log_warn (LOGD_SETTINGS, "Could not get hostname: failed to read " SC_NETWORK_FILE);
+ _LOGW ("Could not get hostname: failed to read " SC_NETWORK_FILE);
return NULL;
}
@@ -670,10 +762,12 @@ plugin_set_hostname (SCPluginIfcfg *plugin, const char *hostname)
#if HAVE_SELINUX
security_context_t se_ctx_prev = NULL, se_ctx = NULL;
struct stat file_stat = { .st_mode = 0 };
+ mode_t st_mode = 0;
/* Get default context for HOSTNAME_FILE and set it for fscreate */
- stat (HOSTNAME_FILE, &file_stat);
- matchpathcon (HOSTNAME_FILE, file_stat.st_mode, &se_ctx);
+ if (stat (HOSTNAME_FILE, &file_stat) == 0)
+ st_mode = file_stat.st_mode;
+ matchpathcon (HOSTNAME_FILE, st_mode, &se_ctx);
matchpathcon_fini ();
getfscreatecon (&se_ctx_prev);
setfscreatecon (se_ctx);
@@ -690,7 +784,7 @@ plugin_set_hostname (SCPluginIfcfg *plugin, const char *hostname)
#endif
if (!ret) {
- nm_log_warn (LOGD_SETTINGS, "Could not save hostname: failed to create/open " HOSTNAME_FILE);
+ _LOGW ("Could not save hostname: failed to create/open " HOSTNAME_FILE);
g_free (hostname_eol);
return FALSE;
}
@@ -859,7 +953,7 @@ sc_plugin_ifcfg_init (SCPluginIfcfg *plugin)
priv->bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (!priv->bus) {
- nm_log_warn (LOGD_SETTINGS, "Couldn't connect to D-Bus: %s", error->message);
+ _LOGW ("Couldn't connect to D-Bus: %s", error->message);
g_clear_error (&error);
} else {
DBusConnection *tmp;
@@ -880,10 +974,10 @@ sc_plugin_ifcfg_init (SCPluginIfcfg *plugin)
G_TYPE_INVALID,
G_TYPE_UINT, &result,
G_TYPE_INVALID)) {
- nm_log_warn (LOGD_SETTINGS, "Couldn't acquire D-Bus service: %s", error->message);
+ _LOGW ("Couldn't acquire D-Bus service: %s", error->message);
g_clear_error (&error);
} else if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
- nm_log_warn (LOGD_SETTINGS, "Couldn't acquire ifcfgrh1 D-Bus service (already taken)");
+ _LOGW ("Couldn't acquire ifcfgrh1 D-Bus service (already taken)");
} else
success = TRUE;
}
@@ -1045,7 +1139,7 @@ nm_system_config_factory (void)
dbus_g_connection_register_g_object (priv->bus,
DBUS_OBJECT_PATH,
G_OBJECT (singleton));
- nm_log_info (LOGD_SETTINGS, "Acquired D-Bus service %s", DBUS_SERVICE_NAME);
+ _LOGI ("Acquired D-Bus service %s", DBUS_SERVICE_NAME);
} else
g_object_ref (singleton);
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 6994f6af93..febbd90ac6 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -15,10 +15,11 @@
* 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.
+ * Copyright 2008 - 2015 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@ -49,13 +50,12 @@
#include <nm-setting-dcb.h>
#include <nm-setting-generic.h>
#include "nm-core-internal.h"
-#include "nm-utils-private.h"
#include <nm-utils.h>
#include "nm-platform.h"
-#include "nm-posix-signals.h"
#include "NetworkManagerUtils.h"
#include "nm-logging.h"
+#include "gsystem-local-alloc.h"
#include "common.h"
#include "shvar.h"
@@ -148,7 +148,7 @@ make_connection_setting (const char *file,
uuid = svGetValue (ifcfg, "UUID", FALSE);
if (!uuid || !strlen (uuid)) {
g_free (uuid);
- uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName);
+ uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
}
g_object_set (s_con,
@@ -255,58 +255,31 @@ make_connection_setting (const char *file,
static gboolean
read_ip4_address (shvarFile *ifcfg,
const char *tag,
- guint32 *out_addr,
+ char **out_addr,
GError **error)
{
char *value = NULL;
- guint32 ip4_addr;
- gboolean success = FALSE;
g_return_val_if_fail (ifcfg != NULL, FALSE);
g_return_val_if_fail (tag != NULL, FALSE);
g_return_val_if_fail (out_addr != NULL, FALSE);
- if (error)
- g_return_val_if_fail (*error == NULL, FALSE);
+ g_return_val_if_fail (!error || !*error, FALSE);
- *out_addr = 0;
+ *out_addr = NULL;
value = svGetValue (ifcfg, tag, FALSE);
if (!value)
return TRUE;
- if (inet_pton (AF_INET, value, &ip4_addr) > 0) {
- *out_addr = ip4_addr;
- success = TRUE;
+ if (nm_utils_ipaddr_valid (AF_INET, value)) {
+ *out_addr = value;
+ return TRUE;
} else {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid %s IP4 address '%s'", tag, value);
- }
- g_free (value);
- return success;
-}
-
-/* Returns TRUE on valid address, including unspecified (::) */
-static gboolean
-parse_ip6_address (const char *value,
- struct in6_addr *out_addr,
- GError **error)
-{
- struct in6_addr ip6_addr;
-
- g_return_val_if_fail (value != NULL, FALSE);
- g_return_val_if_fail (out_addr != NULL, FALSE);
- if (error)
- g_return_val_if_fail (*error == NULL, FALSE);
-
- *out_addr = in6addr_any;
- if (inet_pton (AF_INET6, value, &ip6_addr) <= 0) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Invalid IP6 address '%s'", value);
+ g_free (value);
return FALSE;
}
-
- *out_addr = ip6_addr;
- return TRUE;
}
static char *
@@ -318,9 +291,11 @@ get_numbered_tag (char *tag_name, int which)
}
static gboolean
-is_any_ip4_address_defined (shvarFile *ifcfg)
+is_any_ip4_address_defined (shvarFile *ifcfg, int *idx)
{
- int i;
+ int i, ignore, *ret_idx;;
+
+ ret_idx = idx ? idx : &ignore;
for (i = -1; i <= 2; i++) {
char *tag;
@@ -331,6 +306,7 @@ is_any_ip4_address_defined (shvarFile *ifcfg)
g_free (tag);
if (value) {
g_free (value);
+ *ret_idx = i;
return TRUE;
}
@@ -339,6 +315,7 @@ is_any_ip4_address_defined (shvarFile *ifcfg)
g_free(tag);
if (value) {
g_free (value);
+ *ret_idx = i;
return TRUE;
}
@@ -347,6 +324,7 @@ is_any_ip4_address_defined (shvarFile *ifcfg)
g_free(tag);
if (value) {
g_free (value);
+ *ret_idx = i;
return TRUE;
}
}
@@ -358,21 +336,24 @@ static gboolean
read_full_ip4_address (shvarFile *ifcfg,
const char *network_file,
gint32 which,
- NMIP4Address *addr,
+ NMIPAddress *base_addr,
+ NMIPAddress **out_address,
+ char **out_gateway,
GError **error)
{
char *ip_tag, *prefix_tag, *netmask_tag, *gw_tag;
- guint32 tmp;
+ char *ip = NULL;
+ long prefix = 0;
gboolean success = FALSE;
- shvarFile *network_ifcfg;
char *value;
+ guint32 tmp;
g_return_val_if_fail (which >= -1, FALSE);
g_return_val_if_fail (ifcfg != NULL, FALSE);
g_return_val_if_fail (network_file != NULL, FALSE);
- g_return_val_if_fail (addr != NULL, FALSE);
- if (error)
- g_return_val_if_fail (*error == NULL, FALSE);
+ g_return_val_if_fail (out_address != NULL, FALSE);
+ g_return_val_if_fail (*out_address == NULL, FALSE);
+ g_return_val_if_fail (!error || !*error, FALSE);
ip_tag = get_numbered_tag ("IPADDR", which);
prefix_tag = get_numbered_tag ("PREFIX", which);
@@ -380,82 +361,73 @@ read_full_ip4_address (shvarFile *ifcfg,
gw_tag = get_numbered_tag ("GATEWAY", which);
/* IP address */
- if (!read_ip4_address (ifcfg, ip_tag, &tmp, error))
- goto done;
- if (tmp)
- nm_ip4_address_set_address (addr, tmp);
- else if (!nm_ip4_address_get_address (addr)) {
- success = TRUE;
+ if (!read_ip4_address (ifcfg, ip_tag, &ip, error))
goto done;
+ if (!ip) {
+ if (base_addr)
+ ip = g_strdup (nm_ip_address_get_address (base_addr));
+ else {
+ success = TRUE;
+ goto done;
+ }
}
/* Gateway */
- if (!read_ip4_address (ifcfg, gw_tag, &tmp, error))
- goto done;
- if (tmp)
- nm_ip4_address_set_gateway (addr, tmp);
- else {
- gboolean read_success;
-
- /* If no gateway in the ifcfg, try /etc/sysconfig/network instead */
- network_ifcfg = svOpenFile (network_file, NULL);
- if (network_ifcfg) {
- read_success = read_ip4_address (network_ifcfg, "GATEWAY", &tmp, error);
- svCloseFile (network_ifcfg);
- if (!read_success)
- goto done;
- nm_ip4_address_set_gateway (addr, tmp);
- }
+ if (out_gateway && !*out_gateway) {
+ if (!read_ip4_address (ifcfg, gw_tag, out_gateway, error))
+ goto done;
}
/* Prefix */
value = svGetValue (ifcfg, prefix_tag, FALSE);
if (value) {
- long int prefix;
-
errno = 0;
prefix = strtol (value, NULL, 10);
- if (errno || prefix <= 0 || prefix > 32) {
+ if (errno || prefix < 0) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid IP4 prefix '%s'", value);
g_free (value);
goto done;
}
- nm_ip4_address_set_prefix (addr, (guint32) prefix);
g_free (value);
}
/* Fall back to NETMASK if no PREFIX was specified */
- if (!nm_ip4_address_get_prefix (addr)) {
- if (!read_ip4_address (ifcfg, netmask_tag, &tmp, error))
+ if (prefix == 0) {
+ if (!read_ip4_address (ifcfg, netmask_tag, &value, error))
goto done;
- if (tmp)
- nm_ip4_address_set_prefix (addr, nm_utils_ip4_netmask_to_prefix (tmp));
+ if (value) {
+ inet_pton (AF_INET, value, &tmp);
+ prefix = nm_utils_ip4_netmask_to_prefix (tmp);
+ g_free (value);
+ }
}
- /* Try to autodetermine the prefix for the address' class */
- if (!nm_ip4_address_get_prefix (addr)) {
- guint32 prefix = 0;
+ if (prefix == 0 && base_addr)
+ prefix = nm_ip_address_get_prefix (base_addr);
- prefix = nm_utils_ip4_get_default_prefix (nm_ip4_address_get_address (addr));
- nm_ip4_address_set_prefix (addr, prefix);
+ /* Try to autodetermine the prefix for the address' class */
+ if (prefix == 0) {
+ if (inet_pton (AF_INET, ip, &tmp) == 1) {
+ prefix = nm_utils_ip4_get_default_prefix (tmp);
- value = svGetValue (ifcfg, ip_tag, FALSE);
- PARSE_WARNING ("missing %s, assuming %s/%u", prefix_tag, value, prefix);
- g_free (value);
+ PARSE_WARNING ("missing %s, assuming %s/%ld", prefix_tag, ip, prefix);
+ }
}
/* Validate the prefix */
- if (nm_ip4_address_get_prefix (addr) > 32) {
+ if (prefix == 0) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Missing or invalid IP4 prefix '%d'",
- nm_ip4_address_get_prefix (addr));
+ "Missing IP4 prefix");
goto done;
}
- success = TRUE;
+ *out_address = nm_ip_address_new (AF_INET, ip, prefix, error);
+ if (*out_address)
+ success = TRUE;
done:
+ g_free (ip);
g_free (ip_tag);
g_free (prefix_tag);
g_free (netmask_tag);
@@ -469,22 +441,19 @@ static gboolean
read_one_ip4_route (shvarFile *ifcfg,
const char *network_file,
guint32 which,
- NMIP4Route **out_route,
+ NMIPRoute **out_route,
GError **error)
{
- NMIP4Route *route;
char *ip_tag, *netmask_tag, *gw_tag, *metric_tag, *value;
- guint32 tmp;
+ char *dest = NULL, *next_hop = NULL;
+ gint64 prefix, metric;
gboolean success = FALSE;
g_return_val_if_fail (ifcfg != NULL, FALSE);
g_return_val_if_fail (network_file != NULL, FALSE);
g_return_val_if_fail (out_route != NULL, FALSE);
g_return_val_if_fail (*out_route == NULL, FALSE);
- if (error)
- g_return_val_if_fail (*error == NULL, FALSE);
-
- route = nm_ip4_route_new ();
+ g_return_val_if_fail (!error || !*error, FALSE);
ip_tag = g_strdup_printf ("ADDRESS%u", which);
netmask_tag = g_strdup_printf ("NETMASK%u", which);
@@ -492,67 +461,66 @@ read_one_ip4_route (shvarFile *ifcfg,
metric_tag = g_strdup_printf ("METRIC%u", which);
/* Destination */
- if (!read_ip4_address (ifcfg, ip_tag, &tmp, error))
+ if (!read_ip4_address (ifcfg, ip_tag, &dest, error))
goto out;
- if (!tmp) {
+ if (!dest) {
/* Check whether IP is missing or 0.0.0.0 */
char *val;
val = svGetValue (ifcfg, ip_tag, FALSE);
if (!val) {
- nm_ip4_route_unref (route);
- route = NULL;
+ *out_route = NULL;
success = TRUE; /* missing route = success */
goto out;
}
g_free (val);
}
- nm_ip4_route_set_dest (route, tmp);
/* Next hop */
- if (!read_ip4_address (ifcfg, gw_tag, &tmp, error))
+ if (!read_ip4_address (ifcfg, gw_tag, &next_hop, error))
goto out;
- /* No need to check tmp, because we don't make distinction between missing GATEWAY IP and 0.0.0.0 */
- nm_ip4_route_set_next_hop (route, tmp);
+ /* We don't make distinction between missing GATEWAY IP and 0.0.0.0 */
/* Prefix */
- if (!read_ip4_address (ifcfg, netmask_tag, &tmp, error))
+ if (!read_ip4_address (ifcfg, netmask_tag, &value, error))
goto out;
- if (tmp)
- nm_ip4_route_set_prefix (route, nm_utils_ip4_netmask_to_prefix (tmp));
+ if (value) {
+ guint32 netmask;
- /* Validate the prefix */
- if ( !nm_ip4_route_get_prefix (route)
- || nm_ip4_route_get_prefix (route) > 32) {
+ inet_pton (AF_INET, value, &netmask);
+ prefix = nm_utils_ip4_netmask_to_prefix (netmask);
+ g_free (value);
+ if (prefix == 0 || netmask != nm_utils_ip4_prefix_to_netmask (prefix)) {
+ g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
+ "Invalid IP4 netmask '%s' \"%s\"", netmask_tag, nm_utils_inet4_ntop (netmask, NULL));
+ goto out;
+ }
+ } else {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Missing or invalid IP4 prefix '%d'",
- nm_ip4_route_get_prefix (route));
+ "Missing IP4 route element '%s'", netmask_tag);
goto out;
}
/* Metric */
value = svGetValue (ifcfg, metric_tag, FALSE);
if (value) {
- long int metric;
-
- errno = 0;
- metric = strtol (value, NULL, 10);
- if (errno || metric < 0) {
+ metric = _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT32, -1);
+ if (metric < 0) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid IP4 route metric '%s'", value);
g_free (value);
goto out;
}
- nm_ip4_route_set_metric (route, (guint32) metric);
g_free (value);
- }
+ } else
+ metric = -1;
- *out_route = route;
- success = TRUE;
+ *out_route = nm_ip_route_new (AF_INET, dest, prefix, next_hop, metric, error);
+ if (*out_route)
+ success = TRUE;
out:
- if (!success && route)
- nm_ip4_route_unref (route);
-
+ g_free (dest);
+ g_free (next_hop);
g_free (ip_tag);
g_free (netmask_tag);
g_free (gw_tag);
@@ -561,17 +529,14 @@ out:
}
static gboolean
-read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError **error)
+read_route_file_legacy (const char *filename, NMSettingIPConfig *s_ip4, GError **error)
{
char *contents = NULL;
gsize len = 0;
char **lines = NULL, **iter;
GRegex *regex_to1, *regex_to2, *regex_via, *regex_metric;
GMatchInfo *match_info;
- NMIP4Route *route;
- guint32 ip4_addr;
- char *dest = NULL, *prefix = NULL, *metric = NULL;
- long int prefix_int, metric_int;
+ gint64 prefix_int, metric_int;
gboolean success = FALSE;
const char *pattern_empty = "^\\s*(\\#.*)?$";
@@ -584,8 +549,7 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (s_ip4 != NULL, FALSE);
- if (error)
- g_return_val_if_fail (*error == NULL, FALSE);
+ g_return_val_if_fail (!error || !*error, FALSE);
/* Read the route file */
if (!g_file_get_contents (filename, &contents, &len, NULL) || !len) {
@@ -599,12 +563,12 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError
regex_via = g_regex_new (pattern_via, 0, 0, NULL);
regex_metric = g_regex_new (pattern_metric, 0, 0, NULL);
- /* New NMIP4Route structure */
- route = nm_ip4_route_new ();
-
/* Iterate through file lines */
lines = g_strsplit_set (contents, "\n\r", -1);
for (iter = lines; iter && *iter; iter++) {
+ gs_free char *next_hop = NULL, *dest = NULL;
+ char *prefix, *metric;
+ NMIPRoute *route;
/* Skip empty lines */
if (g_regex_match_simple (pattern_empty, *iter, 0, 0))
@@ -624,15 +588,13 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError
}
dest = g_match_info_fetch (match_info, 1);
if (!strcmp (dest, "default"))
- strcpy (dest, "0.0.0.0");
- if (inet_pton (AF_INET, dest, &ip4_addr) != 1) {
+ strcpy (dest, "0.0.0.0");
+ if (!nm_utils_ipaddr_valid (AF_INET, dest)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid IP4 route destination address '%s'", dest);
- g_free (dest);
+ g_match_info_free (match_info);
goto error;
}
- nm_ip4_route_set_dest (route, ip4_addr);
- g_free (dest);
/* Prefix - is optional; 32 if missing */
prefix = g_match_info_fetch (match_info, 2);
@@ -648,32 +610,27 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError
goto error;
}
}
- nm_ip4_route_set_prefix (route, (guint32) prefix_int);
g_free (prefix);
/* Next hop */
g_regex_match (regex_via, *iter, 0, &match_info);
if (g_match_info_matches (match_info)) {
- char *next_hop = g_match_info_fetch (match_info, 1);
- if (inet_pton (AF_INET, next_hop, &ip4_addr) != 1) {
+ next_hop = g_match_info_fetch (match_info, 1);
+ if (!nm_utils_ipaddr_valid (AF_INET, next_hop)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid IP4 route gateway address '%s'",
next_hop);
g_match_info_free (match_info);
- g_free (next_hop);
goto error;
}
- g_free (next_hop);
} else {
/* we don't make distinction between missing GATEWAY IP and 0.0.0.0 */
- ip4_addr = 0;
}
- nm_ip4_route_set_next_hop (route, ip4_addr);
g_match_info_free (match_info);
/* Metric */
g_regex_match (regex_metric, *iter, 0, &match_info);
- metric_int = 0;
+ metric_int = -1;
if (g_match_info_matches (match_info)) {
metric = g_match_info_fetch (match_info, 1);
errno = 0;
@@ -687,13 +644,14 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError
}
g_free (metric);
}
-
- nm_ip4_route_set_metric (route, (guint32) metric_int);
g_match_info_free (match_info);
- if (!nm_setting_ip4_config_add_route (s_ip4, route))
+ route = nm_ip_route_new (AF_INET, dest, prefix_int, next_hop, metric_int, error);
+ if (!route)
+ goto error;
+ if (!nm_setting_ip_config_add_route (s_ip4, route))
PARSE_WARNING ("duplicate IP4 route");
-
+ nm_ip_route_unref (route);
}
success = TRUE;
@@ -701,7 +659,6 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError
error:
g_free (contents);
g_strfreev (lines);
- nm_ip4_route_unref (route);
g_regex_unref (regex_to1);
g_regex_unref (regex_to2);
g_regex_unref (regex_via);
@@ -715,22 +672,18 @@ parse_full_ip6_address (shvarFile *ifcfg,
const char *network_file,
const char *addr_str,
int i,
- NMIP6Address **out_address,
+ NMIPAddress **out_address,
GError **error)
{
- NMIP6Address *addr = NULL;
char **list;
char *ip_val, *prefix_val;
- shvarFile *network_ifcfg;
- char *value = NULL;
- struct in6_addr tmp = IN6ADDR_ANY_INIT;
+ long prefix;
gboolean success = FALSE;
g_return_val_if_fail (addr_str != NULL, FALSE);
g_return_val_if_fail (out_address != NULL, FALSE);
g_return_val_if_fail (*out_address == NULL, FALSE);
- if (error)
- g_return_val_if_fail (*error == NULL, FALSE);
+ g_return_val_if_fail (!error || !*error, FALSE);
/* Split the address and prefix */
list = g_strsplit_set (addr_str, "/", 2);
@@ -741,23 +694,9 @@ parse_full_ip6_address (shvarFile *ifcfg,
}
ip_val = list[0];
- prefix_val = list[1];
-
- addr = nm_ip6_address_new ();
- /* IP address */
- if (!parse_ip6_address (ip_val, &tmp, error))
- goto error;
- if (IN6_IS_ADDR_UNSPECIFIED (&tmp)) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Invalid IP6 address '%s'", ip_val);
- goto error;
- }
- nm_ip6_address_set_address (addr, &tmp);
- /* Prefix */
+ prefix_val = list[1];
if (prefix_val) {
- long int prefix;
-
errno = 0;
prefix = strtol (prefix_val, NULL, 10);
if (errno || prefix <= 0 || prefix > 128) {
@@ -765,47 +704,17 @@ parse_full_ip6_address (shvarFile *ifcfg,
"Invalid IP6 prefix '%s'", prefix_val);
goto error;
}
- nm_ip6_address_set_prefix (addr, (guint32) prefix);
} else {
/* Missing prefix is treated as prefix of 64 */
- nm_ip6_address_set_prefix (addr, 64);
- }
-
- /* Gateway */
- tmp = in6addr_any;
- value = svGetValue (ifcfg, "IPV6_DEFAULTGW", FALSE);
- if (i != 0) {
- /* We don't support gateways for IPV6ADDR_SECONDARIES yet */
- g_free (value);
- value = NULL;
+ prefix = 64;
}
- if (!value) {
- /* If no gateway in the ifcfg, try global /etc/sysconfig/network instead */
- network_ifcfg = svOpenFile (network_file, NULL);
- if (network_ifcfg) {
- value = svGetValue (network_ifcfg, "IPV6_DEFAULTGW", FALSE);
- svCloseFile (network_ifcfg);
- }
- }
- if (value) {
- char *ptr;
- if ((ptr = strchr (value, '%')) != NULL)
- *ptr = '\0'; /* remove %interface prefix if present */
- if (!parse_ip6_address (value, &tmp, error))
- goto error;
- nm_ip6_address_set_gateway (addr, &tmp);
- }
-
- *out_address = addr;
- success = TRUE;
+ *out_address = nm_ip_address_new (AF_INET6, ip_val, prefix, error);
+ if (*out_address)
+ success = TRUE;
error:
- if (!success && addr)
- nm_ip6_address_unref (addr);
-
g_strfreev (list);
- g_free (value);
return success;
}
@@ -817,17 +726,15 @@ error:
#define IPV6_ADDR_REGEX "[0-9A-Fa-f:.]+"
static gboolean
-read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **error)
+read_route6_file (const char *filename, NMSettingIPConfig *s_ip6, GError **error)
{
char *contents = NULL;
gsize len = 0;
char **lines = NULL, **iter;
GRegex *regex_to1, *regex_to2, *regex_via, *regex_metric;
GMatchInfo *match_info;
- NMIP6Route *route;
- struct in6_addr ip6_addr;
- char *dest = NULL, *prefix = NULL, *metric = NULL;
- long int prefix_int, metric_int;
+ char *dest = NULL, *prefix = NULL, *next_hop = NULL, *metric = NULL;
+ gint64 prefix_int, metric_int;
gboolean success = FALSE;
const char *pattern_empty = "^\\s*(\\#.*)?$";
@@ -840,8 +747,7 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (s_ip6 != NULL, FALSE);
- if (error)
- g_return_val_if_fail (*error == NULL, FALSE);
+ g_return_val_if_fail (!error || !*error, FALSE);
/* Read the route file */
if (!g_file_get_contents (filename, &contents, &len, NULL) || !len) {
@@ -855,12 +761,10 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro
regex_via = g_regex_new (pattern_via, 0, 0, NULL);
regex_metric = g_regex_new (pattern_metric, 0, 0, NULL);
- /* New NMIP6Route structure */
- route = nm_ip6_route_new ();
-
/* Iterate through file lines */
lines = g_strsplit_set (contents, "\n\r", -1);
for (iter = lines; iter && *iter; iter++) {
+ NMIPRoute *route;
/* Skip empty lines */
if (g_regex_match_simple (pattern_empty, *iter, 0, 0))
@@ -881,19 +785,11 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro
dest = g_match_info_fetch (match_info, 1);
if (!g_strcmp0 (dest, "default")) {
/* Ignore default route - NM handles it internally */
- g_free (dest);
+ g_clear_pointer (&dest, g_free);
g_match_info_free (match_info);
PARSE_WARNING ("ignoring manual default route: '%s' (%s)", *iter, filename);
continue;
}
- if (inet_pton (AF_INET6, dest, &ip6_addr) != 1) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Invalid IP6 route destination address '%s'", dest);
- g_free (dest);
- goto error;
- }
- nm_ip6_route_set_dest (route, &ip6_addr);
- g_free (dest);
/* Prefix - is optional; 128 if missing */
prefix = g_match_info_fetch (match_info, 2);
@@ -905,36 +801,35 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro
if (errno || prefix_int <= 0 || prefix_int > 128) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid IP6 route destination prefix '%s'", prefix);
+ g_free (dest);
g_free (prefix);
goto error;
}
}
- nm_ip6_route_set_prefix (route, (guint32) prefix_int);
g_free (prefix);
/* Next hop */
g_regex_match (regex_via, *iter, 0, &match_info);
if (g_match_info_matches (match_info)) {
- char *next_hop = g_match_info_fetch (match_info, 1);
- if (inet_pton (AF_INET6, next_hop, &ip6_addr) != 1) {
+ next_hop = g_match_info_fetch (match_info, 1);
+ if (!nm_utils_ipaddr_valid (AF_INET6, next_hop)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid IPv6 route nexthop address '%s'",
next_hop);
g_match_info_free (match_info);
+ g_free (dest);
g_free (next_hop);
goto error;
}
- g_free (next_hop);
} else {
/* Missing "via" is taken as :: */
- ip6_addr = in6addr_any;
+ next_hop = NULL;
}
- nm_ip6_route_set_next_hop (route, &ip6_addr);
g_match_info_free (match_info);
/* Metric */
g_regex_match (regex_metric, *iter, 0, &match_info);
- metric_int = 0;
+ metric_int = -1;
if (g_match_info_matches (match_info)) {
metric = g_match_info_fetch (match_info, 1);
errno = 0;
@@ -943,17 +838,23 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro
g_match_info_free (match_info);
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid IP6 route metric '%s'", metric);
+ g_free (dest);
+ g_free (next_hop);
g_free (metric);
goto error;
}
g_free (metric);
}
-
- nm_ip6_route_set_metric (route, (guint32) metric_int);
g_match_info_free (match_info);
- if (!nm_setting_ip6_config_add_route (s_ip6, route))
+ route = nm_ip_route_new (AF_INET6, dest, prefix_int, next_hop, metric_int, error);
+ g_free (dest);
+ g_free (next_hop);
+ if (!route)
+ goto error;
+ if (!nm_setting_ip_config_add_route (s_ip6, route))
PARSE_WARNING ("duplicate IP6 route");
+ nm_ip_route_unref (route);
}
success = TRUE;
@@ -961,7 +862,6 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro
error:
g_free (contents);
g_strfreev (lines);
- nm_ip6_route_unref (route);
g_regex_unref (regex_to1);
g_regex_unref (regex_to2);
g_regex_unref (regex_via);
@@ -976,16 +876,17 @@ make_ip4_setting (shvarFile *ifcfg,
const char *network_file,
GError **error)
{
- NMSettingIP4Config *s_ip4 = NULL;
+ NMSettingIPConfig *s_ip4 = NULL;
char *value = NULL;
char *route_path = NULL;
char *method;
+ gs_free char *gateway = NULL;
gint32 i;
shvarFile *network_ifcfg;
shvarFile *route_ifcfg;
gboolean never_default = FALSE;
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
/* First check if DEFROUTE is set for this device; DEFROUTE has the
* opposite meaning from never-default. The default if DEFROUTE is not
@@ -1017,7 +918,7 @@ make_ip4_setting (shvarFile *ifcfg,
value = svGetValue (ifcfg, "BOOTPROTO", FALSE);
if (!value || !*value || !g_ascii_strcasecmp (value, "none")) {
- if (is_any_ip4_address_defined (ifcfg))
+ if (is_any_ip4_address_defined (ifcfg, NULL))
method = NM_SETTING_IP4_CONFIG_METHOD_MANUAL;
else
method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
@@ -1028,16 +929,30 @@ make_ip4_setting (shvarFile *ifcfg,
} else if (!g_ascii_strcasecmp (value, "autoip")) {
g_free (value);
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, never_default,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL,
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, never_default,
NULL);
return NM_SETTING (s_ip4);
} else if (!g_ascii_strcasecmp (value, "shared")) {
+ int idx;
+
g_free (value);
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_SHARED,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, never_default,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_SHARED,
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, never_default,
NULL);
+ /* 1 IP address is allowed for shared connections. Read it. */
+ if (is_any_ip4_address_defined (ifcfg, &idx)) {
+ NMIPAddress *addr = NULL;
+
+ if (!read_full_ip4_address (ifcfg, network_file, idx, NULL, &addr, NULL, error))
+ goto done;
+ if (!read_ip4_address (ifcfg, "GATEWAY", &gateway, error))
+ goto done;
+ (void) nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_GATEWAY, gateway, NULL);
+ }
return NM_SETTING (s_ip4);
} else {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
@@ -1048,11 +963,13 @@ make_ip4_setting (shvarFile *ifcfg,
g_free (value);
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, method,
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, !svTrueValue (ifcfg, "PEERDNS", TRUE),
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, !svTrueValue (ifcfg, "PEERROUTES", TRUE),
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, never_default,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, !svTrueValue (ifcfg, "IPV4_FAILURE_FATAL", FALSE),
+ NM_SETTING_IP_CONFIG_METHOD, method,
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, !svTrueValue (ifcfg, "PEERDNS", TRUE),
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, !svTrueValue (ifcfg, "PEERROUTES", TRUE),
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, never_default,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, !svTrueValue (ifcfg, "IPV4_FAILURE_FATAL", FALSE),
+ NM_SETTING_IP_CONFIG_ROUTE_METRIC, svGetValueInt64 (ifcfg, "IPV4_ROUTE_METRIC", 10,
+ -1, G_MAXUINT32, -1),
NULL);
if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0)
@@ -1062,11 +979,11 @@ make_ip4_setting (shvarFile *ifcfg,
if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
value = svGetValue (ifcfg, "DHCP_HOSTNAME", FALSE);
if (value && strlen (value))
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, value, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, value, NULL);
g_free (value);
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME,
+ NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME,
svTrueValue (ifcfg, "DHCP_SEND_HOSTNAME", TRUE),
NULL);
@@ -1082,16 +999,14 @@ make_ip4_setting (shvarFile *ifcfg,
* the legacy 'network' service (ifup-eth).
*/
for (i = -1; i < 256; i++) {
- NMIP4Address *addr = NULL;
+ NMIPAddress *addr = NULL;
- addr = nm_ip4_address_new ();
- if (!read_full_ip4_address (ifcfg, network_file, i, addr, error)) {
- nm_ip4_address_unref (addr);
+ /* gateway will only be set if still unset. Hence, we don't leak gateway
+ * here by calling read_full_ip4_address() repeatedly */
+ if (!read_full_ip4_address (ifcfg, network_file, i, NULL, &addr, &gateway, error))
goto done;
- }
- if (!nm_ip4_address_get_address (addr)) {
- nm_ip4_address_unref (addr);
+ if (!addr) {
/* The first mandatory variable is 2-indexed (IPADDR2)
* Variables IPADDR, IPADDR0 and IPADDR1 are optional */
if (i > 1)
@@ -1099,37 +1014,46 @@ make_ip4_setting (shvarFile *ifcfg,
continue;
}
- if (!nm_setting_ip4_config_add_address (s_ip4, addr))
+ if (!nm_setting_ip_config_add_address (s_ip4, addr))
PARSE_WARNING ("duplicate IP4 address");
- nm_ip4_address_unref (addr);
+ nm_ip_address_unref (addr);
+ }
+
+ /* Gateway */
+ if (!gateway) {
+ network_ifcfg = svOpenFile (network_file, NULL);
+ if (network_ifcfg) {
+ gboolean read_success;
+
+ read_success = read_ip4_address (network_ifcfg, "GATEWAY", &gateway, error);
+ svCloseFile (network_ifcfg);
+ if (!read_success)
+ goto done;
+ }
}
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_GATEWAY, gateway, NULL);
/* DNS servers
* Pick up just IPv4 addresses (IPv6 addresses are taken by make_ip6_setting())
*/
for (i = 1; i <= 10; i++) {
char *tag;
- guint32 dns;
- struct in6_addr ip6_dns;
tag = g_strdup_printf ("DNS%u", i);
value = svGetValue (ifcfg, tag, FALSE);
if (value) {
- if (!read_ip4_address (ifcfg, tag, &dns, error)) {
- gboolean valid = TRUE;
-
+ if (nm_utils_ipaddr_valid (AF_INET, value)) {
+ if (!nm_setting_ip_config_add_dns (s_ip4, value))
+ PARSE_WARNING ("duplicate DNS server %s", tag);
+ } else if (nm_utils_ipaddr_valid (AF_INET6, value)) {
/* Ignore IPv6 addresses */
- valid = parse_ip6_address (value, &ip6_dns, NULL);
- if (!valid) {
- g_free (tag);
- goto done;
- }
- g_clear_error (error);
- dns = 0;
+ } else {
+ PARSE_WARNING ("invalid DNS server address %s", value);
+ g_free (tag);
+ g_free (value);
+ goto done;
}
- if (dns && !nm_setting_ip4_config_add_dns (s_ip4, value))
- PARSE_WARNING ("duplicate DNS server %s", tag);
g_free (value);
}
@@ -1146,7 +1070,7 @@ make_ip4_setting (shvarFile *ifcfg,
char **item;
for (item = searches; *item; item++) {
if (strlen (*item)) {
- if (!nm_setting_ip4_config_add_dns_search (s_ip4, *item))
+ if (!nm_setting_ip_config_add_dns_search (s_ip4, *item))
PARSE_WARNING ("duplicate DNS domain '%s'", *item);
}
}
@@ -1157,19 +1081,15 @@ make_ip4_setting (shvarFile *ifcfg,
/* Static routes - route-<name> file */
route_path = utils_get_route_path (ifcfg->fileName);
- if (!route_path) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Could not get route file path for '%s'", ifcfg->fileName);
- goto done;
- }
- /* First test new/legacy syntax */
- if (utils_has_route_file_new_syntax (route_path)) {
+ if (utils_has_complex_routes (route_path)) {
+ PARSE_WARNING ("'rule-' or 'rule6-' file is present; you will need to use a dispatcher script to apply these routes");
+ } else if (utils_has_route_file_new_syntax (route_path)) {
/* Parse route file in new syntax */
route_ifcfg = utils_get_route_ifcfg (ifcfg->fileName, FALSE);
if (route_ifcfg) {
for (i = 0; i < 256; i++) {
- NMIP4Route *route = NULL;
+ NMIPRoute *route = NULL;
if (!read_one_ip4_route (route_ifcfg, network_file, i, &route, error)) {
svCloseFile (route_ifcfg);
@@ -1179,9 +1099,9 @@ make_ip4_setting (shvarFile *ifcfg,
if (!route)
break;
- if (!nm_setting_ip4_config_add_route (s_ip4, route))
+ if (!nm_setting_ip_config_add_route (s_ip4, route))
PARSE_WARNING ("duplicate IP4 route");
- nm_ip4_route_unref (route);
+ nm_ip_route_unref (route);
}
svCloseFile (route_ifcfg);
}
@@ -1189,9 +1109,10 @@ make_ip4_setting (shvarFile *ifcfg,
if (!read_route_file_legacy (route_path, s_ip4, error))
goto done;
}
+ g_free (route_path);
/* Legacy value NM used for a while but is incorrect (rh #459370) */
- if (!nm_setting_ip4_config_get_num_dns_searches (s_ip4)) {
+ if (!nm_setting_ip_config_get_num_dns_searches (s_ip4)) {
value = svGetValue (ifcfg, "SEARCH", FALSE);
if (value) {
char **searches = NULL;
@@ -1201,7 +1122,7 @@ make_ip4_setting (shvarFile *ifcfg,
char **item;
for (item = searches; *item; item++) {
if (strlen (*item)) {
- if (!nm_setting_ip4_config_add_dns_search (s_ip4, *item))
+ if (!nm_setting_ip_config_add_dns_search (s_ip4, *item))
PARSE_WARNING ("duplicate DNS search '%s'", *item);
}
}
@@ -1220,21 +1141,21 @@ done:
}
static void
-read_aliases (NMSettingIP4Config *s_ip4, const char *filename, const char *network_file)
+read_aliases (NMSettingIPConfig *s_ip4, const char *filename, const char *network_file)
{
GDir *dir;
char *dirname, *base;
shvarFile *parsed;
- NMIP4Address *base_addr;
+ NMIPAddress *base_addr;
GError *err = NULL;
g_return_if_fail (s_ip4 != NULL);
g_return_if_fail (filename != NULL);
- if (nm_setting_ip4_config_get_num_addresses (s_ip4) == 0)
+ if (nm_setting_ip_config_get_num_addresses (s_ip4) == 0)
return;
- base_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
+ base_addr = nm_setting_ip_config_get_address (s_ip4, 0);
dirname = g_path_get_dirname (filename);
g_return_if_fail (dirname != NULL);
@@ -1244,7 +1165,7 @@ read_aliases (NMSettingIP4Config *s_ip4, const char *filename, const char *netwo
dir = g_dir_open (dirname, 0, &err);
if (dir) {
const char *item;
- NMIP4Address *addr;
+ NMIPAddress *addr;
gboolean ok;
while ((item = g_dir_read_name (dir))) {
@@ -1293,18 +1214,19 @@ read_aliases (NMSettingIP4Config *s_ip4, const char *filename, const char *netwo
continue;
}
- addr = nm_ip4_address_dup (base_addr);
- ok = read_full_ip4_address (parsed, network_file, -1, addr, &err);
+ addr = NULL;
+ ok = read_full_ip4_address (parsed, network_file, -1, base_addr, &addr, NULL, &err);
svCloseFile (parsed);
if (ok) {
- if (!_nm_setting_ip4_config_add_address_with_label (s_ip4, addr, device))
+ nm_ip_address_set_attribute (addr, "label", g_variant_new_string (device));
+ if (!nm_setting_ip_config_add_address (s_ip4, addr))
PARSE_WARNING ("duplicate IP4 address in alias file %s", item);
} else {
PARSE_WARNING ("error reading IP4 address from alias file '%s': %s",
full_path, err ? err->message : "no address");
g_clear_error (&err);
}
- nm_ip4_address_unref (addr);
+ nm_ip_address_unref (addr);
g_free (device);
g_free (full_path);
@@ -1325,7 +1247,7 @@ make_ip6_setting (shvarFile *ifcfg,
const char *network_file,
GError **error)
{
- NMSettingIP6Config *s_ip6 = NULL;
+ NMSettingIPConfig *s_ip6 = NULL;
char *value = NULL;
char *str_value;
char *route6_path = NULL;
@@ -1340,7 +1262,7 @@ make_ip6_setting (shvarFile *ifcfg,
char *ip6_privacy_str;
NMSettingIP6ConfigPrivacy ip6_privacy_val;
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
/* First check if IPV6_DEFROUTE is set for this device; IPV6_DEFROUTE has the
* opposite meaning from never-default. The default if IPV6_DEFROUTE is not
@@ -1437,11 +1359,13 @@ make_ip6_setting (shvarFile *ifcfg,
g_free (ip6_privacy_str);
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, method,
- NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, !svTrueValue (ifcfg, "IPV6_PEERDNS", TRUE),
- NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, !svTrueValue (ifcfg, "IPV6_PEERROUTES", TRUE),
- NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, never_default,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, !svTrueValue (ifcfg, "IPV6_FAILURE_FATAL", FALSE),
+ NM_SETTING_IP_CONFIG_METHOD, method,
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, !svTrueValue (ifcfg, "IPV6_PEERDNS", TRUE),
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, !svTrueValue (ifcfg, "IPV6_PEERROUTES", TRUE),
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, never_default,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, !svTrueValue (ifcfg, "IPV6_FAILURE_FATAL", FALSE),
+ NM_SETTING_IP_CONFIG_ROUTE_METRIC, svGetValueInt64 (ifcfg, "IPV6_ROUTE_METRIC", 10,
+ -1, G_MAXUINT32, -1),
NM_SETTING_IP6_CONFIG_IP6_PRIVACY, ip6_privacy_val,
NULL);
@@ -1454,7 +1378,7 @@ make_ip6_setting (shvarFile *ifcfg,
/* METHOD_AUTO may trigger DHCPv6, so save the hostname to send to DHCP */
value = svGetValue (ifcfg, "DHCP_HOSTNAME", FALSE);
if (value && value[0])
- g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME, value, NULL);
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, value, NULL);
g_free (value);
}
@@ -1476,26 +1400,51 @@ make_ip6_setting (shvarFile *ifcfg,
list = g_strsplit_set (value, " ", 0);
g_free (value);
for (iter = list, i = 0; iter && *iter; iter++, i++) {
- NMIP6Address *addr = NULL;
+ NMIPAddress *addr = NULL;
if (!parse_full_ip6_address (ifcfg, network_file, *iter, i, &addr, error)) {
g_strfreev (list);
goto error;
}
- if (!nm_setting_ip6_config_add_address (s_ip6, addr))
+ if (!nm_setting_ip_config_add_address (s_ip6, addr))
PARSE_WARNING ("duplicate IP6 address");
- nm_ip6_address_unref (addr);
+ nm_ip_address_unref (addr);
}
g_strfreev (list);
+ /* Gateway */
+ if (nm_setting_ip_config_get_num_addresses (s_ip6)) {
+ value = svGetValue (ifcfg, "IPV6_DEFAULTGW", FALSE);
+ if (!value) {
+ /* If no gateway in the ifcfg, try global /etc/sysconfig/network instead */
+ network_ifcfg = svOpenFile (network_file, NULL);
+ if (network_ifcfg) {
+ value = svGetValue (network_ifcfg, "IPV6_DEFAULTGW", FALSE);
+ svCloseFile (network_ifcfg);
+ }
+ }
+ if (value) {
+ char *ptr;
+ if ((ptr = strchr (value, '%')) != NULL)
+ *ptr = '\0'; /* remove %interface prefix if present */
+ if (!nm_utils_ipaddr_valid (AF_INET6, value)) {
+ g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
+ "Invalid IP6 address '%s'", value);
+ g_free (value);
+ goto error;
+ }
+
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_GATEWAY, value, NULL);
+ g_free (value);
+ }
+ }
+
/* DNS servers
* Pick up just IPv6 addresses (IPv4 addresses are taken by make_ip4_setting())
*/
for (i = 1; i <= 10; i++) {
char *tag;
- struct in6_addr ip6_dns;
- guint32 ip4_addr;
tag = g_strdup_printf ("DNS%u", i);
value = svGetValue (ifcfg, tag, FALSE);
@@ -1504,38 +1453,33 @@ make_ip6_setting (shvarFile *ifcfg,
break; /* all done */
}
- ip6_dns = in6addr_any;
- if (parse_ip6_address (value, &ip6_dns, NULL)) {
- if (!IN6_IS_ADDR_UNSPECIFIED (&ip6_dns) && !nm_setting_ip6_config_add_dns (s_ip6, value))
+ if (nm_utils_ipaddr_valid (AF_INET6, value)) {
+ if (!nm_setting_ip_config_add_dns (s_ip6, value))
PARSE_WARNING ("duplicate DNS server %s", tag);
+ } else if (nm_utils_ipaddr_valid (AF_INET, value)) {
+ /* Ignore IPv4 addresses */
} else {
- /* Maybe an IPv4 address? If so ignore it */
- if (inet_pton (AF_INET, value, &ip4_addr) != 1) {
- g_free (tag);
- g_free (value);
- PARSE_WARNING ("duplicate IP6 address");
- goto error;
- }
+ PARSE_WARNING ("invalid DNS server address %s", value);
+ g_free (tag);
+ g_free (value);
+ goto error;
}
g_free (tag);
g_free (value);
}
- /* DNS searches ('DOMAIN' key) are read by make_ip4_setting() and included in NMSettingIP4Config */
+ /* DNS searches ('DOMAIN' key) are read by make_ip4_setting() and included in NMSettingIPConfig */
- /* Read static routes from route6-<interface> file */
- route6_path = utils_get_route6_path (ifcfg->fileName);
- if (!route6_path) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Could not get route6 file path for '%s'", ifcfg->fileName);
- goto error;
- }
+ if (!utils_has_complex_routes (ifcfg->fileName)) {
+ /* Read static routes from route6-<interface> file */
+ route6_path = utils_get_route6_path (ifcfg->fileName);
+ if (!read_route6_file (route6_path, s_ip6, error))
+ goto error;
- if (!read_route6_file (route6_path, s_ip6, error))
- goto error;
+ g_free (route6_path);
+ }
- g_free (route6_path);
return NM_SETTING (s_ip6);
error:
@@ -3118,7 +3062,8 @@ make_wpa_setting (shvarFile *ifcfg,
if (psk) {
g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_PSK, psk, NULL);
g_free (psk);
- }
+ } else if (error)
+ goto error;
}
if (adhoc)
@@ -3231,6 +3176,8 @@ make_wireless_security_setting (shvarFile *ifcfg,
{
NMSetting *wsec;
+ g_return_val_if_fail (error && !*error, NULL);
+
if (!adhoc) {
wsec = make_leap_setting (ifcfg, file, error);
if (wsec)
@@ -3281,7 +3228,6 @@ make_wireless_setting (shvarFile *ifcfg,
GError **error)
{
NMSettingWireless *s_wireless;
- GBytes *bytes = NULL;
char *value = NULL;
gint64 chan = 0;
@@ -3313,19 +3259,19 @@ make_wireless_setting (shvarFile *ifcfg,
value = svGetValue (ifcfg, "ESSID", TRUE);
if (value) {
- gsize ssid_len = 0, value_len = strlen (value);
- char *p = value, *tmp;
- char buf[33];
+ GBytes *bytes = NULL;
+ gsize ssid_len = 0;
+ gsize value_len = strlen (value);
- ssid_len = value_len;
if ( (value_len >= 2)
&& (value[0] == '"')
&& (value[value_len - 1] == '"')) {
/* Strip the quotes and unescape */
- p = value + 1;
+ char *p = value + 1;
+
value[value_len - 1] = '\0';
svUnescape (p);
- ssid_len = strlen (p);
+ bytes = g_bytes_new (p, strlen (p));
} else if ((value_len > 2) && (strncmp (value, "0x", 2) == 0)) {
/* Hex representation */
if (value_len % 2) {
@@ -3336,34 +3282,27 @@ make_wireless_setting (shvarFile *ifcfg,
goto error;
}
- p = value + 2;
- while (*p) {
- if (!g_ascii_isxdigit (*p)) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)",
- value, *p);
- g_free (value);
- goto error;
- }
- p++;
+ bytes = nm_utils_hexstr2bin (value);
+ if (!bytes) {
+ g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
+ "Invalid SSID '%s' (looks like hex SSID but isn't)",
+ value);
+ g_free (value);
+ goto error;
}
+ } else
+ bytes = g_bytes_new (value, value_len);
- tmp = nm_utils_hexstr2bin (value + 2, value_len - 2);
- ssid_len = (value_len - 2) / 2;
- memcpy (buf, tmp, ssid_len);
- p = &buf[0];
- g_free (tmp);
- }
-
+ ssid_len = g_bytes_get_size (bytes);
if (ssid_len > 32 || ssid_len == 0) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid SSID '%s' (size %zu not between 1 and 32 inclusive)",
value, ssid_len);
+ g_bytes_unref (bytes);
g_free (value);
goto error;
}
- bytes = g_bytes_new (p, ssid_len);
g_object_set (s_wireless, NM_SETTING_WIRELESS_SSID, bytes, NULL);
g_bytes_unref (bytes);
g_free (value);
@@ -3405,7 +3344,7 @@ make_wireless_setting (shvarFile *ifcfg,
value = svGetValue (ifcfg, "CHANNEL", FALSE);
if (value) {
errno = 0;
- chan = nm_utils_ascii_str_to_int64 (value, 10, 1, 196, 0);
+ chan = _nm_utils_ascii_str_to_int64 (value, 10, 1, 196, 0);
if (errno || (chan == 0)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid wireless channel '%s'", value);
@@ -3468,6 +3407,11 @@ make_wireless_setting (shvarFile *ifcfg,
svTrueValue (ifcfg, "SSID_HIDDEN", FALSE),
NULL);
+ g_object_set (s_wireless,
+ NM_SETTING_WIRELESS_POWERSAVE,
+ svTrueValue (ifcfg, "POWERSAVE", FALSE) ? 1 : 0,
+ NULL);
+
return NM_SETTING (s_wireless);
error:
@@ -3490,11 +3434,11 @@ wireless_connection_from_ifcfg (const char *file,
char *printable_ssid = NULL;
const char *mode;
gboolean adhoc = FALSE;
+ GError *local = NULL;
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (ifcfg != NULL, NULL);
- g_return_val_if_fail (error != NULL, NULL);
- g_return_val_if_fail (*error == NULL, NULL);
+ g_return_val_if_fail (!error || !*error, NULL);
connection = nm_simple_connection_new ();
@@ -3518,10 +3462,11 @@ wireless_connection_from_ifcfg (const char *file,
adhoc = TRUE;
/* Wireless security */
- security_setting = make_wireless_security_setting (ifcfg, file, ssid, adhoc, &s_8021x, error);
- if (*error) {
+ security_setting = make_wireless_security_setting (ifcfg, file, ssid, adhoc, &s_8021x, &local);
+ if (local) {
g_free (printable_ssid);
g_object_unref (connection);
+ g_propagate_error (error, local);
return NULL;
}
if (security_setting) {
@@ -3903,7 +3848,8 @@ handle_bond_option (NMSettingBond *s_bond,
}
if (!nm_setting_bond_add_option (s_bond, key, sanitized ? sanitized : value))
- PARSE_WARNING ("invalid bonding option '%s'", key);
+ PARSE_WARNING ("invalid bonding option '%s' = %s",
+ key, sanitized ? sanitized : value);
g_free (sanitized);
}
@@ -4146,6 +4092,12 @@ handle_bridge_option (NMSetting *setting,
g_object_set (setting, NM_SETTING_BRIDGE_AGEING_TIME, u, NULL);
else
PARSE_WARNING ("invalid ageing_time value '%s'", value);
+ } else if (!strcmp (key, "multicast_snooping")) {
+ if (get_uint (value, &u))
+ g_object_set (setting, NM_SETTING_BRIDGE_MULTICAST_SNOOPING,
+ (gboolean) u, NULL);
+ else
+ PARSE_WARNING ("invalid multicast_snooping value '%s'", value);
} else
PARSE_WARNING ("unhandled bridge option '%s'", key);
}
@@ -4508,6 +4460,7 @@ make_vlan_setting (shvarFile *ifcfg,
goto error;
}
g_object_set (s_vlan, NM_SETTING_VLAN_PARENT, parent, NULL);
+ g_clear_pointer (&parent, g_free);
if (svTrueValue (ifcfg, "REORDER_HDR", FALSE))
vlan_flags |= NM_VLAN_FLAG_REORDER_HEADERS;
@@ -4526,6 +4479,8 @@ make_vlan_setting (shvarFile *ifcfg,
parse_prio_map_list (s_vlan, ifcfg, "VLAN_INGRESS_PRIORITY_MAP", NM_VLAN_INGRESS_MAP);
parse_prio_map_list (s_vlan, ifcfg, "VLAN_EGRESS_PRIORITY_MAP", NM_VLAN_EGRESS_MAP);
+ g_free (iface_name);
+
return (NMSetting *) s_vlan;
error:
@@ -4653,7 +4608,7 @@ uuid_from_file (const char *filename)
uuid = svGetValue (ifcfg, "UUID", FALSE);
if (!uuid || !strlen (uuid)) {
g_free (uuid);
- uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName);
+ uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
}
svCloseFile (ifcfg);
@@ -4669,7 +4624,7 @@ check_dns_search_domains (shvarFile *ifcfg, NMSetting *s_ip4, NMSetting *s_ip6)
/* If there is no IPv4 config or it doesn't contain DNS searches,
* read DOMAIN and put the domains into IPv6.
*/
- if (!s_ip4 || nm_setting_ip4_config_get_num_dns_searches (NM_SETTING_IP4_CONFIG (s_ip4)) == 0) {
+ if (!s_ip4 || nm_setting_ip_config_get_num_dns_searches (NM_SETTING_IP_CONFIG (s_ip4)) == 0) {
/* DNS searches */
char *value = svGetValue (ifcfg, "DOMAIN", FALSE);
if (value) {
@@ -4678,7 +4633,7 @@ check_dns_search_domains (shvarFile *ifcfg, NMSetting *s_ip4, NMSetting *s_ip6)
char **item;
for (item = searches; *item; item++) {
if (strlen (*item)) {
- if (!nm_setting_ip6_config_add_dns_search (NM_SETTING_IP6_CONFIG (s_ip6), *item))
+ if (!nm_setting_ip_config_add_dns_search (NM_SETTING_IP_CONFIG (s_ip6), *item))
PARSE_WARNING ("duplicate DNS domain '%s'", *item);
}
}
@@ -4689,32 +4644,24 @@ check_dns_search_domains (shvarFile *ifcfg, NMSetting *s_ip4, NMSetting *s_ip6)
}
}
-NMConnection *
-connection_from_file (const char *filename,
- const char *network_file, /* for unit tests only */
- const char *test_type, /* for unit tests only */
- char **out_unhandled,
- char **out_keyfile,
- char **out_routefile,
- char **out_route6file,
- GError **error,
- gboolean *out_ignore_error)
+static NMConnection *
+connection_from_file_full (const char *filename,
+ const char *network_file, /* for unit tests only */
+ const char *test_type, /* for unit tests only */
+ char **out_unhandled,
+ GError **error,
+ gboolean *out_ignore_error)
{
NMConnection *connection = NULL;
shvarFile *parsed;
- char *type, *devtype, *bootproto;
+ gs_free char *type = NULL;
+ char *devtype, *bootproto;
NMSetting *s_ip4, *s_ip6, *s_port, *s_dcb = NULL;
const char *ifcfg_name = NULL;
g_return_val_if_fail (filename != NULL, NULL);
if (out_unhandled)
g_return_val_if_fail (*out_unhandled == NULL, NULL);
- if (out_keyfile)
- g_return_val_if_fail (*out_keyfile == NULL, NULL);
- if (out_routefile)
- g_return_val_if_fail (*out_routefile == NULL, NULL);
- if (out_route6file)
- g_return_val_if_fail (*out_route6file == NULL, NULL);
/* Non-NULL only for unit tests; normally use /etc/sysconfig/network */
if (!network_file)
@@ -4750,8 +4697,7 @@ connection_from_file (const char *filename,
g_free (bootproto);
goto done;
}
-
- type = NULL;
+ g_free (bootproto);
devtype = svGetValue (parsed, "DEVICETYPE", FALSE);
if (devtype) {
@@ -4840,7 +4786,6 @@ connection_from_file (const char *filename,
PARSE_WARNING ("connection type was unrecognized but device was not uniquely identified; device may be managed");
goto done;
}
- g_free (type);
if (!connection)
goto done;
@@ -4859,7 +4804,7 @@ connection_from_file (const char *filename,
connection = NULL;
goto done;
} else {
- read_aliases (NM_SETTING_IP4_CONFIG (s_ip4), filename, network_file);
+ read_aliases (NM_SETTING_IP_CONFIG (s_ip4), filename, network_file);
nm_connection_add_setting (connection, s_ip4);
}
@@ -4892,15 +4837,64 @@ connection_from_file (const char *filename,
connection = NULL;
}
- if (out_keyfile)
- *out_keyfile = utils_get_keys_path (filename);
- if (out_routefile)
- *out_routefile = utils_get_route_path (filename);
- if (out_route6file)
- *out_route6file = utils_get_route6_path (filename);
-
done:
svCloseFile (parsed);
return connection;
}
+NMConnection *
+connection_from_file (const char *filename,
+ char **out_unhandled,
+ GError **error)
+{
+ gboolean ignore_error = FALSE;
+ NMConnection *conn;
+
+ conn = connection_from_file_full (filename, NULL, NULL,
+ out_unhandled,
+ error,
+ &ignore_error);
+ if (error && *error && !ignore_error)
+ PARSE_WARNING ("%s", (*error)->message);
+ return conn;
+}
+
+NMConnection *
+connection_from_file_test (const char *filename,
+ const char *network_file,
+ const char *test_type,
+ char **out_unhandled,
+ GError **error)
+{
+ return connection_from_file_full (filename,
+ network_file,
+ test_type,
+ out_unhandled,
+ error,
+ NULL);
+}
+
+guint
+devtimeout_from_file (const char *filename)
+{
+ shvarFile *ifcfg;
+ char *devtimeout_str;
+ guint devtimeout;
+
+ g_return_val_if_fail (filename != NULL, 0);
+
+ ifcfg = svOpenFile (filename, NULL);
+ if (!ifcfg)
+ return 0;
+
+ devtimeout_str = svGetValue (ifcfg, "DEVTIMEOUT", FALSE);
+ if (devtimeout_str) {
+ devtimeout = _nm_utils_ascii_str_to_int64 (devtimeout_str, 10, 0, G_MAXUINT, 0);
+ g_free (devtimeout_str);
+ } else
+ devtimeout = 0;
+
+ svCloseFile (ifcfg);
+
+ return devtimeout;
+}
diff --git a/src/settings/plugins/ifcfg-rh/reader.h b/src/settings/plugins/ifcfg-rh/reader.h
index c23e5870ef..70e9ce4e24 100644
--- a/src/settings/plugins/ifcfg-rh/reader.h
+++ b/src/settings/plugins/ifcfg-rh/reader.h
@@ -27,15 +27,18 @@
#include "shvar.h"
NMConnection *connection_from_file (const char *filename,
- const char *network_file, /* for unit tests only */
- const char *test_type, /* for unit tests only */
char **out_unhandled,
- char **out_keyfile,
- char **out_routefile,
- char **out_route6file,
- GError **error,
- gboolean *out_ignore_error);
+ GError **error);
char *uuid_from_file (const char *filename);
+guint devtimeout_from_file (const char *filename);
+
+/* for test-ifcfg-rh */
+NMConnection *connection_from_file_test (const char *filename,
+ const char *network_file,
+ const char *test_type,
+ char **out_unhandled,
+ GError **error);
+
#endif /* __READER_H__ */
diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c
index b4c911fb6d..ed12683072 100644
--- a/src/settings/plugins/ifcfg-rh/shvar.c
+++ b/src/settings/plugins/ifcfg-rh/shvar.c
@@ -23,6 +23,8 @@
*
*/
+#include "config.h"
+
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -34,7 +36,7 @@
#include "shvar.h"
-#include "NetworkManagerUtils.h"
+#include "nm-core-internal.h"
#include "nm-logging.h"
#define PARSE_WARNING(msg...) nm_log_warn (LOGD_SETTINGS, " " msg)
@@ -238,8 +240,7 @@ svEscape (const char *s)
new[j++] = s[i];
}
new[j++] = '"';
- new[j++] = '\0'
-;
+ new[j++] = '\0';
g_assert (j == slen + mangle - newline + 3);
return new;
@@ -266,7 +267,8 @@ svGetValue (shvarFile *s, const char *key, gboolean verbatim)
for (s->current = s->lineList; s->current; s->current = s->current->next) {
line = s->current->data;
if (!strncmp (keyString, line, len)) {
- value = g_strdup (line + len);
+ /* Strip trailing spaces before unescaping to preserve spaces quoted whitespace */
+ value = g_strchomp (g_strdup (line + len));
if (!verbatim)
svUnescape (value);
break;
@@ -319,7 +321,7 @@ svTrueValue (shvarFile *s, const char *key, gboolean def)
* @max: the maximum for range-check
* @fallback: the fallback value in any error case
*
- * Reads a value @key and converts it to an integer using nm_utils_ascii_str_to_int64().
+ * Reads a value @key and converts it to an integer using _nm_utils_ascii_str_to_int64().
* In case of error, @errno will be set and @fallback returned. */
gint64
svGetValueInt64 (shvarFile *s, const char *key, guint base, gint64 min, gint64 max, gint64 fallback)
@@ -334,7 +336,7 @@ svGetValueInt64 (shvarFile *s, const char *key, guint base, gint64 min, gint64 m
return fallback;
}
- result = nm_utils_ascii_str_to_int64 (tmp, base, min, max, fallback);
+ result = _nm_utils_ascii_str_to_int64 (tmp, base, min, max, fallback);
errsv = errno;
if (errsv != 0)
PARSE_WARNING ("Error reading '%s' value '%s' as integer (%d)", key, tmp, errsv);
@@ -370,10 +372,12 @@ svSetValue (shvarFile *s, const char *key, const char *value, gboolean verbatim)
if (oldval) {
/* delete line */
s->lineList = g_list_remove_link (s->lineList, s->current);
+ g_free (s->current->data);
g_list_free_1 (s->current);
s->modified = TRUE;
}
- goto bail; /* do not need keyValue */
+ g_free (keyValue);
+ goto end;
}
if (!oldval) {
@@ -385,21 +389,19 @@ svSetValue (shvarFile *s, const char *key, const char *value, gboolean verbatim)
if (strcmp (oldval, newval) != 0) {
/* change line */
- if (s->current)
+ if (s->current) {
+ g_free (s->current->data);
s->current->data = keyValue;
- else
+ } else
s->lineList = g_list_append (s->lineList, keyValue);
s->modified = TRUE;
- }
+ } else
+ g_free (keyValue);
end:
g_free (newval);
g_free (oldval);
return;
-
- bail:
- g_free (keyValue);
- goto end;
}
/* Write the current contents iff modified. Returns FALSE on error
diff --git a/src/settings/plugins/ifcfg-rh/tests/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/Makefile.am
index 5a17ed9bb6..a3f6a05204 100644
--- a/src/settings/plugins/ifcfg-rh/tests/Makefile.am
+++ b/src/settings/plugins/ifcfg-rh/tests/Makefile.am
@@ -47,6 +47,7 @@ test_ifcfg_rh_utils_SOURCES = \
test_ifcfg_rh_utils_LDADD = \
$(top_builddir)/src/libNetworkManager.la
+@VALGRIND_RULES@
TESTS = test-ifcfg-rh-utils test-ifcfg-rh
endif
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
index 9c9a3b13f8..a20a78d9a5 100644
--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
@@ -9,10 +9,12 @@ EXTRA_DIST = \
ifcfg-test-wired-static-bootproto \
ifcfg-test-wired-dhcp \
ifcfg-test-wired-dhcp-plus-ip \
+ ifcfg-test-wired-shared-plus-ip \
ifcfg-test-wired-dhcp-send-hostname \
ifcfg-test-wired-dhcp6-only \
ifcfg-test-wired-global-gateway \
network-test-wired-global-gateway \
+ ifcfg-test-wired-obsolete-gateway-n \
ifcfg-test-wired-never-default \
network-test-wired-never-default \
ifcfg-test-wired-defroute-no \
@@ -106,6 +108,7 @@ EXTRA_DIST = \
ifcfg-test-bond-main \
ifcfg-test-bond-slave \
ifcfg-test-bond-slave-ib \
+ ifcfg-test-bond-mode-numeric \
ifcfg-test-dcb \
ifcfg-test-dcb-default-app-priorities \
ifcfg-test-dcb-bad-booleans \
@@ -119,7 +122,8 @@ EXTRA_DIST = \
ifcfg-test-fcoe-vn2vn \
ifcfg-test-team-master \
ifcfg-test-team-port \
- ifcfg-test-team-port-empty-config
+ ifcfg-test-team-port-empty-config \
+ ifcfg-test-vlan-trailing-spaces
# make target dependencies can't have colons in their names, which ends up
# meaning that we can't add the alias files to EXTRA_DIST
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-mode-numeric b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-mode-numeric
new file mode 100644
index 0000000000..9989f58b97
--- /dev/null
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-mode-numeric
@@ -0,0 +1,5 @@
+DEVICE=bond0
+ONBOOT=no
+TYPE=Bond
+BOOTPROTO=dhcp
+BONDING_OPTS="mode=4 miimon=100"
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main
index 8507628e3f..1d31b5ba05 100644
--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main
@@ -3,6 +3,6 @@ ONBOOT=no
TYPE=Bridge
BOOTPROTO=dhcp
STP=on
-DELAY=0
-BRIDGING_OPTS="priority=32744 hello_time=7 max_age=39 ageing_time=235352"
+DELAY=2
+BRIDGING_OPTS="priority=32744 hello_time=7 max_age=39 ageing_time=235352 multicast_snooping=0"
MACADDR=00:16:41:11:22:33
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-trailing-spaces b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-trailing-spaces
new file mode 100644
index 0000000000..4a31e475ae
--- /dev/null
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-trailing-spaces
@@ -0,0 +1,11 @@
+DEVICE="vlan201"
+ONBOOT=yes
+NETBOOT=yes
+BOOTPROTO=none
+IPADDR="10.130.70.7"
+NETMASK="255.255.0.0"
+TYPE=Vlan
+NAME="vlan201"
+VLAN=yes
+PHYSDEV="enccw0.0.fb00"
+
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open
index 48db45b25d..b089103dae 100644
--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open
@@ -12,3 +12,5 @@ ONBOOT=yes
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
+IPV4_ROUTE_METRIC=104
+IPV6_ROUTE_METRIC=106
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-plus-ip b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-plus-ip
index f0c022a9d0..af254f9c22 100644
--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-plus-ip
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-plus-ip
@@ -15,11 +15,11 @@ DNS3=1:2:3:4::a
DNS4=1:2:3:4::b
# additional IPs
-IPADDR0=1.2.3.4
-PREFIX0=24
-GATEWAY0=1.1.1.1
+IPADDR=1.2.3.4
+PREFIX=24
IPADDR1=9.8.7.6
PREFIX1=16
+GATEWAY=1.1.1.1
IPV6ADDR="1001:abba::1234/56"
IPV6ADDR_SECONDARIES="2001:abba::2234/64 3001:abba::3234/96"
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-1 b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-1
index cad0f6cf36..1bc3d5241c 100644
--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-1
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-1
@@ -5,8 +5,8 @@ HWADDR=00:11:22:33:44:ee
BOOTPROTO=none
IPADDR0=1.2.3.4
PREFIX0=24
-GATEWAY0=1.1.1.1
IPADDR1=9.8.7.6
PREFIX1=16
IPADDR2=3.3.3.3
PREFIX2=8
+GATEWAY=1.1.1.1
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-2 b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-2
index ad9290a4dd..d7273e3600 100644
--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-2
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv4-manual-2
@@ -5,10 +5,7 @@ HWADDR=00:11:22:33:44:ee
BOOTPROTO=none
IPADDR=1.2.3.4
PREFIX=24
-GATEWAY=1.1.1.1
IPADDR2=9.8.7.6
PREFIX2=16
-GATEWAY2=5.5.5.5
IPADDR3=3.3.3.3
PREFIX3=8
-GATEWAY3=7.7.7.7
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-obsolete-gateway-n b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-obsolete-gateway-n
new file mode 100644
index 0000000000..2190a9959f
--- /dev/null
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-obsolete-gateway-n
@@ -0,0 +1,13 @@
+# GATEWAY<N> is obsolete, but we read it for backwards compatibility
+
+TYPE=Ethernet
+DEVICE=eth0
+HWADDR=00:11:22:33:44:ee
+BOOTPROTO=none
+ONBOOT=yes
+
+# manual IP
+IPADDR1=1.2.3.4
+PREFIX1=24
+GATEWAY1=1.1.1.1
+
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-shared-plus-ip b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-shared-plus-ip
new file mode 100644
index 0000000000..5098aef79c
--- /dev/null
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-shared-plus-ip
@@ -0,0 +1,19 @@
+# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
+TYPE=Ethernet
+DEVICE=eth0
+HWADDR=00:11:22:33:44:ee
+BOOTPROTO=shared
+ONBOOT=no
+IPV6INIT=yes
+
+# additional IPs
+IPADDR=10.20.30.5
+PREFIX=24
+GATEWAY=1.1.1.1
+
+# these are ignored for shared method
+IPADDR1=6.7.8.9
+PREFIX1=16
+IPADDR2=3.3.3.3
+PREFIX2=24
+
diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c
index 39c81027fe..8494c63825 100644
--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c
+++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
@@ -119,7 +121,7 @@ int main (int argc, char **argv)
{
char *base;
- nmtst_init (&argc, &argv, TRUE);
+ nmtst_init_assert_logging (&argc, &argv);
/* The tests */
test_get_ifcfg_name ("get-ifcfg-name-bad", "/foo/bar/adfasdfadf", FALSE, NULL);
diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
index b2d91e46f6..e5e4f3d477 100644
--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
+++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
@@ -183,8 +185,8 @@ test_read_basic (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
GError *error = NULL;
const char *mac;
char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 };
@@ -192,8 +194,8 @@ test_read_basic (void)
guint64 expected_timestamp = 0;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-minimal",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-minimal",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -225,14 +227,14 @@ test_read_basic (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
- g_assert (nm_setting_ip4_config_get_never_default (s_ip4) == FALSE);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
+ g_assert (nm_setting_ip_config_get_never_default (s_ip4) == FALSE);
/* ===== IPv6 SETTING ===== */
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
- g_assert_cmpstr (nm_setting_ip6_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
- g_assert (nm_setting_ip6_config_get_never_default (s_ip6) == FALSE);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
+ g_assert (nm_setting_ip_config_get_never_default (s_ip6) == FALSE);
g_object_unref (connection);
}
@@ -243,7 +245,7 @@ test_read_miscellaneous_variables (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
char *expected_mac_blacklist[3] = { "00:16:41:11:22:88", "00:16:41:11:22:99", "6a:5d:5a:fa:dd:f0" };
int mac_blacklist_num, i;
@@ -252,8 +254,8 @@ test_read_miscellaneous_variables (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*invalid MAC in HWADDR_BLACKLIST 'XX:aa:invalid'*");
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-misc-variables",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-misc-variables",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_test_assert_expected_messages ();
g_assert_no_error (error);
g_assert (connection);
@@ -281,8 +283,8 @@ test_read_miscellaneous_variables (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
- g_assert (nm_setting_ip4_config_get_never_default (s_ip4) == FALSE);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
+ g_assert (nm_setting_ip_config_get_never_default (s_ip4) == FALSE);
g_object_unref (connection);
}
@@ -293,7 +295,7 @@ test_read_variables_corner_cases (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *mac;
char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 };
@@ -302,8 +304,8 @@ test_read_variables_corner_cases (void)
guint64 expected_timestamp = 0;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-variables-corner-cases-1",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-variables-corner-cases-1",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -331,8 +333,8 @@ test_read_variables_corner_cases (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
- g_assert (nm_setting_ip4_config_get_never_default (s_ip4) == FALSE);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
+ g_assert (nm_setting_ip_config_get_never_default (s_ip4) == FALSE);
g_object_unref (connection);
}
@@ -348,10 +350,10 @@ test_read_unmanaged (void)
guint64 expected_timestamp = 0;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled",
- NULL, TYPE_ETHERNET,
- &unhandled_spec,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled",
+ NULL, TYPE_ETHERNET,
+ &unhandled_spec,
+ &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -375,16 +377,16 @@ test_read_unmanaged_unrecognized (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- char *unhandled_spec = NULL;
+ gs_free char *unhandled_spec = NULL;
GError *error = NULL;
const char *expected_id = "PigeonNet";
guint64 expected_timestamp = 0;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled-unrecognized",
- NULL, NULL,
- &unhandled_spec,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled-unrecognized",
+ NULL, NULL,
+ &unhandled_spec,
+ &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -406,16 +408,16 @@ test_read_unrecognized (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- char *unhandled_spec = NULL;
+ gs_free char *unhandled_spec = NULL;
GError *error = NULL;
const char *expected_id = "U Can't Touch This";
guint64 expected_timestamp = 0;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-unrecognized",
- NULL, NULL,
- &unhandled_spec,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-unrecognized",
+ NULL, NULL,
+ &unhandled_spec,
+ &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -440,21 +442,18 @@ test_read_wired_static (const char *file,
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *unmanaged = NULL;
GError *error = NULL;
const char *mac;
char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0xee };
- struct in6_addr addr6;
- const char *expected6_address1 = "dead:beaf::1";
- const char *expected6_address2 = "dead:beaf::2";
- NMIP4Address *ip4_addr;
- NMIP6Address *ip6_addr;
+ NMIPAddress *ip4_addr;
+ NMIPAddress *ip6_addr;
gboolean success;
- connection = connection_from_file (file, NULL, TYPE_ETHERNET,
- &unmanaged, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (file, NULL, TYPE_ETHERNET,
+ &unmanaged, &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -482,53 +481,52 @@ test_read_wired_static (const char *file,
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
- g_assert (nm_setting_ip4_config_get_may_fail (s_ip4));
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
+ g_assert (nm_setting_ip_config_get_may_fail (s_ip4));
/* DNS Addresses */
- g_assert_cmpint (nm_setting_ip4_config_get_num_dns (s_ip4), ==, 2);
- g_assert_cmpstr (nm_setting_ip4_config_get_dns (s_ip4, 0), ==, "4.2.2.1");
- g_assert_cmpstr (nm_setting_ip4_config_get_dns (s_ip4, 1), ==, "4.2.2.2");
+ g_assert_cmpint (nm_setting_ip_config_get_num_dns (s_ip4), ==, 2);
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip4, 0), ==, "4.2.2.1");
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip4, 1), ==, "4.2.2.2");
/* IP addresses */
- g_assert_cmpint (nm_setting_ip4_config_get_num_addresses (s_ip4), ==, 1);
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 1);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
g_assert (ip4_addr);
- g_assert_cmpint (nm_ip4_address_get_prefix (ip4_addr), ==, 24);
- nmtst_assert_ip4_address_equals (nm_ip4_address_get_address (ip4_addr), "192.168.1.5");
- nmtst_assert_ip4_address_equals (nm_ip4_address_get_gateway (ip4_addr), "192.168.1.1");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "192.168.1.5");
+
+ /* Gateway */
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.1.1");
/* ===== IPv6 SETTING ===== */
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
if (expect_ip6) {
- g_assert_cmpstr (nm_setting_ip6_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_MANUAL);
- g_assert (nm_setting_ip6_config_get_may_fail (s_ip6));
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_MANUAL);
+ g_assert (nm_setting_ip_config_get_may_fail (s_ip6));
/* DNS Addresses */
- g_assert_cmpint (nm_setting_ip6_config_get_num_dns (s_ip6), ==, 2);
- g_assert_cmpstr (nm_setting_ip6_config_get_dns (s_ip6, 0), ==, "1:2:3:4::a");
- g_assert_cmpstr (nm_setting_ip6_config_get_dns (s_ip6, 1), ==, "1:2:3:4::b");
+ g_assert_cmpint (nm_setting_ip_config_get_num_dns (s_ip6), ==, 2);
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip6, 0), ==, "1:2:3:4::a");
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip6, 1), ==, "1:2:3:4::b");
/* IP addresses */
- g_assert_cmpint (nm_setting_ip6_config_get_num_addresses (s_ip6), ==, 2);
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip6), ==, 2);
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 0);
g_assert (ip6_addr);
- g_assert_cmpint (nm_ip6_address_get_prefix (ip6_addr), ==, 64);
- g_assert_cmpint (inet_pton (AF_INET6, expected6_address1, &addr6), >, 0);
- g_assert (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6));
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 64);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "dead:beaf::1");
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 1);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 1);
g_assert (ip6_addr);
- g_assert_cmpint (nm_ip6_address_get_prefix (ip6_addr), ==, 56);
- g_assert_cmpint (inet_pton (AF_INET6, expected6_address2, &addr6), >, 0);
- g_assert (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6));
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 56);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "dead:beaf::2");
} else {
- g_assert_cmpstr (nm_setting_ip6_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
}
- g_free (unmanaged);
g_object_unref (connection);
}
@@ -538,9 +536,9 @@ test_read_wired_static_no_prefix (gconstpointer user_data)
guint32 expected_prefix = GPOINTER_TO_UINT (user_data);
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
- NMIP4Address *ip4_addr;
+ NMIPAddress *ip4_addr;
char *file, *expected_id;
file = g_strdup_printf (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-wired-static-no-prefix-%u", expected_prefix);
@@ -548,8 +546,8 @@ test_read_wired_static_no_prefix (gconstpointer user_data)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*missing PREFIX, assuming*");
- connection = connection_from_file (file, NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, NULL,
+ &error);
g_test_assert_expected_messages ();
g_assert_no_error (error);
g_assert (connection);
@@ -563,12 +561,12 @@ test_read_wired_static_no_prefix (gconstpointer user_data)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
- g_assert_cmpint (nm_setting_ip4_config_get_num_addresses (s_ip4), ==, 1);
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 1);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
g_assert (ip4_addr);
- g_assert_cmpint (nm_ip4_address_get_prefix (ip4_addr), ==, expected_prefix);
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, expected_prefix);
g_free (file);
g_free (expected_id);
@@ -583,12 +581,8 @@ test_read_wired_dhcp (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *mac;
char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0xee };
@@ -596,15 +590,11 @@ test_read_wired_dhcp (void)
const char *expected_id = "System test-wired-dhcp";
const char *expected_dhcp_hostname = "foobar";
- connection = connection_from_file (TEST_IFCFG_WIRED_DHCP,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_DHCP,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-dhcp-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP, error->message);
@@ -679,54 +669,50 @@ test_read_wired_dhcp (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wired-dhcp-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DHCP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- tmp = nm_setting_ip4_config_get_dhcp_hostname (s_ip4);
+ tmp = nm_setting_ip_config_get_dhcp_hostname (s_ip4);
ASSERT (tmp != NULL,
"wired-dhcp-verify-ip4", "failed to verify %s: missing %s / %s key",
TEST_IFCFG_WIRED_DHCP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME);
+ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME);
ASSERT (strcmp (tmp, expected_dhcp_hostname) == 0,
"wired-dhcp-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DHCP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME);
+ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME);
- ASSERT (nm_setting_ip4_config_get_ignore_auto_dns (s_ip4) == TRUE,
+ ASSERT (nm_setting_ip_config_get_ignore_auto_dns (s_ip4) == TRUE,
"wired-dhcp-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DHCP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS);
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS);
/* DNS Addresses */
- ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip4) == 2,
"wired-dhcp-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DHCP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip4_config_get_dns (s_ip4, 0), "4.2.2.1") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip4, 0), "4.2.2.1") == 0,
"wired-dhcp-verify-ip4", "failed to verify %s: unexpected %s / %s key value #1",
TEST_IFCFG_WIRED_DHCP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip4_config_get_dns (s_ip4, 1), "4.2.2.2") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip4, 1), "4.2.2.2") == 0,
"wired-dhcp-verify-ip4", "failed to verify %s: unexpected %s / %s key value #2",
TEST_IFCFG_WIRED_DHCP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -734,18 +720,16 @@ static void
test_read_wired_dhcp_plus_ip (void)
{
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
GError *error = NULL;
- guint32 addr4;
- struct in6_addr addr6;
- NMIP4Address *ip4_addr;
- NMIP6Address *ip6_addr;
+ NMIPAddress *ip4_addr;
+ NMIPAddress *ip6_addr;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip",
- NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip",
+ NULL, TYPE_ETHERNET, NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -755,60 +739,88 @@ test_read_wired_dhcp_plus_ip (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
- g_assert (nm_setting_ip4_config_get_may_fail (s_ip4));
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+ g_assert (nm_setting_ip_config_get_may_fail (s_ip4));
/* DNS Addresses */
- g_assert_cmpint (nm_setting_ip4_config_get_num_dns (s_ip4), ==, 2);
- g_assert_cmpstr (nm_setting_ip4_config_get_dns (s_ip4, 0), ==, "4.2.2.1");
- g_assert_cmpstr (nm_setting_ip4_config_get_dns (s_ip4, 1), ==, "4.2.2.2");
+ g_assert_cmpint (nm_setting_ip_config_get_num_dns (s_ip4), ==, 2);
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip4, 0), ==, "4.2.2.1");
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip4, 1), ==, "4.2.2.2");
/* IP addresses */
- g_assert_cmpint (nm_setting_ip4_config_get_num_addresses (s_ip4), ==, 2);
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 2);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
g_assert (ip4_addr);
- g_assert_cmpint (nm_ip4_address_get_prefix (ip4_addr), ==, 24);
- g_assert_cmpint (inet_pton (AF_INET, "1.2.3.4", &addr4), >, 0);
- g_assert_cmpint (nm_ip4_address_get_address (ip4_addr), ==, addr4);
- g_assert_cmpint (inet_pton (AF_INET, "1.1.1.1", &addr4), >, 0);
- g_assert_cmpint (nm_ip4_address_get_gateway (ip4_addr), ==, addr4);
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "1.2.3.4");
+
+ /* Gateway */
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "1.1.1.1");
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 1);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 1);
g_assert (ip4_addr);
- g_assert_cmpint (nm_ip4_address_get_prefix (ip4_addr), ==, 16);
- g_assert_cmpint (inet_pton (AF_INET, "9.8.7.6", &addr4), >, 0);
- g_assert_cmpint (nm_ip4_address_get_address (ip4_addr), ==, addr4);
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 16);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "9.8.7.6");
/* ===== IPv6 SETTING ===== */
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
- g_assert_cmpstr (nm_setting_ip6_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
- g_assert (nm_setting_ip6_config_get_may_fail (s_ip6));
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
+ g_assert (nm_setting_ip_config_get_may_fail (s_ip6));
/* DNS Addresses */
- g_assert_cmpint (nm_setting_ip6_config_get_num_dns (s_ip6), ==, 2);
- g_assert_cmpstr (nm_setting_ip6_config_get_dns (s_ip6, 0), ==, "1:2:3:4::a");
- g_assert_cmpstr (nm_setting_ip6_config_get_dns (s_ip6, 1), ==, "1:2:3:4::b");
+ g_assert_cmpint (nm_setting_ip_config_get_num_dns (s_ip6), ==, 2);
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip6, 0), ==, "1:2:3:4::a");
+ g_assert_cmpstr (nm_setting_ip_config_get_dns (s_ip6, 1), ==, "1:2:3:4::b");
/* IP addresses */
- g_assert_cmpint (nm_setting_ip6_config_get_num_addresses (s_ip6), ==, 3);
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0);
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip6), ==, 3);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 0);
g_assert (ip6_addr);
- g_assert_cmpint (nm_ip6_address_get_prefix (ip6_addr), ==, 56);
- g_assert_cmpint (inet_pton (AF_INET6, "1001:abba::1234", &addr6), >, 0);
- g_assert (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6));
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 56);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "1001:abba::1234");
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 1);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 1);
g_assert (ip6_addr);
- g_assert_cmpint (nm_ip6_address_get_prefix (ip6_addr), ==, 64);
- g_assert_cmpint (inet_pton (AF_INET6, "2001:abba::2234", &addr6), >, 0);
- g_assert (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6));
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 64);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "2001:abba::2234");
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 2);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 2);
g_assert (ip6_addr);
- g_assert_cmpint (nm_ip6_address_get_prefix (ip6_addr), ==, 96);
- g_assert_cmpint (inet_pton (AF_INET6, "3001:abba::3234", &addr6), >, 0);
- g_assert (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6));
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 96);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "3001:abba::3234");
+
+ g_object_unref (connection);
+}
+
+static void
+test_read_wired_shared_plus_ip (void)
+{
+ NMConnection *connection;
+ NMSettingIPConfig *s_ip4;
+ GError *error = NULL;
+ NMIPAddress *ip4_addr;
+
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-shared-plus-ip",
+ NULL, TYPE_ETHERNET, NULL,
+ &error);
+ nmtst_assert_connection_verifies_without_normalization (connection);
+
+ /* ===== IPv4 SETTING ===== */
+ s_ip4 = nm_connection_get_setting_ip4_config (connection);
+ g_assert (s_ip4);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_SHARED);
+ g_assert (nm_setting_ip_config_get_may_fail (s_ip4));
+
+ /* IP addresses */
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 1);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert (ip4_addr);
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "10.20.30.5");
+
+ /* Gateway */
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "1.1.1.1");
g_object_unref (connection);
}
@@ -819,14 +831,14 @@ test_read_wired_global_gateway (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
- NMIP4Address *ip4_addr;
+ NMIPAddress *ip4_addr;
char *unmanaged = NULL;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-global-gateway",
- TEST_IFCFG_DIR"/network-scripts/network-test-wired-global-gateway",
- TYPE_ETHERNET, &unmanaged, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-global-gateway",
+ TEST_IFCFG_DIR"/network-scripts/network-test-wired-global-gateway",
+ TYPE_ETHERNET, &unmanaged, &error);
nmtst_assert_connection_verifies_without_normalization (connection);
g_assert (unmanaged == NULL);
@@ -842,14 +854,47 @@ test_read_wired_global_gateway (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
/* Address #1 */
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert (ip4_addr);
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "192.168.1.5");
+
+ /* Gateway */
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.1.2");
+
+ g_object_unref (connection);
+}
+
+static void
+test_read_wired_obsolete_gateway_n (void)
+{
+ NMConnection *connection;
+ NMSettingIPConfig *s_ip4;
+ GError *error = NULL;
+ NMIPAddress *ip4_addr;
+
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-obsolete-gateway-n",
+ NULL, TYPE_ETHERNET, NULL,
+ &error);
+ nmtst_assert_connection_verifies_without_normalization (connection);
+
+ /* ===== IPv4 SETTING ===== */
+ s_ip4 = nm_connection_get_setting_ip4_config (connection);
+ g_assert (s_ip4);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
+
+ /* IP addresses */
+ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 1);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
g_assert (ip4_addr);
- g_assert_cmpint (nm_ip4_address_get_prefix (ip4_addr), ==, 24);
- nmtst_assert_ip4_address_equals (nm_ip4_address_get_address (ip4_addr), "192.168.1.5");
- nmtst_assert_ip4_address_equals (nm_ip4_address_get_gateway (ip4_addr), "192.168.1.2");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "1.2.3.4");
+
+ /* Gateway */
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "1.1.1.1");
g_object_unref (connection);
}
@@ -858,13 +903,13 @@ static void
test_read_wired_never_default (void)
{
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
GError *error = NULL;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-never-default",
- TEST_IFCFG_DIR"/network-scripts/network-test-wired-never-default",
- TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-never-default",
+ TEST_IFCFG_DIR"/network-scripts/network-test-wired-never-default",
+ TYPE_ETHERNET, NULL, &error);
nmtst_assert_connection_verifies_without_normalization (connection);
/* ===== WIRED SETTING ===== */
@@ -873,15 +918,15 @@ test_read_wired_never_default (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
- g_assert (nm_setting_ip4_config_get_never_default (s_ip4));
- g_assert_cmpint (nm_setting_ip4_config_get_num_dns (s_ip4), ==, 0);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+ g_assert (nm_setting_ip_config_get_never_default (s_ip4));
+ g_assert_cmpint (nm_setting_ip_config_get_num_dns (s_ip4), ==, 0);
/* ===== IPv6 SETTING ===== */
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
- g_assert_cmpstr (nm_setting_ip6_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
- g_assert (nm_setting_ip6_config_get_never_default (s_ip6));
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
+ g_assert (nm_setting_ip_config_get_never_default (s_ip6));
g_object_unref (connection);
}
@@ -894,26 +939,18 @@ test_read_wired_defroute_no (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System test-wired-defroute-no";
- connection = connection_from_file (TEST_IFCFG_WIRED_DEFROUTE_NO,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_DEFROUTE_NO,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-defroute-no-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DEFROUTE_NO, error->message);
@@ -961,18 +998,18 @@ test_read_wired_defroute_no (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wired-defroute-no-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DEFROUTE_NO,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip4_config_get_never_default (s_ip4) == TRUE,
+ ASSERT (nm_setting_ip_config_get_never_default (s_ip4) == TRUE,
"wired-defroute-no-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DEFROUTE_NO,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT);
/* ===== IPv6 SETTING ===== */
@@ -983,23 +1020,19 @@ test_read_wired_defroute_no (void)
NM_SETTING_IP6_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip6_config_get_method (s_ip6);
+ tmp = nm_setting_ip_config_get_method (s_ip6);
ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0,
"wired-defroute-no-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DEFROUTE_NO,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip6_config_get_never_default (s_ip6) == TRUE,
+ ASSERT (nm_setting_ip_config_get_never_default (s_ip6) == TRUE,
"wired-defroute-no-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DEFROUTE_NO,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_NEVER_DEFAULT);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -1012,26 +1045,18 @@ test_read_wired_defroute_no_gatewaydev_yes (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System test-wired-defroute-no-gatewaydev-yes";
- connection = connection_from_file (TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES,
- TEST_NETWORK_WIRED_DEFROUTE_NO_GATEWAYDEV_YES,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES,
+ TEST_NETWORK_WIRED_DEFROUTE_NO_GATEWAYDEV_YES,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-defroute-no-gatewaydev-yes-read",
"failed to read %s: %s",
@@ -1087,18 +1112,18 @@ test_read_wired_defroute_no_gatewaydev_yes (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wired-defroute-no-gatewaydev-yes-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip4_config_get_never_default (s_ip4) == FALSE,
+ ASSERT (nm_setting_ip_config_get_never_default (s_ip4) == FALSE,
"wired-defroute-no-gatewaydev-yes-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT);
/* ===== IPv6 SETTING ===== */
@@ -1109,23 +1134,19 @@ test_read_wired_defroute_no_gatewaydev_yes (void)
NM_SETTING_IP6_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip6_config_get_method (s_ip6);
- ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
- "wired-defroute-no-gatewaydev-yes-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
+ tmp = nm_setting_ip_config_get_method (s_ip6);
+ ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0,
+ "wired-defroute-no-gatewaydev-yes-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip6_config_get_never_default (s_ip6) == FALSE,
- "wired-defroute-no-gatewaydev-yes-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
+ ASSERT (nm_setting_ip_config_get_never_default (s_ip6) == FALSE,
+ "wired-defroute-no-gatewaydev-yes-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_NEVER_DEFAULT);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -1135,12 +1156,12 @@ test_read_wired_static_routes (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
- NMIP4Route *ip4_route;
+ NMIPRoute *ip4_route;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-routes",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-routes",
+ NULL, TYPE_ETHERNET, NULL, &error);
nmtst_assert_connection_verifies_without_normalization (connection);
/* ===== CONNECTION SETTING ===== */
@@ -1155,24 +1176,24 @@ test_read_wired_static_routes (void)
/* ===== IPv4 SETTING ===== */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
/* Routes */
- g_assert_cmpint (nm_setting_ip4_config_get_num_routes (s_ip4), ==, 2);
+ g_assert_cmpint (nm_setting_ip_config_get_num_routes (s_ip4), ==, 2);
- ip4_route = nm_setting_ip4_config_get_route (s_ip4, 0);
+ ip4_route = nm_setting_ip_config_get_route (s_ip4, 0);
g_assert (ip4_route);
- nmtst_assert_ip4_address_equals (nm_ip4_route_get_dest (ip4_route), "11.22.33.0");
- g_assert_cmpint (nm_ip4_route_get_prefix (ip4_route), ==, 24);
- nmtst_assert_ip4_address_equals (nm_ip4_route_get_next_hop (ip4_route), "192.168.1.5");
- g_assert_cmpint (nm_ip4_route_get_metric (ip4_route), ==, 0);
+ g_assert_cmpstr (nm_ip_route_get_dest (ip4_route), ==, "11.22.33.0");
+ g_assert_cmpint (nm_ip_route_get_prefix (ip4_route), ==, 24);
+ g_assert_cmpstr (nm_ip_route_get_next_hop (ip4_route), ==, "192.168.1.5");
+ g_assert_cmpint (nm_ip_route_get_metric (ip4_route), ==, -1);
- ip4_route = nm_setting_ip4_config_get_route (s_ip4, 1);
+ ip4_route = nm_setting_ip_config_get_route (s_ip4, 1);
g_assert (ip4_route);
- nmtst_assert_ip4_address_equals (nm_ip4_route_get_dest (ip4_route), "44.55.66.77");
- g_assert_cmpint (nm_ip4_route_get_prefix (ip4_route), ==, 32);
- nmtst_assert_ip4_address_equals (nm_ip4_route_get_next_hop (ip4_route), "192.168.1.7");
- g_assert_cmpint (nm_ip4_route_get_metric (ip4_route), ==, 3);
+ g_assert_cmpstr (nm_ip_route_get_dest (ip4_route), ==, "44.55.66.77");
+ g_assert_cmpint (nm_ip_route_get_prefix (ip4_route), ==, 32);
+ g_assert_cmpstr (nm_ip_route_get_next_hop (ip4_route), ==, "192.168.1.7");
+ g_assert_cmpint (nm_ip_route_get_metric (ip4_route), ==, 3);
g_object_unref (connection);
}
@@ -1185,33 +1206,18 @@ test_read_wired_static_routes_legacy (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
- NMIP4Route *ip4_route;
- guint32 addr;
+ NMIPRoute *ip4_route;
const char *expected_id = "System test-wired-static-routes-legacy";
- const char *expected_dst1 = "21.31.41.0";
- const char *expected_dst2 = "32.42.52.62";
- const char *expected_dst3 = "43.53.0.0";
- const char *expected_gw1 = "9.9.9.9";
- const char *expected_gw2 = "8.8.8.8";
- const char *expected_gw3 = "7.7.7.7";
-
- connection = connection_from_file (TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-static-routes-legacy-read",
@@ -1265,120 +1271,44 @@ test_read_wired_static_routes_legacy (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0,
"wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* Routes */
- ASSERT (nm_setting_ip4_config_get_num_routes (s_ip4) == 3,
+ ASSERT (nm_setting_ip_config_get_num_routes (s_ip4) == 3,
"wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES);
+ NM_SETTING_IP_CONFIG_ROUTES);
/* Route #1 */
- ip4_route = nm_setting_ip4_config_get_route (s_ip4, 0);
- ASSERT (ip4_route,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: missing IP4 route #1",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
-
- ASSERT (inet_pton (AF_INET, expected_dst1, &addr) > 0,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: couldn't convert destination IP address #1",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
- ASSERT (nm_ip4_route_get_dest (ip4_route) == addr,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value #1",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
- NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES);
-
- ASSERT (nm_ip4_route_get_prefix (ip4_route) == 24,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected destination route #1 prefix",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
-
- ASSERT (inet_pton (AF_INET, expected_gw1, &addr) > 0,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: couldn't convert next hop IP address #1",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
- ASSERT (nm_ip4_route_get_next_hop (ip4_route) == addr,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value #1",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
- NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES);
-
- ASSERT (nm_ip4_route_get_metric (ip4_route) == 1,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected destination route #1 metric",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
+ ip4_route = nm_setting_ip_config_get_route (s_ip4, 0);
+ g_assert (ip4_route != NULL);
+ g_assert_cmpstr (nm_ip_route_get_dest (ip4_route), ==, "21.31.41.0");
+ g_assert_cmpint (nm_ip_route_get_prefix (ip4_route), ==, 24);
+ g_assert_cmpstr (nm_ip_route_get_next_hop (ip4_route), ==, "9.9.9.9");
+ g_assert_cmpint (nm_ip_route_get_metric (ip4_route), ==, 1);
/* Route #2 */
- ip4_route = nm_setting_ip4_config_get_route (s_ip4, 1);
- ASSERT (ip4_route,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: missing IP4 route #2",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
-
- ASSERT (inet_pton (AF_INET, expected_dst2, &addr) > 0,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: couldn't convert destination IP address #2",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
- ASSERT (nm_ip4_route_get_dest (ip4_route) == addr,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value #2",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
- NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES);
-
- ASSERT (nm_ip4_route_get_prefix (ip4_route) == 32,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected destination route #2 prefix",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
-
- ASSERT (inet_pton (AF_INET, expected_gw2, &addr) > 0,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: couldn't convert next hop IP address #2",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
- ASSERT (nm_ip4_route_get_next_hop (ip4_route) == addr,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value #2",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
- NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES);
-
- ASSERT (nm_ip4_route_get_metric (ip4_route) == 0,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected destination route #2 metric",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
+ ip4_route = nm_setting_ip_config_get_route (s_ip4, 1);
+ g_assert (ip4_route != NULL);
+ g_assert_cmpstr (nm_ip_route_get_dest (ip4_route), ==, "32.42.52.62");
+ g_assert_cmpint (nm_ip_route_get_prefix (ip4_route), ==, 32);
+ g_assert_cmpstr (nm_ip_route_get_next_hop (ip4_route), ==, "8.8.8.8");
+ g_assert_cmpint (nm_ip_route_get_metric (ip4_route), ==, -1);
/* Route #3 */
- ip4_route = nm_setting_ip4_config_get_route (s_ip4, 2);
- ASSERT (ip4_route,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: missing IP4 route #3",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
+ ip4_route = nm_setting_ip_config_get_route (s_ip4, 2);
+ g_assert (ip4_route != NULL);
+ g_assert_cmpstr (nm_ip_route_get_dest (ip4_route), ==, "43.53.0.0");
+ g_assert_cmpint (nm_ip_route_get_prefix (ip4_route), ==, 16);
+ g_assert_cmpstr (nm_ip_route_get_next_hop (ip4_route), ==, "7.7.7.7");
+ g_assert_cmpint (nm_ip_route_get_metric (ip4_route), ==, 3);
- ASSERT (inet_pton (AF_INET, expected_dst3, &addr) > 0,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: couldn't convert destination IP address #3",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
- ASSERT (nm_ip4_route_get_dest (ip4_route) == addr,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value #3",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
- NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES);
-
- ASSERT (nm_ip4_route_get_prefix (ip4_route) == 16,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected destination route #3 prefix",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
-
- ASSERT (inet_pton (AF_INET, expected_gw3, &addr) > 0,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: couldn't convert next hop IP address #3",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
- ASSERT (nm_ip4_route_get_next_hop (ip4_route) == addr,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value #3",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY,
- NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES);
-
- ASSERT (nm_ip4_route_get_metric (ip4_route) == 3,
- "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected destination route #3 metric",
- TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY);
-
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -1388,32 +1318,17 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
- const char *expected_address1 = "1.2.3.4";
- const char *expected_address2 = "9.8.7.6";
- const char *expected_address3 = "3.3.3.3";
- guint32 expected_prefix1 = 24;
- guint32 expected_prefix2 = 16;
- guint32 expected_prefix3 = 8;
- NMIP4Address *ip4_addr;
- guint32 addr;
-
- connection = connection_from_file (file,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ NMIPAddress *ip4_addr;
+
+ connection = connection_from_file_test (file,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-ipv4-manual-read", "failed to read %s: %s", file, error->message);
@@ -1461,75 +1376,38 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0,
"wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* IP addresses */
- ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 3,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip4) == 3,
"wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
/* Address #1 */
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
- ASSERT (ip4_addr,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: missing IP4 address #1",
- file);
-
- ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix1,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected IP4 address #1 prefix",
- file);
-
- ASSERT (inet_pton (AF_INET, expected_address1, &addr) > 0,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: couldn't convert IP address #1",
- file);
- ASSERT (nm_ip4_address_get_address (ip4_addr) == addr,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected IP4 address #1",
- file);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert (ip4_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "1.2.3.4");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
/* Address #2 */
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 1);
- ASSERT (ip4_addr,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: missing IP4 address #2",
- file);
-
- ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix2,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected IP4 address #2 prefix",
- file);
-
- ASSERT (inet_pton (AF_INET, expected_address2, &addr) > 0,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: couldn't convert IP address #2",
- file);
- ASSERT (nm_ip4_address_get_address (ip4_addr) == addr,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected IP4 address #2",
- file);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 1);
+ g_assert (ip4_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "9.8.7.6");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 16);
/* Address #3 */
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 2);
- ASSERT (ip4_addr,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: missing IP4 address #3",
- file);
-
- ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix3,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected IP4 address #3 prefix",
- file);
-
- ASSERT (inet_pton (AF_INET, expected_address3, &addr) > 0,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: couldn't convert IP address #3",
- file);
- ASSERT (nm_ip4_address_get_address (ip4_addr) == addr,
- "wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected IP4 address #3",
- file);
-
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 2);
+ g_assert (ip4_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "3.3.3.3");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 8);
+
g_object_unref (connection);
}
@@ -1541,37 +1419,22 @@ test_read_wired_ipv6_manual (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System test-wired-ipv6-manual";
- const char *expected_address1 = "1001:abba::1234";
- const char *expected_address2 = "2001:abba::2234";
- const char *expected_address3 = "3001:abba::3234";
- guint32 expected_prefix1 = 56;
- guint32 expected_prefix2 = 64;
- guint32 expected_prefix3 = 96;
- NMIP6Address *ip6_addr;
- NMIP6Route *ip6_route;
- struct in6_addr addr;
+ NMIPAddress *ip6_addr;
+ NMIPRoute *ip6_route;
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*ignoring manual default route*");
- connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_MANUAL,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_IPV6_MANUAL,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
g_test_assert_expected_messages ();
ASSERT (connection != NULL,
@@ -1621,54 +1484,54 @@ test_read_wired_ipv6_manual (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* DNS Addresses */
- ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip4) == 2,
"wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
/* DNS search domains */
- ASSERT (nm_setting_ip4_config_get_num_dns_searches (s_ip4) == 3,
+ ASSERT (nm_setting_ip_config_get_num_dns_searches (s_ip4) == 3,
"wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- tmp = nm_setting_ip4_config_get_dns_search (s_ip4, 0);
+ tmp = nm_setting_ip_config_get_dns_search (s_ip4, 0);
ASSERT (tmp != NULL,
"wired-ipv6-manual-verify-ip4", "failed to verify %s: missing %s / %s key",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
ASSERT (strcmp (tmp, "lorem.com") == 0,
"wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
- tmp = nm_setting_ip4_config_get_dns_search (s_ip4, 1);
+ tmp = nm_setting_ip_config_get_dns_search (s_ip4, 1);
ASSERT (tmp != NULL,
"wired-ipv6-manual-verify-ip4", "failed to verify %s: missing %s / %s key",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
ASSERT (strcmp (tmp, "ipsum.org") == 0,
"wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
- tmp = nm_setting_ip4_config_get_dns_search (s_ip4, 2);
+ tmp = nm_setting_ip_config_get_dns_search (s_ip4, 2);
ASSERT (tmp != NULL,
"wired-ipv6-manual-verify-ip4", "failed to verify %s: missing %s / %s key",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
ASSERT (strcmp (tmp, "dolor.edu") == 0,
"wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
/* ===== IPv6 SETTING ===== */
@@ -1679,134 +1542,93 @@ test_read_wired_ipv6_manual (void)
NM_SETTING_IP6_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip6_config_get_method (s_ip6);
+ tmp = nm_setting_ip_config_get_method (s_ip6);
ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0,
"wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip6_config_get_never_default (s_ip6) == FALSE,
+ ASSERT (nm_setting_ip_config_get_never_default (s_ip6) == FALSE,
"wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_NEVER_DEFAULT);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT);
- ASSERT (nm_setting_ip6_config_get_may_fail (s_ip6) == TRUE,
+ ASSERT (nm_setting_ip_config_get_may_fail (s_ip6) == TRUE,
"wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_MAY_FAIL);
+ NM_SETTING_IP_CONFIG_MAY_FAIL);
/* IP addresses */
- ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 3,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip6) == 3,
"wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
/* Address #1 */
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0);
- ASSERT (ip6_addr,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing IP6 address #1",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
-
- ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix1,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #1 prefix",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
-
- ASSERT (inet_pton (AF_INET6, expected_address1, &addr) > 0,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP address #1",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
- ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr),
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #1",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 0);
+ g_assert (ip6_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "1001:abba::1234");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 56);
/* Address #2 */
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 1);
- ASSERT (ip6_addr,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing IP6 address #2",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
-
- ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix2,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #2 prefix",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
-
- ASSERT (inet_pton (AF_INET6, expected_address2, &addr) > 0,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP address #2",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
- ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr),
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #2",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 1);
+ g_assert (ip6_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "2001:abba::2234");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 64);
/* Address #3 */
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 2);
- ASSERT (ip6_addr,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing IP6 address #3",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
-
- ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix3,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #3 prefix",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
-
- ASSERT (inet_pton (AF_INET6, expected_address3, &addr) > 0,
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP address #3",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
- ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr),
- "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #3",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 2);
+ g_assert (ip6_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "3001:abba::3234");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 96);
/* Routes */
- g_assert_cmpint (nm_setting_ip6_config_get_num_routes (s_ip6), ==, 2);
+ g_assert_cmpint (nm_setting_ip_config_get_num_routes (s_ip6), ==, 2);
/* Route #1 */
- ip6_route = nm_setting_ip6_config_get_route (s_ip6, 0);
+ ip6_route = nm_setting_ip_config_get_route (s_ip6, 0);
g_assert (ip6_route);
- g_assert_cmpint (inet_pton (AF_INET6, "9876::1234", &addr), >, 0);
- g_assert_cmpint (memcmp (nm_ip6_route_get_dest (ip6_route), &addr, sizeof (struct in6_addr)), ==, 0);
- g_assert_cmpint (nm_ip6_route_get_prefix (ip6_route), ==, 96);
- g_assert_cmpint (inet_pton (AF_INET6, "9876::7777", &addr), >, 0);
- g_assert_cmpint (memcmp (nm_ip6_route_get_next_hop (ip6_route), &addr, sizeof (struct in6_addr)), ==, 0);
- g_assert_cmpint (nm_ip6_route_get_metric (ip6_route), ==, 2);
+ g_assert_cmpstr (nm_ip_route_get_dest (ip6_route), ==, "9876::1234");
+ g_assert_cmpint (nm_ip_route_get_prefix (ip6_route), ==, 96);
+ g_assert_cmpstr (nm_ip_route_get_next_hop (ip6_route), ==, "9876::7777");
+ g_assert_cmpint (nm_ip_route_get_metric (ip6_route), ==, 2);
/* Route #2 */
- ip6_route = nm_setting_ip6_config_get_route (s_ip6, 1);
+ ip6_route = nm_setting_ip_config_get_route (s_ip6, 1);
g_assert (ip6_route);
- g_assert_cmpint (inet_pton (AF_INET6, "abbe::cafe", &addr), >, 0);
- g_assert_cmpint (memcmp (nm_ip6_route_get_dest (ip6_route), &addr, sizeof (struct in6_addr)), ==, 0);
- g_assert_cmpint (nm_ip6_route_get_prefix (ip6_route), ==, 64);
- g_assert_cmpint (inet_pton (AF_INET6, "::", &addr), >, 0);
- g_assert_cmpint (memcmp (nm_ip6_route_get_next_hop (ip6_route), &addr, sizeof (struct in6_addr)), ==, 0);
- g_assert_cmpint (nm_ip6_route_get_metric (ip6_route), ==, 777);
+ g_assert_cmpstr (nm_ip_route_get_dest (ip6_route), ==, "abbe::cafe");
+ g_assert_cmpint (nm_ip_route_get_prefix (ip6_route), ==, 64);
+ g_assert_cmpstr (nm_ip_route_get_next_hop (ip6_route), ==, NULL);
+ g_assert_cmpint (nm_ip_route_get_metric (ip6_route), ==, 777);
/* DNS Addresses */
- ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip6) == 2,
"wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip6_config_get_dns (s_ip6, 0), "1:2:3:4::a") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip6, 0), "1:2:3:4::a") == 0,
"wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value #1",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip6_config_get_dns (s_ip6, 1), "1:2:3:4::b") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip6, 1), "1:2:3:4::b") == 0,
"wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value #2",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
/* DNS domains - none as domains are stuffed to 'ipv4' setting */
- ASSERT (nm_setting_ip6_config_get_num_dns_searches (s_ip6) == 0,
+ ASSERT (nm_setting_ip_config_get_num_dns_searches (s_ip6) == 0,
"wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -1818,31 +1640,20 @@ test_read_wired_ipv6_only (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System test-wired-ipv6-only";
- const char *expected_address1 = "1001:abba::1234";
- guint32 expected_prefix1 = 56;
- NMIP6Address *ip6_addr;
- struct in6_addr addr;
+ NMIPAddress *ip6_addr;
const char *method;
- connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_ONLY,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_IPV6_ONLY,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-ipv6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message);
@@ -1889,12 +1700,12 @@ test_read_wired_ipv6_only (void)
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME);
- method = nm_setting_ip4_config_get_method (s_ip4);
+ method = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0,
"wired-ipv6-only-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* ===== IPv6 SETTING ===== */
@@ -1905,60 +1716,45 @@ test_read_wired_ipv6_only (void)
NM_SETTING_IP6_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip6_config_get_method (s_ip6);
+ tmp = nm_setting_ip_config_get_method (s_ip6);
ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0,
"wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* IP addresses */
- ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 1,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip6) == 1,
"wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
/* Address #1 */
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0);
- ASSERT (ip6_addr,
- "wired-ipv6-only-verify-ip6", "failed to verify %s: missing IP6 address #1",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
-
- ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix1,
- "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected IP6 address #1 prefix",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
-
- ASSERT (inet_pton (AF_INET6, expected_address1, &addr) > 0,
- "wired-ipv6-only-verify-ip6", "failed to verify %s: couldn't convert IP address #1",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
- ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr),
- "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected IP6 address #1",
- TEST_IFCFG_WIRED_IPV6_MANUAL);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 0);
+ g_assert (ip6_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "1001:abba::1234");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 56);
/* DNS Addresses */
- ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 1,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip6) == 1,
"wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip6_config_get_dns (s_ip6, 0), "1:2:3:4::a") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip6, 0), "1:2:3:4::a") == 0,
"wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value #1",
TEST_IFCFG_WIRED_IPV6_MANUAL,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
/* DNS domains should be in IPv6, because IPv4 is disabled */
- g_assert_cmpint (nm_setting_ip6_config_get_num_dns_searches (s_ip6), ==, 3);
- g_assert_cmpstr (nm_setting_ip6_config_get_dns_search (s_ip6, 0), ==, "lorem.com");
- g_assert_cmpstr (nm_setting_ip6_config_get_dns_search (s_ip6, 1), ==, "ipsum.org");
- g_assert_cmpstr (nm_setting_ip6_config_get_dns_search (s_ip6, 2), ==, "dolor.edu");
+ g_assert_cmpint (nm_setting_ip_config_get_num_dns_searches (s_ip6), ==, 3);
+ g_assert_cmpstr (nm_setting_ip_config_get_dns_search (s_ip6, 0), ==, "lorem.com");
+ g_assert_cmpstr (nm_setting_ip_config_get_dns_search (s_ip6, 1), ==, "ipsum.org");
+ g_assert_cmpstr (nm_setting_ip_config_get_dns_search (s_ip6, 2), ==, "dolor.edu");
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -1970,27 +1766,19 @@ test_read_wired_dhcp6_only (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System test-wired-dhcp6-only";
const char *method;
- connection = connection_from_file (TEST_IFCFG_WIRED_DHCP6_ONLY,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_DHCP6_ONLY,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-dhcp6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message);
@@ -2037,12 +1825,12 @@ test_read_wired_dhcp6_only (void)
TEST_IFCFG_WIRED_DHCP6_ONLY,
NM_SETTING_IP4_CONFIG_SETTING_NAME);
- method = nm_setting_ip4_config_get_method (s_ip4);
+ method = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0,
"wired-dhcp6-only-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DHCP6_ONLY,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* ===== IPv6 SETTING ===== */
@@ -2053,17 +1841,13 @@ test_read_wired_dhcp6_only (void)
NM_SETTING_IP6_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip6_config_get_method (s_ip6);
+ tmp = nm_setting_ip_config_get_method (s_ip6);
ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0,
"wired-dhcp6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_DHCP6_ONLY,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -2075,21 +1859,13 @@ test_read_onboot_no (void)
NMConnection *connection;
NMSettingConnection *s_con;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
- GError *error = NULL;
-
- connection = connection_from_file (TEST_IFCFG_ONBOOT_NO,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ GError *error = NULL;
+
+ connection = connection_from_file_test (TEST_IFCFG_ONBOOT_NO,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"onboot-no-read", "failed to read %s: %s", TEST_IFCFG_ONBOOT_NO, error->message);
@@ -2114,10 +1890,6 @@ test_read_onboot_no (void)
NM_SETTING_CONNECTION_SETTING_NAME,
NM_SETTING_CONNECTION_AUTOCONNECT);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -2127,42 +1899,29 @@ static void
test_read_noip (void)
{
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
- GError *error = NULL;
-
- connection = connection_from_file (TEST_IFCFG_NOIP,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
+ GError *error = NULL;
+
+ connection = connection_from_file_test (TEST_IFCFG_NOIP,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_assert (connection);
g_assert (nm_connection_verify (connection, &error));
g_assert_no_error (error);
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
- g_assert (nm_setting_ip4_config_get_never_default (s_ip4) == FALSE);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
+ g_assert (nm_setting_ip_config_get_never_default (s_ip4) == FALSE);
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
- g_assert_cmpstr (nm_setting_ip6_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
- g_assert (nm_setting_ip6_config_get_never_default (s_ip6) == FALSE);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
+ g_assert (nm_setting_ip_config_get_never_default (s_ip6) == FALSE);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -2174,14 +1933,10 @@ test_read_wired_8021x_peap_mschapv2 (void)
{
NMConnection *connection;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSetting8021x *s_8021x;
NMSetting8021x *tmp_8021x;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_identity = "David Smith";
@@ -2191,15 +1946,11 @@ test_read_wired_8021x_peap_mschapv2 (void)
const char *expected_ca_cert_path;
const char *read_ca_cert_path;
- connection = connection_from_file (TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-8021x-peap-mschapv2-read", "failed to read %s: %s", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, error->message);
@@ -2226,12 +1977,12 @@ test_read_wired_8021x_peap_mschapv2 (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wired-8021x-peap-mschapv2-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* ===== 802.1x SETTING ===== */
s_8021x = nm_connection_get_setting_802_1x (connection);
@@ -2358,10 +2109,6 @@ test_read_wired_8021x_peap_mschapv2 (void)
g_object_unref (tmp_8021x);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -2374,25 +2121,16 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags
NMConnection *connection;
NMSettingWired *s_wired;
NMSetting8021x *s_8021x;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *expected_identity = "David Smith";
gboolean success = FALSE;
char *dirname, *tmp;
- connection = connection_from_file (ifcfg,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (ifcfg,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection);
@@ -2424,10 +2162,6 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags
g_free (dirname);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -2442,9 +2176,9 @@ test_read_write_802_1X_subj_matches (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*missing IEEE_8021X_CA_CERT*peap*");
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1X-subj-matches",
- NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1X-subj-matches",
+ NULL, TYPE_ETHERNET, NULL,
+ &error);
g_test_assert_expected_messages ();
g_assert_no_error (error);
g_assert (connection != NULL);
@@ -2477,8 +2211,8 @@ test_read_write_802_1X_subj_matches (void)
/* re-read the connection for comparison */
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*missing IEEE_8021X_CA_CERT*peap*");
- reread = connection_from_file (written, NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL,
+ &error);
g_test_assert_expected_messages ();
unlink (written);
g_free (written);
@@ -2525,8 +2259,8 @@ test_read_802_1x_ttls_eapgtc (void)
* NMSetting8021x::autheap property.
*/
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1x-ttls-eapgtc",
- NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1x-ttls-eapgtc",
+ NULL, TYPE_WIRELESS, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -2555,30 +2289,21 @@ test_read_wired_aliases_good (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System aliasem0";
- int expected_num_addresses = 4, expected_prefix = 24;
+ int expected_num_addresses = 4;
const char *expected_address[4] = { "192.168.1.5", "192.168.1.6", "192.168.1.9", "192.168.1.99" };
- const char *expected_label[4] = { "", "aliasem0:1", "aliasem0:2", "aliasem0:99" };
- const char *expected_gateway[4] = { "192.168.1.1", "192.168.1.1", "192.168.1.1", "192.168.1.1" };
+ const char *expected_label[4] = { NULL, "aliasem0:1", "aliasem0:2", "aliasem0:99" };
+ const char *expected_gateway = "192.168.1.1";
int i, j;
- connection = connection_from_file (TEST_IFCFG_ALIASES_GOOD,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_ALIASES_GOOD,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"aliases-good-read", "failed to read %s: %s", TEST_IFCFG_ALIASES_GOOD, error->message);
@@ -2615,74 +2340,51 @@ test_read_wired_aliases_good (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0,
"aliases-good-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_ALIASES_GOOD,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == expected_num_addresses,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip4) == expected_num_addresses,
"aliases-good-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_ALIASES_GOOD,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
/* Addresses */
for (i = 0; i < expected_num_addresses; i++) {
- NMIP4Address *ip4_addr;
- char buf[INET_ADDRSTRLEN];
- struct in_addr addr;
+ NMIPAddress *ip4_addr;
+ const char *addr;
+ GVariant *label;
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, i);
- ASSERT (ip4_addr,
- "aliases-good-verify-ip4", "failed to verify %s: missing IP4 address #%d",
- TEST_IFCFG_ALIASES_GOOD,
- i);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, i);
+ g_assert (ip4_addr != NULL);
- addr.s_addr = nm_ip4_address_get_address (ip4_addr);
- ASSERT (inet_ntop (AF_INET, &addr, buf, sizeof (buf)) > 0,
- "aliases-good-verify-ip4", "failed to verify %s: couldn't convert IP address #%d",
- TEST_IFCFG_ALIASES_GOOD,
- i);
+ addr = nm_ip_address_get_address (ip4_addr);
+ g_assert (nm_utils_ipaddr_valid (AF_INET, addr));
for (j = 0; j < expected_num_addresses; j++) {
- if (!g_strcmp0 (buf, expected_address[j]))
+ if (!g_strcmp0 (addr, expected_address[j]))
break;
}
+ g_assert (j < expected_num_addresses);
- ASSERT (j < expected_num_addresses,
- "aliases-good-verify-ip4", "failed to verify %s: unexpected IP4 address #%d",
- TEST_IFCFG_ALIASES_GOOD,
- i);
-
- ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix,
- "aliases-good-verify-ip4", "failed to verify %s: unexpected IP4 address prefix #%d",
- TEST_IFCFG_ALIASES_GOOD,
- i);
-
- if (expected_gateway[j]) {
- ASSERT (inet_pton (AF_INET, expected_gateway[j], &addr) > 0,
- "aliases-good-verify-ip4", "failed to verify %s: couldn't convert IP address gateway #%d",
- TEST_IFCFG_ALIASES_GOOD,
- i);
- } else
- addr.s_addr = 0;
- ASSERT (nm_ip4_address_get_gateway (ip4_addr) == addr.s_addr,
- "aliases-good-verify-ip4", "failed to verify %s: unexpected IP4 address gateway #%d",
- TEST_IFCFG_ALIASES_GOOD,
- i);
-
- ASSERT (g_strcmp0 (_nm_setting_ip4_config_get_address_label (s_ip4, i), expected_label[j]) == 0,
- "aliases-good-verify-ip4", "failed to verify %s: unexpected IP4 address label #%d",
- TEST_IFCFG_ALIASES_GOOD,
- i);
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
+ label = nm_ip_address_get_attribute (ip4_addr, "label");
+ if (expected_label[j])
+ g_assert_cmpstr (g_variant_get_string (label, NULL), ==, expected_label[j]);
+ else
+ g_assert (label == NULL);
expected_address[j] = NULL;
- expected_gateway[j] = NULL;
expected_label[j] = NULL;
}
+ /* Gateway */
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, expected_gateway);
+
for (i = 0; i < expected_num_addresses; i++) {
ASSERT (expected_address[i] == NULL,
"aliases-good-verify-ip4", "failed to verify %s: did not find IP4 address %s",
@@ -2690,9 +2392,6 @@ test_read_wired_aliases_good (void)
expected_address[i]);
}
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -2701,30 +2400,16 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *tmp;
- int expected_num_addresses = 1, expected_prefix = 24;
- const char *expected_address = "192.168.1.5";
- const char *expected_label = "";
- const char *expected_gateway = "192.168.1.1";
- NMIP4Address *ip4_addr;
- struct in_addr addr;
-
- connection = connection_from_file (base,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ NMIPAddress *ip4_addr;
+
+ connection = connection_from_file_test (base,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_test_assert_expected_messages ();
ASSERT (connection != NULL,
"aliases-bad-read", "failed to read %s: %s", base, error->message);
@@ -2762,50 +2447,29 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0,
"aliases-bad-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
base,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == expected_num_addresses,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip4) == 1,
"aliases-bad-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
base,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
/* Addresses */
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
- ASSERT (ip4_addr,
- "aliases-bad-verify-ip4", "failed to verify %s: missing IP4 address",
- base);
-
- ASSERT (inet_pton (AF_INET, expected_address, &addr) > 0,
- "aliases-bad-verify-ip4", "failed to verify %s: couldn't convert IP address",
- base);
- ASSERT (nm_ip4_address_get_address (ip4_addr) == addr.s_addr,
- "aliases-bad-verify-ip4", "failed to verify %s: unexpected IP4 address",
- base);
-
- ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix,
- "aliases-bad-verify-ip4", "failed to verify %s: unexpected IP4 address prefix",
- base);
-
- ASSERT (inet_pton (AF_INET, expected_gateway, &addr) > 0,
- "aliases-bad-verify-ip4", "failed to verify %s: couldn't convert IP address gateway",
- base);
- ASSERT (nm_ip4_address_get_gateway (ip4_addr) == addr.s_addr,
- "aliases-bad-verify-ip4", "failed to verify %s: unexpected IP4 address gateway",
- base);
-
- ASSERT (g_strcmp0 (_nm_setting_ip4_config_get_address_label (s_ip4, 0), expected_label) == 0,
- "aliases-bad-verify-ip4", "failed to verify %s: unexpected IP4 address label",
- base);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert (ip4_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "192.168.1.5");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 24);
+ g_assert (nm_ip_address_get_attribute (ip4_addr, "label") == NULL);
+
+ /* Gateway */
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.1.1");
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -2838,12 +2502,7 @@ test_read_wifi_open (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
+ NMSettingIPConfig *s_ip4, *s_ip6;
GError *error = NULL;
const char *tmp;
GBytes *ssid;
@@ -2855,15 +2514,11 @@ test_read_wifi_open (void)
const char *expected_mode = "infrastructure";
const guint32 expected_channel = 1;
- connection = connection_from_file (TEST_IFCFG_WIFI_OPEN,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-open-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN, error->message);
@@ -2992,18 +2647,20 @@ test_read_wifi_open (void)
TEST_IFCFG_WIFI_OPEN,
NM_SETTING_IP4_CONFIG_SETTING_NAME);
+ g_assert_cmpint (nm_setting_ip_config_get_route_metric (s_ip4), ==, 104);
+
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-open-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_OPEN,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
+
+ s_ip6 = nm_connection_get_setting_ip6_config (connection);
+ g_assert( s_ip6);
+ g_assert_cmpint (nm_setting_ip_config_get_route_metric (s_ip6), ==, 106);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -3015,25 +2672,16 @@ test_read_wifi_open_auto (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System blahblah (test-wifi-open-auto)";
const char *expected_mode = "infrastructure";
- connection = connection_from_file (TEST_IFCFG_WIFI_OPEN_AUTO,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_AUTO,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-open-auto-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_AUTO, error->message);
@@ -3081,10 +2729,6 @@ test_read_wifi_open_auto (void)
NM_SETTING_WIRELESS_SETTING_NAME,
NM_SETTING_WIRELESS_MODE);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -3096,26 +2740,17 @@ test_read_wifi_open_ssid_hex (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
GBytes *ssid;
const char *expected_id = "System blahblah (test-wifi-open-ssid-hex)";
const char *expected_ssid = "blahblah";
- connection = connection_from_file (TEST_IFCFG_WIFI_OPEN_SSID_HEX,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_SSID_HEX,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-open-ssid-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_HEX, error->message);
@@ -3169,10 +2804,6 @@ test_read_wifi_open_ssid_hex (void)
NM_SETTING_WIRELESS_SETTING_NAME,
NM_SETTING_WIRELESS_SSID);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -3180,29 +2811,16 @@ static void
test_read_wifi_open_ssid_bad (const char *file, const char *test)
{
NMConnection *connection;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
- GError *error = NULL;
-
- connection = connection_from_file (file,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ GError *error = NULL;
+
+ connection = connection_from_file_test (file,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection == NULL, test, "unexpected success reading %s", file);
g_clear_error (&error);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
}
#define TEST_IFCFG_WIFI_OPEN_SSID_QUOTED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-quoted"
@@ -3213,26 +2831,17 @@ test_read_wifi_open_ssid_quoted (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
GBytes *ssid;
const char *expected_id = "System foo\"bar\\ (test-wifi-open-ssid-quoted)";
const char *expected_ssid = "foo\"bar\\";
- connection = connection_from_file (TEST_IFCFG_WIFI_OPEN_SSID_QUOTED,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_SSID_QUOTED,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-open-ssid-quoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, error->message);
@@ -3286,10 +2895,6 @@ test_read_wifi_open_ssid_quoted (void)
NM_SETTING_WIRELESS_SETTING_NAME,
NM_SETTING_WIRELESS_SSID);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -3302,12 +2907,7 @@ test_read_wifi_wep (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *tmp;
GBytes *ssid;
@@ -3321,15 +2921,11 @@ test_read_wifi_wep (void)
const char *expected_wep_key0 = "0123456789abcdef0123456789";
NMWepKeyType key_type;
- connection = connection_from_file (TEST_IFCFG_WIFI_WEP,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wep-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP, error->message);
@@ -3537,17 +3133,13 @@ test_read_wifi_wep (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-wep-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WEP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -3560,12 +3152,7 @@ test_read_wifi_wep_adhoc (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *tmp;
GBytes *ssid;
@@ -3574,15 +3161,11 @@ test_read_wifi_wep_adhoc (void)
const char *expected_mode = "adhoc";
const char *expected_wep_key0 = "0123456789abcdef0123456789";
- connection = connection_from_file (TEST_IFCFG_WIFI_WEP_ADHOC,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_ADHOC,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wep-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_ADHOC, error->message);
@@ -3751,43 +3334,39 @@ test_read_wifi_wep_adhoc (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-wep-adhoc-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WEP_ADHOC,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* Ignore auto DNS */
- ASSERT (nm_setting_ip4_config_get_ignore_auto_dns (s_ip4) == TRUE,
+ ASSERT (nm_setting_ip_config_get_ignore_auto_dns (s_ip4) == TRUE,
"wifi-wep-adhoc-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WEP_ADHOC,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS);
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS);
/* DNS Addresses */
- ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip4) == 2,
"wifi-wep-adhoc-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WEP_ADHOC,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip4_config_get_dns (s_ip4, 0), "4.2.2.1") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip4, 0), "4.2.2.1") == 0,
"wifi-wep-adhoc-verify-ip4", "failed to verify %s: unexpected %s / %s key value #1",
TEST_IFCFG_WIFI_WEP_ADHOC,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip4_config_get_dns (s_ip4, 1), "4.2.2.2") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip4, 1), "4.2.2.2") == 0,
"wifi-wep-adhoc-verify-ip4", "failed to verify %s: unexpected %s / %s key value #2",
TEST_IFCFG_WIFI_WEP_ADHOC,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -3800,25 +3379,16 @@ test_read_wifi_wep_passphrase (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_wep_key0 = "foobar222blahblah";
NMWepKeyType key_type;
- connection = connection_from_file (TEST_IFCFG_WIFI_WEP_PASSPHRASE,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_PASSPHRASE,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wep-passphrase-read", "failed to read %s: %s",
TEST_IFCFG_WIFI_WEP_PASSPHRASE, error->message);
@@ -3909,10 +3479,6 @@ test_read_wifi_wep_passphrase (void)
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NM_SETTING_WIRELESS_SECURITY_WEP_KEY3);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -3925,25 +3491,16 @@ test_read_wifi_wep_40_ascii (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_wep_key0 = "Lorem";
NMWepKeyType key_type;
- connection = connection_from_file (TEST_IFCFG_WIFI_WEP_40_ASCII,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_40_ASCII,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wep-40-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message);
@@ -4032,10 +3589,6 @@ test_read_wifi_wep_40_ascii (void)
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NM_SETTING_WIRELESS_SECURITY_WEP_KEY3);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -4048,25 +3601,16 @@ test_read_wifi_wep_104_ascii (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_wep_key0 = "LoremIpsumSit";
NMWepKeyType key_type;
- connection = connection_from_file (TEST_IFCFG_WIFI_WEP_104_ASCII,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_104_ASCII,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wep-104-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message);
@@ -4155,10 +3699,6 @@ test_read_wifi_wep_104_ascii (void)
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NM_SETTING_WIRELESS_SECURITY_WEP_KEY3);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -4171,26 +3711,17 @@ test_read_wifi_leap (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System blahblah (test-wifi-leap)";
const char *expected_identity = "Bill Smith";
const char *expected_password = "foobarblah";
- connection = connection_from_file (TEST_IFCFG_WIFI_LEAP,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_LEAP,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-leap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_LEAP, error->message);
@@ -4280,10 +3811,6 @@ test_read_wifi_leap (void)
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -4296,24 +3823,15 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte
NMConnection *connection;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *expected_identity = "Bill Smith";
gboolean success;
- connection = connection_from_file (file,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (file,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection);
@@ -4336,10 +3854,6 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte
g_assert (nm_setting_wireless_security_get_leap_password_flags (s_wsec) == expected_flags);
g_assert (nm_setting_wireless_security_get_leap_password (s_wsec) == NULL);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -4352,12 +3866,7 @@ test_read_wifi_wpa_psk (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *tmp;
GBytes *ssid;
@@ -4380,15 +3889,11 @@ test_read_wifi_wpa_psk (void)
gboolean found_proto_wpa = FALSE;
gboolean found_proto_rsn = FALSE;
- connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wpa-psk-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK, error->message);
@@ -4630,17 +4135,13 @@ test_read_wifi_wpa_psk (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-wpa-psk-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WPA_PSK,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -4653,25 +4154,16 @@ test_read_wifi_wpa_psk_2 (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System ipsum (test-wifi-wpa-psk-2)";
const char *expected_psk = "They're really saying I love you. >>`<< \\";
- connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_2,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_2,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wpa-psk-2-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_2, error->message);
@@ -4728,10 +4220,6 @@ test_read_wifi_wpa_psk_2 (void)
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NM_SETTING_WIRELESS_SECURITY_PSK);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -4744,25 +4232,16 @@ test_read_wifi_wpa_psk_unquoted (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System blahblah (test-wifi-wpa-psk-unquoted)";
const char *expected_psk = "54336845e2f3f321c4c7";
- connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wpa-psk-unquoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, error->message);
@@ -4819,10 +4298,6 @@ test_read_wifi_wpa_psk_unquoted (void)
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NM_SETTING_WIRELESS_SECURITY_PSK);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -4832,34 +4307,21 @@ static void
test_read_wifi_wpa_psk_unquoted2 (void)
{
NMConnection *connection;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
/* Ensure a quoted 64-character WPA passphrase will fail since passphrases
* must be between 8 and 63 ASCII characters inclusive per the WPA spec.
*/
- connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection == NULL,
"wifi-wpa-psk-unquoted-read", "unexpected success reading %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2);
g_clear_error (&error);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
}
#define TEST_IFCFG_WIFI_WPA_PSK_ADHOC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc"
@@ -4871,12 +4333,7 @@ test_read_wifi_wpa_psk_adhoc (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System blahblah (test-wifi-wpa-psk-adhoc)";
@@ -4886,15 +4343,11 @@ test_read_wifi_wpa_psk_adhoc (void)
const char *expected_group = "ccmp";
const char *expected_proto = "wpa";
- connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_ADHOC,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_ADHOC,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wpa-psk-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_ADHOC, error->message);
@@ -5026,17 +4479,13 @@ test_read_wifi_wpa_psk_adhoc (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-wpa-psk-adhoc-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WPA_PSK_ADHOC,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -5049,12 +4498,7 @@ test_read_wifi_wpa_psk_hex (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *tmp;
GBytes *ssid;
@@ -5063,15 +4507,11 @@ test_read_wifi_wpa_psk_hex (void)
const char *expected_key_mgmt = "wpa-psk";
const char *expected_psk = "1da190379817bc360dda52e85c388c439a21ea5c7bf819c64e9da051807deae6";
- connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_HEX,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_HEX,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wpa-psk-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_HEX, error->message);
@@ -5168,17 +4608,13 @@ test_read_wifi_wpa_psk_hex (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-wpa-psk-hex-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WPA_PSK_HEX,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -5192,27 +4628,19 @@ test_read_wifi_wpa_eap_tls (void)
{
NMConnection *connection;
NMSettingWireless *s_wireless;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSetting8021x *s_8021x;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp, *password;
const char *expected_identity = "Bill Smith";
const char *expected_privkey_password = "test1";
- connection = connection_from_file (TEST_IFCFG_WIFI_WPA_EAP_TLS,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_EAP_TLS,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wifi-wpa-eap-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TLS, error->message);
@@ -5239,12 +4667,12 @@ test_read_wifi_wpa_eap_tls (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-wpa-eap-tls-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WPA_EAP_TLS,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* ===== 802.1x SETTING ===== */
s_8021x = nm_connection_get_setting_802_1x (connection);
@@ -5316,10 +4744,6 @@ test_read_wifi_wpa_eap_tls (void)
expected_privkey_password,
NM_SETTING_802_1X_PRIVATE_KEY);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -5332,27 +4756,19 @@ test_read_wifi_wpa_eap_ttls_tls (void)
{
NMConnection *connection;
NMSettingWireless *s_wireless;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSetting8021x *s_8021x;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp, *password;
const char *expected_identity = "Chuck Shumer";
const char *expected_privkey_password = "test1";
- connection = connection_from_file (TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS,
+ NULL,
+ TYPE_WIRELESS,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wifi-wpa-eap-ttls-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, error->message);
@@ -5379,12 +4795,12 @@ test_read_wifi_wpa_eap_ttls_tls (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-wpa-eap-ttls-tls-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* ===== 802.1x SETTING ===== */
s_8021x = nm_connection_get_setting_802_1x (connection);
@@ -5475,10 +4891,6 @@ test_read_wifi_wpa_eap_ttls_tls (void)
NM_SETTING_802_1X_SETTING_NAME,
NM_SETTING_802_1X_IDENTITY);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -5491,22 +4903,14 @@ test_read_wifi_dynamic_wep_leap (void)
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
NMSetting8021x *s_8021x;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE, success;
+ gboolean success;
GError *error = NULL;
- connection = connection_from_file (TEST_IFCFG_WIFI_DYNAMIC_WEP_LEAP,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_DYNAMIC_WEP_LEAP,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection);
@@ -5547,10 +4951,6 @@ test_read_wifi_dynamic_wep_leap (void)
g_assert_cmpstr (nm_setting_802_1x_get_identity (s_8021x), ==, "bill smith");
g_assert_cmpstr (nm_setting_802_1x_get_password (s_8021x), ==, "foobar baz");
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -5563,28 +4963,20 @@ test_read_wifi_wep_eap_ttls_chap (void)
NMConnection *connection;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSetting8021x *s_8021x;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_password = "foobar baz";
const char *expected_identity = "David Smith";
const char *expected_key_mgmt = "ieee8021x";
- connection = connection_from_file (TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP,
+ NULL,
+ TYPE_WIRELESS,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wifi-wep-eap-ttls-chap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, error->message);
@@ -5611,12 +5003,12 @@ test_read_wifi_wep_eap_ttls_chap (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"wifi-wep-eap-ttls-chap-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* ===== 802.1x SETTING ===== */
s_wsec = nm_connection_get_setting_wireless_security (connection);
@@ -5708,10 +5100,6 @@ test_read_wifi_wep_eap_ttls_chap (void)
NM_SETTING_802_1X_SETTING_NAME,
NM_SETTING_802_1X_PASSWORD);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -5724,8 +5112,8 @@ test_read_wifi_hidden (void)
gboolean success;
GError *error = NULL;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-hidden",
- NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-hidden",
+ NULL, TYPE_WIRELESS, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
@@ -5812,8 +5200,8 @@ test_write_wifi_hidden (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile, NULL, TYPE_WIRELESS,
- NULL, NULL, NULL, NULL, &error, NULL);
+ reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS,
+ NULL, &error);
unlink (testfile);
g_assert_no_error (error);
g_assert (reread);
@@ -5838,8 +5226,8 @@ test_read_wifi_band_a (void)
gboolean success;
GError *error = NULL;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a",
- NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a",
+ NULL, TYPE_WIRELESS, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
@@ -5926,8 +5314,8 @@ test_write_wifi_band_a (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile, NULL, TYPE_WIRELESS,
- NULL, NULL, NULL, NULL, &error, NULL);
+ reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS,
+ NULL, &error);
unlink (testfile);
g_assert_no_error (error);
g_assert (reread);
@@ -5949,10 +5337,11 @@ test_read_wifi_band_a_channel_mismatch (void)
NMConnection *connection;
GError *error = NULL;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a-channel-mismatch",
- NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a-channel-mismatch",
+ NULL, TYPE_WIRELESS, NULL, &error);
g_assert (connection == NULL);
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
+ g_clear_error (&error);
}
static void
@@ -5961,10 +5350,11 @@ test_read_wifi_band_bg_channel_mismatch (void)
NMConnection *connection;
GError *error = NULL;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-bg-channel-mismatch",
- NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-bg-channel-mismatch",
+ NULL, TYPE_WIRELESS, NULL, &error);
g_assert (connection == NULL);
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
+ g_clear_error (&error);
}
#define TEST_IFCFG_WIRED_QETH_STATIC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-qeth-static"
@@ -5975,12 +5365,8 @@ test_read_wired_qeth_static (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System test-wired-qeth-static";
@@ -5990,15 +5376,11 @@ test_read_wired_qeth_static (void)
const char *expected_channel2 = "0.0.0602";
const char * const *subchannels;
- connection = connection_from_file (TEST_IFCFG_WIRED_QETH_STATIC,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_QETH_STATIC,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"wired-qeth-static-read", "failed to read %s: %s", TEST_IFCFG_WIRED_QETH_STATIC, error->message);
@@ -6123,17 +5505,13 @@ test_read_wired_qeth_static (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0,
"wired-qeth-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_WIRED_QETH_STATIC,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -6146,10 +5524,6 @@ test_read_wired_ctc_static (void)
NMSettingConnection *s_con;
NMSettingWired *s_wired;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System test-wired-ctc-static";
@@ -6158,15 +5532,11 @@ test_read_wired_ctc_static (void)
const char * const *subchannels;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_WIRED_CTC_STATIC,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIRED_CTC_STATIC,
+ NULL,
+ TYPE_ETHERNET,
+ &unmanaged,
+ &error);
g_assert_no_error (error);
g_assert (connection);
@@ -6202,10 +5572,6 @@ test_read_wired_ctc_static (void)
g_assert (tmp != NULL);
g_assert_cmpstr (tmp, ==, "0");
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -6218,25 +5584,16 @@ test_read_wifi_wep_no_keys (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *tmp;
const char *expected_id = "System foobar (test-wifi-wep-no-keys)";
NMWepKeyType key_type;
- connection = connection_from_file (TEST_IFCFG_WIFI_WEP_NO_KEYS,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_NO_KEYS,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"wifi-wep-no-keys-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_NO_KEYS, error->message);
@@ -6314,10 +5671,6 @@ test_read_wifi_wep_no_keys (void)
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NM_SETTING_WIRELESS_SECURITY_WEP_KEY0);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -6328,24 +5681,16 @@ test_read_permissions (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE, success;
+ gboolean success;
GError *error = NULL;
guint32 num;
const char *tmp;
- connection = connection_from_file (TEST_IFCFG_PERMISSIONS,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_PERMISSIONS,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"permissions-read", "failed to read %s: %s", TEST_IFCFG_PERMISSIONS, error->message);
@@ -6387,10 +5732,6 @@ test_read_permissions (void)
ASSERT (strcmp (tmp, "johnny5") == 0,
"permissions-verify-permissions", "unexpected permission #3");
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -6402,25 +5743,16 @@ test_read_wifi_wep_agent_keys (void)
NMConnection *connection;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
NMWepKeyType key_type;
gboolean success;
NMSettingSecretFlags flags;
- connection = connection_from_file (TEST_IFCFG_WIFI_WEP_AGENT_KEYS,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_AGENT_KEYS,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
g_assert (connection != NULL);
success = nm_connection_verify (connection, &error);
@@ -6451,10 +5783,6 @@ test_read_wifi_wep_agent_keys (void)
flags = nm_setting_wireless_security_get_wep_key_flags (s_wsec);
g_assert (flags & NM_SETTING_SECRET_FLAG_AGENT_OWNED);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -6465,46 +5793,26 @@ test_write_wired_static (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4, *reread_s_ip4;
- NMSettingIP6Config *s_ip6, *reread_s_ip6;
+ NMSettingIPConfig *s_ip4, *reread_s_ip4;
+ NMSettingIPConfig *s_ip6, *reread_s_ip6;
static const char *mac = "31:33:33:37:be:cd";
guint32 mtu = 1492;
char *uuid;
- const guint32 ip1 = htonl (0x01010103);
- const guint32 ip2 = htonl (0x01010105);
- const guint32 gw = htonl (0x01010101);
const char *dns1 = "4.2.2.1";
const char *dns2 = "4.2.2.2";
- const guint32 prefix = 24;
const char *dns_search1 = "foobar.com";
const char *dns_search2 = "lab.foobar.com";
const char *dns_search3 = "foobar6.com";
const char *dns_search4 = "lab6.foobar.com";
- struct in6_addr ip6, ip6_1, ip6_2;
- struct in6_addr route1_dest, route2_dest, route1_nexthop, route2_nexthop;
const char *dns6_1 = "fade:0102:0103::face";
const char *dns6_2 = "cafe:ffff:eeee:dddd:cccc:bbbb:aaaa:feed";
- const guint32 route1_prefix = 64, route2_prefix = 128;
- const guint32 route1_metric = 99, route2_metric = 1;
- NMIP4Address *addr;
- NMIP6Address *addr6;
- NMIP6Route *route6;
+ NMIPAddress *addr;
+ NMIPAddress *addr6;
+ NMIPRoute *route6;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
char *route6file = NULL;
- gboolean ignore_error = FALSE;
-
- inet_pton (AF_INET6, "1003:1234:abcd::1", &ip6);
- inet_pton (AF_INET6, "2003:1234:abcd::2", &ip6_1);
- inet_pton (AF_INET6, "3003:1234:abcd::3", &ip6_2);
- inet_pton (AF_INET6, "2222:aaaa:bbbb:cccc::", &route1_dest);
- inet_pton (AF_INET6, "2222:aaaa:bbbb:cccc:dddd:eeee:5555:6666", &route1_nexthop);
- inet_pton (AF_INET6, "::", &route2_dest);
- inet_pton (AF_INET6, "2222:aaaa::9999", &route2_nexthop);
connection = nm_simple_connection_new ();
@@ -6531,86 +5839,78 @@ test_write_wired_static (void)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
+ NM_SETTING_IP_CONFIG_ROUTE_METRIC, (gint64) 204,
NULL);
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip1);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.3", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip2);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.5", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
- nm_setting_ip4_config_add_dns (s_ip4, dns1);
- nm_setting_ip4_config_add_dns (s_ip4, dns2);
+ nm_setting_ip_config_add_dns (s_ip4, dns1);
+ nm_setting_ip_config_add_dns (s_ip4, dns2);
- nm_setting_ip4_config_add_dns_search (s_ip4, dns_search1);
- nm_setting_ip4_config_add_dns_search (s_ip4, dns_search2);
+ nm_setting_ip_config_add_dns_search (s_ip4, dns_search1);
+ nm_setting_ip_config_add_dns_search (s_ip4, dns_search2);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_ROUTE_METRIC, (gint64) 206,
NULL);
/* Add addresses */
- addr6 = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr6, &ip6);
- nm_ip6_address_set_prefix (addr6, 11);
- nm_setting_ip6_config_add_address (s_ip6, addr6);
- nm_ip6_address_unref (addr6);
-
- addr6 = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr6, &ip6_1);
- nm_ip6_address_set_prefix (addr6, 22);
- nm_setting_ip6_config_add_address (s_ip6, addr6);
- nm_ip6_address_unref (addr6);
-
- addr6 = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr6, &ip6_2);
- nm_ip6_address_set_prefix (addr6, 33);
- nm_setting_ip6_config_add_address (s_ip6, addr6);
- nm_ip6_address_unref (addr6);
+ addr6 = nm_ip_address_new (AF_INET6, "1003:1234:abcd::1", 11, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip6, addr6);
+ nm_ip_address_unref (addr6);
+
+ addr6 = nm_ip_address_new (AF_INET6, "2003:1234:abcd::2", 22, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip6, addr6);
+ nm_ip_address_unref (addr6);
+
+ addr6 = nm_ip_address_new (AF_INET6, "3003:1234:abcd::3", 33, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip6, addr6);
+ nm_ip_address_unref (addr6);
/* Add routes */
- route6 = nm_ip6_route_new ();
- nm_ip6_route_set_dest (route6, &route1_dest);
- nm_ip6_route_set_prefix (route6, route1_prefix);
- nm_ip6_route_set_next_hop (route6, &route1_nexthop);
- nm_ip6_route_set_metric (route6, route1_metric);
- nm_setting_ip6_config_add_route (s_ip6, route6);
- nm_ip6_route_unref (route6);
-
- route6 = nm_ip6_route_new ();
- nm_ip6_route_set_dest (route6, &route2_dest);
- nm_ip6_route_set_prefix (route6, route2_prefix);
- nm_ip6_route_set_next_hop (route6, &route2_nexthop);
- nm_ip6_route_set_metric (route6, route2_metric);
- nm_setting_ip6_config_add_route (s_ip6, route6);
- nm_ip6_route_unref (route6);
+ route6 = nm_ip_route_new (AF_INET6,
+ "2222:aaaa:bbbb:cccc::", 64,
+ "2222:aaaa:bbbb:cccc:dddd:eeee:5555:6666", 99, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_route (s_ip6, route6);
+ nm_ip_route_unref (route6);
+
+ route6 = nm_ip_route_new (AF_INET6, "::", 128, "2222:aaaa::9999", 1, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_route (s_ip6, route6);
+ nm_ip_route_unref (route6);
/* DNS servers */
- nm_setting_ip6_config_add_dns (s_ip6, dns6_1);
- nm_setting_ip6_config_add_dns (s_ip6, dns6_2);
+ nm_setting_ip_config_add_dns (s_ip6, dns6_1);
+ nm_setting_ip_config_add_dns (s_ip6, dns6_2);
/* DNS domains */
- nm_setting_ip6_config_add_dns_search (s_ip6, dns_search3);
- nm_setting_ip6_config_add_dns_search (s_ip6, dns_search4);
+ nm_setting_ip_config_add_dns_search (s_ip6, dns_search3);
+ nm_setting_ip_config_add_dns_search (s_ip6, dns_search4);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
"wired-static-write", "failed to verify connection: %s",
@@ -6632,15 +5932,11 @@ test_write_wired_static (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -6655,21 +5951,21 @@ test_write_wired_static (void)
*/
reread_s_ip4 = nm_connection_get_setting_ip4_config (reread);
reread_s_ip6 = nm_connection_get_setting_ip6_config (reread);
- nm_setting_ip6_config_add_dns_search (reread_s_ip6, nm_setting_ip4_config_get_dns_search (reread_s_ip4, 2));
- nm_setting_ip6_config_add_dns_search (reread_s_ip6, nm_setting_ip4_config_get_dns_search (reread_s_ip4, 3));
- nm_setting_ip4_config_remove_dns_search (reread_s_ip4, 3);
- nm_setting_ip4_config_remove_dns_search (reread_s_ip4, 2);
+ nm_setting_ip_config_add_dns_search (reread_s_ip6, nm_setting_ip_config_get_dns_search (reread_s_ip4, 2));
+ nm_setting_ip_config_add_dns_search (reread_s_ip6, nm_setting_ip_config_get_dns_search (reread_s_ip4, 3));
+ nm_setting_ip_config_remove_dns_search (reread_s_ip4, 3);
+ nm_setting_ip_config_remove_dns_search (reread_s_ip4, 2);
+
+ g_assert_cmpint (nm_setting_ip_config_get_route_metric (reread_s_ip4), ==, 204);
+ g_assert_cmpint (nm_setting_ip_config_get_route_metric (reread_s_ip6), ==, 206);
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
"wired-static-write", "written and re-read connection weren't the same.");
- if (route6file)
- unlink (route6file);
+ route6file = utils_get_route6_path (testfile);
+ unlink (route6file);
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
@@ -6682,17 +5978,12 @@ test_write_wired_dhcp (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -6714,15 +6005,15 @@ test_write_wired_dhcp (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, "random-client-id-00:22:33",
- NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, "awesome-hostname",
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, TRUE,
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, TRUE,
+ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, "awesome-hostname",
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, TRUE,
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -6730,12 +6021,12 @@ test_write_wired_dhcp (void)
(error && error->message) ? error->message : "(unknown)");
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
/* Save the ifcfg */
@@ -6754,15 +6045,11 @@ test_write_wired_dhcp (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -6775,10 +6062,6 @@ test_write_wired_dhcp (void)
"wired-dhcp-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -6791,9 +6074,9 @@ test_write_wired_dhcp_plus_ip (void)
GError *error = NULL;
gboolean success = FALSE;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip",
- NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip",
+ NULL, TYPE_ETHERNET, NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection != NULL);
@@ -6807,8 +6090,8 @@ test_write_wired_dhcp_plus_ip (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (written, NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL,
+ &error);
unlink (written);
g_free (written);
@@ -6830,16 +6113,16 @@ static void
test_read_write_wired_dhcp_send_hostname (void)
{
NMConnection *connection, *reread;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
const char * dhcp_hostname = "kamil-patka";
char *written = NULL;
GError *error = NULL;
gboolean success = FALSE;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-send-hostname",
- NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-send-hostname",
+ NULL, TYPE_ETHERNET, NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection != NULL);
@@ -6848,14 +6131,14 @@ test_read_write_wired_dhcp_send_hostname (void)
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip4);
g_assert (s_ip6);
- g_assert (nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) == TRUE);
- g_assert_cmpstr (nm_setting_ip4_config_get_dhcp_hostname (s_ip4), ==, "svata-pulec");
- g_assert_cmpstr (nm_setting_ip6_config_get_dhcp_hostname (s_ip6), ==, "svata-pulec");
+ g_assert (nm_setting_ip_config_get_dhcp_send_hostname (s_ip4) == TRUE);
+ g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip4), ==, "svata-pulec");
+ g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip6), ==, "svata-pulec");
/* Set dhcp-send-hostname=false dhcp-hostname="kamil-patka" and write the connection. */
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, FALSE, NULL);
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, dhcp_hostname, NULL);
- g_object_set (s_ip6, NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, dhcp_hostname, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, FALSE, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, dhcp_hostname, NULL);
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, dhcp_hostname, NULL);
success = writer_new_connection (connection,
TEST_SCRATCH_DIR "/network-scripts/",
@@ -6867,8 +6150,8 @@ test_read_write_wired_dhcp_send_hostname (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (written, NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL,
+ &error);
unlink (written);
g_free (written);
@@ -6887,9 +6170,9 @@ test_read_write_wired_dhcp_send_hostname (void)
s_ip6 = nm_connection_get_setting_ip6_config (reread);
g_assert (s_ip4);
g_assert (s_ip6);
- g_assert (nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) == FALSE);
- g_assert_cmpstr (nm_setting_ip4_config_get_dhcp_hostname (s_ip4), ==, dhcp_hostname);
- g_assert_cmpstr (nm_setting_ip6_config_get_dhcp_hostname (s_ip6), ==, dhcp_hostname);
+ g_assert (nm_setting_ip_config_get_dhcp_send_hostname (s_ip4) == FALSE);
+ g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip4), ==, dhcp_hostname);
+ g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip6), ==, dhcp_hostname);
g_object_unref (connection);
g_object_unref (reread);
@@ -6902,23 +6185,15 @@ test_write_wired_static_ip6_only (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
static const char *mac = "31:33:33:37:be:cd";
char *uuid;
- struct in6_addr ip6;
const char *dns6 = "fade:0102:0103::face";
- NMIP6Address *addr6;
+ NMIPAddress *addr6;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
-
- inet_pton (AF_INET6, "1003:1234:abcd::1", &ip6);
connection = nm_simple_connection_new ();
@@ -6942,30 +6217,29 @@ test_write_wired_static_ip6_only (void)
g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
NULL);
/* Add addresses */
- addr6 = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr6, &ip6);
- nm_ip6_address_set_prefix (addr6, 11);
- nm_setting_ip6_config_add_address (s_ip6, addr6);
- nm_ip6_address_unref (addr6);
+ addr6 = nm_ip_address_new (AF_INET6, "1003:1234:abcd::1", 11, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip6, addr6);
+ nm_ip_address_unref (addr6);
/* DNS server */
- nm_setting_ip6_config_add_dns (s_ip6, dns6);
+ nm_setting_ip_config_add_dns (s_ip6, dns6);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
"wired-static-ip6-only-write", "failed to verify connection: %s",
@@ -6987,15 +6261,11 @@ test_write_wired_static_ip6_only (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -7007,14 +6277,7 @@ test_write_wired_static_ip6_only (void)
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
"wired-static-ip6-only-write", "written and re-read connection weren't the same.");
- if (route6file)
- unlink (route6file);
-
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -7034,33 +6297,18 @@ test_write_wired_static_ip6_only_gw (gconstpointer user_data)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
static const char *mac = "31:33:33:37:be:cd";
char *uuid;
- struct in6_addr ip6;
const char *dns6 = "fade:0102:0103::face";
- NMIP6Address *addr6;
+ NMIPAddress *addr6;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
char *id = NULL;
- gboolean ignore_error = FALSE;
char *written_ifcfg_gateway;
- char s_gateway6[INET6_ADDRSTRLEN] = { 0 };
- struct in6_addr gateway6_autovar;
- const struct in6_addr *gateway6 = NULL;
-
- /* parsing the input argument and set the struct in6_addr "gateway6" to
- * the gateway address. NULL means "do not set the gateway explicitly". */
- if (user_data) {
- g_assert_cmpint (inet_pton (AF_INET6, user_data, &gateway6_autovar), ==, 1);
- gateway6 = &gateway6_autovar;
- }
-
- inet_pton (AF_INET6, "1003:1234:abcd::1", &ip6);
- if (gateway6)
- inet_ntop (AF_INET6, gateway6, s_gateway6, sizeof (s_gateway6));
+ const char *gateway6 = user_data;
connection = nm_simple_connection_new ();
@@ -7069,7 +6317,7 @@ test_write_wired_static_ip6_only_gw (gconstpointer user_data)
nm_connection_add_setting (connection, NM_SETTING (s_con));
uuid = nm_utils_uuid_generate ();
- id = g_strdup_printf ("Test Write Wired Static IP6 Only With Gateway %s", gateway6 ? s_gateway6 : "NULL");
+ id = g_strdup_printf ("Test Write Wired Static IP6 Only With Gateway %s", gateway6 ? gateway6 : "NULL");
g_object_set (s_con,
NM_SETTING_CONNECTION_ID, id,
NM_SETTING_CONNECTION_UUID, uuid,
@@ -7086,32 +6334,30 @@ test_write_wired_static_ip6_only_gw (gconstpointer user_data)
g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, gateway6,
NULL);
/* Add addresses */
- addr6 = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr6, &ip6);
- nm_ip6_address_set_prefix (addr6, 11);
- if (gateway6)
- nm_ip6_address_set_gateway (addr6, gateway6);
- nm_setting_ip6_config_add_address (s_ip6, addr6);
- nm_ip6_address_unref (addr6);
+ addr6 = nm_ip_address_new (AF_INET6, "1003:1234:abcd::1", 11, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip6, addr6);
+ nm_ip_address_unref (addr6);
/* DNS server */
- nm_setting_ip6_config_add_dns (s_ip6, dns6);
+ nm_setting_ip_config_add_dns (s_ip6, dns6);
g_assert (nm_connection_verify (connection, &error));
@@ -7128,13 +6374,11 @@ test_write_wired_static_ip6_only_gw (gconstpointer user_data)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- NULL, NULL,
- NULL, NULL,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (reread);
g_assert (nm_connection_verify (reread, &error));
@@ -7154,18 +6398,18 @@ test_write_wired_static_ip6_only_gw (gconstpointer user_data)
/* access the gateway from the loaded connection. */
s_ip6 = nm_connection_get_setting_ip6_config (reread);
- g_assert (s_ip6 && nm_setting_ip6_config_get_num_addresses (s_ip6)==1);
- addr6 = nm_setting_ip6_config_get_address (s_ip6, 0);
+ g_assert (s_ip6 && nm_setting_ip_config_get_num_addresses (s_ip6)==1);
+ addr6 = nm_setting_ip_config_get_address (s_ip6, 0);
g_assert (addr6);
/* assert that the gateway was written and reloaded as expected */
- if (!gateway6 || IN6_IS_ADDR_UNSPECIFIED (gateway6)) {
- g_assert (IN6_IS_ADDR_UNSPECIFIED (nm_ip6_address_get_gateway (addr6)));
- g_assert (written_ifcfg_gateway==NULL);
+ if (!gateway6 || !strcmp (gateway6, "::")) {
+ g_assert (nm_setting_ip_config_get_gateway (s_ip6) == NULL);
+ g_assert (written_ifcfg_gateway == NULL);
} else {
- g_assert (!IN6_IS_ADDR_UNSPECIFIED (nm_ip6_address_get_gateway (addr6)));
- g_assert_cmpint (memcmp (nm_ip6_address_get_gateway (addr6), gateway6, sizeof (struct in6_addr)), ==, 0);
- g_assert_cmpstr (written_ifcfg_gateway, ==, s_gateway6);
+ g_assert (nm_setting_ip_config_get_gateway (s_ip6) != NULL);
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip6), ==, gateway6);
+ g_assert_cmpstr (written_ifcfg_gateway, ==, gateway6);
}
g_free (testfile);
@@ -7182,29 +6426,19 @@ test_read_write_static_routes_legacy (void)
NMConnection *connection, *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- char *unmanaged = NULL;
+ NMSettingIPConfig *s_ip4;
char *testfile = NULL;
- char *keyfile = NULL;
- char *keyfile2 = NULL;
char *routefile = NULL;
- char *routefile2 = NULL;
char *route6file = NULL;
- char *route6file2 = NULL;
- gboolean ignore_error = FALSE;
gboolean success;
GError *error = NULL;
const char *tmp;
- connection = connection_from_file (TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"read-write-static-routes-legacy-read", "failed to read %s: %s",
TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, error->message);
@@ -7253,18 +6487,18 @@ test_read_write_static_routes_legacy (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"read-write-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip4_config_get_never_default (s_ip4) == FALSE,
+ ASSERT (nm_setting_ip_config_get_never_default (s_ip4) == FALSE,
"read-write-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT);
/* Save the ifcfg; use a special different scratch dir to ensure that
* we can clean up after the written connection in both the original
@@ -7285,25 +6519,20 @@ test_read_write_static_routes_legacy (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile2,
- &routefile2,
- &route6file2,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
- unlink (routefile2);
- unlink (route6file2);
+ routefile = utils_get_route_path (testfile);
+ unlink (routefile);
+ route6file = utils_get_route6_path (testfile);
+ unlink (route6file);
ASSERT (reread != NULL,
"read-write-static-routes-legacy-reread", "failed to read %s: %s", testfile, error->message);
- ASSERT (routefile2 != NULL,
- "read-write-static-routes-legacy-reread", "expected routefile for '%s'", testfile);
-
ASSERT (nm_connection_verify (reread, &error),
"read-write-static-routes-legacy-reread-verify", "failed to verify %s: %s", testfile, error->message);
@@ -7311,13 +6540,8 @@ test_read_write_static_routes_legacy (void)
"read-write-static-routes-legacy-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (keyfile2);
g_free (routefile);
- g_free (routefile2);
g_free (route6file);
- g_free (route6file2);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -7329,33 +6553,21 @@ test_write_wired_static_routes (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
static const char *mac = "31:33:33:37:be:cd";
guint32 mtu = 1492;
char *uuid;
- const guint32 ip1 = htonl (0x01010103);
- const guint32 ip2 = htonl (0x01010105);
- const guint32 gw = htonl (0x01010101);
const char *dns1 = "4.2.2.1";
const char *dns2 = "4.2.2.2";
- const guint32 route_dst1 = htonl (0x01020300);
- const guint32 route_dst2= htonl (0x03020100);
- const guint32 route_gw1 = htonl (0xdeadbeef);
- const guint32 route_gw2 = htonl (0xcafeabbe);
- const guint32 prefix = 24;
const char *dns_search1 = "foobar.com";
const char *dns_search2 = "lab.foobar.com";
- NMIP4Address *addr;
- NMIP4Route *route;
+ NMIPAddress *addr;
+ NMIPRoute *route;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -7382,56 +6594,48 @@ test_write_wired_static_routes (void)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
NULL);
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip1);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.3", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip2);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.5", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
/* Write out routes */
- route = nm_ip4_route_new ();
- nm_ip4_route_set_dest (route, route_dst1);
- nm_ip4_route_set_prefix (route, prefix);
- nm_ip4_route_set_next_hop (route, route_gw1);
- nm_setting_ip4_config_add_route (s_ip4, route);
- nm_ip4_route_unref (route);
-
- route = nm_ip4_route_new ();
- nm_ip4_route_set_dest (route, route_dst2);
- nm_ip4_route_set_prefix (route, prefix);
- nm_ip4_route_set_next_hop (route, route_gw2);
- nm_ip4_route_set_metric (route, 77);
- nm_setting_ip4_config_add_route (s_ip4, route);
- nm_ip4_route_unref (route);
-
- nm_setting_ip4_config_add_dns (s_ip4, dns1);
- nm_setting_ip4_config_add_dns (s_ip4, dns2);
-
- nm_setting_ip4_config_add_dns_search (s_ip4, dns_search1);
- nm_setting_ip4_config_add_dns_search (s_ip4, dns_search2);
+ route = nm_ip_route_new (AF_INET, "1.2.3.0", 24, "222.173.190.239", 0, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_route (s_ip4, route);
+ nm_ip_route_unref (route);
+
+ route = nm_ip_route_new (AF_INET, "3.2.1.0", 24, "202.254.186.190", 77, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_route (s_ip4, route);
+ nm_ip_route_unref (route);
+
+ nm_setting_ip_config_add_dns (s_ip4, dns1);
+ nm_setting_ip_config_add_dns (s_ip4, dns2);
+
+ nm_setting_ip_config_add_dns_search (s_ip4, dns_search1);
+ nm_setting_ip_config_add_dns_search (s_ip4, dns_search2);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -7454,22 +6658,17 @@ test_write_wired_static_routes (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
"wired-static-routes-write-reread", "failed to read %s: %s", testfile, error->message);
- ASSERT (routefile != NULL,
- "wired-static-routes-write-reread", "expected routefile for '%s'", testfile);
+ routefile = utils_get_route_path (testfile);
unlink (routefile);
ASSERT (nm_connection_verify (reread, &error),
@@ -7479,10 +6678,7 @@ test_write_wired_static_routes (void)
"wired-static-routes-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -7494,18 +6690,14 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
NMSetting8021x *s_8021x;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -7527,18 +6719,18 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
/* 802.1x setting */
@@ -7585,22 +6777,17 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
"wired-dhcp-8021x-peap-mschapv2write-reread", "failed to read %s: %s", testfile, error->message);
- ASSERT (keyfile != NULL,
- "wired-dhcp-8021x-peap-mschapv2write-reread", "expected keyfile for '%s'", testfile);
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
ASSERT (nm_connection_verify (reread, &error),
@@ -7610,10 +6797,7 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void)
"wired-dhcp-8021x-peap-mschapv2write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -7648,18 +6832,14 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme,
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
NMSetting8021x *s_8021x;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN;
const char *pw;
char *tmp;
@@ -7687,17 +6867,17 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme,
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
@@ -7769,17 +6949,13 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme,
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- g_assert (keyfile != NULL);
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
g_assert (reread != NULL);
@@ -7845,10 +7021,7 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme,
g_free (tmp);
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -7862,22 +7035,15 @@ test_write_wired_aliases (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *uuid;
int num_addresses = 4;
- guint32 ip[] = { 0x01010101, 0x01010102, 0x01010103, 0x01010104 };
- const char *label[] = { "", "alias0:2", "", "alias0:3" };
- const guint32 gw = htonl (0x01010101);
- const guint32 prefix = 24;
- NMIP4Address *addr;
+ const char *ip[] = { "1.1.1.1", "1.1.1.2", "1.1.1.3", "1.1.1.4" };
+ const char *label[] = { NULL, "alias0:2", NULL, "alias0:3" };
+ NMIPAddress *addr;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
shvarFile *ifcfg;
int i, j;
@@ -7908,24 +7074,25 @@ test_write_wired_aliases (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
ASSERT (s_ip4 != NULL,
"wired-aliases-write", "failed to allocate new %s setting",
NM_SETTING_IP4_CONFIG_SETTING_NAME);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
for (i = 0; i < num_addresses; i++) {
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip[i]);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- _nm_setting_ip4_config_add_address_with_label (s_ip4, addr, label[i]);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, ip[i], 24, &error);
+ g_assert_no_error (error);
+ if (label[i])
+ nm_ip_address_set_attribute (addr, "label", g_variant_new_string (label[i]));
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
}
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -7970,15 +7137,11 @@ test_write_wired_aliases (void)
"wired-aliases-write", "saving failed to delete unused ifcfg-alias0:5");
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
unlink (TEST_SCRATCH_ALIAS_BASE ":2");
unlink (TEST_SCRATCH_ALIAS_BASE ":3");
@@ -7994,49 +7157,33 @@ test_write_wired_aliases (void)
* verify the aliases manually.
*/
s_ip4 = nm_connection_get_setting_ip4_config (connection);
- ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == num_addresses,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip4) == num_addresses,
"wired-aliases-write-verify-ip4", "failed to verify %s: unexpected %s / %s key value",
testfile,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
/* Addresses */
for (i = 0; i < num_addresses; i++) {
- guint32 addrbytes;
+ const char *addrstr;
- addr = nm_setting_ip4_config_get_address (s_ip4, i);
- ASSERT (addr,
- "wired-aliases-write-verify-ip4", "failed to verify %s: missing IP4 address #%d",
- testfile,
- i);
+ addr = nm_setting_ip_config_get_address (s_ip4, i);
+ g_assert (addr != NULL);
- addrbytes = nm_ip4_address_get_address (addr);
+ addrstr = nm_ip_address_get_address (addr);
for (j = 0; j < num_addresses; j++) {
- if (addrbytes == ip[j])
+ if (!g_strcmp0 (addrstr, ip[j]))
break;
}
+ g_assert (j < num_addresses);
- ASSERT (j < num_addresses,
- "wired-aliases-write-verify-ip4", "failed to verify %s: unexpected IP4 address #%d",
- testfile,
- i);
-
- ASSERT (nm_ip4_address_get_prefix (addr) == prefix,
- "wired-aliases-write-verify-ip4", "failed to verify %s: unexpected IP4 address prefix #%d",
- testfile,
- i);
-
- ASSERT (nm_ip4_address_get_gateway (addr) == gw,
- "wired-aliases-write-verify-ip4", "failed to verify %s: unexpected IP4 address gateway #%d",
- testfile,
- i);
-
- ASSERT (g_strcmp0 (_nm_setting_ip4_config_get_address_label (s_ip4, i), label[j]) == 0,
- "wired-aliases-write-verify-ip4", "failed to verify %s: unexpected IP4 address label #%d",
- testfile,
- i);
+ g_assert_cmpint (nm_ip_address_get_prefix (addr), ==, 24);
+ if (label[j])
+ g_assert_cmpstr (g_variant_get_string (nm_ip_address_get_attribute (addr, "label"), NULL), ==, label[j]);
+ else
+ g_assert (nm_ip_address_get_attribute (addr, "label") == NULL);
- ip[j] = 0;
+ ip[j] = NULL;
}
for (i = 0; i < num_addresses; i++) {
@@ -8046,10 +7193,10 @@ test_write_wired_aliases (void)
ip[i]);
}
+ /* Gateway */
+ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "1.1.1.1");
+
g_free (testfile);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -8060,18 +7207,12 @@ test_write_gateway (void)
NMConnection *connection, *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *uuid, *testfile = NULL, *val;
gboolean success;
GError *error = NULL;
shvarFile *f;
- NMIP4Address *addr;
- const char *ip1_str = "1.1.1.3";
- const char *ip2_str = "2.2.2.5";
- const char *gw1_str = "1.1.1.254";
- const char *gw2_str = "2.2.2.254";
- struct in_addr ip1, ip2, gw1, gw2;
- const guint32 prefix = 24;
+ NMIPAddress *addr;
connection = nm_simple_connection_new ();
@@ -8092,32 +7233,24 @@ test_write_gateway (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.254",
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
- inet_pton (AF_INET, ip1_str, &ip1);
- inet_pton (AF_INET, ip2_str, &ip2);
- inet_pton (AF_INET, gw1_str, &gw1);
- inet_pton (AF_INET, gw2_str, &gw2);
-
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip1.s_addr);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw1.s_addr);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.3", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip2.s_addr);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw2.s_addr);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "2.2.2.5", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
success = nm_connection_verify (connection, &error);
g_assert_no_error (error);
@@ -8138,12 +7271,12 @@ test_write_gateway (void)
/* re-read the file to check that the keys was written as IPADDR, GATEWAY and IPADDR1, GATEWAY1 */
val = svGetValue (f, "IPADDR", FALSE);
g_assert (val);
- g_assert_cmpstr (val, ==, ip1_str);
+ g_assert_cmpstr (val, ==, "1.1.1.3");
g_free (val);
val = svGetValue (f, "IPADDR1", FALSE);
g_assert (val);
- g_assert_cmpstr (val, ==, ip2_str);
+ g_assert_cmpstr (val, ==, "2.2.2.5");
g_free (val);
val = svGetValue (f, "IPADDR0", FALSE);
@@ -8164,17 +7297,14 @@ test_write_gateway (void)
val = svGetValue (f, "GATEWAY", FALSE);
g_assert (val);
- g_assert_cmpstr (val, ==, gw1_str);
- g_free (val);
-
- val = svGetValue (f, "GATEWAY1", FALSE);
- g_assert (val);
- g_assert_cmpstr (val, ==, gw2_str);
+ g_assert_cmpstr (val, ==, "1.1.1.254");
g_free (val);
val = svGetValue (f, "GATEWAY0", FALSE);
g_assert (val == NULL);
+ val = svGetValue (f, "GATEWAY1", FALSE);
+ g_assert (val == NULL);
svCloseFile (f);
@@ -8182,8 +7312,8 @@ test_write_gateway (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile, NULL, TYPE_WIRELESS,
- NULL, NULL, NULL, NULL, &error, NULL);
+ reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS,
+ NULL, &error);
unlink (testfile);
g_assert_no_error (error);
g_assert (reread);
@@ -8207,17 +7337,12 @@ test_write_wifi_open (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 };
const char *bssid = "11:22:33:44:55:66";
@@ -8260,18 +7385,18 @@ test_write_wifi_open (void)
g_bytes_unref (ssid);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -8294,15 +7419,11 @@ test_write_wifi_open (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
g_assert_no_error (error);
/* Now make sure that the ESSID item isn't double-quoted (rh #606518) */
@@ -8332,10 +7453,6 @@ test_write_wifi_open (void)
"wifi-open-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -8347,17 +7464,12 @@ test_write_wifi_open_hex_ssid (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const unsigned char ssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd };
@@ -8390,18 +7502,18 @@ test_write_wifi_open_hex_ssid (void)
g_bytes_unref (ssid);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -8424,15 +7536,11 @@ test_write_wifi_open_hex_ssid (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -8445,10 +7553,6 @@ test_write_wifi_open_hex_ssid (void)
"wifi-open-hex-ssid-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -8461,17 +7565,13 @@ test_write_wifi_wep (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
struct stat statbuf;
@@ -8519,18 +7619,18 @@ test_write_wifi_wep (void)
nm_setting_wireless_security_set_wep_key (s_wsec, 3, "BBBBBBBBBBBBBBBBBBBBBBBBBB");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -8553,27 +7653,20 @@ test_write_wifi_wep (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- ASSERT (keyfile != NULL,
- "wifi-wep-write-reread", "expected keyfile for '%s'", testfile);
-
+ keyfile = utils_get_keys_path (testfile);
ASSERT (stat (keyfile, &statbuf) == 0,
"wifi-wep-write-reread", "couldn't stat() '%s'", keyfile);
ASSERT (S_ISREG (statbuf.st_mode),
"wifi-wep-write-reread", "keyfile '%s' wasn't a normal file", keyfile);
ASSERT ((statbuf.st_mode & 0077) == 0,
"wifi-wep-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile);
-
unlink (keyfile);
ASSERT (reread != NULL,
@@ -8586,10 +7679,7 @@ test_write_wifi_wep (void)
"wifi-wep-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -8602,25 +7692,18 @@ test_write_wifi_wep_adhoc (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
struct stat statbuf;
- NMIP4Address *addr;
- const guint32 ip1 = htonl (0x01010103);
- const guint32 gw = htonl (0x01010101);
+ NMIPAddress *addr;
const char *dns1 = "4.2.2.1";
- const guint32 prefix = 24;
connection = nm_simple_connection_new ();
@@ -8658,28 +7741,29 @@ test_write_wifi_wep_adhoc (void)
nm_setting_wireless_security_set_wep_key (s_wsec, 0, "0123456789abcdef0123456789");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
+ g_object_set (s_ip4,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
+ NULL);
/* IP Address */
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip1);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.3", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
- nm_setting_ip4_config_add_dns (s_ip4, dns1);
+ nm_setting_ip_config_add_dns (s_ip4, dns1);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -8702,27 +7786,20 @@ test_write_wifi_wep_adhoc (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- ASSERT (keyfile != NULL,
- "wifi-wep-adhoc-write-reread", "expected keyfile for '%s'", testfile);
-
+ keyfile = utils_get_keys_path (testfile);
ASSERT (stat (keyfile, &statbuf) == 0,
"wifi-wep-adhoc-write-reread", "couldn't stat() '%s'", keyfile);
ASSERT (S_ISREG (statbuf.st_mode),
"wifi-wep-adhoc-write-reread", "keyfile '%s' wasn't a normal file", keyfile);
ASSERT ((statbuf.st_mode & 0077) == 0,
"wifi-wep-adhoc-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile);
-
unlink (keyfile);
ASSERT (reread != NULL,
@@ -8735,10 +7812,7 @@ test_write_wifi_wep_adhoc (void)
"wifi-wep-adhoc-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -8751,17 +7825,13 @@ test_write_wifi_wep_passphrase (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
struct stat statbuf;
@@ -8807,18 +7877,18 @@ test_write_wifi_wep_passphrase (void)
nm_setting_wireless_security_set_wep_key (s_wsec, 0, "asdfdjaslfjasd;flasjdfl;aksdf");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -8841,27 +7911,20 @@ test_write_wifi_wep_passphrase (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- ASSERT (keyfile != NULL,
- "wifi-wep-passphrase-write-reread", "expected keyfile for '%s'", testfile);
-
+ keyfile = utils_get_keys_path (testfile);
ASSERT (stat (keyfile, &statbuf) == 0,
"wifi-wep-passphrase-write-reread", "couldn't stat() '%s'", keyfile);
ASSERT (S_ISREG (statbuf.st_mode),
"wifi-wep-passphrase-write-reread", "keyfile '%s' wasn't a normal file", keyfile);
ASSERT ((statbuf.st_mode & 0077) == 0,
"wifi-wep-passphrase-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile);
-
unlink (keyfile);
ASSERT (reread != NULL,
@@ -8874,10 +7937,7 @@ test_write_wifi_wep_passphrase (void)
"wifi-wep-passphrase-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -8890,17 +7950,13 @@ test_write_wifi_wep_40_ascii (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah40";
struct stat statbuf;
@@ -8948,18 +8004,18 @@ test_write_wifi_wep_40_ascii (void)
nm_setting_wireless_security_set_wep_key (s_wsec, 3, "donec");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -8982,27 +8038,20 @@ test_write_wifi_wep_40_ascii (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- ASSERT (keyfile != NULL,
- "wifi-wep-40-ascii-write-reread", "expected keyfile for '%s'", testfile);
-
+ keyfile = utils_get_keys_path (testfile);
ASSERT (stat (keyfile, &statbuf) == 0,
"wifi-wep-40-ascii-write-reread", "couldn't stat() '%s'", keyfile);
ASSERT (S_ISREG (statbuf.st_mode),
"wifi-wep-40-ascii-write-reread", "keyfile '%s' wasn't a normal file", keyfile);
ASSERT ((statbuf.st_mode & 0077) == 0,
"wifi-wep-40-ascii-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile);
-
unlink (keyfile);
ASSERT (reread != NULL,
@@ -9015,10 +8064,7 @@ test_write_wifi_wep_40_ascii (void)
"wifi-wep-40-ascii-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -9031,17 +8077,13 @@ test_write_wifi_wep_104_ascii (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah104";
struct stat statbuf;
@@ -9089,18 +8131,18 @@ test_write_wifi_wep_104_ascii (void)
nm_setting_wireless_security_set_wep_key (s_wsec, 3, "thisismyascii");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -9123,27 +8165,20 @@ test_write_wifi_wep_104_ascii (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- ASSERT (keyfile != NULL,
- "wifi-wep-104-ascii-write-reread", "expected keyfile for '%s'", testfile);
-
+ keyfile = utils_get_keys_path (testfile);
ASSERT (stat (keyfile, &statbuf) == 0,
"wifi-wep-104-ascii-write-reread", "couldn't stat() '%s'", keyfile);
ASSERT (S_ISREG (statbuf.st_mode),
"wifi-wep-104-ascii-write-reread", "keyfile '%s' wasn't a normal file", keyfile);
ASSERT ((statbuf.st_mode & 0077) == 0,
"wifi-wep-104-ascii-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile);
-
unlink (keyfile);
ASSERT (reread != NULL,
@@ -9156,10 +8191,7 @@ test_write_wifi_wep_104_ascii (void)
"wifi-wep-104-ascii-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -9172,17 +8204,13 @@ test_write_wifi_leap (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
struct stat statbuf;
@@ -9227,18 +8255,18 @@ test_write_wifi_leap (void)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -9261,27 +8289,20 @@ test_write_wifi_leap (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- ASSERT (keyfile != NULL,
- "wifi-leap-write-reread", "expected keyfile for '%s'", testfile);
-
+ keyfile = utils_get_keys_path (testfile);
ASSERT (stat (keyfile, &statbuf) == 0,
"wifi-leap-write-reread", "couldn't stat() '%s'", keyfile);
ASSERT (S_ISREG (statbuf.st_mode),
"wifi-leap-write-reread", "keyfile '%s' wasn't a normal file", keyfile);
ASSERT ((statbuf.st_mode & 0077) == 0,
"wifi-leap-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile);
-
unlink (keyfile);
ASSERT (reread != NULL,
@@ -9294,10 +8315,7 @@ test_write_wifi_leap (void)
"wifi-leap-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -9310,17 +8328,13 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
@@ -9366,19 +8380,19 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
success = nm_connection_verify (connection, &error);
@@ -9398,21 +8412,17 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
g_assert_no_error (error);
/* No key should be written out since the secret is not system owned */
- g_assert (keyfile);
+ keyfile = utils_get_keys_path (testfile);
g_assert (g_file_test (keyfile, G_FILE_TEST_EXISTS) == FALSE);
g_assert (reread);
@@ -9428,10 +8438,7 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags)
g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT));
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -9449,17 +8456,13 @@ test_write_wifi_wpa_psk (const char *name,
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid, *tmp;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
@@ -9518,18 +8521,18 @@ test_write_wifi_wpa_psk (const char *name,
}
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -9552,22 +8555,17 @@ test_write_wifi_wpa_psk (const char *name,
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- tmp = g_strdup_printf ("%s-reread", test_name);
- ASSERT (keyfile != NULL,
- tmp, "expected keyfile for '%s'", testfile);
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
+ tmp = g_strdup_printf ("%s-reread", test_name);
ASSERT (reread != NULL,
tmp, "failed to read %s: %s", testfile, error->message);
@@ -9579,10 +8577,7 @@ test_write_wifi_wpa_psk (const char *name,
test_name, "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -9595,24 +8590,17 @@ test_write_wifi_wpa_psk_adhoc (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
- NMIP4Address *addr;
- const guint32 ip1 = htonl (0x01010103);
- const guint32 gw = htonl (0x01010101);
+ NMIPAddress *addr;
const char *dns1 = "4.2.2.1";
- const guint32 prefix = 24;
connection = nm_simple_connection_new ();
@@ -9657,28 +8645,29 @@ test_write_wifi_wpa_psk_adhoc (void)
nm_setting_wireless_security_add_group (s_wsec, "tkip");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
+ g_object_set (s_ip4,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
+ NULL);
/* IP Address */
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip1);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.3", 25, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
- nm_setting_ip4_config_add_dns (s_ip4, dns1);
+ nm_setting_ip_config_add_dns (s_ip4, dns1);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -9701,19 +8690,14 @@ test_write_wifi_wpa_psk_adhoc (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- ASSERT (keyfile != NULL,
- "wifi-wpa-psk-adhoc-write-reread", "expected keyfile for '%s'", testfile);
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
ASSERT (reread != NULL,
@@ -9726,10 +8710,7 @@ test_write_wifi_wpa_psk_adhoc (void)
"wifi-wpa-psk-adhoc-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -9743,17 +8724,13 @@ test_write_wifi_wpa_eap_tls (void)
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
NMSetting8021x *s_8021x;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
@@ -9831,18 +8808,18 @@ test_write_wifi_wpa_eap_tls (void)
TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY, error->message);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -9865,19 +8842,14 @@ test_write_wifi_wpa_eap_tls (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
- ASSERT (keyfile != NULL,
- "wifi-wpa-eap-tls-write-reread", "expected keyfile for '%s'", testfile);
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
ASSERT (reread != NULL,
@@ -9890,10 +8862,7 @@ test_write_wifi_wpa_eap_tls (void)
"wifi-wpa-eap-tls-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -9907,17 +8876,13 @@ test_write_wifi_wpa_eap_ttls_tls (void)
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
NMSetting8021x *s_8021x;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
@@ -10013,18 +8978,18 @@ test_write_wifi_wpa_eap_ttls_tls (void)
TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY, error->message);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -10047,22 +9012,17 @@ test_write_wifi_wpa_eap_ttls_tls (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
"wifi-wpa-eap-ttls-tls-write-reread", "failed to read %s: %s", testfile, error->message);
- ASSERT (keyfile != NULL,
- "wifi-wpa-eap-ttls-tls-write-reread", "expected keyfile for '%s'", testfile);
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
ASSERT (nm_connection_verify (reread, &error),
@@ -10072,10 +9032,7 @@ test_write_wifi_wpa_eap_ttls_tls (void)
"wifi-wpa-eap-ttls-tls-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -10089,17 +9046,13 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void)
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
NMSetting8021x *s_8021x;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
@@ -10167,18 +9120,18 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void)
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -10201,22 +9154,17 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
"wifi-wpa-eap-ttls-mschapv2-write-reread", "failed to read %s: %s", testfile, error->message);
- ASSERT (keyfile != NULL,
- "wifi-wpa-eap-ttls-mschapv2-write-reread", "expected keyfile for '%s'", testfile);
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
ASSERT (nm_connection_verify (reread, &error),
@@ -10226,10 +9174,7 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void)
"wifi-wpa-eap-ttls-mschapv2-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -10242,17 +9187,13 @@ test_write_wifi_wpa_then_open (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
@@ -10310,20 +9251,20 @@ test_write_wifi_wpa_then_open (void)
nm_setting_wireless_security_add_group (s_wsec, "ccmp");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
success = nm_connection_verify (connection, &error);
@@ -10343,15 +9284,11 @@ test_write_wifi_wpa_then_open (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (reread);
@@ -10361,18 +9298,13 @@ test_write_wifi_wpa_then_open (void)
success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT);
g_assert (success);
- g_free (unmanaged);
- unmanaged = NULL;
- g_free (routefile);
- routefile = NULL;
- g_free (route6file);
- route6file = NULL;
g_object_unref (reread);
/* Now change the connection to open and recheck */
nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
/* Write it back out */
+ keyfile = utils_get_keys_path (testfile);
success = writer_update_connection (connection,
TEST_SCRATCH_DIR "/network-scripts/",
testfile,
@@ -10389,22 +9321,18 @@ test_write_wifi_wpa_then_open (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read it for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
g_assert_no_error (error);
g_assert (reread);
/* No keyfile since it's an open connection this time */
- g_assert (keyfile);
+ keyfile = utils_get_keys_path (testfile);
g_assert (g_file_test (keyfile, G_FILE_TEST_EXISTS) == FALSE);
success = nm_connection_verify (reread, &error);
@@ -10415,10 +9343,7 @@ test_write_wifi_wpa_then_open (void)
unlink (testfile);
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (reread);
g_object_unref (connection);
@@ -10432,17 +9357,13 @@ test_write_wifi_wpa_then_wep_with_perms (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
char **perms;
const char *ssid_data = "SomeSSID";
@@ -10506,20 +9427,20 @@ test_write_wifi_wpa_then_wep_with_perms (void)
nm_setting_wireless_security_add_group (s_wsec, "ccmp");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
success = nm_connection_verify (connection, &error);
@@ -10539,15 +9460,11 @@ test_write_wifi_wpa_then_wep_with_perms (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (reread);
@@ -10557,12 +9474,6 @@ test_write_wifi_wpa_then_wep_with_perms (void)
success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT);
g_assert (success);
- g_free (unmanaged);
- unmanaged = NULL;
- g_free (routefile);
- routefile = NULL;
- g_free (route6file);
- route6file = NULL;
g_object_unref (reread);
/* Now change the connection to WEP and recheck */
@@ -10576,6 +9487,7 @@ test_write_wifi_wpa_then_wep_with_perms (void)
nm_setting_wireless_security_set_wep_key (s_wsec, 0, "abraka dabra");
/* Write it back out */
+ keyfile = utils_get_keys_path (testfile);
success = writer_update_connection (connection,
TEST_SCRATCH_DIR "/network-scripts/",
testfile,
@@ -10591,15 +9503,11 @@ test_write_wifi_wpa_then_wep_with_perms (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read it for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (reread);
@@ -10614,14 +9522,12 @@ test_write_wifi_wpa_then_wep_with_perms (void)
ASSERT (success,
"test_write_wifi_wpa_then_wep_with_perms", "failed to compare connections");
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
unlink (testfile);
+ g_free (keyfile);
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (reread);
g_object_unref (connection);
@@ -10636,17 +9542,13 @@ test_write_wifi_dynamic_wep_leap (void)
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
NMSetting8021x *s_8021x;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GBytes *ssid;
const char *ssid_data = "blahblah";
shvarFile *ifcfg;
@@ -10702,19 +9604,19 @@ test_write_wifi_dynamic_wep_leap (void)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
success = nm_connection_verify (connection, &error);
@@ -10734,18 +9636,15 @@ test_write_wifi_dynamic_wep_leap (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (reread);
- g_assert (keyfile);
+
+ keyfile = utils_get_keys_path (testfile);
unlink (keyfile);
success = nm_connection_verify (reread, &error);
@@ -10774,10 +9673,7 @@ test_write_wifi_dynamic_wep_leap (void)
unlink (testfile);
g_free (testfile);
- g_free (unmanaged);
g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -10789,18 +9685,13 @@ test_write_wired_qeth_dhcp (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
char **subchans;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -10834,20 +9725,20 @@ test_write_wired_qeth_dhcp (void)
nm_setting_wired_add_s390_option (s_wired, "protocol", "blahbalh");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
/* Verify */
@@ -10871,15 +9762,11 @@ test_write_wired_qeth_dhcp (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -10891,14 +9778,7 @@ test_write_wired_qeth_dhcp (void)
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
"wired-qeth-dhcp-write", "written and re-read connection weren't the same.");
- if (route6file)
- unlink (route6file);
-
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -10910,18 +9790,13 @@ test_write_wired_ctc_dhcp (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
char **subchans;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
shvarFile *ifcfg;
char *tmp;
@@ -10955,19 +9830,19 @@ test_write_wired_ctc_dhcp (void)
nm_setting_wired_add_s390_option (s_wired, "ctcprot", "0");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
/* Verify */
@@ -11005,15 +9880,11 @@ test_write_wired_ctc_dhcp (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
g_assert (reread);
@@ -11024,14 +9895,7 @@ test_write_wired_ctc_dhcp (void)
success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT);
g_assert (success);
- if (route6file)
- unlink (route6file);
-
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -11043,17 +9907,12 @@ test_write_permissions (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -11079,20 +9938,20 @@ test_write_permissions (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
/* Verify */
@@ -11116,15 +9975,11 @@ test_write_permissions (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -11136,14 +9991,7 @@ test_write_permissions (void)
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
"permissions-write", "written and re-read connection weren't the same.");
- if (route6file)
- unlink (route6file);
-
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -11156,19 +10004,14 @@ test_write_wifi_wep_agent_keys (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
const char *str_ssid = "foobarbaz";
GBytes *ssid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
g_assert (connection != NULL);
@@ -11187,19 +10030,19 @@ test_write_wifi_wep_agent_keys (void)
g_free (uuid);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
/* Wifi setting */
@@ -11244,15 +10087,11 @@ test_write_wifi_wep_agent_keys (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_WIRELESS,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_WIRELESS,
+ NULL,
+ &error);
unlink (testfile);
g_assert_no_error (error);
@@ -11276,14 +10115,7 @@ test_write_wifi_wep_agent_keys (void)
success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT);
g_assert (success);
- if (route6file)
- unlink (route6file);
-
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -11294,7 +10126,7 @@ test_write_wired_pppoe (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSettingPppoe *s_pppoe;
NMSettingPpp *s_ppp;
char *uuid;
@@ -11322,11 +10154,11 @@ test_write_wired_pppoe (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* PPPoE setting */
@@ -11356,6 +10188,7 @@ test_write_wired_pppoe (void)
"wired-pppoe-write", "unexpected success writing connection to disk");
g_object_unref (connection);
+ g_clear_error (&error);
}
static void
@@ -11363,7 +10196,7 @@ test_write_vpn (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSettingVpn *s_vpn;
char *uuid;
gboolean success;
@@ -11398,11 +10231,11 @@ test_write_vpn (void)
nm_setting_vpn_add_secret (s_vpn, "password", "sup3rs3cr3t");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -11418,6 +10251,7 @@ test_write_vpn (void)
"vpn-write", "unexpected success writing connection to disk");
g_object_unref (connection);
+ g_clear_error (&error);
}
static void
@@ -11425,7 +10259,7 @@ test_write_mobile_broadband (gboolean gsm)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSettingGsm *s_gsm;
NMSettingCdma *s_cdma;
NMSettingPpp *s_ppp;
@@ -11476,11 +10310,11 @@ test_write_mobile_broadband (gboolean gsm)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* PPP setting */
@@ -11500,6 +10334,7 @@ test_write_mobile_broadband (gboolean gsm)
"mobile-broadband-write", "unexpected success writing connection to disk");
g_object_unref (connection);
+ g_clear_error (&error);
}
#define TEST_IFCFG_BRIDGE_MAIN TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-main"
@@ -11511,22 +10346,13 @@ test_read_bridge_main (void)
NMSettingBridge *s_bridge;
const char *mac;
char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 };
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
- GError *error = NULL;
-
- connection = connection_from_file (TEST_IFCFG_BRIDGE_MAIN,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ GError *error = NULL;
+
+ connection = connection_from_file_test (TEST_IFCFG_BRIDGE_MAIN,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_assert (connection);
g_assert (nm_connection_verify (connection, &error));
g_assert_no_error (error);
@@ -11537,22 +10363,19 @@ test_read_bridge_main (void)
s_bridge = nm_connection_get_setting_bridge (connection);
g_assert (s_bridge);
- g_assert_cmpuint (nm_setting_bridge_get_forward_delay (s_bridge), ==, 0);
+ g_assert_cmpuint (nm_setting_bridge_get_forward_delay (s_bridge), ==, 2);
g_assert (nm_setting_bridge_get_stp (s_bridge));
g_assert_cmpuint (nm_setting_bridge_get_priority (s_bridge), ==, 32744);
g_assert_cmpuint (nm_setting_bridge_get_hello_time (s_bridge), ==, 7);
g_assert_cmpuint (nm_setting_bridge_get_max_age (s_bridge), ==, 39);
g_assert_cmpuint (nm_setting_bridge_get_ageing_time (s_bridge), ==, 235352);
+ g_assert (!nm_setting_bridge_get_multicast_snooping (s_bridge));
/* MAC address */
mac = nm_setting_bridge_get_mac_address (s_bridge);
g_assert (mac);
g_assert (nm_utils_hwaddr_matches (mac, -1, expected_mac_address, ETH_ALEN));
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -11563,22 +10386,14 @@ test_write_bridge_main (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingBridge *s_bridge;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
- const guint32 ip1 = htonl (0x01010103);
- const guint32 gw = htonl (0x01010101);
- const guint32 prefix = 24;
- NMIP4Address *addr;
+ NMIPAddress *addr;
static const char *mac = "31:33:33:37:be:cd";
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
g_assert (connection);
@@ -11608,29 +10423,28 @@ test_write_bridge_main (void)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip1);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.3", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
NULL);
nmtst_assert_connection_verifies_without_normalization (connection);
@@ -11647,15 +10461,11 @@ test_write_bridge_main (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_BRIDGE,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_BRIDGE,
+ NULL,
+ &error);
unlink (testfile);
g_assert (reread);
@@ -11664,10 +10474,6 @@ test_write_bridge_main (void)
g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT));
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -11680,23 +10486,14 @@ test_read_bridge_component (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingBridgePort *s_port;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_BRIDGE_COMPONENT,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_BRIDGE_COMPONENT,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -11714,10 +10511,6 @@ test_read_bridge_component (void)
g_assert_cmpuint (nm_setting_bridge_port_get_priority (s_port), ==, 28);
g_assert_cmpuint (nm_setting_bridge_port_get_path_cost (s_port), ==, 100);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -11735,11 +10528,6 @@ test_write_bridge_component (void)
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
g_assert (connection);
@@ -11795,15 +10583,11 @@ test_write_bridge_component (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
g_assert (reread);
@@ -11813,14 +10597,7 @@ test_write_bridge_component (void)
g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT));
- if (route6file)
- unlink (route6file);
-
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -11830,22 +10607,13 @@ test_read_bridge_missing_stp (void)
{
NMConnection *connection;
NMSettingBridge *s_bridge;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
- GError *error = NULL;
-
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-missing-stp",
- NULL,
- TYPE_BRIDGE,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ GError *error = NULL;
+
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-missing-stp",
+ NULL,
+ TYPE_BRIDGE,
+ NULL,
+ &error);
g_assert (connection);
g_assert (nm_connection_verify (connection, &error));
g_assert_no_error (error);
@@ -11858,10 +10626,6 @@ test_read_bridge_missing_stp (void)
g_assert (s_bridge);
g_assert (nm_setting_bridge_get_stp (s_bridge) == FALSE);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -11871,31 +10635,18 @@ static void
test_read_vlan_interface (void)
{
NMConnection *connection;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
NMSettingVlan *s_vlan;
guint32 from = 0, to = 0;
- connection = connection_from_file (TEST_IFCFG_VLAN_INTERFACE,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_VLAN_INTERFACE,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection != NULL);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_assert_cmpstr (nm_connection_get_interface_name (connection), ==, "vlan43");
@@ -11942,30 +10693,17 @@ static void
test_read_vlan_only_vlan_id (void)
{
NMConnection *connection;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
NMSettingVlan *s_vlan;
- connection = connection_from_file (TEST_IFCFG_VLAN_ONLY_VLANID,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_VLANID,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection != NULL);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_assert (nm_connection_get_interface_name (connection) == NULL);
@@ -11984,30 +10722,17 @@ static void
test_read_vlan_only_device (void)
{
NMConnection *connection;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
NMSettingVlan *s_vlan;
- connection = connection_from_file (TEST_IFCFG_VLAN_ONLY_DEVICE,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_DEVICE,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection != NULL);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_assert_cmpstr (nm_connection_get_interface_name (connection), ==, "eth0.9");
@@ -12027,9 +10752,9 @@ test_read_vlan_physdev (void)
GError *error = NULL;
NMSettingVlan *s_vlan;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-physdev",
- NULL, TYPE_ETHERNET, NULL,
- NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-physdev",
+ NULL, TYPE_ETHERNET, NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection);
g_assert (nm_connection_verify (connection, &error));
@@ -12049,24 +10774,15 @@ static void
test_write_vlan (void)
{
NMConnection *connection;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
char *written = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
gboolean success = FALSE;
- connection = connection_from_file (TEST_IFCFG_VLAN_INTERFACE,
- NULL,
- TYPE_VLAN,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_VLAN_INTERFACE,
+ NULL,
+ TYPE_VLAN,
+ NULL,
+ &error);
g_assert (connection != NULL);
success = writer_new_connection (connection,
@@ -12078,46 +10794,25 @@ test_write_vlan (void)
unlink (written);
g_free (written);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
+ g_object_unref (connection);
}
static void
test_write_vlan_only_vlanid (void)
{
NMConnection *connection, *reread;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
char *written = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
gboolean success = FALSE;
- connection = connection_from_file (TEST_IFCFG_VLAN_ONLY_VLANID,
- NULL,
- TYPE_VLAN,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_VLANID,
+ NULL,
+ TYPE_VLAN,
+ NULL,
+ &error);
g_assert_no_error (error);
g_assert (connection != NULL);
- g_free (unmanaged);
- unmanaged = NULL;
- g_free (keyfile);
- keyfile = NULL;
- g_free (routefile);
- routefile = NULL;
- g_free (route6file);
- route6file = NULL;
-
success = writer_new_connection (connection,
TEST_SCRATCH_DIR "/network-scripts/",
&written,
@@ -12128,21 +10823,13 @@ test_write_vlan_only_vlanid (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (written,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (written,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (written);
g_free (written);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_assert_no_error (error);
g_assert (reread != NULL);
@@ -12165,17 +10852,12 @@ test_write_ethernet_missing_ipv6 (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
g_assert (connection);
@@ -12200,14 +10882,14 @@ test_write_ethernet_missing_ipv6 (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, "random-client-id-00:22:33",
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, TRUE,
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, TRUE,
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, TRUE,
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, TRUE,
NULL);
/* IP6 setting */
@@ -12236,15 +10918,11 @@ test_write_ethernet_missing_ipv6 (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -12258,22 +10936,18 @@ test_write_ethernet_missing_ipv6 (void)
* the comparison can succeed. Missing IPv6 setting should have been
* written out (and re-read) as Automatic IPv6.
*/
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
"ethernet-missing-ipv6", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -12284,11 +10958,12 @@ test_read_ibft_ignored (void)
NMConnection *connection;
GError *error = NULL;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-ibft",
- NULL, TYPE_ETHERNET,
- NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-ibft",
+ NULL, TYPE_ETHERNET,
+ NULL, &error);
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
g_assert (connection == NULL);
+ g_clear_error (&error);
}
#define TEST_IFCFG_BOND_MAIN TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bond-main"
@@ -12298,22 +10973,13 @@ test_read_bond_main (void)
{
NMConnection *connection;
NMSettingBond *s_bond;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
- GError *error = NULL;
-
- connection = connection_from_file (TEST_IFCFG_BOND_MAIN,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ GError *error = NULL;
+
+ connection = connection_from_file_test (TEST_IFCFG_BOND_MAIN,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
ASSERT (connection != NULL,
"bond-main-read", "unexpected failure reading %s", TEST_IFCFG_BOND_MAIN);
@@ -12336,10 +11002,6 @@ test_read_bond_main (void)
"bond-main", "failed to verify %s: miimon=%s does not match 100",
TEST_IFCFG_BOND_MAIN, nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_MIIMON));
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -12350,22 +11012,14 @@ test_write_bond_main (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingBond *s_bond;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
NMSettingWired *s_wired;
char *uuid;
- const guint32 ip1 = htonl (0x01010103);
- const guint32 gw = htonl (0x01010101);
- const guint32 prefix = 24;
- NMIP4Address *addr;
+ NMIPAddress *addr;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -12392,27 +11046,26 @@ test_write_bond_main (void)
nm_connection_add_setting (connection, NM_SETTING (s_bond));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip1);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.3", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
NULL);
nmtst_assert_connection_verifies_without_normalization (connection);
@@ -12433,15 +11086,11 @@ test_write_bond_main (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_BOND,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_BOND,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -12454,10 +11103,6 @@ test_write_bond_main (void)
"bond-main-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -12469,22 +11114,13 @@ test_read_bond_slave (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
- GError *error = NULL;
-
- connection = connection_from_file (TEST_IFCFG_BOND_SLAVE,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ GError *error = NULL;
+
+ connection = connection_from_file_test (TEST_IFCFG_BOND_SLAVE,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
g_test_assert_expected_messages ();
ASSERT (connection != NULL,
@@ -12506,10 +11142,6 @@ test_read_bond_slave (void)
"bond-slave-read", "failed to verify %s: slave-type is not bond",
TEST_IFCFG_BOND_SLAVE);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -12526,11 +11158,6 @@ test_write_bond_slave (void)
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -12578,15 +11205,11 @@ test_write_bond_slave (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -12598,14 +11221,7 @@ test_write_bond_slave (void)
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
"bond-slave-write", "written and re-read connection weren't the same.");
- if (route6file)
- unlink (route6file);
-
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -12618,24 +11234,16 @@ test_read_infiniband (void)
NMConnection *connection;
NMSettingInfiniband *s_infiniband;
char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
GError *error = NULL;
const char *mac;
char expected_mac_address[INFINIBAND_ALEN] = { 0x80, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22 };
const char *transport_mode;
- connection = connection_from_file (TEST_IFCFG_INFINIBAND,
- NULL,
- TYPE_INFINIBAND,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ connection = connection_from_file_test (TEST_IFCFG_INFINIBAND,
+ NULL,
+ TYPE_INFINIBAND,
+ &unmanaged,
+ &error);
ASSERT (connection != NULL,
"infiniband-read", "failed to read %s: %s", TEST_IFCFG_INFINIBAND, error->message);
@@ -12679,10 +11287,6 @@ test_read_infiniband (void)
NM_SETTING_INFINIBAND_SETTING_NAME,
NM_SETTING_INFINIBAND_TRANSPORT_MODE);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -12693,23 +11297,15 @@ test_write_infiniband (void)
NMConnection *reread;
NMSettingConnection *s_con;
NMSettingInfiniband *s_infiniband;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
const char *mac = "80:00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:00:11:22";
guint32 mtu = 65520;
char *uuid;
- const guint32 ip1 = htonl (0x01010103);
- const guint32 gw = htonl (0x01010101);
- const guint32 prefix = 24;
- NMIP4Address *addr;
+ NMIPAddress *addr;
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -12737,27 +11333,26 @@ test_write_infiniband (void)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, ip1);
- nm_ip4_address_set_prefix (addr, prefix);
- nm_ip4_address_set_gateway (addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, addr);
- nm_ip4_address_unref (addr);
+ addr = nm_ip_address_new (AF_INET, "1.1.1.3", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, addr);
+ nm_ip_address_unref (addr);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
NULL);
ASSERT (nm_connection_verify (connection, &error) == TRUE,
@@ -12780,15 +11375,11 @@ test_write_infiniband (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_INFINIBAND,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_INFINIBAND,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -12801,10 +11392,6 @@ test_write_infiniband (void)
"infiniband-write", "written and re-read connection weren't the same.");
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
@@ -12816,22 +11403,13 @@ test_read_bond_slave_ib (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
- GError *error = NULL;
-
- connection = connection_from_file (TEST_IFCFG_BOND_SLAVE_IB,
- NULL,
- NULL,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ GError *error = NULL;
+
+ connection = connection_from_file_test (TEST_IFCFG_BOND_SLAVE_IB,
+ NULL,
+ NULL,
+ NULL,
+ &error);
g_test_assert_expected_messages();
ASSERT (connection != NULL,
@@ -12853,10 +11431,6 @@ test_read_bond_slave_ib (void)
"bond-slave-read-ib", "failed to verify %s: slave-type is not bond",
TEST_IFCFG_BOND_SLAVE_IB);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
}
@@ -12872,11 +11446,6 @@ test_write_bond_slave_ib (void)
gboolean success;
GError *error = NULL;
char *testfile = NULL;
- char *unmanaged = NULL;
- char *keyfile = NULL;
- char *routefile = NULL;
- char *route6file = NULL;
- gboolean ignore_error = FALSE;
connection = nm_simple_connection_new ();
@@ -12925,15 +11494,11 @@ test_write_bond_slave_ib (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- NULL,
- &unmanaged,
- &keyfile,
- &routefile,
- &route6file,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ NULL,
+ NULL,
+ &error);
unlink (testfile);
ASSERT (reread != NULL,
@@ -12945,18 +11510,42 @@ test_write_bond_slave_ib (void)
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
"bond-slave-write-ib", "written and re-read connection weren't the same.");
- if (route6file)
- unlink (route6file);
-
g_free (testfile);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
g_object_unref (connection);
g_object_unref (reread);
}
+static void
+test_read_bond_opts_mode_numeric (void)
+{
+ NMConnection *connection;
+ NMSettingConnection *s_con;
+ NMSettingBond *s_bond;
+ gboolean success;
+ GError *error = NULL;
+
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-bond-mode-numeric",
+ NULL, TYPE_ETHERNET, NULL, &error);
+ g_assert_no_error (error);
+ g_assert (connection);
+
+ success = nm_connection_verify (connection, &error);
+ g_assert_no_error (error);
+ g_assert (success);
+
+ g_assert_cmpstr (nm_connection_get_interface_name (connection), ==, "bond0");
+
+ s_con = nm_connection_get_setting_connection (connection);
+ g_assert (s_con);
+ g_assert_cmpstr (nm_setting_connection_get_connection_type (s_con), ==, NM_SETTING_BOND_SETTING_NAME);
+
+ s_bond = nm_connection_get_setting_bond (connection);
+ g_assert (s_bond);
+ g_assert_cmpstr (nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_MODE), ==, "802.3ad");
+
+ g_object_unref (connection);
+}
+
#define DCB_ALL_FLAGS (NM_SETTING_DCB_FLAG_ENABLE | \
NM_SETTING_DCB_FLAG_ADVERTISE | \
NM_SETTING_DCB_FLAG_WILLING)
@@ -12976,8 +11565,8 @@ test_read_dcb_basic (void)
guint expected_traffic_classes[8] = { 7, 6, 5, 4, 3, 2, 1, 0 };
gboolean expected_pfcs[8] = { TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE };
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -13033,9 +11622,9 @@ test_write_dcb_basic (void)
NMSettingConnection *s_con;
NMSettingWired *s_wired;
NMSettingDcb *s_dcb;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
- gboolean success, ignore_error;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
+ gboolean success;
guint i;
char *uuid, *testfile;
const guint group_ids[8] = { 4, 0xF, 6, 0xF, 1, 7, 3, 0xF };
@@ -13063,12 +11652,12 @@ test_write_dcb_basic (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP stuff */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
- g_object_set (G_OBJECT (s_ip4), NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
+ g_object_set (G_OBJECT (s_ip4), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
- g_object_set (G_OBJECT (s_ip6), NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
+ g_object_set (G_OBJECT (s_ip6), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
/* DCB */
@@ -13107,13 +11696,11 @@ test_write_dcb_basic (void)
g_assert (testfile);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- NULL, NULL,
- NULL, NULL,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
g_assert_no_error (error);
@@ -13134,8 +11721,8 @@ test_read_dcb_default_app_priorities (void)
NMSettingDcb *s_dcb;
gboolean success;
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-default-app-priorities",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-default-app-priorities",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
success = nm_connection_verify (connection, &error);
@@ -13165,13 +11752,14 @@ test_read_dcb_bad_booleans (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*invalid DCB_PG_STRICT value*not all 0s and 1s*");
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-booleans",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-booleans",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_test_assert_expected_messages ();
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
g_assert (strstr (error->message, "invalid boolean digit"));
g_assert (connection == NULL);
+ g_clear_error (&error);
}
static void
@@ -13182,13 +11770,14 @@ test_read_dcb_short_booleans (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*DCB_PG_STRICT value*8 characters*");
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-booleans",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-booleans",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_test_assert_expected_messages ();
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
g_assert (strstr (error->message, "boolean array must be 8 characters"));
g_assert (connection == NULL);
+ g_clear_error (&error);
}
static void
@@ -13199,13 +11788,14 @@ test_read_dcb_bad_uints (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*invalid DCB_PG_UP2TC value*not 0 - 7*");
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-uints",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-uints",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_test_assert_expected_messages ();
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
g_assert (strstr (error->message, "invalid uint digit"));
g_assert (connection == NULL);
+ g_clear_error (&error);
}
static void
@@ -13216,13 +11806,14 @@ test_read_dcb_short_uints (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*DCB_PG_UP2TC value*8 characters*");
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-uints",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-uints",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_test_assert_expected_messages ();
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
g_assert (strstr (error->message, "uint array must be 8 characters"));
g_assert (connection == NULL);
+ g_clear_error (&error);
}
static void
@@ -13233,13 +11824,14 @@ test_read_dcb_bad_percent (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*invalid DCB_PG_PCT percentage value*");
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-percent",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-percent",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_test_assert_expected_messages ();
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
g_assert (strstr (error->message, "invalid percent element"));
g_assert (connection == NULL);
+ g_clear_error (&error);
}
static void
@@ -13250,13 +11842,14 @@ test_read_dcb_short_percent (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*invalid DCB_PG_PCT percentage list value*");
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-percent",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-percent",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_test_assert_expected_messages ();
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
g_assert (strstr (error->message, "percent array must be 8 elements"));
g_assert (connection == NULL);
+ g_clear_error (&error);
}
static void
@@ -13267,13 +11860,14 @@ test_read_dcb_pgpct_not_100 (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
"*DCB_PG_PCT percentages do not equal 100*");
- connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-pgpct-not-100",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-pgpct-not-100",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_test_assert_expected_messages ();
g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
g_assert (strstr (error->message, "invalid percentage sum"));
g_assert (connection == NULL);
+ g_clear_error (&error);
}
static void
@@ -13287,7 +11881,7 @@ test_read_fcoe_mode (gconstpointer user_data)
char *file;
file = g_strdup_printf (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-fcoe-%s", expected_mode);
- connection = connection_from_file (file, NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, NULL, &error);
g_free (file);
g_assert_no_error (error);
g_assert (connection);
@@ -13313,9 +11907,9 @@ test_write_fcoe_mode (gconstpointer user_data)
NMSettingConnection *s_con;
NMSettingWired *s_wired;
NMSettingDcb *s_dcb;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
- gboolean success, ignore_error;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
+ gboolean success;
char *uuid, *testfile;
connection = nm_simple_connection_new ();
@@ -13336,12 +11930,12 @@ test_write_fcoe_mode (gconstpointer user_data)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP stuff */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
- g_object_set (G_OBJECT (s_ip4), NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
+ g_object_set (G_OBJECT (s_ip4), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
- g_object_set (G_OBJECT (s_ip6), NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
+ g_object_set (G_OBJECT (s_ip6), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
/* DCB */
@@ -13377,13 +11971,11 @@ test_write_fcoe_mode (gconstpointer user_data)
}
/* re-read the connection for comparison */
- reread = connection_from_file (testfile,
- NULL,
- TYPE_ETHERNET,
- NULL, NULL,
- NULL, NULL,
- &error,
- &ignore_error);
+ reread = connection_from_file_test (testfile,
+ NULL,
+ TYPE_ETHERNET,
+ NULL,
+ &error);
unlink (testfile);
g_assert_no_error (error);
@@ -13406,8 +11998,8 @@ test_read_team_master (void)
GError *error = NULL;
const char *expected_config = "{ \"device\": \"team0\", \"link_watch\": { \"name\": \"ethtool\" } }";
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-master",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-master",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
@@ -13435,8 +12027,8 @@ test_write_team_master (void)
NMSettingConnection *s_con;
NMSettingTeam *s_team;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid, *testfile = NULL, *val;
gboolean success;
GError *error = NULL;
@@ -13472,21 +12064,21 @@ test_write_team_master (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
NULL);
nmtst_assert_connection_verifies_without_normalization (connection);
@@ -13518,8 +12110,8 @@ test_write_team_master (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile, NULL, TYPE_ETHERNET,
- NULL, NULL, NULL, NULL, &error, NULL);
+ reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET,
+ NULL, &error);
unlink (testfile);
g_assert_no_error (error);
g_assert (reread);
@@ -13545,8 +12137,8 @@ test_read_team_port (void)
GError *error = NULL;
const char *expected_config = "{ \"p4p1\": { \"prio\": -10, \"sticky\": true } }";
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
@@ -13631,6 +12223,7 @@ test_write_team_port (void)
val = svGetValue (f, "TEAM_PORT_CONFIG", TRUE);
g_assert (val);
g_assert_cmpstr (val, ==, escaped_expected_config);
+ g_free (val);
val = svGetValue (f, "TEAM_MASTER", TRUE);
g_assert (val);
g_assert_cmpstr (val, ==, "team0");
@@ -13641,8 +12234,8 @@ test_write_team_port (void)
nm_connection_normalize (connection, NULL, NULL, NULL);
/* re-read the connection for comparison */
- reread = connection_from_file (testfile, NULL, TYPE_ETHERNET,
- NULL, NULL, NULL, NULL, &error, NULL);
+ reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET,
+ NULL, &error);
unlink (testfile);
g_assert_no_error (error);
g_assert (reread);
@@ -13666,8 +12259,8 @@ test_read_team_port_empty_config (void)
gboolean success;
GError *error = NULL;
- connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port-empty-config",
- NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL);
+ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port-empty-config",
+ NULL, TYPE_ETHERNET, NULL, &error);
g_assert_no_error (error);
g_assert (connection);
@@ -13791,6 +12384,43 @@ test_svUnescape (void)
g_rand_free (r);
}
+static void
+test_read_vlan_trailing_spaces (void)
+{
+ const char *testfile = TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-trailing-spaces";
+ NMConnection *connection;
+ gboolean success;
+ GError *error = NULL;
+ NMSettingVlan *s_vlan;
+ char *contents = NULL;
+
+ /* Ensure there is whitespace at the end of the VLAN interface name,
+ * to prevent the whitespace getting stripped off and committed mistakenly
+ * by something in the future.
+ */
+ success = g_file_get_contents (testfile, &contents, NULL, &error);
+ g_assert_no_error (error);
+ g_assert (success);
+ g_assert (contents && contents[0]);
+ g_assert (strstr (contents, "DEVICE=\"vlan201\" \n"));
+ g_free (contents);
+
+ connection = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, NULL,
+ &error);
+ g_assert_no_error (error);
+ g_assert (connection != NULL);
+
+ s_vlan = nm_connection_get_setting_vlan (connection);
+ g_assert (s_vlan);
+
+ g_assert_cmpstr (nm_connection_get_interface_name (connection), ==, "vlan201");
+ g_assert_cmpstr (nm_setting_vlan_get_parent (s_vlan), ==, "enccw0.0.fb00");
+ g_assert_cmpint (nm_setting_vlan_get_id (s_vlan), ==, 201);
+ g_assert_cmpint (nm_setting_vlan_get_flags (s_vlan), ==, 0);
+
+ g_object_unref (connection);
+}
+
#define TEST_IFCFG_WIFI_OPEN_SSID_BAD_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex"
#define TEST_IFCFG_WIFI_OPEN_SSID_LONG_QUOTED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-long-quoted"
@@ -13816,6 +12446,7 @@ int main (int argc, char **argv)
nmtst_init_assert_logging (&argc, &argv);
g_test_add_func (TPATH "svUnescape", test_svUnescape);
+ g_test_add_func (TPATH "vlan-trailing-spaces", test_read_vlan_trailing_spaces);
g_test_add_func (TPATH "unmanaged", test_read_unmanaged);
g_test_add_func (TPATH "unmanaged-unrecognized", test_read_unmanaged_unrecognized);
@@ -13829,14 +12460,16 @@ int main (int argc, char **argv)
g_test_add_data_func (TPATH "static-ip6-only-gw/_NULL_", NULL, test_write_wired_static_ip6_only_gw);
g_test_add_data_func (TPATH "static-ip6-only-gw/::", "::", test_write_wired_static_ip6_only_gw);
g_test_add_data_func (TPATH "static-ip6-only-gw/2001:db8:8:4::2", "2001:db8:8:4::2", test_write_wired_static_ip6_only_gw);
- g_test_add_data_func (TPATH "static-ip6-only-gw/ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255", "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255", test_write_wired_static_ip6_only_gw);
+ g_test_add_data_func (TPATH "static-ip6-only-gw/::ffff:255.255.255.255", "::ffff:255.255.255.255", test_write_wired_static_ip6_only_gw);
test_read_wired_static (TEST_IFCFG_WIRED_STATIC, "System test-wired-static", TRUE);
test_read_wired_static (TEST_IFCFG_WIRED_STATIC_BOOTPROTO, "System test-wired-static-bootproto", FALSE);
test_read_wired_dhcp ();
g_test_add_func (TPATH "dhcp-plus-ip", test_read_wired_dhcp_plus_ip);
+ g_test_add_func (TPATH "shared-plus-ip", test_read_wired_shared_plus_ip);
g_test_add_func (TPATH "dhcp-send-hostname", test_read_write_wired_dhcp_send_hostname);
g_test_add_func (TPATH "global-gateway", test_read_wired_global_gateway);
+ g_test_add_func (TPATH "obsolete-gateway-n", test_read_wired_obsolete_gateway_n);
g_test_add_func (TPATH "never-default", test_read_wired_never_default);
test_read_wired_defroute_no ();
test_read_wired_defroute_no_gatewaydev_yes ();
@@ -14005,6 +12638,7 @@ int main (int argc, char **argv)
test_write_bond_main ();
test_write_bond_slave ();
test_write_bond_slave_ib ();
+ g_test_add_func (TPATH "bond/bonding-opts-numeric-mode", test_read_bond_opts_mode_numeric);
/* bridging */
test_read_bridge_main ();
diff --git a/src/settings/plugins/ifcfg-rh/utils.c b/src/settings/plugins/ifcfg-rh/utils.c
index 919a048438..c57f2cfedf 100644
--- a/src/settings/plugins/ifcfg-rh/utils.c
+++ b/src/settings/plugins/ifcfg-rh/utils.c
@@ -18,11 +18,15 @@
* (C) Copyright 2008 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "nm-core-internal.h"
+#include "nm-utils-internal.h"
+#include "NetworkManagerUtils.h"
#include "utils.h"
#include "shvar.h"
@@ -203,34 +207,37 @@ utils_cert_path (const char *parent, const char *suffix)
const char *
utils_get_ifcfg_name (const char *file, gboolean only_ifcfg)
{
- const char *name = NULL, *start = NULL;
- char *base;
+ const char *name;
g_return_val_if_fail (file != NULL, NULL);
- base = g_path_get_basename (file);
- if (!base)
+ name = strrchr (file, '/');
+ if (!name)
+ name = file;
+ else
+ name++;
+ if (!*name)
return NULL;
- /* Find the point in 'file' where 'base' starts. We use 'file' since it's
- * const and thus will survive after we free 'base'.
- */
- start = file + strlen (file) - strlen (base);
- g_assert (strcmp (start, base) == 0);
- g_free (base);
-
- if (!strncmp (start, IFCFG_TAG, strlen (IFCFG_TAG)))
- name = start + strlen (IFCFG_TAG);
- else if (only_ifcfg == FALSE) {
- if (!strncmp (start, KEYS_TAG, strlen (KEYS_TAG)))
- name = start + strlen (KEYS_TAG);
- else if (!strncmp (start, ROUTE_TAG, strlen (ROUTE_TAG)))
- name = start + strlen (ROUTE_TAG);
- else if (!strncmp (start, ROUTE6_TAG, strlen (ROUTE6_TAG)))
- name = start + strlen (ROUTE6_TAG);
+#define MATCH_TAG_AND_RETURN(name, TAG) \
+ G_STMT_START { \
+ if (strncmp (name, TAG, STRLEN (TAG)) == 0) { \
+ name += STRLEN (TAG); \
+ if (name[0] == '\0') \
+ return NULL; \
+ else \
+ return name; \
+ } \
+ } G_STMT_END
+
+ MATCH_TAG_AND_RETURN (name, IFCFG_TAG);
+ if (!only_ifcfg) {
+ MATCH_TAG_AND_RETURN (name, KEYS_TAG);
+ MATCH_TAG_AND_RETURN (name, ROUTE_TAG);
+ MATCH_TAG_AND_RETURN (name, ROUTE6_TAG);
}
- return name;
+ return NULL;
}
/* Used to get any ifcfg/extra file path from any other ifcfg/extra path
@@ -354,6 +361,30 @@ gone:
}
gboolean
+utils_has_complex_routes (const char *filename)
+{
+ char *rules;
+
+ g_return_val_if_fail (filename != NULL, TRUE);
+
+ rules = utils_get_extra_path (filename, RULE_TAG);
+ if (g_file_test (rules, G_FILE_TEST_EXISTS)) {
+ g_free (rules);
+ return TRUE;
+ }
+ g_free (rules);
+
+ rules = utils_get_extra_path (filename, RULE6_TAG);
+ if (g_file_test (rules, G_FILE_TEST_EXISTS)) {
+ g_free (rules);
+ return TRUE;
+ }
+ g_free (rules);
+
+ return FALSE;
+}
+
+gboolean
utils_ignore_ip_config (NMConnection *connection)
{
NMSettingConnection *s_con;
diff --git a/src/settings/plugins/ifcfg-rh/utils.h b/src/settings/plugins/ifcfg-rh/utils.h
index 95af828bb1..445437c48b 100644
--- a/src/settings/plugins/ifcfg-rh/utils.h
+++ b/src/settings/plugins/ifcfg-rh/utils.h
@@ -25,6 +25,13 @@
#include <nm-connection.h>
#include "shvar.h"
#include "common.h"
+#include "nm-logging.h"
+
+#define NM_IFCFG_CONNECTION_LOG_PATH(path) str_if_set (path,"in-memory")
+#define NM_IFCFG_CONNECTION_LOG_FMT "%s (%s,\"%s\")"
+#define NM_IFCFG_CONNECTION_LOG_ARG(con) NM_IFCFG_CONNECTION_LOG_PATH (nm_settings_connection_get_filename ((NMSettingsConnection *) (con))), nm_connection_get_uuid ((NMConnection *) (con)), nm_connection_get_id ((NMConnection *) (con))
+#define NM_IFCFG_CONNECTION_LOG_FMTD "%s (%s,\"%s\",%p)"
+#define NM_IFCFG_CONNECTION_LOG_ARGD(con) NM_IFCFG_CONNECTION_LOG_PATH (nm_settings_connection_get_filename ((NMSettingsConnection *) (con))), nm_connection_get_uuid ((NMConnection *) (con)), nm_connection_get_id ((NMConnection *) (con)), (con)
char *utils_single_quote_string (const char *str);
@@ -47,6 +54,7 @@ shvarFile *utils_get_route_ifcfg (const char *parent, gboolean should_create);
shvarFile *utils_get_route6_ifcfg (const char *parent, gboolean should_create);
gboolean utils_has_route_file_new_syntax (const char *filename);
+gboolean utils_has_complex_routes (const char *filename);
gboolean utils_ignore_ip_config (NMConnection *connection);
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c
index 55dca87c82..75547641b1 100644
--- a/src/settings/plugins/ifcfg-rh/writer.c
+++ b/src/settings/plugins/ifcfg-rh/writer.c
@@ -15,9 +15,11 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright 2009 - 2014 Red Hat, Inc.
+ * Copyright 2009 - 2015 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -42,6 +44,7 @@
#include <nm-utils.h>
#include "nm-logging.h"
+#include "gsystem-local-alloc.h"
#include "common.h"
#include "shvar.h"
#include "reader.h"
@@ -693,9 +696,15 @@ write_wireless_security_setting (NMConnection *connection,
* keys.
*/
key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec);
+ if (key_type == NM_WEP_KEY_TYPE_UNKNOWN) {
+ if (nm_utils_wep_key_valid (key, NM_WEP_KEY_TYPE_KEY))
+ key_type = NM_WEP_KEY_TYPE_KEY;
+ else if (nm_utils_wep_key_valid (key, NM_WEP_KEY_TYPE_PASSPHRASE))
+ key_type = NM_WEP_KEY_TYPE_PASSPHRASE;
+ }
if (key_type == NM_WEP_KEY_TYPE_PASSPHRASE)
tmp = g_strdup_printf ("KEY_PASSPHRASE%d", i + 1);
- else {
+ else if (key_type == NM_WEP_KEY_TYPE_KEY) {
tmp = g_strdup_printf ("KEY%d", i + 1);
/* Add 's:' prefix for ASCII keys */
@@ -703,7 +712,8 @@ write_wireless_security_setting (NMConnection *connection,
ascii_key = g_strdup_printf ("s:%s", key);
key = ascii_key;
}
- }
+ } else
+ key = NULL;
set_secret (ifcfg,
tmp,
@@ -970,6 +980,7 @@ write_wireless_setting (NMConnection *connection,
}
svSetValue (ifcfg, "SSID_HIDDEN", nm_setting_wireless_get_hidden (s_wireless) ? "yes" : NULL, TRUE);
+ svSetValue (ifcfg, "POWERSAVE", nm_setting_wireless_get_powersave (s_wireless) ? "yes" : NULL, TRUE);
svSetValue (ifcfg, "TYPE", TYPE_WIRELESS, FALSE);
@@ -1313,7 +1324,7 @@ write_team_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
}
static guint32
-get_setting_default (NMSetting *setting, const char *prop)
+get_setting_default_uint (NMSetting *setting, const char *prop)
{
GParamSpec *pspec;
GValue val = G_VALUE_INIT;
@@ -1330,11 +1341,29 @@ get_setting_default (NMSetting *setting, const char *prop)
}
static gboolean
+get_setting_default_boolean (NMSetting *setting, const char *prop)
+{
+ GParamSpec *pspec;
+ GValue val = G_VALUE_INIT;
+ gboolean ret = 0;
+
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), prop);
+ g_assert (pspec);
+ g_value_init (&val, pspec->value_type);
+ g_param_value_set_default (pspec, &val);
+ g_assert (G_VALUE_HOLDS_BOOLEAN (&val));
+ ret = g_value_get_boolean (&val);
+ g_value_unset (&val);
+ return ret;
+}
+
+static gboolean
write_bridge_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
{
NMSettingBridge *s_bridge;
const char *iface;
guint32 i;
+ gboolean b;
GString *opts;
const char *mac;
char *s;
@@ -1368,7 +1397,7 @@ write_bridge_setting (NMConnection *connection, shvarFile *ifcfg, GError **error
svSetValue (ifcfg, "STP", "yes", FALSE);
i = nm_setting_bridge_get_forward_delay (s_bridge);
- if (i != get_setting_default (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_FORWARD_DELAY)) {
+ if (i != get_setting_default_uint (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_FORWARD_DELAY)) {
s = g_strdup_printf ("%u", i);
svSetValue (ifcfg, "DELAY", s, FALSE);
g_free (s);
@@ -1377,14 +1406,14 @@ write_bridge_setting (NMConnection *connection, shvarFile *ifcfg, GError **error
g_string_append_printf (opts, "priority=%u", nm_setting_bridge_get_priority (s_bridge));
i = nm_setting_bridge_get_hello_time (s_bridge);
- if (i != get_setting_default (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_HELLO_TIME)) {
+ if (i != get_setting_default_uint (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_HELLO_TIME)) {
if (opts->len)
g_string_append_c (opts, ' ');
g_string_append_printf (opts, "hello_time=%u", i);
}
i = nm_setting_bridge_get_max_age (s_bridge);
- if (i != get_setting_default (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_MAX_AGE)) {
+ if (i != get_setting_default_uint (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_MAX_AGE)) {
if (opts->len)
g_string_append_c (opts, ' ');
g_string_append_printf (opts, "max_age=%u", i);
@@ -1392,12 +1421,19 @@ write_bridge_setting (NMConnection *connection, shvarFile *ifcfg, GError **error
}
i = nm_setting_bridge_get_ageing_time (s_bridge);
- if (i != get_setting_default (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_AGEING_TIME)) {
+ if (i != get_setting_default_uint (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_AGEING_TIME)) {
if (opts->len)
g_string_append_c (opts, ' ');
g_string_append_printf (opts, "ageing_time=%u", i);
}
+ b = nm_setting_bridge_get_multicast_snooping (s_bridge);
+ if (b != get_setting_default_boolean (NM_SETTING (s_bridge), NM_SETTING_BRIDGE_MULTICAST_SNOOPING)) {
+ if (opts->len)
+ g_string_append_c (opts, ' ');
+ g_string_append_printf (opts, "multicast_snooping=%u", (guint32) b);
+ }
+
if (opts->len)
svSetValue (ifcfg, "BRIDGING_OPTS", opts->str, FALSE);
g_string_free (opts, TRUE);
@@ -1424,11 +1460,11 @@ write_bridge_port_setting (NMConnection *connection, shvarFile *ifcfg, GError **
opts = g_string_sized_new (32);
i = nm_setting_bridge_port_get_priority (s_port);
- if (i != get_setting_default (NM_SETTING (s_port), NM_SETTING_BRIDGE_PORT_PRIORITY))
+ if (i != get_setting_default_uint (NM_SETTING (s_port), NM_SETTING_BRIDGE_PORT_PRIORITY))
g_string_append_printf (opts, "priority=%u", i);
i = nm_setting_bridge_port_get_path_cost (s_port);
- if (i != get_setting_default (NM_SETTING (s_port), NM_SETTING_BRIDGE_PORT_PATH_COST)) {
+ if (i != get_setting_default_uint (NM_SETTING (s_port), NM_SETTING_BRIDGE_PORT_PATH_COST)) {
if (opts->len)
g_string_append_c (opts, ' ');
g_string_append_printf (opts, "path_cost=%u", i);
@@ -1741,14 +1777,14 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
}
static gboolean
-write_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError **error)
+write_route_file_legacy (const char *filename, NMSettingIPConfig *s_ip4, GError **error)
{
- char dest[INET_ADDRSTRLEN];
- char next_hop[INET_ADDRSTRLEN];
+ const char *dest, *next_hop;
char **route_items;
char *route_contents;
- NMIP4Route *route;
- guint32 ip, prefix, metric;
+ NMIPRoute *route;
+ guint32 prefix;
+ gint64 metric;
guint32 i, num;
gboolean success = FALSE;
@@ -1757,7 +1793,7 @@ write_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError
g_return_val_if_fail (error != NULL, FALSE);
g_return_val_if_fail (*error == NULL, FALSE);
- num = nm_setting_ip4_config_get_num_routes (s_ip4);
+ num = nm_setting_ip_config_get_num_routes (s_ip4);
if (num == 0) {
unlink (filename);
return TRUE;
@@ -1765,21 +1801,17 @@ write_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError
route_items = g_malloc0 (sizeof (char*) * (num + 1));
for (i = 0; i < num; i++) {
- route = nm_setting_ip4_config_get_route (s_ip4, i);
-
- memset (dest, 0, sizeof (dest));
- ip = nm_ip4_route_get_dest (route);
- inet_ntop (AF_INET, (const void *) &ip, &dest[0], sizeof (dest));
-
- prefix = nm_ip4_route_get_prefix (route);
+ route = nm_setting_ip_config_get_route (s_ip4, i);
- memset (next_hop, 0, sizeof (next_hop));
- ip = nm_ip4_route_get_next_hop (route);
- inet_ntop (AF_INET, (const void *) &ip, &next_hop[0], sizeof (next_hop));
+ dest = nm_ip_route_get_dest (route);
+ prefix = nm_ip_route_get_prefix (route);
+ next_hop = nm_ip_route_get_next_hop (route);
+ metric = nm_ip_route_get_metric (route);
- metric = nm_ip4_route_get_metric (route);
-
- route_items[i] = g_strdup_printf ("%s/%u via %s metric %u\n", dest, prefix, next_hop, metric);
+ if (metric == -1)
+ route_items[i] = g_strdup_printf ("%s/%u via %s\n", dest, prefix, next_hop);
+ else
+ route_items[i] = g_strdup_printf ("%s/%u via %s metric %u\n", dest, prefix, next_hop, (guint32) metric);
}
route_items[num] = NULL;
route_contents = g_strjoinv (NULL, route_items);
@@ -1802,12 +1834,13 @@ error:
static gboolean
write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
{
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
const char *value;
char *addr_key, *prefix_key, *netmask_key, *gw_key, *metric_key, *tmp;
char *route_path = NULL;
gint32 j;
guint32 i, n, num;
+ gint64 route_metric;
GString *searches;
gboolean success = FALSE;
gboolean fake_ip4 = FALSE;
@@ -1815,7 +1848,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
s_ip4 = nm_connection_get_setting_ip4_config (connection);
if (s_ip4)
- method = nm_setting_ip4_config_get_method (s_ip4);
+ method = nm_setting_ip_config_get_method (s_ip4);
/* Missing IP4 setting is assumed to be DHCP */
if (!method)
@@ -1858,7 +1891,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
/* Temporarily create fake IP4 setting if missing; method set to DHCP above */
if (!s_ip4) {
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
fake_ip4 = TRUE;
}
@@ -1885,17 +1918,17 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
/* Write out IPADDR<n>, PREFIX<n>, GATEWAY<n> for current IP addresses
* without labels. Unset obsolete NETMASK<n>.
*/
- num = nm_setting_ip4_config_get_num_addresses (s_ip4);
+ num = nm_setting_ip_config_get_num_addresses (s_ip4);
for (i = n = 0; i < num; i++) {
- char buf[INET_ADDRSTRLEN];
- NMIP4Address *addr;
- guint32 ip;
+ NMIPAddress *addr;
+
+ addr = nm_setting_ip_config_get_address (s_ip4, i);
if (i > 0) {
- const char *label;
+ GVariant *label;
- label = _nm_setting_ip4_config_get_address_label (s_ip4, i);
- if (*label)
+ label = nm_ip_address_get_attribute (addr, "label");
+ if (label)
continue;
}
@@ -1916,26 +1949,14 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
gw_key = g_strdup_printf ("GATEWAY%d", n);
}
- addr = nm_setting_ip4_config_get_address (s_ip4, i);
+ svSetValue (ifcfg, addr_key, nm_ip_address_get_address (addr), FALSE);
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_address_get_address (addr);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0], sizeof (buf));
- svSetValue (ifcfg, addr_key, &buf[0], FALSE);
-
- tmp = g_strdup_printf ("%u", nm_ip4_address_get_prefix (addr));
+ tmp = g_strdup_printf ("%u", nm_ip_address_get_prefix (addr));
svSetValue (ifcfg, prefix_key, tmp, FALSE);
g_free (tmp);
svSetValue (ifcfg, netmask_key, NULL, FALSE);
-
- if (nm_ip4_address_get_gateway (addr)) {
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_address_get_gateway (addr);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0], sizeof (buf));
- svSetValue (ifcfg, gw_key, &buf[0], FALSE);
- } else
- svSetValue (ifcfg, gw_key, NULL, FALSE);
+ svSetValue (ifcfg, gw_key, NULL, FALSE);
g_free (addr_key);
g_free (prefix_key);
@@ -1962,7 +1983,9 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
g_free (gw_key);
}
- num = nm_setting_ip4_config_get_num_dns (s_ip4);
+ svSetValue (ifcfg, "GATEWAY", nm_setting_ip_config_get_gateway (s_ip4), FALSE);
+
+ num = nm_setting_ip_config_get_num_dns (s_ip4);
for (i = 0; i < 254; i++) {
const char *dns;
@@ -1971,19 +1994,19 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
if (i >= num)
svSetValue (ifcfg, addr_key, NULL, FALSE);
else {
- dns = nm_setting_ip4_config_get_dns (s_ip4, i);
+ dns = nm_setting_ip_config_get_dns (s_ip4, i);
svSetValue (ifcfg, addr_key, dns, FALSE);
}
g_free (addr_key);
}
- num = nm_setting_ip4_config_get_num_dns_searches (s_ip4);
+ num = nm_setting_ip_config_get_num_dns_searches (s_ip4);
if (num > 0) {
searches = g_string_new (NULL);
for (i = 0; i < num; i++) {
if (i > 0)
g_string_append_c (searches, ' ');
- g_string_append (searches, nm_setting_ip4_config_get_dns_search (s_ip4, i));
+ g_string_append (searches, nm_setting_ip_config_get_dns_search (s_ip4, i));
}
svSetValue (ifcfg, "DOMAIN", searches->str, FALSE);
g_string_free (searches, TRUE);
@@ -1992,7 +2015,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
/* DEFROUTE; remember that it has the opposite meaning from never-default */
svSetValue (ifcfg, "DEFROUTE",
- nm_setting_ip4_config_get_never_default (s_ip4) ? "no" : "yes",
+ nm_setting_ip_config_get_never_default (s_ip4) ? "no" : "yes",
FALSE);
svSetValue (ifcfg, "PEERDNS", NULL, FALSE);
@@ -2000,14 +2023,14 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
svSetValue (ifcfg, "DHCP_CLIENT_ID", NULL, FALSE);
if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
svSetValue (ifcfg, "PEERDNS",
- nm_setting_ip4_config_get_ignore_auto_dns (s_ip4) ? "no" : "yes",
+ nm_setting_ip_config_get_ignore_auto_dns (s_ip4) ? "no" : "yes",
FALSE);
svSetValue (ifcfg, "PEERROUTES",
- nm_setting_ip4_config_get_ignore_auto_routes (s_ip4) ? "no" : "yes",
+ nm_setting_ip_config_get_ignore_auto_routes (s_ip4) ? "no" : "yes",
FALSE);
- value = nm_setting_ip4_config_get_dhcp_hostname (s_ip4);
+ value = nm_setting_ip_config_get_dhcp_hostname (s_ip4);
if (value)
svSetValue (ifcfg, "DHCP_HOSTNAME", value, FALSE);
@@ -2015,18 +2038,23 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
* in that case, because it is NM-specific variable
*/
svSetValue (ifcfg, "DHCP_SEND_HOSTNAME",
- nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) ? NULL : "no",
+ nm_setting_ip_config_get_dhcp_send_hostname (s_ip4) ? NULL : "no",
FALSE);
- value = nm_setting_ip4_config_get_dhcp_client_id (s_ip4);
+ value = nm_setting_ip4_config_get_dhcp_client_id (NM_SETTING_IP4_CONFIG (s_ip4));
if (value)
svSetValue (ifcfg, "DHCP_CLIENT_ID", value, FALSE);
}
svSetValue (ifcfg, "IPV4_FAILURE_FATAL",
- nm_setting_ip4_config_get_may_fail (s_ip4) ? "no" : "yes",
+ nm_setting_ip_config_get_may_fail (s_ip4) ? "no" : "yes",
FALSE);
+ route_metric = nm_setting_ip_config_get_route_metric (s_ip4);
+ tmp = route_metric != -1 ? g_strdup_printf ("%"G_GINT64_FORMAT, route_metric) : NULL;
+ svSetValue (ifcfg, "IPV4_ROUTE_METRIC", tmp, FALSE);
+ g_free (tmp);
+
/* Static routes - route-<name> file */
route_path = utils_get_route_path (ifcfg->fileName);
if (!route_path) {
@@ -2047,11 +2075,12 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
}
g_free (route_path);
- num = nm_setting_ip4_config_get_num_routes (s_ip4);
+ num = nm_setting_ip_config_get_num_routes (s_ip4);
for (i = 0; i < 256; i++) {
char buf[INET_ADDRSTRLEN];
- NMIP4Route *route;
- guint32 ip, metric;
+ NMIPRoute *route;
+ guint32 netmask;
+ gint64 metric;
addr_key = g_strdup_printf ("ADDRESS%d", i);
netmask_key = g_strdup_printf ("NETMASK%d", i);
@@ -2064,29 +2093,23 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
svSetValue (routefile, gw_key, NULL, FALSE);
svSetValue (routefile, metric_key, NULL, FALSE);
} else {
- route = nm_setting_ip4_config_get_route (s_ip4, i);
+ route = nm_setting_ip_config_get_route (s_ip4, i);
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_route_get_dest (route);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0], sizeof (buf));
- svSetValue (routefile, addr_key, &buf[0], FALSE);
+ svSetValue (routefile, addr_key, nm_ip_route_get_dest (route), FALSE);
memset (buf, 0, sizeof (buf));
- ip = nm_utils_ip4_prefix_to_netmask (nm_ip4_route_get_prefix (route));
- inet_ntop (AF_INET, (const void *) &ip, &buf[0], sizeof (buf));
+ netmask = nm_utils_ip4_prefix_to_netmask (nm_ip_route_get_prefix (route));
+ inet_ntop (AF_INET, (const void *) &netmask, &buf[0], sizeof (buf));
svSetValue (routefile, netmask_key, &buf[0], FALSE);
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_route_get_next_hop (route);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0], sizeof (buf));
- svSetValue (routefile, gw_key, &buf[0], FALSE);
+ svSetValue (routefile, gw_key, nm_ip_route_get_next_hop (route), FALSE);
memset (buf, 0, sizeof (buf));
- metric = nm_ip4_route_get_metric (route);
- if (metric == 0)
+ metric = nm_ip_route_get_metric (route);
+ if (metric == -1)
svSetValue (routefile, metric_key, NULL, FALSE);
else {
- tmp = g_strdup_printf ("%u", metric);
+ tmp = g_strdup_printf ("%u", (guint32) metric);
svSetValue (routefile, metric_key, tmp, FALSE);
g_free (tmp);
}
@@ -2121,14 +2144,17 @@ out:
static void
write_ip4_aliases (NMConnection *connection, char *base_ifcfg_path)
{
- NMSettingIP4Config *s_ip4;
- char *base_ifcfg_dir, *base_ifcfg_name, *base_name;
+ NMSettingIPConfig *s_ip4;
+ gs_free char *base_ifcfg_dir = NULL, *base_ifcfg_name = NULL;
+ const char*base_name;
int i, num, base_ifcfg_name_len, base_name_len;
GDir *dir;
base_ifcfg_dir = g_path_get_dirname (base_ifcfg_path);
base_ifcfg_name = g_path_get_basename (base_ifcfg_path);
base_ifcfg_name_len = strlen (base_ifcfg_name);
+ if (!g_str_has_prefix (base_ifcfg_name, IFCFG_TAG))
+ g_return_if_reached ();
base_name = base_ifcfg_name + strlen (IFCFG_TAG);
base_name_len = strlen (base_name);
@@ -2159,15 +2185,20 @@ write_ip4_aliases (NMConnection *connection, char *base_ifcfg_path)
if (!s_ip4)
return;
- num = nm_setting_ip4_config_get_num_addresses (s_ip4);
+ num = nm_setting_ip_config_get_num_addresses (s_ip4);
for (i = 0; i < num; i++) {
+ GVariant *label_var;
const char *label, *p;
- char buf[INET_ADDRSTRLEN], *path, *tmp;
- NMIP4Address *addr;
- guint32 ip;
+ char *path, *tmp;
+ NMIPAddress *addr;
shvarFile *ifcfg;
- label = _nm_setting_ip4_config_get_address_label (s_ip4, i);
+ addr = nm_setting_ip_config_get_address (s_ip4, i);
+
+ label_var = nm_ip_address_get_attribute (addr, "label");
+ if (!label_var)
+ continue;
+ label = g_variant_get_string (label_var, NULL);
if ( strncmp (label, base_name, base_name_len) != 0
|| label[base_name_len] != ':')
continue;
@@ -2185,42 +2216,24 @@ write_ip4_aliases (NMConnection *connection, char *base_ifcfg_path)
svSetValue (ifcfg, "DEVICE", label, FALSE);
- addr = nm_setting_ip4_config_get_address (s_ip4, i);
-
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_address_get_address (addr);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0], sizeof (buf));
- svSetValue (ifcfg, "IPADDR", &buf[0], FALSE);
+ addr = nm_setting_ip_config_get_address (s_ip4, i);
+ svSetValue (ifcfg, "IPADDR", nm_ip_address_get_address (addr), FALSE);
- tmp = g_strdup_printf ("%u", nm_ip4_address_get_prefix (addr));
+ tmp = g_strdup_printf ("%u", nm_ip_address_get_prefix (addr));
svSetValue (ifcfg, "PREFIX", tmp, FALSE);
g_free (tmp);
- if (nm_ip4_address_get_gateway (addr)) {
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_address_get_gateway (addr);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0], sizeof (buf));
- svSetValue (ifcfg, "GATEWAY", &buf[0], FALSE);
- }
-
svWriteFile (ifcfg, 0644, NULL);
svCloseFile (ifcfg);
}
-
- g_free (base_ifcfg_name);
- g_free (base_ifcfg_dir);
}
static gboolean
-write_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **error)
+write_route6_file (const char *filename, NMSettingIPConfig *s_ip6, GError **error)
{
- char dest[INET6_ADDRSTRLEN];
- char next_hop[INET6_ADDRSTRLEN];
char **route_items;
char *route_contents;
- NMIP6Route *route;
- const struct in6_addr *ip;
- guint32 prefix, metric;
+ NMIPRoute *route;
guint32 i, num;
gboolean success = FALSE;
@@ -2229,7 +2242,7 @@ write_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **err
g_return_val_if_fail (error != NULL, FALSE);
g_return_val_if_fail (*error == NULL, FALSE);
- num = nm_setting_ip6_config_get_num_routes (s_ip6);
+ num = nm_setting_ip_config_get_num_routes (s_ip6);
if (num == 0) {
unlink (filename);
return TRUE;
@@ -2237,21 +2250,20 @@ write_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **err
route_items = g_malloc0 (sizeof (char*) * (num + 1));
for (i = 0; i < num; i++) {
- route = nm_setting_ip6_config_get_route (s_ip6, i);
-
- memset (dest, 0, sizeof (dest));
- ip = nm_ip6_route_get_dest (route);
- inet_ntop (AF_INET6, (const void *) ip, &dest[0], sizeof (dest));
+ route = nm_setting_ip_config_get_route (s_ip6, i);
- prefix = nm_ip6_route_get_prefix (route);
-
- memset (next_hop, 0, sizeof (next_hop));
- ip = nm_ip6_route_get_next_hop (route);
- inet_ntop (AF_INET6, (const void *) ip, &next_hop[0], sizeof (next_hop));
-
- metric = nm_ip6_route_get_metric (route);
-
- route_items[i] = g_strdup_printf ("%s/%u via %s metric %u\n", dest, prefix, next_hop, metric);
+ if (nm_ip_route_get_metric (route) == -1) {
+ route_items[i] = g_strdup_printf ("%s/%u via %s\n",
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route),
+ nm_ip_route_get_next_hop (route));
+ } else {
+ route_items[i] = g_strdup_printf ("%s/%u via %s metric %u\n",
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route),
+ nm_ip_route_get_next_hop (route),
+ (guint32) nm_ip_route_get_metric (route));
+ }
}
route_items[num] = NULL;
route_contents = g_strjoinv (NULL, route_items);
@@ -2273,17 +2285,16 @@ error:
static gboolean
write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
{
- NMSettingIP6Config *s_ip6;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip6;
+ NMSettingIPConfig *s_ip4;
const char *value;
- char *addr_key, *prefix;
+ char *addr_key;
+ char *tmp;
guint32 i, num, num4;
GString *searches;
- char buf[INET6_ADDRSTRLEN];
- char ipv6_defaultgw[INET6_ADDRSTRLEN];
- NMIP6Address *addr;
- const struct in6_addr *ip;
+ NMIPAddress *addr;
const char *dns;
+ gint64 route_metric;
GString *ip_str1, *ip_str2, *ip_ptr;
char *route6_path;
@@ -2297,10 +2308,11 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
svSetValue (ifcfg, "IPV6_PEERDNS", "yes", FALSE);
svSetValue (ifcfg, "IPV6_PEERROUTES", "yes", FALSE);
svSetValue (ifcfg, "IPV6_FAILURE_FATAL", "no", FALSE);
+ svSetValue (ifcfg, "IPV6_ROUTE_METRIC", NULL, FALSE);
return TRUE;
}
- value = nm_setting_ip6_config_get_method (s_ip6);
+ value = nm_setting_ip_config_get_method (s_ip6);
g_assert (value);
if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) {
svSetValue (ifcfg, "IPV6INIT", "no", FALSE);
@@ -2315,7 +2327,7 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
svSetValue (ifcfg, "IPV6INIT", "yes", FALSE);
svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE);
svSetValue (ifcfg, "DHCPV6C", "yes", FALSE);
- hostname = nm_setting_ip6_config_get_dhcp_hostname (s_ip6);
+ hostname = nm_setting_ip_config_get_dhcp_hostname (s_ip6);
if (hostname)
svSetValue (ifcfg, "DHCP_HOSTNAME", hostname, FALSE);
} else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
@@ -2333,59 +2345,47 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
}
/* Write out IP addresses */
- num = nm_setting_ip6_config_get_num_addresses (s_ip6);
+ num = nm_setting_ip_config_get_num_addresses (s_ip6);
ip_str1 = g_string_new (NULL);
ip_str2 = g_string_new (NULL);
- ipv6_defaultgw[0] = 0;
for (i = 0; i < num; i++) {
if (i == 0)
ip_ptr = ip_str1;
else
ip_ptr = ip_str2;
- addr = nm_setting_ip6_config_get_address (s_ip6, i);
- ip = nm_ip6_address_get_address (addr);
- prefix = g_strdup_printf ("%u", nm_ip6_address_get_prefix (addr));
- memset (buf, 0, sizeof (buf));
- inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf));
+ addr = nm_setting_ip_config_get_address (s_ip6, i);
+
if (i > 1)
g_string_append_c (ip_ptr, ' '); /* separate addresses in IPV6ADDR_SECONDARIES */
- g_string_append (ip_ptr, buf);
- g_string_append_c (ip_ptr, '/');
- g_string_append (ip_ptr, prefix);
- g_free (prefix);
-
- /* We only support gateway for the first IP address for now */
- if (i == 0) {
- ip = nm_ip6_address_get_gateway (addr);
- if (!IN6_IS_ADDR_UNSPECIFIED (ip))
- inet_ntop (AF_INET6, ip, ipv6_defaultgw, sizeof (ipv6_defaultgw));
- }
+ g_string_append_printf (ip_ptr, "%s/%u",
+ nm_ip_address_get_address (addr),
+ nm_ip_address_get_prefix (addr));
}
svSetValue (ifcfg, "IPV6ADDR", ip_str1->str, FALSE);
svSetValue (ifcfg, "IPV6ADDR_SECONDARIES", ip_str2->str, FALSE);
- svSetValue (ifcfg, "IPV6_DEFAULTGW", ipv6_defaultgw, FALSE);
+ svSetValue (ifcfg, "IPV6_DEFAULTGW", nm_setting_ip_config_get_gateway (s_ip6), FALSE);
g_string_free (ip_str1, TRUE);
g_string_free (ip_str2, TRUE);
/* Write out DNS - 'DNS' key is used both for IPv4 and IPv6 */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
- num4 = s_ip4 ? nm_setting_ip4_config_get_num_dns (s_ip4) : 0; /* from where to start with IPv6 entries */
- num = nm_setting_ip6_config_get_num_dns (s_ip6);
+ num4 = s_ip4 ? nm_setting_ip_config_get_num_dns (s_ip4) : 0; /* from where to start with IPv6 entries */
+ num = nm_setting_ip_config_get_num_dns (s_ip6);
for (i = 0; i < 254; i++) {
addr_key = g_strdup_printf ("DNS%d", i + num4 + 1);
if (i >= num)
svSetValue (ifcfg, addr_key, NULL, FALSE);
else {
- dns = nm_setting_ip6_config_get_dns (s_ip6, i);
+ dns = nm_setting_ip_config_get_dns (s_ip6, i);
svSetValue (ifcfg, addr_key, dns, FALSE);
}
g_free (addr_key);
}
/* Write out DNS domains - 'DOMAIN' key is shared for both IPv4 and IPv6 domains */
- num = nm_setting_ip6_config_get_num_dns_searches (s_ip6);
+ num = nm_setting_ip_config_get_num_dns_searches (s_ip6);
if (num > 0) {
char *ip4_domains;
ip4_domains = svGetValue (ifcfg, "DOMAIN", FALSE);
@@ -2393,7 +2393,7 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
for (i = 0; i < num; i++) {
if (searches->len > 0)
g_string_append_c (searches, ' ');
- g_string_append (searches, nm_setting_ip6_config_get_dns_search (s_ip6, i));
+ g_string_append (searches, nm_setting_ip_config_get_dns_search (s_ip6, i));
}
svSetValue (ifcfg, "DOMAIN", searches->str, FALSE);
g_string_free (searches, TRUE);
@@ -2402,7 +2402,7 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
/* handle IPV6_DEFROUTE */
/* IPV6_DEFROUTE has the opposite meaning from 'never-default' */
- if (nm_setting_ip6_config_get_never_default(s_ip6))
+ if (nm_setting_ip_config_get_never_default(s_ip6))
svSetValue (ifcfg, "IPV6_DEFROUTE", "no", FALSE);
else
svSetValue (ifcfg, "IPV6_DEFROUTE", "yes", FALSE);
@@ -2411,22 +2411,27 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
svSetValue (ifcfg, "IPV6_PEERROUTES", NULL, FALSE);
if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) {
svSetValue (ifcfg, "IPV6_PEERDNS",
- nm_setting_ip6_config_get_ignore_auto_dns (s_ip6) ? "no" : "yes",
+ nm_setting_ip_config_get_ignore_auto_dns (s_ip6) ? "no" : "yes",
FALSE);
svSetValue (ifcfg, "IPV6_PEERROUTES",
- nm_setting_ip6_config_get_ignore_auto_routes (s_ip6) ? "no" : "yes",
+ nm_setting_ip_config_get_ignore_auto_routes (s_ip6) ? "no" : "yes",
FALSE);
}
svSetValue (ifcfg, "IPV6_FAILURE_FATAL",
- nm_setting_ip6_config_get_may_fail (s_ip6) ? "no" : "yes",
+ nm_setting_ip_config_get_may_fail (s_ip6) ? "no" : "yes",
FALSE);
+ route_metric = nm_setting_ip_config_get_route_metric (s_ip6);
+ tmp = route_metric != -1 ? g_strdup_printf ("%"G_GINT64_FORMAT, route_metric) : NULL;
+ svSetValue (ifcfg, "IPV6_ROUTE_METRIC", tmp, FALSE);
+ g_free (tmp);
+
/* IPv6 Privacy Extensions */
svSetValue (ifcfg, "IPV6_PRIVACY", NULL, FALSE);
svSetValue (ifcfg, "IPV6_PRIVACY_PREFER_PUBLIC_IP", NULL, FALSE);
- switch (nm_setting_ip6_config_get_ip6_privacy (s_ip6)){
+ switch (nm_setting_ip6_config_get_ip6_privacy (NM_SETTING_IP6_CONFIG (s_ip6))){
case NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED:
svSetValue (ifcfg, "IPV6_PRIVACY", "no", FALSE);
break;
@@ -2667,6 +2672,12 @@ writer_update_connection (NMConnection *connection,
const char *keyfile,
GError **error)
{
+ if (utils_has_complex_routes (filename)) {
+ g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+ "Cannot modify a connection that has an associated 'rule-' or 'rule6-' file");
+ return FALSE;
+ }
+
return write_connection (connection, ifcfg_dir, filename, keyfile, NULL, error);
}
diff --git a/src/settings/plugins/ifcfg-suse/plugin.c b/src/settings/plugins/ifcfg-suse/plugin.c
index a45ecd523c..a1667f6455 100644
--- a/src/settings/plugins/ifcfg-suse/plugin.c
+++ b/src/settings/plugins/ifcfg-suse/plugin.c
@@ -22,7 +22,8 @@
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <string.h>
#include <gmodule.h>
diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c
index f76876f11f..888ee589ad 100644
--- a/src/settings/plugins/ifnet/connection_parser.c
+++ b/src/settings/plugins/ifnet/connection_parser.c
@@ -30,6 +30,7 @@
#include "nm-system-config-interface.h"
#include "nm-logging.h"
#include "nm-core-internal.h"
+#include "NetworkManagerUtils.h"
#include "net_utils.h"
#include "wpa_parser.h"
@@ -42,8 +43,16 @@ connection_id_from_ifnet_name (const char *conn_name)
int name_len = strlen (conn_name);
/* Convert a hex-encoded conn_name (only used for wifi SSIDs) to human-readable one */
- if ((name_len > 2) && (g_str_has_prefix (conn_name, "0x")))
- return nm_utils_hexstr2bin (conn_name + 2, name_len - 2);
+ if ((name_len > 2) && (g_str_has_prefix (conn_name, "0x"))) {
+ GBytes *bytes = nm_utils_hexstr2bin (conn_name);
+ char *buf;
+
+ if (bytes) {
+ buf = g_strndup (g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
+ g_bytes_unref (bytes);
+ return buf;
+ }
+ }
return g_strdup (conn_name);
}
@@ -544,25 +553,25 @@ make_wired_connection_setting (NMConnection *connection,
nm_connection_add_setting (connection, NM_SETTING (s_wired));
}
-/* add NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME,
- * NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID in future*/
+/* add NM_SETTING_IP_CONFIG_DHCP_HOSTNAME,
+ * NM_SETTING_IP_CONFIG_DHCP_CLIENT_ID in future*/
static void
make_ip4_setting (NMConnection *connection,
const char *conn_name,
GError **error)
{
- NMSettingIP4Config *ip4_setting =
- NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ NMSettingIPConfig *ip4_setting =
+ NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
const char *value, *method = NULL;
gboolean is_static_block = is_static_ip4 (conn_name);
ip_block *iblock = NULL;
/* set dhcp options (dhcp_xxx) */
value = ifnet_get_data (conn_name, "dhcp");
- g_object_set (ip4_setting, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, value
+ g_object_set (ip4_setting, NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, value
&& strstr (value, "nodns") ? TRUE : FALSE,
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, value
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, value
&& strstr (value, "nogateway") ? TRUE : FALSE, NULL);
if (!is_static_block) {
@@ -575,21 +584,21 @@ make_ip4_setting (NMConnection *connection,
}
if (strstr (method, "dhcp"))
g_object_set (ip4_setting,
- NM_SETTING_IP4_CONFIG_METHOD,
+ NM_SETTING_IP_CONFIG_METHOD,
NM_SETTING_IP4_CONFIG_METHOD_AUTO,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, FALSE, NULL);
else if (strstr (method, "autoip")) {
g_object_set (ip4_setting,
- NM_SETTING_IP4_CONFIG_METHOD,
+ NM_SETTING_IP_CONFIG_METHOD,
NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, FALSE, NULL);
nm_connection_add_setting (connection, NM_SETTING (ip4_setting));
return;
} else if (strstr (method, "shared")) {
g_object_set (ip4_setting,
- NM_SETTING_IP4_CONFIG_METHOD,
+ NM_SETTING_IP_CONFIG_METHOD,
NM_SETTING_IP4_CONFIG_METHOD_SHARED,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL);
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, FALSE, NULL);
nm_connection_add_setting (connection, NM_SETTING (ip4_setting));
return;
} else {
@@ -611,29 +620,32 @@ make_ip4_setting (NMConnection *connection,
/************** add all ip settings to the connection**********/
while (iblock) {
ip_block *current_iblock;
- NMIP4Address *ip4_addr = nm_ip4_address_new ();
-
- nm_ip4_address_set_address (ip4_addr, iblock->ip);
- nm_ip4_address_set_prefix (ip4_addr,
- nm_utils_ip4_netmask_to_prefix
- (iblock->netmask));
- /* currently all the IPs has the same gateway */
- nm_ip4_address_set_gateway (ip4_addr, iblock->gateway);
- if (iblock->gateway)
+ NMIPAddress *ip4_addr;
+ GError *local = NULL;
+
+ ip4_addr = nm_ip_address_new (AF_INET, iblock->ip, iblock->prefix, &local);
+ if (iblock->next_hop)
g_object_set (ip4_setting,
- NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES,
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES,
TRUE, NULL);
- if (!nm_setting_ip4_config_add_address (ip4_setting, ip4_addr))
- nm_log_warn (LOGD_SETTINGS, "ignoring duplicate IP4 address");
- nm_ip4_address_unref (ip4_addr);
+
+ if (ip4_addr) {
+ if (!nm_setting_ip_config_add_address (ip4_setting, ip4_addr))
+ nm_log_warn (LOGD_SETTINGS, "ignoring duplicate IP4 address");
+ nm_ip_address_unref (ip4_addr);
+ } else {
+ nm_log_warn (LOGD_SETTINGS, " ignoring invalid address entry: %s", local->message);
+ g_clear_error (&local);
+ }
+
current_iblock = iblock;
iblock = iblock->next;
destroy_ip_block (current_iblock);
}
g_object_set (ip4_setting,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, !has_default_ip4_route (conn_name),
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, !has_default_ip4_route (conn_name),
NULL);
}
@@ -644,7 +656,7 @@ make_ip4_setting (NMConnection *connection,
get_dhcp_hostname_and_client_id (&dhcp_hostname, &client_id);
if (dhcp_hostname) {
g_object_set (ip4_setting,
- NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME,
+ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME,
dhcp_hostname, NULL);
nm_log_info (LOGD_SETTINGS, "DHCP hostname: %s", dhcp_hostname);
g_free (dhcp_hostname);
@@ -675,7 +687,7 @@ make_ip4_setting (NMConnection *connection,
for (item = searches; *item; item++) {
if (strlen (*item)) {
- if (!nm_setting_ip4_config_add_dns_search (ip4_setting, *item))
+ if (!nm_setting_ip_config_add_dns_search (ip4_setting, *item))
nm_log_warn (LOGD_SETTINGS, " duplicate DNS domain '%s'", *item);
}
}
@@ -689,34 +701,34 @@ make_ip4_setting (NMConnection *connection,
ip_block *current_iblock = iblock;
const char *metric_str;
char *stripped;
- long int metric;
- NMIP4Route *route = nm_ip4_route_new ();
-
- nm_ip4_route_set_dest (route, iblock->ip);
- nm_ip4_route_set_next_hop (route, iblock->gateway);
- nm_ip4_route_set_prefix (route,
- nm_utils_ip4_netmask_to_prefix
- (iblock->netmask));
+ gint64 metric;
+ NMIPRoute *route;
+ GError *local = NULL;
+
if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) {
- metric = strtol (metric_str, NULL, 10);
- nm_ip4_route_set_metric (route, (guint32) metric);
+ metric = _nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1);
} else {
metric_str = ifnet_get_global_data ("metric");
if (metric_str) {
stripped = g_strdup (metric_str);
strip_string (stripped, '"');
- metric = strtol (metric_str, NULL, 10);
- nm_ip4_route_set_metric (route,
- (guint32) metric);
+ metric = _nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1);
g_free (stripped);
- }
+ } else
+ metric = -1;
}
- if (!nm_setting_ip4_config_add_route (ip4_setting, route))
- nm_log_warn (LOGD_SETTINGS, "duplicate IP4 route");
- nm_log_info (LOGD_SETTINGS, "new IP4 route:%d\n", iblock->ip);
-
- nm_ip4_route_unref (route);
+ route = nm_ip_route_new (AF_INET, iblock->ip, iblock->prefix, iblock->next_hop, metric, &local);
+ if (route) {
+ if (nm_setting_ip_config_add_route (ip4_setting, route))
+ nm_log_info (LOGD_SETTINGS, "new IP4 route:%s\n", iblock->ip);
+ else
+ nm_log_warn (LOGD_SETTINGS, "duplicate IP4 route");
+ nm_ip_route_unref (route);
+ } else {
+ nm_log_warn (LOGD_SETTINGS, " ignoring invalid route entry: %s", local->message);
+ g_clear_error (&local);
+ }
current_iblock = iblock;
iblock = iblock->next;
@@ -732,17 +744,17 @@ make_ip6_setting (NMConnection *connection,
const char *conn_name,
GError **error)
{
- NMSettingIP6Config *s_ip6 = NULL;
+ NMSettingIPConfig *s_ip6 = NULL;
gboolean is_static_block = is_static_ip6 (conn_name);
// used to disable IPv6
gboolean ipv6_enabled = FALSE;
gchar *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
const char *value;
- ip6_block *iblock;
+ ip_block *iblock;
gboolean never_default = !has_default_ip6_route (conn_name);
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
value = ifnet_get_data (conn_name, "enable_ipv6");
if (value && is_true (value))
@@ -752,7 +764,7 @@ make_ip6_setting (NMConnection *connection,
// Currently only Manual and DHCP are supported
if (!ipv6_enabled) {
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD,
+ NM_SETTING_IP_CONFIG_METHOD,
NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL);
goto done;
} else if (!is_static_block) {
@@ -769,14 +781,14 @@ make_ip6_setting (NMConnection *connection,
nm_log_info (LOGD_SETTINGS, "IPv6 for %s enabled, using %s", conn_name, method);
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, method,
- NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, FALSE,
- NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, FALSE,
- NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, never_default, NULL);
+ NM_SETTING_IP_CONFIG_METHOD, method,
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, FALSE,
+ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, FALSE,
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, never_default, NULL);
/* Make manual settings */
if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
- ip6_block *current_iblock;
+ ip_block *current_iblock;
iblock = convert_ip6_config_block (conn_name);
if (!iblock) {
@@ -787,73 +799,80 @@ make_ip6_setting (NMConnection *connection,
}
/* add all IPv6 addresses */
while (iblock) {
- NMIP6Address *ip6_addr = nm_ip6_address_new ();
-
- nm_ip6_address_set_address (ip6_addr, iblock->ip);
- nm_ip6_address_set_prefix (ip6_addr, iblock->prefix);
- if (nm_setting_ip6_config_add_address (s_ip6, ip6_addr)) {
- nm_log_info (LOGD_SETTINGS, "ipv6 addresses count: %d",
- nm_setting_ip6_config_get_num_addresses (s_ip6));
+ NMIPAddress *ip6_addr;
+ GError *local = NULL;
+
+ ip6_addr = nm_ip_address_new (AF_INET6, iblock->ip, iblock->prefix, &local);
+ if (ip6_addr) {
+ if (nm_setting_ip_config_add_address (s_ip6, ip6_addr)) {
+ nm_log_info (LOGD_SETTINGS, "ipv6 addresses count: %d",
+ nm_setting_ip_config_get_num_addresses (s_ip6));
+ } else {
+ nm_log_warn (LOGD_SETTINGS, "ignoring duplicate IP6 address");
+ }
+ nm_ip_address_unref (ip6_addr);
} else {
- nm_log_warn (LOGD_SETTINGS, "ignoring duplicate IP4 address");
+ nm_log_warn (LOGD_SETTINGS, " ignoring invalid address entry: %s", local->message);
+ g_clear_error (&local);
}
- nm_ip6_address_unref (ip6_addr);
+
current_iblock = iblock;
iblock = iblock->next;
- destroy_ip6_block (current_iblock);
+ destroy_ip_block (current_iblock);
}
} else if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) {
/* - autoconf or DHCPv6 stuff goes here */
}
- // DNS Servers, set NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS TRUE here
+ // DNS Servers, set NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS TRUE here
set_ip6_dns_servers (s_ip6, conn_name);
- /* DNS searches ('DOMAIN' key) are read by make_ip4_setting() and included in NMSettingIP4Config */
+ /* DNS searches ('DOMAIN' key) are read by make_ip4_setting() and included in NMSettingIPConfig */
// Add routes
iblock = convert_ip6_routes_block (conn_name);
if (iblock)
- g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES,
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES,
TRUE, NULL);
/* Add all IPv6 routes */
while (iblock) {
- ip6_block *current_iblock = iblock;
+ ip_block *current_iblock = iblock;
const char *metric_str;
char *stripped;
- long int metric = 1;
- NMIP6Route *route = nm_ip6_route_new ();
+ gint64 metric;
+ NMIPRoute *route;
+ GError *local = NULL;
- nm_ip6_route_set_dest (route, iblock->ip);
- nm_ip6_route_set_next_hop (route, iblock->next_hop);
- nm_ip6_route_set_prefix (route, iblock->prefix);
/* metric is not per routes configuration right now
* global metric is also supported (metric="x") */
- if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) {
- metric = strtol (metric_str, NULL, 10);
- nm_ip6_route_set_metric (route, (guint32) metric);
- } else {
+ if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL)
+ metric = _nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1);
+ else {
metric_str = ifnet_get_global_data ("metric");
if (metric_str) {
stripped = g_strdup (metric_str);
strip_string (stripped, '"');
- metric = strtol (metric_str, NULL, 10);
- nm_ip6_route_set_metric (route,
- (guint32) metric);
+ metric = _nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1);
g_free (stripped);
} else
- nm_ip6_route_set_metric (route, (guint32) 1);
+ metric = 1;
}
- if (nm_setting_ip6_config_add_route (s_ip6, route))
- nm_log_info (LOGD_SETTINGS, " new IP6 route");
- else
- nm_log_warn (LOGD_SETTINGS, " duplicate IP6 route");
- nm_ip6_route_unref (route);
+ route = nm_ip_route_new (AF_INET6, iblock->ip, iblock->prefix, iblock->next_hop, metric, &local);
+ if (route) {
+ if (nm_setting_ip_config_add_route (s_ip6, route))
+ nm_log_info (LOGD_SETTINGS, " new IP6 route");
+ else
+ nm_log_warn (LOGD_SETTINGS, " duplicate IP6 route");
+ nm_ip_route_unref (route);
+ } else {
+ nm_log_warn (LOGD_SETTINGS, " ignoring invalid route entry: %s", local->message);
+ g_clear_error (&local);
+ }
current_iblock = iblock;
iblock = iblock->next;
- destroy_ip6_block (current_iblock);
+ destroy_ip_block (current_iblock);
}
done:
@@ -871,7 +890,6 @@ make_wireless_connection_setting (const char *conn_name,
NMSetting8021x **s_8021x,
GError **error)
{
- GBytes *bytes;
const char *mac = NULL;
NMSettingWireless *wireless_setting = NULL;
gboolean adhoc = FALSE;
@@ -902,9 +920,8 @@ make_wireless_connection_setting (const char *conn_name,
/* handle ssid (hex and ascii) */
if (conn_name) {
+ GBytes *bytes;
gsize ssid_len = 0, value_len = strlen (conn_name);
- const char *p;
- char *tmp, *converted = NULL;
ssid_len = value_len;
if ((value_len > 2) && (g_str_has_prefix (conn_name, "0x"))) {
@@ -915,32 +932,27 @@ make_wireless_connection_setting (const char *conn_name,
conn_name);
goto error;
}
- // ignore "0x"
- p = conn_name + 2;
- if (!is_hex (p)) {
+
+ bytes = nm_utils_hexstr2bin (conn_name);
+ if (!bytes) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)",
- conn_name, *p);
+ "Invalid SSID '%s' (looks like hex SSID but isn't)",
+ conn_name);
goto error;
-
}
- tmp = nm_utils_hexstr2bin (p, value_len - 2);
- ssid_len = (value_len - 2) / 2;
- converted = g_malloc0 (ssid_len + 1);
- memcpy (converted, tmp, ssid_len);
- g_free (tmp);
- }
+ } else
+ bytes = g_bytes_new (conn_name, value_len);
+ ssid_len = g_bytes_get_size (bytes);
if (ssid_len > 32 || ssid_len == 0) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid SSID '%s' (size %zu not between 1 and 32 inclusive)",
conn_name, ssid_len);
goto error;
}
- bytes = g_bytes_new (converted ? converted : conn_name, ssid_len);
+
g_object_set (wireless_setting, NM_SETTING_WIRELESS_SSID, bytes, NULL);
g_bytes_unref (bytes);
- g_free (converted);
} else {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Missing SSID");
@@ -1084,7 +1096,7 @@ add_one_wep_key (const char *ssid,
}
- converted = nm_utils_bin2hexstr (tmp, strlen (tmp), strlen (tmp) * 2);
+ converted = nm_utils_bin2hexstr (tmp, strlen (tmp), -1);
g_free (tmp);
} else {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
@@ -1617,7 +1629,7 @@ ifnet_update_connection_from_config_block (const char *conn_name,
id = connection_id_from_ifnet_name (conn_name);
uuid = g_strdup (ifnet_get_data (conn_name, "uuid"));
if (!uuid)
- uuid = nm_utils_uuid_generate_from_string (id);
+ uuid = nm_utils_uuid_generate_from_string (id, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
g_object_set (setting,
NM_SETTING_CONNECTION_TYPE, type,
@@ -2359,15 +2371,13 @@ write_wired_setting (NMConnection *connection,
static gboolean
write_ip4_setting (NMConnection *connection, const char *conn_name, GError **error)
{
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
const char *value;
- char *tmp;
guint32 i, num;
GString *searches;
GString *ips;
GString *routes;
GString *dns;
- gboolean has_def_route = FALSE;
gboolean success = FALSE;
s_ip4 = nm_connection_get_setting_ip4_config (connection);
@@ -2379,42 +2389,27 @@ write_ip4_setting (NMConnection *connection, const char *conn_name, GError **err
}
routes = g_string_new (NULL);
- value = nm_setting_ip4_config_get_method (s_ip4);
+ value = nm_setting_ip_config_get_method (s_ip4);
g_assert (value);
if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
- num = nm_setting_ip4_config_get_num_addresses (s_ip4);
+ num = nm_setting_ip_config_get_num_addresses (s_ip4);
ips = g_string_new (NULL);
/* IPv4 addresses */
for (i = 0; i < num; i++) {
- char buf[INET_ADDRSTRLEN + 1];
- NMIP4Address *addr;
- guint32 ip;
-
- addr = nm_setting_ip4_config_get_address (s_ip4, i);
-
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_address_get_address (addr);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0],
- sizeof (buf));
- g_string_append_printf (ips, "\"%s", &buf[0]);
-
- tmp =
- g_strdup_printf ("%u",
- nm_ip4_address_get_prefix (addr));
- g_string_append_printf (ips, "/%s\" ", tmp);
- g_free (tmp);
+ NMIPAddress *addr;
+
+ addr = nm_setting_ip_config_get_address (s_ip4, i);
+
+ g_string_append_printf (ips, "\"%s/%u",
+ nm_ip_address_get_address (addr),
+ nm_ip_address_get_prefix (addr));
/* only the first gateway will be written */
- if (!has_def_route && nm_ip4_address_get_gateway (addr)) {
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_address_get_gateway (addr);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0],
- sizeof (buf));
+ if (i == 0 && nm_setting_ip_config_get_gateway (s_ip4)) {
g_string_append_printf (routes,
- "\"default via %s\" ",
- &buf[0]);
- has_def_route = TRUE;
+ "\"default via %s\" ",
+ nm_setting_ip_config_get_gateway (s_ip4));
}
}
ifnet_set_data (conn_name, "config", ips->str);
@@ -2427,13 +2422,13 @@ write_ip4_setting (NMConnection *connection, const char *conn_name, GError **err
ifnet_set_data (conn_name, "config", "dhcp");
/* DNS Servers */
- num = nm_setting_ip4_config_get_num_dns (s_ip4);
+ num = nm_setting_ip_config_get_num_dns (s_ip4);
if (num > 0) {
dns = g_string_new (NULL);
for (i = 0; i < num; i++) {
const char *ip;
- ip = nm_setting_ip4_config_get_dns (s_ip4, i);
+ ip = nm_setting_ip_config_get_dns (s_ip4, i);
g_string_append_printf (dns, " %s", ip);
}
ifnet_set_data (conn_name, "dns_servers", dns->str);
@@ -2442,14 +2437,14 @@ write_ip4_setting (NMConnection *connection, const char *conn_name, GError **err
ifnet_set_data (conn_name, "dns_servers", NULL);
/* DNS Searches */
- num = nm_setting_ip4_config_get_num_dns_searches (s_ip4);
+ num = nm_setting_ip_config_get_num_dns_searches (s_ip4);
if (num > 0) {
searches = g_string_new (NULL);
for (i = 0; i < num; i++) {
if (i > 0)
g_string_append_c (searches, ' ');
g_string_append (searches,
- nm_setting_ip4_config_get_dns_search
+ nm_setting_ip_config_get_dns_search
(s_ip4, i));
}
ifnet_set_data (conn_name, "dns_search", searches->str);
@@ -2458,12 +2453,12 @@ write_ip4_setting (NMConnection *connection, const char *conn_name, GError **err
ifnet_set_data (conn_name, "dns_search", NULL);
/* FIXME Will be implemented when configuration supports it
if (!strcmp(value, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
- value = nm_setting_ip4_config_get_dhcp_hostname(s_ip4);
+ value = nm_setting_ip_config_get_dhcp_hostname(s_ip4);
if (value)
ifnet_set_data(conn_name, "DHCP_HOSTNAME", value,
FALSE);
- value = nm_setting_ip4_config_get_dhcp_client_id(s_ip4);
+ value = nm_setting_ip_config_get_dhcp_client_id(s_ip4);
if (value)
ifnet_set_data(conn_name, "DHCP_CLIENT_ID", value,
FALSE);
@@ -2471,32 +2466,22 @@ write_ip4_setting (NMConnection *connection, const char *conn_name, GError **err
*/
/* Static routes */
- num = nm_setting_ip4_config_get_num_routes (s_ip4);
+ num = nm_setting_ip_config_get_num_routes (s_ip4);
if (num > 0) {
for (i = 0; i < num; i++) {
- char buf[INET_ADDRSTRLEN + 1];
- NMIP4Route *route;
- guint32 ip;
-
- route = nm_setting_ip4_config_get_route (s_ip4, i);
-
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_route_get_dest (route);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0],
- sizeof (buf));
- g_string_append_printf (routes, "\"%s", buf);
-
- tmp =
- g_strdup_printf ("%u",
- nm_ip4_route_get_prefix (route));
- g_string_append_printf (routes, "/%s via ", tmp);
- g_free (tmp);
+ NMIPRoute *route;
+ const char *next_hop;
- memset (buf, 0, sizeof (buf));
- ip = nm_ip4_route_get_next_hop (route);
- inet_ntop (AF_INET, (const void *) &ip, &buf[0],
- sizeof (buf));
- g_string_append_printf (routes, "%s\" ", buf);
+ route = nm_setting_ip_config_get_route (s_ip4, i);
+
+ next_hop = nm_ip_route_get_next_hop (route);
+ if (!next_hop)
+ next_hop = "0.0.0.0";
+
+ g_string_append_printf (routes, "\"%s/%u via %s\" ",
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route),
+ next_hop);
}
}
if (routes->len > 0)
@@ -2511,19 +2496,16 @@ write_ip4_setting (NMConnection *connection, const char *conn_name, GError **err
}
static gboolean
-write_route6_file (NMSettingIP6Config *s_ip6, const char *conn_name, GError **error)
+write_route6_file (NMSettingIPConfig *s_ip6, const char *conn_name, GError **error)
{
- char dest[INET6_ADDRSTRLEN + 1];
- char next_hop[INET6_ADDRSTRLEN + 1];
- NMIP6Route *route;
- const struct in6_addr *ip;
- guint32 prefix;
+ NMIPRoute *route;
+ const char *next_hop;
guint32 i, num;
GString *routes_string;
const char *old_routes;
g_return_val_if_fail (s_ip6 != NULL, FALSE);
- num = nm_setting_ip6_config_get_num_routes (s_ip6);
+ num = nm_setting_ip_config_get_num_routes (s_ip6);
if (num == 0) {
return TRUE;
}
@@ -2533,22 +2515,16 @@ write_route6_file (NMSettingIP6Config *s_ip6, const char *conn_name, GError **er
if (old_routes)
g_string_append (routes_string, "\" ");
for (i = 0; i < num; i++) {
- route = nm_setting_ip6_config_get_route (s_ip6, i);
-
- memset (dest, 0, sizeof (dest));
- ip = nm_ip6_route_get_dest (route);
- inet_ntop (AF_INET6, (const void *) ip, &dest[0],
- sizeof (dest));
+ route = nm_setting_ip_config_get_route (s_ip6, i);
- prefix = nm_ip6_route_get_prefix (route);
-
- memset (next_hop, 0, sizeof (next_hop));
- ip = nm_ip6_route_get_next_hop (route);
- inet_ntop (AF_INET6, (const void *) ip, &next_hop[0],
- sizeof (next_hop));
+ next_hop = nm_ip_route_get_next_hop (route);
+ if (!next_hop)
+ next_hop = "::";
g_string_append_printf (routes_string, "\"%s/%u via %s\" ",
- dest, prefix, next_hop);
+ nm_ip_route_get_dest (route),
+ nm_ip_route_get_prefix (route),
+ next_hop);
}
if (num > 0)
ifnet_set_data (conn_name, "routes", routes_string->str);
@@ -2560,14 +2536,11 @@ write_route6_file (NMSettingIP6Config *s_ip6, const char *conn_name, GError **er
static gboolean
write_ip6_setting (NMConnection *connection, const char *conn_name, GError **error)
{
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
const char *value;
- char *prefix;
guint32 i, num;
GString *searches;
- char buf[INET6_ADDRSTRLEN + 1];
- NMIP6Address *addr;
- const struct in6_addr *ip;
+ NMIPAddress *addr;
s_ip6 = nm_connection_get_setting_ip6_config (connection);
if (!s_ip6) {
@@ -2577,7 +2550,7 @@ write_ip6_setting (NMConnection *connection, const char *conn_name, GError **err
return FALSE;
}
- value = nm_setting_ip6_config_get_method (s_ip6);
+ value = nm_setting_ip_config_get_method (s_ip6);
g_assert (value);
if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) {
ifnet_set_data (conn_name, "enable_ipv6", "false");
@@ -2611,22 +2584,16 @@ write_ip6_setting (NMConnection *connection, const char *conn_name, GError **err
if (!config)
config = "";
- num = nm_setting_ip6_config_get_num_addresses (s_ip6);
+ num = nm_setting_ip_config_get_num_addresses (s_ip6);
/* IPv6 addresses */
ip_str = g_string_new (NULL);
for (i = 0; i < num; i++) {
- addr = nm_setting_ip6_config_get_address (s_ip6, i);
- ip = nm_ip6_address_get_address (addr);
- prefix =
- g_strdup_printf ("%u",
- nm_ip6_address_get_prefix (addr));
- memset (buf, 0, sizeof (buf));
- inet_ntop (AF_INET6, (const void *) ip, buf,
- sizeof (buf));
- g_string_append_printf (ip_str, "\"%s/", buf);
- g_string_append_printf (ip_str, "%s\" ", prefix);
- g_free (prefix);
+ addr = nm_setting_ip_config_get_address (s_ip6, i);
+
+ g_string_append_printf (ip_str, "\"%s/%u\"",
+ nm_ip_address_get_address (addr),
+ nm_ip_address_get_prefix (addr));
}
tmp = g_strdup_printf ("%s\" %s", config, ip_str->str);
ifnet_set_data (conn_name, "config", tmp);
@@ -2635,7 +2602,7 @@ write_ip6_setting (NMConnection *connection, const char *conn_name, GError **err
}
/* DNS Servers */
- num = nm_setting_ip6_config_get_num_dns (s_ip6);
+ num = nm_setting_ip_config_get_num_dns (s_ip6);
if (num > 0) {
const char *dns_servers = ifnet_get_data (conn_name, "dns_servers");
gchar *tmp;
@@ -2645,7 +2612,7 @@ write_ip6_setting (NMConnection *connection, const char *conn_name, GError **err
if (!dns_servers)
dns_servers = "";
for (i = 0; i < num; i++) {
- dns = nm_setting_ip6_config_get_dns (s_ip6, i);
+ dns = nm_setting_ip_config_get_dns (s_ip6, i);
if (!strstr (dns_servers, dns))
g_string_append_printf (dns_string, "%s ", dns);
@@ -2657,7 +2624,7 @@ write_ip6_setting (NMConnection *connection, const char *conn_name, GError **err
} else
/* DNS Searches */
- num = nm_setting_ip6_config_get_num_dns_searches (s_ip6);
+ num = nm_setting_ip_config_get_num_dns_searches (s_ip6);
if (num > 0) {
const char *ip4_domains;
@@ -2669,7 +2636,7 @@ write_ip6_setting (NMConnection *connection, const char *conn_name, GError **err
const gchar *search = NULL;
search =
- nm_setting_ip6_config_get_dns_search (s_ip6, i);
+ nm_setting_ip_config_get_dns_search (s_ip6, i);
if (search && !strstr (searches->str, search)) {
if (searches->len > 0)
g_string_append_c (searches, ' ');
@@ -2715,7 +2682,7 @@ ifnet_update_parsers_by_connection (NMConnection *connection,
GError **error)
{
NMSettingConnection *s_con;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
gboolean success = FALSE;
const char *type;
gboolean no_8021x = FALSE;
diff --git a/src/settings/plugins/ifnet/net_parser.c b/src/settings/plugins/ifnet/net_parser.c
index 95add14fc2..755767e296 100644
--- a/src/settings/plugins/ifnet/net_parser.c
+++ b/src/settings/plugins/ifnet/net_parser.c
@@ -19,6 +19,8 @@
* Copyright (C) 1999-2010 Gentoo Foundation, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <stdio.h>
#include <sys/ioctl.h>
@@ -394,7 +396,11 @@ ifnet_init (gchar * config_file)
const char *
ifnet_get_data (const char *conn_name, const char *key)
{
- GHashTable *conn = g_hash_table_lookup (conn_table, conn_name);
+ GHashTable *conn;
+
+ g_return_val_if_fail (conn_name && key, NULL);
+
+ conn = g_hash_table_lookup (conn_table, conn_name);
if (conn)
return g_hash_table_lookup (conn, key);
diff --git a/src/settings/plugins/ifnet/net_utils.c b/src/settings/plugins/ifnet/net_utils.c
index be19134e96..adb23c43f4 100644
--- a/src/settings/plugins/ifnet/net_utils.c
+++ b/src/settings/plugins/ifnet/net_utils.c
@@ -19,6 +19,8 @@
* Copyright (C) 1999-2010 Gentoo Foundation, Inc.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -366,23 +368,21 @@ create_ip4_block (gchar * ip)
ip_mask = g_strsplit (ip, "/", 0);
length = g_strv_length (ip_mask);
- if (!inet_pton (AF_INET, ip_mask[0], &tmp_ip4_addr))
+ if (!nm_utils_ipaddr_valid (AF_INET, ip_mask[0]))
goto error;
- iblock->ip = tmp_ip4_addr;
+ iblock->ip = g_strdup (ip_mask[0]);
prefix = ip_mask[1];
i = 0;
while (i < length && g_ascii_isdigit (prefix[i]))
i++;
prefix[i] = '\0';
- iblock->netmask = nm_utils_ip4_prefix_to_netmask ((guint32)
- atoi (ip_mask
- [1]));
+ iblock->prefix = (guint32) atoi (ip_mask[1]);
} else if (strstr (ip, "netmask")) {
ip_mask = g_strsplit (ip, " ", 0);
length = g_strv_length (ip_mask);
- if (!inet_pton (AF_INET, ip_mask[0], &tmp_ip4_addr))
+ if (!nm_utils_ipaddr_valid (AF_INET, ip_mask[0]))
goto error;
- iblock->ip = tmp_ip4_addr;
+ iblock->ip = g_strdup (ip_mask[0]);
i = 0;
while (i < length && !strstr (ip_mask[++i], "netmask")) ;
while (i < length && ip_mask[++i][0] == '\0') ;
@@ -390,39 +390,42 @@ create_ip4_block (gchar * ip)
goto error;
if (!inet_pton (AF_INET, ip_mask[i], &tmp_ip4_addr))
goto error;
- iblock->netmask = tmp_ip4_addr;
+ iblock->prefix = nm_utils_ip4_netmask_to_prefix (tmp_ip4_addr);
} else {
g_slice_free (ip_block, iblock);
if (!is_ip6_address (ip) && !strstr (ip, "dhcp"))
nm_log_warn (LOGD_SETTINGS, "Can't handle ipv4 address: %s, missing netmask or prefix", ip);
return NULL;
}
+ if (iblock->prefix == 0 || iblock->prefix > 32) {
+ nm_log_warn (LOGD_SETTINGS, "Can't handle ipv4 address: %s, invalid prefix", ip);
+ goto error;
+ }
g_strfreev (ip_mask);
return iblock;
error:
if (!is_ip6_address (ip))
nm_log_warn (LOGD_SETTINGS, "Can't handle IPv4 address: %s", ip);
g_strfreev (ip_mask);
+ g_free (iblock->ip);
g_slice_free (ip_block, iblock);
return NULL;
}
-static ip6_block *
-create_ip6_block (gchar * ip)
+static ip_block *
+create_ip_block (gchar * ip)
{
- ip6_block *iblock = g_slice_new0 (ip6_block);
+ ip_block *iblock = g_slice_new0 (ip_block);
gchar *dup_ip = g_strdup (ip);
- struct in6_addr *tmp_ip6_addr = g_slice_new0 (struct in6_addr);
gchar *prefix = NULL;
if ((prefix = strstr (dup_ip, "/")) != NULL) {
*prefix = '\0';
prefix++;
}
- if (!inet_pton (AF_INET6, dup_ip, tmp_ip6_addr)) {
+ if (!nm_utils_ipaddr_valid (AF_INET6, dup_ip))
goto error;
- }
- iblock->ip = tmp_ip6_addr;
+ iblock->ip = dup_ip;
if (prefix) {
errno = 0;
iblock->prefix = strtol (prefix, NULL, 10);
@@ -431,30 +434,26 @@ create_ip6_block (gchar * ip)
}
} else
iblock->prefix = 64;
- g_free (dup_ip);
return iblock;
error:
if (!is_ip4_address (ip))
nm_log_warn (LOGD_SETTINGS, "Can't handle IPv6 address: %s", ip);
- g_slice_free (ip6_block, iblock);
- g_slice_free (struct in6_addr, tmp_ip6_addr);
-
+ g_slice_free (ip_block, iblock);
g_free (dup_ip);
return NULL;
}
-static guint32
+static char *
get_ip4_gateway (gchar * gateway)
{
gchar *tmp, *split;
- guint32 tmp_ip4_addr;
if (!gateway)
- return 0;
+ return NULL;
tmp = find_gateway_str (gateway);
if (!tmp) {
nm_log_warn (LOGD_SETTINGS, "Couldn't obtain gateway in \"%s\"", gateway);
- return 0;
+ return NULL;
}
tmp = g_strdup (tmp);
strip_string (tmp, ' ');
@@ -464,43 +463,39 @@ get_ip4_gateway (gchar * gateway)
if ((split = strstr (tmp, "\"")) != NULL)
*split = '\0';
- if (!inet_pton (AF_INET, tmp, &tmp_ip4_addr))
+ if (!nm_utils_ipaddr_valid (AF_INET, tmp))
goto error;
- g_free (tmp);
- return tmp_ip4_addr;
+ return tmp;
error:
if (!is_ip6_address (tmp))
nm_log_warn (LOGD_SETTINGS, "Can't handle IPv4 gateway: %s", tmp);
g_free (tmp);
- return 0;
+ return NULL;
}
-static struct in6_addr *
+static char *
get_ip6_next_hop (gchar * next_hop)
{
gchar *tmp;
- struct in6_addr *tmp_ip6_addr = g_slice_new0 (struct in6_addr);
if (!next_hop)
- return 0;
+ return NULL;
tmp = find_gateway_str (next_hop);
if (!tmp) {
nm_log_warn (LOGD_SETTINGS, "Couldn't obtain next_hop in \"%s\"", next_hop);
- return 0;
+ return NULL;
}
tmp = g_strdup (tmp);
strip_string (tmp, ' ');
strip_string (tmp, '"');
g_strstrip (tmp);
- if (!inet_pton (AF_INET6, tmp, tmp_ip6_addr))
+ if (!nm_utils_ipaddr_valid (AF_INET6, tmp))
goto error;
- g_free (tmp);
- return tmp_ip6_addr;
+ return tmp;
error:
if (!is_ip4_address (tmp))
nm_log_warn (LOGD_SETTINGS, "Can't handle IPv6 next_hop: %s", tmp);
g_free (tmp);
- g_slice_free (struct in6_addr, tmp_ip6_addr);
return NULL;
}
@@ -512,7 +507,7 @@ convert_ip4_config_block (const char *conn_name)
guint length;
guint i;
gchar *ip;
- guint32 def_gateway = 0;
+ char *def_gateway = NULL;
const char *routes;
ip_block *start = NULL, *current = NULL, *iblock = NULL;
@@ -531,8 +526,8 @@ convert_ip4_config_block (const char *conn_name)
iblock = create_ip4_block (ip);
if (iblock == NULL)
continue;
- if (!iblock->gateway && def_gateway != 0)
- iblock->gateway = def_gateway;
+ if (!iblock->next_hop && def_gateway != NULL)
+ iblock->next_hop = g_strdup (def_gateway);
if (start == NULL)
start = current = iblock;
else {
@@ -541,17 +536,18 @@ convert_ip4_config_block (const char *conn_name)
}
}
g_strfreev (ipset);
+ g_free (def_gateway);
return start;
}
-ip6_block *
+ip_block *
convert_ip6_config_block (const char *conn_name)
{
gchar **ipset;
guint length;
guint i;
gchar *ip;
- ip6_block *start = NULL, *current = NULL, *iblock = NULL;
+ ip_block *start = NULL, *current = NULL, *iblock = NULL;
g_return_val_if_fail (conn_name != NULL, NULL);
ipset = split_addresses (ifnet_get_data (conn_name, "config"));
@@ -559,7 +555,7 @@ convert_ip6_config_block (const char *conn_name)
for (i = 0; i < length; i++) {
ip = ipset[i];
ip = strip_string (ip, '"');
- iblock = create_ip6_block (ip);
+ iblock = create_ip_block (ip);
if (iblock == NULL)
continue;
if (start == NULL)
@@ -595,7 +591,7 @@ convert_ip4_routes_block (const char *conn_name)
iblock = create_ip4_block (ip);
if (iblock == NULL)
continue;
- iblock->gateway = get_ip4_gateway (ip);
+ iblock->next_hop = get_ip4_gateway (ip);
if (start == NULL)
start = current = iblock;
else {
@@ -607,15 +603,14 @@ convert_ip4_routes_block (const char *conn_name)
return start;
}
-ip6_block *
+ip_block *
convert_ip6_routes_block (const char *conn_name)
{
gchar **ipset;
guint length;
guint i;
gchar *ip, *tmp_addr;
- ip6_block *start = NULL, *current = NULL, *iblock = NULL;
- struct in6_addr *tmp_ip6_addr;
+ ip_block *start = NULL, *current = NULL, *iblock = NULL;
g_return_val_if_fail (conn_name != NULL, NULL);
ipset = split_routes (ifnet_get_data (conn_name, "routes"));
@@ -629,25 +624,17 @@ convert_ip6_routes_block (const char *conn_name)
if (!is_ip6_address (tmp_addr))
continue;
else {
- tmp_ip6_addr = g_slice_new0 (struct in6_addr);
-
- if (inet_pton (AF_INET6, "::", tmp_ip6_addr)) {
- iblock = g_slice_new0 (ip6_block);
- iblock->ip = tmp_ip6_addr;
- iblock->prefix = 128;
- } else {
- g_slice_free (struct in6_addr,
- tmp_ip6_addr);
- continue;
- }
+ iblock = g_slice_new0 (ip_block);
+ iblock->ip = g_strdup ("::");
+ iblock->prefix = 128;
}
} else
- iblock = create_ip6_block (ip);
+ iblock = create_ip_block (ip);
if (iblock == NULL)
continue;
iblock->next_hop = get_ip6_next_hop (ip);
if (iblock->next_hop == NULL) {
- destroy_ip6_block (iblock);
+ destroy_ip_block (iblock);
continue;
}
if (start == NULL)
@@ -664,20 +651,13 @@ convert_ip6_routes_block (const char *conn_name)
void
destroy_ip_block (ip_block * iblock)
{
+ g_free (iblock->ip);
+ g_free (iblock->next_hop);
g_slice_free (ip_block, iblock);
}
void
-destroy_ip6_block (ip6_block * iblock)
-{
- g_slice_free (struct in6_addr, iblock->ip);
- g_slice_free (struct in6_addr, iblock->next_hop);
-
- g_slice_free (ip6_block, iblock);
-}
-
-void
-set_ip4_dns_servers (NMSettingIP4Config *s_ip4, const char *conn_name)
+set_ip4_dns_servers (NMSettingIPConfig *s_ip4, const char *conn_name)
{
const char *dns_servers;
gchar **server_list, *stripped;
@@ -694,7 +674,7 @@ set_ip4_dns_servers (NMSettingIP4Config *s_ip4, const char *conn_name)
length = g_strv_length (server_list);
if (length)
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS,
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS,
TRUE, NULL);
for (i = 0; i < length; i++) {
g_strstrip (server_list[i]);
@@ -705,14 +685,14 @@ set_ip4_dns_servers (NMSettingIP4Config *s_ip4, const char *conn_name)
nm_log_warn (LOGD_SETTINGS, "ignored dns: %s\n", server_list[i]);
continue;
}
- if (!nm_setting_ip4_config_add_dns (s_ip4, server_list[i]))
+ if (!nm_setting_ip_config_add_dns (s_ip4, server_list[i]))
nm_log_warn (LOGD_SETTINGS, "warning: duplicate DNS server %s", server_list[i]);
}
g_strfreev (server_list);
}
void
-set_ip6_dns_servers (NMSettingIP6Config *s_ip6, const char *conn_name)
+set_ip6_dns_servers (NMSettingIPConfig *s_ip6, const char *conn_name)
{
const char *dns_servers;
gchar **server_list, *stripped;
@@ -730,7 +710,7 @@ set_ip6_dns_servers (NMSettingIP6Config *s_ip6, const char *conn_name)
length = g_strv_length (server_list);
if (length)
- g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS,
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS,
TRUE, NULL);
for (i = 0; i < length; i++) {
g_strstrip (server_list[i]);
@@ -741,7 +721,7 @@ set_ip6_dns_servers (NMSettingIP6Config *s_ip6, const char *conn_name)
nm_log_warn (LOGD_SETTINGS, "ignored dns: %s\n", server_list[i]);
continue;
}
- if (!nm_setting_ip6_config_add_dns (s_ip6, server_list[i]))
+ if (!nm_setting_ip_config_add_dns (s_ip6, server_list[i]))
nm_log_warn (LOGD_SETTINGS, "warning: duplicate DNS server %s", server_list[i]);
}
g_strfreev (server_list);
diff --git a/src/settings/plugins/ifnet/net_utils.h b/src/settings/plugins/ifnet/net_utils.h
index cee71d57e5..d58e7ec616 100644
--- a/src/settings/plugins/ifnet/net_utils.h
+++ b/src/settings/plugins/ifnet/net_utils.h
@@ -31,19 +31,12 @@
#define has_default_ip6_route(conn_name) has_default_route((conn_name), &is_ip6_address)
typedef struct _ip_block {
- guint32 ip;
- guint32 netmask;
- guint32 gateway;
+ char *ip;
+ guint32 prefix;
+ char *next_hop;
struct _ip_block *next;
} ip_block;
-typedef struct _ip6_block {
- struct in6_addr *ip;
- long int prefix;
- struct in6_addr *next_hop;
- struct _ip6_block *next;
-} ip6_block;
-
gchar *read_hostname (const char *path);
gboolean write_hostname (const char *path, const char *hostname);
gboolean is_static_ip4 (const char *conn_name);
@@ -55,14 +48,13 @@ gboolean has_default_route (const char *conn_name, gboolean (*check_fn) (const c
gboolean reload_parsers (void);
ip_block *convert_ip4_config_block (const char *conn_name);
-ip6_block *convert_ip6_config_block (const char *conn_name);
+ip_block *convert_ip6_config_block (const char *conn_name);
ip_block *convert_ip4_routes_block (const char *conn_name);
-ip6_block *convert_ip6_routes_block (const char *conn_name);
+ip_block *convert_ip6_routes_block (const char *conn_name);
void destroy_ip_block (ip_block * iblock);
-void destroy_ip6_block (ip6_block * iblock);
-void set_ip4_dns_servers (NMSettingIP4Config * s_ip4, const char *conn_name);
-void set_ip6_dns_servers (NMSettingIP6Config * s_ip6, const char *conn_name);
+void set_ip4_dns_servers (NMSettingIPConfig * s_ip4, const char *conn_name);
+void set_ip6_dns_servers (NMSettingIPConfig * s_ip6, const char *conn_name);
gchar *strip_string (gchar *str, gchar t);
gboolean is_managed (const char *conn_name);
diff --git a/src/settings/plugins/ifnet/nm-ifnet-connection.c b/src/settings/plugins/ifnet/nm-ifnet-connection.c
index 3a7cc810a4..693e653288 100644
--- a/src/settings/plugins/ifnet/nm-ifnet-connection.c
+++ b/src/settings/plugins/ifnet/nm-ifnet-connection.c
@@ -19,6 +19,8 @@
* Copyright (C) 1999-2010 Gentoo Foundation, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib/gstdio.h>
#include <nm-dbus-interface.h>
@@ -80,6 +82,7 @@ nm_ifnet_connection_new (NMConnection *source, const char *conn_name)
nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object),
tmp,
update_unsaved,
+ NULL,
NULL);
g_object_unref (tmp);
diff --git a/src/settings/plugins/ifnet/plugin.c b/src/settings/plugins/ifnet/plugin.c
index d376bbfc21..7f1eb4ff93 100644
--- a/src/settings/plugins/ifnet/plugin.c
+++ b/src/settings/plugins/ifnet/plugin.c
@@ -20,6 +20,8 @@
* Copyright (C) 1999-2010 Gentoo Foundation, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gmodule.h>
@@ -121,9 +123,9 @@ is_managed_plugin (void)
{
char *result = NULL;
- result = nm_config_get_value (nm_config_get (),
- IFNET_KEY_FILE_GROUP, IFNET_KEY_FILE_KEY_MANAGED,
- NULL);
+ result = nm_config_data_get_value (nm_config_get_data_orig (nm_config_get ()),
+ IFNET_KEY_FILE_GROUP, IFNET_KEY_FILE_KEY_MANAGED,
+ NULL);
if (result) {
gboolean ret = is_true (result);
g_free (result);
@@ -262,9 +264,9 @@ reload_connections (NMSystemConfigInterface *config)
nm_log_info (LOGD_SETTINGS, "Loading connections");
- str_auto_refresh = nm_config_get_value (nm_config_get (),
- IFNET_KEY_FILE_GROUP, "auto_refresh",
- NULL);
+ str_auto_refresh = nm_config_data_get_value (nm_config_get_data_orig (nm_config_get ()),
+ IFNET_KEY_FILE_GROUP, "auto_refresh",
+ NULL);
if (str_auto_refresh && is_true (str_auto_refresh))
auto_refresh = TRUE;
g_free (str_auto_refresh);
@@ -311,10 +313,13 @@ reload_connections (NMSystemConfigInterface *config)
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (old),
NM_CONNECTION (new),
FALSE, /* don't set Unsaved */
+ "ifnet-update",
&error)) {
- /* Shouldn't ever get here as 'new' was verified by the reader already */
- g_assert_no_error (error);
+ /* Shouldn't ever get here as 'new' was verified by the reader already
+ * and the UUID did not change. */
+ g_assert_not_reached ();
}
+ g_assert_no_error (error);
nm_log_info (LOGD_SETTINGS, "Connection %s updated",
nm_connection_get_id (NM_CONNECTION (new)));
}
@@ -391,7 +396,7 @@ check_unmanaged (gpointer key, gpointer data, gpointer user_data)
conn_name = nm_ifnet_connection_get_conn_name (connection);
- if (is_managed (conn_name))
+ if (!conn_name || is_managed (conn_name))
return;
nm_log_info (LOGD_SETTINGS, "Checking unmanaged: %s", conn_name);
diff --git a/src/settings/plugins/ifnet/tests/test_all.c b/src/settings/plugins/ifnet/tests/test_all.c
index 163cf6ede3..9c3991287d 100644
--- a/src/settings/plugins/ifnet/tests/test_all.c
+++ b/src/settings/plugins/ifnet/tests/test_all.c
@@ -20,6 +20,8 @@
* Copyright (C) 1999-2010 Gentoo Foundation, Inc.
*/
+#include "config.h"
+
#include <stdio.h>
#include <string.h>
#include <glib.h>
@@ -160,25 +162,14 @@ test_is_ip6_address (void)
}
static void
-check_ip_block (ip_block * iblock, gchar * ip, gchar * netmask, gchar * gateway)
+check_ip_block (ip_block * iblock, gchar * ip, guint32 prefix, gchar * gateway)
{
- char *str;
- guint32 tmp_ip4_addr;
-
- str = malloc (INET_ADDRSTRLEN);
- tmp_ip4_addr = iblock->ip;
- inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN);
- ASSERT (strcmp (ip, str) == 0, "check ip",
- "ip expected:%s, find:%s", ip, str);
- tmp_ip4_addr = iblock->netmask;
- inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN);
- ASSERT (strcmp (netmask, str) == 0, "check netmask",
- "netmask expected:%s, find:%s", netmask, str);
- tmp_ip4_addr = iblock->gateway;
- inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN);
- ASSERT (strcmp (gateway, str) == 0, "check gateway",
- "gateway expected:%s, find:%s", gateway, str);
- free (str);
+ ASSERT (strcmp (ip, iblock->ip) == 0, "check ip",
+ "ip expected:%s, find:%s", ip, iblock->ip);
+ ASSERT (prefix == iblock->prefix, "check netmask",
+ "prefix expected:%d, find:%d", prefix, iblock->prefix);
+ ASSERT (g_strcmp0 (gateway, iblock->next_hop) == 0, "check gateway",
+ "gateway expected:%s, find:%s", gateway, iblock->next_hop);
}
static void
@@ -189,14 +180,12 @@ test_convert_ipv4_config_block (void)
ASSERT (iblock != NULL, "convert ipv4 block",
"block eth0 should not be NULL");
- check_ip_block (iblock, "202.117.16.121", "255.255.255.0",
- "202.117.16.1");
+ check_ip_block (iblock, "202.117.16.121", 24, "202.117.16.1");
iblock = iblock->next;
destroy_ip_block (tmp);
ASSERT (iblock != NULL, "convert ipv4 block",
"block eth0 should have a second IP address");
- check_ip_block (iblock, "192.168.4.121", "255.255.255.0",
- "202.117.16.1");
+ check_ip_block (iblock, "192.168.4.121", 24, "202.117.16.1");
destroy_ip_block (iblock);
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
@@ -206,7 +195,7 @@ test_convert_ipv4_config_block (void)
ASSERT (iblock != NULL
&& iblock->next == NULL,
"convert error IPv4 address", "should only get one address");
- check_ip_block (iblock, "192.168.4.121", "255.255.255.0", "0.0.0.0");
+ check_ip_block (iblock, "192.168.4.121", 24, NULL);
destroy_ip_block (iblock);
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
@@ -214,7 +203,6 @@ test_convert_ipv4_config_block (void)
iblock = convert_ip4_config_block ("eth3");
ASSERT (iblock == NULL, "convert config_block",
"convert error configuration");
- destroy_ip_block (iblock);
}
static void
@@ -224,7 +212,7 @@ test_convert_ipv4_routes_block (void)
ip_block *tmp = iblock;
ASSERT (iblock != NULL, "convert ip4 routes", "should get one route");
- check_ip_block (iblock, "192.168.4.0", "255.255.255.0", "192.168.4.1");
+ check_ip_block (iblock, "192.168.4.0", 24, "192.168.4.1");
iblock = iblock->next;
destroy_ip_block (tmp);
ASSERT (iblock == NULL, "convert ip4 routes",
@@ -234,7 +222,7 @@ test_convert_ipv4_routes_block (void)
tmp = iblock;
ASSERT (iblock != NULL, "convert ip4 routes", "should get one route");
- check_ip_block (iblock, "10.0.0.0", "255.0.0.0", "192.168.0.1");
+ check_ip_block (iblock, "10.0.0.0", 8, "192.168.0.1");
iblock = iblock->next;
destroy_ip_block (tmp);
ASSERT (iblock == NULL, "convert ip4 routes",
diff --git a/src/settings/plugins/ifnet/wpa_parser.c b/src/settings/plugins/ifnet/wpa_parser.c
index 02d7ea8e6d..3f912da876 100644
--- a/src/settings/plugins/ifnet/wpa_parser.c
+++ b/src/settings/plugins/ifnet/wpa_parser.c
@@ -19,6 +19,8 @@
* Copyright (C) 1999-2010 Gentoo Foundation, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
#include <nm-system-config-interface.h>
diff --git a/src/settings/plugins/ifupdown/interface_parser.c b/src/settings/plugins/ifupdown/interface_parser.c
index ee233c93a3..32d27c57b5 100644
--- a/src/settings/plugins/ifupdown/interface_parser.c
+++ b/src/settings/plugins/ifupdown/interface_parser.c
@@ -21,6 +21,7 @@
*/
#include "config.h"
+
#include "interface_parser.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/settings/plugins/ifupdown/nm-ifupdown-connection.c b/src/settings/plugins/ifupdown/nm-ifupdown-connection.c
index 43fa670a61..c6073bd7e5 100644
--- a/src/settings/plugins/ifupdown/nm-ifupdown-connection.c
+++ b/src/settings/plugins/ifupdown/nm-ifupdown-connection.c
@@ -21,6 +21,8 @@
* (C) Copyright 2007,2008 Canonical Ltd.
*/
+#include "config.h"
+
#include <string.h>
#include <glib/gstdio.h>
#include <nm-dbus-interface.h>
diff --git a/src/settings/plugins/ifupdown/parser.c b/src/settings/plugins/ifupdown/parser.c
index 415cfcc755..15081a4c59 100644
--- a/src/settings/plugins/ifupdown/parser.c
+++ b/src/settings/plugins/ifupdown/parser.c
@@ -21,6 +21,8 @@
* (C) Copyright 2008 Canonical Ltd.
*/
+#include "config.h"
+
#include <string.h>
#include <arpa/inet.h>
#include <stdlib.h>
@@ -410,7 +412,7 @@ update_wired_setting_from_if_block(NMConnection *connection,
}
static void
-ifupdown_ip4_add_dns (NMSettingIP4Config *s_ip4, const char *dns)
+ifupdown_ip4_add_dns (NMSettingIPConfig *s_ip4, const char *dns)
{
guint32 addr;
char **list, **iter;
@@ -428,7 +430,7 @@ ifupdown_ip4_add_dns (NMSettingIP4Config *s_ip4, const char *dns)
continue;
}
- if (!nm_setting_ip4_config_add_dns (s_ip4, *iter))
+ if (!nm_setting_ip_config_add_dns (s_ip4, *iter))
nm_log_warn (LOGD_SETTINGS, " duplicate DNS domain '%s'", *iter);
}
g_strfreev (list);
@@ -440,15 +442,15 @@ update_ip4_setting_from_if_block(NMConnection *connection,
GError **error)
{
- NMSettingIP4Config *s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new());
+ NMSettingIPConfig *s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new());
const char *type = ifparser_getkey(block, "inet");
gboolean is_static = type && !strcmp("static", type);
if (!is_static) {
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
} else {
- guint32 tmp_addr, tmp_mask, tmp_gw;
- NMIP4Address *addr;
+ guint32 tmp_mask;
+ NMIPAddress *addr;
const char *address_v;
const char *netmask_v;
const char *gateway_v;
@@ -460,10 +462,9 @@ update_ip4_setting_from_if_block(NMConnection *connection,
/* Address */
address_v = ifparser_getkey (block, "address");
- if (!address_v || !inet_pton (AF_INET, address_v, &tmp_addr)) {
+ if (!address_v) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Missing IPv4 address '%s'",
- address_v ? address_v : "(none)");
+ "Missing IPv4 address");
goto error;
}
@@ -472,11 +473,6 @@ update_ip4_setting_from_if_block(NMConnection *connection,
if (netmask_v) {
if (strlen (netmask_v) < 7) {
netmask_int = atoi (netmask_v);
- if (netmask_int > 32) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Invalid IPv4 netmask '%s'", netmask_v);
- goto error;
- }
} else if (!inet_pton (AF_INET, netmask_v, &tmp_mask)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid IPv4 netmask '%s'", netmask_v);
@@ -486,29 +482,30 @@ update_ip4_setting_from_if_block(NMConnection *connection,
}
}
- /* gateway */
- gateway_v = ifparser_getkey (block, "gateway");
- if (!gateway_v)
- gateway_v = address_v; /* dcbw: whaaa?? */
- if (!inet_pton (AF_INET, gateway_v, &tmp_gw)) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Invalid IPv4 gateway '%s'", gateway_v);
- goto error;
- }
-
/* Add the new address to the setting */
- addr = nm_ip4_address_new ();
- nm_ip4_address_set_address (addr, tmp_addr);
- nm_ip4_address_set_prefix (addr, netmask_int);
- nm_ip4_address_set_gateway (addr, tmp_gw);
+ addr = nm_ip_address_new (AF_INET, address_v, netmask_int, error);
+ if (!addr)
+ goto error;
- if (nm_setting_ip4_config_add_address (s_ip4, addr)) {
+ if (nm_setting_ip_config_add_address (s_ip4, addr)) {
nm_log_info (LOGD_SETTINGS, "addresses count: %d",
- nm_setting_ip4_config_get_num_addresses (s_ip4));
+ nm_setting_ip_config_get_num_addresses (s_ip4));
} else {
nm_log_info (LOGD_SETTINGS, "ignoring duplicate IP4 address");
}
- nm_ip4_address_unref (addr);
+ nm_ip_address_unref (addr);
+
+ /* gateway */
+ gateway_v = ifparser_getkey (block, "gateway");
+ if (gateway_v) {
+ if (!nm_utils_ipaddr_valid (AF_INET, gateway_v)) {
+ g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
+ "Invalid IPv4 gateway '%s'", gateway_v);
+ goto error;
+ }
+ if (!nm_setting_ip_config_get_gateway (s_ip4))
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_GATEWAY, gateway_v, NULL);
+ }
nameserver_v = ifparser_getkey (block, "dns-nameserver");
ifupdown_ip4_add_dns (s_ip4, nameserver_v);
@@ -516,7 +513,7 @@ update_ip4_setting_from_if_block(NMConnection *connection,
nameservers_v = ifparser_getkey (block, "dns-nameservers");
ifupdown_ip4_add_dns (s_ip4, nameservers_v);
- if (!nm_setting_ip4_config_get_num_dns (s_ip4))
+ if (!nm_setting_ip_config_get_num_dns (s_ip4))
nm_log_info (LOGD_SETTINGS, "No dns-nameserver configured in /etc/network/interfaces");
/* DNS searches */
@@ -527,13 +524,13 @@ update_ip4_setting_from_if_block(NMConnection *connection,
g_strstrip (*iter);
if (g_ascii_isspace (*iter[0]))
continue;
- if (!nm_setting_ip4_config_add_dns_search (s_ip4, *iter))
+ if (!nm_setting_ip_config_add_dns_search (s_ip4, *iter))
nm_log_warn (LOGD_SETTINGS, " duplicate DNS domain '%s'", *iter);
}
g_strfreev (list);
}
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
}
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
@@ -545,7 +542,7 @@ error:
}
static void
-ifupdown_ip6_add_dns (NMSettingIP6Config *s_ip6, const char *dns)
+ifupdown_ip6_add_dns (NMSettingIPConfig *s_ip6, const char *dns)
{
struct in6_addr addr;
char **list, **iter;
@@ -563,7 +560,7 @@ ifupdown_ip6_add_dns (NMSettingIP6Config *s_ip6, const char *dns)
continue;
}
- if (!nm_setting_ip6_config_add_dns (s_ip6, *iter))
+ if (!nm_setting_ip_config_add_dns (s_ip6, *iter))
nm_log_warn (LOGD_SETTINGS, " duplicate DNS domain '%s'", *iter);
}
g_strfreev (list);
@@ -574,16 +571,15 @@ update_ip6_setting_from_if_block(NMConnection *connection,
if_block *block,
GError **error)
{
- NMSettingIP6Config *s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new());
+ NMSettingIPConfig *s_ip6 = NM_SETTING_IP_CONFIG (nm_setting_ip6_config_new());
const char *type = ifparser_getkey(block, "inet6");
gboolean is_static = type && (!strcmp("static", type) ||
!strcmp("v4tunnel", type));
if (!is_static) {
- g_object_set(s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
+ g_object_set(s_ip6, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
} else {
- struct in6_addr tmp_addr, tmp_gw;
- NMIP6Address *addr;
+ NMIPAddress *addr;
const char *address_v;
const char *prefix_v;
const char *gateway_v;
@@ -595,10 +591,9 @@ update_ip6_setting_from_if_block(NMConnection *connection,
/* Address */
address_v = ifparser_getkey(block, "address");
- if (!address_v || !inet_pton (AF_INET6, address_v, &tmp_addr)) {
+ if (!address_v) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Missing IPv6 address '%s'",
- address_v ? address_v : "(none)");
+ "Missing IPv6 address");
goto error;
}
@@ -607,29 +602,30 @@ update_ip6_setting_from_if_block(NMConnection *connection,
if (prefix_v)
prefix_int = g_ascii_strtoll (prefix_v, NULL, 10);
- /* Gateway */
- gateway_v = ifparser_getkey (block, "gateway");
- if (!gateway_v)
- gateway_v = address_v; /* dcbw: whaaa?? */
- if (!inet_pton (AF_INET6, gateway_v, &tmp_gw)) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Invalid IPv6 gateway '%s'", gateway_v);
- goto error;
- }
-
/* Add the new address to the setting */
- addr = nm_ip6_address_new ();
- nm_ip6_address_set_address (addr, &tmp_addr);
- nm_ip6_address_set_prefix (addr, prefix_int);
- nm_ip6_address_set_gateway (addr, &tmp_gw);
+ addr = nm_ip_address_new (AF_INET6, address_v, prefix_int, error);
+ if (!addr)
+ goto error;
- if (nm_setting_ip6_config_add_address (s_ip6, addr)) {
+ if (nm_setting_ip_config_add_address (s_ip6, addr)) {
nm_log_info (LOGD_SETTINGS, "addresses count: %d",
- nm_setting_ip6_config_get_num_addresses (s_ip6));
+ nm_setting_ip_config_get_num_addresses (s_ip6));
} else {
nm_log_info (LOGD_SETTINGS, "ignoring duplicate IP6 address");
}
- nm_ip6_address_unref (addr);
+ nm_ip_address_unref (addr);
+
+ /* gateway */
+ gateway_v = ifparser_getkey (block, "gateway");
+ if (gateway_v) {
+ if (!nm_utils_ipaddr_valid (AF_INET6, gateway_v)) {
+ g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
+ "Invalid IPv6 gateway '%s'", gateway_v);
+ goto error;
+ }
+ if (!nm_setting_ip_config_get_gateway (s_ip6))
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_GATEWAY, gateway_v, NULL);
+ }
nameserver_v = ifparser_getkey(block, "dns-nameserver");
ifupdown_ip6_add_dns (s_ip6, nameserver_v);
@@ -637,7 +633,7 @@ update_ip6_setting_from_if_block(NMConnection *connection,
nameservers_v = ifparser_getkey(block, "dns-nameservers");
ifupdown_ip6_add_dns (s_ip6, nameservers_v);
- if (!nm_setting_ip6_config_get_num_dns (s_ip6))
+ if (!nm_setting_ip_config_get_num_dns (s_ip6))
nm_log_info (LOGD_SETTINGS, "No dns-nameserver configured in /etc/network/interfaces");
/* DNS searches */
@@ -648,14 +644,14 @@ update_ip6_setting_from_if_block(NMConnection *connection,
g_strstrip (*iter);
if (isblank (*iter[0]))
continue;
- if (!nm_setting_ip6_config_add_dns_search (s_ip6, *iter))
+ if (!nm_setting_ip_config_add_dns_search (s_ip6, *iter))
nm_log_warn (LOGD_SETTINGS, " duplicate DNS domain '%s'", *iter);
}
g_strfreev (list);
}
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
NULL);
}
@@ -690,7 +686,7 @@ ifupdown_update_connection_from_if_block (NMConnection *connection,
idstr = g_strconcat ("Ifupdown (", block->name, ")", NULL);
uuid_base = idstr;
- uuid = nm_utils_uuid_generate_from_string (uuid_base);
+ uuid = nm_utils_uuid_generate_from_string (uuid_base, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
g_object_set (s_con,
NM_SETTING_CONNECTION_TYPE, type,
NM_SETTING_CONNECTION_INTERFACE_NAME, block->name,
diff --git a/src/settings/plugins/ifupdown/plugin.c b/src/settings/plugins/ifupdown/plugin.c
index 20928c6826..1cbff29b3d 100644
--- a/src/settings/plugins/ifupdown/plugin.c
+++ b/src/settings/plugins/ifupdown/plugin.c
@@ -22,6 +22,8 @@
* (C) Copyright 2009 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <sys/inotify.h>
@@ -454,12 +456,12 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config)
g_hash_table_destroy (auto_ifaces);
/* Check the config file to find out whether to manage interfaces */
- value = nm_config_get_value (nm_config_get (),
- IFUPDOWN_KEY_FILE_GROUP, IFUPDOWN_KEY_FILE_KEY_MANAGED,
- &error);
+ value = nm_config_data_get_value (nm_config_get_data_orig (nm_config_get ()),
+ IFUPDOWN_KEY_FILE_GROUP, IFUPDOWN_KEY_FILE_KEY_MANAGED,
+ &error);
if (error) {
nm_log_info (LOGD_SETTINGS, "loading system config file (%s) caused error: %s",
- nm_config_get_path (nm_config_get ()),
+ nm_config_data_get_config_main_file (nm_config_get_data (nm_config_get ())),
error->message);
} else {
gboolean manage_well_known;
diff --git a/src/settings/plugins/ifupdown/tests/Makefile.am b/src/settings/plugins/ifupdown/tests/Makefile.am
index 24cdd95504..2e927db931 100644
--- a/src/settings/plugins/ifupdown/tests/Makefile.am
+++ b/src/settings/plugins/ifupdown/tests/Makefile.am
@@ -23,6 +23,8 @@ test_ifupdown_SOURCES = \
test_ifupdown_LDADD = \
$(top_builddir)/src/libNetworkManager.la
+# TODO: enable valgrind for ifupdown. Currently it fails.
+#@VALGRIND_RULES@
TESTS = test-ifupdown
endif
diff --git a/src/settings/plugins/ifupdown/tests/test-ifupdown.c b/src/settings/plugins/ifupdown/tests/test-ifupdown.c
index 8100676d79..1c100ac2e2 100644
--- a/src/settings/plugins/ifupdown/tests/test-ifupdown.c
+++ b/src/settings/plugins/ifupdown/tests/test-ifupdown.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
@@ -459,18 +461,15 @@ test17_read_static_ipv4 (const char *path)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSettingWired *s_wired;
char *unmanaged = NULL;
GError *error = NULL;
const char* tmp;
- const char *expected_address = "10.0.0.3";
const char *expected_id = "Ifupdown (eth0)";
const char *expected_search1 = "example.com";
const char *expected_search2 = "foo.example.com";
- guint32 expected_prefix = 8;
- NMIP4Address *ip4_addr;
- guint32 addr;
+ NMIPAddress *ip4_addr;
#define TEST17_NAME "wired-static-verify-ip4"
if_block *block = NULL;
@@ -521,10 +520,6 @@ test17_read_static_ipv4 (const char *path)
/* ===== IPv4 SETTING ===== */
- ASSERT (inet_pton (AF_INET, expected_address, &addr) > 0,
- TEST17_NAME, "failed to verify %s: couldn't convert IP address #1",
- file);
-
s_ip4 = nm_connection_get_setting_ip4_config (connection);
ASSERT (s_ip4 != NULL,
TEST17_NAME, "failed to verify %s: missing %s setting",
@@ -532,89 +527,81 @@ test17_read_static_ipv4 (const char *path)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0,
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* IP addresses */
- ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 1,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip4) == 1,
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ADDRESSES);
-
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
- ASSERT (ip4_addr,
- TEST17_NAME, "failed to verify %s: missing IP4 address #1",
- file);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
- ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix,
- TEST17_NAME, "failed to verify %s: unexpected IP4 address prefix",
- file);
-
- ASSERT (nm_ip4_address_get_address (ip4_addr) == addr,
- TEST17_NAME, "failed to verify %s: unexpected IP4 address: %s",
- file, addr);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert (ip4_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "10.0.0.3");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 8);
/* DNS Addresses */
- ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip4) == 2,
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (!strcmp (nm_setting_ip4_config_get_dns (s_ip4, 0), "10.0.0.1"),
+ ASSERT (!strcmp (nm_setting_ip_config_get_dns (s_ip4, 0), "10.0.0.1"),
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value #1",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (!strcmp (nm_setting_ip4_config_get_dns (s_ip4, 1), "10.0.0.2"),
+ ASSERT (!strcmp (nm_setting_ip_config_get_dns (s_ip4, 1), "10.0.0.2"),
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value #2",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 1,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip4) == 1,
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
/* DNS search domains */
- ASSERT (nm_setting_ip4_config_get_num_dns_searches (s_ip4) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns_searches (s_ip4) == 2,
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- tmp = nm_setting_ip4_config_get_dns_search (s_ip4, 0);
+ tmp = nm_setting_ip_config_get_dns_search (s_ip4, 0);
ASSERT (tmp != NULL,
TEST17_NAME, "failed to verify %s: missing %s / %s key",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
ASSERT (strcmp (tmp, expected_search1) == 0,
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
- tmp = nm_setting_ip4_config_get_dns_search (s_ip4, 1);
+ tmp = nm_setting_ip_config_get_dns_search (s_ip4, 1);
ASSERT (tmp != NULL,
TEST17_NAME, "failed to verify %s: missing %s / %s key",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
ASSERT (strcmp (tmp, expected_search2) == 0,
TEST17_NAME, "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
g_object_unref (connection);
}
@@ -624,18 +611,15 @@ test18_read_static_ipv6 (const char *path)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
NMSettingWired *s_wired;
char *unmanaged = NULL;
GError *error = NULL;
const char* tmp;
- const char *expected_address = "fc00::1";
const char *expected_id = "Ifupdown (myip6tunnel)";
const char *expected_search1 = "example.com";
const char *expected_search2 = "foo.example.com";
- guint32 expected_prefix = 64;
- NMIP6Address *ip6_addr;
- struct in6_addr addr;
+ NMIPAddress *ip6_addr;
if_block *block = NULL;
#define TEST18_NAME "wired-static-verify-ip6"
const char* file = "test18-" TEST18_NAME;
@@ -691,11 +675,6 @@ test18_read_static_ipv6 (const char *path)
/* ===== IPv6 SETTING ===== */
- ASSERT (inet_pton (AF_INET6, expected_address, &addr) > 0,
- TEST18_NAME,
- "failed to verify %s: couldn't convert IP address #1",
- file);
-
s_ip6 = nm_connection_get_setting_ip6_config (connection);
ASSERT (s_ip6 != NULL,
TEST18_NAME,
@@ -704,103 +683,85 @@ test18_read_static_ipv6 (const char *path)
NM_SETTING_IP6_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip6_config_get_method (s_ip6);
+ tmp = nm_setting_ip_config_get_method (s_ip6);
ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0,
TEST18_NAME,
"failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* IP addresses */
- ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 1,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip6) == 1,
TEST18_NAME,
"failed to verify %s: unexpected number of %s / %s",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ADDRESSES);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
- ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0);
- ASSERT (ip6_addr,
- TEST18_NAME,
- "failed to verify %s: missing %s / %s #1",
- file,
- NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ADDRESSES);
-
- ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix,
- TEST18_NAME
- "failed to verify %s: unexpected %s / %s prefix",
- file,
- NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ADDRESSES);
-
- ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr),
- &addr),
- TEST18_NAME,
- "failed to verify %s: unexpected %s / %s",
- file,
- NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ADDRESSES);
+ ip6_addr = nm_setting_ip_config_get_address (s_ip6, 0);
+ g_assert (ip6_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip6_addr), ==, "fc00::1");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip6_addr), ==, 64);
/* DNS Addresses */
- ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip6) == 2,
TEST18_NAME,
"failed to verify %s: unexpected number of %s / %s values",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (!strcmp (nm_setting_ip6_config_get_dns (s_ip6, 0), "fc00::2"),
+ ASSERT (!strcmp (nm_setting_ip_config_get_dns (s_ip6, 0), "fc00::2"),
TEST18_NAME,
"failed to verify %s: unexpected %s / %s #1",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (!strcmp (nm_setting_ip6_config_get_dns (s_ip6, 1), "fc00::3"),
+ ASSERT (!strcmp (nm_setting_ip_config_get_dns (s_ip6, 1), "fc00::3"),
TEST18_NAME, "failed to verify %s: unexpected %s / %s #2",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
/* DNS search domains */
- ASSERT (nm_setting_ip6_config_get_num_dns_searches (s_ip6) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns_searches (s_ip6) == 2,
TEST18_NAME,
"failed to verify %s: unexpected number of %s / %s values",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
- tmp = nm_setting_ip6_config_get_dns_search (s_ip6, 0);
+ tmp = nm_setting_ip_config_get_dns_search (s_ip6, 0);
ASSERT (tmp != NULL,
"wired-ipv6-manual-verify-ip6",
"failed to verify %s: missing %s / %s #1",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
ASSERT (strcmp (tmp, expected_search1) == 0,
"wired-ipv6-manual-verify-ip6",
"failed to verify %s: unexpected %s / %s #1",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
- tmp = nm_setting_ip6_config_get_dns_search (s_ip6, 1);
+ tmp = nm_setting_ip_config_get_dns_search (s_ip6, 1);
ASSERT (tmp != NULL,
TEST18_NAME,
"failed to verify %s: missing %s / %s #2",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
ASSERT (strcmp (tmp, expected_search2) == 0,
TEST18_NAME,
"failed to verify %s: unexpected %s / %s #2",
file,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
g_free (unmanaged);
g_object_unref (connection);
@@ -810,13 +771,10 @@ static void
test19_read_static_ipv4_plen (const char *path)
{
NMConnection *connection;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *unmanaged = NULL;
GError *error = NULL;
- const char *expected_address = "10.0.0.3";
- guint32 expected_prefix = 8;
- NMIP4Address *ip4_addr;
- guint32 addr;
+ NMIPAddress *ip4_addr;
#define TEST19_NAME "wired-static-verify-ip4-plen"
if_block *block = NULL;
@@ -838,10 +796,6 @@ test19_read_static_ipv4_plen (const char *path)
/* ===== IPv4 SETTING ===== */
- ASSERT (inet_pton (AF_INET, expected_address, &addr) > 0,
- TEST19_NAME, "failed to verify %s: couldn't convert IP address #1",
- file);
-
s_ip4 = nm_connection_get_setting_ip4_config (connection);
ASSERT (s_ip4 != NULL,
TEST19_NAME, "failed to verify %s: missing %s setting",
@@ -849,24 +803,16 @@ test19_read_static_ipv4_plen (const char *path)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* IP addresses */
- ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 1,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip4) == 1,
TEST19_NAME, "failed to verify %s: unexpected %s / %s key value",
file,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ADDRESSES);
-
- ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0);
- ASSERT (ip4_addr,
- TEST19_NAME, "failed to verify %s: missing IP4 address #1",
- file);
-
- ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix,
- TEST19_NAME, "failed to verify %s: unexpected IP4 address prefix",
- file);
+ NM_SETTING_IP_CONFIG_ADDRESSES);
- ASSERT (nm_ip4_address_get_address (ip4_addr) == addr,
- TEST19_NAME, "failed to verify %s: unexpected IP4 address: %s",
- file, addr);
+ ip4_addr = nm_setting_ip_config_get_address (s_ip4, 0);
+ g_assert (ip4_addr != NULL);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "10.0.0.3");
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 8);
g_object_unref (connection);
}
@@ -901,14 +847,10 @@ test20_source_stanza (const char *path)
int
main (int argc, char **argv)
{
- GError *error = NULL;
-
#if !GLIB_CHECK_VERSION (2, 35, 0)
g_type_init ();
#endif
- if (!nm_utils_init (&error))
- FAIL ("nm-utils-init", "failed to initialize libnm: %s", error->message);
nm_logging_setup ("WARN", "DEFAULT", NULL, NULL);
g_test_init (&argc, &argv, NULL);
diff --git a/src/settings/plugins/keyfile/common.h b/src/settings/plugins/keyfile/common.h
index db6569e54a..86fe002855 100644
--- a/src/settings/plugins/keyfile/common.h
+++ b/src/settings/plugins/keyfile/common.h
@@ -24,11 +24,9 @@
#include <glib.h>
#define KEYFILE_PLUGIN_NAME "keyfile"
-#define KEYFILE_PLUGIN_INFO "(c) 2007 - 2013 Red Hat, Inc. To report bugs please use the NetworkManager mailing list."
+#define KEYFILE_PLUGIN_INFO "(c) 2007 - 2015 Red Hat, Inc. To report bugs please use the NetworkManager mailing list."
#define KEYFILE_DIR NMCONFDIR "/system-connections"
-#define VPN_SECRETS_GROUP "vpn-secrets"
-
#endif /* __COMMON_H__ */
diff --git a/src/settings/plugins/keyfile/nm-keyfile-connection.c b/src/settings/plugins/keyfile/nm-keyfile-connection.c
index 661b6745e0..8fb94302d7 100644
--- a/src/settings/plugins/keyfile/nm-keyfile-connection.c
+++ b/src/settings/plugins/keyfile/nm-keyfile-connection.c
@@ -19,6 +19,8 @@
* Copyright (C) 2008 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib/gstdio.h>
#include <nm-dbus-interface.h>
@@ -34,19 +36,12 @@
G_DEFINE_TYPE (NMKeyfileConnection, nm_keyfile_connection, NM_TYPE_SETTINGS_CONNECTION)
-#define NM_KEYFILE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionPrivate))
-
-typedef struct {
- char *path;
-} NMKeyfileConnectionPrivate;
-
NMKeyfileConnection *
nm_keyfile_connection_new (NMConnection *source,
const char *full_path,
GError **error)
{
GObject *object;
- NMKeyfileConnectionPrivate *priv;
NMConnection *tmp;
const char *uuid;
gboolean update_unsaved = TRUE;
@@ -73,15 +68,15 @@ nm_keyfile_connection_new (NMConnection *source,
update_unsaved = FALSE;
}
- object = (GObject *) g_object_new (NM_TYPE_KEYFILE_CONNECTION, NULL);
-
- priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object);
- priv->path = g_strdup (full_path);
+ object = (GObject *) g_object_new (NM_TYPE_KEYFILE_CONNECTION,
+ NM_SETTINGS_CONNECTION_FILENAME, full_path,
+ NULL);
/* Update our settings with what was read from the file */
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object),
tmp,
update_unsaved,
+ NULL,
error)) {
g_object_unref (object);
object = NULL;
@@ -91,38 +86,16 @@ nm_keyfile_connection_new (NMConnection *source,
return (NMKeyfileConnection *) object;
}
-const char *
-nm_keyfile_connection_get_path (NMKeyfileConnection *self)
-{
- g_return_val_if_fail (NM_IS_KEYFILE_CONNECTION (self), NULL);
-
- return NM_KEYFILE_CONNECTION_GET_PRIVATE (self)->path;
-}
-
-void
-nm_keyfile_connection_set_path (NMKeyfileConnection *self, const char *path)
-{
- NMKeyfileConnectionPrivate *priv;
-
- g_return_if_fail (NM_IS_KEYFILE_CONNECTION (self));
- g_return_if_fail (path != NULL);
-
- priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (self);
- g_free (priv->path);
- priv->path = g_strdup (path);
-}
-
static void
commit_changes (NMSettingsConnection *connection,
NMSettingsConnectionCommitFunc callback,
gpointer user_data)
{
- NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (connection);
char *path = NULL;
GError *error = NULL;
if (!nm_keyfile_plugin_write_connection (NM_CONNECTION (connection),
- priv->path,
+ nm_settings_connection_get_filename (connection),
&path,
&error)) {
callback (connection, error, user_data);
@@ -131,10 +104,8 @@ commit_changes (NMSettingsConnection *connection,
}
/* Update the filename if it changed */
- if (path) {
- g_free (priv->path);
- priv->path = path;
- }
+ if (path)
+ nm_settings_connection_set_filename (connection, path);
NM_SETTINGS_CONNECTION_CLASS (nm_keyfile_connection_parent_class)->commit_changes (connection,
callback,
@@ -146,10 +117,11 @@ do_delete (NMSettingsConnection *connection,
NMSettingsConnectionDeleteFunc callback,
gpointer user_data)
{
- NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (connection);
+ const char *path;
- if (priv->path)
- g_unlink (priv->path);
+ path = nm_settings_connection_get_filename (connection);
+ if (path)
+ g_unlink (path);
NM_SETTINGS_CONNECTION_CLASS (nm_keyfile_connection_parent_class)->delete (connection,
callback,
@@ -164,23 +136,11 @@ nm_keyfile_connection_init (NMKeyfileConnection *connection)
}
static void
-finalize (GObject *object)
-{
- g_free (NM_KEYFILE_CONNECTION_GET_PRIVATE (object)->path);
-
- G_OBJECT_CLASS (nm_keyfile_connection_parent_class)->finalize (object);
-}
-
-static void
nm_keyfile_connection_class_init (NMKeyfileConnectionClass *keyfile_connection_class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (keyfile_connection_class);
NMSettingsConnectionClass *settings_class = NM_SETTINGS_CONNECTION_CLASS (keyfile_connection_class);
- g_type_class_add_private (keyfile_connection_class, sizeof (NMKeyfileConnectionPrivate));
-
/* Virtual methods */
- object_class->finalize = finalize;
settings_class->commit_changes = commit_changes;
settings_class->delete = do_delete;
}
diff --git a/src/settings/plugins/keyfile/nm-keyfile-connection.h b/src/settings/plugins/keyfile/nm-keyfile-connection.h
index 135bb49f73..f6fa432b65 100644
--- a/src/settings/plugins/keyfile/nm-keyfile-connection.h
+++ b/src/settings/plugins/keyfile/nm-keyfile-connection.h
@@ -47,9 +47,6 @@ NMKeyfileConnection *nm_keyfile_connection_new (NMConnection *source,
const char *filename,
GError **error);
-const char *nm_keyfile_connection_get_path (NMKeyfileConnection *self);
-void nm_keyfile_connection_set_path (NMKeyfileConnection *self, const char *path);
-
G_END_DECLS
#endif /* __NETWORKMANAGER_KEYFILE_CONNECTION_H__ */
diff --git a/src/settings/plugins/keyfile/plugin.c b/src/settings/plugins/keyfile/plugin.c
index 562beeaeb1..611192baa5 100644
--- a/src/settings/plugins/keyfile/plugin.c
+++ b/src/settings/plugins/keyfile/plugin.c
@@ -19,7 +19,8 @@
* Copyright (C) 2008 - 2013 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
@@ -44,6 +45,7 @@
#include "writer.h"
#include "common.h"
#include "utils.h"
+#include "gsystem-local-alloc.h"
static char *plugin_get_hostname (SCPluginKeyfile *plugin);
static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class);
@@ -86,7 +88,7 @@ remove_connection (SCPluginKeyfile *self, NMKeyfileConnection *connection)
g_return_if_fail (connection != NULL);
- nm_log_info (LOGD_SETTINGS, "removed %s.", nm_keyfile_connection_get_path (connection));
+ nm_log_info (LOGD_SETTINGS, "keyfile: removed " NM_KEYFILE_CONNECTION_LOG_FMT, NM_KEYFILE_CONNECTION_LOG_ARG (connection));
/* Removing from the hash table should drop the last reference */
g_object_ref (connection);
@@ -99,102 +101,182 @@ remove_connection (SCPluginKeyfile *self, NMKeyfileConnection *connection)
g_return_if_fail (removed);
}
-static void
-update_connection (SCPluginKeyfile *self,
- NMKeyfileConnection *connection,
- const char *name)
-{
- NMKeyfileConnection *tmp;
- GError *error = NULL;
-
- tmp = nm_keyfile_connection_new (NULL, name, &error);
- if (!tmp) {
- /* Error; remove the connection */
- nm_log_warn (LOGD_SETTINGS, " error in connection %s: %s", name,
- (error && error->message) ? error->message : "(unknown)");
- g_clear_error (&error);
- remove_connection (self, connection);
- return;
- }
-
- if (!nm_connection_compare (NM_CONNECTION (connection),
- NM_CONNECTION (tmp),
- NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS |
- NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS)) {
- nm_log_info (LOGD_SETTINGS, "updating %s", name);
- if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (connection),
- NM_CONNECTION (tmp),
- FALSE, /* don't set Unsaved */
- &error)) {
- /* Shouldn't ever get here as 'new' was verified by the reader already */
- g_assert_no_error (error);
- }
- }
- g_object_unref (tmp);
-}
-
static NMKeyfileConnection *
find_by_path (SCPluginKeyfile *self, const char *path)
{
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (self);
GHashTableIter iter;
- NMKeyfileConnection *candidate = NULL;
+ NMSettingsConnection *candidate = NULL;
g_return_val_if_fail (path != NULL, NULL);
g_hash_table_iter_init (&iter, priv->connections);
while (g_hash_table_iter_next (&iter, NULL, (gpointer) &candidate)) {
- if (g_strcmp0 (path, nm_keyfile_connection_get_path (candidate)) == 0)
- return candidate;
+ if (g_strcmp0 (path, nm_settings_connection_get_filename (candidate)) == 0)
+ return NM_KEYFILE_CONNECTION (candidate);
}
return NULL;
}
-static void
-new_connection (SCPluginKeyfile *self,
- const char *name,
- char **out_old_path)
+/* update_connection:
+ * @self: the plugin instance
+ * @source: if %NULL, this re-reads the connection from @full_path
+ * and updates it. When passing @source, this adds a connection from
+ * memory.
+ * @full_path: the filename of the keyfile to be loaded
+ * @connection: an existing connection that might be updated.
+ * If given, @connection must be an existing connection that is currently
+ * owned by the plugin.
+ * @protect_existing_connection: if %TRUE, and !@connection, we don't allow updating
+ * an existing connection with the same UUID.
+ * If %TRUE and @connection, allow updating only if the reload would modify
+ * @connection (without changing its UUID) or if we would create a new connection.
+ * In other words, if this paramter is %TRUE, we only allow creating a
+ * new connection (with an unseen UUID) or updating the passed in @connection
+ * (whereas the UUID cannot change).
+ * Note, that this allows for @connection to be replaced by a new connection.
+ * @protected_connections: (allow-none): if given, we only update an
+ * existing connection if it is not contained in this hash.
+ * @error: error in case of failure
+ *
+ * Loads a connection from file @full_path. This can both be used to
+ * load a connection initially or to update an existing connection.
+ *
+ * If you pass in an existing connection and the reloaded file happens
+ * to have a different UUID, the connection is deleted.
+ * Beware, that means that after the function, you have a dangling pointer
+ * if the returned connection is different from @connection.
+ *
+ * Returns: the updated connection.
+ * */
+static NMKeyfileConnection *
+update_connection (SCPluginKeyfile *self,
+ NMConnection *source,
+ const char *full_path,
+ NMKeyfileConnection *connection,
+ gboolean protect_existing_connection,
+ GHashTable *protected_connections,
+ GError **error)
{
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (self);
- NMKeyfileConnection *tmp, *connection;
- GError *error = NULL;
+ NMKeyfileConnection *connection_new;
+ NMKeyfileConnection *connection_by_uuid;
+ GError *local = NULL;
const char *uuid;
- if (out_old_path)
- *out_old_path = NULL;
+ g_return_val_if_fail (!source || NM_IS_CONNECTION (source), NULL);
+ g_return_val_if_fail (full_path || source, NULL);
- tmp = nm_keyfile_connection_new (NULL, name, &error);
- if (!tmp) {
- nm_log_warn (LOGD_SETTINGS, " error in connection %s: %s", name,
- (error && error->message) ? error->message : "(unknown)");
- g_clear_error (&error);
- return;
+ if (full_path)
+ nm_log_dbg (LOGD_SETTINGS, "keyfile: loading from file \"%s\"...", full_path);
+
+ connection_new = nm_keyfile_connection_new (source, full_path, &local);
+ if (!connection_new) {
+ /* Error; remove the connection */
+ if (source)
+ nm_log_warn (LOGD_SETTINGS, "keyfile: error creating connection %s: %s", nm_connection_get_uuid (source), local->message);
+ else
+ nm_log_warn (LOGD_SETTINGS, "keyfile: error loading connection from file %s: %s", full_path, local->message);
+ if ( connection
+ && !protect_existing_connection
+ && (!protected_connections || !g_hash_table_contains (protected_connections, connection)))
+ remove_connection (self, connection);
+ g_propagate_error (error, local);
+ return NULL;
}
- /* Connection renames will show as different paths but same UUID */
- uuid = nm_connection_get_uuid (NM_CONNECTION (tmp));
- connection = g_hash_table_lookup (priv->connections, uuid);
- if (connection) {
- nm_log_info (LOGD_SETTINGS, "rename %s -> %s", nm_keyfile_connection_get_path (connection), name);
- if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (connection),
- NM_CONNECTION (tmp),
- FALSE, /* don't set Unsaved */
- &error)) {
- /* Shouldn't ever get here as 'tmp' was verified by the reader already */
- g_assert_no_error (error);
+ uuid = nm_connection_get_uuid (NM_CONNECTION (connection_new));
+ connection_by_uuid = g_hash_table_lookup (priv->connections, uuid);
+
+ if ( connection
+ && connection != connection_by_uuid) {
+
+ if ( (protect_existing_connection && connection_by_uuid != NULL)
+ || (protected_connections && g_hash_table_contains (protected_connections, connection))) {
+ NMKeyfileConnection *conflicting = (protect_existing_connection && connection_by_uuid != NULL) ? connection_by_uuid : connection;
+
+ if (source)
+ nm_log_warn (LOGD_SETTINGS, "keyfile: cannot update protected "NM_KEYFILE_CONNECTION_LOG_FMT" connection due to conflicting UUID %s", NM_KEYFILE_CONNECTION_LOG_ARG (conflicting), uuid);
+ else
+ nm_log_warn (LOGD_SETTINGS, "keyfile: cannot load %s due to conflicting UUID for "NM_KEYFILE_CONNECTION_LOG_FMT, full_path, NM_KEYFILE_CONNECTION_LOG_ARG (conflicting));
+ g_object_unref (connection_new);
+ g_set_error_literal (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+ "Cannot update protected connection due to conflicting UUID");
+ return NULL;
}
- g_object_unref (tmp);
- if (out_old_path)
- *out_old_path = g_strdup (nm_keyfile_connection_get_path (connection));
- nm_keyfile_connection_set_path (connection, name);
+
+ /* The new connection has a different UUID then the original one.
+ * Remove @connection. */
+ remove_connection (self, connection);
+ }
+
+ if ( connection_by_uuid
+ && ( (!connection && protect_existing_connection)
+ || (protected_connections && g_hash_table_contains (protected_connections, connection_by_uuid)))) {
+ if (source)
+ nm_log_warn (LOGD_SETTINGS, "keyfile: cannot update connection due to conflicting UUID for "NM_KEYFILE_CONNECTION_LOG_FMT, NM_KEYFILE_CONNECTION_LOG_ARG (connection_by_uuid));
+ else
+ nm_log_warn (LOGD_SETTINGS, "keyfile: cannot load %s due to conflicting UUID for "NM_KEYFILE_CONNECTION_LOG_FMT, full_path, NM_KEYFILE_CONNECTION_LOG_ARG (connection_by_uuid));
+ g_object_unref (connection_new);
+ g_set_error_literal (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+ "Skip updating protected connection during reload");
+ return NULL;
+ }
+
+ if (connection_by_uuid) {
+ const char *old_path;
+
+ old_path = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection_by_uuid));
+
+ if (nm_connection_compare (NM_CONNECTION (connection_by_uuid),
+ NM_CONNECTION (connection_new),
+ NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS |
+ NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS)) {
+ /* Nothing to do... except updating the path. */
+ if (old_path && g_strcmp0 (old_path, full_path) != 0)
+ nm_log_info (LOGD_SETTINGS, "keyfile: rename \"%s\" to "NM_KEYFILE_CONNECTION_LOG_FMT" without other changes", old_path, NM_KEYFILE_CONNECTION_LOG_ARG (connection_new));
+ } else {
+ /* An existing connection changed. */
+ if (source)
+ nm_log_info (LOGD_SETTINGS, "keyfile: update "NM_KEYFILE_CONNECTION_LOG_FMT" from %s", NM_KEYFILE_CONNECTION_LOG_ARG (connection_new), NM_KEYFILE_CONNECTION_LOG_PATH (old_path));
+ else if (!g_strcmp0 (old_path, nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection_new))))
+ nm_log_info (LOGD_SETTINGS, "keyfile: update "NM_KEYFILE_CONNECTION_LOG_FMT, NM_KEYFILE_CONNECTION_LOG_ARG (connection_new));
+ else if (old_path)
+ nm_log_info (LOGD_SETTINGS, "keyfile: rename \"%s\" to "NM_KEYFILE_CONNECTION_LOG_FMT, old_path, NM_KEYFILE_CONNECTION_LOG_ARG (connection_new));
+ else
+ nm_log_info (LOGD_SETTINGS, "keyfile: update and persist "NM_KEYFILE_CONNECTION_LOG_FMT, NM_KEYFILE_CONNECTION_LOG_ARG (connection_new));
+
+ if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (connection_by_uuid),
+ NM_CONNECTION (connection_new),
+ FALSE, /* don't set Unsaved */
+ "keyfile-update",
+ &local)) {
+ /* Shouldn't ever get here as 'connection_new' was verified by the reader already
+ * and the UUID did not change. */
+ g_assert_not_reached ();
+ }
+ g_assert_no_error (local);
+ }
+ nm_settings_connection_set_filename (NM_SETTINGS_CONNECTION (connection_by_uuid), full_path);
+ g_object_unref (connection_new);
+ return connection_by_uuid;
} else {
- nm_log_info (LOGD_SETTINGS, "new connection %s", name);
- g_hash_table_insert (priv->connections, g_strdup (uuid), tmp);
- g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, tmp);
+ if (source)
+ nm_log_info (LOGD_SETTINGS, "keyfile: add connection "NM_KEYFILE_CONNECTION_LOG_FMT, NM_KEYFILE_CONNECTION_LOG_ARG (connection_new));
+ else
+ nm_log_info (LOGD_SETTINGS, "keyfile: new connection "NM_KEYFILE_CONNECTION_LOG_FMT, NM_KEYFILE_CONNECTION_LOG_ARG (connection_new));
+ g_hash_table_insert (priv->connections, g_strdup (uuid), connection_new);
- g_signal_connect (tmp, NM_SETTINGS_CONNECTION_REMOVED,
+ g_signal_connect (connection_new, NM_SETTINGS_CONNECTION_REMOVED,
G_CALLBACK (connection_removed_cb),
self);
+
+ if (!source) {
+ /* Only raise the signal if we were called without source, i.e. if we read the connection from file.
+ * Otherwise, we were called by add_connection() which does not expect the signal. */
+ g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection_new);
+ }
+ return connection_new;
}
}
@@ -209,26 +291,28 @@ dir_changed (GFileMonitor *monitor,
SCPluginKeyfile *self = SC_PLUGIN_KEYFILE (config);
NMKeyfileConnection *connection;
char *full_path;
+ gboolean exists;
full_path = g_file_get_path (file);
if (nm_keyfile_plugin_utils_should_ignore_file (full_path)) {
g_free (full_path);
return;
}
+ exists = g_file_test (full_path, G_FILE_TEST_EXISTS);
+
+ nm_log_dbg (LOGD_SETTINGS, "dir_changed(%s) = %d; file %s", full_path, event_type, exists ? "exists" : "does not exist");
connection = find_by_path (self, full_path);
switch (event_type) {
case G_FILE_MONITOR_EVENT_DELETED:
- if (connection)
+ if (!exists && connection)
remove_connection (SC_PLUGIN_KEYFILE (config), connection);
break;
case G_FILE_MONITOR_EVENT_CREATED:
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
- if (connection)
- update_connection (SC_PLUGIN_KEYFILE (config), connection, full_path);
- else
- new_connection (SC_PLUGIN_KEYFILE (config), full_path, NULL);
+ if (exists)
+ update_connection (SC_PLUGIN_KEYFILE (config), NULL, full_path, connection, TRUE, NULL, NULL);
break;
default:
break;
@@ -304,6 +388,43 @@ setup_monitoring (NMSystemConfigInterface *config)
}
}
+static GHashTable *
+_paths_from_connections (GHashTable *connections)
+{
+ GHashTableIter iter;
+ NMKeyfileConnection *connection;
+ GHashTable *paths = g_hash_table_new (g_str_hash, g_str_equal);
+
+ g_hash_table_iter_init (&iter, connections);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &connection)) {
+ const char *path = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection));
+
+ if (path)
+ g_hash_table_add (paths, (void *) path);
+ }
+ return paths;
+}
+
+static int
+_sort_paths (const char **f1, const char **f2, GHashTable *paths)
+{
+ struct stat st;
+ gboolean c1, c2;
+ gint64 m1, m2;
+
+ c1 = !!g_hash_table_contains (paths, *f1);
+ c2 = !!g_hash_table_contains (paths, *f2);
+ if (c1 != c2)
+ return c1 ? -1 : 1;
+
+ m1 = stat (*f1, &st) == 0 ? (gint64) st.st_mtime : G_MININT64;
+ m2 = stat (*f2, &st) == 0 ? (gint64) st.st_mtime : G_MININT64;
+ if (m1 != m2)
+ return m1 > m2 ? -1 : 1;
+
+ return strcmp (*f1, *f2);
+}
+
static void
read_connections (NMSystemConfigInterface *config)
{
@@ -312,13 +433,17 @@ read_connections (NMSystemConfigInterface *config)
GDir *dir;
GError *error = NULL;
const char *item;
- GHashTable *oldconns;
+ GHashTable *alive_connections;
GHashTableIter iter;
- gpointer data;
+ NMKeyfileConnection *connection;
+ GPtrArray *dead_connections = NULL;
+ guint i;
+ GPtrArray *filenames;
+ GHashTable *paths;
dir = g_dir_open (KEYFILE_DIR, 0, &error);
if (!dir) {
- nm_log_warn (LOGD_SETTINGS, "Cannot read directory '%s': (%d) %s",
+ nm_log_warn (LOGD_SETTINGS, "keyfile: cannot read directory '%s': (%d) %s",
KEYFILE_DIR,
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
@@ -326,45 +451,49 @@ read_connections (NMSystemConfigInterface *config)
return;
}
- oldconns = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- g_hash_table_iter_init (&iter, priv->connections);
- while (g_hash_table_iter_next (&iter, NULL, &data)) {
- const char *con_path = nm_keyfile_connection_get_path (data);
- if (con_path)
- g_hash_table_insert (oldconns, g_strdup (con_path), data);
- }
+ alive_connections = g_hash_table_new (NULL, NULL);
+ filenames = g_ptr_array_new_with_free_func (g_free);
while ((item = g_dir_read_name (dir))) {
- NMKeyfileConnection *connection;
- char *full_path, *old_path;
-
if (nm_keyfile_plugin_utils_should_ignore_file (item))
continue;
+ g_ptr_array_add (filenames, g_build_filename (KEYFILE_DIR, item, NULL));
+ }
+ g_dir_close (dir);
- full_path = g_build_filename (KEYFILE_DIR, item, NULL);
+ /* While reloading, we don't replace connections that we already loaded while
+ * iterating over the files.
+ *
+ * To have sensible, reproducible behavior, sort the paths by last modification
+ * time prefering older files.
+ */
+ paths = _paths_from_connections (priv->connections);
+ g_ptr_array_sort_with_data (filenames, (GCompareDataFunc) _sort_paths, paths);
+ g_hash_table_destroy (paths);
+
+ for (i = 0; i < filenames->len; i++) {
+ connection = update_connection (self, NULL, filenames->pdata[i], NULL, FALSE, alive_connections, NULL);
+ if (connection)
+ g_hash_table_add (alive_connections, connection);
+ }
+ g_ptr_array_free (filenames, TRUE);
- connection = g_hash_table_lookup (oldconns, full_path);
- if (connection) {
- g_hash_table_remove (oldconns, full_path);
- update_connection (self, connection, full_path);
- } else {
- new_connection (self, full_path, &old_path);
- if (old_path) {
- g_hash_table_remove (oldconns, old_path);
- g_free (old_path);
- }
+ g_hash_table_iter_init (&iter, priv->connections);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &connection)) {
+ if ( !g_hash_table_contains (alive_connections, connection)
+ && nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection))) {
+ if (!dead_connections)
+ dead_connections = g_ptr_array_new ();
+ g_ptr_array_add (dead_connections, connection);
}
-
- g_free (full_path);
}
- g_dir_close (dir);
+ g_hash_table_destroy (alive_connections);
- g_hash_table_iter_init (&iter, oldconns);
- while (g_hash_table_iter_next (&iter, NULL, &data)) {
- g_hash_table_iter_remove (&iter);
- remove_connection (self, data);
+ if (dead_connections) {
+ for (i = 0; i < dead_connections->len; i++)
+ remove_connection (self, dead_connections->pdata[i]);
+ g_ptr_array_free (dead_connections, TRUE);
}
- g_hash_table_destroy (oldconns);
}
/* Plugin */
@@ -398,13 +527,7 @@ load_connection (NMSystemConfigInterface *config,
if (nm_keyfile_plugin_utils_should_ignore_file (filename + dir_len + 1))
return FALSE;
- connection = find_by_path (self, filename);
- if (connection)
- update_connection (self, connection, filename);
- else {
- new_connection (self, filename, NULL);
- connection = find_by_path (self, filename);
- }
+ connection = update_connection (self, NULL, filename, find_by_path (self, filename), TRUE, NULL, NULL);
return (connection != NULL);
}
@@ -422,26 +545,13 @@ add_connection (NMSystemConfigInterface *config,
GError **error)
{
SCPluginKeyfile *self = SC_PLUGIN_KEYFILE (config);
- SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (self);
- NMSettingsConnection *added = NULL;
- char *path = NULL;
+ gs_free char *path = NULL;
if (save_to_disk) {
if (!nm_keyfile_plugin_write_connection (connection, NULL, &path, error))
return NULL;
}
-
- added = (NMSettingsConnection *) nm_keyfile_connection_new (connection, path, error);
- if (added) {
- g_hash_table_insert (priv->connections,
- g_strdup (nm_connection_get_uuid (NM_CONNECTION (added))),
- added);
- g_signal_connect (added, NM_SETTINGS_CONNECTION_REMOVED,
- G_CALLBACK (connection_removed_cb),
- self);
- }
- g_free (path);
- return added;
+ return NM_SETTINGS_CONNECTION (update_connection (self, connection, path, NULL, FALSE, NULL, error));
}
static gboolean
@@ -475,45 +585,19 @@ get_unmanaged_specs (NMSystemConfigInterface *config)
GKeyFile *key_file;
GSList *specs = NULL;
GError *error = NULL;
- char *str;
if (!priv->conf_file)
return NULL;
- key_file = g_key_file_new ();
- if (!parse_key_file_allow_none (priv, key_file, &error))
- goto out;
-
- str = g_key_file_get_value (key_file, "keyfile", "unmanaged-devices", NULL);
- if (str) {
- char **udis;
- int i;
-
- udis = g_strsplit_set (str, ";,", -1);
- g_free (str);
-
- for (i = 0; udis[i] != NULL; i++) {
- /* Verify unmanaged specification and add it to the list */
- if (!strncmp (udis[i], "mac:", 4) && nm_utils_hwaddr_valid (udis[i] + 4, -1)) {
- specs = g_slist_append (specs, udis[i]);
- } else if (!strncmp (udis[i], "interface-name:", 15) && nm_utils_iface_valid_name (udis[i] + 15)) {
- specs = g_slist_append (specs, udis[i]);
- } else {
- nm_log_warn (LOGD_SETTINGS, "Error in file '%s': invalid unmanaged-devices entry: '%s'", priv->conf_file, udis[i]);
- g_free (udis[i]);
- }
- }
-
- g_free (udis); /* Yes, g_free, not g_strfreev because we need the strings in the list */
- }
+ key_file = nm_config_create_keyfile ();
+ if (parse_key_file_allow_none (priv, key_file, &error))
+ specs = nm_config_get_device_match_spec (key_file, "keyfile", "unmanaged-devices");
- out:
if (error) {
- nm_log_warn (LOGD_SETTINGS, "%s", error->message);
+ nm_log_warn (LOGD_SETTINGS, "keyfile: error getting unmanaged specs: %s", error->message);
g_error_free (error);
}
- if (key_file)
- g_key_file_free (key_file);
+ g_key_file_free (key_file);
return specs;
}
@@ -537,7 +621,7 @@ plugin_get_hostname (SCPluginKeyfile *plugin)
out:
if (error) {
- nm_log_warn (LOGD_SETTINGS, "%s", error->message);
+ nm_log_warn (LOGD_SETTINGS, "keyfile: error getting hostname: %s", error->message);
g_error_free (error);
}
if (key_file)
@@ -584,7 +668,7 @@ plugin_set_hostname (SCPluginKeyfile *plugin, const char *hostname)
out:
if (error) {
- nm_log_warn (LOGD_SETTINGS, "%s", error->message);
+ nm_log_warn (LOGD_SETTINGS, "keyfile: error setting hostname: %s", error->message);
g_error_free (error);
}
g_free (data);
@@ -733,7 +817,7 @@ nm_settings_keyfile_plugin_new (void)
singleton = SC_PLUGIN_KEYFILE (g_object_new (SC_TYPE_PLUGIN_KEYFILE, NULL));
priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (singleton);
- priv->conf_file = nm_config_get_path (nm_config_get ());
+ priv->conf_file = nm_config_data_get_config_main_file (nm_config_get_data (nm_config_get ()));
/* plugin_set_hostname() has to be called *after* priv->conf_file is set */
priv->hostname = plugin_get_hostname (singleton);
diff --git a/src/settings/plugins/keyfile/reader.c b/src/settings/plugins/keyfile/reader.c
index cbd6e49ab1..a149e06d93 100644
--- a/src/settings/plugins/keyfile/reader.c
+++ b/src/settings/plugins/keyfile/reader.c
@@ -15,1265 +15,76 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2008 - 2009 Novell, Inc.
- * Copyright (C) 2008 - 2011 Red Hat, Inc.
+ * Copyright (C) 2015 Red Hat, Inc.
*/
-#include <errno.h>
-#include <stdlib.h>
+#include "config.h"
+
#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <arpa/inet.h>
#include <string.h>
-#include "nm-core-internal.h"
-#include "nm-dbus-glib-types.h"
-#include "nm-glib-compat.h"
-#include "nm-system-config-interface.h"
-#include "nm-logging.h"
#include "reader.h"
-#include "common.h"
-#include "utils.h"
-#include "nm-core-internal.h"
-
-/* Some setting properties also contain setting names, such as
- * NMSettingConnection's 'type' property (which specifies the base type of the
- * connection, e.g. ethernet or wifi) or 'slave-type' (specifies type of slave
- * connection, e.g. bond or bridge). This function handles translating those
- * properties' values to the real setting name if they are an alias.
- */
-static void
-setting_alias_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- const char *setting_name = nm_setting_get_name (setting);
- char *s;
- const char *key_setting_name;
-
- s = nm_keyfile_plugin_kf_get_string (keyfile, setting_name, key, NULL);
- if (s) {
- key_setting_name = nm_keyfile_plugin_get_setting_name_for_alias (s);
- g_object_set (G_OBJECT (setting),
- key, key_setting_name ? key_setting_name : s,
- NULL);
- g_free (s);
- }
-}
-
-static gboolean
-read_array_of_uint (GKeyFile *file,
- NMSetting *setting,
- const char *key)
-{
- GArray *array = NULL;
- gsize length;
- int i;
- gint *tmp;
-
- tmp = nm_keyfile_plugin_kf_get_integer_list (file, nm_setting_get_name (setting), key, &length, NULL);
- array = g_array_sized_new (FALSE, FALSE, sizeof (guint32), length);
- g_return_val_if_fail (array != NULL, FALSE);
-
- for (i = 0; i < length; i++)
- g_array_append_val (array, tmp[i]);
-
- g_object_set (setting, key, array, NULL);
- g_array_unref (array);
-
- return TRUE;
-}
-
-static gboolean
-get_one_int (const char *str, guint32 max_val, const char *key_name, guint32 *out)
-{
- long tmp;
- char *endptr;
-
- if (!str || !str[0]) {
- if (key_name)
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring missing number %s", __func__, key_name);
- return FALSE;
- }
-
- errno = 0;
- tmp = strtol (str, &endptr, 10);
- if (errno || (tmp < 0) || (tmp > max_val) || *endptr != 0) {
- if (key_name)
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid number %s '%s'", __func__, key_name, str);
- return FALSE;
- }
-
- *out = (guint32) tmp;
- return TRUE;
-}
-
-static gpointer
-build_ip4_address_or_route (const char *key_name, const char *address_str, guint32 plen, const char *gateway_str, const char *metric_str, gboolean route)
-{
- gpointer result;
- guint32 addr;
- guint32 address = 0;
- guint32 gateway = 0;
- guint32 metric = 0;
- int err;
-
- g_return_val_if_fail (address_str, NULL);
-
- /* Address */
- err = inet_pton (AF_INET, address_str, &addr);
- if (err <= 0) {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid IPv4 address '%s'", __func__, address_str);
- return NULL;
- }
- address = addr;
-
- /* Gateway */
- if (gateway_str && gateway_str[0]) {
- err = inet_pton (AF_INET, gateway_str, &addr);
- if (err <= 0) {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid IPv4 gateway '%s'", __func__, gateway_str);
- return NULL;
- }
- gateway = addr;
- }
- else
- gateway = 0;
-
- /* parse metric, default to 0 */
- if (metric_str) {
- if (!get_one_int (metric_str, G_MAXUINT32, key_name, &metric))
- return NULL;
- }
-
- if (route) {
- result = nm_ip4_route_new ();
- nm_ip4_route_set_dest (result, address);
- nm_ip4_route_set_prefix (result, plen);
- nm_ip4_route_set_next_hop (result, gateway);
- nm_ip4_route_set_metric (result, metric);
- } else {
- result = nm_ip4_address_new ();
- nm_ip4_address_set_address (result, address);
- nm_ip4_address_set_prefix (result, plen);
- nm_ip4_address_set_gateway (result, gateway);
- }
- return result;
-}
-
-static gpointer
-build_ip6_address_or_route (const char *key_name, const char *address_str, guint32 plen, const char *gateway_str, const char *metric_str, gboolean route)
-{
- gpointer result;
- struct in6_addr addr;
- guint32 metric = 0;
- int err;
-
- g_return_val_if_fail (address_str, NULL);
-
- if (route)
- result = nm_ip6_route_new ();
- else
- result = nm_ip6_address_new ();
-
- /* add address and prefix length */
- err = inet_pton (AF_INET6, address_str, &addr);
- if (err <= 0) {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid IPv6 address '%s'", __func__, address_str);
- goto error_out;
- }
- if (route) {
- nm_ip6_route_set_dest (result, &addr);
- nm_ip6_route_set_prefix (result, plen);
- } else {
- nm_ip6_address_set_address (result, &addr);
- nm_ip6_address_set_prefix (result, plen);
- }
-
- /* add gateway */
- if (gateway_str && gateway_str[0]) {
- err = inet_pton (AF_INET6, gateway_str, &addr);
- if (err <= 0) {
- /* Try workaround for routes written by broken keyfile writer.
- * Due to bug bgo#719851, an older version of writer would have
- * written "a:b:c:d::/plen,metric" if the gateway was ::, instead
- * of "a:b:c:d::/plen,,metric" or "a:b:c:d::/plen,::,metric"
- * Try workaround by interepeting gateway_str as metric to accept such
- * invalid routes. This broken syntax should not be not officially
- * supported.
- **/
- if (route && !metric_str && get_one_int (gateway_str, G_MAXUINT32, NULL, &metric))
- addr = in6addr_any;
- else {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid IPv6 gateway '%s'", __func__, gateway_str);
- goto error_out;
- }
- }
- } else
- addr = in6addr_any;
-
- if (route) {
- nm_ip6_route_set_next_hop (result, &addr);
-
- /* parse metric, default to 0 */
- if (metric_str) {
- if (!get_one_int (metric_str, G_MAXUINT32, key_name, &metric))
- goto error_out;
- }
- nm_ip6_route_set_metric (result, metric);
- } else
- nm_ip6_address_set_gateway (result, &addr);
-
- return result;
-
-error_out:
- if (route)
- nm_ip6_route_unref (result);
- else
- nm_ip4_route_unref (result);
- return NULL;
-}
-
-/* On success, returns pointer to the zero-terminated field (original @current).
- * The @current * pointer target is set to point to the rest of the input
- * or %NULL if there is no more input. Sets error to %NULL for convenience.
- *
- * On failure, returns %NULL (unspecified). The @current pointer target is
- * resets to its original value to allow skipping fields. The @error target
- * is set to the character that breaks the parsing or %NULL if @current was %NULL.
- *
- * When @current target is %NULL, gracefully fail returning %NULL while
- * leaving the @current target %NULL end setting @error to %NULL;
- */
-static char *
-read_field (char **current, char **error, const char *characters, const char *delimiters)
-{
- char *start;
-
- g_return_val_if_fail (current, NULL);
- g_return_val_if_fail (error, NULL);
- g_return_val_if_fail (characters, NULL);
- g_return_val_if_fail (delimiters, NULL);
-
- if (!*current) {
- /* graceful failure, leave '*current' NULL */
- *error = NULL;
- return NULL;
- }
-
- /* fail on empty input */
- if (!**current)
- return NULL;
-
- /* remember beginning of input */
- start = *current;
-
- while (**current && strchr (characters, **current))
- (*current)++;
- if (**current)
- if (strchr (delimiters, **current)) {
- /* success, more data available */
- *error = NULL;
- *(*current)++ = '\0';
- return start;
- } else {
- /* error, bad character */
- *error = *current;
- *current = start;
- return NULL;
- }
- else {
- /* success, end of input */
- *error = NULL;
- *current = NULL;
- return start;
- }
-}
-
-#define IP_ADDRESS_CHARS "0123456789abcdefABCDEF:.%"
-#define DIGITS "0123456789"
-#define DELIMITERS "/;,"
-
-
-/* The following IPv4 and IPv6 address formats are supported:
- *
- * address (DEPRECATED)
- * address/plen
- * address/gateway (DEPRECATED)
- * address/plen,gateway
- *
- * The following IPv4 and IPv6 route formats are supported:
- *
- * address/plen (NETWORK dev DEVICE)
- * address/plen,gateway (NETWORK via GATEWAY dev DEVICE)
- * address/plen,,metric (NETWORK dev DEVICE metric METRIC)
- * address/plen,gateway,metric (NETWORK via GATEWAY dev DEVICE metric METRIC)
- *
- * For backward, forward and sideward compatibility, slash (/),
- * semicolon (;) and comma (,) are interchangable. The choice of
- * separator in the above examples is therefore not significant.
- *
- * Leaving out the prefix length is discouraged and DEPRECATED. The
- * default value of IPv6 prefix length was 64 and has not been
- * changed. The default for IPv4 is now 24, which is the closest
- * IPv4 equivalent. These defaults may just as well be changed to
- * match the iproute2 defaults (32 for IPv4 and 128 for IPv6).
- */
-static gpointer
-read_one_ip_address_or_route (GKeyFile *file,
- const char *setting_name,
- const char *key_name,
- gboolean ipv6,
- gboolean route)
-{
- guint32 plen;
- gpointer result;
- char *address_str, *plen_str, *gateway_str, *metric_str, *value, *current, *error;
-
- current = value = nm_keyfile_plugin_kf_get_string (file, setting_name, key_name, NULL);
- if (!value)
- return NULL;
-
- /* get address field */
- address_str = read_field (&current, &error, IP_ADDRESS_CHARS, DELIMITERS);
- if (error) {
- nm_log_warn (LOGD_SETTINGS, "keyfile: Unexpected character '%c' in '%s.%s' address (position %td of '%s').",
- *error, setting_name, key_name, error - current, current);
- goto error;
- }
- /* get prefix length field (skippable) */
- plen_str = read_field (&current, &error, DIGITS, DELIMITERS);
- /* get gateway field */
- gateway_str = read_field (&current, &error, IP_ADDRESS_CHARS, DELIMITERS);
- if (error) {
- nm_log_warn (LOGD_SETTINGS, "keyfile: Unexpected character '%c' in '%s.%s' %s (position %td of '%s').",
- *error, setting_name, key_name,
- plen_str ? "gateway" : "gateway or prefix length",
- error - current, current);
- goto error;
- }
- /* for routes, get metric */
- if (route) {
- metric_str = read_field (&current, &error, DIGITS, DELIMITERS);
- if (error) {
- nm_log_warn (LOGD_SETTINGS, "keyfile: Unexpected character '%c' in '%s.%s' prefix length (position %td of '%s').",
- *error, setting_name, key_name, error - current, current);
- goto error;
- }
- } else
- metric_str = NULL;
- if (current) {
- /* there is still some data */
- if (*current) {
- /* another field follows */
- nm_log_warn (LOGD_SETTINGS, "keyfile: %s.%s: Garbage at the and of the line: %s",
- setting_name, key_name, current);
- goto error;
- } else {
- /* semicolon at the end of input */
- nm_log_info (LOGD_SETTINGS, "keyfile: %s.%s: Deprecated semicolon at the end of value.",
- setting_name, key_name);
- }
- }
-
- /* parse plen, fallback to defaults */
- if (plen_str)
- g_return_val_if_fail (get_one_int (plen_str, ipv6 ? 128 : 32,
- key_name, &plen), NULL);
- else {
- if (route)
- plen = ipv6 ? 128 : 24;
- else
- plen = ipv6 ? 64 : 24;
- nm_log_warn (LOGD_SETTINGS, "keyfile: Missing prefix length in '%s.%s', defaulting to %d",
- setting_name, key_name, plen);
- }
-
- /* build the appropriate data structure for NetworkManager settings */
- result = (ipv6 ? build_ip6_address_or_route : build_ip4_address_or_route) (
- key_name, address_str, plen, gateway_str, metric_str, route);
-
- g_free (value);
- return result;
-error:
- g_free (value);
- return NULL;
-}
+#include "nm-logging.h"
+#include "nm-keyfile-internal.h"
-static void
-ip_address_or_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
+static const char *
+_fmt_warn (const char *group, NMSetting *setting, const char *property_name, const char *message, char **out_message)
{
- const char *setting_name = nm_setting_get_name (setting);
- gboolean ipv6 = !strcmp (setting_name, "ipv6");
- gboolean routes = !strcmp (key, "routes");
- static const char *key_names_routes[] = { "route", "routes", NULL };
- static const char *key_names_addresses[] = { "address", "addresses", NULL };
- const char **key_names = routes ? key_names_routes : key_names_addresses;
- GPtrArray *list;
- GDestroyNotify free_func;
- int i;
+ const char *setting_name = setting ? nm_setting_get_name (setting) : NULL;
- if (ipv6) {
- if (routes)
- free_func = (GDestroyNotify) nm_ip6_route_unref;
- else
- free_func = (GDestroyNotify) nm_ip6_address_unref;
- } else {
- if (routes)
- free_func = (GDestroyNotify) nm_ip4_route_unref;
- else
- free_func = (GDestroyNotify) nm_ip4_address_unref;
- }
- list = g_ptr_array_new_with_free_func (free_func);
-
- for (i = -1; i < 1000; i++) {
- const char **key_basename;
-
- for (key_basename = key_names; *key_basename; key_basename++) {
- char *key_name;
- gpointer item;
+ if (group) {
+ char *res;
- /* -1 means no suffix */
- if (i >= 0)
- key_name = g_strdup_printf ("%s%d", *key_basename, i);
+ if (setting_name) {
+ if (property_name && !strcmp (group, setting_name))
+ res = g_strdup_printf ("%s.%s: %s", group, property_name, message);
+ else if (property_name)
+ res = g_strdup_printf ("%s/%s.%s: %s", group, setting_name, property_name, message);
+ else if (!strcmp (group, setting_name))
+ res = g_strdup_printf ("%s: %s", group, message);
else
- key_name = g_strdup (*key_basename);
-
- item = read_one_ip_address_or_route (keyfile, setting_name, key_name, ipv6, routes);
-
- if (item)
- g_ptr_array_add (list, item);
-
- g_free (key_name);
- }
- }
-
- if (list->len >= 1)
- g_object_set (setting, key, list, NULL);
-
- g_ptr_array_unref (list);
-}
-
-static void
-ip4_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- const char *setting_name = nm_setting_get_name (setting);
- GPtrArray *array;
- gsize length;
- char **list, **iter;
- int ret;
-
- list = nm_keyfile_plugin_kf_get_string_list (keyfile, setting_name, key, &length, NULL);
- if (!list || !g_strv_length (list))
- return;
-
- array = g_ptr_array_sized_new (length + 1);
- for (iter = list; *iter; iter++) {
- guint32 addr;
-
- ret = inet_pton (AF_INET, *iter, &addr);
- if (ret <= 0) {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid DNS server address '%s'", __func__, *iter);
- continue;
- }
-
- g_ptr_array_add (array, *iter);
- }
- g_ptr_array_add (array, NULL);
-
- g_object_set (setting, key, array->pdata, NULL);
- g_ptr_array_unref (array);
- g_strfreev (list);
-}
-
-static void
-ip6_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- const char *setting_name = nm_setting_get_name (setting);
- GPtrArray *array = NULL;
- gsize length;
- char **list, **iter;
- int ret;
-
- list = nm_keyfile_plugin_kf_get_string_list (keyfile, setting_name, key, &length, NULL);
- if (!list || !g_strv_length (list))
- return;
-
- array = g_ptr_array_sized_new (length + 1);
-
- for (iter = list; *iter; iter++) {
- struct in6_addr addr;
-
- ret = inet_pton (AF_INET6, *iter, &addr);
- if (ret <= 0) {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid DNS server IPv6 address '%s'", __func__, *iter);
- continue;
- }
-
- g_ptr_array_add (array, *iter);
- }
- g_ptr_array_add (array, NULL);
-
- g_object_set (setting, key, array->pdata, NULL);
- g_ptr_array_unref (array);
- g_strfreev (list);
-}
-
-static void
-mac_address_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path, gsize enforce_length)
-{
- const char *setting_name = nm_setting_get_name (setting);
- char *tmp_string = NULL, *p, *mac_str;
- gint *tmp_list;
- GByteArray *array = NULL;
- gsize length;
-
- p = tmp_string = nm_keyfile_plugin_kf_get_string (keyfile, setting_name, key, NULL);
- if (tmp_string && tmp_string[0]) {
- /* Look for enough ':' characters to signify a MAC address */
- guint i = 0;
-
- while (*p) {
- if (*p == ':')
- i++;
- p++;
- }
-
- if (enforce_length == 0 || enforce_length == i+1) {
- /* If we found enough it's probably a string-format MAC address */
- array = g_byte_array_sized_new (i+1);
- g_byte_array_set_size (array, i+1);
- if (!nm_utils_hwaddr_aton (tmp_string, array->data, array->len)) {
- g_byte_array_unref (array);
- array = NULL;
- }
- }
- }
- g_free (tmp_string);
-
- if (array == NULL) {
- /* Old format; list of ints */
- tmp_list = nm_keyfile_plugin_kf_get_integer_list (keyfile, setting_name, key, &length, NULL);
- if (length > 0 && (enforce_length == 0 || enforce_length == length)) {
- gsize i;
-
- array = g_byte_array_sized_new (length);
- for (i = 0; i < length; i++) {
- int val = tmp_list[i];
- const guint8 v = (guint8) (val & 0xFF);
-
- if (val < 0 || val > 255) {
- nm_log_warn (LOGD_SETTINGS, "%s: %s / %s ignoring invalid byte element '%d' (not "
- " between 0 and 255 inclusive)", __func__, setting_name,
- key, val);
- g_byte_array_free (array, TRUE);
- array = NULL;
- break;
- }
- g_byte_array_append (array, &v, 1);
- }
- }
- g_free (tmp_list);
- }
-
- if (!array) {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid MAC address for %s / %s",
- __func__, setting_name, key);
- return;
- }
-
- mac_str = nm_utils_hwaddr_ntoa (array->data, array->len);
- g_object_set (setting, key, mac_str, NULL);
- g_free (mac_str);
- g_byte_array_free (array, TRUE);
-}
-
-static void
-mac_address_parser_ETHER (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- mac_address_parser (setting, key, keyfile, keyfile_path, ETH_ALEN);
-}
-
-static void
-mac_address_parser_INFINIBAND (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- mac_address_parser (setting, key, keyfile, keyfile_path, INFINIBAND_ALEN);
-}
-
-static void
-read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key)
-{
- char **keys, **iter;
- char *value;
- const char *setting_name = nm_setting_get_name (setting);
-
- keys = nm_keyfile_plugin_kf_get_keys (file, setting_name, NULL, NULL);
- if (!keys || !*keys)
- return;
-
- for (iter = keys; *iter; iter++) {
- value = nm_keyfile_plugin_kf_get_string (file, setting_name, *iter, NULL);
- if (!value)
- continue;
-
- if (NM_IS_SETTING_VPN (setting)) {
- /* Add any item that's not a class property to the data hash */
- if (!g_object_class_find_property (G_OBJECT_GET_CLASS (setting), *iter))
- nm_setting_vpn_add_data_item (NM_SETTING_VPN (setting), *iter, value);
- }
- if (NM_IS_SETTING_BOND (setting)) {
- if (strcmp (*iter, "interface-name"))
- nm_setting_bond_add_option (NM_SETTING_BOND (setting), *iter, value);
- }
- g_free (value);
- }
- g_strfreev (keys);
-}
-
-static void
-unescape_semicolons (char *str)
-{
- int i;
- gsize len = strlen (str);
-
- for (i = 0; i < len; i++) {
- if (str[i] == '\\' && str[i+1] == ';') {
- memmove(str + i, str + i + 1, len - (i + 1));
- len--;
- }
- str[len] = '\0';
- }
-}
-
-static GBytes *
-get_bytes (GKeyFile *keyfile,
- const char *setting_name,
- const char *key,
- gboolean zero_terminate,
- gboolean unescape_semicolon)
-{
- GByteArray *array = NULL;
- char *tmp_string;
- gint *tmp_list;
- gsize length;
- int i;
-
- /* New format: just a string
- * Old format: integer list; e.g. 11;25;38;
- */
- tmp_string = nm_keyfile_plugin_kf_get_string (keyfile, setting_name, key, NULL);
- if (tmp_string) {
- GRegex *regex;
- GMatchInfo *match_info;
- const char *pattern = "^[[:space:]]*[[:digit:]]{1,3}[[:space:]]*;([[:space:]]*[[:digit:]]{1,3}[[:space:]]*;)*([[:space:]]*)?$";
-
- regex = g_regex_new (pattern, 0, 0, NULL);
- g_regex_match (regex, tmp_string, 0, &match_info);
- if (!g_match_info_matches (match_info)) {
- /* Handle as a simple string (ie, new format) */
- if (unescape_semicolon)
- unescape_semicolons (tmp_string);
- length = strlen (tmp_string);
- if (zero_terminate)
- length++;
- array = g_byte_array_sized_new (length);
- g_byte_array_append (array, (guint8 *) tmp_string, length);
- }
- g_match_info_free (match_info);
- g_regex_unref (regex);
- g_free (tmp_string);
- }
-
- if (!array) {
- /* Old format; list of ints */
- tmp_list = nm_keyfile_plugin_kf_get_integer_list (keyfile, setting_name, key, &length, NULL);
- array = g_byte_array_sized_new (length);
- for (i = 0; i < length; i++) {
- int val = tmp_list[i];
- unsigned char v = (unsigned char) (val & 0xFF);
-
- if (val < 0 || val > 255) {
- nm_log_warn (LOGD_SETTINGS, "%s: %s / %s ignoring invalid byte element '%d' (not "
- " between 0 and 255 inclusive)", __func__, setting_name,
- key, val);
- } else
- g_byte_array_append (array, (const unsigned char *) &v, sizeof (v));
- }
- g_free (tmp_list);
- }
-
- if (array->len == 0) {
- g_byte_array_free (array, TRUE);
- return NULL;
+ res = g_strdup_printf ("%s/%s: %s", group, setting_name, message);
+ } else
+ res = g_strdup_printf ("%s: %s", group, message);
+ *out_message = res;
+ return res;
} else
- return g_byte_array_free_to_bytes (array);
+ return message;
}
-static void
-ssid_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- const char *setting_name = nm_setting_get_name (setting);
- GBytes *bytes;
-
- bytes = get_bytes (keyfile, setting_name, key, FALSE, TRUE);
- if (bytes) {
- g_object_set (setting, key, bytes, NULL);
- g_bytes_unref (bytes);
- } else {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid SSID for %s / %s",
- __func__, setting_name, key);
- }
-}
-
-static void
-password_raw_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- const char *setting_name = nm_setting_get_name (setting);
- GBytes *bytes;
-
- bytes = get_bytes (keyfile, setting_name, key, FALSE, TRUE);
- if (bytes) {
- g_object_set (setting, key, bytes, NULL);
- g_bytes_unref (bytes);
- } else {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid raw password for %s / %s",
- __func__, setting_name, key);
- }
-}
-
-static char *
-get_cert_path (const char *keyfile_path, const guint8 *cert_path, gsize cert_path_len)
-{
- const char *base;
- char *p = NULL, *path, *dirname, *tmp;
-
- g_return_val_if_fail (keyfile_path != NULL, NULL);
- g_return_val_if_fail (cert_path != NULL, NULL);
-
- base = path = g_malloc0 (cert_path_len + 1);
- memcpy (path, cert_path, cert_path_len);
-
- if (path[0] == '/')
- return path;
-
- p = strrchr (path, '/');
- if (p)
- base = p + 1;
-
- dirname = g_path_get_dirname (keyfile_path);
- tmp = g_build_path ("/", dirname, base, NULL);
- g_free (dirname);
- g_free (path);
- return tmp;
-}
-
-#define SCHEME_PATH "file://"
-
-static const char *certext[] = { ".pem", ".cert", ".crt", ".cer", ".p12", ".der", ".key" };
-
static gboolean
-has_cert_ext (const char *path)
-{
- int i;
-
- for (i = 0; i < G_N_ELEMENTS (certext); i++) {
- if (g_str_has_suffix (path, certext[i]))
- return TRUE;
- }
- return FALSE;
-}
-
-static gboolean
-handle_as_scheme (GBytes *bytes, NMSetting *setting, const char *key)
-{
- const guint8 *data;
- gsize data_len;
-
- data = g_bytes_get_data (bytes, &data_len);
+_handler_read (GKeyFile *keyfile,
+ NMConnection *connection,
+ NMKeyfileReadType type,
+ void *type_data,
+ void *user_data,
+ GError **error)
+{
+ if (type == NM_KEYFILE_READ_TYPE_WARN) {
+ NMKeyfileReadTypeDataWarn *warn_data = type_data;
+ NMLogLevel level;
+ char *message_free = NULL;
+
+ if (warn_data->severity > NM_KEYFILE_WARN_SEVERITY_WARN)
+ level = LOGL_ERR;
+ else if (warn_data->severity >= NM_KEYFILE_WARN_SEVERITY_WARN)
+ level = LOGL_WARN;
+ else if (warn_data->severity == NM_KEYFILE_WARN_SEVERITY_INFO_MISSING_FILE)
+ level = LOGL_WARN;
+ else
+ level = LOGL_INFO;
- /* It's the PATH scheme, can just set plain data */
- if ( (data_len > strlen (SCHEME_PATH))
- && g_str_has_prefix ((const char *) data, SCHEME_PATH)
- && (data[data_len - 1] == '\0')) {
- g_object_set (setting, key, bytes, NULL);
+ nm_log (level, LOGD_SETTINGS, "keyfile: %s",
+ _fmt_warn (warn_data->group, warn_data->setting,
+ warn_data->property_name, warn_data->message,
+ &message_free));
+ g_free (message_free);
return TRUE;
}
return FALSE;
}
-static gboolean
-handle_as_path (GBytes *bytes,
- NMSetting *setting,
- const char *key,
- const char *keyfile_path)
-{
- const guint8 *data;
- gsize data_len;
- gsize validate_len;
- char *path;
- gboolean exists, success = FALSE;
-
- data = g_bytes_get_data (bytes, &data_len);
- if (data_len > 500 || data_len < 1)
- return FALSE;
-
- /* If there's a trailing NULL tell g_utf8_validate() to to until the NULL */
- if (data[data_len - 1] == '\0')
- validate_len = -1;
- else
- validate_len = data_len;
-
- if (g_utf8_validate ((const char *) data, validate_len, NULL) == FALSE)
- return FALSE;
-
- /* Might be a bare path without the file:// prefix; in that case
- * if it's an absolute path, use that, otherwise treat it as a
- * relative path to the current directory.
- */
-
- path = get_cert_path (keyfile_path, data, data_len);
- exists = g_file_test (path, G_FILE_TEST_EXISTS);
- if ( exists
- || memchr (data, '/', data_len)
- || has_cert_ext (path)) {
- GByteArray *tmp;
- GBytes *val;
-
- /* Construct the proper value as required for the PATH scheme */
- tmp = g_byte_array_sized_new (strlen (SCHEME_PATH) + strlen (path) + 1);
- g_byte_array_append (tmp, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH));
- g_byte_array_append (tmp, (const guint8 *) path, strlen (path));
- g_byte_array_append (tmp, (const guint8 *) "\0", 1);
- val = g_byte_array_free_to_bytes (tmp);
- g_object_set (setting, key, val, NULL);
- g_bytes_unref (val);
- success = TRUE;
-
- /* Warn if the certificate didn't exist */
- if (exists == FALSE)
- nm_log_warn (LOGD_SETTINGS, "certificate or key %s does not exist", path);
- }
- g_free (path);
-
- return success;
-}
-
-static void
-cert_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- const char *setting_name = nm_setting_get_name (setting);
- GBytes *bytes;
- gboolean success = FALSE;
-
- bytes = get_bytes (keyfile, setting_name, key, TRUE, FALSE);
- if (bytes) {
- /* Try as a path + scheme (ie, starts with "file://") */
- success = handle_as_scheme (bytes, setting, key);
-
- /* If not, it might be a plain path */
- if (success == FALSE)
- success = handle_as_path (bytes, setting, key, keyfile_path);
-
- /* If neither of those two, assume blob with certificate data */
- if (success == FALSE)
- g_object_set (setting, key, bytes, NULL);
- } else {
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid key/cert value for %s / %s",
- __func__, setting_name, key);
- }
-
- if (bytes)
- g_bytes_unref (bytes);
-}
-
-static void
-parity_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
-{
- const char *setting_name = nm_setting_get_name (setting);
- NMSettingSerialParity parity;
- int int_val;
- char *str_val;
-
- /* Keyfile traditionally stored this as the ASCII value for 'E', 'o', or 'n'.
- * We now accept either that or the (case-insensitive) character itself (but
- * still always write it the old way, for backward compatibility).
- */
- int_val = nm_keyfile_plugin_kf_get_integer (keyfile, setting_name, key, NULL);
- if (!int_val) {
- str_val = nm_keyfile_plugin_kf_get_string (keyfile, setting_name, key, NULL);
- if (str_val) {
- if (str_val[0] && !str_val[1])
- int_val = str_val[0];
- else {
- /* This will hit the warning below */
- int_val = 'X';
- }
- }
- }
-
- if (!int_val)
- return;
-
- switch (int_val) {
- case 'E':
- case 'e':
- parity = NM_SETTING_SERIAL_PARITY_EVEN;
- break;
- case 'O':
- case 'o':
- parity = NM_SETTING_SERIAL_PARITY_ODD;
- break;
- case 'N':
- case 'n':
- parity = NM_SETTING_SERIAL_PARITY_NONE;
- break;
- default:
- nm_log_warn (LOGD_SETTINGS, "%s: ignoring invalid value for %s / %s",
- __func__, setting_name, key);
- return;
- }
-
- g_object_set (setting, key, parity, NULL);
-}
-
-typedef struct {
- const char *setting_name;
- const char *key;
- gboolean check_for_key;
- void (*parser) (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path);
-} KeyParser;
-
-/* A table of keys that require further parsing/conversion because they are
- * stored in a format that can't be automatically read using the key's type.
- * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are
- * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored
- * in struct in6_addr internally, but as string in keyfiles.
- */
-static KeyParser key_parsers[] = {
- { NM_SETTING_CONNECTION_SETTING_NAME,
- NM_SETTING_CONNECTION_TYPE,
- TRUE,
- setting_alias_parser },
- { NM_SETTING_BRIDGE_SETTING_NAME,
- NM_SETTING_BRIDGE_MAC_ADDRESS,
- TRUE,
- mac_address_parser_ETHER },
- { NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ADDRESSES,
- FALSE,
- ip_address_or_route_parser },
- { NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ADDRESSES,
- FALSE,
- ip_address_or_route_parser },
- { NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES,
- FALSE,
- ip_address_or_route_parser },
- { NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ROUTES,
- FALSE,
- ip_address_or_route_parser },
- { NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS,
- FALSE,
- ip4_dns_parser },
- { NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS,
- FALSE,
- ip6_dns_parser },
- { NM_SETTING_WIRED_SETTING_NAME,
- NM_SETTING_WIRED_MAC_ADDRESS,
- TRUE,
- mac_address_parser_ETHER },
- { NM_SETTING_WIRED_SETTING_NAME,
- NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
- TRUE,
- mac_address_parser_ETHER },
- { NM_SETTING_WIRELESS_SETTING_NAME,
- NM_SETTING_WIRELESS_MAC_ADDRESS,
- TRUE,
- mac_address_parser_ETHER },
- { NM_SETTING_WIRELESS_SETTING_NAME,
- NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS,
- TRUE,
- mac_address_parser_ETHER },
- { NM_SETTING_WIRELESS_SETTING_NAME,
- NM_SETTING_WIRELESS_BSSID,
- TRUE,
- mac_address_parser_ETHER },
- { NM_SETTING_BLUETOOTH_SETTING_NAME,
- NM_SETTING_BLUETOOTH_BDADDR,
- TRUE,
- mac_address_parser_ETHER },
- { NM_SETTING_INFINIBAND_SETTING_NAME,
- NM_SETTING_INFINIBAND_MAC_ADDRESS,
- TRUE,
- mac_address_parser_INFINIBAND },
- { NM_SETTING_WIMAX_SETTING_NAME,
- NM_SETTING_WIMAX_MAC_ADDRESS,
- TRUE,
- mac_address_parser_ETHER },
- { NM_SETTING_WIRELESS_SETTING_NAME,
- NM_SETTING_WIRELESS_SSID,
- TRUE,
- ssid_parser },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PASSWORD_RAW,
- TRUE,
- password_raw_parser },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_CA_CERT,
- TRUE,
- cert_parser },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_CLIENT_CERT,
- TRUE,
- cert_parser },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PRIVATE_KEY,
- TRUE,
- cert_parser },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PHASE2_CA_CERT,
- TRUE,
- cert_parser },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
- TRUE,
- cert_parser },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
- TRUE,
- cert_parser },
- { NM_SETTING_SERIAL_SETTING_NAME,
- NM_SETTING_SERIAL_PARITY,
- TRUE,
- parity_parser },
- { NULL, NULL, FALSE }
-};
-
-typedef struct {
- GKeyFile *keyfile;
- const char *keyfile_path;
-} ReadInfo;
-
-static void
-read_one_setting_value (NMSetting *setting,
- const char *key,
- const GValue *value,
- GParamFlags flags,
- gpointer user_data)
-{
- ReadInfo *info = user_data;
- const char *setting_name;
- GType type;
- GError *err = NULL;
- gboolean check_for_key = TRUE;
- KeyParser *parser = &key_parsers[0];
-
- /* Property is not writable */
- if (!(flags & G_PARAM_WRITABLE))
- return;
-
- /* Setting name gets picked up from the keyfile's section name instead */
- if (!strcmp (key, NM_SETTING_NAME))
- return;
-
- /* Don't read the NMSettingConnection object's 'read-only' property */
- if ( NM_IS_SETTING_CONNECTION (setting)
- && !strcmp (key, NM_SETTING_CONNECTION_READ_ONLY))
- return;
-
- setting_name = nm_setting_get_name (setting);
-
- /* Look through the list of handlers for non-standard format key values */
- while (parser->setting_name) {
- if (!strcmp (parser->setting_name, setting_name) && !strcmp (parser->key, key)) {
- check_for_key = parser->check_for_key;
- break;
- }
- parser++;
- }
-
- /* VPN properties don't have the exact key name */
- if (NM_IS_SETTING_VPN (setting))
- check_for_key = FALSE;
-
- /* Bonding 'options' don't have the exact key name. The options are right under [bond] group. */
- if (NM_IS_SETTING_BOND (setting))
- check_for_key = FALSE;
-
- /* Check for the exact key in the GKeyFile if required. Most setting
- * properties map 1:1 to a key in the GKeyFile, but for those properties
- * like IP addresses and routes where more than one value is actually
- * encoded by the setting property, this won't be true.
- */
- if (check_for_key && !nm_keyfile_plugin_kf_has_key (info->keyfile, setting_name, key, &err)) {
- /* Key doesn't exist or an error ocurred, thus nothing to do. */
- if (err) {
- nm_log_warn (LOGD_SETTINGS, "Error loading setting '%s' value: %s", setting_name, err->message);
- g_error_free (err);
- }
- return;
- }
-
- /* If there's a custom parser for this key, handle that before the generic
- * parsers below.
- */
- if (parser->setting_name) {
- (*parser->parser) (setting, key, info->keyfile, info->keyfile_path);
- return;
- }
-
- type = G_VALUE_TYPE (value);
-
- if (type == G_TYPE_STRING) {
- char *str_val;
-
- str_val = nm_keyfile_plugin_kf_get_string (info->keyfile, setting_name, key, NULL);
- g_object_set (setting, key, str_val, NULL);
- g_free (str_val);
- } else if (type == G_TYPE_UINT) {
- int int_val;
-
- int_val = nm_keyfile_plugin_kf_get_integer (info->keyfile, setting_name, key, NULL);
- if (int_val < 0)
- nm_log_warn (LOGD_SETTINGS, "Casting negative value (%i) to uint", int_val);
- g_object_set (setting, key, int_val, NULL);
- } else if (type == G_TYPE_INT) {
- int int_val;
-
- int_val = nm_keyfile_plugin_kf_get_integer (info->keyfile, setting_name, key, NULL);
- g_object_set (setting, key, int_val, NULL);
- } else if (type == G_TYPE_BOOLEAN) {
- gboolean bool_val;
-
- bool_val = nm_keyfile_plugin_kf_get_boolean (info->keyfile, setting_name, key, NULL);
- g_object_set (setting, key, bool_val, NULL);
- } else if (type == G_TYPE_CHAR) {
- int int_val;
-
- int_val = nm_keyfile_plugin_kf_get_integer (info->keyfile, setting_name, key, NULL);
- if (int_val < G_MININT8 || int_val > G_MAXINT8)
- nm_log_warn (LOGD_SETTINGS, "Casting value (%i) to char", int_val);
-
- g_object_set (setting, key, int_val, NULL);
- } else if (type == G_TYPE_UINT64) {
- char *tmp_str;
- guint64 uint_val;
-
- tmp_str = nm_keyfile_plugin_kf_get_value (info->keyfile, setting_name, key, NULL);
- uint_val = g_ascii_strtoull (tmp_str, NULL, 10);
- g_free (tmp_str);
- g_object_set (setting, key, uint_val, NULL);
- } else if (type == G_TYPE_BYTES) {
- gint *tmp;
- GByteArray *array;
- GBytes *bytes;
- gsize length;
- int i;
-
- tmp = nm_keyfile_plugin_kf_get_integer_list (info->keyfile, setting_name, key, &length, NULL);
-
- array = g_byte_array_sized_new (length);
- for (i = 0; i < length; i++) {
- int val = tmp[i];
- unsigned char v = (unsigned char) (val & 0xFF);
-
- if (val < 0 || val > 255) {
- nm_log_warn (LOGD_SETTINGS, "%s: %s / %s ignoring invalid byte element '%d' (not "
- " between 0 and 255 inclusive)", __func__, setting_name,
- key, val);
- } else
- g_byte_array_append (array, (const unsigned char *) &v, sizeof (v));
- }
-
- bytes = g_byte_array_free_to_bytes (array);
- g_object_set (setting, key, bytes, NULL);
- g_bytes_unref (bytes);
- g_free (tmp);
- } else if (type == G_TYPE_STRV) {
- gchar **sa;
- gsize length;
-
- sa = nm_keyfile_plugin_kf_get_string_list (info->keyfile, setting_name, key, &length, NULL);
- g_object_set (setting, key, sa, NULL);
- g_strfreev (sa);
- } else if (type == G_TYPE_HASH_TABLE) {
- read_hash_of_string (info->keyfile, setting, key);
- } else if (type == G_TYPE_ARRAY) {
- if (!read_array_of_uint (info->keyfile, setting, key)) {
- nm_log_warn (LOGD_SETTINGS, "Unhandled setting property type (read): '%s/%s' : '%s'",
- setting_name, key, G_VALUE_TYPE_NAME (value));
- }
- } else if (G_VALUE_HOLDS_FLAGS (value)) {
- guint64 uint_val;
-
- /* Flags are guint but GKeyFile has no uint reader, just uint64 */
- uint_val = nm_keyfile_plugin_kf_get_uint64 (info->keyfile, setting_name, key, &err);
- if (!err) {
- if (uint_val <= G_MAXUINT)
- g_object_set (setting, key, (guint) uint_val, NULL);
- else {
- nm_log_warn (LOGD_SETTINGS, "Too large FLAGS property (read): '%s/%s' : '%s'",
- setting_name, key, G_VALUE_TYPE_NAME (value));
- }
- }
- g_clear_error (&err);
- } else if (G_VALUE_HOLDS_ENUM (value)) {
- gint int_val;
-
- int_val = nm_keyfile_plugin_kf_get_integer (info->keyfile, setting_name, key, &err);
- if (!err)
- g_object_set (setting, key, (gint) int_val, NULL);
- g_clear_error (&err);
- } else {
- nm_log_warn (LOGD_SETTINGS, "Unhandled setting property type (read): '%s/%s' : '%s'",
- setting_name, key, G_VALUE_TYPE_NAME (value));
- }
-}
-
-static NMSetting *
-read_setting (GKeyFile *file, const char *keyfile_path, const char *group)
-{
- NMSetting *setting = NULL;
- ReadInfo info = { file, keyfile_path };
- const char *alias;
- GType type;
-
- alias = nm_keyfile_plugin_get_setting_name_for_alias (group);
- if (alias)
- group = alias;
-
- type = nm_setting_lookup_type (group);
- if (type) {
- setting = g_object_new (type, NULL);
- nm_setting_enumerate_values (setting, read_one_setting_value, &info);
- } else
- nm_log_warn (LOGD_SETTINGS, "Invalid setting name '%s'", group);
-
- return setting;
-}
-
-static void
-read_vpn_secrets (GKeyFile *file, NMSettingVpn *s_vpn)
-{
- char **keys, **iter;
-
- keys = nm_keyfile_plugin_kf_get_keys (file, VPN_SECRETS_GROUP, NULL, NULL);
- for (iter = keys; *iter; iter++) {
- char *secret;
-
- secret = nm_keyfile_plugin_kf_get_string (file, VPN_SECRETS_GROUP, *iter, NULL);
- if (secret) {
- nm_setting_vpn_add_secret (s_vpn, *iter, secret);
- g_free (secret);
- }
- }
- g_strfreev (keys);
-}
-
NMConnection *
nm_keyfile_plugin_connection_from_file (const char *filename, GError **error)
{
@@ -1281,12 +92,6 @@ nm_keyfile_plugin_connection_from_file (const char *filename, GError **error)
struct stat statbuf;
gboolean bad_permissions;
NMConnection *connection = NULL;
- NMSettingConnection *s_con;
- NMSetting *setting;
- gchar **groups;
- gsize length;
- int i;
- gboolean vpn_secrets = FALSE;
GError *verify_error = NULL;
if (stat (filename, &statbuf) != 0 || !S_ISREG (statbuf.st_mode)) {
@@ -1308,77 +113,14 @@ nm_keyfile_plugin_connection_from_file (const char *filename, GError **error)
if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, error))
goto out;
- connection = nm_simple_connection_new ();
-
- groups = g_key_file_get_groups (key_file, &length);
- for (i = 0; i < length; i++) {
- /* Only read out secrets when needed */
- if (!strcmp (groups[i], VPN_SECRETS_GROUP)) {
- vpn_secrets = TRUE;
- continue;
- }
-
- setting = read_setting (key_file, filename, groups[i]);
- if (setting)
- nm_connection_add_setting (connection, setting);
- }
-
- s_con = nm_connection_get_setting_connection (connection);
- if (!s_con) {
- s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
- nm_connection_add_setting (connection, NM_SETTING (s_con));
- }
-
- /* Make sure that we have 'id' even if not explictly specified in the keyfile */
- if (!nm_setting_connection_get_id (s_con)) {
- char *base_name;
-
- base_name = g_path_get_basename (filename);
- g_object_set (s_con, NM_SETTING_CONNECTION_ID, base_name, NULL);
- g_free (base_name);
- }
-
- /* Make sure that we have 'uuid' even if not explictly specified in the keyfile */
- if (!nm_setting_connection_get_uuid (s_con)) {
- char *hashed_uuid;
-
- hashed_uuid = nm_utils_uuid_generate_from_string (filename);
- g_object_set (s_con, NM_SETTING_CONNECTION_UUID, hashed_uuid, NULL);
- g_free (hashed_uuid);
- }
-
- /* Make sure that we have 'interface-name' even if it was specified in the
- * "wrong" (ie, deprecated) group.
- */
- if ( !nm_setting_connection_get_interface_name (s_con)
- && nm_setting_connection_get_connection_type (s_con)) {
- char *interface_name;
-
- interface_name = g_key_file_get_string (key_file,
- nm_setting_connection_get_connection_type (s_con),
- "interface-name",
- NULL);
- if (interface_name) {
- g_object_set (s_con, NM_SETTING_CONNECTION_INTERFACE_NAME, interface_name, NULL);
- g_free (interface_name);
- }
- }
-
- /* Handle vpn secrets after the 'vpn' setting was read */
- if (vpn_secrets) {
- NMSettingVpn *s_vpn;
-
- s_vpn = nm_connection_get_setting_vpn (connection);
- if (s_vpn)
- read_vpn_secrets (key_file, s_vpn);
- }
-
- g_strfreev (groups);
+ connection = nm_keyfile_read (key_file, filename, NULL, _handler_read, NULL, error);
+ if (!connection)
+ goto out;
/* Normalize and verify the connection */
if (!nm_connection_normalize (connection, NULL, NULL, &verify_error)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "invalid connection: %s",
+ "invalid connection: %s",
verify_error->message);
g_clear_error (&verify_error);
g_object_unref (connection);
@@ -1389,3 +131,4 @@ out:
g_key_file_free (key_file);
return connection;
}
+
diff --git a/src/settings/plugins/keyfile/tests/Makefile.am b/src/settings/plugins/keyfile/tests/Makefile.am
index 20b9820c9e..a79e20b5b6 100644
--- a/src/settings/plugins/keyfile/tests/Makefile.am
+++ b/src/settings/plugins/keyfile/tests/Makefile.am
@@ -34,6 +34,7 @@ test_keyfile_LDADD = \
$(DBUS_LIBS) \
$(CODE_COVERAGE_LDFLAGS)
+@VALGRIND_RULES@
TESTS = test-keyfile
endif
diff --git a/src/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Main b/src/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Main
index 7fbbfe2296..fc9fd8f81f 100644
--- a/src/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Main
+++ b/src/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Main
@@ -6,11 +6,12 @@ type=bridge
[bridge]
interface-name=br0
stp=true
-forward-delay=0
+forward-delay=2
priority=32744
hello-time=7
max-age=39
ageing-time=235352
+multicast-snooping=false
[ipv4]
method=auto
diff --git a/src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Blob b/src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Blob
index 9f4ef62fd4..62e6ae31fd 100644
--- a/src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Blob
+++ b/src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Blob
@@ -8,8 +8,8 @@ type=802-3-ethernet
eap=tls;
identity=Bill Smith
ca-cert=48;130;2;52;48;130;1;161;2;16;2;173;102;126;78;69;254;94;87;111;60;152;25;94;221;192;48;13;6;9;42;134;72;134;247;13;1;1;2;5;0;48;95;49;11;48;9;6;3;85;4;6;19;2;85;83;49;32;48;30;6;3;85;4;10;19;23;82;83;65;32;68;97;116;97;32;83;101;99;117;114;105;116;121;44;32;73;110;99;46;49;46;48;44;6;3;85;4;11;19;37;83;101;99;117;114;101;32;83;101;114;118;101;114;32;67;101;114;116;105;102;105;99;97;116;105;111;110;32;65;117;116;104;111;114;105;116;121;48;30;23;13;57;52;49;49;48;57;48;48;48;48;48;48;90;23;13;49;48;48;49;48;55;50;51;53;57;53;57;90;48;95;49;11;48;9;6;3;85;4;6;19;2;85;83;49;32;48;30;6;3;85;4;10;19;23;82;83;65;32;68;97;116;97;32;83;101;99;117;114;105;116;121;44;32;73;110;99;46;49;46;48;44;6;3;85;4;11;19;37;83;101;99;117;114;101;32;83;101;114;118;101;114;32;67;101;114;116;105;102;105;99;97;116;105;111;110;32;65;117;116;104;111;114;105;116;121;48;129;155;48;13;6;9;42;134;72;134;247;13;1;1;1;5;0;3;129;137;0;48;129;133;2;126;0;146;206;122;193;174;131;62;90;170;137;131;87;172;37;1;118;12;173;174;142;44;55;206;235;53;120;100;84;3;229;132;64;81;201;191;143;8;226;138;130;8;210;22;134;55;85;233;177;33;2;173;118;104;129;154;5;162;75;201;75;37;102;34;86;108;136;7;143;247;129;89;109;132;7;101;112;19;113;118;62;155;119;76;227;80;137;86;152;72;185;29;167;41;26;19;46;74;17;89;156;30;21;213;73;84;44;115;58;105;130;177;151;57;156;109;112;103;72;229;221;45;214;200;30;123;2;3;1;0;1;48;13;6;9;42;134;72;134;247;13;1;1;2;5;0;3;126;0;101;221;126;225;178;236;176;226;58;224;236;113;70;154;25;17;184;211;199;160;180;3;64;38;2;62;9;156;225;18;179;209;90;246;55;165;183;97;3;182;91;22;105;59;198;68;8;12;136;83;12;107;151;73;199;62;53;220;108;185;187;170;223;92;187;58;47;147;96;182;169;75;77;242;32;247;205;95;127;100;123;142;220;0;92;215;250;119;202;57;22;89;111;14;234;211;181;131;127;77;77;66;86;118;180;201;95;4;248;56;248;235;210;95;117;95;205;123;252;229;142;128;124;252;80;
-client-cert=102;105;108;101;58;47;47;47;104;111;109;101;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;
-private-key=102;105;108;101;58;47;47;47;104;111;109;101;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;
+client-cert=102;105;108;101;58;47;47;47;67;65;83;65;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;
+private-key=102;105;108;101;58;47;47;47;67;65;83;65;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;
private-key-password=12345testing
[ipv4]
diff --git a/src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Old b/src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Old
index 61afdd91c8..d3da598c81 100644
--- a/src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Old
+++ b/src/settings/plugins/keyfile/tests/keyfiles/Test_Wired_TLS_Old
@@ -7,9 +7,9 @@ type=802-3-ethernet
[802-1x]
eap=tls;
identity=Bill Smith
-ca-cert=102;105;108;101;58;47;47;47;104;111;109;101;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;67;65;47;101;97;112;116;101;115;116;95;99;97;95;99;101;114;116;46;112;101;109;0;
-client-cert=102;105;108;101;58;47;47;47;104;111;109;101;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;
-private-key=102;105;108;101;58;47;47;47;104;111;109;101;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;
+ca-cert=102;105;108;101;58;47;47;47;67;65;83;65;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;67;65;47;101;97;112;116;101;115;116;95;99;97;95;99;101;114;116;46;112;101;109;0;
+client-cert=102;105;108;101;58;47;47;47;67;65;83;65;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;
+private-key=102;105;108;101;58;47;47;47;67;65;83;65;47;100;99;98;119;47;68;101;115;107;116;111;112;47;99;101;114;116;105;110;102;114;97;47;99;108;105;101;110;116;46;112;101;109;0;
private-key-password=12345testing
[ipv4]
diff --git a/src/settings/plugins/keyfile/tests/test-keyfile.c b/src/settings/plugins/keyfile/tests/test-keyfile.c
index e37f7c8a90..a86bfed6c2 100644
--- a/src/settings/plugins/keyfile/tests/test-keyfile.c
+++ b/src/settings/plugins/keyfile/tests/test-keyfile.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 - 2014 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
@@ -31,6 +33,7 @@
#include "reader.h"
#include "writer.h"
+#include "utils.h"
#include "nm-test-utils.h"
@@ -38,69 +41,26 @@
#define TEST_WIRELESS_FILE TEST_KEYFILES_DIR"/Test_Wireless_Connection"
static void
-check_ip4_address (NMSettingIP4Config *config, int idx, const char *address_str, int plen, const char *gateway_str)
+check_ip_address (NMSettingIPConfig *config, int idx, const char *address, int plen)
{
- NMIP4Address *ip4 = nm_setting_ip4_config_get_address (config, idx);
- guint32 address, gateway;
-
- g_assert (inet_pton (AF_INET, address_str, &address) == 1);
- g_assert (inet_pton (AF_INET, gateway_str, &gateway) == 1);
+ NMIPAddress *ip4 = nm_setting_ip_config_get_address (config, idx);
g_assert (ip4);
- g_assert (nm_ip4_address_get_address (ip4) == address);
- g_assert (nm_ip4_address_get_prefix (ip4) == plen);
- g_assert (nm_ip4_address_get_gateway (ip4) == gateway);
+ g_assert_cmpstr (nm_ip_address_get_address (ip4), ==, address);
+ g_assert_cmpint (nm_ip_address_get_prefix (ip4), ==, plen);
}
static void
-check_ip6_address (NMSettingIP6Config *config, int idx, const char *address_str, int plen, const char *gateway_str)
+check_ip_route (NMSettingIPConfig *config, int idx, const char *destination, int plen,
+ const char *next_hop, gint64 metric)
{
- NMIP6Address *ip6 = nm_setting_ip6_config_get_address (config, idx);
- struct in6_addr address;
- struct in6_addr gateway;
-
- g_assert (inet_pton (AF_INET6, address_str, &address) == 1);
- g_assert (inet_pton (AF_INET6, gateway_str, &gateway) == 1);
-
- g_assert (ip6);
- g_assert (!memcmp (nm_ip6_address_get_address (ip6), &address, sizeof(address)));
- g_assert (nm_ip6_address_get_prefix (ip6) == plen);
- g_assert (!memcmp (nm_ip6_address_get_gateway (ip6), &gateway, sizeof(gateway)));
-}
-
-static void
-check_ip4_route (NMSettingIP4Config *config, int idx, const char *destination_str, int plen,
- const char *nexthop_str, int metric)
-{
- NMIP4Route *route = nm_setting_ip4_config_get_route (config, idx);
- guint32 destination, nexthop;
-
- g_assert (inet_pton (AF_INET, destination_str, &destination) == 1);
- g_assert (inet_pton (AF_INET, nexthop_str, &nexthop) == 1);
+ NMIPRoute *route = nm_setting_ip_config_get_route (config, idx);
g_assert (route);
- g_assert (nm_ip4_route_get_dest (route) == destination);
- g_assert (nm_ip4_route_get_prefix (route) == plen);
- g_assert (nm_ip4_route_get_next_hop (route) == nexthop);
- g_assert (nm_ip4_route_get_metric (route) == metric);
-}
-
-static void
-check_ip6_route (NMSettingIP6Config *config, int idx, const char *destination_str, int plen,
- const char *next_hop_str, int metric)
-{
- NMIP6Route *route = nm_setting_ip6_config_get_route (config, idx);
- struct in6_addr destination;
- struct in6_addr next_hop;
-
- g_assert (inet_pton (AF_INET6, destination_str, &destination) == 1);
- g_assert (inet_pton (AF_INET6, next_hop_str, &next_hop) == 1);
-
- g_assert (route);
- g_assert (!memcmp (nm_ip6_route_get_dest (route), &destination, sizeof(destination)));
- g_assert (nm_ip6_route_get_prefix (route) == plen);
- g_assert (!memcmp (nm_ip6_route_get_next_hop (route), &next_hop, sizeof(next_hop)));
- g_assert (nm_ip6_route_get_metric (route) == metric);
+ g_assert_cmpstr (nm_ip_route_get_dest (route), ==, destination);
+ g_assert_cmpint (nm_ip_route_get_prefix (route), ==, plen);
+ g_assert_cmpstr (nm_ip_route_get_next_hop (route), ==, next_hop);
+ g_assert_cmpint (nm_ip_route_get_metric (route), ==, metric);
}
static NMConnection *
@@ -125,8 +85,8 @@ test_read_valid_wired_connection (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
GError *error = NULL;
const char *mac;
char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 };
@@ -140,33 +100,33 @@ test_read_valid_wired_connection (void)
const char *expected6_dnssearch3 = "gnu.org";
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv4.addresses1*semicolon at the end*");
+ "*ipv4.addresses:*semicolon at the end*addresses1*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv4.addresses2*semicolon at the end*");
+ "*ipv4.addresses:*semicolon at the end*addresses2*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
- "*Missing prefix length*ipv4.address4*");
+ "*missing prefix length*address4*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
- "*Missing prefix length*ipv4.address5*");
+ "*missing prefix length*address5*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv4.routes2*semicolon at the end*");
+ "*ipv4.routes*semicolon at the end*routes2*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv4.routes3*semicolon at the end*");
+ "*ipv4.routes*semicolon at the end*routes3*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv4.routes5*semicolon at the end*");
+ "*ipv4.routes*semicolon at the end*routes5*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv4.routes8*semicolon at the end*");
+ "*ipv4.routes*semicolon at the end*routes8*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
- "*Missing prefix length*ipv6.address4*");
+ "*missing prefix length*address4*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv6.address5*semicolon at the end*");
+ "*ipv6.address*semicolon at the end*address5*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
- "*Missing prefix length*ipv6.address5*");
+ "*missing prefix length*address5*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv6.address7*semicolon at the end*");
+ "*ipv6.address*semicolon at the end*address7*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv6.routes1*semicolon at the end*");
+ "*ipv6.routes*semicolon at the end*routes1*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv6.route6*semicolon at the end*");
+ "*ipv6.route*semicolon at the end*route6*");
connection = nm_keyfile_plugin_connection_from_file (TEST_WIRED_FILE, NULL);
g_test_assert_expected_messages ();
ASSERT (connection != NULL,
@@ -260,55 +220,62 @@ test_read_valid_wired_connection (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRED_FILE,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* DNS Addresses */
- ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip4) == 2,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRED_FILE,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip4_config_get_dns (s_ip4, 0), "4.2.2.1") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip4, 0), "4.2.2.1") == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #1",
TEST_WIRED_FILE,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip4_config_get_dns (s_ip4, 1), "4.2.2.2") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip4, 1), "4.2.2.2") == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #2",
TEST_WIRED_FILE,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
/* IPv4 addresses */
- g_assert (nm_setting_ip4_config_get_num_addresses (s_ip4) == 6);
- check_ip4_address (s_ip4, 0, "2.3.4.5", 24, "2.3.4.6");
- check_ip4_address (s_ip4, 1, "192.168.0.5", 24, "192.168.0.1");
- check_ip4_address (s_ip4, 2, "1.2.3.4", 16, "1.2.1.1");
- check_ip4_address (s_ip4, 3, "3.4.5.6", 16, "0.0.0.0");
- check_ip4_address (s_ip4, 4, "4.5.6.7", 24, "1.2.3.4");
- check_ip4_address (s_ip4, 5, "5.6.7.8", 24, "0.0.0.0");
+ g_assert (nm_setting_ip_config_get_num_addresses (s_ip4) == 6);
+ check_ip_address (s_ip4, 0, "2.3.4.5", 24);
+ check_ip_address (s_ip4, 1, "192.168.0.5", 24);
+ check_ip_address (s_ip4, 2, "1.2.3.4", 16);
+ check_ip_address (s_ip4, 3, "3.4.5.6", 16);
+ check_ip_address (s_ip4, 4, "4.5.6.7", 24);
+ check_ip_address (s_ip4, 5, "5.6.7.8", 24);
+
+ /* IPv4 gateway */
+ ASSERT (strcmp (nm_setting_ip_config_get_gateway (s_ip4), "2.3.4.6") == 0,
+ "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
+ TEST_WIRED_FILE,
+ NM_SETTING_IP4_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_GATEWAY);
/* IPv4 routes */
- g_assert (nm_setting_ip4_config_get_num_routes (s_ip4) == 12);
- check_ip4_route (s_ip4, 0, "5.6.7.8", 32, "0.0.0.0", 0);
- check_ip4_route (s_ip4, 1, "1.2.3.0", 24, "2.3.4.8", 99);
- check_ip4_route (s_ip4, 2, "1.1.1.2", 12, "0.0.0.0", 0);
- check_ip4_route (s_ip4, 3, "1.1.1.3", 13, "0.0.0.0", 0);
- check_ip4_route (s_ip4, 4, "1.1.1.4", 14, "2.2.2.4", 0);
- check_ip4_route (s_ip4, 5, "1.1.1.5", 15, "2.2.2.5", 0);
- check_ip4_route (s_ip4, 6, "1.1.1.6", 16, "2.2.2.6", 0);
- check_ip4_route (s_ip4, 7, "1.1.1.7", 17, "0.0.0.0", 0);
- check_ip4_route (s_ip4, 8, "1.1.1.8", 18, "0.0.0.0", 0);
- check_ip4_route (s_ip4, 9, "1.1.1.9", 19, "0.0.0.0", 0);
- check_ip4_route (s_ip4, 10, "1.1.1.10", 20, "0.0.0.0", 0);
- check_ip4_route (s_ip4, 11, "1.1.1.11", 21, "0.0.0.0", 21);
+ g_assert (nm_setting_ip_config_get_num_routes (s_ip4) == 12);
+ check_ip_route (s_ip4, 0, "5.6.7.8", 32, NULL, -1);
+ check_ip_route (s_ip4, 1, "1.2.3.0", 24, "2.3.4.8", 99);
+ check_ip_route (s_ip4, 2, "1.1.1.2", 12, NULL, -1);
+ check_ip_route (s_ip4, 3, "1.1.1.3", 13, NULL, -1);
+ check_ip_route (s_ip4, 4, "1.1.1.4", 14, "2.2.2.4", -1);
+ check_ip_route (s_ip4, 5, "1.1.1.5", 15, "2.2.2.5", -1);
+ check_ip_route (s_ip4, 6, "1.1.1.6", 16, "2.2.2.6", -1);
+ check_ip_route (s_ip4, 7, "1.1.1.7", 17, NULL, -1);
+ check_ip_route (s_ip4, 8, "1.1.1.8", 18, NULL, -1);
+ check_ip_route (s_ip4, 9, "1.1.1.9", 19, NULL, -1);
+ check_ip_route (s_ip4, 10, "1.1.1.10", 20, NULL, -1);
+ check_ip_route (s_ip4, 11, "1.1.1.11", 21, NULL, 21);
/* ===== IPv6 SETTING ===== */
@@ -319,172 +286,118 @@ test_read_valid_wired_connection (void)
NM_SETTING_IP6_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip6_config_get_method (s_ip6);
+ tmp = nm_setting_ip_config_get_method (s_ip6);
ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRED_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* DNS Addresses */
- ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 2,
+ ASSERT (nm_setting_ip_config_get_num_dns (s_ip6) == 2,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRED_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip6_config_get_dns (s_ip6, 0), "1111:dddd::aaaa") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip6, 0), "1111:dddd::aaaa") == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #1",
TEST_WIRED_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
- ASSERT (strcmp (nm_setting_ip6_config_get_dns (s_ip6, 1), "1::cafe") == 0,
+ ASSERT (strcmp (nm_setting_ip_config_get_dns (s_ip6, 1), "1::cafe") == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #2",
TEST_WIRED_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
/* DNS Searches */
- ASSERT (nm_setting_ip6_config_get_num_dns_searches (s_ip6) == 3,
+ ASSERT (nm_setting_ip_config_get_num_dns_searches (s_ip6) == 3,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRED_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
- ASSERT (!strcmp (nm_setting_ip6_config_get_dns_search (s_ip6, 0), expected6_dnssearch1),
+ ASSERT (!strcmp (nm_setting_ip_config_get_dns_search (s_ip6, 0), expected6_dnssearch1),
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #1",
TEST_WIRED_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
- ASSERT (!strcmp (nm_setting_ip6_config_get_dns_search (s_ip6, 1), expected6_dnssearch2),
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
+ ASSERT (!strcmp (nm_setting_ip_config_get_dns_search (s_ip6, 1), expected6_dnssearch2),
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #2",
TEST_WIRED_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
- ASSERT (!strcmp (nm_setting_ip6_config_get_dns_search (s_ip6, 2), expected6_dnssearch3),
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
+ ASSERT (!strcmp (nm_setting_ip_config_get_dns_search (s_ip6, 2), expected6_dnssearch3),
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #3",
TEST_WIRED_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ NM_SETTING_IP_CONFIG_DNS_SEARCH);
/* IPv6 addresses */
- g_assert (nm_setting_ip6_config_get_num_addresses (s_ip6) == 10);
- check_ip6_address (s_ip6, 0, "2:3:4:5:6:7:8:9", 64, "2:3:4:5:1:2:3:4");
- check_ip6_address (s_ip6, 1, "abcd:1234:ffff::cdde", 64, "::");
- check_ip6_address (s_ip6, 2, "1:2:3:4:5:6:7:8", 96, "::");
- check_ip6_address (s_ip6, 3, "3:4:5:6:7:8:9:0", 128, "::");
- check_ip6_address (s_ip6, 4, "3:4:5:6:7:8:9:14", 64, "::");
- check_ip6_address (s_ip6, 5, "3:4:5:6:7:8:9:15", 64, "::");
- check_ip6_address (s_ip6, 6, "3:4:5:6:7:8:9:16", 66, "::");
- check_ip6_address (s_ip6, 7, "3:4:5:6:7:8:9:17", 67, "::");
- check_ip6_address (s_ip6, 8, "3:4:5:6:7:8:9:18", 68, "::");
- check_ip6_address (s_ip6, 9, "3:4:5:6:7:8:9:19", 69, "1::09");
+ g_assert (nm_setting_ip_config_get_num_addresses (s_ip6) == 10);
+ check_ip_address (s_ip6, 0, "2:3:4:5:6:7:8:9", 64);
+ check_ip_address (s_ip6, 1, "abcd:1234:ffff::cdde", 64);
+ check_ip_address (s_ip6, 2, "1:2:3:4:5:6:7:8", 96);
+ check_ip_address (s_ip6, 3, "3:4:5:6:7:8:9:0", 128);
+ check_ip_address (s_ip6, 4, "3:4:5:6:7:8:9:14", 64);
+ check_ip_address (s_ip6, 5, "3:4:5:6:7:8:9:15", 64);
+ check_ip_address (s_ip6, 6, "3:4:5:6:7:8:9:16", 66);
+ check_ip_address (s_ip6, 7, "3:4:5:6:7:8:9:17", 67);
+ check_ip_address (s_ip6, 8, "3:4:5:6:7:8:9:18", 68);
+ check_ip_address (s_ip6, 9, "3:4:5:6:7:8:9:19", 69);
+
+ /* IPv6 gateway */
+ ASSERT (strcmp (nm_setting_ip_config_get_gateway (s_ip6), "2:3:4:5:1:2:3:4") == 0,
+ "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
+ TEST_WIRED_FILE,
+ NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_GATEWAY);
/* Route #1 */
- g_assert (nm_setting_ip6_config_get_num_routes (s_ip6) == 7);
- check_ip6_route (s_ip6, 0, "d:e:f:0:1:2:3:4", 64, "f:e:d:c:1:2:3:4", 0);
- check_ip6_route (s_ip6, 1, "a:b:c:d::", 64, "f:e:d:c:1:2:3:4", 99);
- check_ip6_route (s_ip6, 2, "8:7:6:5:4:3:2:1", 128, "::", 0);
- check_ip6_route (s_ip6, 3, "6:7:8:9:0:1:2:3", 126, "::", 1);
- check_ip6_route (s_ip6, 4, "7:8:9:0:1:2:3:4", 125, "::", 5);
- check_ip6_route (s_ip6, 5, "8:9:0:1:2:3:4:5", 124, "::", 6);
- check_ip6_route (s_ip6, 6, "8:9:0:1:2:3:4:6", 123, "::", 0);
+ g_assert (nm_setting_ip_config_get_num_routes (s_ip6) == 7);
+ check_ip_route (s_ip6, 0, "d:e:f:0:1:2:3:4", 64, "f:e:d:c:1:2:3:4", -1);
+ check_ip_route (s_ip6, 1, "a:b:c:d::", 64, "f:e:d:c:1:2:3:4", 99);
+ check_ip_route (s_ip6, 2, "8:7:6:5:4:3:2:1", 128, NULL, -1);
+ check_ip_route (s_ip6, 3, "6:7:8:9:0:1:2:3", 126, NULL, 1);
+ check_ip_route (s_ip6, 4, "7:8:9:0:1:2:3:4", 125, NULL, 5);
+ check_ip_route (s_ip6, 5, "8:9:0:1:2:3:4:5", 124, NULL, 6);
+ check_ip_route (s_ip6, 6, "8:9:0:1:2:3:4:6", 123, NULL, -1);
g_object_unref (connection);
}
static void
-add_one_ip4_address (NMSettingIP4Config *s_ip4,
- const char *addr,
- const char *gw,
- guint32 prefix)
+add_one_ip_address (NMSettingIPConfig *s_ip,
+ const char *addr,
+ guint32 prefix)
{
- guint32 tmp;
- NMIP4Address *ip4_addr;
-
- ip4_addr = nm_ip4_address_new ();
- nm_ip4_address_set_prefix (ip4_addr, prefix);
-
- inet_pton (AF_INET, addr, &tmp);
- nm_ip4_address_set_address (ip4_addr, tmp);
-
- inet_pton (AF_INET, gw, &tmp);
- nm_ip4_address_set_gateway (ip4_addr, tmp);
-
- nm_setting_ip4_config_add_address (s_ip4, ip4_addr);
- nm_ip4_address_unref (ip4_addr);
-}
-
-static void
-add_one_ip4_route (NMSettingIP4Config *s_ip4,
- const char *dest,
- const char *nh,
- guint32 prefix,
- guint32 metric)
-{
- guint32 addr;
- NMIP4Route *route;
-
- route = nm_ip4_route_new ();
- nm_ip4_route_set_prefix (route, prefix);
- nm_ip4_route_set_metric (route, metric);
-
- inet_pton (AF_INET, dest, &addr);
- nm_ip4_route_set_dest (route, addr);
-
- inet_pton (AF_INET, nh, &addr);
- nm_ip4_route_set_next_hop (route, addr);
-
- nm_setting_ip4_config_add_route (s_ip4, route);
- nm_ip4_route_unref (route);
-}
-
-static void
-add_one_ip6_address (NMSettingIP6Config *s_ip6,
- const char *addr,
- guint32 prefix,
- const char *gw)
-{
- struct in6_addr tmp;
- NMIP6Address *ip6_addr;
-
- ip6_addr = nm_ip6_address_new ();
- nm_ip6_address_set_prefix (ip6_addr, prefix);
-
- inet_pton (AF_INET6, addr, &tmp);
- nm_ip6_address_set_address (ip6_addr, &tmp);
-
- if (gw) {
- inet_pton (AF_INET6, gw, &tmp);
- nm_ip6_address_set_gateway (ip6_addr, &tmp);
- }
+ NMIPAddress *ip_addr;
+ GError *error = NULL;
- nm_setting_ip6_config_add_address (s_ip6, ip6_addr);
- nm_ip6_address_unref (ip6_addr);
+ ip_addr = nm_ip_address_new (NM_IS_SETTING_IP4_CONFIG (s_ip) ? AF_INET : AF_INET6,
+ addr, prefix, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip, ip_addr);
+ nm_ip_address_unref (ip_addr);
}
static void
-add_one_ip6_route (NMSettingIP6Config *s_ip6,
- const char *dest,
- const char *nh,
- guint32 prefix,
- guint32 metric)
+add_one_ip_route (NMSettingIPConfig *s_ip,
+ const char *dest,
+ const char *nh,
+ guint32 prefix,
+ gint64 metric)
{
- struct in6_addr addr;
- NMIP6Route *route;
-
- route = nm_ip6_route_new ();
- nm_ip6_route_set_prefix (route, prefix);
- nm_ip6_route_set_metric (route, metric);
-
- inet_pton (AF_INET6, dest, &addr);
- nm_ip6_route_set_dest (route, &addr);
-
- inet_pton (AF_INET6, nh, &addr);
- nm_ip6_route_set_next_hop (route, &addr);
+ NMIPRoute *route;
+ GError *error = NULL;
- nm_setting_ip6_config_add_route (s_ip6, route);
- nm_ip6_route_unref (route);
+ g_assert (prefix > 0);
+ route = nm_ip_route_new (NM_IS_SETTING_IP4_CONFIG (s_ip) ? AF_INET : AF_INET6,
+ dest, prefix, nh, metric, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_route (s_ip, route);
+ nm_ip_route_unref (route);
}
@@ -494,8 +407,8 @@ test_write_wired_connection (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
const char *mac = "99:88:77:66:55:44";
gboolean success;
@@ -507,17 +420,16 @@ test_write_wired_connection (void)
const char *dns1 = "4.2.2.1";
const char *dns2 = "4.2.2.2";
const char *address1 = "192.168.0.5";
- const char *address1_gw = "192.168.0.1";
const char *address2 = "1.2.3.4";
- const char *address2_gw = "1.2.1.1";
+ const char *gw = "192.168.0.1";
const char *route1 = "10.10.10.2";
const char *route1_nh = "10.10.10.1";
const char *route2 = "1.1.1.1";
const char *route2_nh = "1.2.1.1";
const char *route3 = "2.2.2.2";
- const char *route3_nh = "0.0.0.0";
+ const char *route3_nh = NULL;
const char *route4 = "3.3.3.3";
- const char *route4_nh = "0.0.0.0";
+ const char *route4_nh = NULL;
const char *dns6_1 = "1::cafe";
const char *dns6_2 = "2::cafe";
const char *address6_1 = "abcd::beef";
@@ -561,52 +473,53 @@ test_write_wired_connection (void)
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, gw,
NULL);
/* Addresses */
- add_one_ip4_address (s_ip4, address1, address1_gw, 24);
- add_one_ip4_address (s_ip4, address2, address2_gw, 8);
+ add_one_ip_address (s_ip4, address1, 24);
+ add_one_ip_address (s_ip4, address2, 8);
/* Routes */
- add_one_ip4_route (s_ip4, route1, route1_nh, 24, 3);
- add_one_ip4_route (s_ip4, route2, route2_nh, 8, 1);
- add_one_ip4_route (s_ip4, route3, route3_nh, 7, 0);
- add_one_ip4_route (s_ip4, route4, route4_nh, 6, 4);
+ add_one_ip_route (s_ip4, route1, route1_nh, 24, 3);
+ add_one_ip_route (s_ip4, route2, route2_nh, 8, 1);
+ add_one_ip_route (s_ip4, route3, route3_nh, 7, -1);
+ add_one_ip_route (s_ip4, route4, route4_nh, 6, 4);
/* DNS servers */
- nm_setting_ip4_config_add_dns (s_ip4, dns1);
- nm_setting_ip4_config_add_dns (s_ip4, dns2);
+ nm_setting_ip_config_add_dns (s_ip4, dns1);
+ nm_setting_ip_config_add_dns (s_ip4, dns2);
/* IP6 setting */
- s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ());
+ s_ip6 = NM_SETTING_IP_CONFIG (nm_setting_ip6_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
NULL);
/* Addresses */
- add_one_ip6_address (s_ip6, address6_1, 64, NULL);
- add_one_ip6_address (s_ip6, address6_2, 56, NULL);
+ add_one_ip_address (s_ip6, address6_1, 64);
+ add_one_ip_address (s_ip6, address6_2, 56);
/* Routes */
- add_one_ip6_route (s_ip6, route6_1, route6_1_nh, 64, 3);
- add_one_ip6_route (s_ip6, route6_2, route6_2_nh, 56, 1);
- add_one_ip6_route (s_ip6, route6_3, route6_3_nh, 63, 5);
- add_one_ip6_route (s_ip6, route6_4, route6_4_nh, 62, 0);
+ add_one_ip_route (s_ip6, route6_1, route6_1_nh, 64, 3);
+ add_one_ip_route (s_ip6, route6_2, route6_2_nh, 56, 1);
+ add_one_ip_route (s_ip6, route6_3, route6_3_nh, 63, 5);
+ add_one_ip_route (s_ip6, route6_4, route6_4_nh, 62, -1);
/* DNS servers */
- nm_setting_ip6_config_add_dns (s_ip6, dns6_1);
- nm_setting_ip6_config_add_dns (s_ip6, dns6_2);
+ nm_setting_ip_config_add_dns (s_ip6, dns6_1);
+ nm_setting_ip_config_add_dns (s_ip6, dns6_2);
/* DNS searches */
- nm_setting_ip6_config_add_dns_search (s_ip6, "wallaceandgromit.com");
+ nm_setting_ip_config_add_dns_search (s_ip6, "wallaceandgromit.com");
/* Write out the connection */
owner_uid = geteuid ();
@@ -642,8 +555,8 @@ test_read_ip6_wired_connection (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
GError *error = NULL;
const char *tmp;
const char *expected_id = "Test Wired Connection IP6";
@@ -707,18 +620,18 @@ test_read_ip6_wired_connection (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRED_IP6_FILE,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
- ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 0,
+ ASSERT (nm_setting_ip_config_get_num_addresses (s_ip4) == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRED_IP6_FILE,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS);
+ NM_SETTING_IP_CONFIG_DNS);
/* ===== IPv6 SETTING ===== */
@@ -729,16 +642,23 @@ test_read_ip6_wired_connection (void)
NM_SETTING_IP6_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip6_config_get_method (s_ip6);
+ tmp = nm_setting_ip_config_get_method (s_ip6);
ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0,
"connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRED_IP6_FILE,
NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
/* IPv6 address */
- g_assert (nm_setting_ip6_config_get_num_addresses (s_ip6) == 1);
- check_ip6_address (s_ip6, 0, "abcd:1234:ffff::cdde", 64, "abcd:1234:ffff::cdd1");
+ g_assert (nm_setting_ip_config_get_num_addresses (s_ip6) == 1);
+ check_ip_address (s_ip6, 0, "abcd:1234:ffff::cdde", 64);
+
+ /* IPv6 gateway */
+ ASSERT (strcmp (nm_setting_ip_config_get_gateway (s_ip6), "abcd:1234:ffff::cdd1") == 0,
+ "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value",
+ TEST_WIRED_IP6_FILE,
+ NM_SETTING_IP6_CONFIG_SETTING_NAME,
+ NM_SETTING_IP_CONFIG_GATEWAY);
g_object_unref (connection);
}
@@ -749,8 +669,8 @@ test_write_ip6_wired_connection (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
NMConnection *reread;
@@ -785,30 +705,31 @@ test_write_ip6_wired_connection (void)
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
NULL);
/* IP6 setting */
- s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ());
+ s_ip6 = NM_SETTING_IP_CONFIG (nm_setting_ip6_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, gw,
NULL);
/* Addresses */
- add_one_ip6_address (s_ip6, address, 64, gw);
+ add_one_ip_address (s_ip6, address, 64);
/* DNS servers */
- nm_setting_ip6_config_add_dns (s_ip6, dns);
+ nm_setting_ip_config_add_dns (s_ip6, dns);
/* DNS searches */
- nm_setting_ip6_config_add_dns_search (s_ip6, "wallaceandgromit.com");
+ nm_setting_ip_config_add_dns_search (s_ip6, "wallaceandgromit.com");
/* Write out the connection */
owner_uid = geteuid ();
@@ -852,11 +773,11 @@ test_read_wired_mac_case (void)
const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57";
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv4.addresses1*semicolon at the end*");
+ "*ipv4.addresses*semicolon at the end*addresses1*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv4.addresses2*semicolon at the end*");
+ "*ipv4.addresses*semicolon at the end*addresses2*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
- "*ipv6.routes1*semicolon at the end*");
+ "*ipv6.routes*semicolon at the end*routes1*");
connection = nm_keyfile_plugin_connection_from_file (TEST_WIRED_MAC_CASE_FILE, NULL);
g_test_assert_expected_messages ();
ASSERT (connection != NULL,
@@ -999,7 +920,7 @@ test_read_valid_wireless_connection (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
GError *error = NULL;
const char *bssid;
const guint8 expected_bssid[ETH_ALEN] = { 0x00, 0x1a, 0x33, 0x44, 0x99, 0x82 };
@@ -1095,12 +1016,12 @@ test_read_valid_wireless_connection (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME);
/* Method */
- tmp = nm_setting_ip4_config_get_method (s_ip4);
+ tmp = nm_setting_ip_config_get_method (s_ip4);
ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0,
"connection-verify-wireless", "failed to verify %s: unexpected %s / %s key value",
TEST_WIRELESS_FILE,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_METHOD);
+ NM_SETTING_IP_CONFIG_METHOD);
g_object_unref (connection);
}
@@ -1111,8 +1032,8 @@ test_write_wireless_connection (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
const char *bssid = "aa:b9:a1:74:55:44";
GBytes *ssid;
@@ -1159,20 +1080,20 @@ test_write_wireless_connection (void)
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* IP6 setting */
- s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ());
+ s_ip6 = NM_SETTING_IP_CONFIG (nm_setting_ip6_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
NULL);
/* Write out the connection */
@@ -1249,7 +1170,7 @@ test_write_string_ssid (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wireless;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *uuid, *testfile = NULL, *tmp;
GBytes *ssid;
unsigned char tmpssid[] = { 65, 49, 50, 51, 32, 46, 92, 46, 36, 37, 126, 93 };
@@ -1286,11 +1207,11 @@ test_write_string_ssid (void)
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* Write out the connection */
@@ -1372,7 +1293,7 @@ test_write_intlist_ssid (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *uuid, *testfile = NULL;
GBytes *ssid;
unsigned char tmpssid[] = { 65, 49, 50, 51, 0, 50, 50 };
@@ -1412,10 +1333,10 @@ test_write_intlist_ssid (void)
g_bytes_unref (ssid);
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* Write out the connection */
owner_uid = geteuid ();
@@ -1533,7 +1454,7 @@ test_write_intlike_ssid (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *uuid, *testfile = NULL;
GBytes *ssid;
unsigned char tmpssid[] = { 49, 48, 49 };
@@ -1572,10 +1493,10 @@ test_write_intlike_ssid (void)
g_bytes_unref (ssid);
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* Write out the connection */
owner_uid = geteuid ();
@@ -1595,6 +1516,7 @@ test_write_intlike_ssid (void)
g_assert_no_error (error);
g_assert (tmp);
g_assert_cmpstr (tmp, ==, "101");
+ g_free (tmp);
g_key_file_free (keyfile);
@@ -1619,7 +1541,7 @@ test_write_intlike_ssid_2 (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
char *uuid, *testfile = NULL;
GBytes *ssid;
unsigned char tmpssid[] = { 49, 49, 59, 49, 50, 59, 49, 51, 59};
@@ -1658,10 +1580,10 @@ test_write_intlike_ssid_2 (void)
g_bytes_unref (ssid);
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* Write out the connection */
owner_uid = geteuid ();
@@ -1681,6 +1603,7 @@ test_write_intlike_ssid_2 (void)
g_assert_no_error (error);
g_assert (tmp);
g_assert_cmpstr (tmp, ==, "11\\;12\\;13\\;");
+ g_free (tmp);
g_key_file_free (keyfile);
@@ -1866,7 +1789,7 @@ test_write_bt_dun_connection (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingBluetooth *s_bt;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSettingGsm *s_gsm;
char *uuid;
const char *bdaddr = "aa:b9:a1:74:55:44";
@@ -1907,11 +1830,11 @@ test_write_bt_dun_connection (void)
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* GSM setting */
@@ -2115,7 +2038,7 @@ test_write_gsm_connection (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSettingGsm *s_gsm;
char *uuid;
gboolean success;
@@ -2145,11 +2068,11 @@ test_write_gsm_connection (void)
/* IP4 setting */
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+ s_ip4 = NM_SETTING_IP_CONFIG (nm_setting_ip4_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
/* GSM setting */
@@ -2204,6 +2127,10 @@ test_read_wired_8021x_tls_blob_connection (void)
gboolean success;
GBytes *blob;
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
+ "*<warn> keyfile: 802-1x.client-cert: certificate or key file '/CASA/dcbw/Desktop/certinfra/client.pem' does not exist*");
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
+ "*<warn> keyfile: 802-1x.private-key: certificate or key file '/CASA/dcbw/Desktop/certinfra/client.pem' does not exist*");
connection = nm_keyfile_plugin_connection_from_file (TEST_WIRED_TLS_BLOB_FILE, &error);
if (connection == NULL) {
g_assert (error);
@@ -2251,10 +2178,10 @@ test_read_wired_8021x_tls_blob_connection (void)
g_assert_cmpint (g_bytes_get_size (blob), ==, 568);
tmp = nm_setting_802_1x_get_client_cert_path (s_8021x);
- g_assert_cmpstr (tmp, ==, "/home/dcbw/Desktop/certinfra/client.pem");
+ g_assert_cmpstr (tmp, ==, "/CASA/dcbw/Desktop/certinfra/client.pem");
tmp = nm_setting_802_1x_get_private_key_path (s_8021x);
- g_assert_cmpstr (tmp, ==, "/home/dcbw/Desktop/certinfra/client.pem");
+ g_assert_cmpstr (tmp, ==, "/CASA/dcbw/Desktop/certinfra/client.pem");
g_object_unref (connection);
}
@@ -2336,6 +2263,12 @@ test_read_wired_8021x_tls_old_connection (void)
const char *tmp;
gboolean success;
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
+ "*<warn> keyfile: 802-1x.ca-cert: certificate or key file '/CASA/dcbw/Desktop/certinfra/CA/eaptest_ca_cert.pem' does not exist*");
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
+ "*<warn> keyfile: 802-1x.client-cert: certificate or key file '/CASA/dcbw/Desktop/certinfra/client.pem' does not exist*");
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
+ "*<warn> keyfile: 802-1x.private-key: certificate or key file '/CASA/dcbw/Desktop/certinfra/client.pem' does not exist*");
connection = nm_keyfile_plugin_connection_from_file (TEST_WIRED_TLS_OLD_FILE, &error);
if (connection == NULL) {
g_assert (error);
@@ -2369,13 +2302,13 @@ test_read_wired_8021x_tls_old_connection (void)
g_assert (g_strcmp0 (tmp, "12345testing") == 0);
tmp = nm_setting_802_1x_get_ca_cert_path (s_8021x);
- g_assert (g_strcmp0 (tmp, "/home/dcbw/Desktop/certinfra/CA/eaptest_ca_cert.pem") == 0);
+ g_assert (g_strcmp0 (tmp, "/CASA/dcbw/Desktop/certinfra/CA/eaptest_ca_cert.pem") == 0);
tmp = nm_setting_802_1x_get_client_cert_path (s_8021x);
- g_assert (g_strcmp0 (tmp, "/home/dcbw/Desktop/certinfra/client.pem") == 0);
+ g_assert (g_strcmp0 (tmp, "/CASA/dcbw/Desktop/certinfra/client.pem") == 0);
tmp = nm_setting_802_1x_get_private_key_path (s_8021x);
- g_assert (g_strcmp0 (tmp, "/home/dcbw/Desktop/certinfra/client.pem") == 0);
+ g_assert (g_strcmp0 (tmp, "/CASA/dcbw/Desktop/certinfra/client.pem") == 0);
g_object_unref (connection);
}
@@ -2451,7 +2384,7 @@ create_wired_tls_connection (NMSetting8021xCKScheme scheme)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSetting *s_wired;
NMSetting8021x *s_8021x;
char *uuid;
@@ -2475,9 +2408,9 @@ create_wired_tls_connection (NMSetting8021xCKScheme scheme)
g_free (uuid);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
/* Wired setting */
@@ -2591,6 +2524,7 @@ test_write_wired_8021x_tls_connection_path (void)
tmp2 = g_path_get_dirname (testfile);
if (g_strcmp0 (tmp2, TEST_KEYFILES_DIR) == 0)
relative = TRUE;
+ g_free (tmp2);
/* CA cert */
tmp = g_key_file_get_string (keyfile,
@@ -2644,10 +2578,22 @@ test_write_wired_8021x_tls_connection_blob (void)
char *new_priv_key;
const char *uuid;
GError *error = NULL;
+ GBytes *password_raw = NULL;
+#define PASSWORD_RAW "password-raw\0test"
connection = create_wired_tls_connection (NM_SETTING_802_1X_CK_SCHEME_BLOB);
g_assert (connection != NULL);
+ s_8021x = nm_connection_get_setting_802_1x (connection);
+ g_assert (s_8021x);
+
+ password_raw = g_bytes_new (PASSWORD_RAW, STRLEN (PASSWORD_RAW));
+ g_object_set (s_8021x,
+ NM_SETTING_802_1X_PASSWORD_RAW,
+ password_raw,
+ NULL);
+ g_bytes_unref (password_raw);
+
/* Write out the connection */
success = nm_keyfile_plugin_write_test_connection (connection, TEST_SCRATCH_DIR, geteuid (), getegid (), &testfile, &error);
if (!success) {
@@ -2690,6 +2636,11 @@ test_write_wired_8021x_tls_connection_blob (void)
g_assert (nm_setting_802_1x_get_client_cert_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH);
g_assert (nm_setting_802_1x_get_private_key_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH);
+ password_raw = nm_setting_802_1x_get_password_raw (s_8021x);
+ g_assert (password_raw);
+ g_assert (g_bytes_get_size (password_raw) == STRLEN (PASSWORD_RAW));
+ g_assert (!memcmp (g_bytes_get_data (password_raw, NULL), PASSWORD_RAW, STRLEN (PASSWORD_RAW)));
+
unlink (testfile);
g_free (testfile);
@@ -2754,8 +2705,8 @@ test_write_infiniband_connection (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingInfiniband *s_ib;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
const char *mac = "99:88:77:66:55:44:ab:bc:cd:de:ef:f0:0a:1b:2c:3d:4e:5f:6f:ba";
gboolean success;
@@ -2795,16 +2746,16 @@ test_write_infiniband_connection (void)
NULL);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
- g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
/* Write out the connection */
owner_uid = geteuid ();
@@ -2835,7 +2786,7 @@ test_read_bridge_main (void)
{
NMConnection *connection;
NMSettingConnection *s_con;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
NMSettingBridge *s_bridge;
GError *error = NULL;
const char *expected_id = "Test Bridge Main";
@@ -2859,17 +2810,18 @@ test_read_bridge_main (void)
/* IPv4 setting */
s_ip4 = nm_connection_get_setting_ip4_config (connection);
g_assert (s_ip4);
- g_assert_cmpstr (nm_setting_ip4_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
/* Bridge setting */
s_bridge = nm_connection_get_setting_bridge (connection);
g_assert (s_bridge);
- g_assert_cmpuint (nm_setting_bridge_get_forward_delay (s_bridge), ==, 0);
+ g_assert_cmpuint (nm_setting_bridge_get_forward_delay (s_bridge), ==, 2);
g_assert_cmpuint (nm_setting_bridge_get_stp (s_bridge), ==, TRUE);
g_assert_cmpuint (nm_setting_bridge_get_priority (s_bridge), ==, 32744);
g_assert_cmpuint (nm_setting_bridge_get_hello_time (s_bridge), ==, 7);
g_assert_cmpuint (nm_setting_bridge_get_max_age (s_bridge), ==, 39);
g_assert_cmpuint (nm_setting_bridge_get_ageing_time (s_bridge), ==, 235352);
+ g_assert_cmpuint (nm_setting_bridge_get_multicast_snooping (s_bridge), ==, FALSE);
g_object_unref (connection);
}
@@ -2880,8 +2832,8 @@ test_write_bridge_main (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingBridge *s_bridge;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
NMConnection *reread;
@@ -2914,21 +2866,22 @@ test_write_bridge_main (void)
nm_connection_add_setting (connection, NM_SETTING (s_bridge));
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
g_assert (s_ip4);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
g_object_set (s_ip4,
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.1",
NULL);
- add_one_ip4_address (s_ip4, "1.2.3.4", "1.1.1.1", 24);
+ add_one_ip_address (s_ip4, "1.2.3.4", 24);
/* IP6 setting */
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
g_assert (s_ip6);
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
- g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip6, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL);
/* Write out the connection */
owner_uid = geteuid ();
@@ -3177,6 +3130,7 @@ test_write_new_wired_group_name (void)
unlink (testfile);
g_free (testfile);
+ g_key_file_unref (kf);
g_object_unref (reread);
g_object_unref (connection);
}
@@ -3315,6 +3269,7 @@ test_write_new_wireless_group_names (void)
unlink (testfile);
g_free (testfile);
+ g_key_file_unref (kf);
g_object_unref (reread);
g_object_unref (connection);
}
@@ -3451,7 +3406,7 @@ static void
test_read_enum_property (void)
{
NMConnection *connection;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
GError *error = NULL;
gboolean success;
@@ -3465,7 +3420,7 @@ test_read_enum_property (void)
/* IPv6 setting */
s_ip6 = nm_connection_get_setting_ip6_config (connection);
g_assert (s_ip6);
- g_assert_cmpint (nm_setting_ip6_config_get_ip6_privacy (s_ip6), ==, NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR);
+ g_assert_cmpint (nm_setting_ip6_config_get_ip6_privacy (NM_SETTING_IP6_CONFIG (s_ip6)), ==, NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR);
g_object_unref (connection);
}
@@ -3476,7 +3431,7 @@ test_write_enum_property (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
char *uuid;
gboolean success;
NMConnection *reread;
@@ -3505,10 +3460,10 @@ test_write_enum_property (void)
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* IP6 setting */
- s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ());
+ s_ip6 = NM_SETTING_IP_CONFIG (nm_setting_ip6_config_new ());
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
g_object_set (s_ip6,
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
NM_SETTING_IP6_CONFIG_IP6_PRIVACY, NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR,
NULL);
@@ -3623,6 +3578,56 @@ test_write_flags_property (void)
g_object_unref (connection);
}
+/*****************************************************************************/
+
+static void
+_escape_filename (const char *filename, gboolean would_be_ignored)
+{
+ gs_free char *esc = NULL;
+
+ g_assert (filename && filename[0]);
+
+ if (!!would_be_ignored != !!nm_keyfile_plugin_utils_should_ignore_file (filename)) {
+ if (would_be_ignored)
+ g_error ("We expect filename \"%s\" to be ignored, but it isn't", filename);
+ else
+ g_error ("We expect filename \"%s\" not to be ignored, but it is", filename);
+ }
+
+ esc = nm_keyfile_plugin_utils_escape_filename (filename);
+ g_assert (esc && esc[0]);
+ g_assert (!strchr (esc, '/'));
+
+ if (nm_keyfile_plugin_utils_should_ignore_file (esc))
+ g_error ("Escaping filename \"%s\" yielded \"%s\", but this is ignored", filename, esc);
+}
+
+static void
+test_nm_keyfile_plugin_utils_escape_filename (void)
+{
+ _escape_filename ("ab", FALSE);
+ _escape_filename (".vim-file.swp", TRUE);
+ _escape_filename (".vim-file.Swp", TRUE);
+ _escape_filename (".vim-file.SWP", TRUE);
+ _escape_filename (".vim-file.swpx", TRUE);
+ _escape_filename (".vim-file.Swpx", TRUE);
+ _escape_filename (".vim-file.SWPX", TRUE);
+ _escape_filename (".pem-file.pem", TRUE);
+ _escape_filename (".pem-file.Pem", TRUE);
+ _escape_filename (".pem-file.PEM", TRUE);
+ _escape_filename (".pem-file.der", TRUE);
+ _escape_filename (".pem-file.Der", TRUE);
+ _escape_filename (".mkstemp.ABCEDF", TRUE);
+ _escape_filename (".mkstemp.abcdef", TRUE);
+ _escape_filename (".mkstemp.123456", TRUE);
+ _escape_filename (".mkstemp.A23456", TRUE);
+ _escape_filename (".#emacs-locking", TRUE);
+ _escape_filename ("file-with-tilde~", TRUE);
+ _escape_filename (".file-with-dot", TRUE);
+}
+
+/*****************************************************************************/
+
NMTST_DEFINE ();
int main (int argc, char **argv)
@@ -3693,6 +3698,8 @@ int main (int argc, char **argv)
g_test_add_func ("/keyfile/test_read_flags_property ", test_read_flags_property);
g_test_add_func ("/keyfile/test_write_flags_property ", test_write_flags_property);
+ g_test_add_func ("/keyfile/test_nm_keyfile_plugin_utils_escape_filename ", test_nm_keyfile_plugin_utils_escape_filename);
+
return g_test_run ();
}
diff --git a/src/settings/plugins/keyfile/utils.c b/src/settings/plugins/keyfile/utils.c
index 844d9c08c9..4809c642c0 100644
--- a/src/settings/plugins/keyfile/utils.c
+++ b/src/settings/plugins/keyfile/utils.c
@@ -18,9 +18,12 @@
* (C) Copyright 2010 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <stdlib.h>
#include <string.h>
+#include "gsystem-local-alloc.h"
#include "utils.h"
#include <nm-setting-wired.h>
#include <nm-setting-wireless.h>
@@ -57,7 +60,7 @@ check_prefix (const char *base, const char *tag)
len = strlen (base);
tag_len = strlen (tag);
- if ((len > tag_len) && !strncasecmp (base, tag, tag_len))
+ if ((len > tag_len) && !g_ascii_strncasecmp (base, tag, tag_len))
return TRUE;
return FALSE;
}
@@ -72,7 +75,7 @@ check_suffix (const char *base, const char *tag)
len = strlen (base);
tag_len = strlen (tag);
- if ((len > tag_len) && !strcasecmp (base + len - tag_len, tag))
+ if ((len > tag_len) && !g_ascii_strcasecmp (base + len - tag_len, tag))
return TRUE;
return FALSE;
}
@@ -85,199 +88,61 @@ check_suffix (const char *base, const char *tag)
gboolean
nm_keyfile_plugin_utils_should_ignore_file (const char *filename)
{
- char *base;
- gboolean ignore = FALSE;
+ gs_free char *base = NULL;
g_return_val_if_fail (filename != NULL, TRUE);
base = g_path_get_basename (filename);
g_return_val_if_fail (base != NULL, TRUE);
- /* Ignore files with certain patterns */
- if ( (check_prefix (base, ".") && check_suffix (base, SWP_TAG)) /* vim temporary files: .filename.swp */
- || (check_prefix (base, ".") && check_suffix (base, SWPX_TAG)) /* vim temporary files: .filename.swpx */
- || check_suffix (base, PEM_TAG) /* 802.1x certificates and keys */
- || check_suffix (base, DER_TAG) /* 802.1x certificates and keys */
- || check_mkstemp_suffix (base) /* temporary files created by mkstemp() */
- || check_prefix (base, ".#") /* Emacs locking file (link) */
- || base[strlen (base) - 1] == '~')
- ignore = TRUE;
-
- g_free (base);
- return ignore;
-}
-
-typedef struct {
- const char *setting;
- const char *alias;
-} SettingAlias;
-
-static const SettingAlias alias_list[] = {
- { NM_SETTING_WIRED_SETTING_NAME, "ethernet" },
- { NM_SETTING_WIRELESS_SETTING_NAME, "wifi" },
- { NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, "wifi-security" },
-};
-
-const char *
-nm_keyfile_plugin_get_alias_for_setting_name (const char *setting_name)
-{
- guint i;
-
- g_return_val_if_fail (setting_name != NULL, NULL);
+ /* Ignore hidden and backup files */
+ /* should_ignore_file() must mirror escape_filename() */
+ if (check_prefix (base, ".") || check_suffix (base, "~"))
+ return TRUE;
+ /* Ignore temporary files */
+ if (check_mkstemp_suffix (base))
+ return TRUE;
+ /* Ignore 802.1x certificates and keys */
+ if (check_suffix (base, PEM_TAG) || check_suffix (base, DER_TAG))
+ return TRUE;
- for (i = 0; i < G_N_ELEMENTS (alias_list); i++) {
- if (strcmp (setting_name, alias_list[i].setting) == 0)
- return alias_list[i].alias;
- }
- return NULL;
+ return FALSE;
}
-const char *
-nm_keyfile_plugin_get_setting_name_for_alias (const char *alias)
+char *
+nm_keyfile_plugin_utils_escape_filename (const char *filename)
{
- guint i;
-
- g_return_val_if_fail (alias != NULL, NULL);
-
- for (i = 0; i < G_N_ELEMENTS (alias_list); i++) {
- if (strcmp (alias, alias_list[i].alias) == 0)
- return alias_list[i].setting;
- }
- return NULL;
-}
-
-/**********************************************************************/
-
-/* List helpers */
-#define DEFINE_KF_LIST_WRAPPER(stype, get_ctype, set_ctype) \
-get_ctype \
-nm_keyfile_plugin_kf_get_##stype##_list (GKeyFile *kf, \
- const char *group, \
- const char *key, \
- gsize *out_length, \
- GError **error) \
-{ \
- get_ctype list; \
- const char *alias; \
- GError *local = NULL; \
- \
- list = g_key_file_get_##stype##_list (kf, group, key, out_length, &local); \
- if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { \
- alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
- if (alias) { \
- g_clear_error (&local); \
- list = g_key_file_get_##stype##_list (kf, alias, key, out_length, &local); \
- } \
- } \
- if (local) \
- g_propagate_error (error, local); \
- return list; \
-} \
- \
-void \
-nm_keyfile_plugin_kf_set_##stype##_list (GKeyFile *kf, \
- const char *group, \
- const char *key, \
- set_ctype list[], \
- gsize length) \
-{ \
- const char *alias; \
- \
- alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
- g_key_file_set_##stype##_list (kf, alias ? alias : group, key, list, length); \
-}
-
-DEFINE_KF_LIST_WRAPPER(integer, gint*, gint);
-DEFINE_KF_LIST_WRAPPER(string, gchar **, const gchar* const);
+ GString *str;
+ const char *f = filename;
+ const char ESCAPE_CHAR = '*';
-/* Single value helpers */
-#define DEFINE_KF_WRAPPER(stype, get_ctype, set_ctype) \
-get_ctype \
-nm_keyfile_plugin_kf_get_##stype (GKeyFile *kf, \
- const char *group, \
- const char *key, \
- GError **error) \
-{ \
- get_ctype val; \
- const char *alias; \
- GError *local = NULL; \
- \
- val = g_key_file_get_##stype (kf, group, key, &local); \
- if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { \
- alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
- if (alias) { \
- g_clear_error (&local); \
- val = g_key_file_get_##stype (kf, alias, key, &local); \
- } \
- } \
- if (local) \
- g_propagate_error (error, local); \
- return val; \
-} \
- \
-void \
-nm_keyfile_plugin_kf_set_##stype (GKeyFile *kf, \
- const char *group, \
- const char *key, \
- set_ctype value) \
-{ \
- const char *alias; \
- \
- alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
- g_key_file_set_##stype (kf, alias ? alias : group, key, value); \
-}
+ /* keyfile used to escape with '*', do not change that behavior.
+ * But for newly added escapings, use '_' instead. */
+ const char ESCAPE_CHAR2 = '_';
-DEFINE_KF_WRAPPER(string, gchar*, const gchar*);
-DEFINE_KF_WRAPPER(integer, gint, gint);
-DEFINE_KF_WRAPPER(uint64, guint64, guint64);
-DEFINE_KF_WRAPPER(boolean, gboolean, gboolean);
-DEFINE_KF_WRAPPER(value, gchar*, const gchar*);
+ g_return_val_if_fail (filename && filename[0], NULL);
+ str = g_string_sized_new (60);
-gchar **
-nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
- const char *group,
- gsize *out_length,
- GError **error)
-{
- gchar **keys;
- const char *alias;
- GError *local = NULL;
-
- keys = g_key_file_get_keys (kf, group, out_length, &local);
- if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
- alias = nm_keyfile_plugin_get_alias_for_setting_name (group);
- if (alias) {
- g_clear_error (&local);
- keys = g_key_file_get_keys (kf, alias, out_length, &local);
- }
+ /* Convert '/' to ESCAPE_CHAR */
+ for (f = filename; f[0]; f++) {
+ if (f[0] == '/')
+ g_string_append_c (str, ESCAPE_CHAR);
+ else
+ g_string_append_c (str, f[0]);
}
- if (local)
- g_propagate_error (error, local);
- return keys;
-}
-gboolean
-nm_keyfile_plugin_kf_has_key (GKeyFile *kf,
- const char *group,
- const char *key,
- GError **error)
-{
- gboolean has;
- const char *alias;
- GError *local = NULL;
-
- has = g_key_file_has_key (kf, group, key, &local);
- if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
- alias = nm_keyfile_plugin_get_alias_for_setting_name (group);
- if (alias) {
- g_clear_error (&local);
- has = g_key_file_has_key (kf, alias, key, &local);
- }
- }
- if (local)
- g_propagate_error (error, local);
- return has;
+ /* escape_filename() must avoid anything that should_ignore_file() would reject.
+ * We can escape here more aggressivly then what we would read back. */
+ if (check_prefix (str->str, "."))
+ str->str[0] = ESCAPE_CHAR2;
+ if (check_suffix (str->str, "~"))
+ str->str[str->len - 1] = ESCAPE_CHAR2;
+ if ( check_mkstemp_suffix (str->str)
+ || check_suffix (str->str, PEM_TAG)
+ || check_suffix (str->str, DER_TAG))
+ g_string_append_c (str, ESCAPE_CHAR2);
+
+ return g_string_free (str, FALSE);;
}
-
diff --git a/src/settings/plugins/keyfile/utils.h b/src/settings/plugins/keyfile/utils.h
index 1a7c2502b0..d0862284cd 100644
--- a/src/settings/plugins/keyfile/utils.h
+++ b/src/settings/plugins/keyfile/utils.h
@@ -22,59 +22,17 @@
#define _UTILS_H_
#include <glib.h>
-#include "common.h"
+#include "NetworkManagerUtils.h"
-gboolean nm_keyfile_plugin_utils_should_ignore_file (const char *filename);
-
-const char *nm_keyfile_plugin_get_alias_for_setting_name (const char *setting_name);
-
-const char *nm_keyfile_plugin_get_setting_name_for_alias (const char *alias);
-
-/*********************************************************/
+#define NM_KEYFILE_CONNECTION_LOG_PATH(path) str_if_set (path,"in-memory")
+#define NM_KEYFILE_CONNECTION_LOG_FMT "%s (%s,\"%s\")"
+#define NM_KEYFILE_CONNECTION_LOG_ARG(con) NM_KEYFILE_CONNECTION_LOG_PATH (nm_settings_connection_get_filename ((NMSettingsConnection *) (con))), nm_connection_get_uuid ((NMConnection *) (con)), nm_connection_get_id ((NMConnection *) (con))
+#define NM_KEYFILE_CONNECTION_LOG_FMTD "%s (%s,\"%s\",%p)"
+#define NM_KEYFILE_CONNECTION_LOG_ARGD(con) NM_KEYFILE_CONNECTION_LOG_PATH (nm_settings_connection_get_filename ((NMSettingsConnection *) (con))), nm_connection_get_uuid ((NMConnection *) (con)), nm_connection_get_id ((NMConnection *) (con)), (con)
-/* List helpers */
-#define DEFINE_KF_LIST_WRAPPER_PROTO(stype, get_ctype, set_ctype) \
-get_ctype nm_keyfile_plugin_kf_get_##stype##_list (GKeyFile *kf, \
- const char *group, \
- const char *key, \
- gsize *out_length, \
- GError **error); \
-\
-void nm_keyfile_plugin_kf_set_##stype##_list (GKeyFile *kf, \
- const char *group, \
- const char *key, \
- set_ctype list[], \
- gsize length);
-DEFINE_KF_LIST_WRAPPER_PROTO(integer, gint*, gint)
-DEFINE_KF_LIST_WRAPPER_PROTO(string, gchar**, const gchar* const)
-
-/* Single-value helpers */
-#define DEFINE_KF_WRAPPER_PROTO(stype, get_ctype, set_ctype) \
-get_ctype nm_keyfile_plugin_kf_get_##stype (GKeyFile *kf, \
- const char *group, \
- const char *key, \
- GError **error); \
-\
-void nm_keyfile_plugin_kf_set_##stype (GKeyFile *kf, \
- const char *group, \
- const char *key, \
- set_ctype value);
-DEFINE_KF_WRAPPER_PROTO(string, gchar*, const gchar*)
-DEFINE_KF_WRAPPER_PROTO(integer, gint, gint)
-DEFINE_KF_WRAPPER_PROTO(uint64, guint64, guint64)
-DEFINE_KF_WRAPPER_PROTO(boolean, gboolean, gboolean)
-DEFINE_KF_WRAPPER_PROTO(value, gchar*, const gchar*)
-
-/* Misc */
-gchar ** nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
- const char *group,
- gsize *out_length,
- GError **error);
+gboolean nm_keyfile_plugin_utils_should_ignore_file (const char *filename);
-gboolean nm_keyfile_plugin_kf_has_key (GKeyFile *kf,
- const char *group,
- const char *key,
- GError **error);
+char *nm_keyfile_plugin_utils_escape_filename (const char *filename);
#endif /* _UTILS_H_ */
diff --git a/src/settings/plugins/keyfile/writer.c b/src/settings/plugins/keyfile/writer.c
index 17d4d9581a..9cf119c0c8 100644
--- a/src/settings/plugins/keyfile/writer.c
+++ b/src/settings/plugins/keyfile/writer.c
@@ -16,523 +16,28 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2008 Novell, Inc.
- * Copyright (C) 2008 - 2012 Red Hat, Inc.
+ * Copyright (C) 2008 - 2015 Red Hat, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <stdio.h>
#include <errno.h>
-
-#include <dbus/dbus-glib.h>
-#include <nm-setting.h>
-#include <nm-setting-connection.h>
-#include <nm-setting-ip4-config.h>
-#include <nm-setting-ip6-config.h>
-#include <nm-setting-vpn.h>
-#include <nm-setting-wired.h>
-#include <nm-setting-wireless.h>
-#include <nm-setting-ip4-config.h>
-#include <nm-setting-bluetooth.h>
-#include <nm-setting-8021x.h>
-#include <nm-utils.h>
#include <string.h>
-#include <arpa/inet.h>
-#include "nm-dbus-glib-types.h"
-#include "nm-glib-compat.h"
#include "nm-logging.h"
#include "writer.h"
#include "common.h"
#include "utils.h"
+#include "nm-keyfile-internal.h"
-/* Some setting properties also contain setting names, such as
- * NMSettingConnection's 'type' property (which specifies the base type of the
- * connection, eg ethernet or wifi) or the 802-11-wireless setting's
- * 'security' property which specifies whether or not the AP requires
- * encrpytion. This function handles translating those properties' values
- * from the real setting name to the more-readable alias.
- */
-static void
-setting_alias_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- const char *str, *alias;
-
- str = g_value_get_string (value);
- alias = nm_keyfile_plugin_get_alias_for_setting_name (str);
- nm_keyfile_plugin_kf_set_string (file,
- nm_setting_get_name (setting),
- key,
- alias ? alias : str);
-}
-
-static gboolean
-write_array_of_uint (GKeyFile *file,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- GArray *array;
- int i;
- int *tmp_array;
-
- array = (GArray *) g_value_get_boxed (value);
- if (!array || !array->len)
- return TRUE;
-
- tmp_array = g_new (gint, array->len);
- for (i = 0; i < array->len; i++)
- tmp_array[i] = g_array_index (array, int, i);
-
- nm_keyfile_plugin_kf_set_integer_list (file, nm_setting_get_name (setting), key, tmp_array, array->len);
- g_free (tmp_array);
- return TRUE;
-}
-
-static void
-ip4_dns_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- char **list;
-
- list = g_value_get_boxed (value);
- if (list && list[0]) {
- nm_keyfile_plugin_kf_set_string_list (file, nm_setting_get_name (setting), key,
- (const char **) list, g_strv_length (list));
- }
-}
-
-static void
-write_ip4_values (GKeyFile *file,
- const char *setting_name,
- GPtrArray *array,
- gboolean is_route)
-{
- GString *output;
- int i;
- guint32 addr, gw, plen, metric;
- char key_name[30], *key_name_idx;
-
- if (!array->len)
- return;
-
- strcpy (key_name, is_route ? "route" : "address");
- key_name_idx = key_name + strlen (key_name);
-
- output = g_string_sized_new (2*INET_ADDRSTRLEN + 10);
- for (i = 0; i < array->len; i++) {
- if (is_route) {
- NMIP4Route *route = array->pdata[i];
-
- addr = nm_ip4_route_get_dest (route);
- plen = nm_ip4_route_get_prefix (route);
- gw = nm_ip4_route_get_next_hop (route);
- metric = nm_ip4_route_get_metric (route);
- } else {
- NMIP4Address *address = array->pdata[i];
-
- addr = nm_ip4_address_get_address (address);
- plen = nm_ip4_address_get_prefix (address);
- gw = nm_ip4_address_get_gateway (address);
- metric = 0;
- }
-
- g_string_set_size (output, 0);
- g_string_append_printf (output, "%s/%u",
- nm_utils_inet4_ntop (addr, NULL),
- (unsigned) plen);
- if (metric || gw) {
- /* Older versions of the plugin do not support the form
- * "a.b.c.d/plen,,metric", so, we always have to write the
- * gateway, even if it's 0.0.0.0.
- * The current version support reading of the above form. */
- g_string_append_c (output, ',');
- g_string_append (output, nm_utils_inet4_ntop (gw, NULL));
- if (metric)
- g_string_append_printf (output, ",%lu", (unsigned long) metric);
- }
-
- sprintf (key_name_idx, "%d", i + 1);
- nm_keyfile_plugin_kf_set_string (file, setting_name, key_name, output->str);
- }
- g_string_free (output, TRUE);
-}
-
-static void
-ip4_addr_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- GPtrArray *array;
- const char *setting_name = nm_setting_get_name (setting);
-
- array = (GPtrArray *) g_value_get_boxed (value);
- if (array && array->len)
- write_ip4_values (file, setting_name, array, FALSE);
-}
-
-static void
-ip4_addr_label_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- /* skip */
-}
-
-static void
-ip4_route_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- GPtrArray *array;
- const char *setting_name = nm_setting_get_name (setting);
-
- array = (GPtrArray *) g_value_get_boxed (value);
- if (array && array->len)
- write_ip4_values (file, setting_name, array, TRUE);
-}
-
-static void
-ip6_dns_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- char **list;
-
- list = g_value_get_boxed (value);
- if (list && list[0]) {
- nm_keyfile_plugin_kf_set_string_list (file, nm_setting_get_name (setting), key,
- (const char **) list, g_strv_length (list));
- }
-}
-
-static char *
-ip6_values_to_addr_prefix (const struct in6_addr *addr, guint prefix, const struct in6_addr *gw,
- gboolean force_write_gateway)
-{
- GString *ip6_str;
- char buf[INET6_ADDRSTRLEN];
-
- /* address */
- nm_utils_inet6_ntop (addr, buf);
-
- /* Enough space for the address, '/', and the prefix */
- ip6_str = g_string_sized_new ((INET6_ADDRSTRLEN * 2) + 5);
-
- /* prefix */
- g_string_append (ip6_str, buf);
- g_string_append_printf (ip6_str, "/%u", prefix);
-
- /* gateway */
- nm_utils_inet6_ntop (gw, buf);
- if (force_write_gateway || !IN6_IS_ADDR_UNSPECIFIED (gw))
- g_string_append_printf (ip6_str, ",%s", buf);
- return g_string_free (ip6_str, FALSE);
-}
-
-static void
-ip6_addr_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- GPtrArray *array;
- const char *setting_name = nm_setting_get_name (setting);
- int i, j;
-
- array = (GPtrArray *) g_value_get_boxed (value);
- if (!array || !array->len)
- return;
-
- for (i = 0, j = 1; i < array->len; i++) {
- NMIP6Address *addr = array->pdata[i];
- char *key_name, *ip6_addr;
-
- ip6_addr = ip6_values_to_addr_prefix (nm_ip6_address_get_address (addr),
- nm_ip6_address_get_prefix (addr),
- nm_ip6_address_get_gateway (addr),
- /* we allow omitting the gateway if it's :: */
- FALSE);
- /* Write it out */
- key_name = g_strdup_printf ("address%d", j++);
- nm_keyfile_plugin_kf_set_string (file, setting_name, key_name, ip6_addr);
- g_free (key_name);
- g_free (ip6_addr);
- }
-}
-
-static void
-ip6_route_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- GPtrArray *array;
- const char *setting_name = nm_setting_get_name (setting);
- GString *output;
- int i, j;
-
- array = (GPtrArray *) g_value_get_boxed (value);
- if (!array || !array->len)
- return;
-
- for (i = 0, j = 1; i < array->len; i++) {
- NMIP6Route *route = array->pdata[i];
- char *key_name;
- char *addr_str;
- guint metric;
-
- output = g_string_new ("");
-
- /* Metric */
- metric = nm_ip6_route_get_metric (route);
-
- /* Address, prefix and next hop
- * We allow omitting the gateway ::, if we also omit the metric
- * and force writing of the gateway, if we add a non zero metric.
- * The current version of the reader also supports the syntax
- * "a:b:c::/plen,,metric" for a gateway ::.
- * As older versions of the plugin, cannot read this form,
- * we always write the gateway, whenever we also write the metric.
- * But if possible, we omit them both (",::,0") or only the metric
- * (",0").
- **/
- addr_str = ip6_values_to_addr_prefix (nm_ip6_route_get_dest (route),
- nm_ip6_route_get_prefix (route),
- nm_ip6_route_get_next_hop (route),
- metric != 0);
- g_string_append (output, addr_str);
- g_free (addr_str);
-
- if (metric != 0)
- g_string_append_printf (output, ",%u", metric);
-
- /* Write it out */
- key_name = g_strdup_printf ("route%d", j++);
- nm_keyfile_plugin_kf_set_string (file, setting_name, key_name, output->str);
- g_free (key_name);
-
- g_string_free (output, TRUE);
- }
-}
-
-
-static void
-write_hash_of_string (GKeyFile *file,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- GHashTableIter iter;
- const char *property = NULL, *data = NULL;
- const char *group_name = nm_setting_get_name (setting);
- gboolean vpn_secrets = FALSE;
-
- /* Write VPN secrets out to a different group to keep them separate */
- if (NM_IS_SETTING_VPN (setting) && !strcmp (key, NM_SETTING_VPN_SECRETS)) {
- group_name = VPN_SECRETS_GROUP;
- vpn_secrets = TRUE;
- }
-
- g_hash_table_iter_init (&iter, (GHashTable *) g_value_get_boxed (value));
- while (g_hash_table_iter_next (&iter, (gpointer *) &property, (gpointer *) &data)) {
- gboolean write_item = TRUE;
-
- /* Handle VPN secrets specially; they are nested in the property's hash;
- * we don't want to write them if the secret is not saved, not required,
- * or owned by a user's secret agent.
- */
- if (vpn_secrets) {
- NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
-
- nm_setting_get_secret_flags (setting, property, &secret_flags, NULL);
- if (secret_flags != NM_SETTING_SECRET_FLAG_NONE)
- write_item = FALSE;
- }
-
- if (write_item)
- nm_keyfile_plugin_kf_set_string (file, group_name, property, data);
- }
-}
-
-static void
-ssid_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- GBytes *bytes;
- const guint8 *ssid_data;
- gsize ssid_len;
- const char *setting_name = nm_setting_get_name (setting);
- gboolean new_format = TRUE;
- unsigned int semicolons = 0;
- int i, *tmp_array;
- char *ssid;
-
- g_return_if_fail (G_VALUE_HOLDS (value, G_TYPE_BYTES));
-
- bytes = g_value_get_boxed (value);
- if (!bytes)
- return;
- ssid_data = g_bytes_get_data (bytes, &ssid_len);
- if (ssid_len == 0)
- return;
-
- /* Check whether each byte is printable. If not, we have to use an
- * integer list, otherwise we can just use a string.
- */
- for (i = 0; i < ssid_len; i++) {
- char c = ssid_data[i] & 0xFF;
- if (!g_ascii_isprint (c)) {
- new_format = FALSE;
- break;
- }
- if (c == ';')
- semicolons++;
- }
-
- if (new_format) {
- ssid = g_malloc0 (ssid_len + semicolons + 1);
- if (semicolons == 0)
- memcpy (ssid, ssid_data, ssid_len);
- else {
- /* Escape semicolons with backslashes to make strings
- * containing ';', such as '16;17;' unambiguous */
- int j = 0;
- for (i = 0; i < ssid_len; i++) {
- if (ssid_data[i] == ';')
- ssid[j++] = '\\';
- ssid[j++] = ssid_data[i];
- }
- }
- nm_keyfile_plugin_kf_set_string (file, setting_name, key, ssid);
- g_free (ssid);
- } else {
- tmp_array = g_new (gint, ssid_len);
- for (i = 0; i < ssid_len; i++)
- tmp_array[i] = (int) ssid_data[i];
- nm_keyfile_plugin_kf_set_integer_list (file, setting_name, key, tmp_array, ssid_len);
- g_free (tmp_array);
- }
-}
-
-static void
-password_raw_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
-{
- const char *setting_name = nm_setting_get_name (setting);
- GByteArray *array;
- int i, *tmp_array;
-
- g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_UCHAR_ARRAY));
-
- array = (GByteArray *) g_value_get_boxed (value);
- if (!array || !array->len)
- return;
-
- tmp_array = g_new (gint, array->len);
- for (i = 0; i < array->len; i++)
- tmp_array[i] = (int) array->data[i];
- nm_keyfile_plugin_kf_set_integer_list (file, setting_name, key, tmp_array, array->len);
- g_free (tmp_array);
-}
-
-typedef struct ObjectType {
- const char *key;
- const char *suffix;
- const char *privkey_pw_prop;
- NMSetting8021xCKScheme (*scheme_func) (NMSetting8021x *setting);
- NMSetting8021xCKFormat (*format_func) (NMSetting8021x *setting);
- const char * (*path_func) (NMSetting8021x *setting);
- GBytes * (*blob_func) (NMSetting8021x *setting);
-} ObjectType;
-
-static const ObjectType objtypes[10] = {
- { NM_SETTING_802_1X_CA_CERT,
- "ca-cert",
- NULL,
- nm_setting_802_1x_get_ca_cert_scheme,
- NULL,
- nm_setting_802_1x_get_ca_cert_path,
- nm_setting_802_1x_get_ca_cert_blob },
-
- { NM_SETTING_802_1X_PHASE2_CA_CERT,
- "inner-ca-cert",
- NULL,
- nm_setting_802_1x_get_phase2_ca_cert_scheme,
- NULL,
- nm_setting_802_1x_get_phase2_ca_cert_path,
- nm_setting_802_1x_get_phase2_ca_cert_blob },
-
- { NM_SETTING_802_1X_CLIENT_CERT,
- "client-cert",
- NULL,
- nm_setting_802_1x_get_client_cert_scheme,
- NULL,
- nm_setting_802_1x_get_client_cert_path,
- nm_setting_802_1x_get_client_cert_blob },
-
- { NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
- "inner-client-cert",
- NULL,
- nm_setting_802_1x_get_phase2_client_cert_scheme,
- NULL,
- nm_setting_802_1x_get_phase2_client_cert_path,
- nm_setting_802_1x_get_phase2_client_cert_blob },
-
- { NM_SETTING_802_1X_PRIVATE_KEY,
- "private-key",
- NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD,
- nm_setting_802_1x_get_private_key_scheme,
- nm_setting_802_1x_get_private_key_format,
- nm_setting_802_1x_get_private_key_path,
- nm_setting_802_1x_get_private_key_blob },
-
- { NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
- "inner-private-key",
- NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD,
- nm_setting_802_1x_get_phase2_private_key_scheme,
- nm_setting_802_1x_get_phase2_private_key_format,
- nm_setting_802_1x_get_phase2_private_key_path,
- nm_setting_802_1x_get_phase2_private_key_blob },
+typedef struct {
+ const char *keyfile_dir;
+} WriteInfo;
- { NULL },
-};
static gboolean
write_cert_key_file (const char *path,
@@ -598,61 +103,75 @@ out:
}
static void
-cert_writer (GKeyFile *file,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value)
+cert_writer (NMConnection *connection,
+ GKeyFile *file,
+ NMKeyfileWriteTypeDataCert *cert_data,
+ WriteInfo *info,
+ GError **error)
{
- const char *setting_name = nm_setting_get_name (setting);
+ const char *setting_name = nm_setting_get_name (NM_SETTING (cert_data->setting));
NMSetting8021xCKScheme scheme;
NMSetting8021xCKFormat format;
const char *path = NULL, *ext = "pem";
- const ObjectType *objtype = NULL;
- int i;
-
- for (i = 0; i < G_N_ELEMENTS (objtypes) && objtypes[i].key; i++) {
- if (g_strcmp0 (objtypes[i].key, key) == 0) {
- objtype = &objtypes[i];
- break;
- }
- }
- if (!objtype) {
- g_return_if_fail (objtype);
- return;
- }
- scheme = objtype->scheme_func (NM_SETTING_802_1X (setting));
+ scheme = cert_data->scheme_func (cert_data->setting);
if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) {
- path = objtype->path_func (NM_SETTING_802_1X (setting));
+ char *tmp = NULL;
+ const char *accepted_path = NULL;
+
+ path = cert_data->path_func (cert_data->setting);
g_assert (path);
- /* If the path is rooted in the keyfile directory, just use a
- * relative path instead of an absolute one.
- */
- if (g_str_has_prefix (path, keyfile_dir)) {
- path += strlen (keyfile_dir);
- while (*path == '/')
- path++;
+ if (g_str_has_prefix (path, info->keyfile_dir)) {
+ const char *p = path + strlen (info->keyfile_dir);
+
+ /* If the path is rooted in the keyfile directory, just use a
+ * relative path instead of an absolute one.
+ */
+ if (*p == '/') {
+ while (*p == '/')
+ p++;
+ if (p[0]) {
+ /* If @p looks like an integer list, the following detection will fail too and
+ * we will file:// qualify the path below. We thus avoid writing a path string
+ * that would be interpreted as legacy binary format by reader. */
+ tmp = nm_keyfile_detect_unqualified_path_scheme (info->keyfile_dir, p, -1, FALSE, NULL);
+ if (tmp) {
+ g_clear_pointer (&tmp, g_free);
+ accepted_path = p;
+ }
+ }
+ }
+ }
+ if (!accepted_path) {
+ /* What we are about to write, must also be understood by the reader.
+ * Otherwise, add a file:// prefix */
+ tmp = nm_keyfile_detect_unqualified_path_scheme (info->keyfile_dir, path, -1, FALSE, NULL);
+ if (tmp) {
+ g_clear_pointer (&tmp, g_free);
+ accepted_path = path;
+ }
}
- nm_keyfile_plugin_kf_set_string (file, setting_name, key, path);
+ if (!accepted_path)
+ accepted_path = tmp = g_strconcat (NM_KEYFILE_CERT_SCHEME_PREFIX_PATH, path, NULL);
+ nm_keyfile_plugin_kf_set_string (file, setting_name, cert_data->property_name, accepted_path);
+ g_free (tmp);
} else if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) {
GBytes *blob;
const guint8 *blob_data;
gsize blob_len;
gboolean success;
- GError *error = NULL;
+ GError *local = NULL;
char *new_path;
- blob = objtype->blob_func (NM_SETTING_802_1X (setting));
+ blob = cert_data->blob_func (cert_data->setting);
g_assert (blob);
blob_data = g_bytes_get_data (blob, &blob_len);
- if (objtype->format_func) {
+ if (cert_data->format_func) {
/* Get the extension for a private key */
- format = objtype->format_func (NM_SETTING_802_1X (setting));
+ format = cert_data->format_func (cert_data->setting);
if (format == NM_SETTING_802_1X_CK_FORMAT_PKCS12)
ext = "p12";
} else {
@@ -664,234 +183,46 @@ cert_writer (GKeyFile *file,
/* Write the raw data out to the standard file so that we can use paths
* from now on instead of pushing around the certificate data.
*/
- new_path = g_strdup_printf ("%s/%s-%s.%s", keyfile_dir, uuid, objtype->suffix, ext);
- g_assert (new_path);
+ new_path = g_strdup_printf ("%s/%s-%s.%s", info->keyfile_dir, nm_connection_get_uuid (connection),
+ cert_data->suffix, ext);
- success = write_cert_key_file (new_path, blob_data, blob_len, &error);
+ success = write_cert_key_file (new_path, blob_data, blob_len, &local);
if (success) {
- /* Write the path value to the keyfile */
- nm_keyfile_plugin_kf_set_string (file, setting_name, key, new_path);
+ /* Write the path value to the keyfile.
+ * We know, that basename(new_path) starts with a UUID, hence no conflict with "data:;base64," */
+ nm_keyfile_plugin_kf_set_string (file, setting_name, cert_data->property_name, strrchr (new_path, '/') + 1);
} else {
- nm_log_warn (LOGD_SETTINGS, "Failed to write certificate/key %s: %s",
- new_path, error->message);
- g_error_free (error);
+ nm_log_warn (LOGD_SETTINGS, "keyfile: %s.%s: failed to write certificate to file %s: %s",
+ setting_name, cert_data->property_name, new_path, local->message);
+ g_error_free (local);
}
g_free (new_path);
- } else
- g_assert_not_reached ();
-}
-
-typedef struct {
- const char *setting_name;
- const char *key;
- void (*writer) (GKeyFile *keyfile,
- const char *keyfile_dir,
- const char *uuid,
- NMSetting *setting,
- const char *key,
- const GValue *value);
-} KeyWriter;
-
-/* A table of keys that require further parsing/conversion because they are
- * stored in a format that can't be automatically read using the key's type.
- * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are
- * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored
- * in struct in6_addr internally, but as string in keyfiles.
- */
-static KeyWriter key_writers[] = {
- { NM_SETTING_CONNECTION_SETTING_NAME,
- NM_SETTING_CONNECTION_TYPE,
- setting_alias_writer },
- { NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ADDRESSES,
- ip4_addr_writer },
- { NM_SETTING_IP4_CONFIG_SETTING_NAME,
- "address-labels",
- ip4_addr_label_writer },
- { NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ADDRESSES,
- ip6_addr_writer },
- { NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_ROUTES,
- ip4_route_writer },
- { NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_ROUTES,
- ip6_route_writer },
- { NM_SETTING_IP4_CONFIG_SETTING_NAME,
- NM_SETTING_IP4_CONFIG_DNS,
- ip4_dns_writer },
- { NM_SETTING_IP6_CONFIG_SETTING_NAME,
- NM_SETTING_IP6_CONFIG_DNS,
- ip6_dns_writer },
- { NM_SETTING_WIRELESS_SETTING_NAME,
- NM_SETTING_WIRELESS_SSID,
- ssid_writer },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PASSWORD_RAW,
- password_raw_writer },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_CA_CERT,
- cert_writer },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_CLIENT_CERT,
- cert_writer },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PRIVATE_KEY,
- cert_writer },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PHASE2_CA_CERT,
- cert_writer },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
- cert_writer },
- { NM_SETTING_802_1X_SETTING_NAME,
- NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
- cert_writer },
- { NULL, NULL, NULL }
-};
-
-typedef struct {
- GKeyFile *keyfile;
- const char *keyfile_dir;
- const char *uuid;
-} WriteInfo;
-
-static void
-write_setting_value (NMSetting *setting,
- const char *key,
- const GValue *value,
- GParamFlags flag,
- gpointer user_data)
-{
- WriteInfo *info = user_data;
- const char *setting_name;
- GType type = G_VALUE_TYPE (value);
- KeyWriter *writer = &key_writers[0];
- GParamSpec *pspec;
-
- /* Setting name gets picked up from the keyfile's section name instead */
- if (!strcmp (key, NM_SETTING_NAME))
- return;
-
- /* Don't write the NMSettingConnection object's 'read-only' property */
- if ( NM_IS_SETTING_CONNECTION (setting)
- && !strcmp (key, NM_SETTING_CONNECTION_READ_ONLY))
- return;
-
- setting_name = nm_setting_get_name (setting);
-
- /* If the value is the default value, remove the item from the keyfile */
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key);
- if (pspec) {
- if (g_param_value_defaults (pspec, (GValue *) value)) {
- g_key_file_remove_key (info->keyfile, setting_name, key, NULL);
- return;
- }
- }
-
- /* Don't write secrets that are owned by user secret agents or aren't
- * supposed to be saved. VPN secrets are handled specially though since
- * the secret flags there are in a third-level hash in the 'secrets'
- * property.
- */
- if (pspec && (pspec->flags & NM_SETTING_PARAM_SECRET) && !NM_IS_SETTING_VPN (setting)) {
- NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
-
- if (!nm_setting_get_secret_flags (setting, key, &secret_flags, NULL))
- g_assert_not_reached ();
- if (secret_flags != NM_SETTING_SECRET_FLAG_NONE)
- return;
- }
-
- /* Look through the list of handlers for non-standard format key values */
- while (writer->setting_name) {
- if (!strcmp (writer->setting_name, setting_name) && !strcmp (writer->key, key)) {
- (*writer->writer) (info->keyfile, info->keyfile_dir, info->uuid, setting, key, value);
- return;
- }
- writer++;
- }
-
- if (type == G_TYPE_STRING) {
- const char *str;
-
- str = g_value_get_string (value);
- if (str)
- nm_keyfile_plugin_kf_set_string (info->keyfile, setting_name, key, str);
- } else if (type == G_TYPE_UINT)
- nm_keyfile_plugin_kf_set_integer (info->keyfile, setting_name, key, (int) g_value_get_uint (value));
- else if (type == G_TYPE_INT)
- nm_keyfile_plugin_kf_set_integer (info->keyfile, setting_name, key, g_value_get_int (value));
- else if (type == G_TYPE_UINT64) {
- char *numstr;
-
- numstr = g_strdup_printf ("%" G_GUINT64_FORMAT, g_value_get_uint64 (value));
- nm_keyfile_plugin_kf_set_value (info->keyfile, setting_name, key, numstr);
- g_free (numstr);
- } else if (type == G_TYPE_BOOLEAN) {
- nm_keyfile_plugin_kf_set_boolean (info->keyfile, setting_name, key, g_value_get_boolean (value));
- } else if (type == G_TYPE_CHAR) {
- nm_keyfile_plugin_kf_set_integer (info->keyfile, setting_name, key, (int) g_value_get_schar (value));
- } else if (type == G_TYPE_BYTES) {
- GBytes *bytes;
- const guint8 *data;
- gsize len = 0;
-
- bytes = g_value_get_boxed (value);
- data = bytes ? g_bytes_get_data (bytes, &len) : NULL;
-
- if (data != NULL && len > 0) {
- int *tmp_array;
- int i;
-
- tmp_array = g_new (gint, len);
- for (i = 0; i < len; i++)
- tmp_array[i] = (int) data[i];
-
- nm_keyfile_plugin_kf_set_integer_list (info->keyfile, setting_name, key, tmp_array, len);
- g_free (tmp_array);
- }
- } else if (type == G_TYPE_STRV) {
- char **array;
-
- array = (char **) g_value_get_boxed (value);
- nm_keyfile_plugin_kf_set_string_list (info->keyfile, setting_name, key, (const gchar **const) array, g_strv_length (array));
- } else if (type == G_TYPE_HASH_TABLE) {
- write_hash_of_string (info->keyfile, setting, key, value);
- } else if (type == G_TYPE_ARRAY) {
- if (!write_array_of_uint (info->keyfile, setting, key, value)) {
- nm_log_warn (LOGD_SETTINGS, "Unhandled setting property type (write) '%s/%s' : '%s'",
- setting_name, key, g_type_name (type));
- }
- } else if (G_VALUE_HOLDS_FLAGS (value)) {
- /* Flags are guint but GKeyFile has no uint reader, just uint64 */
- nm_keyfile_plugin_kf_set_uint64 (info->keyfile, setting_name, key, (guint64) g_value_get_flags (value));
- } else if (G_VALUE_HOLDS_ENUM (value))
- nm_keyfile_plugin_kf_set_integer (info->keyfile, setting_name, key, (gint) g_value_get_enum (value));
- else {
- nm_log_warn (LOGD_SETTINGS, "Unhandled setting property type (write) '%s/%s' : '%s'",
- setting_name, key, g_type_name (type));
+ } else {
+ /* scheme_func() returns UNKNOWN in all other cases. The only valid case
+ * where a scheme is allowed to be UNKNOWN, is unsetting the value. In this
+ * case, we don't expect the writer to be called, because the default value
+ * will not be serialized.
+ * The only other reason for the scheme to be UNKNOWN is an invalid cert.
+ * But our connection verifies, so that cannot happen either. */
+ g_return_if_reached ();
}
}
-static char *
-_writer_id_to_filename (const char *id)
+static gboolean
+_handler_write (NMConnection *connection,
+ GKeyFile *keyfile,
+ NMKeyfileWriteType type,
+ void *type_data,
+ void *user_data,
+ GError **error)
{
- char *filename, *f;
- const char *i = id;
-
- f = filename = g_malloc0 (strlen (id) + 1);
-
- /* Convert '/' to '*' */
- while (*i) {
- if (*i == '/')
- *f++ = '*';
- else
- *f++ = *i;
- i++;
+ if (type == NM_KEYFILE_WRITE_TYPE_CERT) {
+ cert_writer (connection, keyfile,
+ (NMKeyfileWriteTypeDataCert *) type_data,
+ (WriteInfo *) user_data, error);
+ return TRUE;
}
-
- return filename;
+ return FALSE;
}
static gboolean
@@ -907,34 +238,29 @@ _internal_write_connection (NMConnection *connection,
char *data;
gsize len;
gboolean success = FALSE;
- char *filename = NULL, *path;
+ char *path;
const char *id;
- WriteInfo info;
+ WriteInfo info = { 0 };
GError *local_err = NULL;
- if (out_path)
- g_return_val_if_fail (*out_path == NULL, FALSE);
+ g_return_val_if_fail (!out_path || !*out_path, FALSE);
+ g_return_val_if_fail (keyfile_dir && keyfile_dir[0] == '/', FALSE);
- if (!nm_connection_verify (connection, error)) {
+ if (!nm_connection_verify (connection, error))
g_return_val_if_reached (FALSE);
- return FALSE;
- }
id = nm_connection_get_id (connection);
- if (!id) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "%s.%d: connection had no ID", __FILE__, __LINE__);
- return FALSE;
- }
+ g_assert (id && *id);
- info.keyfile = key_file = g_key_file_new ();
info.keyfile_dir = keyfile_dir;
- info.uuid = nm_connection_get_uuid (connection);
- g_assert (info.uuid);
- nm_connection_for_each_setting_value (connection, write_setting_value, &info);
+
+ key_file = nm_keyfile_write (connection, _handler_write, &info, error);
+ if (!key_file)
+ return FALSE;
data = g_key_file_to_data (key_file, &len, error);
+ g_key_file_unref (key_file);
if (!data)
- goto out;
+ return FALSE;
/* If we have existing file path, use it. Else generate one from
* connection's ID.
@@ -942,8 +268,10 @@ _internal_write_connection (NMConnection *connection,
if (existing_path != NULL) {
path = g_strdup (existing_path);
} else {
- filename = _writer_id_to_filename (id);
- path = g_build_filename (keyfile_dir, filename, NULL);
+ char *filename_escaped = nm_keyfile_plugin_utils_escape_filename (id);
+
+ path = g_build_filename (keyfile_dir, filename_escaped, NULL);
+ g_free (filename_escaped);
}
/* If a file with this path already exists (but isn't the existing path
@@ -953,24 +281,42 @@ _internal_write_connection (NMConnection *connection,
* there's a race here, but there's not a lot we can do about it, and
* we shouldn't get more than one connection with the same UUID either.
*/
- if (g_file_test (path, G_FILE_TEST_EXISTS) && (g_strcmp0 (path, existing_path) != 0)) {
- /* A keyfile with this connection's ID already exists. Pick another name. */
- g_free (path);
+ if (g_strcmp0 (path, existing_path) != 0 && g_file_test (path, G_FILE_TEST_EXISTS)) {
+ guint i;
+ gboolean name_found = FALSE;
- path = g_strdup_printf ("%s/%s-%s", keyfile_dir, filename, nm_connection_get_uuid (connection));
- if (g_file_test (path, G_FILE_TEST_EXISTS)) {
- if (existing_path == NULL || g_strcmp0 (path, existing_path) != 0) {
- /* This should not happen. But, it actually occurs when
- * two connections have the same UUID, and one of the connections
- * is edited to contain the same ID as the other one.
- * Give up.
- */
+ /* A keyfile with this connection's ID already exists. Pick another name. */
+ for (i = 0; i < 100; i++) {
+ char *filename, *filename_escaped;
+
+ if (i == 0)
+ filename = g_strdup_printf ("%s-%s", id, nm_connection_get_uuid (connection));
+ else
+ filename = g_strdup_printf ("%s-%s-%u", id, nm_connection_get_uuid (connection), i);
+
+ filename_escaped = nm_keyfile_plugin_utils_escape_filename (filename);
+
+ g_free (path);
+ path = g_strdup_printf ("%s/%s", keyfile_dir, filename_escaped);
+ g_free (filename);
+ g_free (filename_escaped);
+ if (g_strcmp0 (path, existing_path) == 0 || !g_file_test (path, G_FILE_TEST_EXISTS)) {
+ name_found = TRUE;
+ break;
+ }
+ }
+ if (!name_found) {
+ if (existing_path == NULL) {
+ /* this really should not happen, we tried hard to find an unused name... bail out. */
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
- "%s.%d: could not find suitable keyfile file name (%s already used)",
- __FILE__, __LINE__, path);
+ "could not find suitable keyfile file name (%s already used)", path);
g_free (path);
goto out;
}
+ /* Both our preferred path based on connection id and id-uuid are taken.
+ * Fallback to @existing_path */
+ g_free (path);
+ path = g_strdup (existing_path);
}
}
@@ -1012,9 +358,7 @@ _internal_write_connection (NMConnection *connection,
g_free (path);
out:
- g_free (filename);
g_free (data);
- g_key_file_free (key_file);
return success;
}
diff --git a/src/settings/plugins/keyfile/writer.h b/src/settings/plugins/keyfile/writer.h
index a602f2f4a3..8b08812d86 100644
--- a/src/settings/plugins/keyfile/writer.h
+++ b/src/settings/plugins/keyfile/writer.h
@@ -22,7 +22,6 @@
#ifndef _KEYFILE_PLUGIN_WRITER_H
#define _KEYFILE_PLUGIN_WRITER_H
-#include <sys/types.h>
#include <glib.h>
#include <nm-connection.h>
diff --git a/src/supplicant-manager/nm-call-store.c b/src/supplicant-manager/nm-call-store.c
deleted file mode 100644
index 950d199e3a..0000000000
--- a/src/supplicant-manager/nm-call-store.c
+++ /dev/null
@@ -1,117 +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 (C) 2007 Novell, Inc.
- * Copyright (C) 2010 Red Hat, Inc.
- */
-
-#include "nm-call-store.h"
-#include "nm-logging.h"
-
-NMCallStore *
-nm_call_store_new (void)
-{
- /* Maps { DBusGProxy :: GHashTable { DBusGProxyCall :: NULL } } */
- return g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_hash_table_destroy);
-}
-
-static void
-proxy_destroyed_cb (gpointer data, GObject *proxy)
-{
- g_hash_table_remove ((NMCallStore *) data, proxy);
-}
-
-void
-nm_call_store_add (NMCallStore *store,
- DBusGProxy *proxy,
- DBusGProxyCall *call)
-{
- GHashTable *calls;
-
- g_return_if_fail (store != NULL);
- g_return_if_fail (proxy != NULL);
-
- if (!call) {
- /* Allow calling nm_call_store_add() with NULL @call for convenience.
- * This way you can pass the result of dbus_g_proxy_begin_call() directly
- * to nm_call_store_add() without checking for NULL. */
- return;
- }
-
- calls = g_hash_table_lookup (store, proxy);
- if (!calls) {
- calls = g_hash_table_new (NULL, NULL);
- g_hash_table_insert (store, proxy, calls);
- g_object_weak_ref (G_OBJECT (proxy), proxy_destroyed_cb, store);
- }
-
- g_hash_table_add (calls, call);
-}
-
-void
-nm_call_store_remove (NMCallStore *store,
- DBusGProxy *proxy,
- DBusGProxyCall *call)
-{
- GHashTable *calls;
-
- g_return_if_fail (store != NULL);
- g_return_if_fail (proxy != NULL);
- g_return_if_fail (call != NULL);
-
- calls = g_hash_table_lookup (store, proxy);
- if (!calls)
- return;
-
- g_hash_table_remove (calls, call);
- if (g_hash_table_size (calls) == 0) {
- g_hash_table_remove (store, proxy);
- g_object_weak_unref (G_OBJECT (proxy), proxy_destroyed_cb, store);
- }
-}
-
-void
-nm_call_store_clear (NMCallStore *store)
-{
- DBusGProxy *proxy;
- GHashTable *calls;
- GHashTableIter proxies_iter;
-
- g_return_if_fail (store != NULL);
-
- g_hash_table_iter_init (&proxies_iter, store);
- while (g_hash_table_iter_next (&proxies_iter, (gpointer) &proxy, (gpointer) &calls)) {
- GHashTableIter calls_iter;
- DBusGProxyCall *call;
-
- g_hash_table_iter_init (&calls_iter, calls);
- while (g_hash_table_iter_next (&calls_iter, (gpointer) &call, NULL)) {
- dbus_g_proxy_cancel_call (proxy, call);
- g_hash_table_iter_remove (&calls_iter);
- }
- g_object_weak_unref (G_OBJECT (proxy), proxy_destroyed_cb, store);
- g_hash_table_iter_remove (&proxies_iter);
- }
- g_assert_cmpint (g_hash_table_size (store), ==, 0);
-}
-
-void
-nm_call_store_destroy (NMCallStore *store)
-{
- g_return_if_fail (store);
- g_hash_table_destroy (store);
-}
diff --git a/src/supplicant-manager/nm-call-store.h b/src/supplicant-manager/nm-call-store.h
deleted file mode 100644
index bcee54cfbb..0000000000
--- a/src/supplicant-manager/nm-call-store.h
+++ /dev/null
@@ -1,41 +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.
- *
- * (C) Copyright 2007 Novell, Inc.
- */
-
-#ifndef __NETWORKMANAGER_CALLBACK_STORE_H__
-#define __NETWORKMANAGER_CALLBACK_STORE_H__
-
-#include <glib-object.h>
-#include <dbus/dbus-glib.h>
-
-typedef GHashTable NMCallStore;
-
-NMCallStore *nm_call_store_new (void);
-void nm_call_store_add (NMCallStore *store,
- DBusGProxy *proxy,
- DBusGProxyCall *call);
-
-void nm_call_store_remove (NMCallStore *store,
- DBusGProxy *proxy,
- DBusGProxyCall *call);
-
-void nm_call_store_clear (NMCallStore *store);
-void nm_call_store_destroy (NMCallStore *store);
-
-#endif /* __NETWORKMANAGER_CALLBACK_STORE_H__ */
diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c
index f4ee4c3a2c..5df7b1e760 100644
--- a/src/supplicant-manager/nm-supplicant-config.c
+++ b/src/supplicant-manager/nm-supplicant-config.c
@@ -19,9 +19,7 @@
* Copyright (C) 2007 - 2008 Novell, Inc.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
#include <string.h>
#include <stdlib.h>
@@ -262,65 +260,44 @@ nm_supplicant_config_fast_required (NMSupplicantConfig *self)
return NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->fast_required;
}
-static void
-get_hash_cb (gpointer key, gpointer value, gpointer user_data)
-{
- ConfigOption *opt = (ConfigOption *) value;
- GValue *variant;
- GByteArray *array;
-
- variant = g_slice_new0 (GValue);
-
- switch (opt->type) {
- case TYPE_INT:
- g_value_init (variant, G_TYPE_INT);
- g_value_set_int (variant, atoi (opt->value));
- break;
- case TYPE_BYTES:
- case TYPE_UTF8:
- array = g_byte_array_sized_new (opt->len);
- g_byte_array_append (array, (const guint8 *) opt->value, opt->len);
- g_value_init (variant, DBUS_TYPE_G_UCHAR_ARRAY);
- g_value_set_boxed (variant, array);
- g_byte_array_free (array, TRUE);
- break;
- case TYPE_KEYWORD:
- case TYPE_STRING:
- g_value_init (variant, G_TYPE_STRING);
- g_value_set_string (variant, opt->value);
- break;
- default:
- g_slice_free (GValue, variant);
- return;
- }
-
- g_hash_table_insert ((GHashTable *) user_data, g_strdup (key), variant);
-}
-
-static void
-destroy_hash_value (gpointer data)
-{
- GValue *value = (GValue *) data;
-
- g_value_unset (value);
- g_slice_free (GValue, value);
-}
-
-GHashTable *
-nm_supplicant_config_get_hash (NMSupplicantConfig * self)
+GVariant *
+nm_supplicant_config_to_variant (NMSupplicantConfig *self)
{
NMSupplicantConfigPrivate *priv;
- GHashTable *hash;
+ GVariantBuilder builder;
+ GHashTableIter iter;
+ ConfigOption *option;
+ const char *key;
g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), NULL);
- hash = g_hash_table_new_full (g_str_hash, g_str_equal,
- (GDestroyNotify) g_free,
- destroy_hash_value);
-
priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self);
- g_hash_table_foreach (priv->config, get_hash_cb, hash);
- return hash;
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
+
+ g_hash_table_iter_init (&iter, priv->config);
+ while (g_hash_table_iter_next (&iter, (gpointer) &key, (gpointer) &option)) {
+ switch (option->type) {
+ case TYPE_INT:
+ g_variant_builder_add (&builder, "{sv}", key, g_variant_new_int32 (atoi (option->value)));
+ break;
+ case TYPE_BYTES:
+ case TYPE_UTF8:
+ g_variant_builder_add (&builder, "{sv}",
+ key,
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ option->value, option->len, 1));
+ break;
+ case TYPE_KEYWORD:
+ case TYPE_STRING:
+ g_variant_builder_add (&builder, "{sv}", key, g_variant_new_string (option->value));
+ break;
+ default:
+ break;
+ }
+ }
+
+ return g_variant_builder_end (&builder);
}
GHashTable *
@@ -542,19 +519,32 @@ add_wep_key (NMSupplicantConfig *self,
const char *name,
NMWepKeyType wep_type)
{
- char *value;
- gboolean success;
+ GBytes *bytes;
+ gboolean success = FALSE;
size_t key_len = key ? strlen (key) : 0;
if (!key || !key_len)
return TRUE;
+ if (wep_type == NM_WEP_KEY_TYPE_UNKNOWN) {
+ if (nm_utils_wep_key_valid (key, NM_WEP_KEY_TYPE_KEY))
+ wep_type = NM_WEP_KEY_TYPE_KEY;
+ else if (nm_utils_wep_key_valid (key, NM_WEP_KEY_TYPE_PASSPHRASE))
+ wep_type = NM_WEP_KEY_TYPE_PASSPHRASE;
+ }
+
if ( (wep_type == NM_WEP_KEY_TYPE_UNKNOWN)
|| (wep_type == NM_WEP_KEY_TYPE_KEY)) {
if ((key_len == 10) || (key_len == 26)) {
- value = nm_utils_hexstr2bin (key, strlen (key));
- success = nm_supplicant_config_add_option (self, name, value, key_len / 2, TRUE);
- g_free (value);
+ bytes = nm_utils_hexstr2bin (key);
+ if (bytes) {
+ success = nm_supplicant_config_add_option (self,
+ name,
+ g_bytes_get_data (bytes, NULL),
+ g_bytes_get_size (bytes),
+ TRUE);
+ g_bytes_unref (bytes);
+ }
if (!success) {
nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name);
return FALSE;
@@ -590,8 +580,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
NMSetting8021x *setting_8021x,
const char *con_uuid)
{
- char *value;
- gboolean success;
+ gboolean success = FALSE;
const char *key_mgmt, *auth_alg;
const char *psk;
@@ -612,10 +601,18 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
size_t psk_len = strlen (psk);
if (psk_len == 64) {
+ GBytes *bytes;
+
/* Hex PSK */
- value = nm_utils_hexstr2bin (psk, psk_len);
- success = nm_supplicant_config_add_option (self, "psk", value, psk_len / 2, TRUE);
- g_free (value);
+ bytes = nm_utils_hexstr2bin (psk);
+ if (bytes) {
+ success = nm_supplicant_config_add_option (self,
+ "psk",
+ g_bytes_get_data (bytes, NULL),
+ g_bytes_get_size (bytes),
+ TRUE);
+ g_bytes_unref (bytes);
+ }
if (!success) {
nm_log_warn (LOGD_SUPPLICANT, "Error adding 'psk' to supplicant config.");
return FALSE;
@@ -653,6 +650,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
const char *wep1 = nm_setting_wireless_security_get_wep_key (setting, 1);
const char *wep2 = nm_setting_wireless_security_get_wep_key (setting, 2);
const char *wep3 = nm_setting_wireless_security_get_wep_key (setting, 3);
+ char *value;
if (!add_wep_key (self, wep0, "wep_key0", wep_type))
return FALSE;
diff --git a/src/supplicant-manager/nm-supplicant-config.h b/src/supplicant-manager/nm-supplicant-config.h
index 482e3545b6..3324f637f4 100644
--- a/src/supplicant-manager/nm-supplicant-config.h
+++ b/src/supplicant-manager/nm-supplicant-config.h
@@ -59,7 +59,7 @@ void nm_supplicant_config_set_ap_scan (NMSupplicantConfig *self,
gboolean nm_supplicant_config_fast_required (NMSupplicantConfig *self);
-GHashTable *nm_supplicant_config_get_hash (NMSupplicantConfig *self);
+GVariant *nm_supplicant_config_to_variant (NMSupplicantConfig *self);
GHashTable *nm_supplicant_config_get_blobs (NMSupplicantConfig *self);
diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c
index 77924b3e7a..e9775a199c 100644
--- a/src/supplicant-manager/nm-supplicant-interface.c
+++ b/src/supplicant-manager/nm-supplicant-interface.c
@@ -19,20 +19,19 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include "NetworkManagerUtils.h"
#include "nm-supplicant-interface.h"
-#include "nm-supplicant-manager.h"
#include "nm-logging.h"
#include "nm-supplicant-config.h"
-#include "nm-dbus-manager.h"
-#include "nm-call-store.h"
-#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
+#include "gsystem-local-alloc.h"
+#include "nm-core-internal.h"
#define WPAS_DBUS_IFACE_INTERFACE WPAS_DBUS_INTERFACE ".Interface"
#define WPAS_DBUS_IFACE_BSS WPAS_DBUS_INTERFACE ".BSS"
@@ -42,16 +41,6 @@
G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT)
-static void wpas_iface_properties_changed (DBusGProxy *proxy,
- GHashTable *props,
- gpointer user_data);
-
-static void wpas_iface_scan_done (DBusGProxy *proxy,
- gboolean success,
- gpointer user_data);
-
-static void wpas_iface_get_props (NMSupplicantInterface *self);
-
#define NM_SUPPLICANT_INTERFACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
NM_TYPE_SUPPLICANT_INTERFACE, \
NMSupplicantInterfacePrivate))
@@ -80,89 +69,53 @@ enum {
typedef struct {
- NMSupplicantManager * smgr;
- gulong smgr_avail_id;
- NMDBusManager * dbus_mgr;
- char * dev;
- gboolean is_wireless;
- gboolean has_credreq; /* Whether querying 802.1x credentials is supported */
- ApSupport ap_support; /* Lightweight AP mode support */
- gboolean fast_supported;
- guint32 max_scan_ssids;
- guint32 ready_count;
-
- char * object_path;
- guint32 state;
- int disconnect_reason;
- NMCallStore * assoc_pcalls;
- NMCallStore * other_pcalls;
-
- gboolean scanning;
-
- DBusGProxy * wpas_proxy;
- DBusGProxy * introspect_proxy;
- DBusGProxy * iface_proxy;
- DBusGProxy * props_proxy;
- char * net_path;
- guint32 blobs_left;
- GHashTable * bss_proxies;
-
- gint32 last_scan; /* timestamp as returned by nm_utils_get_monotonic_timestamp_s() */
-
- NMSupplicantConfig * cfg;
-
- gboolean disposed;
+ char * dev;
+ gboolean is_wireless;
+ gboolean has_credreq; /* Whether querying 802.1x credentials is supported */
+ ApSupport ap_support; /* Lightweight AP mode support */
+ gboolean fast_supported;
+ guint32 max_scan_ssids;
+ guint32 ready_count;
+
+ char * object_path;
+ guint32 state;
+ int disconnect_reason;
+
+ gboolean scanning;
+
+ GDBusProxy * wpas_proxy;
+ GCancellable * init_cancellable;
+ GDBusProxy * iface_proxy;
+ GCancellable * other_cancellable;
+ GCancellable * assoc_cancellable;
+ char * net_path;
+ guint32 blobs_left;
+ GHashTable * bss_proxies;
+
+ gint32 last_scan; /* timestamp as returned by nm_utils_get_monotonic_timestamp_s() */
+
+ NMSupplicantConfig *cfg;
} NMSupplicantInterfacePrivate;
-static void
-emit_error_helper (NMSupplicantInterface *self,
- GError *err)
-{
- const char *name = NULL;
-
- if (err->domain == DBUS_GERROR && err->code == DBUS_GERROR_REMOTE_EXCEPTION)
- name = dbus_g_error_get_name (err);
-
- g_signal_emit (self, signals[CONNECTION_ERROR], 0, name, err->message);
-}
+/***************************************************************/
static void
-signal_new_bss (NMSupplicantInterface *self,
- const char *object_path,
- GHashTable *props)
+emit_error_helper (NMSupplicantInterface *self, GError *error)
{
- g_signal_emit (self, signals[NEW_BSS], 0, object_path, props);
-}
+ char *name = NULL;
-static void
-bssid_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
-{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *error = NULL;
- GHashTable *props = NULL;
-
- nm_call_store_remove (priv->other_pcalls, proxy, call_id);
- if (dbus_g_proxy_end_call (proxy, call_id, &error,
- DBUS_TYPE_G_MAP_OF_VARIANT, &props,
- G_TYPE_INVALID)) {
- signal_new_bss (self, dbus_g_proxy_get_path (proxy), props);
- g_hash_table_destroy (props);
- } else {
- if (!strstr (error->message, "The BSSID requested was invalid")) {
- nm_log_warn (LOGD_SUPPLICANT, "Couldn't retrieve BSSID properties: %s.",
- error->message);
- }
- g_error_free (error);
- }
+ if (g_dbus_error_is_remote_error (error))
+ name = g_dbus_error_get_remote_error (error);
+
+ g_signal_emit (self, signals[CONNECTION_ERROR], 0, name, error->message);
+ g_free (name);
}
static void
-bss_properties_changed (DBusGProxy *proxy,
- const char *interface,
- GHashTable *props,
- const char **unused,
- gpointer user_data)
+bss_props_changed_cb (GDBusProxy *proxy,
+ GVariant *changed_properties,
+ char **invalidated_properties,
+ gpointer user_data)
{
NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
@@ -170,111 +123,77 @@ bss_properties_changed (DBusGProxy *proxy,
if (priv->scanning)
priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
- if (g_strcmp0 (interface, WPAS_DBUS_IFACE_BSS) == 0)
- g_signal_emit (self, signals[BSS_UPDATED], 0, dbus_g_proxy_get_path (proxy), props);
+ g_signal_emit (self, signals[BSS_UPDATED], 0,
+ g_dbus_proxy_get_object_path (proxy),
+ changed_properties);
}
static void
-handle_new_bss (NMSupplicantInterface *self,
- const char *object_path,
- GHashTable *props)
+on_bss_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- DBusGProxy *bss_proxy;
- DBusGProxyCall *call;
-
- g_return_if_fail (object_path != NULL);
-
- if (g_hash_table_lookup (priv->bss_proxies, object_path))
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_free_error GError *error = NULL;
+ gs_strfreev char **properties = NULL;
+ gs_unref_variant GVariant *props = NULL;
+ GVariantBuilder builder;
+ char **iter;
+
+ if (!g_async_initable_init_finish (G_ASYNC_INITABLE (proxy), result, &error)) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ nm_log_dbg (LOGD_SUPPLICANT, "Failed to acquire BSS proxy: (%s)", error->message);
+ g_hash_table_remove (NM_SUPPLICANT_INTERFACE_GET_PRIVATE (user_data)->bss_proxies,
+ g_dbus_proxy_get_object_path (proxy));
+ }
return;
+ }
- bss_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr),
- WPAS_DBUS_SERVICE,
- object_path,
- DBUS_INTERFACE_PROPERTIES);
- g_hash_table_insert (priv->bss_proxies,
- (gpointer) dbus_g_proxy_get_path (bss_proxy),
- bss_proxy);
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- /* Standard D-Bus PropertiesChanged signal */
- dbus_g_object_register_marshaller (g_cclosure_marshal_generic,
- G_TYPE_NONE,
- G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_STRV,
- G_TYPE_INVALID);
- dbus_g_proxy_add_signal (bss_proxy, "PropertiesChanged",
- G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_STRV,
- G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (bss_proxy, "PropertiesChanged",
- G_CALLBACK (bss_properties_changed),
- self, NULL);
-
- if (props) {
- signal_new_bss (self, object_path, props);
- } else {
- call = dbus_g_proxy_begin_call (bss_proxy, "GetAll",
- bssid_properties_cb,
- self,
- NULL,
- G_TYPE_STRING, WPAS_DBUS_IFACE_BSS,
- G_TYPE_INVALID);
- nm_call_store_add (priv->other_pcalls, bss_proxy, call);
- }
-}
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
-static void
-wpas_iface_bss_added (DBusGProxy *proxy,
- const char *object_path,
- GHashTable *props,
- gpointer user_data)
-{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+ iter = properties = g_dbus_proxy_get_cached_property_names (proxy);
+ while (*iter) {
+ GVariant *copy = g_dbus_proxy_get_cached_property (proxy, *iter);
- if (priv->scanning)
- priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
+ g_variant_builder_add (&builder, "{sv}", *iter++, copy);
+ g_variant_unref (copy);
+ }
- handle_new_bss (self, object_path, props);
+ props = g_variant_builder_end (&builder);
+ g_signal_emit (self, signals[NEW_BSS], 0,
+ g_dbus_proxy_get_object_path (proxy),
+ g_variant_ref_sink (props));
}
static void
-wpas_iface_bss_removed (DBusGProxy *proxy,
- const char *object_path,
- gpointer user_data)
+handle_new_bss (NMSupplicantInterface *self, const char *object_path)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+ GDBusProxy *bss_proxy;
- g_signal_emit (self, signals[BSS_REMOVED], 0, object_path);
-
- g_hash_table_remove (priv->bss_proxies, object_path);
-}
+ g_return_if_fail (object_path != NULL);
-static int
-wpas_state_string_to_enum (const char *str_state)
-{
- if (!strcmp (str_state, "interface_disabled"))
- return NM_SUPPLICANT_INTERFACE_STATE_DISABLED;
- else if (!strcmp (str_state, "disconnected"))
- return NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED;
- else if (!strcmp (str_state, "inactive"))
- return NM_SUPPLICANT_INTERFACE_STATE_INACTIVE;
- else if (!strcmp (str_state, "scanning"))
- return NM_SUPPLICANT_INTERFACE_STATE_SCANNING;
- else if (!strcmp (str_state, "authenticating"))
- return NM_SUPPLICANT_INTERFACE_STATE_AUTHENTICATING;
- else if (!strcmp (str_state, "associating"))
- return NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING;
- else if (!strcmp (str_state, "associated"))
- return NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED;
- else if (!strcmp (str_state, "4way_handshake"))
- return NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE;
- else if (!strcmp (str_state, "group_handshake"))
- return NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE;
- else if (!strcmp (str_state, "completed"))
- return NM_SUPPLICANT_INTERFACE_STATE_COMPLETED;
+ if (g_hash_table_lookup (priv->bss_proxies, object_path))
+ return;
- nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant state '%s'", str_state);
- return -1;
+ bss_proxy = g_object_new (G_TYPE_DBUS_PROXY,
+ "g-bus-type", G_BUS_TYPE_SYSTEM,
+ "g-flags", G_DBUS_PROXY_FLAGS_NONE,
+ "g-name", WPAS_DBUS_SERVICE,
+ "g-object-path", object_path,
+ "g-interface-name", WPAS_DBUS_IFACE_BSS,
+ NULL);
+ g_hash_table_insert (priv->bss_proxies,
+ (char *) g_dbus_proxy_get_object_path (bss_proxy),
+ bss_proxy);
+ g_signal_connect (bss_proxy, "g-properties-changed", G_CALLBACK (bss_props_changed_cb), self);
+ g_async_initable_init_async (G_ASYNC_INITABLE (bss_proxy),
+ G_PRIORITY_DEFAULT,
+ priv->other_cancellable,
+ (GAsyncReadyCallback) on_bss_proxy_acquired,
+ self);
}
static void
@@ -296,39 +215,23 @@ set_state (NMSupplicantInterface *self, guint32 new_state)
g_return_if_fail (new_state > NM_SUPPLICANT_INTERFACE_STATE_READY);
if (new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) {
- /* Get properties again to update to the actual wpa_supplicant
- * interface state.
- */
- wpas_iface_get_props (self);
- } else if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) {
- /* Cancel all pending calls when going down */
- nm_call_store_clear (priv->other_pcalls);
- nm_call_store_clear (priv->assoc_pcalls);
-
- /* Disconnect supplicant manager state listeners since we're done */
- if (priv->smgr_avail_id) {
- g_signal_handler_disconnect (priv->smgr, priv->smgr_avail_id);
- priv->smgr_avail_id = 0;
+ if (priv->other_cancellable) {
+ g_warn_if_fail (priv->other_cancellable == NULL);
+ g_cancellable_cancel (priv->other_cancellable);
+ g_clear_object (&priv->other_cancellable);
}
+ priv->other_cancellable = g_cancellable_new ();
+ } else if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) {
+ if (priv->init_cancellable)
+ g_cancellable_cancel (priv->init_cancellable);
+ g_clear_object (&priv->init_cancellable);
- if (priv->iface_proxy) {
- dbus_g_proxy_disconnect_signal (priv->iface_proxy,
- "PropertiesChanged",
- G_CALLBACK (wpas_iface_properties_changed),
- self);
- dbus_g_proxy_disconnect_signal (priv->iface_proxy,
- "ScanDone",
- G_CALLBACK (wpas_iface_scan_done),
- self);
- dbus_g_proxy_disconnect_signal (priv->iface_proxy,
- "BSSAdded",
- G_CALLBACK (wpas_iface_bss_added),
- self);
- dbus_g_proxy_disconnect_signal (priv->iface_proxy,
- "BSSRemoved",
- G_CALLBACK (wpas_iface_bss_removed),
- self);
- }
+ if (priv->other_cancellable)
+ g_cancellable_cancel (priv->other_cancellable);
+ g_clear_object (&priv->other_cancellable);
+
+ if (priv->iface_proxy)
+ g_signal_handlers_disconnect_by_data (priv->iface_proxy, self);
}
priv->state = new_state;
@@ -347,6 +250,34 @@ set_state (NMSupplicantInterface *self, guint32 new_state)
priv->disconnect_reason);
}
+static int
+wpas_state_string_to_enum (const char *str_state)
+{
+ if (!strcmp (str_state, "interface_disabled"))
+ return NM_SUPPLICANT_INTERFACE_STATE_DISABLED;
+ else if (!strcmp (str_state, "disconnected"))
+ return NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED;
+ else if (!strcmp (str_state, "inactive"))
+ return NM_SUPPLICANT_INTERFACE_STATE_INACTIVE;
+ else if (!strcmp (str_state, "scanning"))
+ return NM_SUPPLICANT_INTERFACE_STATE_SCANNING;
+ else if (!strcmp (str_state, "authenticating"))
+ return NM_SUPPLICANT_INTERFACE_STATE_AUTHENTICATING;
+ else if (!strcmp (str_state, "associating"))
+ return NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING;
+ else if (!strcmp (str_state, "associated"))
+ return NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED;
+ else if (!strcmp (str_state, "4way_handshake"))
+ return NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE;
+ else if (!strcmp (str_state, "group_handshake"))
+ return NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE;
+ else if (!strcmp (str_state, "completed"))
+ return NM_SUPPLICANT_INTERFACE_STATE_COMPLETED;
+
+ nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant state '%s'", str_state);
+ return -1;
+}
+
static void
set_state_from_string (NMSupplicantInterface *self, const char *new_state)
{
@@ -395,107 +326,36 @@ nm_supplicant_interface_get_last_scan_time (NMSupplicantInterface *self)
return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->last_scan;
}
-static void
-wpas_iface_scan_done (DBusGProxy *proxy,
- gboolean success,
- gpointer user_data)
-{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
-
- /* Cache last scan completed time */
- priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
- g_signal_emit (self, signals[SCAN_DONE], 0, success);
-}
+#define MATCH_PROPERTY(p, n, v, t) (!strcmp (p, n) && g_variant_is_of_type (v, t))
static void
-parse_capabilities (NMSupplicantInterface *self, GHashTable *props)
+parse_capabilities (NMSupplicantInterface *self, GVariant *capabilities)
{
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GValue *value;
gboolean have_active = FALSE, have_ssid = FALSE;
+ gint32 max_scan_ssids = -1;
+ const char **array;
- g_return_if_fail (props != NULL);
+ g_return_if_fail (capabilities && g_variant_is_of_type (capabilities, G_VARIANT_TYPE_VARDICT));
- value = g_hash_table_lookup (props, "Scan");
- if (value && G_VALUE_HOLDS (value, G_TYPE_STRV)) {
- const char **vals = g_value_get_boxed (value);
- const char **iter = vals;
-
- while (iter && *iter && (!have_active || !have_ssid)) {
- if (g_strcmp0 (*iter, "active") == 0)
- have_active = TRUE;
- else if (g_strcmp0 (*iter, "ssid") == 0)
- have_ssid = TRUE;
- iter++;
- }
+ if (g_variant_lookup (capabilities, "Scan", "^a&s", &array)) {
+ if (_nm_utils_string_in_list ("active", array))
+ have_active = TRUE;
+ if (_nm_utils_string_in_list ("ssid", array))
+ have_ssid = TRUE;
+ g_free (array);
}
- value = g_hash_table_lookup (props, "MaxScanSSID");
- if (value && G_VALUE_HOLDS (value, G_TYPE_INT)) {
+ if (g_variant_lookup (capabilities, "MaxScanSSID", "i", &max_scan_ssids)) {
/* We need active scan and SSID probe capabilities to care about MaxScanSSIDs */
- if (have_active && have_ssid) {
+ if (max_scan_ssids > 0 && have_active && have_ssid) {
/* wpa_supplicant's WPAS_MAX_SCAN_SSIDS value is 16, but for speed
* and to ensure we don't disclose too many SSIDs from the hidden
* list, we'll limit to 5.
*/
- priv->max_scan_ssids = CLAMP (g_value_get_int (value), 0, 5);
+ priv->max_scan_ssids = CLAMP (max_scan_ssids, 0, 5);
nm_log_info (LOGD_SUPPLICANT, "(%s) supports %d scan SSIDs",
- priv->dev, priv->max_scan_ssids);
- }
- }
-}
-
-static void
-wpas_iface_properties_changed (DBusGProxy *proxy,
- GHashTable *props,
- gpointer user_data)
-{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GValue *value;
-
- value = g_hash_table_lookup (props, "Scanning");
- if (value && G_VALUE_HOLDS_BOOLEAN (value))
- set_scanning (self, g_value_get_boolean (value));
-
- value = g_hash_table_lookup (props, "State");
- if (value && G_VALUE_HOLDS_STRING (value)) {
- if (priv->state >= NM_SUPPLICANT_INTERFACE_STATE_READY) {
- /* Only transition to actual wpa_supplicant interface states (ie,
- * anything > READY) after the NMSupplicantInterface has had a
- * chance to initialize, which is signalled by entering the READY
- * state.
- */
- set_state_from_string (self, g_value_get_string (value));
- }
- }
-
- value = g_hash_table_lookup (props, "BSSs");
- if (value && G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH)) {
- GPtrArray *paths = g_value_get_boxed (value);
- int i;
-
- for (i = 0; paths && (i < paths->len); i++)
- handle_new_bss (self, g_ptr_array_index (paths, i), NULL);
- }
-
- value = g_hash_table_lookup (props, "Capabilities");
- if (value && G_VALUE_HOLDS (value, DBUS_TYPE_G_MAP_OF_VARIANT))
- parse_capabilities (self, g_value_get_boxed (value));
-
- /* Disconnect reason is currently only given for deauthentication events,
- * not disassociation; currently they are IEEE 802.11 "reason codes",
- * defined by (IEEE 802.11-2007, 7.3.1.7, Table 7-22). Any locally caused
- * deauthentication will be negative, while authentications caused by the
- * AP will be positive.
- */
- value = g_hash_table_lookup (props, "DisconnectReason");
- if (value && G_VALUE_HOLDS (value, G_TYPE_INT)) {
- priv->disconnect_reason = g_value_get_int (value);
- if (priv->disconnect_reason != 0) {
- nm_log_warn (LOGD_SUPPLICANT, "Connection disconnected (reason %d)",
- priv->disconnect_reason);
+ priv->dev, priv->max_scan_ssids);
}
}
}
@@ -512,43 +372,6 @@ iface_check_ready (NMSupplicantInterface *self)
}
}
-static void
-iface_get_props_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
-{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GHashTable *props = NULL;
- GError *error = NULL;
-
- nm_call_store_remove (priv->other_pcalls, proxy, call_id);
- if (dbus_g_proxy_end_call (proxy, call_id, &error,
- DBUS_TYPE_G_MAP_OF_VARIANT, &props,
- G_TYPE_INVALID)) {
- wpas_iface_properties_changed (NULL, props, self);
- g_hash_table_destroy (props);
- } else {
- nm_log_warn (LOGD_SUPPLICANT, "could not get interface properties: %s.",
- error && error->message ? error->message : "(unknown)");
- g_clear_error (&error);
- }
- iface_check_ready (self);
-}
-
-static void
-wpas_iface_get_props (NMSupplicantInterface *self)
-{
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- DBusGProxyCall *call;
-
- call = dbus_g_proxy_begin_call (priv->props_proxy, "GetAll",
- iface_get_props_cb,
- self,
- NULL,
- G_TYPE_STRING, WPAS_DBUS_IFACE_INTERFACE,
- G_TYPE_INVALID);
- nm_call_store_add (priv->other_pcalls, priv->props_proxy, call);
-}
-
gboolean
nm_supplicant_interface_credentials_reply (NMSupplicantInterface *self,
const char *field,
@@ -556,6 +379,7 @@ nm_supplicant_interface_credentials_reply (NMSupplicantInterface *self,
GError **error)
{
NMSupplicantInterfacePrivate *priv;
+ gs_unref_variant GVariant *reply = NULL;
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE);
g_return_val_if_fail (field != NULL, FALSE);
@@ -566,74 +390,62 @@ nm_supplicant_interface_credentials_reply (NMSupplicantInterface *self,
/* Need a network block object path */
g_return_val_if_fail (priv->net_path, FALSE);
- return dbus_g_proxy_call_with_timeout (priv->iface_proxy, "NetworkReply",
- 5000,
- error,
- DBUS_TYPE_G_OBJECT_PATH, priv->net_path,
- G_TYPE_STRING, field,
- G_TYPE_STRING, value,
- G_TYPE_INVALID);
+ reply = g_dbus_proxy_call_sync (priv->iface_proxy,
+ "NetworkReply",
+ g_variant_new ("(oss)",
+ priv->net_path,
+ field,
+ value),
+ G_DBUS_CALL_FLAGS_NONE,
+ 5000,
+ NULL,
+ error);
+ /* reply will be unrefed when function exits */
+ return !!reply;
}
-static void
-wpas_iface_network_request (DBusGProxy *proxy,
- const char *object_path,
- const char *field,
- const char *message,
- gpointer user_data)
+static gboolean
+_dbus_error_has_name (GError *error, const char *dbus_error_name)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+ gs_free char *error_name = NULL;
+ gboolean is_error = FALSE;
- g_return_if_fail (priv->has_credreq == TRUE);
- g_return_if_fail (priv->net_path != NULL);
- g_return_if_fail (g_strcmp0 (object_path, priv->net_path) == 0);
-
- g_signal_emit (self, signals[CREDENTIALS_REQUEST], 0, field, message);
+ if (error && g_dbus_error_is_remote_error (error)) {
+ error_name = g_dbus_error_get_remote_error (error);
+ is_error = !g_strcmp0 (error_name, dbus_error_name);
+ }
+ return is_error;
}
static void
-iface_check_netreply_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+iface_check_netreply_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *error = NULL;
-
- nm_call_store_remove (priv->other_pcalls, proxy, call_id);
- if ( dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)
- || dbus_g_error_has_name (error, "fi.w1.wpa_supplicant1.InvalidArgs")) {
- /* We know NetworkReply is supported if the NetworkReply method returned
- * successfully (which is unexpected since we sent a bogus network
- * object path) or if we got an "InvalidArgs" (which indicates NetworkReply
- * is supported). We know it's not supported if we get an
- * "UnknownMethod" error.
- */
- priv->has_credreq = TRUE;
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_unref_variant GVariant *variant = NULL;
+ gs_free_error GError *error = NULL;
+
+ /* We know NetworkReply is supported if the NetworkReply method returned
+ * successfully (which is unexpected since we sent a bogus network
+ * object path) or if we got an "InvalidArgs" (which indicates NetworkReply
+ * is supported). We know it's not supported if we get an
+ * "UnknownMethod" error.
+ */
- nm_log_dbg (LOGD_SUPPLICANT, "Supplicant %s network credentials requests",
- priv->has_credreq ? "supports" : "does not support");
- }
- g_clear_error (&error);
+ variant = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
- iface_check_ready (self);
-}
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
-static void
-wpas_iface_check_network_reply (NMSupplicantInterface *self)
-{
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- DBusGProxyCall *call;
+ if (variant || _dbus_error_has_name (error, "fi.w1.wpa_supplicant1.InvalidArgs"))
+ priv->has_credreq = TRUE;
- priv->ready_count++;
- call = dbus_g_proxy_begin_call (priv->iface_proxy, "NetworkReply",
- iface_check_netreply_cb,
- self,
- NULL,
- DBUS_TYPE_G_OBJECT_PATH, "/foobaraasdfasdf",
- G_TYPE_STRING, "foobar",
- G_TYPE_STRING, "foobar",
- G_TYPE_INVALID);
- nm_call_store_add (priv->other_pcalls, priv->iface_proxy, call);
+ nm_log_dbg (LOGD_SUPPLICANT, "Supplicant %s network credentials requests",
+ priv->has_credreq ? "supports" : "does not support");
+
+ iface_check_ready (self);
}
ApSupport
@@ -656,207 +468,271 @@ nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self,
}
static void
-iface_check_ap_mode_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+iface_check_ap_mode_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- char *data;
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_unref_variant GVariant *variant = NULL;
+ gs_free_error GError *error = NULL;
+ const char *data;
/* The ProbeRequest method only exists if AP mode has been enabled */
- nm_call_store_remove (priv->other_pcalls, proxy, call_id);
- if (dbus_g_proxy_end_call (proxy, call_id, NULL,
- G_TYPE_STRING,
- &data,
- G_TYPE_INVALID)) {
- if (data && strstr (data, "ProbeRequest"))
+ variant = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+
+ if (variant && g_variant_is_of_type (variant, G_VARIANT_TYPE ("(s)"))) {
+ g_variant_get (variant, "(&s)", &data);
+ if (strstr (data, "ProbeRequest"))
priv->ap_support = AP_SUPPORT_YES;
- g_free (data);
}
iface_check_ready (self);
}
+#define MATCH_SIGNAL(s, n, v, t) (!strcmp (s, n) && g_variant_is_of_type (v, t))
+
static void
-wpas_iface_check_ap_mode (NMSupplicantInterface *self)
+signal_cb (GDBusProxy *proxy,
+ const gchar *sender,
+ const gchar *signal,
+ GVariant *args,
+ gpointer user_data)
{
+ NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- DBusGProxyCall *call;
+ const char *path, *field, *message;
+ gboolean success;
- priv->ready_count++;
+ if (MATCH_SIGNAL (signal, "ScanDone", args, G_VARIANT_TYPE ("(b)"))) {
+ /* Cache last scan completed time */
+ priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
- /* If the global supplicant capabilities property is not present, we can
- * fall back to checking whether the ProbeRequest method is supported. If
- * neither of these works we have no way of determining if AP mode is
- * supported or not. hostap 1.0 and earlier don't support either of these.
- */
- call = dbus_g_proxy_begin_call (priv->introspect_proxy, "Introspect",
- iface_check_ap_mode_cb,
- self,
- NULL,
- G_TYPE_INVALID);
- nm_call_store_add (priv->other_pcalls, priv->introspect_proxy, call);
+ g_variant_get (args, "(b)", &success);
+ g_signal_emit (self, signals[SCAN_DONE], 0, success);
+ } else if (MATCH_SIGNAL (signal, "BSSAdded", args, G_VARIANT_TYPE ("(oa{sv})"))) {
+ if (priv->scanning)
+ priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
+
+ g_variant_get (args, "(&oa{sv})", &path, NULL);
+ handle_new_bss (self, path);
+ } else if (MATCH_SIGNAL (signal, "BSSRemoved", args, G_VARIANT_TYPE ("(o)"))) {
+ g_variant_get (args, "(&o)", &path);
+ g_signal_emit (self, signals[BSS_REMOVED], 0, path);
+ g_hash_table_remove (priv->bss_proxies, path);
+ } else if (MATCH_SIGNAL (signal, "NetworkRequest", args, G_VARIANT_TYPE ("(oss)"))) {
+ g_variant_get (args, "(&o&s&s)", &path, &field, &message);
+ if (priv->has_credreq && priv->net_path && !g_strcmp0 (path, priv->net_path))
+ g_signal_emit (self, signals[CREDENTIALS_REQUEST], 0, field, message);
+ }
}
static void
-interface_add_done (NMSupplicantInterface *self, char *path)
+props_changed_cb (GDBusProxy *proxy,
+ GVariant *changed_properties,
+ GStrv invalidated_properties,
+ gpointer user_data)
{
+ NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+ const char *s, **array, **iter;
+ gboolean b = FALSE;
+ gint32 i32;
+ GVariant *v;
+
+ if (g_variant_lookup (changed_properties, "Scanning", "b", &b))
+ set_scanning (self, b);
+
+ if ( g_variant_lookup (changed_properties, "State", "&s", &s)
+ && priv->state >= NM_SUPPLICANT_INTERFACE_STATE_READY) {
+ /* Only transition to actual wpa_supplicant interface states (ie,
+ * anything > READY) after the NMSupplicantInterface has had a
+ * chance to initialize, which is signalled by entering the READY
+ * state.
+ */
+ set_state_from_string (self, s);
+ }
- nm_log_dbg (LOGD_SUPPLICANT, "(%s): interface added to supplicant", priv->dev);
+ if (g_variant_lookup (changed_properties, "BSSs", "^a&s", &array)) {
+ iter = array;
+ while (*iter)
+ handle_new_bss (self, *iter++);
+ g_free (array);
+ }
- priv->object_path = path;
-
- priv->iface_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr),
- WPAS_DBUS_SERVICE,
- path,
- WPAS_DBUS_IFACE_INTERFACE);
-
- dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__BOXED,
- G_TYPE_NONE,
- DBUS_TYPE_G_MAP_OF_VARIANT,
- G_TYPE_INVALID);
- dbus_g_proxy_add_signal (priv->iface_proxy, "PropertiesChanged",
- DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->iface_proxy, "PropertiesChanged",
- G_CALLBACK (wpas_iface_properties_changed),
- self, NULL);
-
- dbus_g_proxy_add_signal (priv->iface_proxy, "ScanDone",
- G_TYPE_BOOLEAN, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->iface_proxy, "ScanDone",
- G_CALLBACK (wpas_iface_scan_done),
- self,
- NULL);
-
- dbus_g_object_register_marshaller (g_cclosure_marshal_generic,
- G_TYPE_NONE,
- DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT,
- G_TYPE_INVALID);
- dbus_g_proxy_add_signal (priv->iface_proxy, "BSSAdded",
- DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT,
- G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->iface_proxy, "BSSAdded",
- G_CALLBACK (wpas_iface_bss_added),
- self,
- NULL);
-
- dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__BOXED,
- G_TYPE_NONE,
- DBUS_TYPE_G_OBJECT_PATH,
- G_TYPE_INVALID);
- dbus_g_proxy_add_signal (priv->iface_proxy, "BSSRemoved",
- DBUS_TYPE_G_OBJECT_PATH,
- G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->iface_proxy, "BSSRemoved",
- G_CALLBACK (wpas_iface_bss_removed),
- self,
- NULL);
-
- dbus_g_object_register_marshaller (g_cclosure_marshal_generic,
- G_TYPE_NONE,
- DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_INVALID);
- dbus_g_proxy_add_signal (priv->iface_proxy, "NetworkRequest",
- DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->iface_proxy, "NetworkRequest",
- G_CALLBACK (wpas_iface_network_request),
- self,
- NULL);
-
- priv->introspect_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr),
- WPAS_DBUS_SERVICE,
- priv->object_path,
- DBUS_INTERFACE_INTROSPECTABLE);
-
- priv->props_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr),
- WPAS_DBUS_SERVICE,
- path,
- DBUS_INTERFACE_PROPERTIES);
- /* Get initial properties and check whether NetworkReply is supported */
- priv->ready_count = 1;
- wpas_iface_get_props (self);
+ v = g_variant_lookup_value (changed_properties, "Capabilities", G_VARIANT_TYPE_VARDICT);
+ if (v) {
+ parse_capabilities (self, v);
+ g_variant_unref (v);
+ }
- /* These two increment ready_count themselves */
- wpas_iface_check_network_reply (self);
- if (priv->ap_support == AP_SUPPORT_UNKNOWN)
- wpas_iface_check_ap_mode (self);
+ if (g_variant_lookup (changed_properties, "DisconnectReason", "i", &i32)) {
+ /* Disconnect reason is currently only given for deauthentication events,
+ * not disassociation; currently they are IEEE 802.11 "reason codes",
+ * defined by (IEEE 802.11-2007, 7.3.1.7, Table 7-22). Any locally caused
+ * deauthentication will be negative, while authentications caused by the
+ * AP will be positive.
+ */
+ priv->disconnect_reason = i32;
+ if (priv->disconnect_reason != 0) {
+ nm_log_warn (LOGD_SUPPLICANT, "Connection disconnected (reason %d)",
+ priv->disconnect_reason);
+ }
+ }
}
static void
-interface_get_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *error = NULL;
- char *path = NULL;
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_free_error GError *error = NULL;
- nm_call_store_remove (priv->other_pcalls, proxy, call_id);
- if (dbus_g_proxy_end_call (proxy, call_id, &error,
- DBUS_TYPE_G_OBJECT_PATH, &path,
- G_TYPE_INVALID)) {
- interface_add_done (self, path);
- } else {
- nm_log_err (LOGD_SUPPLICANT, "(%s): error getting interface: %s",
- priv->dev, error->message);
- g_clear_error (&error);
- set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN);
+ if (!g_async_initable_init_finish (G_ASYNC_INITABLE (proxy), result, &error)) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ nm_log_warn (LOGD_SUPPLICANT, "Failed to acquire wpa_supplicant interface proxy: (%s)", error->message);
+ set_state (NM_SUPPLICANT_INTERFACE (user_data), NM_SUPPLICANT_INTERFACE_STATE_DOWN);
+ }
+ return;
+ }
+
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+
+ g_signal_connect (priv->iface_proxy, "g-signal", G_CALLBACK (signal_cb), self);
+
+ /* Check whether NetworkReply and AP mode are supported */
+ priv->ready_count = 1;
+ g_dbus_proxy_call (priv->iface_proxy,
+ "NetworkReply",
+ g_variant_new ("(oss)",
+ "/fff",
+ "foobar",
+ "foobar"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->init_cancellable,
+ (GAsyncReadyCallback) iface_check_netreply_cb,
+ self);
+
+ if (priv->ap_support == AP_SUPPORT_UNKNOWN) {
+ /* If the global supplicant capabilities property is not present, we can
+ * fall back to checking whether the ProbeRequest method is supported. If
+ * neither of these works we have no way of determining if AP mode is
+ * supported or not. hostap 1.0 and earlier don't support either of these.
+ */
+ priv->ready_count++;
+ g_dbus_proxy_call (priv->iface_proxy,
+ "org.freedesktop.DBus.Introspectable.Introspect",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->init_cancellable,
+ (GAsyncReadyCallback) iface_check_ap_mode_cb,
+ self);
}
}
static void
-interface_get (NMSupplicantInterface *self)
+interface_add_done (NMSupplicantInterface *self, const char *path)
{
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- DBusGProxyCall *call;
- call = dbus_g_proxy_begin_call (priv->wpas_proxy, "GetInterface",
- interface_get_cb,
- self,
- NULL,
- G_TYPE_STRING, priv->dev,
- G_TYPE_INVALID);
- nm_call_store_add (priv->other_pcalls, priv->wpas_proxy, call);
+ nm_log_dbg (LOGD_SUPPLICANT, "(%s): interface added to supplicant", priv->dev);
+
+ priv->object_path = g_strdup (path);
+ priv->iface_proxy = g_object_new (G_TYPE_DBUS_PROXY,
+ "g-bus-type", G_BUS_TYPE_SYSTEM,
+ "g-flags", G_DBUS_PROXY_FLAGS_NONE,
+ "g-name", WPAS_DBUS_SERVICE,
+ "g-object-path", priv->object_path,
+ "g-interface-name", WPAS_DBUS_IFACE_INTERFACE,
+ NULL);
+ g_signal_connect (priv->iface_proxy, "g-properties-changed", G_CALLBACK (props_changed_cb), self);
+ g_async_initable_init_async (G_ASYNC_INITABLE (priv->iface_proxy),
+ G_PRIORITY_DEFAULT,
+ priv->init_cancellable,
+ (GAsyncReadyCallback) on_iface_proxy_acquired,
+ self);
}
static void
-interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+interface_get_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *error = NULL;
- char *path = NULL;
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_unref_variant GVariant *variant = NULL;
+ gs_free_error GError *error = NULL;
+ char *path;
- nm_call_store_remove (priv->other_pcalls, proxy, call_id);
- if (dbus_g_proxy_end_call (proxy, call_id, &error,
- DBUS_TYPE_G_OBJECT_PATH, &path,
- G_TYPE_INVALID)) {
+ variant = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+
+ if (variant && g_variant_is_of_type (variant, G_VARIANT_TYPE ("(o)"))) {
+ g_variant_get (variant, "(o)", &path);
interface_add_done (self, path);
+ g_free (path);
} else {
- if (dbus_g_error_has_name (error, WPAS_ERROR_EXISTS_ERROR)) {
- /* Interface already added, just get its object path */
- interface_get (self);
- } else if ( g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN)
- || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SPAWN_EXEC_FAILED)
- || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SPAWN_FORK_FAILED)
- || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SPAWN_FAILED)
- || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_TIMEOUT)
- || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_NO_REPLY)
- || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_TIMED_OUT)
- || dbus_g_error_has_name (error, DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) {
- /* Supplicant wasn't running and could not be launched via service
- * activation. Wait for it to start by moving back to the INIT
- * state.
- */
- nm_log_dbg (LOGD_SUPPLICANT, "(%s): failed to activate supplicant: %s",
- priv->dev, error->message);
- set_state (self, NM_SUPPLICANT_INTERFACE_STATE_INIT);
- } else {
- nm_log_err (LOGD_SUPPLICANT, "(%s): error adding interface: %s",
- priv->dev, error->message);
- set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN);
- }
- g_clear_error (&error);
+ nm_log_err (LOGD_SUPPLICANT, "(%s): error getting interface: %s", priv->dev, error->message);
+ set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN);
+ }
+}
+
+static void
+interface_add_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
+{
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_free_error GError *error = NULL;
+ gs_unref_variant GVariant *variant = NULL;
+ char *path;
+
+ variant = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+
+ if (variant && g_variant_is_of_type (variant, G_VARIANT_TYPE ("(o)"))) {
+ g_variant_get (variant, "(o)", &path);
+ interface_add_done (self, path);
+ g_free (path);
+ } else if (_dbus_error_has_name (error, WPAS_ERROR_EXISTS_ERROR)) {
+ /* Interface already added, just get its object path */
+ g_dbus_proxy_call (priv->wpas_proxy,
+ "GetInterface",
+ g_variant_new ("(s)", priv->dev),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->init_cancellable,
+ (GAsyncReadyCallback) interface_get_cb,
+ self);
+ } else if ( g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)
+ || g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_EXEC_FAILED)
+ || g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FORK_FAILED)
+ || g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FAILED)
+ || g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_TIMEOUT)
+ || g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_NO_REPLY)
+ || g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_TIMED_OUT)
+ || g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) {
+ /* Supplicant wasn't running and could not be launched via service
+ * activation. Wait for it to start by moving back to the INIT
+ * state.
+ */
+ nm_log_dbg (LOGD_SUPPLICANT, "(%s): failed to activate supplicant: %s",
+ priv->dev, error->message);
+ set_state (self, NM_SUPPLICANT_INTERFACE_STATE_INIT);
+ } else {
+ nm_log_err (LOGD_SUPPLICANT, "(%s): error adding interface: %s", priv->dev, error->message);
+ set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN);
}
}
@@ -867,59 +743,90 @@ interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data
#endif
static void
-interface_add (NMSupplicantInterface *self, gboolean is_wireless)
+on_wpas_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- DBusGProxyCall *call;
- GHashTable *hash;
- GValue driver = G_VALUE_INIT;
- GValue ifname = G_VALUE_INIT;
-
- /* Can only start the interface from INIT state */
- g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT);
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_free_error GError *error = NULL;
+ GDBusProxy *wpas_proxy;
+ GVariantBuilder props;
+
+ wpas_proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
+ if (!wpas_proxy) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ nm_log_warn (LOGD_SUPPLICANT, "Failed to acquire wpa_supplicant proxy: (%s)",
+ error ? error->message : "unknown");
+ set_state (NM_SUPPLICANT_INTERFACE (user_data), NM_SUPPLICANT_INTERFACE_STATE_DOWN);
+ }
+ return;
+ }
- nm_log_dbg (LOGD_SUPPLICANT, "(%s): adding interface to supplicant", priv->dev);
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- /* Move to starting to prevent double-calls of interface_add() */
- set_state (self, NM_SUPPLICANT_INTERFACE_STATE_STARTING);
+ priv->wpas_proxy = wpas_proxy;
/* Try to add the interface to the supplicant. If the supplicant isn't
* running, this will start it via D-Bus activation and return the response
* when the supplicant has started.
*/
- hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_variant_builder_init (&props, G_VARIANT_TYPE_VARDICT);
+ g_variant_builder_add (&props, "{sv}",
+ "Driver",
+ g_variant_new_string (priv->is_wireless ? DEFAULT_WIFI_DRIVER : "wired"));
+ g_variant_builder_add (&props, "{sv}",
+ "Ifname",
+ g_variant_new_string (priv->dev));
+
+ g_dbus_proxy_call (priv->wpas_proxy,
+ "CreateInterface",
+ g_variant_new ("(a{sv})", &props),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->init_cancellable,
+ (GAsyncReadyCallback) interface_add_cb,
+ self);
+}
- g_value_init (&driver, G_TYPE_STRING);
- g_value_set_string (&driver, is_wireless ? DEFAULT_WIFI_DRIVER : "wired");
- g_hash_table_insert (hash, "Driver", &driver);
+static void
+interface_add (NMSupplicantInterface *self, gboolean is_wireless)
+{
+ NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- g_value_init (&ifname, G_TYPE_STRING);
- g_value_set_string (&ifname, priv->dev);
- g_hash_table_insert (hash, "Ifname", &ifname);
+ /* Can only start the interface from INIT state */
+ g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT);
- call = dbus_g_proxy_begin_call (priv->wpas_proxy, "CreateInterface",
- interface_add_cb,
- self,
- NULL,
- DBUS_TYPE_G_MAP_OF_VARIANT, hash,
- G_TYPE_INVALID);
- nm_call_store_add (priv->other_pcalls, priv->wpas_proxy, call);
+ nm_log_dbg (LOGD_SUPPLICANT, "(%s): adding interface to supplicant", priv->dev);
+
+ priv->is_wireless = is_wireless;
+
+ /* Move to starting to prevent double-calls of interface_add() */
+ set_state (self, NM_SUPPLICANT_INTERFACE_STATE_STARTING);
- g_hash_table_destroy (hash);
- g_value_unset (&driver);
- g_value_unset (&ifname);
+ g_warn_if_fail (priv->init_cancellable == NULL);
+ g_clear_object (&priv->init_cancellable);
+ priv->init_cancellable = g_cancellable_new ();
+
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
+ NULL,
+ WPAS_DBUS_SERVICE,
+ WPAS_DBUS_PATH,
+ WPAS_DBUS_INTERFACE,
+ priv->init_cancellable,
+ (GAsyncReadyCallback) on_wpas_proxy_acquired,
+ self);
}
-static void
-smgr_avail_cb (NMSupplicantManager *smgr,
- GParamSpec *pspec,
- gpointer user_data)
+void
+nm_supplicant_interface_set_supplicant_available (NMSupplicantInterface *self,
+ gboolean available)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (user_data);
+ NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- if (nm_supplicant_manager_available (smgr)) {
+ if (available) {
/* This can happen if the supplicant couldn't be activated but
* for some reason was started after the activation failure.
*/
@@ -932,27 +839,14 @@ smgr_avail_cb (NMSupplicantManager *smgr,
}
static void
-remove_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
-{
- GError *error = NULL;
-
- if (!dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) {
- nm_log_dbg (LOGD_SUPPLICANT, "Couldn't remove network from supplicant interface: %s.",
- error && error->message ? error->message : "(unknown)");
- g_clear_error (&error);
- }
-}
-
-static void
-disconnect_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+log_result_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- GError *error = NULL;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *error = NULL;
- if (!dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) {
- nm_log_warn (LOGD_SUPPLICANT, "Couldn't disconnect supplicant interface: %s.",
- error && error->message ? error->message : "(unknown)");
- g_clear_error (&error);
- }
+ reply = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (!reply && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ nm_log_warn (LOGD_SUPPLICANT, "Failed to %s: %s.", error->message, (char *) user_data);
}
void
@@ -964,10 +858,11 @@ nm_supplicant_interface_disconnect (NMSupplicantInterface * self)
priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- /* Clear and cancel all pending calls related to a prior
- * connection attempt.
- */
- nm_call_store_clear (priv->assoc_pcalls);
+ /* Cancel all pending calls related to a prior connection attempt */
+ if (priv->assoc_cancellable) {
+ g_cancellable_cancel (priv->assoc_cancellable);
+ g_clear_object (&priv->assoc_cancellable);
+ }
/* Don't do anything if there is no connection to the supplicant yet. */
if (!priv->iface_proxy)
@@ -976,36 +871,41 @@ nm_supplicant_interface_disconnect (NMSupplicantInterface * self)
/* Disconnect from the current AP */
if ( (priv->state >= NM_SUPPLICANT_INTERFACE_STATE_SCANNING)
&& (priv->state <= NM_SUPPLICANT_INTERFACE_STATE_COMPLETED)) {
- dbus_g_proxy_begin_call (priv->iface_proxy, "Disconnect",
- disconnect_cb,
- NULL, NULL,
- G_TYPE_INVALID);
+ g_dbus_proxy_call (priv->iface_proxy,
+ "Disconnect",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ (GAsyncReadyCallback) log_result_cb,
+ "disconnect");
}
/* Remove any network that was added by NetworkManager */
if (priv->net_path) {
- dbus_g_proxy_begin_call (priv->iface_proxy, "RemoveNetwork",
- remove_network_cb,
- NULL, NULL,
- DBUS_TYPE_G_OBJECT_PATH, priv->net_path,
- G_TYPE_INVALID);
+ g_dbus_proxy_call (priv->iface_proxy,
+ "RemoveNetwork",
+ g_variant_new ("(o)", priv->net_path),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->other_cancellable,
+ (GAsyncReadyCallback) log_result_cb,
+ "remove network");
g_free (priv->net_path);
priv->net_path = NULL;
}
}
static void
-select_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+select_network_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *err = NULL;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *err = NULL;
- nm_call_store_remove (priv->assoc_pcalls, proxy, call_id);
- if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) {
+ reply = g_dbus_proxy_call_finish (proxy, result, &err);
+ if (!reply && !g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
nm_log_warn (LOGD_SUPPLICANT, "Couldn't select network config: %s.", err->message);
- emit_error_helper (self, err);
- g_error_free (err);
+ emit_error_helper (NM_SUPPLICANT_INTERFACE (user_data), err);
}
}
@@ -1013,111 +913,136 @@ static void
call_select_network (NMSupplicantInterface *self)
{
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- DBusGProxyCall *call;
/* We only select the network after all blobs (if any) have been set */
if (priv->blobs_left == 0) {
- call = dbus_g_proxy_begin_call (priv->iface_proxy, "SelectNetwork",
- select_network_cb,
- self,
- NULL,
- DBUS_TYPE_G_OBJECT_PATH, priv->net_path,
- G_TYPE_INVALID);
- nm_call_store_add (priv->assoc_pcalls, priv->iface_proxy, call);
+ g_dbus_proxy_call (priv->iface_proxy,
+ "SelectNetwork",
+ g_variant_new ("(o)", priv->net_path),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->assoc_cancellable,
+ (GAsyncReadyCallback) select_network_cb,
+ self);
}
}
static void
-add_blob_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+add_blob_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *err = NULL;
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *err = NULL;
- priv->blobs_left--;
+ reply = g_dbus_proxy_call_finish (proxy, result, &err);
+ if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- nm_call_store_remove (priv->assoc_pcalls, proxy, call_id);
- if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) {
+ priv->blobs_left--;
+ if (reply)
+ call_select_network (self);
+ else {
nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network certificates: %s.", err->message);
emit_error_helper (self, err);
- g_error_free (err);
- } else
- call_select_network (self);
+ }
}
static void
-add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+add_network_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *err = NULL;
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *error = NULL;
GHashTable *blobs;
GHashTableIter iter;
- gpointer name, data;
- DBusGProxyCall *call;
+ const char *blob_name;
+ GByteArray *blob_data;
+
+ reply = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+
+ if (reply && !g_variant_is_of_type (reply, G_VARIANT_TYPE ("(o)"))) {
+ error = g_error_new (NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
+ "Unexpected AddNetwork reply type %s",
+ g_variant_get_type_string (reply));
+ }
g_free (priv->net_path);
priv->net_path = NULL;
- nm_call_store_remove (priv->assoc_pcalls, proxy, call_id);
- if (!dbus_g_proxy_end_call (proxy, call_id, &err,
- DBUS_TYPE_G_OBJECT_PATH, &priv->net_path,
- G_TYPE_INVALID)) {
- nm_log_warn (LOGD_SUPPLICANT, "Couldn't add a network to the supplicant interface: %s.",
- err->message);
- emit_error_helper (self, err);
- g_error_free (err);
+ if (error) {
+ nm_log_warn (LOGD_SUPPLICANT, "Adding network to supplicant failed: %s.", error->message);
+ emit_error_helper (self, error);
return;
}
- /* Send blobs first; otherwise jump to sending the config settings */
+ g_variant_get (reply, "(o)", &priv->net_path);
+ g_assert (priv->net_path);
+
+ /* Send blobs first; otherwise jump to selecting the network */
blobs = nm_supplicant_config_get_blobs (priv->cfg);
priv->blobs_left = g_hash_table_size (blobs);
+
g_hash_table_iter_init (&iter, blobs);
- while (g_hash_table_iter_next (&iter, &name, &data)) {
- call = dbus_g_proxy_begin_call (priv->iface_proxy, "AddBlob",
- add_blob_cb,
- self,
- NULL,
- G_TYPE_STRING, name,
- DBUS_TYPE_G_UCHAR_ARRAY, data,
- G_TYPE_INVALID);
- nm_call_store_add (priv->assoc_pcalls, priv->iface_proxy, call);
+ while (g_hash_table_iter_next (&iter, (gpointer) &blob_name, (gpointer) &blob_data)) {
+ g_dbus_proxy_call (priv->iface_proxy,
+ "AddBlob",
+ g_variant_new ("(s@ay)",
+ blob_name,
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ blob_data->data, blob_data->len, 1)),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->assoc_cancellable,
+ (GAsyncReadyCallback) add_blob_cb,
+ self);
}
call_select_network (self);
}
static void
-set_ap_scan_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+set_ap_scan_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *err = NULL;
- DBusGProxyCall *call;
- GHashTable *config_hash;
+ NMSupplicantInterface *self;
+ NMSupplicantInterfacePrivate *priv;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *error = NULL;
+
+ reply = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
- nm_call_store_remove (priv->assoc_pcalls, proxy, call_id);
- if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) {
+ self = NM_SUPPLICANT_INTERFACE (user_data);
+ priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+
+ if (!reply) {
nm_log_warn (LOGD_SUPPLICANT, "Couldn't send AP scan mode to the supplicant interface: %s.",
- err->message);
- emit_error_helper (self, err);
- g_error_free (err);
+ error->message);
+ emit_error_helper (self, error);
return;
}
nm_log_info (LOGD_SUPPLICANT, "Config: set interface ap_scan to %d",
nm_supplicant_config_get_ap_scan (priv->cfg));
- config_hash = nm_supplicant_config_get_hash (priv->cfg);
- call = dbus_g_proxy_begin_call (priv->iface_proxy, "AddNetwork",
- add_network_cb,
- self,
- NULL,
- DBUS_TYPE_G_MAP_OF_VARIANT, config_hash,
- G_TYPE_INVALID);
- g_hash_table_destroy (config_hash);
- nm_call_store_add (priv->assoc_pcalls, priv->iface_proxy, call);
+ g_dbus_proxy_call (priv->iface_proxy,
+ "AddNetwork",
+ g_variant_new ("(@a{sv})", nm_supplicant_config_to_variant (priv->cfg)),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->assoc_cancellable,
+ (GAsyncReadyCallback) add_network_cb,
+ self);
}
gboolean
@@ -1125,8 +1050,6 @@ nm_supplicant_interface_set_config (NMSupplicantInterface *self,
NMSupplicantConfig *cfg)
{
NMSupplicantInterfacePrivate *priv;
- DBusGProxyCall *call;
- GValue value = G_VALUE_INIT;
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE);
@@ -1142,103 +1065,75 @@ nm_supplicant_interface_set_config (NMSupplicantInterface *self,
return FALSE;
}
- if (priv->cfg)
- g_object_unref (priv->cfg);
- priv->cfg = cfg;
-
- if (cfg == NULL)
- return TRUE;
-
- g_object_ref (priv->cfg);
-
- g_value_init (&value, G_TYPE_UINT);
- g_value_set_uint (&value, nm_supplicant_config_get_ap_scan (priv->cfg));
-
- call = dbus_g_proxy_begin_call (priv->props_proxy, "Set",
- set_ap_scan_cb,
- self,
- NULL,
- G_TYPE_STRING, WPAS_DBUS_IFACE_INTERFACE,
- G_TYPE_STRING, "ApScan",
- G_TYPE_VALUE, &value,
- G_TYPE_INVALID);
- nm_call_store_add (priv->assoc_pcalls, priv->props_proxy, call);
-
- g_value_unset (&value);
- return call != NULL;
-}
-
-static void
-scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
-{
- NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data);
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- GError *err = NULL;
-
- nm_call_store_remove (priv->other_pcalls, proxy, call_id);
- if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID))
- nm_log_warn (LOGD_SUPPLICANT, "Could not get scan request result: %s", err->message);
-
- g_signal_emit (self, signals[SCAN_DONE], 0, err ? FALSE : TRUE);
- g_clear_error (&err);
+ g_clear_object (&priv->cfg);
+ if (cfg) {
+ priv->cfg = g_object_ref (cfg);
+ g_dbus_proxy_call (priv->iface_proxy,
+ "org.freedesktop.DBus.Properties.Set",
+ g_variant_new ("(ssv)",
+ WPAS_DBUS_IFACE_INTERFACE,
+ "ApScan",
+ g_variant_new_uint32 (nm_supplicant_config_get_ap_scan (priv->cfg))),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->assoc_cancellable,
+ (GAsyncReadyCallback) set_ap_scan_cb,
+ self);
+ }
+ return TRUE;
}
static void
-destroy_gvalue (gpointer data)
-{
- GValue *value = (GValue *) data;
-
- g_value_unset (value);
- g_slice_free (GValue, value);
-}
-
-static GValue *
-string_to_gvalue (const char *str)
+scan_request_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- GValue *val = g_slice_new0 (GValue);
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *error = NULL;
- g_value_init (val, G_TYPE_STRING);
- g_value_set_string (val, str);
- return val;
-}
-
-static GValue *
-byte_array_array_to_gvalue (const GPtrArray *array)
-{
- GValue *val = g_slice_new0 (GValue);
+ reply = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
- g_value_init (val, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR);
- g_value_set_boxed (val, array);
- return val;
+ if (error)
+ nm_log_warn (LOGD_SUPPLICANT, "Could not get scan request result: %s", error->message);
+ g_signal_emit (NM_SUPPLICANT_INTERFACE (user_data), signals[SCAN_DONE], 0, error ? FALSE : TRUE);
}
gboolean
nm_supplicant_interface_request_scan (NMSupplicantInterface *self, const GPtrArray *ssids)
{
NMSupplicantInterfacePrivate *priv;
- DBusGProxyCall *call;
- GHashTable *hash;
+ GVariantBuilder builder;
+ guint i;
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE);
priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
/* Scan parameters */
- hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroy_gvalue);
- g_hash_table_insert (hash, "Type", string_to_gvalue ("active"));
- if (ssids)
- g_hash_table_insert (hash, "SSIDs", byte_array_array_to_gvalue (ssids));
-
- call = dbus_g_proxy_begin_call (priv->iface_proxy, "Scan",
- scan_request_cb,
- self,
- NULL,
- DBUS_TYPE_G_MAP_OF_VARIANT, hash,
- G_TYPE_INVALID);
- g_hash_table_destroy (hash);
- nm_call_store_add (priv->other_pcalls, priv->iface_proxy, call);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
+ g_variant_builder_add (&builder, "{sv}", "Type", g_variant_new_string ("active"));
+ if (ssids) {
+ GVariantBuilder ssids_builder;
+
+ g_variant_builder_init (&ssids_builder, G_VARIANT_TYPE_BYTESTRING_ARRAY);
+ for (i = 0; i < ssids->len; i++) {
+ GByteArray *ssid = g_ptr_array_index (ssids, i);
+ g_variant_builder_add (&ssids_builder, "@ay",
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ ssid->data, ssid->len, 1));
+ }
+ g_variant_builder_add (&builder, "{sv}", "SSIDs", g_variant_builder_end (&ssids_builder));
+ }
- return call != NULL;
+ g_dbus_proxy_call (priv->iface_proxy,
+ "Scan",
+ g_variant_new ("(a{sv})", &builder),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->other_cancellable,
+ (GAsyncReadyCallback) scan_request_cb,
+ self);
+ return TRUE;
}
guint32
@@ -1322,8 +1217,7 @@ nm_supplicant_interface_get_max_scan_ssids (NMSupplicantInterface *self)
/*******************************************************************/
NMSupplicantInterface *
-nm_supplicant_interface_new (NMSupplicantManager *smgr,
- const char *ifname,
+nm_supplicant_interface_new (const char *ifname,
gboolean is_wireless,
gboolean fast_supported,
ApSupport ap_support,
@@ -1331,21 +1225,12 @@ nm_supplicant_interface_new (NMSupplicantManager *smgr,
{
NMSupplicantInterface *self;
NMSupplicantInterfacePrivate *priv;
- guint id;
- g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (smgr), NULL);
g_return_val_if_fail (ifname != NULL, NULL);
self = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, NULL);
priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- priv->smgr = g_object_ref (smgr);
- id = g_signal_connect (priv->smgr,
- "notify::" NM_SUPPLICANT_MANAGER_AVAILABLE,
- G_CALLBACK (smgr_avail_cb),
- self);
- priv->smgr_avail_id = id;
-
priv->dev = g_strdup (ifname);
priv->is_wireless = is_wireless;
priv->fast_supported = fast_supported;
@@ -1361,19 +1246,8 @@ static void
nm_supplicant_interface_init (NMSupplicantInterface * self)
{
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
- DBusGConnection *bus;
priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT;
- priv->assoc_pcalls = nm_call_store_new ();
- priv->other_pcalls = nm_call_store_new ();
- priv->dbus_mgr = nm_dbus_manager_get ();
-
- bus = nm_dbus_manager_get_connection (priv->dbus_mgr);
- priv->wpas_proxy = dbus_g_proxy_new_for_name (bus,
- WPAS_DBUS_SERVICE,
- WPAS_DBUS_PATH,
- WPAS_DBUS_INTERFACE);
-
priv->bss_proxies = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
}
@@ -1411,49 +1285,26 @@ dispose (GObject *object)
{
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object);
- if (priv->disposed) {
- G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object);
- return;
- }
- priv->disposed = TRUE;
-
- /* Cancel pending calls before unrefing the dbus manager */
- nm_call_store_clear (priv->other_pcalls);
- nm_call_store_destroy (priv->other_pcalls);
-
- nm_call_store_clear (priv->assoc_pcalls);
- nm_call_store_destroy (priv->assoc_pcalls);
-
- if (priv->props_proxy)
- g_object_unref (priv->props_proxy);
-
if (priv->iface_proxy)
- g_object_unref (priv->iface_proxy);
+ g_signal_handlers_disconnect_by_data (priv->iface_proxy, NM_SUPPLICANT_INTERFACE (object));
+ g_clear_object (&priv->iface_proxy);
- g_free (priv->net_path);
+ if (priv->init_cancellable)
+ g_cancellable_cancel (priv->init_cancellable);
+ g_clear_object (&priv->init_cancellable);
- if (priv->introspect_proxy)
- g_object_unref (priv->introspect_proxy);
+ if (priv->other_cancellable)
+ g_cancellable_cancel (priv->other_cancellable);
+ g_clear_object (&priv->other_cancellable);
- if (priv->wpas_proxy)
- g_object_unref (priv->wpas_proxy);
+ g_clear_object (&priv->wpas_proxy);
+ g_clear_pointer (&priv->bss_proxies, (GDestroyNotify) g_hash_table_destroy);
- g_hash_table_destroy (priv->bss_proxies);
+ g_clear_pointer (&priv->net_path, g_free);
+ g_clear_pointer (&priv->dev, g_free);
+ g_clear_pointer (&priv->object_path, g_free);
- if (priv->smgr) {
- if (priv->smgr_avail_id)
- g_signal_handler_disconnect (priv->smgr, priv->smgr_avail_id);
- g_object_unref (priv->smgr);
- }
-
- g_free (priv->dev);
-
- priv->dbus_mgr = NULL;
-
- if (priv->cfg)
- g_object_unref (priv->cfg);
-
- g_free (priv->object_path);
+ g_clear_object (&priv->cfg);
/* Chain up to the parent class */
G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object);
@@ -1501,7 +1352,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NMSupplicantInterfaceClass, new_bss),
NULL, NULL, NULL,
- G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER);
+ G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VARIANT);
signals[BSS_UPDATED] =
g_signal_new (NM_SUPPLICANT_INTERFACE_BSS_UPDATED,
diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h
index 0112e40eae..1b1139d404 100644
--- a/src/supplicant-manager/nm-supplicant-interface.h
+++ b/src/supplicant-manager/nm-supplicant-interface.h
@@ -119,13 +119,15 @@ typedef struct {
GType nm_supplicant_interface_get_type (void);
-NMSupplicantInterface * nm_supplicant_interface_new (NMSupplicantManager * smgr,
- const char *ifname,
+NMSupplicantInterface * nm_supplicant_interface_new (const char *ifname,
gboolean is_wireless,
gboolean fast_supported,
ApSupport ap_support,
gboolean start_now);
+void nm_supplicant_interface_set_supplicant_available (NMSupplicantInterface *self,
+ gboolean available);
+
gboolean nm_supplicant_interface_set_config (NMSupplicantInterface * iface,
NMSupplicantConfig * cfg);
diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c
index c50691d9f5..d07e23aeab 100644
--- a/src/supplicant-manager/nm-supplicant-manager.c
+++ b/src/supplicant-manager/nm-supplicant-manager.c
@@ -19,15 +19,16 @@
* Copyright (C) 2007 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
#include <dbus/dbus.h>
#include "nm-supplicant-manager.h"
#include "nm-supplicant-interface.h"
-#include "nm-dbus-manager.h"
#include "nm-logging.h"
-#include "nm-dbus-glib-types.h"
+#include "nm-core-internal.h"
#define NM_SUPPLICANT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
NM_TYPE_SUPPLICANT_MANAGER, \
@@ -35,25 +36,16 @@
G_DEFINE_TYPE (NMSupplicantManager, nm_supplicant_manager, G_TYPE_OBJECT)
-/* Properties */
-enum {
- PROP_0 = 0,
- PROP_AVAILABLE,
- LAST_PROP
-};
-
typedef struct {
- NMDBusManager * dbus_mgr;
- guint name_owner_id;
- DBusGProxy * proxy;
- DBusGProxy * props_proxy;
- gboolean running;
+ GDBusProxy * proxy;
+ GCancellable * cancellable;
+ gboolean running;
+
GHashTable * ifaces;
gboolean fast_supported;
ApSupport ap_support;
guint die_count_reset_id;
guint die_count;
- gboolean disposed;
} NMSupplicantManagerPrivate;
/********************************************************************/
@@ -88,14 +80,16 @@ nm_supplicant_manager_iface_get (NMSupplicantManager * self,
start_now = !die_count_exceeded (priv->die_count);
nm_log_dbg (LOGD_SUPPLICANT, "(%s): creating new supplicant interface", ifname);
- iface = nm_supplicant_interface_new (self,
- ifname,
+ iface = nm_supplicant_interface_new (ifname,
is_wireless,
priv->fast_supported,
priv->ap_support,
start_now);
- if (iface)
- g_hash_table_insert (priv->ifaces, g_strdup (ifname), iface);
+ if (iface) {
+ g_hash_table_insert (priv->ifaces,
+ (char *) nm_supplicant_interface_get_ifname (iface),
+ iface);
+ }
} else {
nm_log_dbg (LOGD_SUPPLICANT, "(%s): returning existing supplicant interface", ifname);
}
@@ -123,35 +117,27 @@ nm_supplicant_manager_iface_release (NMSupplicantManager *self,
/* Ask wpa_supplicant to remove this interface */
op = nm_supplicant_interface_get_object_path (iface);
if (priv->running && priv->proxy && op) {
- dbus_g_proxy_call_no_reply (priv->proxy, "RemoveInterface",
- DBUS_TYPE_G_OBJECT_PATH, op,
- G_TYPE_INVALID);
+ g_dbus_proxy_call (priv->proxy,
+ "RemoveInterface",
+ g_variant_new ("(o)", op),
+ G_DBUS_CALL_FLAGS_NONE,
+ 3000,
+ NULL,
+ NULL,
+ NULL);
}
g_hash_table_remove (priv->ifaces, ifname);
}
static void
-get_capabilities_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
+update_capabilities (NMSupplicantManager *self)
{
- NMSupplicantManager *self = NM_SUPPLICANT_MANAGER (user_data);
NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self);
NMSupplicantInterface *iface;
GHashTableIter hash_iter;
- GError *error = NULL;
- GHashTable *props = NULL;
- GValue *value;
- char **iter;
-
- if (!dbus_g_proxy_end_call (proxy, call_id, &error,
- DBUS_TYPE_G_MAP_OF_VARIANT, &props,
- G_TYPE_INVALID)) {
- nm_log_warn (LOGD_CORE, "Unexpected error requesting supplicant properties: (%d) %s",
- error ? error->code : -1,
- error && error->message ? error->message : "(unknown)");
- g_clear_error (&error);
- return;
- }
+ const char **array;
+ GVariant *value;
/* The supplicant only advertises global capabilities if the following
* commit has been applied:
@@ -163,13 +149,17 @@ get_capabilities_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_
* dbus: Add global capabilities property
*/
priv->ap_support = AP_SUPPORT_UNKNOWN;
- value = g_hash_table_lookup (props, "Capabilities");
- if (value && G_VALUE_HOLDS (value, G_TYPE_STRV)) {
- priv->ap_support = AP_SUPPORT_NO;
- for (iter = g_value_get_boxed (value); iter && *iter; iter++) {
- if (strcasecmp (*iter, "ap") == 0)
+
+ value = g_dbus_proxy_get_cached_property (priv->proxy, "Capabilities");
+ if (value) {
+ if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING_ARRAY)) {
+ array = g_variant_get_strv (value, NULL);
+ priv->ap_support = AP_SUPPORT_NO;
+ if (_nm_utils_string_in_list ("ap", array))
priv->ap_support = AP_SUPPORT_YES;
+ g_free (array);
}
+ g_variant_unref (value);
}
/* Tell all interfaces about results of the AP check */
@@ -183,32 +173,35 @@ get_capabilities_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_
/* EAP-FAST */
priv->fast_supported = FALSE;
- value = g_hash_table_lookup (props, "EapMethods");
- if (value && G_VALUE_HOLDS (value, G_TYPE_STRV)) {
- for (iter = g_value_get_boxed (value); iter && *iter; iter++) {
- if (strcasecmp (*iter, "fast") == 0)
+ value = g_dbus_proxy_get_cached_property (priv->proxy, "EapMethods");
+ if (value) {
+ if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING_ARRAY)) {
+ array = g_variant_get_strv (value, NULL);
+ if (_nm_utils_string_in_list ("fast", array))
priv->fast_supported = TRUE;
+ g_free (array);
}
+ g_variant_unref (value);
}
nm_log_dbg (LOGD_SUPPLICANT, "EAP-FAST is %ssupported", priv->fast_supported ? "" : "not ");
-
- g_hash_table_unref (props);
}
static void
-check_capabilities (NMSupplicantManager *self)
+availability_changed (NMSupplicantManager *self, gboolean available)
{
NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self);
+ GList *ifaces, *iter;
- dbus_g_proxy_begin_call (priv->props_proxy, "GetAll",
- get_capabilities_cb, self, NULL,
- G_TYPE_STRING, WPAS_DBUS_INTERFACE,
- G_TYPE_INVALID);
+ /* priv->ifaces may be modified if availability changes; can't use GHashTableIter */
+ ifaces = g_hash_table_get_values (priv->ifaces);
+ for (iter = ifaces; iter; iter = iter->next)
+ nm_supplicant_interface_set_supplicant_available (NM_SUPPLICANT_INTERFACE (iter->data), available);
+ g_list_free (ifaces);
}
-gboolean
-nm_supplicant_manager_available (NMSupplicantManager *self)
+static gboolean
+is_available (NMSupplicantManager *self)
{
g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), FALSE);
@@ -221,22 +214,26 @@ static void
set_running (NMSupplicantManager *self, gboolean now_running)
{
NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self);
- gboolean old_available = nm_supplicant_manager_available (self);
+ gboolean old_available = is_available (self);
+ gboolean new_available;
priv->running = now_running;
- if (old_available != nm_supplicant_manager_available (self))
- g_object_notify (G_OBJECT (self), NM_SUPPLICANT_MANAGER_AVAILABLE);
+ new_available = is_available (self);
+ if (old_available != new_available)
+ availability_changed (self, new_available);
}
static void
set_die_count (NMSupplicantManager *self, guint new_die_count)
{
NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self);
- gboolean old_available = nm_supplicant_manager_available (self);
+ gboolean old_available = is_available (self);
+ gboolean new_available;
priv->die_count = new_die_count;
- if (old_available != nm_supplicant_manager_available (self))
- g_object_notify (G_OBJECT (self), NM_SUPPLICANT_MANAGER_AVAILABLE);
+ new_available = is_available (self);
+ if (old_available != new_available)
+ availability_changed (self, new_available);
}
static gboolean
@@ -253,28 +250,21 @@ wpas_die_count_reset_cb (gpointer user_data)
}
static void
-name_owner_changed (NMDBusManager *dbus_mgr,
- const char *name,
- const char *old_owner,
- const char *new_owner,
- gpointer user_data)
+name_owner_cb (GDBusProxy *proxy, GParamSpec *pspec, gpointer user_data)
{
NMSupplicantManager *self = NM_SUPPLICANT_MANAGER (user_data);
NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self);
- gboolean old_owner_good = (old_owner && strlen (old_owner));
- gboolean new_owner_good = (new_owner && strlen (new_owner));
+ char *owner;
- /* We only care about the supplicant here */
- if (strcmp (WPAS_DBUS_SERVICE, name) != 0)
- return;
+ g_return_if_fail (proxy == priv->proxy);
- if (!old_owner_good && new_owner_good) {
- nm_log_info (LOGD_SUPPLICANT, "wpa_supplicant started");
- set_running (self, TRUE);
- check_capabilities (self);
- } else if (old_owner_good && !new_owner_good) {
- nm_log_info (LOGD_SUPPLICANT, "wpa_supplicant stopped");
+ owner = g_dbus_proxy_get_name_owner (proxy);
+ nm_log_info (LOGD_SUPPLICANT, "wpa_supplicant %s", owner ? "running" : "stopped");
+ if (owner) {
+ set_running (self, TRUE);
+ update_capabilities (self);
+ } else if (priv->running) {
/* Reschedule the die count reset timeout. Every time the supplicant
* dies we wait 10 seconds before resetting the counter. If the
* supplicant died more than twice before the timer is reset, then
@@ -295,72 +285,56 @@ name_owner_changed (NMDBusManager *dbus_mgr,
priv->fast_supported = FALSE;
}
-}
-/*******************************************************************/
+ g_free (owner);
+}
-NMSupplicantManager *
-nm_supplicant_manager_get (void)
+static void
+on_proxy_acquired (GObject *object, GAsyncResult *result, gpointer user_data)
{
- static NMSupplicantManager *singleton = NULL;
+ NMSupplicantManager *self;
+ NMSupplicantManagerPrivate *priv;
+ GError *error = NULL;
+ GDBusProxy *proxy;
- if (!singleton)
- singleton = NM_SUPPLICANT_MANAGER (g_object_new (NM_TYPE_SUPPLICANT_MANAGER, NULL));
- else
- g_object_ref (singleton);
+ proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
+ if (!proxy) {
+ nm_log_warn (LOGD_SUPPLICANT,
+ "Failed to acquire wpa_supplicant proxy: Wi-Fi and 802.1x will not be available (%s)",
+ error->message);
+ g_clear_error (&error);
+ return;
+ }
- g_assert (singleton);
- return singleton;
+ self = NM_SUPPLICANT_MANAGER (user_data);
+ priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self);
+
+ priv->proxy = proxy;
+ g_signal_connect (priv->proxy, "notify::g-name-owner", G_CALLBACK (name_owner_cb), self);
+ name_owner_cb (priv->proxy, NULL, self);
}
+/*******************************************************************/
+
+NM_DEFINE_SINGLETON_GETTER (NMSupplicantManager, nm_supplicant_manager_get, NM_TYPE_SUPPLICANT_MANAGER);
+
static void
nm_supplicant_manager_init (NMSupplicantManager *self)
{
NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self);
- DBusGConnection *bus;
-
- priv->dbus_mgr = nm_dbus_manager_get ();
- priv->name_owner_id = g_signal_connect (priv->dbus_mgr,
- NM_DBUS_MANAGER_NAME_OWNER_CHANGED,
- G_CALLBACK (name_owner_changed),
- self);
- priv->running = nm_dbus_manager_name_has_owner (priv->dbus_mgr, WPAS_DBUS_SERVICE);
-
- bus = nm_dbus_manager_get_connection (priv->dbus_mgr);
- priv->proxy = dbus_g_proxy_new_for_name (bus,
- WPAS_DBUS_SERVICE,
- WPAS_DBUS_PATH,
- WPAS_DBUS_INTERFACE);
-
- priv->props_proxy = dbus_g_proxy_new_for_name (bus,
- WPAS_DBUS_SERVICE,
- WPAS_DBUS_PATH,
- DBUS_INTERFACE_PROPERTIES);
-
- priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
-
- /* Check generic supplicant capabilities */
- if (priv->running)
- check_capabilities (self);
-}
-static void
-set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-}
-
-static void
-get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- switch (prop_id) {
- case PROP_AVAILABLE:
- g_value_set_boolean (value, nm_supplicant_manager_available (NM_SUPPLICANT_MANAGER (object)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
+ priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
+
+ priv->cancellable = g_cancellable_new ();
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ WPAS_DBUS_SERVICE,
+ WPAS_DBUS_PATH,
+ WPAS_DBUS_INTERFACE,
+ priv->cancellable,
+ (GAsyncReadyCallback) on_proxy_acquired,
+ self);
}
static void
@@ -368,29 +342,19 @@ dispose (GObject *object)
{
NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object);
- if (priv->disposed)
- goto out;
- priv->disposed = TRUE;
-
- if (priv->die_count_reset_id)
+ if (priv->die_count_reset_id) {
g_source_remove (priv->die_count_reset_id);
-
- if (priv->dbus_mgr) {
- if (priv->name_owner_id)
- g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id);
- priv->dbus_mgr = NULL;
+ priv->die_count_reset_id = 0;
}
- g_hash_table_destroy (priv->ifaces);
-
- if (priv->proxy)
- g_object_unref (priv->proxy);
+ if (priv->cancellable) {
+ g_cancellable_cancel (priv->cancellable);
+ g_clear_object (&priv->cancellable);
+ }
- if (priv->props_proxy)
- g_object_unref (priv->props_proxy);
+ g_clear_pointer (&priv->ifaces, g_hash_table_unref);
+ g_clear_object (&priv->proxy);
-out:
- /* Chain up to the parent class */
G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object);
}
@@ -401,15 +365,6 @@ nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass)
g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate));
- object_class->get_property = get_property;
- object_class->set_property = set_property;
object_class->dispose = dispose;
-
- g_object_class_install_property
- (object_class, PROP_AVAILABLE,
- g_param_spec_boolean (NM_SUPPLICANT_MANAGER_AVAILABLE, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
}
diff --git a/src/supplicant-manager/nm-supplicant-manager.h b/src/supplicant-manager/nm-supplicant-manager.h
index 5e7f1eb596..3b8fddf4e6 100644
--- a/src/supplicant-manager/nm-supplicant-manager.h
+++ b/src/supplicant-manager/nm-supplicant-manager.h
@@ -26,11 +26,6 @@
#include "nm-supplicant-types.h"
#include "nm-device.h"
-#define WPAS_DBUS_SERVICE "fi.w1.wpa_supplicant1"
-#define WPAS_DBUS_PATH "/fi/w1/wpa_supplicant1"
-#define WPAS_DBUS_INTERFACE "fi.w1.wpa_supplicant1"
-
-
G_BEGIN_DECLS
#define NM_TYPE_SUPPLICANT_MANAGER (nm_supplicant_manager_get_type ())
@@ -40,8 +35,6 @@ G_BEGIN_DECLS
#define NM_IS_SUPPLICANT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_MANAGER))
#define NM_SUPPLICANT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManagerClass))
-#define NM_SUPPLICANT_MANAGER_AVAILABLE "available"
-
struct _NMSupplicantManager
{
GObject parent;
@@ -63,6 +56,4 @@ NMSupplicantInterface *nm_supplicant_manager_iface_get (NMSupplicantManager *mgr
void nm_supplicant_manager_iface_release (NMSupplicantManager *mgr,
NMSupplicantInterface *iface);
-gboolean nm_supplicant_manager_available (NMSupplicantManager *mgr);
-
#endif /* __NETWORKMANAGER_SUPPLICANT_MANAGER_H__ */
diff --git a/src/supplicant-manager/nm-supplicant-settings-verify.c b/src/supplicant-manager/nm-supplicant-settings-verify.c
index 3571c575ee..1328fd5113 100644
--- a/src/supplicant-manager/nm-supplicant-settings-verify.c
+++ b/src/supplicant-manager/nm-supplicant-settings-verify.c
@@ -18,6 +18,8 @@
* Copyright (C) 2006 - 2012 Red Hat, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/supplicant-manager/nm-supplicant-types.h b/src/supplicant-manager/nm-supplicant-types.h
index 619f0c3e91..1c16e49433 100644
--- a/src/supplicant-manager/nm-supplicant-types.h
+++ b/src/supplicant-manager/nm-supplicant-types.h
@@ -21,6 +21,10 @@
#ifndef __NETWORKMANAGER_SUPPLICANT_TYPES_H__
#define __NETWORKMANAGER_SUPPLICANT_TYPES_H__
+#define WPAS_DBUS_SERVICE "fi.w1.wpa_supplicant1"
+#define WPAS_DBUS_PATH "/fi/w1/wpa_supplicant1"
+#define WPAS_DBUS_INTERFACE "fi.w1.wpa_supplicant1"
+
typedef struct _NMSupplicantManager NMSupplicantManager;
typedef struct _NMSupplicantInterface NMSupplicantInterface;
typedef struct _NMSupplicantConfig NMSupplicantConfig;
diff --git a/src/supplicant-manager/tests/Makefile.am b/src/supplicant-manager/tests/Makefile.am
index 452ccdc1f7..85268dcff9 100644
--- a/src/supplicant-manager/tests/Makefile.am
+++ b/src/supplicant-manager/tests/Makefile.am
@@ -18,4 +18,5 @@ test_supplicant_config_SOURCES = \
test_supplicant_config_LDADD = \
$(top_builddir)/src/libNetworkManager.la
+@VALGRIND_RULES@
TESTS = test-supplicant-config
diff --git a/src/supplicant-manager/tests/test-supplicant-config.c b/src/supplicant-manager/tests/test-supplicant-config.c
index 2d16eecfd6..937757b220 100644
--- a/src/supplicant-manager/tests/test-supplicant-config.c
+++ b/src/supplicant-manager/tests/test-supplicant-config.c
@@ -18,6 +18,8 @@
* Copyright (C) 2008 - 2011 Red Hat, Inc.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
@@ -39,78 +41,67 @@
static gboolean
validate_opt (const char *detail,
- GHashTable *hash,
+ GVariant *config,
const char *key,
OptType val_type,
gconstpointer expected,
size_t expected_len)
{
- GValue *value;
- gint int_val;
- GByteArray *array;
+ char *config_key;
+ GVariant *config_value;
+ gboolean found = FALSE;
+ const guint8 *bytes;
+ gsize len;
const char *s;
const unsigned char *expected_array = expected;
- int result;
-
- ASSERT (hash != NULL, detail, "hash was NULL");
-
- value = g_hash_table_lookup (hash, key);
- ASSERT (value != NULL,
- detail, "option '%s' expected but not found in config hash.");
-
- switch (val_type) {
- case TYPE_INT:
- ASSERT (G_VALUE_HOLDS_INT (value),
- detail, "config hash item '%s' was not TYPE_INT.", key);
- int_val = g_value_get_int (value);
- ASSERT (int_val == GPOINTER_TO_INT (expected),
- detail, "unexpected config hash item '%s' value %d (expected %d)",
- key, int_val, GPOINTER_TO_INT (expected));
- break;
- case TYPE_BYTES:
- ASSERT (G_VALUE_HOLDS (value, DBUS_TYPE_G_UCHAR_ARRAY),
- detail, "config hash item '%s' was not TYPE_BYTES.", key);
- array = g_value_get_boxed (value);
- ASSERT (array->len == expected_len,
- detail, "unexpected config hash item '%s' length %d (expected %d)",
- key, array->len, expected_len);
- result = memcmp (array->data, expected_array, expected_len);
- ASSERT (result == 0, detail, "unexpected config hash item '%s' value", key);
- break;
- case TYPE_KEYWORD:
- case TYPE_STRING:
- ASSERT (G_VALUE_HOLDS_STRING (value),
- detail, "config hash item '%s' was not TYPE_STRING or TYPE_KEYWORD.", key);
- if (expected_len == -1)
- expected_len = strlen ((const char *) expected);
- s = g_value_get_string (value);
- ASSERT (s != NULL, detail, "unexpected NULL config hash string item '%s'.", key);
- ASSERT (strlen (s) == expected_len,
- detail, "unexpected config hash string item '%s' length %d (expected %d)",
- key, strlen (s), expected_len);
- result = strcmp (s, (const char *) expected);
- ASSERT (result == 0,
- detail, "unexpected config hash string item '%s' value '%s' (expected '%s')",
- key, s, (const char *) expected);
- break;
- default:
- g_warning ("unknown supplicant config hash item '%s' option type %d",
- key, val_type);
- return FALSE;
+ GVariantIter iter;
+
+ g_assert (g_variant_is_of_type (config, G_VARIANT_TYPE_VARDICT));
+
+ g_variant_iter_init (&iter, config);
+ while (g_variant_iter_next (&iter, "{&sv}", (gpointer) &config_key, (gpointer) &config_value)) {
+ if (!strcmp (key, config_key)) {
+ found = TRUE;
+ switch (val_type) {
+ case TYPE_INT:
+ g_assert (g_variant_is_of_type (config_value, G_VARIANT_TYPE_INT32));
+ g_assert_cmpint (g_variant_get_int32 (config_value), ==, GPOINTER_TO_INT (expected));
+ break;
+ case TYPE_BYTES:
+ g_assert (g_variant_is_of_type (config_value, G_VARIANT_TYPE_BYTESTRING));
+ bytes = g_variant_get_fixed_array (config_value, &len, 1);
+ g_assert_cmpint (len, ==, expected_len);
+ g_assert (memcmp (bytes, expected_array, expected_len) == 0);
+ break;
+ case TYPE_KEYWORD:
+ case TYPE_STRING:
+ g_assert (g_variant_is_of_type (config_value, G_VARIANT_TYPE_STRING));
+ if (expected_len == -1)
+ expected_len = strlen ((const char *) expected);
+ s = g_variant_get_string (config_value, NULL);
+ g_assert_cmpint (strlen (s), ==, expected_len);
+ g_assert_cmpstr (s, ==, expected);
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ }
+ g_variant_unref (config_value);
}
- return TRUE;
+ return found;
}
static void
test_wifi_open (void)
{
- NMConnection *connection;
+ gs_unref_object NMConnection *connection = NULL;
+ gs_unref_object NMSupplicantConfig *config = NULL;
+ gs_unref_variant GVariant *config_dict = NULL;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
- NMSettingIP4Config *s_ip4;
- NMSupplicantConfig *config;
- GHashTable *hash;
+ NMSettingIPConfig *s_ip4;
char *uuid;
gboolean success;
GError *error = NULL;
@@ -149,14 +140,14 @@ test_wifi_open (void)
g_bytes_unref (ssid);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
- ASSERT (nm_connection_verify (connection, &error) == TRUE,
- "wifi-open", "failed to verify connection: %s",
- (error && error->message) ? error->message : "(unknown)");
+ success = nm_connection_verify (connection, &error);
+ g_assert_no_error (error);
+ g_assert (success);
config = nm_supplicant_config_new ();
@@ -168,28 +159,21 @@ test_wifi_open (void)
"*added 'bssid' value '11:22:33:44:55:66'*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
"*added 'freq_list' value *");
- success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0);
- ASSERT (success == TRUE,
- "wifi-open", "failed to add wireless setting to supplicant config.");
+ g_assert (nm_supplicant_config_add_setting_wireless (config, s_wifi, 0));
g_test_assert_expected_messages ();
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
"*added 'key_mgmt' value 'NONE'");
- success = nm_supplicant_config_add_no_security (config);
- ASSERT (success == TRUE,
- "wifi-open", "failed to add wireless security to supplicant config.");
+ g_assert (nm_supplicant_config_add_no_security (config));
g_test_assert_expected_messages ();
- hash = nm_supplicant_config_get_hash (config);
- ASSERT (hash != NULL,
- "wifi-open", "failed to hash supplicant config options.");
-
- validate_opt ("wifi-open", hash, "scan_ssid", TYPE_INT, GINT_TO_POINTER (1), -1);
- validate_opt ("wifi-open", hash, "ssid", TYPE_BYTES, ssid_data, sizeof (ssid_data));
- validate_opt ("wifi-open", hash, "bssid", TYPE_KEYWORD, bssid_str, -1);
- validate_opt ("wifi-open", hash, "key_mgmt", TYPE_KEYWORD, "NONE", -1);
+ config_dict = nm_supplicant_config_to_variant (config);
+ g_assert (config_dict);
- g_object_unref (connection);
+ validate_opt ("wifi-open", config_dict, "scan_ssid", TYPE_INT, GINT_TO_POINTER (1), -1);
+ validate_opt ("wifi-open", config_dict, "ssid", TYPE_BYTES, ssid_data, sizeof (ssid_data));
+ validate_opt ("wifi-open", config_dict, "bssid", TYPE_KEYWORD, bssid_str, -1);
+ validate_opt ("wifi-open", config_dict, "key_mgmt", TYPE_KEYWORD, "NONE", -1);
}
static void
@@ -199,13 +183,13 @@ test_wifi_wep_key (const char *detail,
const unsigned char *expected,
size_t expected_size)
{
- NMConnection *connection;
+ gs_unref_object NMConnection *connection = NULL;
+ gs_unref_object NMSupplicantConfig *config = NULL;
+ gs_unref_variant GVariant *config_dict = NULL;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSupplicantConfig *config;
- GHashTable *hash;
+ NMSettingIPConfig *s_ip4;
char *uuid;
gboolean success;
GError *error = NULL;
@@ -254,14 +238,14 @@ test_wifi_wep_key (const char *detail,
nm_setting_wireless_security_set_wep_key (s_wsec, 0, key_data);
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
- ASSERT (nm_connection_verify (connection, &error) == TRUE,
- detail, "failed to verify connection: %s",
- (error && error->message) ? error->message : "(unknown)");
+ success = nm_connection_verify (connection, &error);
+ g_assert_no_error (error);
+ g_assert (success);
config = nm_supplicant_config_new ();
@@ -273,9 +257,7 @@ test_wifi_wep_key (const char *detail,
"*added 'bssid' value '11:22:33:44:55:66'*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
"*added 'freq_list' value *");
- success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0);
- ASSERT (success == TRUE,
- detail, "failed to add wireless setting to supplicant config.");
+ g_assert (nm_supplicant_config_add_setting_wireless (config, s_wifi, 0));
g_test_assert_expected_messages ();
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
@@ -284,26 +266,21 @@ test_wifi_wep_key (const char *detail,
"*added 'wep_key0' value *");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
"*added 'wep_tx_keyidx' value '0'");
- success = nm_supplicant_config_add_setting_wireless_security (config,
+ g_assert (nm_supplicant_config_add_setting_wireless_security (config,
s_wsec,
NULL,
- "376aced7-b28c-46be-9a62-fcdf072571da");
- ASSERT (success == TRUE,
- detail, "failed to add wireless security to supplicant config.");
+ "376aced7-b28c-46be-9a62-fcdf072571da"));
g_test_assert_expected_messages ();
- hash = nm_supplicant_config_get_hash (config);
- ASSERT (hash != NULL,
- detail, "failed to hash supplicant config options.");
-
- validate_opt (detail, hash, "scan_ssid", TYPE_INT, GINT_TO_POINTER (1), -1);
- validate_opt (detail, hash, "ssid", TYPE_BYTES, ssid_data, sizeof (ssid_data));
- validate_opt (detail, hash, "bssid", TYPE_KEYWORD, bssid_str, -1);
- validate_opt (detail, hash, "key_mgmt", TYPE_KEYWORD, "NONE", -1);
- validate_opt (detail, hash, "wep_tx_keyidx", TYPE_INT, GINT_TO_POINTER (0), -1);
- validate_opt (detail, hash, "wep_key0", TYPE_BYTES, expected, expected_size);
+ config_dict = nm_supplicant_config_to_variant (config);
+ g_assert (config_dict);
- g_object_unref (connection);
+ validate_opt (detail, config_dict, "scan_ssid", TYPE_INT, GINT_TO_POINTER (1), -1);
+ validate_opt (detail, config_dict, "ssid", TYPE_BYTES, ssid_data, sizeof (ssid_data));
+ validate_opt (detail, config_dict, "bssid", TYPE_KEYWORD, bssid_str, -1);
+ validate_opt (detail, config_dict, "key_mgmt", TYPE_KEYWORD, "NONE", -1);
+ validate_opt (detail, config_dict, "wep_tx_keyidx", TYPE_INT, GINT_TO_POINTER (0), -1);
+ validate_opt (detail, config_dict, "wep_key0", TYPE_BYTES, expected, expected_size);
}
static void
@@ -336,13 +313,13 @@ test_wifi_wpa_psk (const char *detail,
const unsigned char *expected,
size_t expected_size)
{
- NMConnection *connection;
+ gs_unref_object NMConnection *connection = NULL;
+ gs_unref_object NMSupplicantConfig *config = NULL;
+ gs_unref_variant GVariant *config_dict = NULL;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
- NMSettingIP4Config *s_ip4;
- NMSupplicantConfig *config;
- GHashTable *hash;
+ NMSettingIPConfig *s_ip4;
char *uuid;
gboolean success;
GError *error = NULL;
@@ -397,14 +374,14 @@ test_wifi_wpa_psk (const char *detail,
nm_setting_wireless_security_add_group (s_wsec, "ccmp");
/* IP4 setting */
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
- g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
- ASSERT (nm_connection_verify (connection, &error) == TRUE,
- detail, "failed to verify connection: %s",
- (error && error->message) ? error->message : "(unknown)");
+ success = nm_connection_verify (connection, &error);
+ g_assert_no_error (error);
+ g_assert (success);
config = nm_supplicant_config_new ();
@@ -416,9 +393,7 @@ test_wifi_wpa_psk (const char *detail,
"*added 'bssid' value '11:22:33:44:55:66'*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
"*added 'freq_list' value *");
- success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0);
- ASSERT (success == TRUE,
- detail, "failed to add wireless setting to supplicant config.");
+ g_assert (nm_supplicant_config_add_setting_wireless (config, s_wifi, 0));
g_test_assert_expected_messages ();
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
@@ -431,28 +406,23 @@ test_wifi_wpa_psk (const char *detail,
"*added 'pairwise' value 'TKIP CCMP'");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE,
"*added 'group' value 'TKIP CCMP'");
- success = nm_supplicant_config_add_setting_wireless_security (config,
+ g_assert (nm_supplicant_config_add_setting_wireless_security (config,
s_wsec,
NULL,
- "376aced7-b28c-46be-9a62-fcdf072571da");
- ASSERT (success == TRUE,
- detail, "failed to add wireless security to supplicant config.");
+ "376aced7-b28c-46be-9a62-fcdf072571da"));
g_test_assert_expected_messages ();
- hash = nm_supplicant_config_get_hash (config);
- ASSERT (hash != NULL,
- detail, "failed to hash supplicant config options.");
-
- validate_opt (detail, hash, "scan_ssid", TYPE_INT, GINT_TO_POINTER (1), -1);
- validate_opt (detail, hash, "ssid", TYPE_BYTES, ssid_data, sizeof (ssid_data));
- validate_opt (detail, hash, "bssid", TYPE_KEYWORD, bssid_str, -1);
- validate_opt (detail, hash, "key_mgmt", TYPE_KEYWORD, "WPA-PSK", -1);
- validate_opt (detail, hash, "proto", TYPE_KEYWORD, "WPA RSN", -1);
- validate_opt (detail, hash, "pairwise", TYPE_KEYWORD, "TKIP CCMP", -1);
- validate_opt (detail, hash, "group", TYPE_KEYWORD, "TKIP CCMP", -1);
- validate_opt (detail, hash, "psk", key_type, expected, expected_size);
-
- g_object_unref (connection);
+ config_dict = nm_supplicant_config_to_variant (config);
+ g_assert (config_dict);
+
+ validate_opt (detail, config_dict, "scan_ssid", TYPE_INT, GINT_TO_POINTER (1), -1);
+ validate_opt (detail, config_dict, "ssid", TYPE_BYTES, ssid_data, sizeof (ssid_data));
+ validate_opt (detail, config_dict, "bssid", TYPE_KEYWORD, bssid_str, -1);
+ validate_opt (detail, config_dict, "key_mgmt", TYPE_KEYWORD, "WPA-PSK", -1);
+ validate_opt (detail, config_dict, "proto", TYPE_KEYWORD, "WPA RSN", -1);
+ validate_opt (detail, config_dict, "pairwise", TYPE_KEYWORD, "TKIP CCMP", -1);
+ validate_opt (detail, config_dict, "group", TYPE_KEYWORD, "TKIP CCMP", -1);
+ validate_opt (detail, config_dict, "psk", key_type, expected, expected_size);
}
static void
@@ -473,18 +443,12 @@ NMTST_DEFINE ();
int main (int argc, char **argv)
{
- char *base;
-
nmtst_init (&argc, &argv, TRUE);
- /* The tests */
- test_wifi_open ();
- test_wifi_wep ();
- test_wifi_wpa_psk_types ();
+ g_test_add_func ("/supplicant-config/wifi-open", test_wifi_open);
+ g_test_add_func ("/supplicant-config/wifi-wep", test_wifi_wep);
+ g_test_add_func ("/supplicant-config/wifi-wpa-psk-types", test_wifi_wpa_psk_types);
- base = g_path_get_basename (argv[0]);
- fprintf (stdout, "%s: SUCCESS\n", base);
- g_free (base);
- return 0;
+ return g_test_run ();
}
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 65bc2199c6..83632bd198 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -20,6 +20,8 @@ noinst_PROGRAMS = \
test-general-with-expect \
test-ip4-config \
test-ip6-config \
+ test-route-manager-linux \
+ test-route-manager-fake \
test-dcb \
test-resolvconf-capture \
test-wired-defname
@@ -40,6 +42,34 @@ test_ip6_config_SOURCES = \
test_ip6_config_LDADD = \
$(top_builddir)/src/libNetworkManager.la
+####### route manager test #######
+
+test_route_manager_fake_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -I$(top_srcdir)/src/platform/tests \
+ -DSETUP=nm_fake_platform_setup \
+ -DKERNEL_HACKS=0
+
+test_route_manager_fake_SOURCES = \
+ $(top_srcdir)/src/platform/tests/test-common.c \
+ test-route-manager.c
+
+test_route_manager_fake_LDADD = \
+ $(top_builddir)/src/libNetworkManager.la
+
+test_route_manager_linux_SOURCES = \
+ $(top_srcdir)/src/platform/tests/test-common.c \
+ test-route-manager.c
+
+test_route_manager_linux_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -I$(top_srcdir)/src/platform/tests \
+ -DSETUP=nm_linux_platform_setup \
+ -DKERNEL_HACKS=1
+
+test_route_manager_linux_LDADD = \
+ $(top_builddir)/src/libNetworkManager.la
+
####### DCB test #######
test_dcb_SOURCES = \
@@ -86,9 +116,12 @@ EXTRA_DIST = test-secret-agent.py
###########################################
+@VALGRIND_RULES@
TESTS = \
test-ip4-config \
test-ip6-config \
+ test-route-manager-fake \
+ test-route-manager-linux \
test-dcb \
test-resolvconf-capture \
test-general \
diff --git a/src/tests/config/Makefile.am b/src/tests/config/Makefile.am
index 66009c877b..42c6b9a1b0 100644
--- a/src/tests/config/Makefile.am
+++ b/src/tests/config/Makefile.am
@@ -23,6 +23,7 @@ test_config_SOURCES = \
test_config_LDADD = \
$(top_builddir)/src/libNetworkManager.la
+@VALGRIND_RULES@
TESTS = test-config
EXTRA_DIST = \
diff --git a/src/tests/config/nm-test-device.c b/src/tests/config/nm-test-device.c
index 8f9c431cc2..512085e997 100644
--- a/src/tests/config/nm-test-device.c
+++ b/src/tests/config/nm-test-device.c
@@ -61,30 +61,32 @@ dispose (GObject *object)
g_object_class->dispose (object);
}
-static void
-finalize (GObject *object)
+static guint32
+get_generic_capabilities (NMDevice *device)
{
- g_object_class->finalize (object);
+ return NM_DEVICE_CAP_IS_NON_KERNEL;
}
static void
nm_test_device_class_init (NMTestDeviceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
g_object_class = g_type_class_peek (G_TYPE_OBJECT);
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->dispose = dispose;
- object_class->finalize = finalize;
+
+ device_class->get_generic_capabilities = get_generic_capabilities;
}
NMDevice *
nm_test_device_new (const char *hwaddr)
{
return g_object_new (NM_TYPE_TEST_DEVICE,
- NM_DEVICE_IFACE, "dummy:",
+ NM_DEVICE_IFACE, "dummy",
NM_DEVICE_HW_ADDRESS, hwaddr,
NULL);
}
diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c
index fff2d2a092..b03cfc112a 100644
--- a/src/tests/config/test-config.c
+++ b/src/tests/config/test-config.c
@@ -26,9 +26,14 @@
#include <nm-config.h>
#include "nm-test-device.h"
+#include "nm-fake-platform.h"
+#include "nm-logging.h"
+#include "nm-dbus-manager.h"
-static void
-setup_config (const char *config_file, const char *config_dir, ...)
+#include "nm-test-utils.h"
+
+static NMConfig *
+setup_config (GError **error, const char *config_file, const char *config_dir, ...)
{
va_list ap;
GPtrArray *args;
@@ -36,6 +41,11 @@ setup_config (const char *config_file, const char *config_dir, ...)
int argc;
GOptionContext *context;
gboolean success;
+ NMConfig *config;
+ GError *local_error = NULL;
+ NMConfigCmdLineOptions *cli;
+
+ g_assert (!error || !*error);
args = g_ptr_array_new ();
g_ptr_array_add (args, "test-config");
@@ -52,8 +62,10 @@ setup_config (const char *config_file, const char *config_dir, ...)
argv = (char **)args->pdata;
argc = args->len;
+ cli = nm_config_cmd_line_options_new ();
+
context = g_option_context_new (NULL);
- g_option_context_add_main_entries (context, nm_config_get_options (), NULL);
+ nm_config_cmd_line_options_add_to_entries (cli, context);
success = g_option_context_parse (context, &argc, &argv, NULL);
g_option_context_free (context);
@@ -61,6 +73,18 @@ setup_config (const char *config_file, const char *config_dir, ...)
g_printerr ("Invalid options.\n");
g_ptr_array_free (args, TRUE);
+
+ config = nm_config_setup (cli, &local_error);
+ if (error) {
+ g_assert (!config);
+ g_assert (local_error);
+ g_propagate_error (error, local_error);
+ } else {
+ g_assert (config);
+ g_assert_no_error (local_error);
+ }
+ nm_config_cmd_line_options_free (cli);
+ return config;
}
static void
@@ -71,14 +95,12 @@ test_config_simple (void)
const char **plugins;
char *value;
- setup_config (SRCDIR "/NetworkManager.conf", "/no/such/dir", NULL);
- config = nm_config_new (&error);
- g_assert_no_error (error);
+ config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "/no/such/dir", NULL);
- g_assert_cmpstr (nm_config_get_path (config), ==, SRCDIR "/NetworkManager.conf");
+ g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, SRCDIR "/NetworkManager.conf");
g_assert_cmpstr (nm_config_get_dhcp_client (config), ==, "dhclient");
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
- g_assert_cmpint (nm_config_get_connectivity_interval (config), ==, 100);
+ g_assert_cmpint (nm_config_data_get_connectivity_interval (nm_config_get_data_orig (config)), ==, 100);
plugins = nm_config_get_plugins (config);
g_assert_cmpint (g_strv_length ((char **)plugins), ==, 3);
@@ -86,16 +108,16 @@ test_config_simple (void)
g_assert_cmpstr (plugins[1], ==, "bar");
g_assert_cmpstr (plugins[2], ==, "baz");
- value = nm_config_get_value (config, "extra-section", "extra-key", NULL);
+ value = nm_config_data_get_value (nm_config_get_data_orig (config), "extra-section", "extra-key", NULL);
g_assert_cmpstr (value, ==, "some value");
g_free (value);
- value = nm_config_get_value (config, "extra-section", "no-key", &error);
+ value = nm_config_data_get_value (nm_config_get_data_orig (config), "extra-section", "no-key", &error);
g_assert (!value);
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND);
g_clear_error (&error);
- value = nm_config_get_value (config, "no-section", "no-key", &error);
+ value = nm_config_data_get_value (nm_config_get_data_orig (config), "no-section", "no-key", &error);
g_assert (!value);
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND);
g_clear_error (&error);
@@ -106,45 +128,38 @@ test_config_simple (void)
static void
test_config_non_existent (void)
{
- NMConfig *config;
GError *error = NULL;
- setup_config (SRCDIR "/no-such-file", "/no/such/dir", NULL);
- config = nm_config_new (&error);
- g_assert (!config);
+ setup_config (&error, SRCDIR "/no-such-file", "/no/such/dir", NULL);
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND);
+ g_clear_error (&error);
}
static void
test_config_parse_error (void)
{
- NMConfig *config;
GError *error = NULL;
- setup_config (SRCDIR "/bad.conf", "/no/such/dir", NULL);
- config = nm_config_new (&error);
- g_assert (!config);
+ setup_config (&error, SRCDIR "/bad.conf", "/no/such/dir", NULL);
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE);
+ g_clear_error (&error);
}
static void
test_config_override (void)
{
NMConfig *config;
- GError *error = NULL;
const char **plugins;
- setup_config (SRCDIR "/NetworkManager.conf", "/no/such/dir",
- "--plugins", "alpha,beta,gamma,delta",
- "--connectivity-interval", "12",
- NULL);
- config = nm_config_new (&error);
- g_assert_no_error (error);
+ config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "/no/such/dir",
+ "--plugins", "alpha,beta,gamma,delta",
+ "--connectivity-interval", "12",
+ NULL);
- g_assert_cmpstr (nm_config_get_path (config), ==, SRCDIR "/NetworkManager.conf");
+ g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, SRCDIR "/NetworkManager.conf");
g_assert_cmpstr (nm_config_get_dhcp_client (config), ==, "dhclient");
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
- g_assert_cmpint (nm_config_get_connectivity_interval (config), ==, 12);
+ g_assert_cmpint (nm_config_data_get_connectivity_interval (nm_config_get_data_orig (config)), ==, 12);
plugins = nm_config_get_plugins (config);
g_assert_cmpint (g_strv_length ((char **)plugins), ==, 4);
@@ -174,37 +189,36 @@ test_config_no_auto_default (void)
g_assert_cmpint (nwrote, ==, 18);
close (fd);
- setup_config (SRCDIR "/NetworkManager.conf", "/no/such/dir",
- "--no-auto-default", state_file,
- NULL);
- config = nm_config_new (&error);
- g_assert_no_error (error);
+ config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "/no/such/dir",
+ "--no-auto-default", state_file,
+ NULL);
dev1 = nm_test_device_new ("11:11:11:11:11:11");
dev2 = nm_test_device_new ("22:22:22:22:22:22");
dev3 = nm_test_device_new ("33:33:33:33:33:33");
dev4 = nm_test_device_new ("44:44:44:44:44:44");
- g_assert (!nm_config_get_ethernet_can_auto_default (config, dev1));
- g_assert (!nm_config_get_ethernet_can_auto_default (config, dev2));
- g_assert (nm_config_get_ethernet_can_auto_default (config, dev3));
- g_assert (!nm_config_get_ethernet_can_auto_default (config, dev4));
+ g_assert (nm_config_get_no_auto_default_for_device (config, dev1));
+ g_assert (nm_config_get_no_auto_default_for_device (config, dev2));
+ g_assert (!nm_config_get_no_auto_default_for_device (config, dev3));
+ g_assert (nm_config_get_no_auto_default_for_device (config, dev4));
- nm_config_set_ethernet_no_auto_default (config, dev3);
- g_assert (!nm_config_get_ethernet_can_auto_default (config, dev3));
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, "*config: update * (no-auto-default)*");
+ nm_config_set_no_auto_default_for_device (config, dev3);
+ g_test_assert_expected_messages ();
+
+ g_assert (nm_config_get_no_auto_default_for_device (config, dev3));
g_object_unref (config);
- setup_config (SRCDIR "/NetworkManager.conf", "/no/such/dir",
- "--no-auto-default", state_file,
- NULL);
- config = nm_config_new (&error);
- g_assert_no_error (error);
+ config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "/no/such/dir",
+ "--no-auto-default", state_file,
+ NULL);
- g_assert (!nm_config_get_ethernet_can_auto_default (config, dev1));
- g_assert (!nm_config_get_ethernet_can_auto_default (config, dev2));
- g_assert (!nm_config_get_ethernet_can_auto_default (config, dev3));
- g_assert (!nm_config_get_ethernet_can_auto_default (config, dev4));
+ g_assert (nm_config_get_no_auto_default_for_device (config, dev1));
+ g_assert (nm_config_get_no_auto_default_for_device (config, dev2));
+ g_assert (nm_config_get_no_auto_default_for_device (config, dev3));
+ g_assert (nm_config_get_no_auto_default_for_device (config, dev4));
g_object_unref (config);
@@ -221,20 +235,17 @@ static void
test_config_confdir (void)
{
NMConfig *config;
- GError *error = NULL;
const char **plugins;
char *value;
- setup_config (SRCDIR "/NetworkManager.conf", SRCDIR "/conf.d", NULL);
- config = nm_config_new (&error);
- g_assert_no_error (error);
+ config = setup_config (NULL, SRCDIR "/NetworkManager.conf", SRCDIR "/conf.d", NULL);
- g_assert_cmpstr (nm_config_get_path (config), ==, SRCDIR "/NetworkManager.conf");
+ g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, SRCDIR "/NetworkManager.conf");
g_assert_cmpstr (nm_config_get_dhcp_client (config), ==, "dhcpcd");
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
g_assert_cmpstr (nm_config_get_log_domains (config), ==, "PLATFORM,DNS,WIFI");
- g_assert_cmpstr (nm_config_get_connectivity_uri (config), ==, "http://example.net");
- g_assert_cmpint (nm_config_get_connectivity_interval (config), ==, 100);
+ g_assert_cmpstr (nm_config_data_get_connectivity_uri (nm_config_get_data_orig (config)), ==, "http://example.net");
+ g_assert_cmpint (nm_config_data_get_connectivity_interval (nm_config_get_data_orig (config)), ==, 100);
plugins = nm_config_get_plugins (config);
g_assert_cmpint (g_strv_length ((char **)plugins), ==, 5);
@@ -244,21 +255,21 @@ test_config_confdir (void)
g_assert_cmpstr (plugins[3], ==, "one");
g_assert_cmpstr (plugins[4], ==, "two");
- value = nm_config_get_value (config, "main", "extra", NULL);
+ value = nm_config_data_get_value (nm_config_get_data_orig (config), "main", "extra", NULL);
g_assert_cmpstr (value, ==, "hello");
g_free (value);
- value = nm_config_get_value (config, "main", "new", NULL);
+ value = nm_config_data_get_value (nm_config_get_data_orig (config), "main", "new", NULL);
g_assert_cmpstr (value, ==, "something"); /* not ",something" */
g_free (value);
- value = nm_config_get_value (config, "order", "a", NULL);
+ value = nm_config_data_get_value (nm_config_get_data_orig (config), "order", "a", NULL);
g_assert_cmpstr (value, ==, "90");
g_free (value);
- value = nm_config_get_value (config, "order", "b", NULL);
+ value = nm_config_data_get_value (nm_config_get_data_orig (config), "order", "b", NULL);
g_assert_cmpstr (value, ==, "10");
g_free (value);
- value = nm_config_get_value (config, "order", "c", NULL);
+ value = nm_config_data_get_value (nm_config_get_data_orig (config), "order", "c", NULL);
g_assert_cmpstr (value, ==, "0");
g_free (value);
@@ -268,24 +279,29 @@ test_config_confdir (void)
static void
test_config_confdir_parse_error (void)
{
- NMConfig *config;
GError *error = NULL;
/* Using SRCDIR as the conf dir will pick up bad.conf */
- setup_config (SRCDIR "/NetworkManager.conf", SRCDIR, NULL);
- config = nm_config_new (&error);
- g_assert (!config);
+ setup_config (&error, SRCDIR "/NetworkManager.conf", SRCDIR, NULL);
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE);
+ g_clear_error (&error);
}
+NMTST_DEFINE ();
+
int
main (int argc, char **argv)
{
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nmtst_init_assert_logging (&argc, &argv);
+
+ /* Initialize the DBus manager singleton explicitly, because it is accessed by
+ * the class initializer of NMDevice (used by the NMTestDevice stub).
+ * This way, we skip calling nm_dbus_manager_init_bus() which would
+ * either fail and/or cause unexpected actions in the test.
+ * */
+ nm_dbus_manager_setup (g_object_new (NM_TYPE_DBUS_MANAGER, NULL));
- g_test_init (&argc, &argv, NULL);
+ nm_fake_platform_setup ();
g_test_add_func ("/config/simple", test_config_simple);
g_test_add_func ("/config/non-existent", test_config_non_existent);
diff --git a/src/tests/test-dcb.c b/src/tests/test-dcb.c
index c28f05b920..dacb1f521f 100644
--- a/src/tests/test-dcb.c
+++ b/src/tests/test-dcb.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
diff --git a/src/tests/test-general-with-expect.c b/src/tests/test-general-with-expect.c
index 2d19cedf96..f5010dae4a 100644
--- a/src/tests/test-general-with-expect.c
+++ b/src/tests/test-general-with-expect.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <errno.h>
@@ -135,7 +137,10 @@ test_nm_utils_kill_child_create_and_join_pgroup (void)
g_assert (err == 0);
pgid = fork();
- g_assert (pgid >= 0);
+ if (pgid < 0) {
+ g_assert_not_reached ();
+ return pgid;
+ }
if (pgid == 0) {
/* child process... */
@@ -297,6 +302,7 @@ test_nm_utils_kill_child (void)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*kill child process 'test-a-3-0' (*): unexpected error sending Unexpected signal: Invalid argument (22)");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_DEBUG, "*kill child process 'test-a-3-0' (*): invoke callback: killing child failed");
+ /* coverity[negative_returns] */
test_nm_utils_kill_child_async_do ("test-a-3-0", pid3a, -1, 1000 / 2, FALSE, NULL);
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_DEBUG, "*kill child process 'test-a-3-1' (*): wait for process to terminate after sending SIGTERM (15) (send SIGKILL in 500 milliseconds)...");
diff --git a/src/tests/test-general.c b/src/tests/test-general.c
index e6bc207bd7..dae872c86d 100644
--- a/src/tests/test-general.c
+++ b/src/tests/test-general.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <errno.h>
@@ -28,135 +30,6 @@
#include "nm-test-utils.h"
-static void
-test_nm_utils_ascii_str_to_int64_check (const char *str, guint base, gint64 min,
- gint64 max, gint64 fallback, int exp_errno,
- gint64 exp_val)
-{
- gint64 v;
-
- errno = 1;
- v = nm_utils_ascii_str_to_int64 (str, base, min, max, fallback);
- g_assert_cmpint (errno, ==, exp_errno);
- g_assert_cmpint (v, ==, exp_val);
-}
-
-static void
-test_nm_utils_ascii_str_to_int64_do (const char *str, guint base, gint64 min,
- gint64 max, gint64 fallback, int exp_errno,
- gint64 exp_val)
-{
- const char *sign = "";
- const char *val;
- static const char *whitespaces[] = {
- "",
- " ",
- "\r\n\t",
- " \r\n\t ",
- " \r\n\t \t\r\n\t",
- NULL,
- };
- static const char *nulls[] = {
- "",
- "0",
- "00",
- "0000",
- "0000000000000000",
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
- NULL,
- };
- const char **ws_pre, **ws_post, **null;
- guint i;
-
- if (str == NULL || exp_errno != 0) {
- test_nm_utils_ascii_str_to_int64_check (str, base, min, max, fallback, exp_errno, exp_val);
- return;
- }
-
- if (strncmp (str, "-", 1) == 0)
- sign = "-";
-
- val = str + strlen (sign);
-
- for (ws_pre = whitespaces; *ws_pre; ws_pre++) {
- for (ws_post = whitespaces; *ws_post; ws_post++) {
- for (null = nulls; *null; null++) {
- for (i = 0; ; i++) {
- char *s;
- const char *str_base = "";
-
- if (base == 16) {
- if (i == 1)
- str_base = "0x";
- else if (i > 1)
- break;
- } else if (base == 8) {
- if (i == 1)
- str_base = "0";
- else if (i > 1)
- break;
- } else if (base == 0) {
- if (i > 0)
- break;
- /* with base==0, a leading zero would be interpreted as octal. Only test without *null */
- if ((*null)[0])
- break;
- } else {
- if (i > 0)
- break;
- }
-
- s = g_strdup_printf ("%s%s%s%s%s%s", *ws_pre, sign, str_base, *null, val, *ws_post);
-
- test_nm_utils_ascii_str_to_int64_check (s, base, min, max, fallback, exp_errno, exp_val);
- g_free (s);
- }
- }
- }
- }
-}
-
-static void
-test_nm_utils_ascii_str_to_int64 (void)
-{
- test_nm_utils_ascii_str_to_int64_do (NULL, 10, 0, 10000, -1, EINVAL, -1);
- test_nm_utils_ascii_str_to_int64_do ("", 10, 0, 10000, -1, EINVAL, -1);
- test_nm_utils_ascii_str_to_int64_do ("1x", 10, 0, 10000, -1, EINVAL, -1);
- test_nm_utils_ascii_str_to_int64_do ("4711", 10, 0, 10000, -1, 0, 4711);
- test_nm_utils_ascii_str_to_int64_do ("10000", 10, 0, 10000, -1, 0, 10000);
- test_nm_utils_ascii_str_to_int64_do ("10001", 10, 0, 10000, -1, ERANGE, -1);
- test_nm_utils_ascii_str_to_int64_do ("FF", 16, 0, 10000, -1, 0, 255);
- test_nm_utils_ascii_str_to_int64_do ("FF", 10, 0, 10000, -2, EINVAL, -2);
- test_nm_utils_ascii_str_to_int64_do ("9223372036854775807", 10, 0, G_MAXINT64, -2, 0, G_MAXINT64);
- test_nm_utils_ascii_str_to_int64_do ("7FFFFFFFFFFFFFFF", 16, 0, G_MAXINT64, -2, 0, G_MAXINT64);
- test_nm_utils_ascii_str_to_int64_do ("9223372036854775808", 10, 0, G_MAXINT64, -2, ERANGE, -2);
- test_nm_utils_ascii_str_to_int64_do ("-9223372036854775808", 10, G_MININT64, 0, -2, 0, G_MININT64);
- test_nm_utils_ascii_str_to_int64_do ("-9223372036854775808", 10, G_MININT64+1, 0, -2, ERANGE, -2);
- test_nm_utils_ascii_str_to_int64_do ("-9223372036854775809", 10, G_MININT64, 0, -2, ERANGE, -2);
- test_nm_utils_ascii_str_to_int64_do ("1.0", 10, 1, 1, -1, EINVAL, -1);
- test_nm_utils_ascii_str_to_int64_do ("1x0", 16, -10, 10, -100, EINVAL, -100);
- test_nm_utils_ascii_str_to_int64_do ("0", 16, -10, 10, -100, 0, 0);
- test_nm_utils_ascii_str_to_int64_do ("10001111", 2, -1000, 1000, -100000, 0, 0x8F);
- test_nm_utils_ascii_str_to_int64_do ("-10001111", 2, -1000, 1000, -100000, 0, -0x8F);
- test_nm_utils_ascii_str_to_int64_do ("1111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7F);
- test_nm_utils_ascii_str_to_int64_do ("111111111111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7FFF);
- test_nm_utils_ascii_str_to_int64_do ("11111111111111111111111111111111111111111111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7FFFFFFFFFFF);
- test_nm_utils_ascii_str_to_int64_do ("111111111111111111111111111111111111111111111111111111111111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7FFFFFFFFFFFFFFF);
- test_nm_utils_ascii_str_to_int64_do ("100000000000000000000000000000000000000000000000000000000000000", 2, G_MININT64, G_MAXINT64, -1, 0, 0x4000000000000000);
- test_nm_utils_ascii_str_to_int64_do ("1000000000000000000000000000000000000000000000000000000000000000", 2, G_MININT64, G_MAXINT64, -1, ERANGE, -1);
- test_nm_utils_ascii_str_to_int64_do ("-100000000000000000000000000000000000000000000000000000000000000", 2, G_MININT64, G_MAXINT64, -1, 0, -0x4000000000000000);
- test_nm_utils_ascii_str_to_int64_do ("111111111111111111111111111111111111111111111111111111111111111", 2, G_MININT64, G_MAXINT64, -1, 0, 0x7FFFFFFFFFFFFFFF);
- test_nm_utils_ascii_str_to_int64_do ("-100000000000000000000000000000000000000000000000000000000000000", 2, G_MININT64, G_MAXINT64, -1, 0, -0x4000000000000000);
- test_nm_utils_ascii_str_to_int64_do ("0x70", 10, G_MININT64, G_MAXINT64, -1, EINVAL, -1);
- test_nm_utils_ascii_str_to_int64_do ("4711", 0, G_MININT64, G_MAXINT64, -1, 0, 4711);
- test_nm_utils_ascii_str_to_int64_do ("04711", 0, G_MININT64, G_MAXINT64, -1, 0, 04711);
- test_nm_utils_ascii_str_to_int64_do ("0x4711", 0, G_MININT64, G_MAXINT64, -1, 0, 0x4711);
- test_nm_utils_ascii_str_to_int64_do ("080", 0, G_MININT64, G_MAXINT64, -1, EINVAL, -1);
- test_nm_utils_ascii_str_to_int64_do ("070", 0, G_MININT64, G_MAXINT64, -1, 0, 7*8);
- test_nm_utils_ascii_str_to_int64_do ("0x70", 0, G_MININT64, G_MAXINT64, -1, 0, 0x70);
-}
-
/* Reference implementation for nm_utils_ip6_address_clear_host_address.
* Taken originally from set_address_masked(), src/rdisc/nm-lndp-rdisc.c
**/
@@ -288,8 +161,7 @@ _match_connection_new (void)
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip4, *s_ip6;
char *uuid;
connection = nm_simple_connection_new ();
@@ -308,16 +180,16 @@ _match_connection_new (void)
s_wired = (NMSettingWired *) nm_setting_wired_new ();
nm_connection_add_setting (connection, (NMSetting *) s_wired);
- s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
+ s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
nm_connection_add_setting (connection, (NMSetting *) s_ip4);
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
- s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
+ s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
nm_connection_add_setting (connection, (NMSetting *) s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
NULL);
return connection;
@@ -328,7 +200,7 @@ test_connection_match_basic (void)
{
NMConnection *orig, *copy, *matched;
GSList *connections = NULL;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
orig = _match_connection_new ();
copy = nm_simple_connection_new_clone (orig);
@@ -341,7 +213,7 @@ test_connection_match_basic (void)
s_ip4 = nm_connection_get_setting_ip4_config (orig);
g_assert (s_ip4);
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL,
NULL);
matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL);
g_assert (matched == NULL);
@@ -356,7 +228,7 @@ test_connection_match_ip6_method (void)
{
NMConnection *orig, *copy, *matched;
GSList *connections = NULL;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
orig = _match_connection_new ();
copy = nm_simple_connection_new_clone (orig);
@@ -369,14 +241,14 @@ test_connection_match_ip6_method (void)
s_ip6 = nm_connection_get_setting_ip6_config (orig);
g_assert (s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
NULL);
s_ip6 = nm_connection_get_setting_ip6_config (copy);
g_assert (s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
- NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL);
@@ -392,7 +264,7 @@ test_connection_match_ip6_method_ignore (void)
{
NMConnection *orig, *copy, *matched;
GSList *connections = NULL;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
orig = _match_connection_new ();
copy = nm_simple_connection_new_clone (orig);
@@ -404,13 +276,13 @@ test_connection_match_ip6_method_ignore (void)
s_ip6 = nm_connection_get_setting_ip6_config (orig);
g_assert (s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
NULL);
s_ip6 = nm_connection_get_setting_ip6_config (copy);
g_assert (s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
NULL);
matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL);
@@ -426,7 +298,7 @@ test_connection_match_ip6_method_ignore_auto (void)
{
NMConnection *orig, *copy, *matched;
GSList *connections = NULL;
- NMSettingIP6Config *s_ip6;
+ NMSettingIPConfig *s_ip6;
orig = _match_connection_new ();
copy = nm_simple_connection_new_clone (orig);
@@ -438,13 +310,13 @@ test_connection_match_ip6_method_ignore_auto (void)
s_ip6 = nm_connection_get_setting_ip6_config (orig);
g_assert (s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
NULL);
s_ip6 = nm_connection_get_setting_ip6_config (copy);
g_assert (s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
NULL);
matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL);
@@ -461,7 +333,7 @@ test_connection_match_ip4_method (void)
{
NMConnection *orig, *copy, *matched;
GSList *connections = NULL;
- NMSettingIP4Config *s_ip4;
+ NMSettingIPConfig *s_ip4;
orig = _match_connection_new ();
copy = nm_simple_connection_new_clone (orig);
@@ -474,14 +346,14 @@ test_connection_match_ip4_method (void)
s_ip4 = nm_connection_get_setting_ip4_config (orig);
g_assert (s_ip4);
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED,
NULL);
s_ip4 = nm_connection_get_setting_ip4_config (copy);
g_assert (s_ip4);
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
- NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+ NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
NULL);
matched = nm_utils_match_connection (connections, orig, FALSE, NULL, NULL);
@@ -537,13 +409,12 @@ test_connection_match_wired (void)
GSList *connections = NULL;
NMSettingWired *s_wired;
char *subchan_arr[] = { "0.0.8000", "0.0.8001", "0.0.8002", NULL };
- GByteArray *mac;
+ const char *mac = "52:54:00:ab:db:23";
orig = _match_connection_new ();
copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
- mac = nm_utils_hwaddr_atoba ("52:54:00:ab:db:23", ETH_ALEN);
s_wired = nm_connection_get_setting_wired (orig);
g_assert (s_wired);
g_object_set (G_OBJECT (s_wired),
@@ -552,7 +423,6 @@ test_connection_match_wired (void)
NM_SETTING_WIRED_S390_SUBCHANNELS, subchan_arr,
NM_SETTING_WIRED_S390_NETTYPE, "qeth",
NULL);
- g_byte_array_free (mac, TRUE);
s_wired = nm_connection_get_setting_wired (copy);
g_assert (s_wired);
@@ -574,10 +444,9 @@ test_connection_no_match_ip4_addr (void)
{
NMConnection *orig, *copy, *matched;
GSList *connections = NULL;
- NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
- NMIP4Address *nm_addr;
- guint32 addr, gw;
+ NMSettingIPConfig *s_ip4, *s_ip6;
+ NMIPAddress *nm_addr;
+ GError *error = NULL;
orig = _match_connection_new ();
copy = nm_simple_connection_new_clone (orig);
@@ -589,43 +458,37 @@ test_connection_no_match_ip4_addr (void)
s_ip6 = nm_connection_get_setting_ip6_config (orig);
g_assert (s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
NULL);
s_ip6 = nm_connection_get_setting_ip6_config (copy);
g_assert (s_ip6);
g_object_set (G_OBJECT (s_ip6),
- NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
NULL);
s_ip4 = nm_connection_get_setting_ip4_config (orig);
g_assert (s_ip4);
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "1.1.1.254",
NULL);
- nm_addr = nm_ip4_address_new ();
- inet_pton (AF_INET, "1.1.1.4", &addr);
- inet_pton (AF_INET, "1.1.1.254", &gw);
- nm_ip4_address_set_address (nm_addr, addr);
- nm_ip4_address_set_prefix (nm_addr, 24);
- nm_ip4_address_set_gateway (nm_addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, nm_addr);
- nm_ip4_address_unref (nm_addr);
+ nm_addr = nm_ip_address_new (AF_INET, "1.1.1.4", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, nm_addr);
+ nm_ip_address_unref (nm_addr);
s_ip4 = nm_connection_get_setting_ip4_config (copy);
g_assert (s_ip4);
g_object_set (G_OBJECT (s_ip4),
- NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
+ NM_SETTING_IP_CONFIG_GATEWAY, "2.2.2.254",
NULL);
- nm_addr = nm_ip4_address_new ();
- inet_pton (AF_INET, "2.2.2.4", &addr);
- inet_pton (AF_INET, "2.2.2.254", &gw);
- nm_ip4_address_set_address (nm_addr, addr);
- nm_ip4_address_set_prefix (nm_addr, 24);
- nm_ip4_address_set_gateway (nm_addr, gw);
- nm_setting_ip4_config_add_address (s_ip4, nm_addr);
- nm_ip4_address_unref (nm_addr);
+ nm_addr = nm_ip_address_new (AF_INET, "2.2.2.4", 24, &error);
+ g_assert_no_error (error);
+ nm_setting_ip_config_add_address (s_ip4, nm_addr);
+ nm_ip_address_unref (nm_addr);
matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL);
g_assert (matched != copy);
@@ -735,6 +598,118 @@ test_connection_sort_autoconnect_priority (void)
/*******************************************/
+static const char *_test_match_spec_all[] = {
+ "e",
+ "em",
+ "em*",
+ "em\\",
+ "em\\*",
+ "em\\1",
+ "em\\11",
+ "em\\2",
+ "em1",
+ "em11",
+ "em2",
+ "=em*",
+ NULL
+};
+
+static gboolean
+_test_match_spec_contains (const char **matches, const char *match)
+{
+ guint i;
+
+ for (i = 0; matches && matches[i]; i++) {
+ if (strcmp (match, matches[i]) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+test_match_spec_ifname (const char *spec_str, const char **matches, const char **neg_matches)
+{
+ const char *m;
+ GSList *specs, *specs_reverse = NULL;
+ guint i;
+
+ g_assert (spec_str);
+
+ specs = nm_match_spec_split (spec_str);
+ specs_reverse = g_slist_reverse (g_slist_copy (specs));
+
+ for (i = 0; matches && matches[i]; i++) {
+ g_assert (nm_match_spec_interface_name (specs, matches[i]) == NM_MATCH_SPEC_MATCH);
+ g_assert (nm_match_spec_interface_name (specs_reverse, matches[i]) == NM_MATCH_SPEC_MATCH);
+ }
+ for (i = 0; neg_matches && neg_matches[i]; i++) {
+ g_assert (nm_match_spec_interface_name (specs, neg_matches[i]) == NM_MATCH_SPEC_NEG_MATCH);
+ g_assert (nm_match_spec_interface_name (specs_reverse, neg_matches[i]) == NM_MATCH_SPEC_NEG_MATCH);
+ }
+ for (i = 0; (m = _test_match_spec_all[i]); i++) {
+ if (_test_match_spec_contains (matches, m))
+ continue;
+ if (_test_match_spec_contains (neg_matches, m))
+ continue;
+ g_assert (nm_match_spec_interface_name (specs, m) == NM_MATCH_SPEC_NO_MATCH);
+ g_assert (nm_match_spec_interface_name (specs_reverse, m) == NM_MATCH_SPEC_NO_MATCH);
+ }
+
+ g_slist_free (specs_reverse);
+ g_slist_free_full (specs, g_free);
+}
+
+static void
+test_nm_match_spec_interface_name (void)
+{
+#define S(...) ((const char *[]) { __VA_ARGS__, NULL } )
+ test_match_spec_ifname ("em1",
+ S ("em1"),
+ NULL);
+ test_match_spec_ifname ("em1,em2",
+ S ("em1", "em2"),
+ NULL);
+ test_match_spec_ifname ("em1,em2,interface-name:em2",
+ S ("em1", "em2"),
+ NULL);
+ test_match_spec_ifname ("interface-name:em1",
+ S ("em1"),
+ NULL);
+ test_match_spec_ifname ("interface-name:em*",
+ S ("em", "em*", "em\\", "em\\*", "em\\1", "em\\11", "em\\2", "em1", "em11", "em2", "em3"),
+ NULL);
+ test_match_spec_ifname ("interface-name:em\\*",
+ S ("em\\", "em\\*", "em\\1", "em\\11", "em\\2"),
+ NULL);
+ test_match_spec_ifname ("interface-name:~em\\*",
+ S ("em\\", "em\\*", "em\\1", "em\\11", "em\\2"),
+ NULL);
+ test_match_spec_ifname ("interface-name:=em*",
+ S ("em*"),
+ NULL);
+ test_match_spec_ifname ("interface-name:em*,except:interface-name:em1*",
+ S ("em", "em*", "em\\", "em\\*", "em\\1", "em\\11", "em\\2", "em2", "em3"),
+ S ("em1", "em11"));
+ test_match_spec_ifname ("interface-name:em*,except:interface-name:=em*",
+ S ("em", "em\\", "em\\*", "em\\1", "em\\11", "em\\2", "em1", "em11", "em2", "em3"),
+ S ("em*"));
+ test_match_spec_ifname ("aa,bb,cc\\,dd,e,,",
+ S ("aa", "bb", "cc,dd", "e"),
+ NULL);
+ test_match_spec_ifname ("aa;bb;cc\\;dd;e,;",
+ S ("aa", "bb", "cc;dd", "e"),
+ NULL);
+ test_match_spec_ifname ("interface-name:em\\;1,em\\,2,\\,,\\\\,,em\\\\x",
+ S ("em;1", "em,2", ",", "\\", "em\\x"),
+ NULL);
+ test_match_spec_ifname (" , interface-name:a, ,",
+ S (" ", " ", " interface-name:a"),
+ NULL);
+#undef S
+}
+
+/*******************************************/
+
NMTST_DEFINE ();
int
@@ -742,7 +717,6 @@ main (int argc, char **argv)
{
nmtst_init_with_logging (&argc, &argv, NULL, "ALL");
- g_test_add_func ("/general/nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64);
g_test_add_func ("/general/nm_utils_ip6_address_clear_host_address", test_nm_utils_ip6_address_clear_host_address);
g_test_add_func ("/general/nm_utils_log_connection_diff", test_nm_utils_log_connection_diff);
@@ -757,6 +731,8 @@ main (int argc, char **argv)
g_test_add_func ("/general/connection-sort/autoconnect-priority", test_connection_sort_autoconnect_priority);
+ g_test_add_func ("/general/nm_match_spec_interface_name", test_nm_match_spec_interface_name);
+
return g_test_run ();
}
diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c
index 68de1e3ea6..f355115dbd 100644
--- a/src/tests/test-ip4-config.c
+++ b/src/tests/test-ip4-config.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <arpa/inet.h>
@@ -69,7 +71,7 @@ build_test_config (void)
NMPlatformIP4Route route;
/* Build up the config to subtract */
- config = nm_ip4_config_new ();
+ config = nm_ip4_config_new (1);
addr_init (&addr, "192.168.1.10", "1.2.3.4", 24);
nm_ip4_config_add_address (config, &addr);
@@ -189,8 +191,8 @@ test_compare_with_source (void)
NMPlatformIP4Address addr;
NMPlatformIP4Route route;
- a = nm_ip4_config_new ();
- b = nm_ip4_config_new ();
+ a = nm_ip4_config_new (1);
+ b = nm_ip4_config_new (2);
/* Address */
addr_init (&addr, "1.2.3.4", NULL, 24);
@@ -222,7 +224,7 @@ test_add_address_with_source (void)
NMPlatformIP4Address addr;
const NMPlatformIP4Address *test_addr;
- a = nm_ip4_config_new ();
+ a = nm_ip4_config_new (1);
/* Test that a higher priority source is not overwritten */
addr_init (&addr, "1.2.3.4", NULL, 24);
@@ -262,7 +264,7 @@ test_add_route_with_source (void)
NMPlatformIP4Route route;
const NMPlatformIP4Route *test_route;
- a = nm_ip4_config_new ();
+ a = nm_ip4_config_new (1);
/* Test that a higher priority source is not overwritten */
route_new (&route, "1.2.3.4", 24, "1.2.3.1");
diff --git a/src/tests/test-ip6-config.c b/src/tests/test-ip6-config.c
index f8ecefc93b..421fa37599 100644
--- a/src/tests/test-ip6-config.c
+++ b/src/tests/test-ip6-config.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <arpa/inet.h>
@@ -34,7 +36,7 @@ build_test_config (void)
NMIP6Config *config;
/* Build up the config to subtract */
- config = nm_ip6_config_new ();
+ config = nm_ip6_config_new (1);
nm_ip6_config_add_address (config, nmtst_platform_ip6_address ("abcd:1234:4321::cdde", "1:2:3:4::5", 64));
nm_ip6_config_add_route (config, nmtst_platform_ip6_route ("abcd:1234:4321::", 24, "abcd:1234:4321:cdde::2"));
@@ -127,8 +129,8 @@ test_compare_with_source (void)
NMPlatformIP6Address addr;
NMPlatformIP6Route route;
- a = nm_ip6_config_new ();
- b = nm_ip6_config_new ();
+ a = nm_ip6_config_new (1);
+ b = nm_ip6_config_new (2);
/* Address */
addr = *nmtst_platform_ip6_address ("1122:3344:5566::7788", NULL, 64);
@@ -160,7 +162,7 @@ test_add_address_with_source (void)
NMPlatformIP6Address addr;
const NMPlatformIP6Address *test_addr;
- a = nm_ip6_config_new ();
+ a = nm_ip6_config_new (1);
/* Test that a higher priority source is not overwritten */
addr = *nmtst_platform_ip6_address ("1122:3344:5566::7788", NULL, 64);
@@ -200,7 +202,7 @@ test_add_route_with_source (void)
NMPlatformIP6Route route;
const NMPlatformIP6Route *test_route;
- a = nm_ip6_config_new ();
+ a = nm_ip6_config_new (1);
/* Test that a higher priority source is not overwritten */
route = *nmtst_platform_ip6_route ("abcd:1234:4321::", 24, "abcd:1234:4321:cdde::2");
diff --git a/src/tests/test-resolvconf-capture.c b/src/tests/test-resolvconf-capture.c
index 2d787b7188..f5cb298b9f 100644
--- a/src/tests/test-resolvconf-capture.c
+++ b/src/tests/test-resolvconf-capture.c
@@ -18,8 +18,11 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
+#include <arpa/inet.h>
#include "NetworkManagerUtils.h"
#include "nm-ip4-config.h"
diff --git a/src/tests/test-route-manager.c b/src/tests/test-route-manager.c
new file mode 100644
index 0000000000..b93dbb18f5
--- /dev/null
+++ b/src/tests/test-route-manager.c
@@ -0,0 +1,681 @@
+/* -*- 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 (C) 2015 Red Hat, Inc.
+ *
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <arpa/inet.h>
+
+#include "test-common.h"
+
+#include "nm-platform.h"
+#include "nm-route-manager.h"
+#include "nm-logging.h"
+
+#include "nm-test-utils.h"
+
+typedef struct {
+ int ifindex0, ifindex1;
+} test_fixture;
+
+static void
+setup_dev0_ip4 (int ifindex)
+{
+ GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route));
+ NMPlatformIP4Route route;
+
+ route.ifindex = ifindex;
+ route.mss = 0;
+
+ route.source = NM_IP_CONFIG_SOURCE_USER;
+ inet_pton (AF_INET, "6.6.6.0", &route.network);
+ route.plen = 24;
+ route.gateway = INADDR_ANY;
+ route.metric = 20;
+ g_array_append_val (routes, route);
+
+ route.source = NM_IP_CONFIG_SOURCE_USER;
+ inet_pton (AF_INET, "7.0.0.0", &route.network);
+ route.plen = 8;
+ inet_pton (AF_INET, "6.6.6.1", &route.gateway);
+ route.metric = 21;
+ g_array_append_val (routes, route);
+
+ nm_route_manager_ip4_route_sync (nm_route_manager_get (), ifindex, routes);
+ g_array_free (routes, TRUE);
+}
+
+static void
+setup_dev1_ip4 (int ifindex)
+{
+ GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route));
+ NMPlatformIP4Route route;
+
+ route.ifindex = ifindex;
+ route.mss = 0;
+
+ /* Add some route outside of route manager. The route manager
+ * should get rid of it upon sync. */
+ nm_platform_ip4_route_add (route.ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ nmtst_inet4_from_string ("9.0.0.0"),
+ 8,
+ INADDR_ANY,
+ 0,
+ 10,
+ route.mss);
+
+ route.source = NM_IP_CONFIG_SOURCE_USER;
+ inet_pton (AF_INET, "6.6.6.0", &route.network);
+ route.plen = 24;
+ route.gateway = INADDR_ANY;
+ route.metric = 20;
+ g_array_append_val (routes, route);
+
+ route.source = NM_IP_CONFIG_SOURCE_USER;
+ inet_pton (AF_INET, "7.0.0.0", &route.network);
+ route.plen = 8;
+ route.gateway = INADDR_ANY;
+ route.metric = 22;
+ g_array_append_val (routes, route);
+
+ route.source = NM_IP_CONFIG_SOURCE_USER;
+ inet_pton (AF_INET, "8.0.0.0", &route.network);
+ route.plen = 8;
+ inet_pton (AF_INET, "6.6.6.2", &route.gateway);
+ route.metric = 22;
+ g_array_append_val (routes, route);
+
+ nm_route_manager_ip4_route_sync (nm_route_manager_get (), ifindex, routes);
+ g_array_free (routes, TRUE);
+}
+
+static void
+update_dev0_ip4 (int ifindex)
+{
+ GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route));
+ NMPlatformIP4Route route;
+
+ route.ifindex = ifindex;
+ route.mss = 0;
+
+ route.source = NM_IP_CONFIG_SOURCE_USER;
+ inet_pton (AF_INET, "6.6.6.0", &route.network);
+ route.plen = 24;
+ route.gateway = INADDR_ANY;
+ route.metric = 20;
+ g_array_append_val (routes, route);
+
+ route.source = NM_IP_CONFIG_SOURCE_USER;
+ inet_pton (AF_INET, "7.0.0.0", &route.network);
+ route.plen = 8;
+ route.gateway = INADDR_ANY;
+ route.metric = 21;
+ g_array_append_val (routes, route);
+
+ nm_route_manager_ip4_route_sync (nm_route_manager_get (), ifindex, routes);
+ g_array_free (routes, TRUE);
+}
+
+
+static GArray *
+ip4_routes (test_fixture *fixture)
+{
+ GArray *routes = nm_platform_ip4_route_get_all (fixture->ifindex0,
+ NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT);
+ GArray *routes1 = nm_platform_ip4_route_get_all (fixture->ifindex1,
+ NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT);
+
+ g_array_append_vals (routes, routes1->data, routes1->len);
+ g_array_free (routes1, TRUE);
+
+ return routes;
+}
+
+static void
+test_ip4 (test_fixture *fixture, gconstpointer user_data)
+{
+ GArray *routes;
+
+ NMPlatformIP4Route state1[] = {
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("6.6.6.0"),
+ .plen = 24,
+ .ifindex = fixture->ifindex0,
+ .gateway = INADDR_ANY,
+ .metric = 20,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("7.0.0.0"),
+ .plen = 8,
+ .ifindex = fixture->ifindex0,
+ .gateway = nmtst_inet4_from_string ("6.6.6.1"),
+ .metric = 21,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("7.0.0.0"),
+ .plen = 8,
+ .ifindex = fixture->ifindex1,
+ .gateway = INADDR_ANY,
+ .metric = 22,
+ .mss = 0,
+ },
+ };
+
+ NMPlatformIP4Route state2[] = {
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("6.6.6.0"),
+ .plen = 24,
+ .ifindex = fixture->ifindex0,
+ .gateway = INADDR_ANY,
+ .metric = 20,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("7.0.0.0"),
+ .plen = 8,
+ .ifindex = fixture->ifindex0,
+ .gateway = INADDR_ANY,
+ .metric = 21,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("7.0.0.0"),
+ .plen = 8,
+ .ifindex = fixture->ifindex1,
+ .gateway = INADDR_ANY,
+ .metric = 22,
+ .mss = 0,
+ },
+ };
+
+ NMPlatformIP4Route state3[] = {
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("7.0.0.0"),
+ .plen = 8,
+ .ifindex = fixture->ifindex1,
+ .gateway = INADDR_ANY,
+ .metric = 22,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("6.6.6.0"),
+ .plen = 24,
+ .ifindex = fixture->ifindex1,
+ .gateway = INADDR_ANY,
+ .metric = 20,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = nmtst_inet4_from_string ("8.0.0.0"),
+ .plen = 8,
+ .ifindex = fixture->ifindex1,
+ .gateway = nmtst_inet4_from_string ("6.6.6.2"),
+ .metric = 22,
+ .mss = 0,
+ },
+ };
+
+ setup_dev0_ip4 (fixture->ifindex0);
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*error adding*");
+ setup_dev1_ip4 (fixture->ifindex1);
+ g_test_assert_expected_messages ();
+
+ /* 6.6.6.0/24 on dev0 won over 6.6.6.0/24 on dev1
+ * 7.0.0.0/8 routes did not clash
+ * 8.0.0.0/8 could not be added. */
+ routes = ip4_routes (fixture);
+ g_assert_cmpint (routes->len, ==, G_N_ELEMENTS (state1));
+ nmtst_platform_ip4_routes_equal ((NMPlatformIP4Route *) routes->data, state1, routes->len);
+ g_array_free (routes, TRUE);
+
+ setup_dev1_ip4 (fixture->ifindex1);
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*error adding*");
+ setup_dev0_ip4 (fixture->ifindex0);
+ g_test_assert_expected_messages ();
+
+ /* Ensure nothing changed. */
+ routes = ip4_routes (fixture);
+ g_assert_cmpint (routes->len, ==, G_N_ELEMENTS (state1));
+ nmtst_platform_ip4_routes_equal ((NMPlatformIP4Route *) routes->data, state1, routes->len);
+ g_array_free (routes, TRUE);
+
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*error adding*");
+ update_dev0_ip4 (fixture->ifindex0);
+ g_test_assert_expected_messages ();
+
+ /* 7.0.0.0/8 on dev0 was updated for gateway removal*/
+ routes = ip4_routes (fixture);
+ g_assert_cmpint (routes->len, ==, G_N_ELEMENTS (state2));
+ nmtst_platform_ip4_routes_equal ((NMPlatformIP4Route *) routes->data, state2, routes->len);
+ g_array_free (routes, TRUE);
+
+ nm_route_manager_route_flush (nm_route_manager_get (), fixture->ifindex0);
+
+ /* 6.6.6.0/24 is now on dev1
+ * 7.0.0.0/8 gone from dev0, still present on dev1
+ * 8.0.0.0/8 is present on dev1 now that 6.6.6.0/24 is on dev1 too
+ * No dev0 routes left. */
+ routes = ip4_routes (fixture);
+ g_assert_cmpint (routes->len, ==, G_N_ELEMENTS (state3));
+ nmtst_platform_ip4_routes_equal ((NMPlatformIP4Route *) routes->data, state3, routes->len);
+ g_array_free (routes, TRUE);
+
+ nm_route_manager_route_flush (nm_route_manager_get (), fixture->ifindex1);
+
+ /* No routes left. */
+ routes = ip4_routes (fixture);
+ g_assert_cmpint (routes->len, ==, 0);
+ g_array_free (routes, TRUE);
+}
+
+static void
+setup_dev0_ip6 (int ifindex)
+{
+ GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP6Route));
+ NMPlatformIP6Route *route;
+
+ /* Add an address so that a route to the gateway below gets added. */
+ nm_platform_ip6_address_add (ifindex,
+ *nmtst_inet6_from_string ("2001:db8:8086::2"),
+ in6addr_any,
+ 64,
+ 3600,
+ 3600,
+ 0);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:8086::",
+ 48,
+ NULL,
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 20,
+ 0);
+ g_array_append_val (routes, *route);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:1337::",
+ 48,
+ NULL,
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 0,
+ 0);
+ g_array_append_val (routes, *route);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:abad:c0de::",
+ 64,
+ "2001:db8:8086::1",
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 21,
+ 0);
+ g_array_append_val (routes, *route);
+
+ nm_route_manager_ip6_route_sync (nm_route_manager_get (), ifindex, routes);
+ g_array_free (routes, TRUE);
+}
+
+static void
+setup_dev1_ip6 (int ifindex)
+{
+ GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP6Route));
+ NMPlatformIP6Route *route;
+
+ /* Add some route outside of route manager. The route manager
+ * should get rid of it upon sync. */
+ nm_platform_ip6_route_add (ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ *nmtst_inet6_from_string ("2001:db8:8088::"),
+ 48,
+ in6addr_any,
+ 10,
+ 0);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:8086::",
+ 48,
+ NULL,
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 20,
+ 0);
+ g_array_append_val (routes, *route);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:1337::",
+ 48,
+ NULL,
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 1024,
+ 0);
+ g_array_append_val (routes, *route);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:d34d::",
+ 64,
+ "2001:db8:8086::2",
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 20,
+ 0);
+ g_array_append_val (routes, *route);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:abad:c0de::",
+ 64,
+ NULL,
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 22,
+ 0);
+ g_array_append_val (routes, *route);
+
+ nm_route_manager_ip6_route_sync (nm_route_manager_get (), ifindex, routes);
+ g_array_free (routes, TRUE);
+}
+
+static void
+update_dev0_ip6 (int ifindex)
+{
+ GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP6Route));
+ NMPlatformIP6Route *route;
+
+ /* Add an address so that a route to the gateway below gets added. */
+ nm_platform_ip6_address_add (ifindex,
+ *nmtst_inet6_from_string ("2001:db8:8086::2"),
+ in6addr_any,
+ 64,
+ 3600,
+ 3600,
+ 0);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:8086::",
+ 48,
+ NULL,
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 20,
+ 0);
+ g_array_append_val (routes, *route);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:1337::",
+ 48,
+ NULL,
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 0,
+ 0);
+ g_array_append_val (routes, *route);
+
+ route = nmtst_platform_ip6_route_full ("2001:db8:abad:c0de::",
+ 64,
+ NULL,
+ ifindex,
+ NM_IP_CONFIG_SOURCE_USER,
+ 21,
+ 0);
+ g_array_append_val (routes, *route);
+
+ nm_route_manager_ip6_route_sync (nm_route_manager_get (), ifindex, routes);
+ g_array_free (routes, TRUE);
+}
+
+static GArray *
+ip6_routes (test_fixture *fixture)
+{
+ GArray *routes = nm_platform_ip6_route_get_all (fixture->ifindex0,
+ NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT);
+ GArray *routes1 = nm_platform_ip6_route_get_all (fixture->ifindex1,
+ NM_PLATFORM_GET_ROUTE_MODE_NO_DEFAULT);
+
+ g_array_append_vals (routes, routes1->data, routes1->len);
+ g_array_free (routes1, TRUE);
+
+ return routes;
+}
+
+static void
+test_ip6 (test_fixture *fixture, gconstpointer user_data)
+{
+ GArray *routes;
+
+ NMPlatformIP6Route state1[] = {
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:8086::"),
+ .plen = 48,
+ .ifindex = fixture->ifindex0,
+ .gateway = in6addr_any,
+ .metric = 20,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:1337::"),
+ .plen = 48,
+ .ifindex = fixture->ifindex0,
+ .gateway = in6addr_any,
+ .metric = 1024,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
+ .plen = 64,
+ .ifindex = fixture->ifindex0,
+ .gateway = *nmtst_inet6_from_string ("2001:db8:8086::1"),
+ .metric = 21,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
+ .plen = 64,
+ .ifindex = fixture->ifindex1,
+ .gateway = in6addr_any,
+ .metric = 22,
+ .mss = 0,
+ },
+ };
+
+ NMPlatformIP6Route state2[] = {
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:8086::"),
+ .plen = 48,
+ .ifindex = fixture->ifindex0,
+ .gateway = in6addr_any,
+ .metric = 20,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:1337::"),
+ .plen = 48,
+ .ifindex = fixture->ifindex0,
+ .gateway = in6addr_any,
+ .metric = 1024,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
+ .plen = 64,
+ .ifindex = fixture->ifindex0,
+ .gateway = in6addr_any,
+ .metric = 21,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
+ .plen = 64,
+ .ifindex = fixture->ifindex1,
+ .gateway = in6addr_any,
+ .metric = 22,
+ .mss = 0,
+ },
+ };
+
+ NMPlatformIP6Route state3[] = {
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
+ .plen = 64,
+ .ifindex = fixture->ifindex1,
+ .gateway = in6addr_any,
+ .metric = 22,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:8086::"),
+ .plen = 48,
+ .ifindex = fixture->ifindex1,
+ .gateway = in6addr_any,
+ .metric = 20,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:1337::"),
+ .plen = 48,
+ .ifindex = fixture->ifindex1,
+ .gateway = in6addr_any,
+ .metric = 1024,
+ .mss = 0,
+ },
+ {
+ .source = NM_IP_CONFIG_SOURCE_USER,
+ .network = *nmtst_inet6_from_string ("2001:db8:d34d::"),
+ .plen = 64,
+ .ifindex = fixture->ifindex1,
+ .gateway = *nmtst_inet6_from_string ("2001:db8:8086::2"),
+ .metric = 20,
+ .mss = 0,
+ },
+ };
+
+ setup_dev0_ip6 (fixture->ifindex0);
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*error adding*");
+ setup_dev1_ip6 (fixture->ifindex1);
+ g_test_assert_expected_messages ();
+
+ /* 2001:db8:8086::/48 on dev0 won over 2001:db8:8086::/48 on dev1
+ * 2001:db8:d34d::/64 on dev1 could not be added
+ * 2001:db8:1337::/48 on dev0 won over 2001:db8:1337::/48 on dev1 and has metric 1024
+ * 2001:db8:abad:c0de::/64 routes did not clash */
+ routes = ip6_routes (fixture);
+ g_assert_cmpint (routes->len, ==, G_N_ELEMENTS (state1));
+ nmtst_platform_ip6_routes_equal ((NMPlatformIP6Route *) routes->data, state1, routes->len);
+ g_array_free (routes, TRUE);
+
+ setup_dev1_ip6 (fixture->ifindex1);
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*error adding*");
+ setup_dev0_ip6 (fixture->ifindex0);
+ g_test_assert_expected_messages ();
+
+ /* Ensure nothing changed. */
+ routes = ip6_routes (fixture);
+ g_assert_cmpint (routes->len, ==, G_N_ELEMENTS (state1));
+ nmtst_platform_ip6_routes_equal ((NMPlatformIP6Route *) routes->data, state1, routes->len);
+ g_array_free (routes, TRUE);
+
+ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*error adding*");
+ update_dev0_ip6 (fixture->ifindex0);
+ g_test_assert_expected_messages ();
+
+ /* 2001:db8:abad:c0de::/64 on dev0 was updated for gateway removal*/
+ routes = ip6_routes (fixture);
+ g_assert_cmpint (routes->len, ==, G_N_ELEMENTS (state2));
+ nmtst_platform_ip6_routes_equal ((NMPlatformIP6Route *) routes->data, state2, routes->len);
+ g_array_free (routes, TRUE);
+
+ nm_route_manager_route_flush (nm_route_manager_get (), fixture->ifindex0);
+
+ /* 2001:db8:abad:c0de::/64 on dev1 is still there, went away from dev0
+ * 2001:db8:8086::/48 is now on dev1
+ * 2001:db8:1337::/48 is now on dev1, metric of 1024 still applies
+ * 2001:db8:d34d::/64 is present now that 2001:db8:8086::/48 is on dev1
+ * No dev0 routes left. */
+ routes = ip6_routes (fixture);
+ g_assert_cmpint (routes->len, ==, G_N_ELEMENTS (state3));
+ nmtst_platform_ip6_routes_equal ((NMPlatformIP6Route *) routes->data, state3, routes->len);
+ g_array_free (routes, TRUE);
+
+ nm_route_manager_route_flush (nm_route_manager_get (), fixture->ifindex1);
+
+ /* No routes left. */
+ routes = ip6_routes (fixture);
+ g_assert_cmpint (routes->len, ==, 0);
+ g_array_free (routes, TRUE);
+}
+
+static void
+fixture_setup (test_fixture *fixture, gconstpointer user_data)
+{
+ SignalData *link_added;
+
+ link_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED,
+ NM_PLATFORM_SIGNAL_ADDED,
+ link_callback,
+ "nm-test-device0");
+ nm_platform_link_delete (nm_platform_link_get_ifindex ("nm-test-device0"));
+ g_assert (!nm_platform_link_exists ("nm-test-device0"));
+ g_assert (nm_platform_dummy_add ("nm-test-device0"));
+ wait_signal (link_added);
+ free_signal (link_added);
+ fixture->ifindex0 = nm_platform_link_get_ifindex ("nm-test-device0");
+ g_assert (nm_platform_link_set_up (fixture->ifindex0));
+
+ link_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED,
+ NM_PLATFORM_SIGNAL_ADDED,
+ link_callback,
+ "nm-test-device1");
+ nm_platform_link_delete (nm_platform_link_get_ifindex ("nm-test-device1"));
+ g_assert (!nm_platform_link_exists ("nm-test-device1"));
+ g_assert (nm_platform_dummy_add ("nm-test-device1"));
+ wait_signal (link_added);
+ free_signal (link_added);
+ fixture->ifindex1 = nm_platform_link_get_ifindex ("nm-test-device1");
+ g_assert (nm_platform_link_set_up (fixture->ifindex1));
+}
+
+static void
+fixture_teardown (test_fixture *fixture, gconstpointer user_data)
+{
+ nm_platform_link_delete (fixture->ifindex0);
+ nm_platform_link_delete (fixture->ifindex1);
+}
+
+void
+setup_tests (void)
+{
+ g_test_add ("/route-manager/ip4", test_fixture, NULL, fixture_setup, test_ip4, fixture_teardown);
+ g_test_add ("/route-manager/ip6", test_fixture, NULL, fixture_setup, test_ip6, fixture_teardown);
+}
diff --git a/src/tests/test-wired-defname.c b/src/tests/test-wired-defname.c
index 968971d981..b2933de0e3 100644
--- a/src/tests/test-wired-defname.c
+++ b/src/tests/test-wired-defname.c
@@ -18,12 +18,15 @@
*
*/
+#include "config.h"
+
#include <glib.h>
#include <glib-object.h>
#include <nm-simple-connection.h>
#include <nm-setting-connection.h>
#include "nm-device-ethernet-utils.h"
+#include "gsystem-local-alloc.h"
static NMConnection *
_new_connection (const char *id)
@@ -43,7 +46,7 @@ _new_connection (const char *id)
static void
test_defname_no_connections (void)
{
- char *name;
+ gs_free char *name = NULL;
name = nm_device_ethernet_utils_get_default_wired_name (NULL);
g_assert_cmpstr (name, ==, "Wired connection 1");
@@ -55,7 +58,7 @@ static void
test_defname_no_conflict (void)
{
GSList *list = NULL;
- char *name;
+ gs_free char *name = NULL;
list = g_slist_append (list, _new_connection ("asdfasdfasdfadf"));
list = g_slist_append (list, _new_connection ("work wifi"));
@@ -73,7 +76,7 @@ static void
test_defname_conflict (void)
{
GSList *list = NULL;
- char *name;
+ gs_free char *name = NULL;
list = g_slist_append (list, _new_connection ("asdfasdfasdfadf"));
list = g_slist_append (list, _new_connection ("Wired connection 1"));
@@ -91,7 +94,7 @@ static void
test_defname_multiple_conflicts (void)
{
GSList *list = NULL;
- char *name;
+ gs_free char *name = NULL;
list = g_slist_append (list, _new_connection ("random gsm connection"));
list = g_slist_append (list, _new_connection ("home wifi"));
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index a348ab7182..57e0e2d215 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -19,6 +19,8 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <sys/socket.h>
@@ -41,6 +43,9 @@
#include "nm-dispatcher.h"
#include "nm-agent-manager.h"
#include "nm-core-internal.h"
+#include "nm-default-route-manager.h"
+#include "nm-route-manager.h"
+#include "gsystem-local-alloc.h"
#include "nm-vpn-connection-glue.h"
@@ -89,8 +94,9 @@ typedef struct {
NMVpnServiceState service_state;
- DBusGProxy *proxy;
- GHashTable *connect_hash;
+ GDBusProxy *proxy;
+ GCancellable *cancellable;
+ GVariant *connect_hash;
guint connect_timeout;
gboolean has_ip4;
NMIP4Config *ip4_config;
@@ -133,10 +139,9 @@ static void get_secrets (NMVpnConnection *self,
SecretsReq secrets_idx,
const char **hints);
-static void plugin_interactive_secrets_required (DBusGProxy *proxy,
+static void plugin_interactive_secrets_required (NMVpnConnection *self,
const char *message,
- const char **secrets,
- gpointer user_data);
+ const char **secrets);
static void _set_vpn_state (NMVpnConnection *connection,
VpnState vpn_state,
@@ -208,18 +213,10 @@ static void
call_plugin_disconnect (NMVpnConnection *self)
{
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- GError *error = NULL;
if (priv->proxy) {
- if (!dbus_g_proxy_call (priv->proxy, "Disconnect", &error,
- G_TYPE_INVALID,
- G_TYPE_INVALID)) {
- nm_log_warn (LOGD_VPN, "error disconnecting VPN: %s", error->message);
- g_error_free (error);
- }
-
- g_object_unref (priv->proxy);
- priv->proxy = NULL;
+ g_dbus_proxy_call (priv->proxy, "Disconnect", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
+ g_clear_object (&priv->proxy);
}
}
@@ -230,7 +227,7 @@ vpn_cleanup (NMVpnConnection *connection, NMDevice *parent_dev)
if (priv->ip_ifindex) {
nm_platform_link_set_down (priv->ip_ifindex);
- nm_platform_route_flush (priv->ip_ifindex);
+ nm_route_manager_route_flush (nm_route_manager_get (), priv->ip_ifindex);
nm_platform_address_flush (priv->ip_ifindex);
}
@@ -321,6 +318,9 @@ _set_vpn_state (NMVpnConnection *connection,
dispatcher_cleanup (connection);
+ nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), connection);
+ nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), connection);
+
/* The connection gets destroyed by the VPN manager when it enters the
* disconnected/failed state, but we need to keep it around for a bit
* to send out signals and handle the dispatcher. So ref it.
@@ -487,6 +487,7 @@ add_ip4_vpn_gateway_route (NMIP4Config *config, NMDevice *parent_device, guint32
NMIP4Config *parent_config;
guint32 parent_gw;
NMPlatformIP4Route route;
+ guint32 route_metric;
g_return_if_fail (NM_IS_IP4_CONFIG (config));
g_return_if_fail (NM_IS_DEVICE (parent_device));
@@ -502,6 +503,8 @@ add_ip4_vpn_gateway_route (NMIP4Config *config, NMDevice *parent_device, guint32
if (!parent_gw)
return;
+ route_metric = nm_device_get_ip4_route_metric (parent_device);
+
memset (&route, 0, sizeof (route));
route.network = vpn_gw;
route.plen = 32;
@@ -515,7 +518,7 @@ add_ip4_vpn_gateway_route (NMIP4Config *config, NMDevice *parent_device, guint32
route.gateway = 0;
route.source = NM_IP_CONFIG_SOURCE_VPN;
- route.metric = nm_device_get_priority (parent_device);
+ route.metric = route_metric;
nm_ip4_config_add_route (config, &route);
/* Ensure there's a route to the parent device's gateway through the
@@ -527,7 +530,7 @@ add_ip4_vpn_gateway_route (NMIP4Config *config, NMDevice *parent_device, guint32
route.network = parent_gw;
route.plen = 32;
route.source = NM_IP_CONFIG_SOURCE_VPN;
- route.metric = nm_device_get_priority (parent_device);
+ route.metric = route_metric;
nm_ip4_config_add_route (config, &route);
}
@@ -540,6 +543,7 @@ add_ip6_vpn_gateway_route (NMIP6Config *config,
NMIP6Config *parent_config;
const struct in6_addr *parent_gw;
NMPlatformIP6Route route;
+ guint32 route_metric;
g_return_if_fail (NM_IS_IP6_CONFIG (config));
g_return_if_fail (NM_IS_DEVICE (parent_device));
@@ -551,6 +555,8 @@ add_ip6_vpn_gateway_route (NMIP6Config *config,
if (!parent_gw)
return;
+ route_metric = nm_device_get_ip6_route_metric (parent_device);
+
memset (&route, 0, sizeof (route));
route.network = *vpn_gw;
route.plen = 128;
@@ -564,7 +570,7 @@ add_ip6_vpn_gateway_route (NMIP6Config *config,
route.gateway = in6addr_any;
route.source = NM_IP_CONFIG_SOURCE_VPN;
- route.metric = nm_device_get_priority (parent_device);
+ route.metric = route_metric;
nm_ip6_config_add_route (config, &route);
/* Ensure there's a route to the parent device's gateway through the
@@ -576,7 +582,7 @@ add_ip6_vpn_gateway_route (NMIP6Config *config,
route.network = *parent_gw;
route.plen = 128;
route.source = NM_IP_CONFIG_SOURCE_VPN;
- route.metric = nm_device_get_priority (parent_device);
+ route.metric = route_metric;
nm_ip6_config_add_route (config, &route);
}
@@ -626,16 +632,13 @@ vpn_plugin_failure_to_string (NMVpnPluginFailure failure)
}
static void
-plugin_failed (DBusGProxy *proxy,
- NMVpnPluginFailure plugin_failure,
- gpointer user_data)
+plugin_failed (NMVpnConnection *self, guint reason)
{
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (user_data);
+ NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- nm_log_warn (LOGD_VPN, "VPN plugin failed: %s (%d)",
- vpn_plugin_failure_to_string (plugin_failure), plugin_failure);
+ nm_log_warn (LOGD_VPN, "VPN plugin failed: %s (%d)", vpn_plugin_failure_to_string (reason), reason);
- switch (plugin_failure) {
+ switch (reason) {
case NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED:
priv->failure_reason = NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED;
break;
@@ -725,12 +728,9 @@ vpn_reason_to_string (NMVpnConnectionStateReason reason)
}
static void
-plugin_state_changed (DBusGProxy *proxy,
- NMVpnServiceState new_service_state,
- gpointer user_data)
+plugin_state_changed (NMVpnConnection *self, NMVpnServiceState new_service_state)
{
- NMVpnConnection *connection = NM_VPN_CONNECTION (user_data);
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
+ NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
NMVpnServiceState old_service_state = priv->service_state;
nm_log_info (LOGD_VPN, "VPN plugin state changed: %s (%d)",
@@ -748,7 +748,7 @@ plugin_state_changed (DBusGProxy *proxy,
nm_log_info (LOGD_VPN, "VPN plugin state change reason: %s (%d)",
vpn_reason_to_string (priv->failure_reason), priv->failure_reason);
- _set_vpn_state (connection, STATE_FAILED, priv->failure_reason, FALSE);
+ _set_vpn_state (self, STATE_FAILED, priv->failure_reason, FALSE);
/* Reset the failure reason */
priv->failure_reason = NM_VPN_CONNECTION_STATE_REASON_UNKNOWN;
@@ -758,13 +758,13 @@ plugin_state_changed (DBusGProxy *proxy,
*/
if ( old_state == STATE_ACTIVATED
&& priv->vpn_state == STATE_FAILED
- && _connection_only_can_persist (connection))
- g_signal_emit (connection, signals[INTERNAL_RETRY_AFTER_FAILURE], 0);
+ && _connection_only_can_persist (self))
+ g_signal_emit (self, signals[INTERNAL_RETRY_AFTER_FAILURE], 0);
}
} else if (new_service_state == NM_VPN_SERVICE_STATE_STARTING &&
old_service_state == NM_VPN_SERVICE_STATE_STARTED) {
/* The VPN service got disconnected and is attempting to reconnect */
- _set_vpn_state (connection, STATE_CONNECT, NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT, FALSE);
+ _set_vpn_state (self, STATE_CONNECT, NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT, FALSE);
}
}
@@ -881,9 +881,9 @@ apply_parent_device_config (NMVpnConnection *connection)
NMIP6Config *vpn6_parent_config = NULL;
if (priv->ip4_config)
- vpn4_parent_config = nm_ip4_config_new ();
+ vpn4_parent_config = nm_ip4_config_new (priv->ip_ifindex);
if (priv->ip6_config)
- vpn6_parent_config = nm_ip6_config_new ();
+ vpn6_parent_config = nm_ip6_config_new (priv->ip_ifindex);
if (priv->ip_ifindex <= 0) {
/* If the VPN didn't return a network interface, it is a route-based
@@ -924,7 +924,8 @@ nm_vpn_connection_apply_config (NMVpnConnection *connection)
nm_platform_link_set_up (priv->ip_ifindex);
if (priv->ip4_config) {
- if (!nm_ip4_config_commit (priv->ip4_config, priv->ip_ifindex))
+ if (!nm_ip4_config_commit (priv->ip4_config, priv->ip_ifindex,
+ nm_vpn_connection_get_ip4_route_metric (connection)))
return FALSE;
}
@@ -936,6 +937,9 @@ nm_vpn_connection_apply_config (NMVpnConnection *connection)
apply_parent_device_config (connection);
+ nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), connection);
+ nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), connection);
+
nm_log_info (LOGD_VPN, "VPN connection '%s' (IP Config Get) complete.",
nm_connection_get_id (priv->connection));
_set_vpn_state (connection, STATE_PRE_UP, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
@@ -959,7 +963,7 @@ nm_vpn_connection_config_maybe_complete (NMVpnConnection *connection,
}
}
- if (priv->connect_timeout == 0) {
+ if (priv->connect_timeout) {
g_source_remove (priv->connect_timeout);
priv->connect_timeout = 0;
}
@@ -979,34 +983,56 @@ nm_vpn_connection_config_maybe_complete (NMVpnConnection *connection,
_set_vpn_state (connection, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID, FALSE);
}
-#define LOG_INVALID_ARG(property) \
- nm_log_dbg (LOGD_VPN, "VPN connection '%s' has invalid argument %s", \
- nm_connection_get_id (priv->connection), property)
+static gboolean
+ip6_addr_from_variant (GVariant *v, struct in6_addr *addr)
+{
+ const guint8 *bytes;
+ gsize len;
+
+ g_return_val_if_fail (v, FALSE);
+ g_return_val_if_fail (addr, FALSE);
+
+ if (g_variant_is_of_type (v, G_VARIANT_TYPE ("ay"))) {
+ bytes = g_variant_get_fixed_array (v, &len, sizeof (guint8));
+ if (len == sizeof (struct in6_addr) && !IN6_IS_ADDR_UNSPECIFIED (bytes)) {
+ memcpy (addr, bytes, len);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static struct in6_addr *
+ip6_addr_dup_from_variant (GVariant *v)
+{
+ struct in6_addr *addr;
+
+ addr = g_malloc0 (sizeof (*addr));
+ if (ip6_addr_from_variant (v, addr))
+ return addr;
+ g_free (addr);
+ return NULL;
+}
static gboolean
-process_generic_config (NMVpnConnection *connection,
- GHashTable *config_hash)
+process_generic_config (NMVpnConnection *self, GVariant *dict)
{
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
- GValue *val;
+ NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
+ const char *str;
+ GVariant *v;
+ guint32 u32;
+ gboolean b, success = FALSE;
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CAN_PERSIST);
- if (val && G_VALUE_HOLDS_BOOLEAN (val) && g_value_get_boolean (val)) {
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_CAN_PERSIST, "b", &b) && b) {
/* Defaults to FALSE, so only let service indicate TRUE */
priv->service_can_persist = TRUE;
}
g_clear_pointer (&priv->ip_iface, g_free);
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CONFIG_TUNDEV);
- if (val) {
- if (G_VALUE_HOLDS (val, G_TYPE_STRING)) {
- const char *tmp = g_value_get_string (val);
-
- /* Backwards compat with NM-openswan */
- if (g_strcmp0 (tmp, "_none_") != 0)
- priv->ip_iface = g_strdup (tmp);
- } else
- LOG_INVALID_ARG (NM_VPN_PLUGIN_CONFIG_TUNDEV);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_TUNDEV, "&s", &str)) {
+ /* Backwards compat with NM-openswan */
+ if (g_strcmp0 (str, "_none_") != 0)
+ priv->ip_iface = g_strdup (str);
}
if (priv->ip_iface) {
@@ -1014,38 +1040,32 @@ process_generic_config (NMVpnConnection *connection,
priv->ip_ifindex = nm_platform_link_get_ifindex (priv->ip_iface);
if (!priv->ip_ifindex) {
nm_log_err (LOGD_VPN, "(%s): failed to look up VPN interface index", priv->ip_iface);
- nm_vpn_connection_config_maybe_complete (connection, FALSE);
+ nm_vpn_connection_config_maybe_complete (self, FALSE);
return FALSE;
}
}
g_clear_pointer (&priv->banner, g_free);
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CONFIG_BANNER);
- if (val) {
- if (G_VALUE_HOLDS (val, G_TYPE_STRING))
- priv->banner = g_strdup (g_value_get_string (val));
- else
- LOG_INVALID_ARG (NM_VPN_PLUGIN_CONFIG_BANNER);
- }
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_BANNER, "&s", &str))
+ priv->banner = g_strdup (str);
/* External world-visible address of the VPN server */
priv->ip4_external_gw = 0;
g_clear_pointer (&priv->ip6_external_gw, g_free);
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY);
- if (val) {
- GByteArray *ba;
-
- if (G_VALUE_HOLDS (val, G_TYPE_UINT)) {
- priv->ip4_external_gw = g_value_get_uint (val);
- } else if (G_VALUE_HOLDS (val, DBUS_TYPE_G_UCHAR_ARRAY) &&
- (ba = g_value_get_boxed (val)) &&
- ba->len == sizeof (struct in6_addr)) {
- priv->ip6_external_gw = g_memdup (ba->data, ba->len);
- } else {
- nm_log_err (LOGD_VPN, "(%s): VPN gateway is neither IPv4 nor IPv6", priv->ip_iface);
- nm_vpn_connection_config_maybe_complete (connection, FALSE);
- return FALSE;
- }
+
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "u", &u32)) {
+ priv->ip4_external_gw = u32;
+ success = TRUE;
+ } else if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "@ay", &v)) {
+ priv->ip6_external_gw = ip6_addr_dup_from_variant (v);
+ success = !!priv->ip6_external_gw;
+ g_variant_unref (v);
+ }
+
+ if (!success) {
+ nm_log_err (LOGD_VPN, "(%s): VPN gateway is neither IPv4 nor IPv6", priv->ip_iface);
+ nm_vpn_connection_config_maybe_complete (self, FALSE);
+ return FALSE;
}
/* MTU; this is a per-connection value, though NM's API treats it
@@ -1053,93 +1073,95 @@ process_generic_config (NMVpnConnection *connection,
* later in ip4_config_get.
*/
priv->mtu = 0;
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CONFIG_MTU);
- if (val) {
- if (G_VALUE_HOLDS (val, G_TYPE_UINT)) {
- priv->mtu = g_value_get_uint (val);
- } else
- LOG_INVALID_ARG (NM_VPN_PLUGIN_CONFIG_MTU);
- }
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "u", &u32))
+ priv->mtu = u32;
return TRUE;
}
static void
-nm_vpn_connection_config_get (DBusGProxy *proxy,
- GHashTable *config_hash,
- gpointer user_data)
+nm_vpn_connection_config_get (NMVpnConnection *self, GVariant *dict)
{
- NMVpnConnection *connection = NM_VPN_CONNECTION (user_data);
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
- GValue *val;
+ NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
+ gboolean b;
+
+ g_return_if_fail (dict && g_variant_is_of_type (dict, G_VARIANT_TYPE_VARDICT));
nm_log_info (LOGD_VPN, "VPN connection '%s' (IP Config Get) reply received.",
nm_connection_get_id (priv->connection));
if (priv->vpn_state == STATE_CONNECT)
- _set_vpn_state (connection, STATE_IP_CONFIG_GET, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+ _set_vpn_state (self, STATE_IP_CONFIG_GET, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
- if (!process_generic_config (connection, config_hash))
+ if (!process_generic_config (self, dict))
return;
/* Note whether to expect IPv4 and IPv6 configs */
- val = g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CONFIG_HAS_IP4);
priv->has_ip4 = FALSE;
- if (val) {
- if (G_VALUE_HOLDS (val, G_TYPE_BOOLEAN))
- priv->has_ip4 = g_value_get_boolean (val);
- else
- LOG_INVALID_ARG (NM_VPN_PLUGIN_CONFIG_HAS_IP4);
- }
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_HAS_IP4, "b", &b))
+ priv->has_ip4 = b;
g_clear_object (&priv->ip4_config);
- val = g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CONFIG_HAS_IP6);
priv->has_ip6 = FALSE;
- if (val) {
- if (G_VALUE_HOLDS (val, G_TYPE_BOOLEAN))
- priv->has_ip6 = g_value_get_boolean (val);
- else
- LOG_INVALID_ARG (NM_VPN_PLUGIN_CONFIG_HAS_IP6);
- }
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_HAS_IP6, "b", &b))
+ priv->has_ip6 = b;
g_clear_object (&priv->ip6_config);
}
-static guint
-vpn_routing_metric (NMVpnConnection *connection)
+guint32
+nm_vpn_connection_get_ip4_route_metric (NMVpnConnection *connection)
{
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
- if (priv->ip_ifindex)
- return NM_PLATFORM_ROUTE_METRIC_DEFAULT;
- else {
- NMDevice *parent_dev = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (connection));
+ if (priv->connection) {
+ gint64 route_metric = nm_setting_ip_config_get_route_metric (nm_connection_get_setting_ip4_config (priv->connection));
- return nm_device_get_priority (parent_dev);
+ if (route_metric >= 0)
+ return route_metric;
}
+
+ return NM_VPN_ROUTE_METRIC_DEFAULT;
}
-static void
-nm_vpn_connection_ip4_config_get (DBusGProxy *proxy,
- GHashTable *config_hash,
- gpointer user_data)
+guint32
+nm_vpn_connection_get_ip6_route_metric (NMVpnConnection *connection)
{
- NMVpnConnection *connection = NM_VPN_CONNECTION (user_data);
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
+
+ if (priv->connection) {
+ gint64 route_metric = nm_setting_ip_config_get_route_metric (nm_connection_get_setting_ip6_config (priv->connection));
+
+ if (route_metric >= 0)
+ return route_metric;
+ }
+
+ return NM_VPN_ROUTE_METRIC_DEFAULT;
+}
+
+static void
+nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict)
+{
+ NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
NMPlatformIP4Address address;
NMIP4Config *config;
- GValue *val;
- int i;
+ guint32 u32, route_metric;
+ GVariantIter *iter;
+ const char *str;
+ GVariant *v;
+ gboolean b;
+
+ g_return_if_fail (dict && g_variant_is_of_type (dict, G_VARIANT_TYPE_VARDICT));
if (priv->vpn_state == STATE_CONNECT)
- _set_vpn_state (connection, STATE_IP_CONFIG_GET, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+ _set_vpn_state (self, STATE_IP_CONFIG_GET, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
if (priv->has_ip4) {
nm_log_info (LOGD_VPN, "VPN connection '%s' (IP4 Config Get) reply received.",
nm_connection_get_id (priv->connection));
- if (g_hash_table_size (config_hash) == 0) {
+ if (g_variant_n_children (dict) == 0) {
priv->has_ip4 = FALSE;
- nm_vpn_connection_config_maybe_complete (connection, TRUE);
+ nm_vpn_connection_config_maybe_complete (self, TRUE);
return;
}
} else {
@@ -1149,14 +1171,14 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy,
/* In the old API, the generic and IPv4 configuration items
* were mixed together.
*/
- if (!process_generic_config (connection, config_hash))
+ if (!process_generic_config (self, dict))
return;
priv->has_ip4 = TRUE;
priv->has_ip6 = FALSE;
}
- config = nm_ip4_config_new ();
+ config = nm_ip4_config_new (priv->ip_ifindex);
memset (&address, 0, sizeof (address));
address.plen = 24;
@@ -1164,21 +1186,17 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy,
nm_ip4_config_set_gateway (config, priv->ip4_external_gw);
/* Internal address of the VPN subnet's gateway */
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_INT_GATEWAY);
- if (val)
- priv->ip4_internal_gw = g_value_get_uint (val);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_INT_GATEWAY, "u", &u32))
+ priv->ip4_internal_gw = u32;
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS);
- if (val)
- address.address = g_value_get_uint (val);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS, "u", &u32))
+ address.address = u32;
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_PTP);
- if (val)
- address.peer_address = g_value_get_uint (val);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_PTP, "u", &u32))
+ address.peer_address = u32;
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_PREFIX);
- if (val)
- address.plen = g_value_get_uint (val);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_PREFIX, "u", &u32))
+ address.plen = u32;
if (address.address && address.plen) {
address.source = NM_IP_CONFIG_SOURCE_VPN;
@@ -1186,119 +1204,107 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy,
} else {
nm_log_err (LOGD_VPN, "invalid IP4 config received!");
g_object_unref (config);
- nm_vpn_connection_config_maybe_complete (connection, FALSE);
+ nm_vpn_connection_config_maybe_complete (self, FALSE);
return;
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_DNS);
- if (val) {
- GArray *dns = (GArray *) g_value_get_boxed (val);
-
- for (i = 0; i < dns->len; i++)
- nm_ip4_config_add_nameserver (config, g_array_index (dns, guint, i));
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_DNS, "au", &iter)) {
+ while (g_variant_iter_next (iter, "u", &u32))
+ nm_ip4_config_add_nameserver (config, u32);
+ g_variant_iter_free (iter);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_NBNS);
- if (val) {
- GArray *nbns = (GArray *) g_value_get_boxed (val);
-
- for (i = 0; i < nbns->len; i++)
- nm_ip4_config_add_wins (config, g_array_index (nbns, guint, i));
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_NBNS, "au", &iter)) {
+ while (g_variant_iter_next (iter, "u", &u32))
+ nm_ip4_config_add_wins (config, u32);
+ g_variant_iter_free (iter);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_MSS);
- if (val)
- nm_ip4_config_set_mss (config, g_value_get_uint (val));
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_MSS, "u", &u32))
+ nm_ip4_config_set_mss (config, u32);
if (priv->mtu)
nm_ip4_config_set_mtu (config, priv->mtu, NM_IP_CONFIG_SOURCE_VPN);
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN);
- if (val)
- nm_ip4_config_add_domain (config, g_value_get_string (val));
-
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_DOMAINS);
- if (val) {
- const char **domains = g_value_get_boxed (val);
- const char **domain;
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN, "&s", &str))
+ nm_ip4_config_add_domain (config, str);
- for (domain = domains; domain && *domain; domain++)
- nm_ip4_config_add_domain (config, *domain);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_DOMAINS, "as", &iter)) {
+ while (g_variant_iter_next (iter, "&s", &str))
+ nm_ip4_config_add_domain (config, str);
+ g_variant_iter_free (iter);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_ROUTES);
- if (val) {
- GSList *routes;
- GSList *iter;
+ route_metric = nm_vpn_connection_get_ip4_route_metric (self);
- routes = nm_utils_ip4_routes_from_gvalue (val);
- for (iter = routes; iter; iter = iter->next) {
- NMIP4Route *item = iter->data;
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_ROUTES, "aau", &iter)) {
+ while (g_variant_iter_next (iter, "@au", &v)) {
NMPlatformIP4Route route;
- memset (&route, 0, sizeof (route));
- route.network = nm_ip4_route_get_dest (item);
- route.plen = nm_ip4_route_get_prefix (item);
- route.gateway = nm_ip4_route_get_next_hop (item);
- route.source = NM_IP_CONFIG_SOURCE_VPN;
- route.metric = vpn_routing_metric (connection);
-
- /* Ignore host routes to the VPN gateway since NM adds one itself
- * below. Since NM knows more about the routing situation than
- * the VPN server, we want to use the NM created route instead of
- * whatever the server provides.
- */
- if (priv->ip4_external_gw && route.network == priv->ip4_external_gw && route.plen == 32)
- continue;
-
- /* Otherwise accept the VPN-provided route */
- nm_ip4_config_add_route (config, &route);
+ if (g_variant_n_children (v) == 4) {
+ memset (&route, 0, sizeof (route));
+ g_variant_get_child (v, 0, "u", &route.network);
+ g_variant_get_child (v, 1, "u", &route.plen);
+ g_variant_get_child (v, 2, "u", &route.gateway);
+ /* 4th item is unused route metric */
+ route.metric = route_metric;
+ route.source = NM_IP_CONFIG_SOURCE_VPN;
+
+ /* Ignore host routes to the VPN gateway since NM adds one itself
+ * below. Since NM knows more about the routing situation than
+ * the VPN server, we want to use the NM created route instead of
+ * whatever the server provides.
+ */
+ if (!(priv->ip4_external_gw && route.network == priv->ip4_external_gw && route.plen == 32))
+ nm_ip4_config_add_route (config, &route);
+ }
+ g_variant_unref (v);
}
-
- g_slist_free_full (routes, (GDestroyNotify) nm_ip4_route_unref);
+ g_variant_iter_free (iter);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT);
- if (val && G_VALUE_HOLDS_BOOLEAN (val))
- nm_ip4_config_set_never_default (config, g_value_get_boolean (val));
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT, "b", &b))
+ nm_ip4_config_set_never_default (config, b);
/* Merge in user overrides from the NMConnection's IPv4 setting */
nm_ip4_config_merge_setting (config,
nm_connection_get_setting_ip4_config (priv->connection),
- vpn_routing_metric (connection));
+ route_metric);
g_clear_object (&priv->ip4_config);
priv->ip4_config = config;
nm_ip4_config_export (config);
- g_object_notify (G_OBJECT (connection), NM_ACTIVE_CONNECTION_IP4_CONFIG);
- nm_vpn_connection_config_maybe_complete (connection, TRUE);
+ g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_IP4_CONFIG);
+ nm_vpn_connection_config_maybe_complete (self, TRUE);
}
static void
-nm_vpn_connection_ip6_config_get (DBusGProxy *proxy,
- GHashTable *config_hash,
- gpointer user_data)
+nm_vpn_connection_ip6_config_get (NMVpnConnection *self, GVariant *dict)
{
- NMVpnConnection *connection = NM_VPN_CONNECTION (user_data);
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
+ NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
NMPlatformIP6Address address;
+ guint32 u32, route_metric;
NMIP6Config *config;
- GValue *val;
- int i;
+ GVariantIter *iter;
+ const char *str;
+ GVariant *v;
+ gboolean b;
+
+ g_return_if_fail (dict && g_variant_is_of_type (dict, G_VARIANT_TYPE_VARDICT));
nm_log_info (LOGD_VPN, "VPN connection '%s' (IP6 Config Get) reply received.",
nm_connection_get_id (priv->connection));
if (priv->vpn_state == STATE_CONNECT)
- _set_vpn_state (connection, STATE_IP_CONFIG_GET, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+ _set_vpn_state (self, STATE_IP_CONFIG_GET, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
- if (g_hash_table_size (config_hash) == 0) {
+ if (g_variant_n_children (dict) == 0) {
priv->has_ip6 = FALSE;
- nm_vpn_connection_config_maybe_complete (connection, TRUE);
+ nm_vpn_connection_config_maybe_complete (self, TRUE);
return;
}
- config = nm_ip6_config_new ();
+ config = nm_ip6_config_new (priv->ip_ifindex);
memset (&address, 0, sizeof (address));
address.plen = 128;
@@ -1307,33 +1313,23 @@ nm_vpn_connection_ip6_config_get (DBusGProxy *proxy,
/* Internal address of the VPN subnet's gateway */
g_clear_pointer (&priv->ip6_internal_gw, g_free);
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_INT_GATEWAY);
- if (val) {
- GByteArray *ba = g_value_get_boxed (val);
-
- if (ba->len == sizeof (struct in6_addr))
- priv->ip6_internal_gw = g_memdup (ba->data, ba->len);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_INT_GATEWAY, "@ay", &v)) {
+ priv->ip6_internal_gw = ip6_addr_dup_from_variant (v);
+ g_variant_unref (v);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_ADDRESS);
- if (val) {
- GByteArray *ba = g_value_get_boxed (val);
-
- if (ba->len == sizeof (struct in6_addr))
- address.address = *(struct in6_addr *) ba->data;
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_ADDRESS, "@ay", &v)) {
+ ip6_addr_from_variant (v, &address.address);
+ g_variant_unref (v);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_PTP);
- if (val) {
- GByteArray *ba = g_value_get_boxed (val);
-
- if (ba->len == sizeof (struct in6_addr))
- address.peer_address = *(struct in6_addr *) ba->data;
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_PTP, "@ay", &v)) {
+ ip6_addr_from_variant (v, &address.peer_address);
+ g_variant_unref (v);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_PREFIX);
- if (val)
- address.plen = g_value_get_uint (val);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_PREFIX, "u", &u32))
+ address.plen = u32;
if (!IN6_IS_ADDR_UNSPECIFIED (&address.address) && address.plen) {
address.source = NM_IP_CONFIG_SOURCE_VPN;
@@ -1341,84 +1337,83 @@ nm_vpn_connection_ip6_config_get (DBusGProxy *proxy,
} else {
nm_log_err (LOGD_VPN, "invalid IP6 config received!");
g_object_unref (config);
- nm_vpn_connection_config_maybe_complete (connection, FALSE);
+ nm_vpn_connection_config_maybe_complete (self, FALSE);
+ return;
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_DNS);
- if (val) {
- GPtrArray *dns = (GPtrArray *) g_value_get_boxed (val);
- GByteArray *ba;
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_DNS, "aay", &iter)) {
+ while (g_variant_iter_next (iter, "@ay", &v)) {
+ struct in6_addr dns;
- for (i = 0; i < dns->len; i++) {
- ba = dns->pdata[i];
- if (ba->len == sizeof (struct in6_addr))
- nm_ip6_config_add_nameserver (config, (struct in6_addr *)ba->data);
+ if (ip6_addr_from_variant (v, &dns))
+ nm_ip6_config_add_nameserver (config, &dns);
+ g_variant_unref (v);
}
+ g_variant_iter_free (iter);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_MSS);
- if (val)
- nm_ip6_config_set_mss (config, g_value_get_uint (val));
-
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_DOMAIN);
- if (val)
- nm_ip6_config_add_domain (config, g_value_get_string (val));
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_MSS, "u", &u32))
+ nm_ip6_config_set_mss (config, u32);
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_DOMAINS);
- if (val) {
- const char **domains = g_value_get_boxed (val);
- const char **domain;
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_DOMAIN, "&s", &str))
+ nm_ip6_config_add_domain (config, str);
- for (domain = domains; domain && *domain; domain++)
- nm_ip6_config_add_domain (config, *domain);
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_DOMAINS, "as", &iter)) {
+ while (g_variant_iter_next (iter, "&s", &str))
+ nm_ip6_config_add_domain (config, str);
+ g_variant_iter_free (iter);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_ROUTES);
- if (val) {
- GSList *routes;
- GSList *iter;
+ route_metric = nm_vpn_connection_get_ip6_route_metric (self);
- routes = nm_utils_ip6_routes_from_gvalue (val);
- for (iter = routes; iter; iter = iter->next) {
- NMIP6Route *item = iter->data;
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_ROUTES, "a(ayuayu)", &iter)) {
+ GVariant *dest, *next_hop;
+ guint32 prefix, metric;
+
+ while (g_variant_iter_next (iter, "(@ayu@ayu)", &dest, &prefix, &next_hop, &metric)) {
NMPlatformIP6Route route;
memset (&route, 0, sizeof (route));
- route.network = *nm_ip6_route_get_dest (item);
- route.plen = nm_ip6_route_get_prefix (item);
- route.gateway = *nm_ip6_route_get_next_hop (item);
+
+ if (!ip6_addr_from_variant (dest, &route.network)) {
+ nm_log_warn (LOGD_VPN, "VPN connection '%s' received invalid IPv6 dest address",
+ nm_connection_get_id (priv->connection));
+ goto next;
+ }
+
+ route.plen = prefix;
+ ip6_addr_from_variant (next_hop, &route.gateway);
+ route.metric = route_metric;
route.source = NM_IP_CONFIG_SOURCE_VPN;
- route.metric = vpn_routing_metric (connection);
- /* Ignore host routes to the VPN gateway since NM adds one itself
- * below. Since NM knows more about the routing situation than
- * the VPN server, we want to use the NM created route instead of
- * whatever the server provides.
+ /* Ignore host routes to the VPN gateway since NM adds one itself.
+ * Since NM knows more about the routing situation than the VPN
+ * server, we want to use the NM created route instead of whatever
+ * the server provides.
*/
- if (priv->ip6_external_gw && IN6_ARE_ADDR_EQUAL (&route.network, priv->ip6_external_gw) && route.plen == 128)
- continue;
+ if (!(priv->ip6_external_gw && IN6_ARE_ADDR_EQUAL (&route.network, priv->ip6_external_gw) && route.plen == 128))
+ nm_ip6_config_add_route (config, &route);
- /* Otherwise accept the VPN-provided route */
- nm_ip6_config_add_route (config, &route);
+next:
+ g_variant_unref (dest);
+ g_variant_unref (next_hop);
}
-
- g_slist_free_full (routes, (GDestroyNotify) nm_ip6_route_unref);
+ g_variant_iter_free (iter);
}
- val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_NEVER_DEFAULT);
- if (val && G_VALUE_HOLDS_BOOLEAN (val))
- nm_ip6_config_set_never_default (config, g_value_get_boolean (val));
+ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP6_CONFIG_NEVER_DEFAULT, "b", &b))
+ nm_ip6_config_set_never_default (config, b);
/* Merge in user overrides from the NMConnection's IPv6 setting */
nm_ip6_config_merge_setting (config,
nm_connection_get_setting_ip6_config (priv->connection),
- vpn_routing_metric (connection));
+ route_metric);
g_clear_object (&priv->ip6_config);
priv->ip6_config = config;
nm_ip6_config_export (config);
- g_object_notify (G_OBJECT (connection), NM_ACTIVE_CONNECTION_IP6_CONFIG);
- nm_vpn_connection_config_maybe_complete (connection, TRUE);
+ g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_IP6_CONFIG);
+ nm_vpn_connection_config_maybe_complete (self, TRUE);
}
static gboolean
@@ -1448,134 +1443,107 @@ connect_success (NMVpnConnection *connection)
/* 40 second timeout waiting for IP config signal from VPN service */
priv->connect_timeout = g_timeout_add_seconds (40, connect_timeout_cb, connection);
- g_hash_table_destroy (priv->connect_hash);
- priv->connect_hash = NULL;
+ g_clear_pointer (&priv->connect_hash, g_variant_unref);
}
static void
-connect_cb (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
+connect_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMVpnConnection *self = NM_VPN_CONNECTION (user_data);
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- GError *err = NULL;
+ NMVpnConnection *self;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *error = NULL;
- nm_log_info (LOGD_VPN, "VPN connection '%s' (Connect) reply received.",
- nm_connection_get_id (priv->connection));
-
- dbus_g_proxy_end_call (proxy, call, &err, G_TYPE_INVALID);
- if (!err) {
- connect_success (self);
+ reply = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return;
- }
- nm_log_warn (LOGD_VPN, "VPN connection '%s' failed to connect: '%s'.",
- nm_connection_get_id (priv->connection), err->message);
- g_error_free (err);
- _set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED, FALSE);
+ self = NM_VPN_CONNECTION (user_data);
+
+ if (error) {
+ nm_log_warn (LOGD_VPN, "VPN connection '%s' failed to connect: '%s'.",
+ nm_connection_get_id (NM_VPN_CONNECTION_GET_PRIVATE (self)->connection),
+ error->message);
+ _set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED, FALSE);
+ } else
+ connect_success (self);
}
static void
-connect_interactive_cb (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
+connect_interactive_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMVpnConnection *self = NM_VPN_CONNECTION (user_data);
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- GError *err = NULL;
+ NMVpnConnection *self;
+ NMVpnConnectionPrivate *priv;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *error = NULL;
+
+ reply = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_VPN_CONNECTION (user_data);
+ priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
nm_log_info (LOGD_VPN, "VPN connection '%s' (ConnectInteractive) reply received.",
nm_connection_get_id (priv->connection));
- dbus_g_proxy_end_call (proxy, call, &err, G_TYPE_INVALID);
- if (!err) {
- connect_success (self);
- return;
- }
+ if (g_error_matches (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED)) {
+ nm_log_dbg (LOGD_VPN, "VPN connection '%s' falling back to non-interactive connect.",
+ nm_connection_get_id (priv->connection));
- if (dbus_g_error_has_name (err, NM_DBUS_VPN_ERROR_PREFIX "." NM_DBUS_VPN_INTERACTIVE_NOT_SUPPORTED)) {
/* Fall back to Connect() */
- dbus_g_proxy_begin_call (priv->proxy, "Connect",
- connect_cb, self, NULL,
- DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, priv->connect_hash,
- G_TYPE_INVALID);
- } else {
+ g_dbus_proxy_call (priv->proxy,
+ "Connect",
+ g_variant_new ("(@a{sa{sv}})", priv->connect_hash),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->cancellable,
+ (GAsyncReadyCallback) connect_cb,
+ self);
+ } else if (error) {
nm_log_warn (LOGD_VPN, "VPN connection '%s' failed to connect interactively: '%s'.",
- nm_connection_get_id (priv->connection), err->message);
- g_error_free (err);
+ nm_connection_get_id (priv->connection), error->message);
_set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED, FALSE);
- }
+ } else
+ connect_success (self);
}
/* Add a username to a hashed connection */
-static GHashTable *
+static GVariant *
_hash_with_username (NMConnection *connection, const char *username)
{
- NMConnection *dup;
+ gs_unref_object NMConnection *dup = NULL;
NMSettingVpn *s_vpn;
- GHashTable *hash;
- GVariant *dict;
- const char *existing;
/* Shortcut if we weren't given a username or if there already was one in
* the VPN setting; don't bother duplicating the connection and everything.
*/
s_vpn = nm_connection_get_setting_vpn (connection);
g_assert (s_vpn);
- existing = nm_setting_vpn_get_user_name (s_vpn);
- if (username == NULL || existing) {
- dict = nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL);
- hash = nm_utils_connection_dict_to_hash (dict);
- g_variant_unref (dict);
- return hash;
- }
+ if (username == NULL || nm_setting_vpn_get_user_name (s_vpn))
+ return nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL);
dup = nm_simple_connection_new_clone (connection);
g_assert (dup);
s_vpn = nm_connection_get_setting_vpn (dup);
g_assert (s_vpn);
g_object_set (s_vpn, NM_SETTING_VPN_USER_NAME, username, NULL);
- dict = nm_connection_to_dbus (dup, NM_CONNECTION_SERIALIZE_ALL);
- g_object_unref (dup);
-
- hash = nm_utils_connection_dict_to_hash (dict);
- g_variant_unref (dict);
- return hash;
+ return nm_connection_to_dbus (dup, NM_CONNECTION_SERIALIZE_ALL);
}
static void
-really_activate (NMVpnConnection *connection, const char *username)
+really_activate (NMVpnConnection *self, const char *username)
{
NMVpnConnectionPrivate *priv;
- NMAgentManager *agent_mgr;
- GHashTable *details;
+ GVariantBuilder details;
- g_return_if_fail (NM_IS_VPN_CONNECTION (connection));
+ g_return_if_fail (NM_IS_VPN_CONNECTION (self));
- priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
+ priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
g_return_if_fail (priv->vpn_state == STATE_NEED_AUTH);
- dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__BOXED,
- G_TYPE_NONE, G_TYPE_VALUE, G_TYPE_INVALID);
-
- dbus_g_proxy_add_signal (priv->proxy, "Config", DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->proxy, "Config",
- G_CALLBACK (nm_vpn_connection_config_get),
- connection, NULL);
-
- /* Ip4Config signal */
- dbus_g_proxy_add_signal (priv->proxy, "Ip4Config", DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->proxy, "Ip4Config",
- G_CALLBACK (nm_vpn_connection_ip4_config_get),
- connection, NULL);
-
- /* Ip6Config signal */
- dbus_g_proxy_add_signal (priv->proxy, "Ip6Config", DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->proxy, "Ip6Config",
- G_CALLBACK (nm_vpn_connection_ip6_config_get),
- connection, NULL);
-
- if (priv->connect_hash)
- g_hash_table_destroy (priv->connect_hash);
+ g_clear_pointer (&priv->connect_hash, g_variant_unref);
priv->connect_hash = _hash_with_username (priv->connection, username);
- details = g_hash_table_new (g_str_hash, g_str_equal);
+ g_variant_ref_sink (priv->connect_hash);
/* If at least one agent doesn't support VPN hints, then we can't use
* ConnectInteractive(), because that agent won't be able to pass hints
@@ -1583,78 +1551,141 @@ really_activate (NMVpnConnection *connection, const char *username)
* dialog and we won't get the secrets we need. In this case fall back to
* the old Connect() call.
*/
- agent_mgr = nm_agent_manager_get ();
- if (nm_agent_manager_all_agents_have_capability (agent_mgr,
- nm_active_connection_get_subject (NM_ACTIVE_CONNECTION (connection)),
+ if (nm_agent_manager_all_agents_have_capability (nm_agent_manager_get (),
+ nm_active_connection_get_subject (NM_ACTIVE_CONNECTION (self)),
NM_SECRET_AGENT_CAPABILITY_VPN_HINTS)) {
nm_log_dbg (LOGD_VPN, "Allowing interactive secrets as all agents have that capability");
- dbus_g_proxy_begin_call (priv->proxy, "ConnectInteractive",
- connect_interactive_cb, connection, NULL,
- DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, priv->connect_hash,
- DBUS_TYPE_G_MAP_OF_VARIANT, details,
- G_TYPE_INVALID);
+
+ g_variant_builder_init (&details, G_VARIANT_TYPE_VARDICT);
+ g_dbus_proxy_call (priv->proxy,
+ "ConnectInteractive",
+ g_variant_new ("(@a{sa{sv}}a{sv})", priv->connect_hash, &details),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->cancellable,
+ (GAsyncReadyCallback) connect_interactive_cb,
+ self);
} else {
nm_log_dbg (LOGD_VPN, "Calling old Connect function as not all agents support interactive secrets");
- dbus_g_proxy_begin_call (priv->proxy, "Connect",
- connect_cb, connection, NULL,
- DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, priv->connect_hash,
- G_TYPE_INVALID);
+ g_dbus_proxy_call (priv->proxy,
+ "Connect",
+ g_variant_new ("(@a{sa{sv}})", priv->connect_hash),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->cancellable,
+ (GAsyncReadyCallback) connect_cb,
+ self);
}
- g_object_unref (agent_mgr);
- g_hash_table_destroy (details);
- _set_vpn_state (connection, STATE_CONNECT, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+ _set_vpn_state (self, STATE_CONNECT, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
}
-void
-nm_vpn_connection_activate (NMVpnConnection *connection)
-{
- NMVpnConnectionPrivate *priv;
- NMSettingVpn *s_vpn;
- DBusGConnection *bus;
-
- g_return_if_fail (NM_IS_VPN_CONNECTION (connection));
+#define MATCH_SIGNAL(s, n, v, t) (!strcmp (s, n) && g_variant_is_of_type (v, t))
- priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
-
- s_vpn = nm_connection_get_setting_vpn (priv->connection);
- g_assert (s_vpn);
- priv->connection_can_persist = nm_setting_vpn_get_persistent (s_vpn);
+static void
+signal_cb (GDBusProxy *proxy,
+ const gchar *sender,
+ const gchar *signal,
+ GVariant *args,
+ gpointer user_data)
+{
+ NMVpnConnection *self = NM_VPN_CONNECTION (user_data);
+ NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
+ const char *message, **secrets;
+ gs_unref_variant GVariant *dict = NULL;
+ guint u32;
+
+ if (MATCH_SIGNAL (signal, "Failure", args, G_VARIANT_TYPE ("(u)"))) {
+ g_variant_get (args, "(u)", &u32);
+ plugin_failed (self, u32);
+ } else if (MATCH_SIGNAL (signal, "StateChanged", args, G_VARIANT_TYPE ("(u)"))) {
+ g_variant_get (args, "(u)", &u32);
+ plugin_state_changed (self, u32);
+ } else if (MATCH_SIGNAL (signal, "SecretsRequired", args, G_VARIANT_TYPE ("(sas)"))) {
+ g_variant_get (args, "(&s^a&s)", &message, &secrets);
+ plugin_interactive_secrets_required (self, message, secrets);
+ g_free (secrets);
+ } else if (priv->vpn_state >= STATE_NEED_AUTH) {
+ /* Only list to these signals during and after connection */
+ if (MATCH_SIGNAL (signal, "Config", args, G_VARIANT_TYPE ("(a{sv})"))) {
+ g_variant_get (args, "(@a{sv})", &dict);
+ nm_vpn_connection_config_get (self, dict);
+ } else if (MATCH_SIGNAL (signal, "Ip4Config", args, G_VARIANT_TYPE ("(a{sv})"))) {
+ g_variant_get (args, "(@a{sv})", &dict);
+ nm_vpn_connection_ip4_config_get (self, dict);
+ } else if (MATCH_SIGNAL (signal, "Ip6Config", args, G_VARIANT_TYPE ("(a{sv})"))) {
+ g_variant_get (args, "(@a{sv})", &dict);
+ nm_vpn_connection_ip6_config_get (self, dict);
+ }
+ }
+}
- _set_vpn_state (connection, STATE_PREPARE, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+static void
+on_proxy_acquired (GObject *object, GAsyncResult *result, gpointer user_data)
+{
+ NMVpnConnection *self;
+ NMVpnConnectionPrivate *priv;
+ gs_free_error GError *error = NULL;
+ GDBusProxy *proxy;
- bus = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
- priv->proxy = dbus_g_proxy_new_for_name (bus,
- nm_vpn_connection_get_service (connection),
- NM_VPN_DBUS_PLUGIN_PATH,
- NM_VPN_DBUS_PLUGIN_INTERFACE);
+ proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
- dbus_g_proxy_add_signal (priv->proxy, "Failure", G_TYPE_UINT, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->proxy, "Failure",
- G_CALLBACK (plugin_failed),
- connection, NULL);
+ self = NM_VPN_CONNECTION (user_data);
+ priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- /* StateChanged signal */
- dbus_g_proxy_add_signal (priv->proxy, "StateChanged", G_TYPE_UINT, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->proxy, "StateChanged",
- G_CALLBACK (plugin_state_changed),
- connection, NULL);
+ if (error) {
+ nm_log_err (LOGD_VPN, "(%s/%s) failed to acquire dbus proxy for VPN service: %s",
+ nm_connection_get_uuid (priv->connection),
+ nm_connection_get_id (priv->connection),
+ error->message);
+ _set_vpn_state (self,
+ STATE_FAILED,
+ NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED,
+ FALSE);
+ return;
+ }
- dbus_g_object_register_marshaller (g_cclosure_marshal_generic,
- G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRV, G_TYPE_INVALID);
- dbus_g_proxy_add_signal (priv->proxy, "SecretsRequired", G_TYPE_STRING, G_TYPE_STRV, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->proxy, "SecretsRequired",
- G_CALLBACK (plugin_interactive_secrets_required),
- connection, NULL);
+ priv->proxy = proxy;
+ g_signal_connect (priv->proxy, "g-signal", G_CALLBACK (signal_cb), self);
- _set_vpn_state (connection, STATE_NEED_AUTH, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+ _set_vpn_state (self, STATE_NEED_AUTH, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
/* Kick off the secrets requests; first we get existing system secrets
* and ask the plugin if these are sufficient, next we get all existing
* secrets from system and from user agents and ask the plugin again,
* and last we ask the user for new secrets if required.
*/
- get_secrets (connection, SECRETS_REQ_SYSTEM, NULL);
+ get_secrets (self, SECRETS_REQ_SYSTEM, NULL);
+}
+
+void
+nm_vpn_connection_activate (NMVpnConnection *self)
+{
+ NMVpnConnectionPrivate *priv;
+ NMSettingVpn *s_vpn;
+
+ g_return_if_fail (NM_IS_VPN_CONNECTION (self));
+
+ priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
+
+ s_vpn = nm_connection_get_setting_vpn (priv->connection);
+ g_assert (s_vpn);
+ priv->connection_can_persist = nm_setting_vpn_get_persistent (s_vpn);
+
+ _set_vpn_state (self, STATE_PREPARE, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+
+ priv->cancellable = g_cancellable_new ();
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
+ NULL,
+ nm_vpn_connection_get_service (self),
+ NM_VPN_DBUS_PLUGIN_PATH,
+ NM_VPN_DBUS_PLUGIN_INTERFACE,
+ priv->cancellable,
+ (GAsyncReadyCallback) on_proxy_acquired,
+ self);
}
NMConnection *
@@ -1665,6 +1696,17 @@ nm_vpn_connection_get_connection (NMVpnConnection *connection)
return NM_VPN_CONNECTION_GET_PRIVATE (connection)->connection;
}
+const char*
+nm_vpn_connection_get_connection_id (NMVpnConnection *connection)
+{
+ NMConnection *c;
+
+ g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL);
+
+ c = NM_VPN_CONNECTION_GET_PRIVATE (connection)->connection;
+ return c ? nm_connection_get_id (c) : NULL;
+}
+
NMVpnConnectionState
nm_vpn_connection_get_vpn_state (NMVpnConnection *connection)
{
@@ -1760,16 +1802,21 @@ nm_vpn_connection_deactivate (NMVpnConnection *connection,
/******************************************************************************/
static void
-plugin_need_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
+plugin_need_secrets_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMVpnConnection *self = NM_VPN_CONNECTION (user_data);
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- GError *error = NULL;
- char *setting_name;
+ NMVpnConnection *self;
+ NMVpnConnectionPrivate *priv;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *error = NULL;
+ const char *setting_name;
+
+ reply = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_VPN_CONNECTION (user_data);
+ priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- dbus_g_proxy_end_call (proxy, call, &error,
- G_TYPE_STRING, &setting_name,
- G_TYPE_INVALID);
if (error) {
nm_log_err (LOGD_VPN, "(%s/%s) plugin NeedSecrets request #%d failed: %s %s",
nm_connection_get_uuid (priv->connection),
@@ -1778,54 +1825,58 @@ plugin_need_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, void *user_dat
g_quark_to_string (error->domain),
error->message);
_set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS, FALSE);
- g_error_free (error);
return;
}
- if (setting_name && strlen (setting_name)) {
- /* More secrets required */
+ g_variant_get (reply, "(&s)", &setting_name);
+ if (!strlen (setting_name)) {
+ nm_log_dbg (LOGD_VPN, "(%s/%s) service indicated no additional secrets required",
+ nm_connection_get_uuid (priv->connection),
+ nm_connection_get_id (priv->connection));
- if (priv->secrets_idx == SECRETS_REQ_NEW) {
- nm_log_err (LOGD_VPN, "(%s/%s) final secrets request failed to provide sufficient secrets",
- nm_connection_get_uuid (priv->connection),
- nm_connection_get_id (priv->connection));
- _set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS, FALSE);
- } else {
- nm_log_dbg (LOGD_VPN, "(%s/%s) service indicated additional secrets required",
- nm_connection_get_uuid (priv->connection),
- nm_connection_get_id (priv->connection));
-
- get_secrets (self, priv->secrets_idx + 1, NULL);
- }
+ /* No secrets required; we can start the VPN */
+ really_activate (self, priv->username);
return;
}
- nm_log_dbg (LOGD_VPN, "(%s/%s) service indicated no additional secrets required",
- nm_connection_get_uuid (priv->connection),
- nm_connection_get_id (priv->connection));
-
- /* No secrets required; we can start the VPN */
- really_activate (self, priv->username);
+ /* More secrets required */
+ if (priv->secrets_idx == SECRETS_REQ_NEW) {
+ nm_log_err (LOGD_VPN, "(%s/%s) final secrets request failed to provide sufficient secrets",
+ nm_connection_get_uuid (priv->connection),
+ nm_connection_get_id (priv->connection));
+ _set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS, FALSE);
+ } else {
+ nm_log_dbg (LOGD_VPN, "(%s/%s) service indicated additional secrets required",
+ nm_connection_get_uuid (priv->connection),
+ nm_connection_get_id (priv->connection));
+ get_secrets (self, priv->secrets_idx + 1, NULL);
+ }
}
static void
-plugin_new_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
+plugin_new_secrets_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
{
- NMVpnConnection *self = NM_VPN_CONNECTION (user_data);
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- GError *error = NULL;
+ NMVpnConnection *self;
+ NMVpnConnectionPrivate *priv;
+ gs_unref_variant GVariant *reply = NULL;
+ gs_free_error GError *error = NULL;
- if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) {
- _set_vpn_state (self, STATE_CONNECT, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
- } else {
+ reply = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ self = NM_VPN_CONNECTION (user_data);
+ priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
+
+ if (error) {
nm_log_err (LOGD_VPN, "(%s/%s) sending new secrets to the plugin failed: %s %s",
nm_connection_get_uuid (priv->connection),
nm_connection_get_id (priv->connection),
g_quark_to_string (error->domain),
error->message);
_set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS, FALSE);
- g_error_free (error);
- }
+ } else
+ _set_vpn_state (self, STATE_CONNECT, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
}
static void
@@ -1838,7 +1889,7 @@ get_secrets_cb (NMSettingsConnection *connection,
{
NMVpnConnection *self = NM_VPN_CONNECTION (user_data);
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
- GHashTable *hash;
+ GVariant *dict;
g_return_if_fail (NM_CONNECTION (connection) == priv->connection);
g_return_if_fail (call_id == priv->secrets_id);
@@ -1849,38 +1900,45 @@ get_secrets_cb (NMSettingsConnection *connection,
nm_log_err (LOGD_VPN, "Failed to request VPN secrets #%d: (%d) %s",
priv->secrets_idx + 1, error->code, error->message);
_set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS, FALSE);
- } else {
- /* Cache the username for later */
- if (agent_username) {
- g_free (priv->username);
- priv->username = g_strdup (agent_username);
- }
-
- hash = _hash_with_username (priv->connection, priv->username);
+ return;
+ }
- if (priv->secrets_idx == SECRETS_REQ_INTERACTIVE) {
- nm_log_dbg (LOGD_VPN, "(%s/%s) sending secrets to the plugin",
- nm_connection_get_uuid (priv->connection),
- nm_connection_get_id (priv->connection));
+ /* Cache the username for later */
+ if (agent_username) {
+ g_free (priv->username);
+ priv->username = g_strdup (agent_username);
+ }
- /* Send the secrets back to the plugin */
- dbus_g_proxy_begin_call (priv->proxy, "NewSecrets",
- plugin_new_secrets_cb, self, NULL,
- DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, hash,
- G_TYPE_INVALID);
- } else {
- nm_log_dbg (LOGD_VPN, "(%s/%s) asking service if additional secrets are required",
- nm_connection_get_uuid (priv->connection),
- nm_connection_get_id (priv->connection));
-
- /* Ask the VPN service if more secrets are required */
- dbus_g_proxy_begin_call (priv->proxy, "NeedSecrets",
- plugin_need_secrets_cb, self, NULL,
- DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, hash,
- G_TYPE_INVALID);
- }
+ dict = _hash_with_username (priv->connection, priv->username);
- g_hash_table_destroy (hash);
+ if (priv->secrets_idx == SECRETS_REQ_INTERACTIVE) {
+ nm_log_dbg (LOGD_VPN, "(%s/%s) sending secrets to the plugin",
+ nm_connection_get_uuid (priv->connection),
+ nm_connection_get_id (priv->connection));
+
+ /* Send the secrets back to the plugin */
+ g_dbus_proxy_call (priv->proxy,
+ "NewSecrets",
+ g_variant_new ("(@a{sa{sv}})", dict),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->cancellable,
+ (GAsyncReadyCallback) plugin_new_secrets_cb,
+ self);
+ } else {
+ nm_log_dbg (LOGD_VPN, "(%s/%s) asking service if additional secrets are required",
+ nm_connection_get_uuid (priv->connection),
+ nm_connection_get_id (priv->connection));
+
+ /* Ask the VPN service if more secrets are required */
+ g_dbus_proxy_call (priv->proxy,
+ "NeedSecrets",
+ g_variant_new ("(@a{sa{sv}})", dict),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->cancellable,
+ (GAsyncReadyCallback) plugin_need_secrets_cb,
+ self);
}
}
@@ -1938,13 +1996,11 @@ get_secrets (NMVpnConnection *self,
}
static void
-plugin_interactive_secrets_required (DBusGProxy *proxy,
+plugin_interactive_secrets_required (NMVpnConnection *self,
const char *message,
- const char **secrets,
- gpointer user_data)
+ const char **secrets)
{
- NMVpnConnection *connection = NM_VPN_CONNECTION (user_data);
- NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
+ NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
guint32 secrets_len = secrets ? g_strv_length ((char **) secrets) : 0;
char **hints;
guint32 i;
@@ -1956,7 +2012,7 @@ plugin_interactive_secrets_required (DBusGProxy *proxy,
priv->vpn_state == STATE_NEED_AUTH);
priv->secrets_idx = SECRETS_REQ_INTERACTIVE;
- _set_vpn_state (connection, STATE_NEED_AUTH, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+ _set_vpn_state (self, STATE_NEED_AUTH, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
/* Copy hints and add message to the end */
hints = g_malloc0 (sizeof (char *) * (secrets_len + 2));
@@ -1965,7 +2021,7 @@ plugin_interactive_secrets_required (DBusGProxy *proxy,
if (message)
hints[i] = g_strdup_printf ("x-vpn-message:%s", message);
- get_secrets (connection, SECRETS_REQ_INTERACTIVE, (const char **) hints);
+ get_secrets (self, SECRETS_REQ_INTERACTIVE, (const char **) hints);
g_strfreev (hints);
}
@@ -2029,10 +2085,7 @@ dispose (GObject *object)
{
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object);
- if (priv->connect_hash) {
- g_hash_table_destroy (priv->connect_hash);
- priv->connect_hash = NULL;
- }
+ g_clear_pointer (&priv->connect_hash, g_variant_unref);
if (priv->connect_timeout) {
g_source_remove (priv->connect_timeout);
@@ -2047,6 +2100,10 @@ dispose (GObject *object)
priv->secrets_id = 0;
}
+ if (priv->cancellable) {
+ g_cancellable_cancel (priv->cancellable);
+ g_clear_object (&priv->cancellable);
+ }
g_clear_object (&priv->ip4_config);
g_clear_object (&priv->ip6_config);
g_clear_object (&priv->proxy);
@@ -2077,7 +2134,7 @@ ip_config_valid (VpnState state)
static void
get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
+ GValue *value, GParamSpec *pspec)
{
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object);
NMDevice *parent_dev;
diff --git a/src/vpn-manager/nm-vpn-connection.h b/src/vpn-manager/nm-vpn-connection.h
index 74ea38a5db..0e63caac3f 100644
--- a/src/vpn-manager/nm-vpn-connection.h
+++ b/src/vpn-manager/nm-vpn-connection.h
@@ -46,9 +46,12 @@
#define NM_VPN_CONNECTION_INTERNAL_RETRY_AFTER_FAILURE "internal-retry-after-failure"
-typedef struct {
+#define NM_VPN_ROUTE_METRIC_DEFAULT 50
+
+
+struct _NMVpnConnection {
NMActiveConnection parent;
-} NMVpnConnection;
+};
typedef struct {
NMActiveConnectionClass parent;
@@ -76,6 +79,7 @@ NMVpnConnection * nm_vpn_connection_new (NMConnection *connection,
void nm_vpn_connection_activate (NMVpnConnection *connection);
NMConnection * nm_vpn_connection_get_connection (NMVpnConnection *connection);
+const char* nm_vpn_connection_get_connection_id (NMVpnConnection *connection);
NMVpnConnectionState nm_vpn_connection_get_vpn_state (NMVpnConnection *connection);
const char * nm_vpn_connection_get_banner (NMVpnConnection *connection);
@@ -93,4 +97,7 @@ int nm_vpn_connection_get_ip_ifindex (NMVpnConnection *connect
guint32 nm_vpn_connection_get_ip4_internal_gateway (NMVpnConnection *connection);
struct in6_addr * nm_vpn_connection_get_ip6_internal_gateway (NMVpnConnection *connection);
+guint32 nm_vpn_connection_get_ip4_route_metric (NMVpnConnection *connection);
+guint32 nm_vpn_connection_get_ip6_route_metric (NMVpnConnection *connection);
+
#endif /* __NETWORKMANAGER_VPN_CONNECTION_H__ */
diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c
index 7daa8cec96..1de9b753f3 100644
--- a/src/vpn-manager/nm-vpn-manager.c
+++ b/src/vpn-manager/nm-vpn-manager.c
@@ -19,6 +19,8 @@
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
+#include "config.h"
+
#include <string.h>
#include <gio/gio.h>
@@ -198,19 +200,7 @@ vpn_dir_changed (GFileMonitor *monitor,
/******************************************************************************/
-NMVpnManager *
-nm_vpn_manager_get (void)
-{
- static NMVpnManager *singleton = NULL;
-
- if (!singleton)
- singleton = NM_VPN_MANAGER (g_object_new (NM_TYPE_VPN_MANAGER, NULL));
- else
- g_object_ref (singleton);
-
- g_assert (singleton);
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMVpnManager, nm_vpn_manager_get, NM_TYPE_VPN_MANAGER);
static void
nm_vpn_manager_init (NMVpnManager *self)
diff --git a/src/vpn-manager/nm-vpn-service.c b/src/vpn-manager/nm-vpn-service.c
index 142644a2d0..77220dd2ea 100644
--- a/src/vpn-manager/nm-vpn-service.c
+++ b/src/vpn-manager/nm-vpn-service.c
@@ -19,7 +19,8 @@
* Copyright (C) 2005 - 2008 Novell, Inc.
*/
-#include <config.h>
+#include "config.h"
+
#include <glib.h>
#include <string.h>
#include <sys/types.h>
@@ -30,7 +31,6 @@
#include "nm-vpn-service.h"
#include "nm-dbus-manager.h"
#include "nm-logging.h"
-#include "nm-posix-signals.h"
#include "nm-vpn-manager.h"
#include "nm-glib-compat.h"
@@ -53,7 +53,7 @@ typedef struct {
#define VPN_CONNECTION_GROUP "VPN Connection"
-static gboolean start_pending_vpn (NMVpnService *self);
+static gboolean start_pending_vpn (NMVpnService *self, GError **error);
NMVpnService *
nm_vpn_service_new (const char *namefile, GError **error)
@@ -129,7 +129,7 @@ connection_vpn_state_changed (NMVpnConnection *connection,
g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_vpn_state_changed), self);
if (connection == priv->active) {
priv->active = NULL;
- start_pending_vpn (self);
+ start_pending_vpn (self, NULL);
} else
priv->pending = g_slist_remove (priv->pending, connection);
g_object_unref (connection);
@@ -166,20 +166,6 @@ nm_vpn_service_stop_connections (NMVpnService *service,
g_clear_pointer (&priv->pending, g_slist_free);
}
-static void
-_daemon_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-
- /*
- * We blocked signals in main(). We need to restore original signal
- * mask for VPN service here so that it can receive signals.
- */
- nm_unblock_posix_signals (NULL);
-}
-
static gboolean
_daemon_exec_timeout (gpointer data)
{
@@ -206,7 +192,7 @@ nm_vpn_service_daemon_exec (NMVpnService *service, GError **error)
vpn_argv[0] = priv->program;
vpn_argv[1] = NULL;
- success = g_spawn_async (NULL, vpn_argv, NULL, 0, _daemon_setup, NULL, &pid, &spawn_error);
+ success = g_spawn_async (NULL, vpn_argv, NULL, 0, nm_utils_setpgid, NULL, &pid, &spawn_error);
if (success) {
nm_log_info (LOGD_VPN, "VPN service '%s' started (%s), PID %ld",
priv->name, priv->dbus_service, (long int) pid);
@@ -252,7 +238,7 @@ start_active_vpn (NMVpnService *self, GError **error)
}
static gboolean
-start_pending_vpn (NMVpnService *self)
+start_pending_vpn (NMVpnService *self, GError **error)
{
NMVpnServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self);
@@ -265,7 +251,7 @@ start_pending_vpn (NMVpnService *self)
priv->active = g_slist_nth_data (priv->pending, 0);
priv->pending = g_slist_remove (priv->pending, priv->active);
- return start_active_vpn (self, NULL);
+ return start_active_vpn (self, error);
}
gboolean
@@ -299,7 +285,7 @@ nm_vpn_service_activate (NMVpnService *service,
}
/* Otherwise start the next VPN */
- return start_pending_vpn (service);
+ return start_pending_vpn (service, error);
}
static void
diff --git a/tools/check-exports.sh b/tools/check-exports.sh
index b5a9e952b5..dfd882c15b 100755
--- a/tools/check-exports.sh
+++ b/tools/check-exports.sh
@@ -4,22 +4,53 @@ LC_ALL=C
export LC_ALL
stat=0
-so=$1
-def=$2
+so="$1"
+def="$2"
+PATTERN="_ANCHOR_"
-# Have to prefix with a tab and suffix with a ';' to match .ver file format
-get_syms='nm "$so" | grep "^[[:xdigit:]]\+ T " | sed "s/^[[:xdigit:]]\+ T //" | sed "s/^/\t/" | sed "s/$/;/"'
+TMPFILE="$(mktemp .nm-check-exports.XXXXXX)"
-echo $so: checking exported symbols against $def
-{
- echo "{"
- echo "global:"
- eval $get_syms | sort -u
- echo "local:"
- echo " *;"
- echo "};"
-} | diff -u "$def" - >&2 || stat=1
+get_syms() {
+ nm "$1" |
+ sed -n 's/^[[:xdigit:]]\+ [DT] //p' |
+ sort
+}
+get_syms_from_def() {
+ # be strict and only parse entries that start with one \t and end with a ';'
+ sed -n 's/^\t\([_a-zA-Z0-9]\+\);$/\1/p' "$1" |
+ grep '^\*$' -v |
+ sort
+}
+
+anchor() {
+ sed "s/.*/$PATTERN\0$PATTERN/"
+}
+
+unanchor() {
+ sed "s/^$PATTERN\(.*\)$PATTERN\$/\1/"
+}
+
+
+get_syms "$so" | anchor > "$TMPFILE"
+WRONG="$(get_syms_from_def "$def" | anchor | grep -F -f - "$TMPFILE" -v)"
+RESULT=$?
+if [ $RESULT -eq 0 ]; then
+ stat=1
+ echo ">>library \"$so\" exports symbols that are not in linker script \"$def\":"
+ echo "$WRONG" | unanchor | nl
+fi
+
+get_syms_from_def "$def" | anchor > "$TMPFILE"
+WRONG="$(get_syms "$so" | anchor | grep -F -f - "$TMPFILE" -v)"
+RESULT=$?
+if [ $RESULT -eq 0 ]; then
+ stat=1
+ echo ">>linker script \"$def\" contains symbols that are not exported by library \"$so\":"
+ echo "$WRONG" | unanchor | nl
+fi
+
+rm -rf "$TMPFILE"
exit $stat
diff --git a/tools/run-test-valgrind.sh b/tools/run-test-valgrind.sh
index 506fff75c4..200a27d13c 100755
--- a/tools/run-test-valgrind.sh
+++ b/tools/run-test-valgrind.sh
@@ -3,8 +3,21 @@
LIBTOOL="$1"; shift
VALGRIND="$1"; shift
SUPPRESSIONS="$1"; shift
+if [ "$1" = "--launch-dbus" ]; then
+ # Spawn DBus if there's none
+ if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
+ eval `dbus-launch --sh-syntax`
+ trap "kill $DBUS_SESSION_BUS_PID" EXIT
+ fi
+ shift
+fi
TEST="$1"; shift
+if [ "$NMTST_NO_VALGRIND" != "" ]; then
+ "$TEST"
+ exit $?
+fi
+
LOGFILE="valgrind-`echo "$TEST" | tr -cd '[:alpha:]-'`.log"
export G_SLICE=always-malloc
@@ -19,7 +32,12 @@ $LIBTOOL --mode=execute "$VALGRIND" \
"$TEST"
RESULT=$?
-if [ $RESULT -ne 0 ]; then
+if [ $RESULT -eq 0 -a "$(wc -c "$LOGFILE" | awk '{print$1}')" -ne 0 ]; then
+ echo "valgrind succeeded, but log is not empty: $LOGFILE"
+ exit 1
+fi
+
+if [ $RESULT -ne 0 -a $RESULT -ne 77 ]; then
echo "Don't forget to check the valgrind log at '`realpath $LOGFILE`'." >&2
fi
diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py
index 564533895d..50803c8871 100755
--- a/tools/test-networkmanager-service.py
+++ b/tools/test-networkmanager-service.py
@@ -74,7 +74,7 @@ class UnknownPropertyException(dbus.DBusException):
def to_path_array(src):
array = dbus.Array([], signature=dbus.Signature('o'))
for o in src:
- array.append(o.path)
+ array.append(to_path(o))
return array
def to_path(src):
@@ -312,7 +312,7 @@ class WifiAp(ExportedObj):
props[PP_FLAGS] = dbus.UInt32(self.flags)
props[PP_WPA_FLAGS] = dbus.UInt32(self.wpaf)
props[PP_RSN_FLAGS] = dbus.UInt32(self.rsnf)
- props[PP_SSID] = dbus.ByteArray(self.ssid)
+ props[PP_SSID] = dbus.ByteArray(self.ssid.encode('utf-8'))
props[PP_FREQUENCY] = dbus.UInt32(self.freq)
props[PP_HW_ADDRESS] = self.bssid
props[PP_MODE] = dbus.UInt32(2) # NM_802_11_MODE_INFRA
@@ -356,11 +356,7 @@ class WifiDevice(Device):
@dbus.service.method(dbus_interface=IFACE_WIFI, in_signature='', out_signature='ao')
def GetAccessPoints(self):
# only include non-hidden APs
- array = []
- for a in self.aps:
- if a.ssid():
- array.append(a)
- return to_path_array(array)
+ return to_path_array([a for a in self.aps if a.ssid])
@dbus.service.method(dbus_interface=IFACE_WIFI, in_signature='', out_signature='ao')
def GetAllAccessPoints(self):
@@ -414,7 +410,7 @@ class WifiDevice(Device):
def add_test_ap(self, ssid, mac):
ap = WifiAp(self._bus, ssid, mac, 0x1, 0x1cc, 0x1cc, 2412)
self.add_ap(ap)
- return ap.path
+ return ap
def remove_ap_by_path(self, path):
for ap in self.aps:
@@ -546,7 +542,7 @@ class WimaxDevice(Device):
def add_test_nsp(self, name):
nsp = WimaxNsp(self._bus, name)
self.add_nsp(nsp)
- return nsp.path
+ return nsp
def remove_nsp_by_path(self, path):
for nsp in self.nsps:
@@ -685,7 +681,7 @@ class NetworkManager(ExportedObj):
for d in self.devices:
# ignore iface/ip_iface distinction for now
if d.iface == ip_iface:
- return d.path
+ return to_path(d)
raise UnknownDeviceException("No device found for the requested iface.")
@dbus.service.method(dbus_interface=IFACE_NM, in_signature='ooo', out_signature='o')
@@ -849,7 +845,7 @@ class NetworkManager(ExportedObj):
raise PermissionDeniedException("Device already added")
dev = WiredDevice(self._bus, ifname)
self.add_device(dev)
- return dbus.ObjectPath(dev.path)
+ return to_path(dev)
@dbus.service.method(IFACE_TEST, in_signature='s', out_signature='o')
def AddWifiDevice(self, ifname):
@@ -858,7 +854,7 @@ class NetworkManager(ExportedObj):
raise PermissionDeniedException("Device already added")
dev = WifiDevice(self._bus, ifname)
self.add_device(dev)
- return dbus.ObjectPath(dev.path)
+ return to_path(dev)
@dbus.service.method(IFACE_TEST, in_signature='s', out_signature='o')
def AddWimaxDevice(self, ifname):
@@ -867,7 +863,7 @@ class NetworkManager(ExportedObj):
raise PermissionDeniedException("Device already added")
dev = WimaxDevice(self._bus, ifname)
self.add_device(dev)
- return dbus.ObjectPath(dev.path)
+ return to_path(dev)
@dbus.service.method(IFACE_TEST, in_signature='o', out_signature='')
def RemoveDevice(self, path):
@@ -881,7 +877,7 @@ class NetworkManager(ExportedObj):
def AddWifiAp(self, ifname, ssid, mac):
for d in self.devices:
if d.iface == ifname:
- return dbus.ObjectPath(d.add_test_ap(ssid, mac))
+ return to_path(d.add_test_ap(ssid, mac))
raise UnknownDeviceException("Device not found")
@dbus.service.method(IFACE_TEST, in_signature='so', out_signature='')
@@ -896,7 +892,7 @@ class NetworkManager(ExportedObj):
def AddWimaxNsp(self, ifname, name):
for d in self.devices:
if d.iface == ifname:
- return dbus.ObjectPath(d.add_test_nsp(name))
+ return to_path(d.add_test_nsp(name))
raise UnknownDeviceException("Device not found")
@dbus.service.method(IFACE_TEST, in_signature='so', out_signature='')
diff --git a/valgrind.suppressions b/valgrind.suppressions
index c418b4b617..6a101cc011 100644
--- a/valgrind.suppressions
+++ b/valgrind.suppressions
@@ -129,3 +129,253 @@
match-leak-kinds: possible
fun:calloc
}
+
+
+{
+ _glib_sigaction
+ Memcheck:Param
+ rt_sigaction(act->sa_flags)
+ fun:__libc_sigaction
+ fun:unref_unix_signal_handler_unlocked
+ fun:g_child_watch_finalize
+ fun:g_source_unref_internal
+ fun:g_main_context_dispatch
+ ...
+ fun:g_main_loop_run
+ ...
+}
+
+{
+ # FIXME: dunny why this is needed. Clean up later.
+ _dispatcher_test
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:g_malloc
+ fun:g_slice_alloc
+ fun:g_variant_new_from_bytes
+ fun:g_variant_new_from_trusted
+ fun:parse_dhcp
+ fun:get_dispatcher_file
+ ...
+ fun:g_test_run_suite_internal
+ fun:g_test_run_suite_internal
+ fun:g_test_run_suite
+}
+
+{
+ _gdbus_1
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:g_malloc
+ fun:g_slice_alloc
+ fun:g_slice_alloc0
+ fun:get_dispatch
+ fun:g_main_context_dispatch
+ ...
+ fun:g_main_loop_run
+ fun:gdbus_shared_thread_func
+ fun:g_thread_proxy
+ fun:start_thread
+ fun:clone
+}
+
+{
+ _gdbus_2
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:g_malloc
+ fun:g_slice_alloc
+ fun:g_slice_alloc0
+ fun:g_main_context_push_thread_default
+ fun:gdbus_shared_thread_func
+ fun:g_thread_proxy
+ fun:start_thread
+ fun:clone
+}
+
+{
+ _gdbus_3
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:calloc
+ fun:g_malloc0
+ fun:_g_socket_read_with_control_messages
+ fun:_g_dbus_worker_do_read_unlocked
+ fun:_g_dbus_worker_do_read_cb
+ fun:g_simple_async_result_complete
+ fun:complete_in_idle_cb
+ ...
+ fun:g_main_context_dispatch
+ ...
+ fun:g_main_loop_run
+ fun:gdbus_shared_thread_func
+ fun:g_thread_proxy
+}
+
+{
+ _gdbus_4
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:calloc
+ fun:g_malloc0
+ ...
+ fun:g_slice_alloc
+ fun:g_slice_alloc0
+ fun:g_main_context_push_thread_default
+ fun:gdbus_shared_thread_func
+ fun:g_thread_proxy
+ fun:start_thread
+ fun:clone
+}
+
+{
+ _gdbus_5
+ Memcheck:Leak
+ match-leak-kinds: definite
+ ...
+ fun:g_dbus_message_new_from_blob
+ ...
+}
+
+{
+ _gdbus_9
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:g_malloc
+ fun:g_slice_alloc
+ fun:g_slice_alloc0
+ fun:get_dispatch
+ fun:g_main_current_source
+ fun:g_task_return
+ fun:g_task_thread_pool_thread
+ fun:g_thread_pool_thread_proxy
+ fun:g_thread_proxy
+ fun:start_thread
+ fun:clone
+}
+
+{
+ _gdbus_10
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:g_malloc
+ fun:g_slice_alloc
+ fun:g_slice_alloc0
+ fun:g_system_thread_new
+ fun:g_thread_new_internal
+ ...
+ fun:g_thread_pool_push
+ fun:g_task_start_task_thread
+ fun:g_task_run_in_thread
+ fun:g_async_initable_real_init_async
+ fun:g_bus_get
+}
+
+{
+ _gdbus_11
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:calloc
+ fun:g_malloc0
+ ...
+ fun:g_slice_alloc
+ fun:g_slice_alloc0
+ fun:get_dispatch
+ fun:g_main_current_source
+ fun:g_task_return
+ fun:g_task_thread_pool_thread
+ fun:g_thread_pool_thread_proxy
+ fun:g_thread_proxy
+ fun:start_thread
+}
+
+{
+ _gdbus_12
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:g_malloc
+ fun:g_slice_alloc
+ fun:g_error_new_valist
+ fun:g_error_new
+ fun:g_dbus_error_new_for_dbus_error
+ fun:g_dbus_error_set_dbus_error
+ fun:g_dbus_message_to_gerror
+ fun:decode_method_reply
+ fun:g_dbus_connection_call_sync_internal
+ fun:g_dbus_proxy_call_sync_internal
+ fun:g_dbus_proxy_call_sync
+}
+
+{
+ _gdbus_15
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:g_malloc
+ fun:g_slice_alloc
+ fun:g_hash_table_new_full
+ fun:demarshal_map
+ fun:_dbus_gvalue_demarshal
+ fun:dbus_g_proxy_end_call_internal
+ fun:dbus_g_proxy_end_call
+ fun:get_permissions_reply
+ fun:complete_pending_call_and_unlock
+ fun:dbus_connection_dispatch
+ fun:message_queue_dispatch
+}
+
+{
+ _gdbus_16
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:calloc
+ fun:g_malloc0
+ fun:_g_dbus_worker_send_message
+ fun:g_dbus_connection_send_message_unlocked
+ fun:unsubscribe_id_internal
+ fun:g_dbus_connection_signal_unsubscribe
+ fun:g_dbus_proxy_finalize
+ ...
+}
+
+{
+ _gdbus_17
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:calloc
+ fun:g_malloc0
+ fun:thread_memory_from_self
+ fun:g_slice_alloc
+ fun:g_slice_alloc0
+ fun:g_main_context_push_thread_default
+ fun:gdbus_shared_thread_func
+ fun:g_thread_proxy
+ fun:start_thread
+ fun:clone
+}
+
+{
+ _gdbus_18
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:g_malloc
+ fun:g_slice_alloc
+ fun:g_slice_alloc0
+ fun:get_dispatch
+ fun:g_main_dispatch
+ fun:g_main_context_dispatch
+ ...
+ fun:g_main_loop_run
+ fun:gdbus_shared_thread_func
+ fun:g_thread_proxy
+ fun:start_thread
+ fun:clone
+}
+
diff --git a/vapi/NMClient-1.0.metadata b/vapi/NMClient-1.0.metadata
index 2d894d8eb3..b8a022f6b7 100644
--- a/vapi/NMClient-1.0.metadata
+++ b/vapi/NMClient-1.0.metadata
@@ -9,13 +9,16 @@ ACCESS_POINT_* cheader_filename="nm-access-point.h" name="ACCESS_POINT
DEVICE_* cheader_filename="nm-device.h" name="DEVICE_(.+)" parent="NM.Device"
DEVICE_ADSL_* cheader_filename="nm-device-adsl.h" name="DEVICE_ADSL_(.+)" parent="NM.DeviceAdsl"
DEVICE_BOND_* cheader_filename="nm-device-bond.h" name="DEVICE_BOND_(.+)" parent="NM.DeviceBond"
+DEVICE_BRIDGE_* cheader_filename="nm-device-bridge.h" name="DEVICE_BRIDGE_(.+)" parent="NM.DeviceBridge"
DEVICE_BT_* cheader_filename="nm-device-bt.h" name="DEVICE_BT_(.+)" parent="NM.DeviceBt"
DEVICE_ETHERNET_* cheader_filename="nm-device-ethernet.h" name="DEVICE_ETHERNET_(.+)" parent="NM.DeviceEthernet"
+DEVICE_GENERIC_* cheader_filename="nm-device-generic.h" name="DEVICE_GENERIC_(.+)" parent="NM.DeviceGeneric"
DEVICE_INFINIBAND_* cheader_filename="nm-device-infiniband.h" name="DEVICE_INFINIBAND_(.+)" parent="NM.DeviceInfiniband"
DEVICE_MODEM_* cheader_filename="nm-device-modem.h" name="DEVICE_MODEM_(.+)" parent="NM.DeviceModem"
DEVICE_OLPC_MESH_* cheader_filename="nm-device-olpc-mesh.h" name="DEVICE_OLPC_(.+)" parent="NM.DeviceOlpcMesh"
+DEVICE_TEAM_* cheader_filename="nm-device-team.h" name="DEVICE_TEAM_(.+)" parent="NM.DeviceTeam"
DEVICE_VLAN_* cheader_filename="nm-device-vlan.h" name="DEVICE_VLAN_(.+)" parent="NM.DeviceVlan"
DEVICE_WIFI_* cheader_filename="nm-device-wifi.h" name="DEVICE_WIFI_(.+)" parent="NM.DeviceWifi"
DEVICE_WIMAX_* cheader_filename="nm-device-wimax.h" name="DEVICE_WIMAX_(.+)" parent="NM.DeviceWimax"
@@ -38,11 +41,14 @@ DHCP6Config cheader_filename="nm-dhcp6-config.h"
Device cheader_filename="nm-device.h"
DeviceAdsl cheader_filename="nm-device-adsl.h"
DeviceBond cheader_filename="nm-device-bond.h"
+DeviceBridge cheader_filename="nm-device-bridge.h"
DeviceBt cheader_filename="nm-device-bt.h"
DeviceEthernet cheader_filename="nm-device-ethernet.h"
+DeviceGeneric cheader_filename="nm-device-generic.h"
DeviceInfiniband cheader_filename="nm-device-infiniband.h"
DeviceModem cheader_filename="nm-device-modem.h"
DeviceOlpcMesh cheader_filename="nm-device-olpc-mesh.h"
+DeviceTeam cheader_filename="nm-device-team.h"
DeviceVlan cheader_filename="nm-device-vlan.h"
DeviceWifi cheader_filename="nm-device-wifi.h"
DeviceWimax cheader_filename="nm-device-wimax.h"
@@ -65,11 +71,14 @@ ClientPermission cheader_filename="nm-client.h"
ClientPermissionResult cheader_filename="nm-client.h"
DeviceAdslError cheader_filename="nm-device-adsl.h"
DeviceBondError cheader_filename="nm-device-bond.h"
+DeviceBridgeError cheader_filename="nm-device-bridge.h"
DeviceBtError cheader_filename="nm-device-bt.h"
DeviceEthernetError cheader_filename="nm-device-ethernet.h"
+DeviceGenericError cheader_filename="nm-device-generic.h"
DeviceInfinibandError cheader_filename="nm-device-infiniband.h"
DeviceModemError cheader_filename="nm-device-modem.h"
DeviceOlpcMeshError cheader_filename="nm-device-olpc-mesh.h"
+DeviceTeamError cheader_filename="nm-device-team.h"
DeviceVlanError cheader_filename="nm-device-vlan.h"
DeviceWifiError cheader_filename="nm-device-wifi.h"
DeviceWimaxError cheader_filename="nm-device-wimax.h"
@@ -93,11 +102,14 @@ SecretAgentSaveSecretsFunc cheader_filename="nm-secret-agent.h"
device_adsl_error_quark cheader_filename="nm-device-adsl.h" parent="NM.DeviceAdslError" name="device_adsl_error_(.+)"
device_bond_error_quark cheader_filename="nm-device-bond.h" parent="NM.DeviceBondError" name="device_bond_error_(.+)"
+device_bridge_error_quark cheader_filename="nm-device-bridge.h" parent="NM.DeviceBridgeError" name="device_bridge_error_(.+)"
device_bt_error_quark cheader_filename="nm-device-bt.h" parent="NM.DeviceBtError" name="device_bt_error_(.+)"
device_ethernet_error_quark cheader_filename="nm-device-ethernet.h" parent="NM.DeviceEthernetError" name="device_ethernet_error_(.+)"
+device_generic_error_quark cheader_filename="nm-device-generic.h" parent="NM.DeviceGenericError" name="device_generic_error_(.+)"
device_infiniband_error_quark cheader_filename="nm-device-infiniband.h" parent="NM.DeviceInfinibandError" name="device_infiniband_error_(.+)"
device_modem_error_quark cheader_filename="nm-device-modem.h" parent="NM.DeviceModemError" name="device_modem_error_(.+)"
device_olpc_mesh_error_quark cheader_filename="nm-device-olpc-mesh.h" parent="NM.DeviceOlpcMeshError" name="device_olpc_mesh_error_(.+)"
+device_team_error_quark cheader_filename="nm-device-team.h" parent="NM.DeviceTeamError" name="device_team_error(.+)"
device_vlan_error_quark cheader_filename="nm-device-vlan.h" parent="NM.DeviceVlanError" name="device_vlan_error(.+)"
device_wifi_error_quark cheader_filename="nm-device-wifi.h" parent="NM.DeviceWifiError" name="device_wifi_error_(.+)"
device_wimax_error_quark cheader_filename="nm-device-wimax.h" parent="NM.DeviceWimaxError" name="device_wimax_error_(.+)"
diff --git a/vapi/NetworkManager-1.0.metadata b/vapi/NetworkManager-1.0.metadata
index d757828fd3..e568f6ddbb 100644
--- a/vapi/NetworkManager-1.0.metadata
+++ b/vapi/NetworkManager-1.0.metadata
@@ -10,8 +10,10 @@ Setting8021x cheader_filename="nm-setting-8021x.h"
SettingAdsl cheader_filename="nm-setting-adsl.h"
SettingBluetooth cheader_filename="nm-setting-bluetooth.h"
SettingBond cheader_filename="nm-setting-bond.h"
+SettingBridge cheader_filename="nm-setting-bridge.h"
SettingCdma cheader_filename="nm-setting-cdma.h"
SettingConnection cheader_filename="nm-setting-connection.h"
+SettingGeneric cheader_filename="nm-setting-generic.h"
SettingGsm cheader_filename="nm-setting-gsm.h"
SettingIP4Config cheader_filename="nm-setting-ip4-config.h"
SettingIP6Config cheader_filename="nm-setting-ip6-config.h"
@@ -21,6 +23,7 @@ SettingPPP cheader_filename="nm-setting-ppp.h"
SettingPPPOE cheader_filename="nm-setting-pppoe.h"
SettingSerial cheader_filename="nm-setting-serial.h"
SettingVPN cheader_filename="nm-setting-vpn.h"
+SettingTeam cheader_filename="nm-setting-team.h"
SettingVlan cheader_filename="nm-setting-vlan.h"
SettingWimax cheader_filename="nm-setting-wimax.h"
SettingWired cheader_filename="nm-setting-wired.h"
@@ -47,11 +50,13 @@ Setting8021xError cheader_filename="nm-setting-8021x.h"
SettingAdslError cheader_filename="nm-setting-adsl.h"
SettingBluetoothError cheader_filename="nm-setting-bluetooth.h"
SettingBondError cheader_filename="nm-setting-bond.h"
+SettingBridgeError cheader_filename="nm-setting-bridge.h"
SettingCdmaError cheader_filename="nm-setting-cdma.h"
SettingCompareFlags cheader_filename="nm-setting.h"
SettingConnectionError cheader_filename="nm-setting-connection.h"
SettingDiffResult cheader_filename="nm-setting.h"
SettingError cheader_filename="nm-setting.h"
+SettingGenericError cheader_filename="nm-setting-generic.h"
SettingGsmError cheader_filename="nm-setting-gsm.h"
SettingGsmNetworkBand cheader_filename="nm-setting-gsm.h"
SettingGsmNetworkType cheader_filename="nm-setting-gsm.h"
@@ -65,6 +70,7 @@ SettingPPPError cheader_filename="nm-setting-ppp.h"
SettingPPPOEError cheader_filename="nm-setting-pppoe.h"
SettingSecretFlags cheader_filename="nm-setting.h"
SettingSerialError cheader_filename="nm-setting-serial.h"
+SettingTeamError cheader_filename="nm-setting-team.h"
SettingVlanError cheader_filename="nm-setting-vlan.h"
SettingVpnError cheader_filename="nm-setting-vpn.h"
SettingWimaxError cheader_filename="nm-setting-wimax.h"
@@ -103,8 +109,10 @@ SETTING_802_1X_* parent="NM.Setting8021x" name="SETTING_802_1X_(.+)"
SETTING_ADSL_* parent="NM.SettingAdsl" cheader_filename="nm-setting-adsl.h" name="SETTING_ADSL_(.+)"
SETTING_BLUETOOTH_* parent="NM.SettingBluetooth" cheader_filename="nm-setting-bluetooth.h" name="SETTING_BLUETOOTH_(.+)"
SETTING_BOND_* parent="NM.SettingBond" cheader_filename="nm-setting-bond.h" name="SETTING_BOND_(.+)"
+SETTING_BRIDGE_* parent="NM.SettingBridge" cheader_filename="nm-setting-bridge.h" name="SETTING_BRIDGE_(.+)"
SETTING_CDMA_* parent="NM.SettingCdma" cheader_filename="nm-setting-cdma.h" name="SETTING_CDMA_(.+)"
SETTING_CONNECTION_* parent="NM.SettingConnection" cheader_filename="nm-setting-connection.h" name="SETTING_CONNECTION_(.+)"
+SETTING_GENERIC_* parent="NM.SettingGeneric" cheader_filename="nm-setting-generic.h" name="SETTING_GENERIC_(.+)"
SETTING_GSM_* parent="NM.SettingGsm" cheader_filename="nm-setting-gsm.h" name="SETTING_GSM_(.+)"
SETTING_INFINIBAND_* parent="NM.SettingInfiniband" cheader_filename="nm-setting-infiniband.h" name="SETTING_INFINIBAND_(.+)"
SETTING_IP4_* parent="NM.SettingIP4" cheader_filename="nm-setting-ip4-config.h" name="SETTING_IP4_(.+)"
@@ -113,6 +121,7 @@ SETTING_OLPC_* parent="NM.SettingOLPC" cheader_filename="nm-setting-
SETTING_PPP_* parent="NM.SettingPPP" cheader_filename="nm-setting-ppp.h" name="SETTING_PPP_(.+)"
SETTING_PPPOE_* parent="NM.SettingPPPOE" cheader_filename="nm-setting-pppoe.h" name="SETTING_PPPOE_(.+)"
SETTING_SERIAL_* parent="NM.SettingSerial" cheader_filename="nm-setting-serial.h" name="SETTING_SERIAL_(.+)"
+SETTING_TEAM_* parent="NM.SettingTeam" cheader_filename="nm-setting-team.h" name="SETTING_TEAM_(.+)"
SETTING_VLAN_* parent="NM.SettingVlan" cheader_filename="nm-setting-vlan.h" name="SETTING_VLAN_(.+)"
SETTING_VPN_* parent="NM.SettingVpn" cheader_filename="nm-setting-vpn.h" name="SETTING_VPN_(.+)"
SETTING_WIMAX_* parent="NM.SettingWimax" cheader_filename="nm-setting-wimax.h" name="SETTING_WIMAX_(.+)"
@@ -128,9 +137,11 @@ setting_802_1x_error_quark cheader_filename="nm-setting-8021x.h" name="
setting_adsl_error_quark cheader_filename="nm-setting-adsl.h" name="setting_adsl_error_(.+)" parent="NM.SettingAdslError"
setting_bluetooth_error_quark cheader_filename="nm-setting-bluetooth.h" name="setting_bluetooth_error_(.+)" parent="NM.SettingBluetoothError"
setting_bond_error_quark cheader_filename="nm-setting-bond.h" name="setting_bond_error_(.+)" parent="NM.SettingBondError"
+setting_bridge_error_quark cheader_filename="nm-setting-bridge.h" name="setting_bridge_error_(.+)" parent="NM.SettingBridgeError"
setting_cdma_error_quark cheader_filename="nm-setting-cdma.h" name="setting_cdma_error_(.+)" parent="NM.SettingCdmaError"
setting_connection_error_quark cheader_filename="nm-setting-connection.h" name="setting_connection_error_(.+)" parent="NM.SettingConnectionError"
setting_error_quark cheader_filename="nm-setting.h" name="setting_error_(.+)" parent="NM.SettingError"
+setting_generic_error_quark cheader_filename="nm-setting-generic.h" name="setting_generic_error_(.+)" parent="NM.SettingGenericError"
setting_gsm_error_quark cheader_filename="nm-setting-gsm.h" name="setting_gsm_error_(.+)" parent="NM.SettingGsmError"
setting_infiniband_error_quark cheader_filename="nm-setting-infiniband.h" name="setting_infiniband_error_(.+)" parent="NM.SettingInfinibandError"
setting_ip4_config_error_quark cheader_filename="nm-setting-ip4-config.h" name="setting_ip4_config_error_(.+)" parent="NM.SettingIP4ConfigError"
@@ -139,6 +150,7 @@ setting_olpc_mesh_error_quark cheader_filename="nm-setting-olpc-mesh.h" name="
setting_ppp_error_quark cheader_filename="nm-setting-ppp.h" name="setting_ppp_error_(.+)" parent="NM.SettingPPPError"
setting_pppoe_error_quark cheader_filename="nm-setting-pppoe.h" name="setting_pppoe_error_(.+)" parent="NM.SettingPPPOEError"
setting_serial_error_quark cheader_filename="nm-setting-serial.h" name="setting_serial_error_(.+)" parent="NM.SettingSerialError"
+setting_team_error_quark cheader_filename="nm-setting-team.h" name="setting_team_error_(.+)" parent="NM.SettingTeamError"
setting_vlan_error_quark cheader_filename="nm-setting-vlan.h" name="setting_vlan_error_(.+)" parent="NM.SettingVlanError"
setting_vpn_error_quark cheader_filename="nm-setting-vpn.h" name="setting_vpn_error_(.+)" parent="NM.SettingVpnError"
setting_wimax_error_quark cheader_filename="nm-setting-wimax.h" name="setting_wimax_error_(.+)" parent="NM.SettingWimaxError"